Search in sources :

Example 1 with EventB

use of de.prob.animator.domainobjects.EventB in project prob2 by bendisposto.

the class BeforeAfterPredicateCommand method processResult.

@Override
public void processResult(final ISimplifiedROMap<String, PrologTerm> bindings) {
    CompoundPrologTerm compoundTerm = BindingGenerator.getCompoundTerm(bindings.get(BA_PRED_VARIABLE), 0);
    String code = compoundTerm.getFunctor();
    result = new EventB(code, FormulaExpand.EXPAND);
}
Also used : EventB(de.prob.animator.domainobjects.EventB) CompoundPrologTerm(de.prob.prolog.term.CompoundPrologTerm)

Example 2 with EventB

use of de.prob.animator.domainobjects.EventB in project prob2 by bendisposto.

the class TheoryExtractor method addGiven.

private void addGiven(final Attributes attributes) {
    String predicate = attributes.getValue("org.eventb.core.predicate");
    given.add(new EventB(predicate, typeEnv, FormulaExpand.EXPAND));
}
Also used : EventB(de.prob.animator.domainobjects.EventB)

Example 3 with EventB

use of de.prob.animator.domainobjects.EventB in project prob2 by bendisposto.

the class TheoryTranslator method printRecursiveDefinition.

private void printRecursiveDefinition(final RecursiveOperatorDefinition definition, final IPrologTermOutput pto) {
    EventB inductiveArgument = definition.getInductiveArgument();
    pto.openList();
    ModelElementList<RecursiveDefinitionCase> cases = definition.getCases();
    for (RecursiveDefinitionCase c : cases) {
        printRecursiveCase(inductiveArgument, c, pto);
    }
    pto.closeList();
}
Also used : RecursiveDefinitionCase(de.prob.model.eventb.theory.RecursiveDefinitionCase) EventB(de.prob.animator.domainobjects.EventB)

Example 4 with EventB

use of de.prob.animator.domainobjects.EventB in project prob2 by bendisposto.

the class RecursiveDefinitionCase method parseCase.

public void parseCase(final Set<IFormulaExtension> typeEnv) {
    expression = new EventB(expressionString, typeEnv, FormulaExpand.EXPAND);
    formula = new EventB(formulaString, typeEnv, FormulaExpand.EXPAND);
}
Also used : EventB(de.prob.animator.domainobjects.EventB)

Example 5 with EventB

use of de.prob.animator.domainobjects.EventB in project prob2 by bendisposto.

the class ContextTranslator method processConstants.

private List<PContextClause> processConstants() {
    List<PContextClause> constants = new ArrayList<>();
    List<PExpression> concrete = new ArrayList<>();
    List<PExpression> abstractC = new ArrayList<>();
    for (EventBConstant eventBConstant : context.getConstants()) {
        if (eventBConstant.isAbstract()) {
            abstractC.add((PExpression) ((EventB) eventBConstant.getExpression()).getAst());
        } else {
            concrete.add((PExpression) ((EventB) eventBConstant.getExpression()).getAst());
        }
    }
    constants.add(new AConstantsContextClause(concrete));
    constants.add(new AAbstractConstantsContextClause(abstractC));
    return constants;
}
Also used : AConstantsContextClause(de.be4.classicalb.core.parser.node.AConstantsContextClause) EventB(de.prob.animator.domainobjects.EventB) ArrayList(java.util.ArrayList) EventBConstant(de.prob.model.eventb.EventBConstant) PExpression(de.be4.classicalb.core.parser.node.PExpression) PContextClause(de.be4.classicalb.core.parser.node.PContextClause) AAbstractConstantsContextClause(de.be4.classicalb.core.parser.node.AAbstractConstantsContextClause)

Aggregations

EventB (de.prob.animator.domainobjects.EventB)12 CompoundPrologTerm (de.prob.prolog.term.CompoundPrologTerm)5 ClassicalB (de.prob.animator.domainobjects.ClassicalB)4 AAbstractConstantsContextClause (de.be4.classicalb.core.parser.node.AAbstractConstantsContextClause)1 AConstantsContextClause (de.be4.classicalb.core.parser.node.AConstantsContextClause)1 PContextClause (de.be4.classicalb.core.parser.node.PContextClause)1 PExpression (de.be4.classicalb.core.parser.node.PExpression)1 EventBConstant (de.prob.model.eventb.EventBConstant)1 RecursiveDefinitionCase (de.prob.model.eventb.theory.RecursiveDefinitionCase)1 ArrayList (java.util.ArrayList)1 Set (java.util.Set)1