Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NIWO
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christian Müller
NIWO
Commits
0cd77329
Commit
0cd77329
authored
Apr 04, 2017
by
Christian Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add target to wf spec file
parent
47d29a28
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
223 additions
and
103 deletions
+223
-103
aalta/Aalta_v2.0/main.cpp
aalta/Aalta_v2.0/main.cpp
+3
-0
cnf.dimacs
cnf.dimacs
+37
-10
examples/easychair.spec
examples/easychair.spec
+6
-1
examples/easychair3NoOracle.spec
examples/easychair3NoOracle.spec
+6
-1
examples/easychairNoOracle.spec
examples/easychairNoOracle.spec
+6
-1
examples/linear3.spec
examples/linear3.spec
+9
-0
examples/linear4.spec
examples/linear4.spec
+6
-0
examples/prevexample.spec
examples/prevexample.spec
+7
-1
examples/prevexampleNoOracle.spec
examples/prevexampleNoOracle.spec
+6
-0
examples/simpleChoice.spec
examples/simpleChoice.spec
+8
-0
examples/simpleChoice.wf
examples/simpleChoice.wf
+0
-2
examples/simpleChoiceNoOracle.spec
examples/simpleChoiceNoOracle.spec
+6
-1
examples/simpleNoChoice.spec
examples/simpleNoChoice.spec
+8
-0
examples/simpleNoChoice.wf
examples/simpleNoChoice.wf
+0
-2
src/main/scala/de/tum/workflows/ExampleWorkflows.scala
src/main/scala/de/tum/workflows/ExampleWorkflows.scala
+8
-27
src/main/scala/de/tum/workflows/Main.scala
src/main/scala/de/tum/workflows/Main.scala
+3
-3
src/main/scala/de/tum/workflows/Utils.scala
src/main/scala/de/tum/workflows/Utils.scala
+6
-0
src/main/scala/de/tum/workflows/WorkflowParser.scala
src/main/scala/de/tum/workflows/WorkflowParser.scala
+9
-5
src/main/scala/de/tum/workflows/foltl/Properties.scala
src/main/scala/de/tum/workflows/foltl/Properties.scala
+3
-4
src/test/scala/de/tum/workflows/ltl/tests/EncodingTest.scala
src/test/scala/de/tum/workflows/ltl/tests/EncodingTest.scala
+2
-2
src/test/scala/de/tum/workflows/ltl/tests/ParserTest.scala
src/test/scala/de/tum/workflows/ltl/tests/ParserTest.scala
+84
-43
No files found.
aalta/Aalta_v2.0/main.cpp
View file @
0cd77329
...
...
@@ -27,8 +27,11 @@ nondeter_sat (int argc, char** argv)
}
aalta_formula
*
af
;
printf
(
"Simplifying ..."
);
af
=
aalta_formula
(
in
).
unique
();
af
=
af
->
simplify
();
printf
(
"Checking satisfiability..."
);
nondeter_checker
ch
(
af
);
...
...
cnf.dimacs
View file @
0cd77329
p cnf 15 17
5 0
-5 6 0
-5 7 0
-6 -1 -2 0
p cnf 35 44
7 0
-7 8 0
-7 9 0
-8 -1 -
3
0
-8 -1 -
2
0
-9 10 0
-9 11 0
-10 -1 -
4
0
-10 -1 -
3
0
-11 12 0
-11 13 0
-12 -
2 -3
0
-12 -
4 -1
0
-13 14 0
-13 15 0
-14 -2 -4 0
-15 -3 -4 0
-14 -4 -5 0
-15 16 0
-15 17 0
-16 -4 -2 0
-17 18 0
-17 19 0
-18 -4 -3 0
-19 20 0
-19 21 0
-20 -1 -5 0
-21 22 0
-21 23 0
-22 -2 -3 0
-23 24 0
-23 25 0
-24 -6 -5 0
-25 26 0
-25 27 0
-26 -6 -3 0
-27 28 0
-27 29 0
-28 -5 -3 0
-29 30 0
-29 31 0
-30 -6 -2 0
-31 32 0
-31 33 0
-32 -5 -2 0
-33 34 0
-33 35 0
-34 -6 -1 0
-35 -6 -4 0
examples/easychair.
wf
→
examples/easychair.
spec
View file @
0cd77329
Workflow
forallmay x,p
True -> Conf += (x,p)
forallmay x,p
...
...
@@ -5,7 +7,10 @@ forallmay x,p
forallmay x,p,r
(Ass(x,p) ∧ O(x,p,r)) -> Review += (x,p,r)
loop {
forall x
,y,p,r (A(x,p) ∧ Review(y,p,r)) -> Read += (x,y
,p,r)
forall x
a,xb,p,r (A(x1,p) ∧ Review(xb,p,r)) -> Read += (xa,xb
,p,r)
forall x,p,r (A(x,p) ∧ O(x,p,r)) -> Review += (x,p,r)
}
Target
(Conf(x,p) ∧ Read(xa, xb, p, r))
examples/easychair3NoOracle.
wf
→
examples/easychair3NoOracle.
spec
View file @
0cd77329
Workflow
forallmay x,p
True -> Conf += (x,p)
forallmay x,p
...
...
@@ -5,7 +7,10 @@ forallmay x,p
forallmay x,p
(Ass(x,p) ∧ O(x,p)) -> Acc += (x,p)
loop {
forall x
,y,p (A(x,p) ∧ Acc(y,p)) -> Read += (x,y
,p)
forall x
a,xb,p (A(xa,p) ∧ Acc(xb,p)) -> Acc += (xa,xb
,p)
forall x,p (A(x,p) ∧ O(x,p,r)) -> Acc += (x,p)
}
Target
(Conf(xa, p) ∧ Acc(xa,xb,p))
examples/easychairNoOracle.
wf
→
examples/easychairNoOracle.
spec
View file @
0cd77329
Workflow
forallmay x,p
True -> Conf += (x,p)
forallmay x,p
...
...
@@ -5,7 +7,10 @@ forallmay x,p
forallmay x,p,r
Ass(x,p) -> Review += (x,p,r)
loop {
forall x
,y,p,r (A(x,p) ∧ Review(y,p,r)) -> Read += (x,y
,p,r)
forall x
a,xb,p,r (A(xa,p) ∧ Review(xb,p,r)) -> Read += (xa,xb
,p,r)
forall x,p,r (A(x,p) ∧ O(x,p,r)) -> Review += (x,p,r)
}
Target
(Conf(xa,p) ∧ Read(xa,xb,p,r))
\ No newline at end of file
examples/linear3.spec
0 → 100644
View file @
0cd77329
Workflow
forallmay i True -> R += (i)
forallmay i,j (R(i) ∧ R(j)) -> S += (i,j)
forallmay i,j,k (S(i,j,k) ∧ S(i,j,k)) -> T += (i,j,k)
Target
T(x,y,z)
examples/linear
.wf
→
examples/linear
4.spec
View file @
0cd77329
Workflow
forallmay i True -> R += (i)
forallmay i,j (R(i) ∧ R(j)) -> S += (i,j)
forallmay i,j,k (S(i,j,k) ∧ S(i,j,k)) -> T += (i,j,k)
forallmay i,j,k,l (T(i,j,k) ∧ T(j,k,l)) -> U += (i,j,k,l)
Target
U(u,v,w,x)
\ No newline at end of file
examples/prevexample.
wf
→
examples/prevexample.
spec
View file @
0cd77329
Workflow
forallmay x,s O(s) -> Q += (x,s)
loop {
forall x,y,s R(y,s) -> S += (x,y,s)
forall x,s Q(x,s) -> R += (x,s)
}
\ No newline at end of file
}
Target
S(x,y,s)
examples/prevexampleNoOracle.
wf
→
examples/prevexampleNoOracle.
spec
View file @
0cd77329
Workflow
forallmay x,s True -> Q += (x,s)
loop {
forall x,y,s R(y,s) → S += (x,y,s)
forall x,s Q(x,s) → R += (x,s)
}
Target
S(x,y,s)
examples/simpleChoice.spec
0 → 100644
View file @
0cd77329
Workflow
forallmay x,s
O(s) -> R += (x,s)
Target
R(x,s)
\ No newline at end of file
examples/simpleChoice.wf
deleted
100644 → 0
View file @
47d29a28
forallmay x,s
O(s) -> R += (x,s)
\ No newline at end of file
examples/simpleChoiceNoOracle.
wf
→
examples/simpleChoiceNoOracle.
spec
View file @
0cd77329
Workflow
forallmay x,s
True -> R += (x,s)
\ No newline at end of file
Target
R(x,s)
examples/simpleNoChoice.spec
0 → 100644
View file @
0cd77329
Workflow
forall x,s
O(s) -> R += (x,s)
Target
R(x,s)
\ No newline at end of file
examples/simpleNoChoice.wf
deleted
100644 → 0
View file @
47d29a28
forall x,s
O(s) -> R += (x,s)
\ No newline at end of file
src/main/scala/de/tum/workflows/ExampleWorkflows.scala
View file @
0cd77329
...
...
@@ -10,38 +10,19 @@ import com.typesafe.scalalogging.LazyLogging
object
ExampleWorkflows
extends
LazyLogging
{
val
folder
=
new
File
(
"examples"
)
val
FOLDER
=
new
File
(
"examples"
)
val
ENDING
=
".spec"
val
examples
=
(
for
(
f
<-
folder
.
listFiles
()
if
f
.
isFile
()
&&
f
.
getName
.
endsWith
(
".wf"
))
yield
{
val
examples
=
(
for
(
f
<-
FOLDER
.
listFiles
()
if
f
.
isFile
()
&&
f
.
getName
.
endsWith
(
".wf"
))
yield
{
val
s
=
Source
.
fromFile
(
f
).
mkString
val
wf
=
WorkflowParser
.
parseWorkflow
(
s
)
val
spec
=
WorkflowParser
.
parseSpec
(
s
)
if
(!
wf
.
successful
)
{
logger
.
error
(
s
"Parsing of $f unsuccessful: $
wf
"
)
if
(!
spec
.
successful
)
{
logger
.
error
(
s
"Parsing of $f unsuccessful: $
spec
"
)
}
// drop file ending
val
name
=
f
.
getName
.
replace
(
".wf"
,
""
)
name
->
wf
.
get
val
name
=
f
.
getName
.
replace
(
ENDING
,
""
)
name
->
(
spec
.
get
.
_1
,
spec
.
get
.
_2
)
})
toMap
val
targets
=
Map
(
// stubborn: counterexample (S is copied from R and Q)
"prevexample"
->
Fun
(
"S"
,
List
(
"x"
,
"y"
,
"s"
)),
// stubborn: no counterexample (no oracle)
"prevexampleNoOracle"
->
Fun
(
"S"
,
List
(
"x"
,
"y"
,
"s"
)),
// stubborn: counterexample (R is exactly O cap choice0)
"simpleChoice"
->
Fun
(
"R"
,
List
(
"x"
,
"s"
)),
// stubborn: counterexample (R is exactly O)
"simpleNoChoice"
->
Fun
(
"R"
,
List
(
"x"
,
"s"
)),
// stubborn: no counterexample (no oracle)
"simpleChoiceNoOracle"
->
Fun
(
"R"
,
List
(
"x"
,
"s"
)),
// stubborn: no counterexample
"easychairNoOracle"
->
Fun
(
"Read"
,
List
(
"x"
,
"y"
,
"p"
,
"r"
)),
// stubborn: no counterexample (TODO: still missing declass, ce for now)
"easychair"
->
Fun
(
"Read"
,
List
(
"x"
,
"y"
,
"p"
,
"r"
)),
// no counterexample
"linear"
->
Fun
(
"U"
,
List
(
"x"
,
"y"
,
"z"
,
"q"
)),
"easychair3NoOracle"
->
Fun
(
"Read"
,
List
(
"x"
,
"y"
,
"p"
))
)
}
src/main/scala/de/tum/workflows/Main.scala
View file @
0cd77329
...
...
@@ -16,11 +16,11 @@ object Main extends App with LazyLogging {
def
generateExample
(
name
:
String
)
{
logger
.
info
(
s
"Generating $name"
)
val
w
=
ExampleWorkflows
.
examples
(
name
)
stubbornnoninter
(
name
,
w
,
ExampleWorkflows
.
targets
(
name
)
)
val
(
wf
,
target
)
=
ExampleWorkflows
.
examples
(
name
)
stubbornnoninter
(
name
,
w
f
,
target
)
}
def
stubbornnoninter
(
name
:
String
,
w
:
Workflow
,
target
:
Fun
)
{
def
stubbornnoninter
(
name
:
String
,
w
:
Workflow
,
target
:
Term
)
{
logger
.
info
(
s
"Encoding Workflow:\n$w"
)
logger
.
info
(
"Using only stubborn agents"
)
val
t1
=
"pi1"
...
...
src/main/scala/de/tum/workflows/Utils.scala
View file @
0cd77329
...
...
@@ -20,4 +20,10 @@ object Utils {
def
allchoices
(
w
:
Workflow
)
=
{
w
.
steps
flatMap
(
collectChoices
_
)
toSet
}
def
allagents
(
t
:
Term
)
=
{
t
.
collect
({
case
Fun
(
_
,
_
,
as
)
=>
as
})
}
}
\ No newline at end of file
src/main/scala/de/tum/workflows/WorkflowParser.scala
View file @
0cd77329
...
...
@@ -49,18 +49,19 @@ object WorkflowParser extends RegexParsers {
}
def
VAR
=
"[a-zA-Z]
+
"
.
r
^^
{
str
=>
Var
(
str
)
}
def
VAR
=
"[a-zA-Z]
[a-zA-Z0-9]*
"
.
r
^^
{
str
=>
Var
(
str
)
}
def
tt
=
"True"
^^
{
_
=>
True
}
def
ff
=
"False"
^^
{
_
=>
False
}
def
AND
=
TERM
~
"∧"
~
TERM
^^
{
case
t1
~
_
~
t2
=>
And
(
t1
,
t2
)
}
def
OR
=
TERM
~
"∨"
~
TERM
^^
{
case
t1
~
_
~
t2
=>
Or
(
t1
,
t2
)
}
def
NEG
=
(
"¬"
|
"!"
)
~
TERM
^^
{
case
_
~
t
=>
Neg
(
t
)
}
def
AND
=
repsep
(
SIMPLETERM
,
"∧"
)
^^
{
case
ts
=>
And
.
make
(
ts
)
}
def
OR
=
repsep
(
SIMPLETERM
,
"∨"
)
^^
{
case
ts
=>
Or
.
make
(
ts
)
}
def
NEG
=
(
"¬"
|
"!"
)
~
SIMPLE
TERM
^^
{
case
_
~
t
=>
Neg
(
t
)
}
def
TUPLE
=
"("
~>
repsep
(
VAR
,
","
)
<~
")"
def
FUN
=
VAR
~
TUPLE
^^
{
case
f
~
tup
=>
Fun
(
f
.
name
,
tup
)
}
def
TERM
:
Parser
[
Term
]
=
(
tt
|
ff
|
FUN
|
"("
~>
AND
<~
")"
|
"("
~>
OR
<~
")"
|
NEG
)
def
SIMPLETERM
=
(
tt
|
ff
|
FUN
)
def
TERM
:
Parser
[
Term
]
=
(
SIMPLETERM
|
"("
~>
AND
<~
")"
|
"("
~>
OR
<~
")"
|
NEG
)
def
ADD
=
TERM
~
(
"→"
|
"->"
)
~
VAR
~
"+="
~
TUPLE
^^
{
case
guard
~
_
~
fun
~
_
~
tup
=>
Add
(
guard
,
fun
.
name
,
tup
)
}
def
REM
=
TERM
~
(
"→"
|
"->"
)
~
VAR
~
"-="
~
TUPLE
^^
{
case
guard
~
_
~
fun
~
_
~
tup
=>
Remove
(
guard
,
fun
.
name
,
tup
)
}
...
...
@@ -77,5 +78,8 @@ object WorkflowParser extends RegexParsers {
Workflow
(
buildSig
(
choiceblocks
),
choiceblocks
)
}}
def
SPEC
=
"Workflow"
~>
WORKFLOW
~
"Target"
~
TERM
^^
{
case
w
~
_
~
t
=>
(
w
,
t
)
}
def
parseWorkflow
(
s
:
String
)
=
parseAll
(
WORKFLOW
,
s
)
def
parseSpec
(
s
:
String
)
=
parseAll
(
SPEC
,
s
)
}
src/main/scala/de/tum/workflows/foltl/Properties.scala
View file @
0cd77329
...
...
@@ -37,7 +37,7 @@ object Noninterference {
object
Properties
{
// include optimizations for choices
def
noninterStubborn
(
w
:
Workflow
,
target
:
Fun
)
=
{
def
noninterStubborn
(
w
:
Workflow
,
target
:
Term
)
=
{
val
t1
=
"t1"
val
t2
=
"t2"
...
...
@@ -46,15 +46,14 @@ object Properties {
val
cfg
=
sanecfg
(
graph
)
val
sem
=
exec
(
w
.
sig
,
graph
)
val
agents
=
target
.
params
.
map
(
s
=>
Var
(
"a"
+
s
.
name
))
val
newtarget
=
Fun
(
target
.
name
,
agents
)
val
agents
=
allagents
(
target
)
// choice and node predicates are equal in both runs (stubborn)
val
nodes
=
nodepredicates
(
graph
)
map
(
_
.
name
)
val
choices
=
allchoices
(
w
)
map
(
_
.
name
)
val
equals
=
nodes
++
choices
val
noninter
=
Exists
(
agents
,
Finally
(
Neg
(
Eq
(
newtarget
.
in
(
t1
),
new
target
.
in
(
t2
)))))
val
noninter
=
Exists
(
agents
,
Finally
(
Neg
(
Eq
(
target
.
in
(
t1
),
target
.
in
(
t2
)))))
// maybe add exists t1, t2. phi?
And
.
make
(
cfg
,
sem
.
in
(
t1
,
equals
),
sem
.
in
(
t2
,
equals
),
noninter
)
...
...
src/test/scala/de/tum/workflows/ltl/tests/EncodingTest.scala
View file @
0cd77329
...
...
@@ -17,7 +17,7 @@ import de.tum.workflows.ExampleWorkflows
class
EncodingTest
extends
FlatSpec
{
val
w
=
ExampleWorkflows
.
examples
(
"simpleChoice"
)
val
w
=
ExampleWorkflows
.
examples
(
"simpleChoice"
)
.
_1
// shorthands
val
n0
=
Fun
(
"n0"
,
List
())
...
...
@@ -103,7 +103,7 @@ class EncodingTest extends FlatSpec {
Stubborn
(
"ax"
,
choices
,
t1
,
t2
),
Finally
(
Exists
(
"as"
,
Neg
(
Eq
(
ce
.
in
(
t1
),
ce
.
in
(
t2
))))))))
val
prop
=
Properties
.
noninterStubborn
(
w
,
Fun
(
"R"
,
List
(
"
x"
,
"
s"
)))
val
prop
=
Properties
.
noninterStubborn
(
w
,
Fun
(
"R"
,
List
(
"
ax"
,
"a
s"
)))
val
(
agents
,
res
)
=
LTL
.
eliminateExistentials
(
prop
)
...
...
src/test/scala/de/tum/workflows/ltl/tests/ParserTest.scala
View file @
0cd77329
...
...
@@ -11,35 +11,52 @@ import de.tum.workflows.foltl.FOLTL._
import
com.typesafe.scalalogging.LazyLogging
class
ParserTest
extends
FlatSpec
with
LazyLogging
{
def
testResult
(
s
:
String
,
sig
:
Signature
)
{
testResult
(
s
,
Workflow
(
sig
,
List
()))
def
testResult
(
s
:
String
,
sig
:
Signature
)
{
testResult
(
s
,
Workflow
(
sig
,
List
()))
}
def
testResult
(
s
:
String
,
wf
:
Workflow
)
{
val
parsed
=
WorkflowParser
.
parseWorkflow
(
s
)
if
(!
parsed
.
successful
)
{
logger
.
error
(
s
"Parsing unsuccessful: $parsed"
)
}
parsed
.
successful
should
be
(
true
)
val
pwf
=
parsed
.
get
pwf
.
sig
should
be
(
wf
.
sig
)
if
(!
wf
.
steps
.
isEmpty
)
{
pwf
.
steps
should
be
(
wf
.
steps
)
}
}
def
testResult
(
s
:
String
,
wf
:
Workflow
)
{
val
parsed
=
WorkflowParser
.
parseWorkflow
(
s
)
if
(!
parsed
.
successful
)
{
logger
.
error
(
s
"Parsing unsuccessful: $parsed"
)
}
parsed
.
successful
should
be
(
true
)
val
pwf
=
parsed
.
get
pwf
.
sig
should
be
(
wf
.
sig
)
if
(!
wf
.
steps
.
isEmpty
)
{
pwf
.
steps
should
be
(
wf
.
steps
)
}
def
testSpecResult
(
s
:
String
,
wf
:
Workflow
,
tar
:
Term
)
{
val
parsed
=
WorkflowParser
.
parseSpec
(
s
)
if
(!
parsed
.
successful
)
{
logger
.
error
(
s
"Parsing unsuccessful: $parsed"
)
}
parsed
.
successful
should
be
(
true
)
val
pwf
=
parsed
.
get
.
_1
pwf
.
sig
should
be
(
wf
.
sig
)
if
(!
wf
.
steps
.
isEmpty
)
{
pwf
.
steps
should
be
(
wf
.
steps
)
}
parsed
.
get
.
_2
should
be
(
tar
)
}
"Workflow Parser"
should
"parse a single may block"
in
{
val
s
=
"forallmay x,s O(x) → R += (x,s)"
val
sig
=
Signature
(
List
(
Fun
(
"O"
,
List
(
"x"
))),
List
(
Fun
(
"R"
,
List
(
"x"
,
"s"
))))
testResult
(
s
,
Workflow
(
sig
,
List
(
ForallMayBlock
(
List
(
"x"
,
"s"
),
"choice0"
,
List
(
Add
(
Fun
(
"O"
,
List
(
"x"
)),
"R"
,
List
(
"x"
,
"s"
)))))))
testResult
(
s
,
Workflow
(
sig
,
List
(
ForallMayBlock
(
List
(
"x"
,
"s"
),
"choice0"
,
List
(
Add
(
Fun
(
"O"
,
List
(
"x"
)),
"R"
,
List
(
"x"
,
"s"
)))))))
}
"Workflow Parser"
should
"parse a block with 2 stmts"
in
{
it
should
"parse a block with 2 stmts"
in
{
val
s
=
"""
forallmay x,s
O(x) → R += (x,s)
...
...
@@ -48,7 +65,7 @@ class ParserTest extends FlatSpec with LazyLogging {
testResult
(
s
,
Signature
(
List
(
Fun
(
"O"
,
List
(
"x"
))),
List
(
Fun
(
"R"
,
List
(
"x"
,
"s"
)))))
}
"Workflow Parser"
should
"parse a loop block with 2 stmts"
in
{
it
should
"parse a loop block with 2 stmts"
in
{
val
s
=
"""
loop {
forallmay x,s
...
...
@@ -61,7 +78,7 @@ class ParserTest extends FlatSpec with LazyLogging {
testResult
(
s
,
Signature
(
List
(
Fun
(
"O"
,
List
(
"s"
))),
List
(
Fun
(
"R"
,
List
(
"x"
,
"s"
)))))
}
"Workflow Parser"
should
"parse prevexample"
in
{
it
should
"parse prevexample"
in
{
val
s
=
"""
forallmay x,s O(s) -> Q += (x,s)
loop {
...
...
@@ -84,40 +101,64 @@ class ParserTest extends FlatSpec with LazyLogging {
Add
(
Fun
(
"R"
,
List
(
"y"
,
"s"
)),
"S"
,
List
(
"x"
,
"y"
,
"s"
))),
ForallBlock
(
List
(
"x"
,
"s"
),
Add
(
Fun
(
"Q"
,
List
(
"x"
,
"s"
)),
"R"
,
List
(
"x"
,
"s"
)))))))
testResult
(
s
,
w
)
testResult
(
s
,
w
)
}
"Workflow Parser"
should
"parse simplechoice"
in
{
it
should
"parse simplechoice"
in
{
val
s
=
"""
forallmay x,s
O(s) -> R += (x,s)
"""
val
w
=
Workflow
(
Signature
(
List
(
Fun
(
"O"
,
List
(
"s"
))),
List
(
Fun
(
"R"
,
List
(
"x"
,
"s"
)))),
List
(
ForallMayBlock
(
List
(
"x"
,
"s"
),
"choice0"
,
Add
(
Fun
(
"O"
,
"s"
),
"R"
,
List
(
"x"
,
"s"
)))))
Signature
(
List
(
Fun
(
"O"
,
List
(
"s"
))),
List
(
Fun
(
"R"
,
List
(
"x"
,
"s"
)))),
List
(
ForallMayBlock
(
List
(
"x"
,
"s"
),
"choice0"
,
Add
(
Fun
(
"O"
,
"s"
),
"R"
,
List
(
"x"
,
"s"
)))))
testResult
(
s
,
w
)
}
"Workflow Parser"
should
"parse simpleNochoice"
in
{
it
should
"parse simpleNochoice"
in
{
val
s
=
"""
forallmay x,s
O(s) -> R += (x,s)
"""
val
w
=
Workflow
(
Signature
(
List
(
Fun
(
"O"
,
List
(
"s"
))),
List
(
Fun
(
"R"
,
List
(
"x"
,
"s"
)))),
List
(
ForallMayBlock
(
List
(
"x"
,
"s"
),
"choice0"
,
Add
(
Fun
(
"O"
,
"s"
),
"R"
,
List
(
"x"
,
"s"
)))))
Signature
(
List
(
Fun
(
"O"
,
List
(
"s"
))),
List
(
Fun
(
"R"
,
List
(
"x"
,
"s"
)))),
List
(
ForallMayBlock
(
List
(
"x"
,
"s"
),
"choice0"
,
Add
(
Fun
(
"O"
,
"s"
),
"R"
,
List
(
"x"
,
"s"
)))))
testResult
(
s
,
w
)
}
"Spec Parser"
should
"parse simpleNochoice"
in
{
val
s
=
"""
Workflow
forallmay x,s
O(s) -> R += (x,s)
Target
(R(x,s) ∧ O(x))
"""
val
w
=
Workflow
(
Signature
(
List
(
Fun
(
"O"
,
List
(
"s"
))),
List
(
Fun
(
"R"
,
List
(
"x"
,
"s"
)))),
List
(
ForallMayBlock
(
List
(
"x"
,
"s"
),
"choice0"
,
Add
(
Fun
(
"O"
,
"s"
),
"R"
,
List
(
"x"
,
"s"
)))))
val
t
=
And
(
Fun
(
"R"
,
List
(
"x"
,
"s"
)),
Fun
(
"O"
,
List
(
"x"
)))
testSpecResult
(
s
,
w
,
t
)
}
}
\ No newline at end of file
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