Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
i7
peregrine
Commits
e3bce867
Commit
e3bce867
authored
Nov 28, 2017
by
Stefan Jaax
Browse files
Fix bug in construction of arcs
parent
36ab546f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Parser/PP.hs
View file @
e3bce867
...
...
@@ -165,7 +165,7 @@ data RecordPP = RecordPP {
initialStates
::
[
String
],
trueStates
::
[
String
],
predicate
::
Maybe
(
QuantFormula
String
),
description
::
Maybe
String
description
::
Maybe
String
}
deriving
(
Show
)
$
(
deriveJSON
defaultOptions
''RecordTransition
)
...
...
@@ -173,11 +173,10 @@ $(deriveJSON defaultOptions ''RecordPP)
recordPP2PopulationProtocol
::
RecordPP
->
PopulationProtocol
recordPP2PopulationProtocol
r
=
makePopulationProtocolFromStrings
(
title
r
)
(
states
r
)
(
map
name
(
transitions
r
))
(
initialStates
r
)
(
trueStates
r
)
falseStates
p
arcs
where
makePopulationProtocolFromStrings
(
title
r
)
(
states
r
)
(
map
name
(
transitions
r
))
(
initialStates
r
)
(
trueStates
r
)
falseStates
p
arcs
where
falseStates
=
[
q
|
q
<-
states
r
,
not
(
S
.
member
q
(
S
.
fromList
(
trueStates
r
)))]
count
=
\
x
->
fromIntegral
.
length
.
(
filter
(
==
x
))
arcs
=
[(
q
,
name
t
,
(
count
q
)
(
pre
t
))
|
t
<-
transitions
r
,
q
<-
pre
t
]
++
[(
name
t
,
q
,
(
count
q
)
(
post
t
))
|
t
<-
transitions
r
,
q
<-
post
t
]
arcs
=
[(
q
,
name
t
,
1
)
|
t
<-
transitions
r
,
q
<-
pre
t
]
++
[(
name
t
,
q
,
1
)
|
t
<-
transitions
r
,
q
<-
post
t
]
p
=
case
predicate
r
of
Nothing
->
ExQuantFormula
[]
FTrue
(
Just
p'
)
->
p'
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment