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
5dac4c08
Commit
5dac4c08
authored
Mar 29, 2018
by
Christian Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
constants
parent
60a69f09
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
15 deletions
+27
-15
src/main/scala/de/tum/workflows/ltl/FOTransformers.scala
src/main/scala/de/tum/workflows/ltl/FOTransformers.scala
+7
-3
src/test/scala/de/tum/workflows/ltl/tests/FOTransformTest.scala
...st/scala/de/tum/workflows/ltl/tests/FOTransformTest.scala
+8
-0
src/test/scala/de/tum/workflows/ltl/tests/papertests/InvariantCausalFilesTest.scala
...flows/ltl/tests/papertests/InvariantCausalFilesTest.scala
+12
-12
No files found.
src/main/scala/de/tum/workflows/ltl/FOTransformers.scala
View file @
5dac4c08
...
...
@@ -35,8 +35,9 @@ object FOTransformers extends LazyLogging {
}
def
collectMultiClause
(
f
:
Formula
)
:
List
[
List
[
Formula
]]
=
f
collect
{
case
t
:
Or
=>
List
(
collectClause
(
t
))
case
And
(
t1
,
t2
)
=>
collectMultiClause
(
t1
)
++
collectMultiClause
(
t2
)
case
Quantifier
(
vars
,
make
,
t
)
=>
collectMultiClause
(
t
)
case
t
=>
List
(
collectClause
(
t
))
}
collectMultiClause
(
f
)
...
...
@@ -173,7 +174,9 @@ object FOTransformers extends LazyLogging {
val
nf
=
f
.
toNegNf
()
val
(
agents
,
inner
)
=
FOTransformers
.
eliminateExistentials
(
nf
)
val
existbound
=
Exists
(
agents
,
inner
)
FOTransformers
.
eliminateUniversals
(
existbound
,
agents
)
val
constants
=
existbound
.
freeVars
()
FOTransformers
.
eliminateUniversals
(
existbound
,
constants
.
toList
)
}
/**
...
...
@@ -191,7 +194,8 @@ object FOTransformers extends LazyLogging {
val
(
agents
,
inner
)
=
FOTransformers
.
eliminateExistentials
(
neg
)
val
existbound
=
Exists
(
agents
,
inner
)
val
res
=
FOTransformers
.
eliminateUniversals
(
existbound
,
List
())
val
constants
=
neg
.
freeVars
()
val
res
=
FOTransformers
.
eliminateUniversals
(
existbound
,
constants
.
toList
)
Neg
(
res
).
simplify
()
}
}
\ No newline at end of file
src/test/scala/de/tum/workflows/ltl/tests/FOTransformTest.scala
View file @
5dac4c08
...
...
@@ -81,6 +81,14 @@ class FOTransformSpec extends FlatSpec {
)
}
it
should
"work with constants"
in
{
val
f
=
Forall
(
List
(
"x"
),
Or
(
Var
(
"c"
),
Exists
(
"z"
,
Fun
(
"f"
,
List
(
"x"
,
"z"
)))))
FOTransformers
.
abstractExistentials
(
f
)
should
be
(
Forall
(
List
(
"x"
),
Or
(
Var
(
"c"
),
Or
(
Fun
(
"f"
,
List
(
"x"
,
"c"
)),
Fun
(
"f"
,
List
(
"x"
,
"x"
)))))
)
}
"hasSubFormula"
should
"find subformulas"
in
{
val
f
=
Forall
(
List
(
"x"
,
"y"
),
Exists
(
"z"
,
Fun
(
"f"
,
List
(
"x"
,
"z"
))))
val
f2
=
And
(
"b"
,
Or
(
"c"
,
f
))
...
...
src/test/scala/de/tum/workflows/ltl/tests/papertests/InvariantCausalFilesTest.scala
View file @
5dac4c08
...
...
@@ -30,11 +30,11 @@ class InvariantCausalFilesTest extends FlatSpec {
// assert(!checkSafeCausal(name, inv))
// }
//
//
it should "fail to prove conference_linear alleq" in {
//
val name = "nonomitting/conference_linear"
//
val inv = InvariantGenerator.invariantAllEqual(ExampleWorkflows.parseExample(name).get)
//
assert(!checkSafeCausal(name, "alleq", inv))
//
}
it
should
"fail to prove conference_linear alleq"
in
{
val
name
=
"nonomitting/conference_linear"
val
inv
=
InvariantGenerator
.
invariantAllEqual
(
ExampleWorkflows
.
parseExample
(
name
).
get
)
assert
(!
checkSafeCausal
(
name
,
"alleq"
,
inv
))
}
//
// // HEAP SPACE
// it should "fail to prove conference_linear with elim" ignore {
...
...
@@ -92,13 +92,13 @@ class InvariantCausalFilesTest extends FlatSpec {
// assert(!checkSafeCausal(name, "alleq", inv))
// }
//
it should "prove omitting/conference_fixed" in {
//
val name = "omitting/conference_fixed"
//
val xt = Var("xt","A")
//
val pt = Var("rt","R")
//
val inv = Forall(List(xt, pt), genEq("Read", List(xt, pt)))
//
assert(checkSafeCausal(name, inv))
//
}
it
should
"prove omitting/conference_fixed"
in
{
val
name
=
"omitting/conference_fixed"
val
xt
=
Var
(
"xt"
,
"A"
)
val
pt
=
Var
(
"rt"
,
"R"
)
val
inv
=
Forall
(
List
(
xt
,
pt
),
genEq
(
"Read"
,
List
(
xt
,
pt
)))
assert
(
checkSafeCausal
(
name
,
inv
))
}
//
// it should "prove omitting/conference_fixed alleq" ignore {
// val name = "omitting/conference_fixed"
...
...
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