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
c06c711e
Commit
c06c711e
authored
Jul 09, 2014
by
Philipp Meyer
Browse files
Reverted to no-deadlock-out-of option
parent
87fc04dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Main.hs
View file @
c06c711e
...
...
@@ -23,8 +23,9 @@ import Solver.SComponent
data
InputFormat
=
PNET
|
LOLA
|
TPN
deriving
(
Show
,
Read
)
-- TODO: Change NoDeadlockOutOf to NoDeadlockUnless=FILE
data
ImplicitProperty
=
Termination
|
NoDeadlock
|
NoDeadlock
UnlessFinal
|
NoDeadlock
|
NoDeadlock
OutOf
String
|
Safe
|
Bounded
Integer
deriving
(
Show
,
Read
)
...
...
@@ -71,11 +72,12 @@ options =
}))
"Prove that there is no deadlock"
,
Option
""
[
"no-deadlock-unless-final"
]
(
NoArg
(
\
opt
->
Right
opt
{
optProperties
=
NoDeadlockUnlessFinal
:
optProperties
opt
}))
"Prove that there is no deadlock unless a final place is marked"
,
Option
""
[
"no-deadlock-out-of"
]
(
ReqArg
(
\
arg
opt
->
Right
opt
{
optProperties
=
NoDeadlockOutOf
arg
:
optProperties
opt
})
"PLACE"
)
"Prove that there is no deadlock unless PLACE is marked"
,
Option
""
[
"safe"
]
(
NoArg
(
\
opt
->
Right
opt
{
...
...
@@ -135,7 +137,6 @@ checkFile parser verbosity refine implicitProperties file = do
"Places: "
++
show
(
length
$
places
net
)
++
"
\n
"
++
"Transitions: "
++
show
(
length
$
transitions
net
)
let
addedProperties
=
map
(
makeImplicitProperty
net
)
implicitProperties
print
addedProperties
rs
<-
mapM
(
checkProperty
verbosity
net
refine
)
(
addedProperties
++
properties
)
verbosePut
verbosity
0
""
...
...
@@ -151,14 +152,9 @@ makeImplicitProperty net NoDeadlock =
foldl
(
:&:
)
FTrue
(
map
(
foldl
(
:|:
)
FFalse
.
map
(
placeOp
Lt
)
.
lpre
net
)
(
transitions
net
))
makeImplicitProperty
net
NoDeadlockUnlessFinal
=
let
finals
=
[
p
|
p
<-
places
net
,
null
(
lpost
net
p
)
]
in
if
null
finals
then
error
"no final place!"
else
if
length
finals
>
1
then
error
(
"more than one final place: "
++
show
finals
)
else
Property
"no deadlock unless final"
Safety
$
foldl
(
:&:
)
FTrue
(
map
(
\
p
->
placeOp
Lt
(
p
,
1
))
finals
)
:&:
pformula
(
makeImplicitProperty
net
NoDeadlock
)
makeImplicitProperty
net
(
NoDeadlockOutOf
pl
)
=
Property
(
"no deadlock out of "
++
pl
)
Safety
$
placeOp
Lt
(
pl
,
1
)
:&:
pformula
(
makeImplicitProperty
net
NoDeadlock
)
makeImplicitProperty
net
(
Bounded
k
)
=
Property
(
show
k
++
"-bounded"
)
Safety
$
foldl
(
:|:
)
FFalse
...
...
@@ -266,4 +262,4 @@ exitFailureWith msg = do
exitErrorWith
::
String
->
IO
()
exitErrorWith
msg
=
do
hPutStrLn
stderr
msg
exitWith
$
ExitFailure
r
exitWith
$
ExitFailure
3
Write
Preview
Supports
Markdown
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