Class AbstractModel<TFormulaInfo,​TType,​TEnv>

    • Method Detail

      • eval

        public <T extends Formula> @Nullable T eval​(T f)
        Description copied from interface: Model
        Evaluate 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 0 for the matching type) or just return null.

        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.

        Specified by:
        eval in interface Model
        Parameters:
        f - Input formula to be evaluated.
        Returns:
        evaluation of the given formula or null if the solver does not provide a better evaluation.
      • evaluate

        public @Nullable BigInteger evaluate​(NumeralFormula.IntegerFormula f)
        Description copied from interface: Model
        Type-safe evaluation for integer formulas.

        The formula does not need to be a variable, we also allow complex expression.

        Specified by:
        evaluate in interface Model
      • evaluate

        public @Nullable Rational evaluate​(NumeralFormula.RationalFormula f)
        Description copied from interface: Model
        Type-safe evaluation for rational formulas.

        The formula does not need to be a variable, we also allow complex expression.

        Specified by:
        evaluate in interface Model
      • evaluate

        public @Nullable Boolean evaluate​(BooleanFormula f)
        Description copied from interface: Model
        Type-safe evaluation for boolean formulas.

        The formula does not need to be a variable, we also allow complex expression.

        Specified by:
        evaluate in interface Model
      • evaluate

        public @Nullable BigInteger evaluate​(BitvectorFormula f)
        Description copied from interface: Model
        Type-safe evaluation for bitvector formulas.

        The formula does not need to be a variable, we also allow complex expression.

        Specified by:
        evaluate in interface Model
      • evaluate

        public final @Nullable Object evaluate​(Formula f)
        Description copied from interface: Model
        Evaluate 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 0 for the matching type) or just return null.

        The formula does not need to be a variable, we also allow complex expression.

        Specified by:
        evaluate in interface Model
        Parameters:
        f - Input formula
        Returns:
        Either of: - Number (Rational/Double/BigInteger/Long/Integer) - Boolean
      • 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, return null.
      • evaluateImpl

        protected @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, return null. Afterwards convert the formula into a Java object as far as possible, i.e., try to match a primitive or simple type.
      • toString

        public String toString()
        Description copied from interface: Model
        Pretty-printing of the model values.
        Specified by:
        toString in interface Model
        Overrides:
        toString in class Object