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
0a1e68f5
Commit
0a1e68f5
authored
7 years ago
by
ISWB Prasetya
Browse files
Options
Downloads
Patches
Plain Diff
adding few more variations of API-wlp
parent
47b9f3fc
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
src/Javawlp/API.hs
+23
-2
23 additions, 2 deletions
src/Javawlp/API.hs
with
23 additions
and
2 deletions
src/Javawlp/API.hs
+
23
−
2
View file @
0a1e68f5
...
...
@@ -52,17 +52,38 @@ wlpMethod conf env decls methodName postCondition = do
-- Calculate the wlp:
return
$
wlpWithEnv
conf
decls
env'
methodBody
postCondition
-- | A variant of wlpMethod where we can specify a list of post-conditions.
-- It returns a list of pairs (p,q) where q is a post-condition and p is the
-- calcuated wlp of q.
wlpMethod_
::
WLPConf
->
TypeEnv
->
[
TypeDecl
]
->
Ident
->
[
Exp
]
->
IO
[(
Exp
,
Exp
)]
wlpMethod_
conf
env
decls
methodName
postconds
=
sequence
[
wlp
q
|
q
<-
postconds
]
where
wlp
q
=
do
p
<-
wlpMethod
conf
env
decls
methodName
q
return
(
p
,
q
)
-- | Calculates the wlps of a list of methods
wlpMethods
::
WLPConf
->
TypeEnv
->
[
TypeDecl
]
->
[(
Ident
,
Exp
)]
->
IO
[(
Ident
,
Exp
)]
wlpMethods
conf
env
decls
methods_and_postconds
=
sequence
$
map
(
\
(
mname
,
p
cond
)
->
do
{
q
<-
wlpMethod
conf
env
decls
mname
p
cond
;
return
(
mname
,
q
)
})
methods'
sequence
$
map
(
\
(
mname
,
p
ostc
)
->
do
{
p
<-
wlpMethod
conf
env
decls
mname
p
ostc
;
return
(
mname
,
p
)
})
methods'
where
methods'
=
if
ignoreMainMethod
conf
then
filter
(
\
(
mname
,
_
)
->
mname
/=
Ident
"main"
)
methods_and_postconds
else
methods_and_postconds
-- | Variation of wlpMethods that takes a list of (m,postconditions)
wlpMethods_
::
WLPConf
->
TypeEnv
->
[
TypeDecl
]
->
[(
Ident
,[
Exp
])]
->
IO
[(
Ident
,
[(
Exp
,
Exp
)])]
wlpMethods_
conf
env
decls
methods_and_postconds
=
sequence
$
map
(
\
(
mname
,
postcs
)
->
do
{
ps
<-
wlpMethod_
conf
env
decls
mname
postcs
;
return
(
mname
,
ps
)
})
methods'
where
methods'
=
if
ignoreMainMethod
conf
then
filter
(
\
(
mname
,
_
)
->
mname
/=
Ident
"main"
)
methods_and_postconds
else
methods_and_postconds
defaultConf
::
WLPConf
defaultConf
=
WLPConf
{
...
...
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