Commit 0c668bda authored by Christian Müller's avatar Christian Müller

strategies in resulting files

parent c823d8b8
......@@ -30,3 +30,4 @@ Compile / unmanagedJars ++= {
//assemblyJarName in assembly := "invariants.jar"
//test in assembly := {}
//mainClass in assembly := Some("de.tum.workflows.InvariantCLI")
# /bin/bash
TIMEOUT=20m
shopt -s globstar
for RUN in 1
do
for FILE in results/*.ltl
for FILE in results/**/*.ltl
do
NAME=$(basename ${FILE} .ltl)
METRICS="results/${NAME}.metrics"
......
# /bin/bash
TIMEOUT=20s
shopt -s globstar
for FILE in results/*.ltl
for FILE in results/**/*.ltl
do
FOLDER=$(dirname ${FILE})
NAME=$(basename ${FILE} .ltl)
METRICS="results/${NAME}.metrics"
METRICS="${FOLDER}/${NAME}.metrics"
echo "Measuring ${FILE}"
echo "Metrics File: ${METRICS}"
......
addSbtPlugin("com.github.xuwei-k" % "sbt-class-diagram" % "0.2.1")
Strategies:
strategy for B(a1,b1): ∀ n2:T. ((a1 = n2) ∨ ¬ leq(a1,n2) ∨ ¬ (a1 = b1)) ∧ ∀ n3:T. (¬ btw(b1,a1,n3) ∨ ¬ leq(a1,n3))
\ No newline at end of file
......@@ -39,7 +39,7 @@ object InvariantInspector extends App with LazyLogging {
val (t, (res, dot)) = time {
// InvariantChecker.checkInvariantOnce(spec.w, inv(spec), true)
val (result, graph, afterlabels, proven, dot, time) =
val (result, graph, afterlabels, proven, strategies, dot, time) =
InvariantChecker.checkInvariantFPLabelling(invspec, props)
// non-omitting conference linear inspection
......@@ -77,7 +77,7 @@ object InvariantInspector extends App with LazyLogging {
write(name, s"${name}.inv", msg)
for ((s, i) <- dot.zipWithIndex) {
write(name, s"${name}_${i}.dot", s)
write(name, s"${name}_$i.dot", s)
}
}
......
......@@ -41,6 +41,6 @@ object LTLCLI extends App with LazyLogging {
}
}
spec.map(MainLTL.generate(new File(file).getName.stripSuffix(".spec"), _, stubborn))
spec.map(MainLTLWorkflows.generate(new File(file).getName.stripSuffix(".spec"), _, stubborn))
}
}
\ No newline at end of file
package de.tum.niwo
import foltl.FOLTL._
import com.typesafe.scalalogging.LazyLogging
import de.tum.niwo.foltl.FOTransformers
import de.tum.niwo.Utils._
import de.tum.niwo.foltl.Properties
import de.tum.niwo.blocks.{InvariantSpec, NISpec}
import de.tum.niwo.foltl.FormulaFunctions
import de.tum.niwo.foltl.FOTransformers
import de.tum.niwo.owltransformer.OwlTransformer
object MainLTLTransitionSystems extends App with LazyLogging {
def writeExample(name: String, spec: InvariantSpec, prop: Formula) {
val MAX_AGENTS = 8
var metrics = List[String]()
write(name, s"$name.foltl", prop.pretty)
metrics :+= s"$name.foltl: ${prop.opsize}"
if (!FormulaFunctions.checkSanity(prop)) {
logger.error("Property didn't pass sanity check")
return
}
logger.info("Embedding FOLTL formula in LTL")
val (agents, res) = FOTransformers.eliminateExistentials(prop)
val universe = agents.map(_.withType).mkString(", ")
logger.info(s"Using universe $universe")
if (agents.groupBy(_.typ).exists(_._2.size > MAX_AGENTS)) {
logger.error(s"Universe has more than $MAX_AGENTS agents for a single type. Aborting.")
return
}
val quantfree = FOTransformers.eliminateUniversals(res, agents)
val ltlprop = FOTransformers.eliminatePredicates(quantfree)
metrics :+= s"$name.ltl: ${ltlprop.opsize}"
metrics :+= s"Universe: $universe"
write(name, s"$name.ltl", ltlprop.toString())
write(name, s"$name.ppltl", ltlprop.pretty)
// val owlform = OwlTransformer.toOwl(ltlprop)
//
// // simplify owl
// val (t1,simped) = time {
// SimplifierFactory.apply(owlform.formula(), SimplifierFactory.Mode.SYNTACTIC_FIXPOINT)
// }
// write(name, s"$name.owlltl",simped.toString)
// logger.info(s"Simplified owl formula in $t1 ms")
// val (t2, sat) = time {
// // check owl sat
// logger.info("Checking satisfiability")
// // LanguageAnalysis.isSatisfiable(simped)
//
// OwlTransformer.isSatisfiable(simped)
// }
// logger.info(s"Found LTL formula to be satisfiable: $sat in $t2 ms")
//
// metrics :+= s"Satisfiable: $sat"
// metrics :+= s"Owl simplification $t1 ms"
// metrics :+= s"Owl runtime: $t2 ms"
write(name, s"$name.metrics", metrics.mkString("", "\n", "\n"))
}
def generate(name: String, spec: InvariantSpec) {
logger.info(s"Encoding Spec:\n$spec")
// TODO: Check if correct fragment
logger.info (s"Computing invariant for target ${spec.inv} using only stubborn agents")
val prop = Properties.singletrace (spec)
writeExample (s"${name}_invspec", spec, prop)
}
def generateExample(name: String) {
logger.info(s"Generating $name")
val spec = Examples.parseExampleTS(name)
if (spec.isEmpty) {
logger.error(s"Not a valid spec: $name")
}
spec.foreach(generate(name, _))
}
def generateAllExamples() {
clear()
// Fill results alphabetically
for (k <- Examples.tsexamples.keys.toList.sorted) {
generateExample(k)
}
}
// clear()
// generateExample("nonomitting/conference")
// generateExample("tests/declasstest")
generateExample("tstests/easychair_singletrace")
// generateExample("tests/simpleChoiceNoOracle")
// generateAllExamples()
}
......@@ -9,11 +9,9 @@ import de.tum.niwo.blocks.NISpec
import de.tum.niwo.foltl.FormulaFunctions
import de.tum.niwo.foltl.FOTransformers
import de.tum.niwo.owltransformer.OwlTransformer
import owl.ltl.algorithms.LanguageAnalysis
import owl.ltl.rewriter.SimplifierFactory
object MainLTL extends App with LazyLogging {
object MainLTLWorkflows extends App with LazyLogging {
def writeExample(name: String, spec: NISpec, prop: Formula) {
......@@ -45,38 +43,39 @@ object MainLTL extends App with LazyLogging {
metrics :+= s"$name.ltl: ${ltlprop.opsize}"
metrics :+= s"Universe: $universe"
write(name, s"$name.ltl", ltlprop.toString())
// So aalta doesnt throw up
val ltlstring = ltlprop.toString.replace("#","_")
write(name, s"$name.ltl", ltlstring)
write(name, s"$name.ppltl", ltlprop.pretty)
val owlform = OwlTransformer.toOwl(ltlprop)
// simplify owl
val (t1,simped) = time {
SimplifierFactory.apply(owlform.formula(), SimplifierFactory.Mode.SYNTACTIC_FIXPOINT)
}
write(name, s"$name.owlltl",simped.toString)
logger.info(s"Simplified owl formula in $t1 ms")
val (t2, sat) = time {
// check owl sat
logger.info("Checking satisfiability")
// LanguageAnalysis.isSatisfiable(simped)
OwlTransformer.isSatisfiable(simped)
}
logger.info(s"Found LTL formula to be satisfiable: $sat in $t2 ms")
metrics :+= s"Satisfiable: $sat"
metrics :+= s"Owl simplification $t1 ms"
metrics :+= s"Owl runtime: $t2 ms"
// val (t1,simped) = time {
// SimplifierFactory.apply(owlform.formula(), SimplifierFactory.Mode.SYNTACTIC_FIXPOINT)
// }
// write(name, s"$name.owlltl",simped.toString)
// logger.info(s"Simplified owl formula in $t1 ms")
// val (t2, sat) = time {
// // check owl sat
// logger.info("Checking satisfiability")
//// LanguageAnalysis.isSatisfiable(simped)
//
// OwlTransformer.isSatisfiable(simped)
// }
// logger.info(s"Found LTL formula to be satisfiable: $sat in $t2 ms")
//
// metrics :+= s"Satisfiable: $sat"
// metrics :+= s"Owl simplification $t1 ms"
// metrics :+= s"Owl runtime: $t2 ms"
write(name, s"$name.metrics", metrics.mkString("", "\n", "\n"))
}
def generate(name: String, spec: NISpec, onlystubborn:Boolean) {
logger.info(s"Encoding Spec:\n$spec")
val t1 = "pi1"
val t2 = "pi2"
// Do FOLTL to LTL
if (spec.w.isomitting) {
logger.info("Omitting spec - no embedding in LTL possible")
......
package de.tum.niwo
import scala.io.Source
import com.typesafe.scalalogging.LazyLogging
import java.io.File
import de.tum.niwo.invariants.InvProperties
import de.tum.niwo.parser.{TransitionSystemParser, WorkflowParser}
object TSCLI extends App with LazyLogging {
lazy val usage = """
Usage niwo-ts.jar FILE
FILE should be a path to a FO Safety Game Description File.
"""
if (args.length != 1) {
logger.info(usage)
} else {
val file = args.last
logger.info(s"Using $file")
val source = Utils.using(Source.fromFile(file)) { source => source.mkString }
val spec = TransitionSystemParser.parseSpec(source)
if (!spec.successful) {
logger.error(s"Parsing of $file unsuccessful: $spec")
} else {
if (!spec.get.isSane) {
logger.error(s"Sanity check of $file failed. Skipping file.")
} else {
val properties = InvProperties(stubborn = true, eliminateA = true, eliminateB = true)
Utils.check(new File(file).getName.stripSuffix(".spec"), "", spec.get, properties)
}
}
}
}
......@@ -9,6 +9,8 @@ import de.tum.niwo.toz3.Z3BSFO
import com.typesafe.scalalogging.LazyLogging
import de.tum.niwo.graphs.{TSGraphEncoding, WFGraphEncoding}
import de.tum.niwo.invariants.{InvProperties, InvariantChecker}
import org.checkerframework.checker.units.qual.s
import scalax.collection.edge.Implicits.+
object Utils extends LazyLogging {
......@@ -116,7 +118,7 @@ object Utils extends LazyLogging {
InvSpecInstantiator.instantiate(spec, u)
).getOrElse(spec)
val (res, graph, labelling, provens, dot, time) =
val (res, graph, labelling, provens, strategies, dot, time) =
InvariantChecker.checkInvariantFPLabelling(fixspec, properties)
logger.info(s"Invariant was ${spec.inv}")
......@@ -135,33 +137,44 @@ object Utils extends LazyLogging {
true
}
// .invariants
val labels = (for ((node, inv) <- labelling.last) yield {
s"Node ${node}:\n${inv.pretty}\n"
}).mkString("\n")
Utils.write(name, s"$filenames.invariants", labels)
// .strategies
val strats = strategies.last.values.foldLeft("")(_ + _)
val stratfile = s"Strategies:\n${Utils.indentLines(strats)}"
Utils.write(name, s"$filenames.strategies", stratfile)
// .metrics
val wfsize = graph.edges.size - 1
val invsizes = labelling.last.map(_._2.opsize)
val maxsize = invsizes.max
val avgsize = invsizes.sum / invsizes.size
Utils.write(name, s"$filenames.metrics",
s"""Name: $name
|Description: $desc
| Invariant:
|${spec.inv.pretty.linesIterator.map(s => " " + s).mkString("\n")}
| Model: $model
| Result: ${if (!res) "not " else ""}inductive
| WF size: $wfsize
| Time: $time ms
| Proof steps: ${dot.size}
| Strengthenings: ${strengthenings.size}
| Largest Inv: $maxsize
| Average Inv: $avgsize
| Properties: $properties
| """.stripMargin
s"""Name: $name
|Description: $desc
| Invariant:
|${spec.inv.pretty.linesIterator.map(s => " " + s).mkString("\n")}
| Model: $model
| Result: ${if (!res) "not " else ""}inductive
| WF size: $wfsize
| Time: $time ms
| Proof steps: ${dot.size}
| Strengthenings: ${strengthenings.size}
| Largest Inv: $maxsize
| Average Inv: $avgsize
| Properties: $properties
| """.stripMargin
)
res
}
// Will be obsolete in Scala 2.13
def using[A, B <: {def close(): Unit}] (closeable: B) (f: B => A): A =
try { f(closeable) } finally { closeable.close() }
}
\ No newline at end of file
package de.tum.niwo
import scala.io.Source
import com.typesafe.scalalogging.LazyLogging
import java.io.File
import de.tum.niwo.LTLCLI.args
import de.tum.niwo.invariants.{InvProperties, InvariantGenerator}
import de.tum.niwo.parser.WorkflowParser
object TSCLI extends App with LazyLogging {
lazy val usage = """
Usage niwo-ts.jar FILE
FILE should be a path to a Workflow Description File.
It will be transformed into a First Order Safety Game and then solved.
If --stubborn is given, all agents are assumed to be stubborn, regardless of the specification in the file.
"""
if (args.length == 0) {
logger.info(usage)
} else {
var stubborn = false
args.collect {
case "--stubborn" => stubborn = true
}
val file = args.last
logger.info(s"Using $file")
val source = Utils.using(Source.fromFile(file)) { source => source.mkString }
val spec = WorkflowParser.parseSpec(source)
if (!spec.successful) {
logger.error(s"Parsing of $file unsuccessful: $spec")
} else {
if (!spec.get.isSane) {
logger.error(s"Sanity check of $file failed. Skipping file.")
} else {
val inv = InvariantGenerator.invariantNoninterSingleBS _
val properties = InvProperties(stubborn = stubborn, approxElim = true, eliminateA = true, eliminateB = true)
Utils.check(new File(file).getName.stripSuffix(".spec"), "", inv, spec.get, properties)
}
}
}
}
......@@ -93,7 +93,7 @@ object FOTransformers extends LazyLogging {
repld.simplify
}
def eliminateBPredicate(f:Formula, B:Fun): (Formula, Formula) = {
def eliminateBPredicate(f:Formula, B:Fun): (Formula, String) = {
val NAME = B.name
// SOQE: \exists B. f <-> f'
......@@ -187,7 +187,7 @@ object FOTransformers extends LazyLogging {
logger.info(s"BSFO SOQE: strategy for ${B.updatedParams(freeparams)}: $z3fsolq")
}
(felimq, z3fsolq)
(felimq, s"strategy for ${B.updatedParams(freeparams)}: $z3fsolq\n")
}
/**
......
package de.tum.niwo.foltl
import de.tum.niwo.Implicits._
import de.tum.niwo.graphs.WFGraphEncoding._
import de.tum.niwo.foltl.LTLEncoding._
import de.tum.niwo.blocks._
import de.tum.niwo.foltl.FOLTL._
......@@ -122,9 +122,28 @@ object Properties {
val T1 = "t1"
val T2 = "t2"
val INFNAME = "informed"
def singletrace(spec:InvariantSpec): Formula = {
import de.tum.niwo.graphs.TSGraphEncoding._
val graph = toGraph(spec.ts)
val cfg = sanecfg(graph)
// TODO: this still believes the graph is a WFGraph
val sem = exec(spec.ts.sig, graph)
val empties = spec.ts.sig.preds.map( pred => Forall(pred.params, Neg(pred)) )
val emptyaxiom = And.make(empties.toList)
val inv = Finally(Neg(spec.inv))
And.make(cfg, sem, emptyaxiom, spec.axioms, inv)
}
// include optimizations for choices
def noninterStubborn(spec: NISpec) = {
def noninterStubborn(spec: NISpec): Formula = {
import de.tum.niwo.graphs.WFGraphEncoding._
val graph = toGraph(spec.w)
val cfg = sanecfg(graph)
......@@ -145,7 +164,8 @@ object Properties {
And.make(cfg, sem.in(T1, equals), sem.in(T2, equals), noninter)
}
def noninterCausal(spec:NISpec) = {
def noninterCausal(spec:NISpec): Formula = {
import de.tum.niwo.graphs.WFGraphEncoding._
val graph = toGraph(spec.w)
val cfg = sanecfg(graph)
......
......@@ -9,6 +9,7 @@ import de.tum.niwo.graphs.WFGraphEncoding.WorkflowGraph
import de.tum.niwo.graphs.{TSGraphEncoding, WFGraphEncoding}
import de.tum.niwo.toz3.{Z3BSFO, Z3FOEncoding}
import de.tum.niwo.Utils
import de.tum.niwo.graphs.TSGraphEncoding.TSGraph
import scala.annotation.tailrec
......@@ -40,15 +41,15 @@ object InvariantChecker extends LazyLogging {
post: Formula,
properties:InvProperties,
untouched:Set[String],
diverged:Boolean): ((Status, Solver), Formula) = {
val precond = Preconditions.abstractedPrecondition(post, b, spec, properties, untouched, diverged)
diverged:Boolean): ((Status, Solver), Formula, String) = {
val (precond, strategy) = Preconditions.abstractedPrecondition(post, b, spec, properties, untouched, diverged)
// pre is universal, spec.always is AE
val f = Implies(And(pre, spec.axioms), precond)
logger.info(s"Checking invariant implication for $b")
(Z3BSFO.checkAE(f.simplify), precond)
(Z3BSFO.checkAE(f.simplify), precond, strategy)
}
def checkInvariantFPLabelling(spec: InvariantSpec, properties:InvProperties) = {
......@@ -66,15 +67,18 @@ object InvariantChecker extends LazyLogging {
val diverged = TSGraphEncoding.divergedMap(graph, spec.ts.sig, properties)
@tailrec
def checkInvariantRec(labellist: List[Map[Int, Formula]], provenlist: List[Set[Edge]]): (Boolean, List[Map[Int, Formula]], List[Set[Edge]]) = {
def checkInvariantRec(labellist: List[Map[Int, Formula]], provenlist: List[Set[Edge]], strategylist:List[Map[Edge, String]]):
(Boolean, List[Map[Int, Formula]], List[Set[Edge]], List[Map[Edge, String]]) = {
val labels = labellist.head
val proven = provenlist.head
val strats = strategylist.head
// check if done, i.e. all edges proven
val toProve = graph.edges -- proven
if (toProve.isEmpty) {
logger.info("Everything proven. Terminating.")
(true, labellist, provenlist)
(true, labellist, provenlist, strategylist)
} else {
// take one edge to prove
......@@ -93,7 +97,7 @@ object InvariantChecker extends LazyLogging {
// try to prove
val pre = labels(nextEdge.from)
val post = labels(nextEdge.to)
val ((status, solver), strengthened) =
val ((status, solver), strengthened, strategy) =
checkBlockInvariant(
spec,
TSGraphEncoding.toBlock(nextEdge),
......@@ -106,12 +110,14 @@ object InvariantChecker extends LazyLogging {
val from = TSGraphEncoding.toNumber(nextEdge._1)
val to = TSGraphEncoding.toNumber(nextEdge._2)
val newstrats = strats.updated(nextEdge, strategy)
if (status == Status.UNSATISFIABLE) {
// Negation of implication unsat
// --> safe, continue with larger proven set.
logger.info(s"Proven inductiveness for ($from -> $to).")
checkInvariantRec(labels :: labellist, (proven + nextEdge) :: provenlist)
checkInvariantRec(labels :: labellist, (proven + nextEdge) :: provenlist, newstrats :: strategylist)
} else {
// Negation of implication sat
// --> unsafe, relabel incoming node, invalidate all proven guarantees for that node
......@@ -142,15 +148,15 @@ object InvariantChecker extends LazyLogging {
if (status2 == Status.SATISFIABLE) {
// Negation of newinv still sat, newinv does not imply false)
logger.info(s"Relabeling $from. New size: ${newinv.opsize}. Continuing.")
checkInvariantRec(newlabels :: labellist, newproven :: provenlist)
checkInvariantRec(newlabels :: labellist, newproven :: provenlist, newstrats :: strategylist)
} else {
logger.info(s"New invariant for $from not satisfiable. Terminating.")
(false, newlabels :: labellist, newproven :: provenlist)
(false, newlabels :: labellist, newproven :: provenlist, newstrats :: strategylist)
}
} else {
logger.info("Relabelled initial node. Terminating.")
// logger.info(s"Model: ${Z3.printModel(solver.getModel())}")
(false, newlabels :: labellist, (proven + nextEdge) :: provenlist)
(false, newlabels :: labellist, (proven + nextEdge) :: provenlist, newstrats :: strategylist)
}
}
}
......@@ -166,27 +172,27 @@ object InvariantChecker extends LazyLogging {
logger.info(s"Beginning inference for invariant $spec.inv")
val (time, (result, labellings, proven)) = Utils.time { checkInvariantRec(List(untouchedlabels), List(Set())) }
val (time, (result, labellings, proven, strategies)) = Utils.time { checkInvariantRec(List(untouchedlabels), List(Set()), List(Map())) }
val dot1 = labellings.zip(proven).reverse
val dot2 = dot1.map(tup => TSGraphEncoding.toDot(graph)(tup._1.map(t => (t._1, {
t._2.pretty
})), tup._2))
(result, graph, labellings.reverse, proven.reverse, dot2, time)
(result, graph, labellings.reverse, proven.reverse, strategies.reverse, dot2, time)
}
def checkInvariantFPDot(spec: InvariantSpec,
properties:InvProperties = InvProperties.DEFAULT
): (Boolean, List[String], Long) = {
val (result, graph, afterlabels, proven, dot, time) = checkInvariantFPLabelling(spec, properties)
val (result, graph, afterlabels, proven, strategies, dot, time) = checkInvariantFPLabelling(spec, properties)
(result, dot, time)
}
def checkInvariantFPHeadLabel(spec: InvariantSpec,
properties:InvProperties = InvProperties.DEFAULT
): (Boolean, WorkflowGraph, Map[Int, Formula], Long) = {
val (result, graph, afterlabels, proven, dot, time) = checkInvariantFPLabelling(spec, properties)
val (result, graph, afterlabels, proven, strategies, dot, time) = checkInvariantFPLabelling(spec, properties)
(result, graph, afterlabels.last, time)
}
......@@ -206,7 +212,7 @@ object InvariantChecker extends LazyLogging {
// Check I -> WP[w](inv)
val b = TSGraphEncoding.toBlock(e)
val ((res, solver), _) = checkBlockInvariant(spec, b, spec.inv, spec.inv, properties, untouched(e.from), diverged(e.from))
val ((res, solver), _, strategies) = checkBlockInvariant(spec, b, spec.inv, spec.inv, properties, untouched(e.from), diverged(e.from))
if (res != Status.UNSATISFIABLE) {
msg ++= s"Possibly unsafe: Block may not uphold invariant:\n\n${e.label}\n\n"
......@@ -221,6 +227,8 @@ object InvariantChecker extends LazyLogging {
logger.info(s"Z3 status $res")
logger.info(s"Block ${e.label} may not uphold it")
}
msg ++= s"Strategies used:\n" + strategies
res == Status.UNSATISFIABLE
}
......
......@@ -6,6 +6,7 @@ import de.tum.niwo.blocks.{InvariantSpec, SetStmt, SimpleTSBlock}
import de.tum.niwo.foltl.FOLTL.{Exists, Formula, Fun, Neg}
import de.tum.niwo.foltl.{FOLTL, FOTransformers, FormulaFunctions, Properties}
import de.tum.niwo.toz3.Z3BSFO
import org.checkerframework.checker.units.qual.s
object Preconditions extends LazyLogging {
......@@ -72,7 +73,7 @@ object Preconditions extends LazyLogging {
}
def abstractedPrecondition(f: Formula, b: SimpleTSBlock, spec: InvariantSpec,
properties: InvProperties, untouched: Set[String], diverged:Boolean): Formula = {
properties: InvProperties, untouched: Set[String], diverged:Boolean): (Formula, String) = {
val precond = weakestPrecondition(f, b, spec, properties)
......@@ -115,7 +116,7 @@ object Preconditions extends LazyLogging {
}
// Eliminate Bs (Win game)
val bless = if (properties.eliminateB) {
val (bless, strategy) = if (properties.eliminateB) {
val bs = spec.ts.sig.bs
val occuringBs = bs.filter(b =>
......@@ -126,9 +127,14 @@ object Preconditions extends LazyLogging {
logger.error("Trying to compute strategies for B with B,B' not necessarily equal")
}
occuringBs.foldRight(oless)((b, inv) => FOTransformers.eliminateBPredicate(inv, b)._1)
occuringBs.foldRight((oless, ""))((b, tup) => {
val eliminated = FOTransformers.eliminateBPredicate(tup._1, b)
val f = eliminated._1
val newstrategy = eliminated._2
(f, tup._2 + newstrategy + "\n")
})
} else {
oless
(oless, "")
}
......@@ -137,6 +143,6 @@ object Preconditions extends LazyLogging {
logger.trace(s"Possible attack: $possibleAttack")
}
Z3BSFO.simplifyBS(bless.simplify)
(Z3BSFO.simplifyBS(bless), strategy)
}
}
package de.tum.niwo.tests.papertests
import java.io.File
import com.typesafe.scalalogging.LazyLogging
import de.tum.niwo.blocks.NISpec
import de.tum.niwo.foltl.{FOLTL, FOTransformers, FormulaFunctions}
import de.tum.niwo.foltl.FOLTL._
import de.tum.niwo.invariants.InvariantGenerator.genEq
import de.tum.niwo.{Examples, MainLTLWorkflows, Utils}
import de.tum.niwo.invariants.{InvProperties, InvariantGenerator}
import de.tum.niwo.parser.{TransitionSystemParser, WorkflowParser}
import de.tum.niwo.tests.TestUtils.{checkSafe, checkSafeCausalElim}
import org.scalatest.FlatSpec
class LTLSatTests extends FlatSpec with LazyLogging {
def generate(name:String) = {
MainLTLWorkflows.generateExample(name)
}
"Nonomitting Easychair" should "be generated" in {
val names = List(
"nonomitting/conference_stubborn"