Search in sources :

Example 6 with PrologTerm

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

the class PrologGeneratorTest method testExistsImplication.

@Test
public void testExistsImplication() throws Exception {
    final PrologTerm id = new CompoundPrologTerm("x");
    // 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("exists", id, ap, glob);
    check("#x. ( {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 7 with PrologTerm

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

the class PrologGeneratorTest method testCurrent.

@Test
public void testCurrent() throws Exception {
    final PrologTerm root = new CompoundPrologTerm("root");
    final PrologTerm stateid = new CompoundPrologTerm("stateid", root);
    final PrologTerm expected = new CompoundPrologTerm("ap", stateid);
    check("current", 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 8 with PrologTerm

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

the class PrologGeneratorTest method testPredicate.

@Test
public void testPredicate() throws Exception {
    final PrologTerm pred = new CompoundPrologTerm("blubb");
    final PrologTerm wrapped = new CompoundPrologTerm("dpred", pred);
    final PrologTerm expected = new CompoundPrologTerm("ap", wrapped);
    check("{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)

Example 9 with PrologTerm

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

the class PrologGeneratorTest method testRelease.

@Test
public void testRelease() throws Exception {
    final PrologTerm expected = new CompoundPrologTerm("release", TERM_FALSE, TERM_TRUE);
    check("false R      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 10 with PrologTerm

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

the class PrologGeneratorTest method testWeakFairCapital.

@Test
public void testWeakFairCapital() 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)

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