use of de.prob.animator.domainobjects.ClassicalB in project prob2 by bendisposto.
the class ConstraintBasedDeadlockCheckCommand method writeCommand.
@Override
public void writeCommand(final IPrologTermOutput pto) {
pto.openTerm(PROLOG_COMMAND_NAME);
if (formula != null) {
formula.printProlog(pto);
} else {
new ClassicalB("1=1", FormulaExpand.EXPAND).printProlog(pto);
}
pto.printVariable(RESULT_VARIABLE);
pto.closeTerm();
}
use of de.prob.animator.domainobjects.ClassicalB in project prob2 by bendisposto.
the class UnsatRegularCoreCommand method processResult.
@Override
public void processResult(ISimplifiedROMap<String, PrologTerm> bindings) {
CompoundPrologTerm compoundTerm = BindingGenerator.getCompoundTerm(bindings.get(RESULT_VARIABLE), 0);
String code = compoundTerm.getFunctor();
if (pred instanceof EventB) {
core = new EventB(code, FormulaExpand.EXPAND);
} else {
core = new ClassicalB(code, FormulaExpand.EXPAND);
}
}
use of de.prob.animator.domainobjects.ClassicalB in project prob2 by bendisposto.
the class WeakestPreconditionCommand method processResult.
@Override
public void processResult(final ISimplifiedROMap<String, PrologTerm> bindings) {
CompoundPrologTerm compoundTerm = BindingGenerator.getCompoundTerm(bindings.get(WEAKEST_PRECONDITION_VARIABLE), 0);
String code = compoundTerm.getFunctor();
if (predicate instanceof EventB) {
result = new EventB(code, FormulaExpand.EXPAND);
} else {
result = new ClassicalB(code, FormulaExpand.EXPAND);
}
}
use of de.prob.animator.domainobjects.ClassicalB in project prob2 by bendisposto.
the class StateSpace method isValidOperation.
/**
* Tests to see if a combination of an operation name and a predicate is
* valid from a given state.
*
* @param stateId
* {@link State} id for state to test
* @param name
* {@link String} name of operation
* @param predicate
* {@link String} predicate to test
* @return true, if the operation is valid from the given state. False
* otherwise.
*/
public boolean isValidOperation(final State stateId, final String name, final String predicate) {
final ClassicalB pred = new ClassicalB(predicate, FormulaExpand.EXPAND);
GetOperationByPredicateCommand command = new GetOperationByPredicateCommand(this, stateId.getId(), name, pred, 1);
execute(command);
return !command.hasErrors();
}
Aggregations