Search in sources :

Example 1 with EvaluationException

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

the class CSPModel method checkSyntax.

@Override
public boolean checkSyntax(final String formula) {
    try {
        CSP element = (CSP) parseFormula(formula, FormulaExpand.TRUNCATE);
        element.printProlog(new PrologTermStringOutput());
        return true;
    } catch (EvaluationException e) {
        return false;
    }
}
Also used : CSP(de.prob.animator.domainobjects.CSP) PrologTermStringOutput(de.prob.prolog.output.PrologTermStringOutput) EvaluationException(de.prob.animator.domainobjects.EvaluationException)

Aggregations

CSP (de.prob.animator.domainobjects.CSP)1 EvaluationException (de.prob.animator.domainobjects.EvaluationException)1 PrologTermStringOutput (de.prob.prolog.output.PrologTermStringOutput)1