Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
javawlp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
impresshs
javawlp
Commits
dc5b0b80
Commit
dc5b0b80
authored
8 years ago
by
koen
Browse files
Options
Downloads
Patches
Plain Diff
wlp on arrayAccess now recurses correctly
parent
79bc4dbf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
WLP.hs
+6
-4
6 additions, 4 deletions
WLP.hs
with
6 additions
and
4 deletions
WLP.hs
+
6
−
4
View file @
dc5b0b80
...
...
@@ -165,7 +165,9 @@ wlpExpAlgebra = (fLit, fClassLit, fThis, fThisClass, fInstanceCreation, fQualIns
else
let
varId
=
getReturnVar
invocation
callWlp
=
wlp'
(
inh
{
acc
=
id
,
calls
=
incrCallCount
(
calls
inh
)
(
invocationToId
invocation
),
ret
=
Just
varId
,
object
=
getObject
inh
invocation
})
(
inlineMethod
inh
invocation
)
in
(
ExpName
(
Name
[
varId
]),
(
callWlp
.
acc
inh
))
fArrayAccess
(
ArrayIndex
a
i
)
inh
=
(
arrayAccess
a
i
,
snd
((
foldExp
wlpExpAlgebra
a
)
inh
{
acc
=
id
})
.
arrayAccessWlp
a
i
inh
)
fArrayAccess
(
ArrayIndex
a
i
)
inh
=
let
(
a'
,
atrans
)
=
foldExp
wlpExpAlgebra
a
inh
{
acc
=
id
}
i'
=
map
(
flip
(
foldExp
wlpExpAlgebra
)
inh
{
acc
=
id
})
i
in
(
arrayAccess
a'
(
map
fst
i'
),
foldl
(
.
)
atrans
(
map
snd
i'
)
.
arrayAccessWlp
a'
(
map
fst
i'
)
inh
)
fExpName
name
inh
=
(
editName
inh
name
,
acc
inh
)
-- x++ increments x but evaluates to the original value
...
...
@@ -175,7 +177,7 @@ wlpExpAlgebra = (fLit, fClassLit, fThis, fThisClass, fInstanceCreation, fQualIns
exp
->
(
exp
,
trans
)
fPostDecrement
e
inh
=
let
(
e'
,
trans
)
=
e
inh
in
case
e'
of
var
@
(
ExpName
name
)
->
(
var
,
substVar
(
env
inh
)
(
decls
inh
)
(
NameLhs
name
)
(
BinOp
var
Rem
(
Lit
(
Int
1
)))
.
trans
)
var
@
(
ExpName
name
)
->
(
var
,
substVar
(
env
inh
)
(
decls
inh
)
(
NameLhs
name
)
(
BinOp
var
Sub
(
Lit
(
Int
1
)))
.
trans
)
exp
->
(
exp
,
trans
)
-- ++x increments x and evaluates to the new value of x
fPreIncrement
e
inh
=
let
(
e'
,
trans
)
=
e
inh
in
...
...
@@ -184,8 +186,8 @@ wlpExpAlgebra = (fLit, fClassLit, fThis, fThisClass, fInstanceCreation, fQualIns
exp
->
(
BinOp
exp
Add
(
Lit
(
Int
1
)),
trans
)
fPreDecrement
e
inh
=
let
(
e'
,
trans
)
=
e
inh
in
case
e'
of
var
@
(
ExpName
name
)
->
(
BinOp
var
Rem
(
Lit
(
Int
1
)),
substVar
(
env
inh
)
(
decls
inh
)
(
NameLhs
name
)
(
BinOp
var
Rem
(
Lit
(
Int
1
)))
.
trans
)
exp
->
(
BinOp
exp
Rem
(
Lit
(
Int
1
)),
trans
)
var
@
(
ExpName
name
)
->
(
BinOp
var
Sub
(
Lit
(
Int
1
)),
substVar
(
env
inh
)
(
decls
inh
)
(
NameLhs
name
)
(
BinOp
var
Sub
(
Lit
(
Int
1
)))
.
trans
)
exp
->
(
BinOp
exp
Sub
(
Lit
(
Int
1
)),
trans
)
fPrePlus
e
inh
=
let
(
e'
,
trans
)
=
e
inh
in
(
e'
,
trans
)
fPreMinus
e
inh
=
let
(
e'
,
trans
)
=
e
inh
in
(
PreMinus
e'
,
trans
)
fPreBitCompl
e
inh
=
let
(
e'
,
trans
)
=
e
inh
in
(
PreBitCompl
e'
,
trans
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment