Search in sources :

Example 1 with ATheoremsModelClause

use of de.be4.classicalb.core.parser.node.ATheoremsModelClause 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

AInvariantModelClause (de.be4.classicalb.core.parser.node.AInvariantModelClause)1 ATheoremsModelClause (de.be4.classicalb.core.parser.node.ATheoremsModelClause)1 PModelClause (de.be4.classicalb.core.parser.node.PModelClause)1 PPredicate (de.be4.classicalb.core.parser.node.PPredicate)1 EventBInvariant (de.prob.model.eventb.EventBInvariant)1 ArrayList (java.util.ArrayList)1