Search in sources :

Example 21 with PrologTerm

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

the class PrologGeneratorTest method testOnce.

@Test
public void testOnce() throws Exception {
    final PrologTerm expected = new CompoundPrologTerm("once", TERM_TRUE);
    check("O 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 22 with PrologTerm

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

the class PrologGeneratorTest method testWeakStrongFairAll.

@Test
public void testWeakStrongFairAll() throws Exception {
    final PrologTerm ap = new CompoundPrologTerm("all");
    final PrologTerm weak_assumption = new CompoundPrologTerm("weakassumptions", ap);
    final PrologTerm strong_assumption = new CompoundPrologTerm("strongassumptions", ap);
    final PrologTerm and = new CompoundPrologTerm("and", strong_assumption, weak_assumption);
    final PrologTerm expected = new CompoundPrologTerm("fairnessimplication", and, TERM_TRUE);
    check("SEF & WEF => 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 23 with PrologTerm

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

the class PrologGeneratorTest method testForAllImplication.

@Test
public void testForAllImplication() throws Exception {
    final PrologTerm id = new CompoundPrologTerm("xyz");
    // ap(dpred(blubb))
    final PrologTerm pred = new CompoundPrologTerm("blubb");
    final PrologTerm dpred = new CompoundPrologTerm("dpred", pred);
    final PrologTerm ap = new CompoundPrologTerm("ap", dpred);
    // G [x]
    final PrologTerm transPred = new CompoundPrologTerm("x");
    final PrologTerm wrapped2 = new CompoundPrologTerm("dtrans", transPred);
    final PrologTerm action = new CompoundPrologTerm("action", wrapped2);
    final PrologTerm glob = new CompoundPrologTerm("globally", action);
    final PrologTerm expected = new CompoundPrologTerm("forall", id, ap, glob);
    check("!xyz. ( {blubb} => G [x])", 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 24 with PrologTerm

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

the class PrologGeneratorTest method testHistorically.

@Test
public void testHistorically() throws Exception {
    final PrologTerm expected = new CompoundPrologTerm("historically", TERM_TRUE);
    check("H 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 25 with PrologTerm

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

the class PrologGeneratorTest method testComplex2.

@Test
public void testComplex2() throws Exception {
    final PrologTerm pred1 = new CompoundPrologTerm("xxx");
    final PrologTerm wrapped1 = new CompoundPrologTerm("dpred", pred1);
    final PrologTerm ap1 = new CompoundPrologTerm("ap", wrapped1);
    final PrologTerm pred2 = new CompoundPrologTerm("blubb");
    final PrologTerm wrapped2 = new CompoundPrologTerm("dpred", pred2);
    final PrologTerm ap2 = new CompoundPrologTerm("ap", wrapped2);
    final PrologTerm fin = new CompoundPrologTerm("finally", ap2);
    final PrologTerm glob = new CompoundPrologTerm("globally", fin);
    final PrologTerm imp = new CompoundPrologTerm("implies", ap1, glob);
    final PrologTerm expected = new CompoundPrologTerm("not", imp);
    check("not({xxx} => GF {blubb})", 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