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
9bdd62d2
Commit
9bdd62d2
authored
Jul 07, 2017
by
Eugen Zalinescu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://versioncontrolseidl.in.tum.de/mueller/loopingworkflows
parents
3f59003d
fdbb138e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
0 deletions
+39
-0
src/main/scala/de/tum/workflows/foltl/FOLTL.scala
src/main/scala/de/tum/workflows/foltl/FOLTL.scala
+2
-0
src/main/scala/de/tum/workflows/foltl/FOLTLTermFunctions.scala
...ain/scala/de/tum/workflows/foltl/FOLTLTermFunctions.scala
+11
-0
src/test/scala/de/tum/workflows/ltl/tests/FOLTLTest.scala
src/test/scala/de/tum/workflows/ltl/tests/FOLTLTest.scala
+26
-0
No files found.
src/main/scala/de/tum/workflows/foltl/FOLTL.scala
View file @
9bdd62d2
...
...
@@ -15,6 +15,8 @@ object FOLTL {
def
in
(
name
:
String
,
ignore
:
Set
[
String
])
=
FormulaFunctions
.
annotate
(
this
,
name
,
ignore
)
def
collect
[
T
](
coll
:
PartialFunction
[
Formula
,
List
[
T
]])
=
FormulaFunctions
.
collect
(
coll
,
this
)
def
opsize
()
=
FormulaFunctions
.
opsize
(
this
)
def
removeOTQuantifiers
()
=
FormulaFunctions
.
removeOTQuantifiers
(
this
)
def
bracketed
()
:
String
=
this
match
{
case
_:
BinOp
=>
"("
+
this
+
")"
...
...
src/main/scala/de/tum/workflows/foltl/FOLTLTermFunctions.scala
View file @
9bdd62d2
...
...
@@ -153,4 +153,15 @@ object FormulaFunctions extends LazyLogging {
frees
.
isEmpty
}
def
removeOTQuantifiers
(
f
:
Formula
)
=
{
f
.
everywhere
({
case
ForallOtherThan
(
vars
,
otherthan
,
fp
)
=>
{
val
eqs
=
for
(
x
<-
vars
;
y
<-
otherthan
)
yield
{
Neg
(
Eq
(
x
,
y
))
}
Forall
(
vars
,
Implies
(
And
.
make
(
eqs
),
fp
.
removeOTQuantifiers
()))
}
})
}
}
\ No newline at end of file
src/test/scala/de/tum/workflows/ltl/tests/FOLTLTest.scala
0 → 100644
View file @
9bdd62d2
package
de.tum.workflows.ltl.tests
import
org.scalatest.FlatSpec
import
org.scalatest.Matchers._
import
org.scalatest.Inspectors._
import
de.tum.workflows.foltl.FOLTL._
import
de.tum.workflows.Implicits._
class
FOLTLTest
extends
FlatSpec
{
"Formula functions"
should
"generate inequalities"
in
{
val
f
=
ForallOtherThan
(
"x"
,
List
(
"y"
,
"z"
),
Globally
(
"x"
))
val
res
=
f
.
removeOTQuantifiers
()
res
should
be
(
Forall
(
"x"
,
Implies
(
And
(
Neg
(
Eq
(
"x"
,
"y"
)),
Neg
(
Eq
(
"x"
,
"z"
))),
Globally
(
"x"
)))
)
val
f2
=
ForallOtherThan
(
List
(
"x"
,
"y"
),
"z"
,
Globally
(
"x"
))
val
res2
=
f2
.
removeOTQuantifiers
()
res2
should
be
(
Forall
(
List
(
"x"
,
"y"
),
Implies
(
And
(
Neg
(
Eq
(
"x"
,
"z"
)),
Neg
(
Eq
(
"y"
,
"z"
))),
Globally
(
"x"
)))
)
}
}
\ 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