Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
i7
peregrine
Commits
bd4481dc
Commit
bd4481dc
authored
May 07, 2014
by
Philipp Meyer
Browse files
Added non-negativity constraints
parent
44774004
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Solver.hs
View file @
bd4481dc
...
...
@@ -39,6 +39,12 @@ evaluateFormula m (p :|: q) = do
r2
<-
evaluateFormula
m
q
return
$
r1
|||
r2
checkNonnegativityConstraints
::
Model
->
PetriNet
->
Symbolic
SBool
checkNonnegativityConstraints
m
net
=
do
pts
<-
mapM
checkPT
$
places
net
++
transitions
net
return
$
bAnd
pts
where
checkPT
x
=
return
$
(
m
M
.!
x
)
.>=
0
checkPlaceEquation
::
Model
->
PetriNet
->
String
->
Symbolic
SBool
checkPlaceEquation
m
net
p
=
do
incoming
<-
mapM
addTransition
$
lpre
net
p
...
...
@@ -76,8 +82,9 @@ checkConstraints net p = do
r1
<-
case
ptype
p
of
Safety
->
checkStateConstraints
model
net
Liveness
->
checkTInvariantConstraints
model
net
r2
<-
evaluateFormula
model
(
pformula
p
)
return
$
r1
&&&
r2
r2
<-
checkNonnegativityConstraints
model
net
r3
<-
evaluateFormula
model
(
pformula
p
)
return
$
r1
&&&
r2
&&&
r3
checkSat
::
PetriNet
->
Property
->
IO
(
Maybe
(
M
.
Map
String
Integer
))
checkSat
net
p
=
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment