Interface Model

    • Method Detail

      • eval

        <T extends Formula> @Nullable T eval​(T formula)
        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.

        Parameters:
        formula - Input formula to be evaluated.
        Returns:
        evaluation of the given formula or null if the solver does not provide a better evaluation.
      • evaluate

        @Nullable Object evaluate​(Formula f)
        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.

        Parameters:
        f - Input formula
        Returns:
        Either of: - Number (Rational/Double/BigInteger/Long/Integer) - Boolean
        Throws:
        IllegalArgumentException - if a formula has unexpected type, e.g. Array.
      • evaluate

        @Nullable BigInteger evaluate​(NumeralFormula.IntegerFormula f)
        Type-safe evaluation for integer formulas.

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

      • evaluate

        @Nullable Rational evaluate​(NumeralFormula.RationalFormula f)
        Type-safe evaluation for rational formulas.

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

      • evaluate

        @Nullable Boolean evaluate​(BooleanFormula f)
        Type-safe evaluation for boolean formulas.

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

      • evaluate

        @Nullable BigInteger evaluate​(BitvectorFormula f)
        Type-safe evaluation for bitvector formulas.

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

      • evaluate

        @Nullable String evaluate​(StringFormula f)
        Type-safe evaluation for string formulas.

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

      • toString

        String toString()
        Pretty-printing of the model values.

        Please only use this method for debugging and not for retrieving relevant information about the model. The returned model representation is not intended for further usage like parsing, because we do not guarantee any specific format, e.g., for arrays and uninterpreted functions, and we allow the SMT solver to include arbitrary additional information about the current solver state, e.g., any available symbol in the solver, even from other provers, and temporary internal symbols.

        Overrides:
        toString in class Object