Class AbstractEvaluator<TFormulaInfo,TType,TEnv>
- java.lang.Object
-
- org.sosy_lab.java_smt.basicimpl.AbstractEvaluator<TFormulaInfo,TType,TEnv>
-
- All Implemented Interfaces:
AutoCloseable,Evaluator
- Direct Known Subclasses:
AbstractModel
public abstract class AbstractEvaluator<TFormulaInfo,TType,TEnv> extends Object implements Evaluator
-
-
Field Summary
Fields Modifier and Type Field Description protected FormulaCreator<TFormulaInfo,TType,TEnv,?>creator
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractEvaluator(AbstractProver<?> pProver, FormulaCreator<TFormulaInfo,TType,TEnv,?> creator)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()Free resources associated with this evaluator (existingFormulainstances stay valid, butEvaluator.evaluate(Formula)etc.<T extends Formula>
@Nullable Teval(T f)Evaluate a given formula substituting the values from the model and return it as formula.protected abstract @Nullable TFormulaInfoevalImpl(TFormulaInfo formula)Simplify the given formula and replace all symbols with their model values.@Nullable BigIntegerevaluate(BitvectorFormula f)Type-safe evaluation for bitvector formulas.@Nullable Booleanevaluate(BooleanFormula f)Type-safe evaluation for boolean formulas.@Nullable Stringevaluate(EnumerationFormula f)Type-safe evaluation for enumeration formulas.@Nullable FloatingPointNumberevaluate(FloatingPointFormula f)Type-safe evaluation for floating-point formulas.@Nullable Objectevaluate(Formula f)Evaluate a given formula substituting the values from the model.@Nullable BigIntegerevaluate(NumeralFormula.IntegerFormula f)Type-safe evaluation for integer formulas.@Nullable Rationalevaluate(NumeralFormula.RationalFormula f)Type-safe evaluation for rational formulas.@Nullable Stringevaluate(StringFormula f)Type-safe evaluation for string formulas.protected @Nullable ObjectevaluateImpl(TFormulaInfo f)Simplify the given formula and replace all symbols with their model values.protected booleanisClosed()
-
-
-
Field Detail
-
creator
protected final FormulaCreator<TFormulaInfo,TType,TEnv,?> creator
-
-
Constructor Detail
-
AbstractEvaluator
protected AbstractEvaluator(AbstractProver<?> pProver, FormulaCreator<TFormulaInfo,TType,TEnv,?> creator)
-
-
Method Detail
-
eval
public final <T extends Formula> @Nullable T eval(T f)
Description copied from interface:EvaluatorEvaluate a given formula substituting the values from the model and return it as formula.If a value is not relevant to the satisfiability result, the solver can choose either to insert an arbitrary value (e.g., the value
0for the matching type) or just returnnull.The formula does not need to be a variable, we also allow complex expression. The solver will replace all symbols from the formula with their model values and then simplify the formula into a simple formula, e.g., consisting only of a numeral expression.
-
evaluate
public final @Nullable BigInteger evaluate(NumeralFormula.IntegerFormula f)
Description copied from interface:EvaluatorType-safe evaluation for integer formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public @Nullable Rational evaluate(NumeralFormula.RationalFormula f)
Description copied from interface:EvaluatorType-safe evaluation for rational formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public final @Nullable Boolean evaluate(BooleanFormula f)
Description copied from interface:EvaluatorType-safe evaluation for boolean formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public final @Nullable String evaluate(StringFormula f)
Description copied from interface:EvaluatorType-safe evaluation for string formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public final @Nullable String evaluate(EnumerationFormula f)
Description copied from interface:EvaluatorType-safe evaluation for enumeration formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public final @Nullable FloatingPointNumber evaluate(FloatingPointFormula f)
Description copied from interface:EvaluatorType-safe evaluation for floating-point formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public final @Nullable BigInteger evaluate(BitvectorFormula f)
Description copied from interface:EvaluatorType-safe evaluation for bitvector formulas.The formula does not need to be a variable, we also allow complex expression.
-
evaluate
public final @Nullable Object evaluate(Formula f)
Description copied from interface:EvaluatorEvaluate a given formula substituting the values from the model.If a value is not relevant to the satisfiability result, the model can choose either an arbitrary value (e.g., the value
0for the matching type) or just returnnull.The formula does not need to be a variable, we also allow complex expression.
-
evalImpl
protected abstract @Nullable TFormulaInfo evalImpl(TFormulaInfo formula)
Simplify the given formula and replace all symbols with their model values. If a symbol is not set in the model and evaluation aborts, returnnull.
-
evaluateImpl
protected final @Nullable Object evaluateImpl(TFormulaInfo f)
Simplify the given formula and replace all symbols with their model values. If a symbol is not set in the model and evaluation aborts, returnnull. Afterward convert the formula into a Java object as far as possible, i.e., try to match a primitive or simple type.
-
isClosed
protected boolean isClosed()
-
close
public void close()
Description copied from interface:EvaluatorFree resources associated with this evaluator (existingFormulainstances stay valid, butEvaluator.evaluate(Formula)etc. must not be called again).- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceEvaluator
-
-