Search in sources :

Example 11 with PPredicate

use of de.be4.classicalb.core.parser.node.PPredicate in project prob2 by bendisposto.

the class EventBMachineTranslator method processInvariantsAndTheorems.

private List<PModelClause> processInvariantsAndTheorems() {
    List<PModelClause> invsAndTheorems = new ArrayList<>();
    List<PPredicate> invs = new ArrayList<>();
    List<PPredicate> thms = new ArrayList<>();
    List<EventBInvariant> allInvs = machine.getInvariants();
    for (EventBInvariant ebInv : allInvs) {
        PPredicate ppred = (PPredicate) ((EventB) ebInv.getPredicate()).getAst();
        nodeInfos.put(ppred, new Tuple2<>(machine.getName(), ebInv.getName()));
        if (ebInv.isTheorem()) {
            thms.add(ppred);
        } else {
            invs.add(ppred);
        }
    }
    invsAndTheorems.add(new AInvariantModelClause(invs));
    invsAndTheorems.add(new ATheoremsModelClause(thms));
    return invsAndTheorems;
}
Also used : PModelClause(de.be4.classicalb.core.parser.node.PModelClause) AInvariantModelClause(de.be4.classicalb.core.parser.node.AInvariantModelClause) ArrayList(java.util.ArrayList) PPredicate(de.be4.classicalb.core.parser.node.PPredicate) ATheoremsModelClause(de.be4.classicalb.core.parser.node.ATheoremsModelClause) EventBInvariant(de.prob.model.eventb.EventBInvariant)

Aggregations

PPredicate (de.be4.classicalb.core.parser.node.PPredicate)10 ArrayList (java.util.ArrayList)6 PSubstitution (de.be4.classicalb.core.parser.node.PSubstitution)3 AEqualPredicate (de.be4.classicalb.core.parser.node.AEqualPredicate)2 AEvent (de.be4.classicalb.core.parser.node.AEvent)2 AEventsModelClause (de.be4.classicalb.core.parser.node.AEventsModelClause)2 AWitness (de.be4.classicalb.core.parser.node.AWitness)2 PEvent (de.be4.classicalb.core.parser.node.PEvent)2 PExpression (de.be4.classicalb.core.parser.node.PExpression)2 PModelClause (de.be4.classicalb.core.parser.node.PModelClause)2 PWitness (de.be4.classicalb.core.parser.node.PWitness)2 TIdentifierLiteral (de.be4.classicalb.core.parser.node.TIdentifierLiteral)2 Test (org.junit.Test)2 BParser (de.be4.classicalb.core.parser.BParser)1 IDefinitions (de.be4.classicalb.core.parser.IDefinitions)1 CheckException (de.be4.classicalb.core.parser.exceptions.CheckException)1 AAssignSubstitution (de.be4.classicalb.core.parser.node.AAssignSubstitution)1 AAxiomsContextClause (de.be4.classicalb.core.parser.node.AAxiomsContextClause)1 AConjunctPredicate (de.be4.classicalb.core.parser.node.AConjunctPredicate)1 AEventBModelParseUnit (de.be4.classicalb.core.parser.node.AEventBModelParseUnit)1