Search in sources :

Example 16 with PrologTerm

use of de.prob.prolog.term.PrologTerm in project probparsers by bendisposto.

the class PrologGeneratorTest method testWeakFair_multiple.

@Test
public void testWeakFair_multiple() throws Exception {
    final PrologTerm transPred1 = new CompoundPrologTerm("bla");
    final PrologTerm wrapped1 = new CompoundPrologTerm("dtrans", transPred1);
    final PrologTerm wf1 = new CompoundPrologTerm("weak_fair", wrapped1);
    final PrologTerm ap1 = new CompoundPrologTerm("ap", wf1);
    final PrologTerm transPred2 = new CompoundPrologTerm("blubb");
    final PrologTerm wrapped2 = new CompoundPrologTerm("dtrans", transPred2);
    final PrologTerm wf2 = new CompoundPrologTerm("weak_fair", wrapped2);
    final PrologTerm ap2 = new CompoundPrologTerm("ap", wf2);
    final PrologTerm orPred = new CompoundPrologTerm("or", ap1, ap2);
    final PrologTerm weak_assumption = new CompoundPrologTerm("weakassumptions", orPred);
    final PrologTerm expected = new CompoundPrologTerm("fairnessimplication", weak_assumption, TERM_TRUE);
    check("wf(bla) or wf(blubb) => true", expected);
}
Also used : CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) ListPrologTerm(de.prob.prolog.term.ListPrologTerm) PrologTerm(de.prob.prolog.term.PrologTerm) Test(org.junit.Test)

Example 17 with PrologTerm

use of de.prob.prolog.term.PrologTerm in project probparsers by bendisposto.

the class PrologGeneratorTest method testWeakFair.

@Test
public void testWeakFair() throws Exception {
    final PrologTerm transPred = new CompoundPrologTerm("bla");
    final PrologTerm wrapped = new CompoundPrologTerm("dtrans", transPred);
    final PrologTerm wf = new CompoundPrologTerm("weak_fair", wrapped);
    final PrologTerm ap = new CompoundPrologTerm("ap", wf);
    final PrologTerm weak_assumption = new CompoundPrologTerm("weakassumptions", ap);
    final PrologTerm expected = new CompoundPrologTerm("fairnessimplication", weak_assumption, TERM_TRUE);
    check("wf(bla) => true", expected);
}
Also used : CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) ListPrologTerm(de.prob.prolog.term.ListPrologTerm) PrologTerm(de.prob.prolog.term.PrologTerm) Test(org.junit.Test)

Example 18 with PrologTerm

use of de.prob.prolog.term.PrologTerm in project probparsers by bendisposto.

the class PrologGeneratorTest method testTrigger.

@Test
public void testTrigger() throws Exception {
    final PrologTerm expected = new CompoundPrologTerm("trigger", TERM_FALSE, TERM_TRUE);
    check("false T true ", expected);
}
Also used : CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) ListPrologTerm(de.prob.prolog.term.ListPrologTerm) PrologTerm(de.prob.prolog.term.PrologTerm) Test(org.junit.Test)

Example 19 with PrologTerm

use of de.prob.prolog.term.PrologTerm in project probparsers by bendisposto.

the class PrologGeneratorTest method testExistsImplicationNested.

@Test
public void testExistsImplicationNested() throws Exception {
    final PrologTerm id_outer = new CompoundPrologTerm("x___1");
    final PrologTerm id_inner = new CompoundPrologTerm("y");
    // ap(dpred(blubb))
    final PrologTerm pred = new CompoundPrologTerm("blubb");
    final PrologTerm dpred = new CompoundPrologTerm("dpred", pred);
    final PrologTerm ap = new CompoundPrologTerm("ap", dpred);
    final PrologTerm transPredx = new CompoundPrologTerm("x");
    final PrologTerm wrappedx = new CompoundPrologTerm("dtrans", transPredx);
    final PrologTerm actionx = new CompoundPrologTerm("action", wrappedx);
    final PrologTerm transPredy = new CompoundPrologTerm("y");
    final PrologTerm wrappedy = new CompoundPrologTerm("dtrans", transPredy);
    final PrologTerm actiony = new CompoundPrologTerm("action", wrappedy);
    final PrologTerm orPred = new CompoundPrologTerm("or", actionx, actiony);
    final PrologTerm glob = new CompoundPrologTerm("globally", orPred);
    final PrologTerm forall = new CompoundPrologTerm("forall", id_inner, ap, glob);
    final PrologTerm expected = new CompoundPrologTerm("exists", id_outer, ap, forall);
    check("# x___1 . ( {blubb} & !y. ({blubb} => G ([x] or [y])))", expected);
}
Also used : CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) ListPrologTerm(de.prob.prolog.term.ListPrologTerm) PrologTerm(de.prob.prolog.term.PrologTerm) Test(org.junit.Test)

Example 20 with PrologTerm

use of de.prob.prolog.term.PrologTerm in project probparsers by bendisposto.

the class PrologGeneratorTest method testStrongFair.

@Test
public void testStrongFair() throws Exception {
    final PrologTerm transPred1 = new CompoundPrologTerm("bla");
    final PrologTerm wrapped1 = new CompoundPrologTerm("dtrans", transPred1);
    final PrologTerm sf1 = new CompoundPrologTerm("strong_fair", wrapped1);
    final PrologTerm ap1 = new CompoundPrologTerm("ap", sf1);
    final PrologTerm strong_assumptions = new CompoundPrologTerm("strongassumptions", ap1);
    final PrologTerm transPred2 = new CompoundPrologTerm("blubb");
    final PrologTerm wrapped2 = new CompoundPrologTerm("dtrans", transPred2);
    final PrologTerm sf2 = new CompoundPrologTerm("weak_fair", wrapped2);
    final PrologTerm ap2 = new CompoundPrologTerm("ap", sf2);
    final PrologTerm weak_assumptions = new CompoundPrologTerm("weakassumptions", ap2);
    final PrologTerm andPred = new CompoundPrologTerm("and", strong_assumptions, weak_assumptions);
    final PrologTerm expected = new CompoundPrologTerm("fairnessimplication", andPred, TERM_TRUE);
    check("(sf(bla)) & (wf(blubb)) => true", expected);
}
Also used : CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm) ListPrologTerm(de.prob.prolog.term.ListPrologTerm) PrologTerm(de.prob.prolog.term.PrologTerm) Test(org.junit.Test)

Aggregations

PrologTerm (de.prob.prolog.term.PrologTerm)103 ListPrologTerm (de.prob.prolog.term.ListPrologTerm)86 CompoundPrologTerm (de.prob.prolog.term.CompoundPrologTerm)85 Test (org.junit.Test)64 IntegerPrologTerm (de.prob.prolog.term.IntegerPrologTerm)11 StructuredPrologOutput (de.prob.prolog.output.StructuredPrologOutput)10 VariablePrologTerm (de.prob.prolog.term.VariablePrologTerm)8 Transition (de.prob.statespace.Transition)5 IEvalElement (de.prob.animator.domainobjects.IEvalElement)4 ArrayList (java.util.ArrayList)4 CheckBooleanPropertyCommand (de.prob.animator.command.CheckBooleanPropertyCommand)3 AbstractEvalResult (de.prob.animator.domainobjects.AbstractEvalResult)3 EvalResult (de.prob.animator.domainobjects.EvalResult)3 ISimplifiedROMap (de.prob.parser.ISimplifiedROMap)3 IPrologTermOutput (de.prob.prolog.output.IPrologTermOutput)3 RecursiveMachineLoader (de.be4.classicalb.core.parser.analysis.prolog.RecursiveMachineLoader)2 LtlParseException (de.be4.ltl.core.parser.LtlParseException)2 ClassicalB (de.prob.animator.domainobjects.ClassicalB)2 ComputationNotCompletedResult (de.prob.animator.domainobjects.ComputationNotCompletedResult)2 StateError (de.prob.animator.domainobjects.StateError)2