Search in sources :

Example 1 with AAxiomsContextClause

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

the class ContextTranslator method processAxiomsAndTheorems.

private List<PContextClause> processAxiomsAndTheorems() {
    List<PContextClause> axiomsAndThms = new ArrayList<>();
    List<PPredicate> axioms = new ArrayList<>();
    List<PPredicate> thms = new ArrayList<>();
    for (EventBAxiom axiom : context.getAxioms()) {
        PPredicate ppred = (PPredicate) ((EventB) axiom.getPredicate()).getAst();
        nodeInfos.put(ppred, new Tuple2<>(context.getName(), axiom.getName()));
        if (axiom.isTheorem()) {
            thms.add(ppred);
        } else {
            axioms.add(ppred);
        }
    }
    axiomsAndThms.add(new AAxiomsContextClause(axioms));
    axiomsAndThms.add(new ATheoremsContextClause(thms));
    return axiomsAndThms;
}
Also used : EventBAxiom(de.prob.model.eventb.EventBAxiom) ArrayList(java.util.ArrayList) ATheoremsContextClause(de.be4.classicalb.core.parser.node.ATheoremsContextClause) PPredicate(de.be4.classicalb.core.parser.node.PPredicate) AAxiomsContextClause(de.be4.classicalb.core.parser.node.AAxiomsContextClause) PContextClause(de.be4.classicalb.core.parser.node.PContextClause)

Aggregations

AAxiomsContextClause (de.be4.classicalb.core.parser.node.AAxiomsContextClause)1 ATheoremsContextClause (de.be4.classicalb.core.parser.node.ATheoremsContextClause)1 PContextClause (de.be4.classicalb.core.parser.node.PContextClause)1 PPredicate (de.be4.classicalb.core.parser.node.PPredicate)1 EventBAxiom (de.prob.model.eventb.EventBAxiom)1 ArrayList (java.util.ArrayList)1