Class InterpolatingProverWithAssumptionsWrapper<T>

java.lang.Object
org.sosy_lab.java_smt.basicimpl.withAssumptionsWrapper.BasicProverWithAssumptionsWrapper<T,InterpolatingProverEnvironment<T>>
org.sosy_lab.java_smt.basicimpl.withAssumptionsWrapper.InterpolatingProverWithAssumptionsWrapper<T>
All Implemented Interfaces:
AutoCloseable, BasicProverEnvironment<T>, InterpolatingProverEnvironment<T>

public class InterpolatingProverWithAssumptionsWrapper<T> extends BasicProverWithAssumptionsWrapper<T,InterpolatingProverEnvironment<T>> implements InterpolatingProverEnvironment<T>
  • Constructor Details

  • Method Details

    • getInterpolant

      public BooleanFormula getInterpolant(Collection<T> pFormulasOfA) throws SolverException, InterruptedException
      Description copied from interface: InterpolatingProverEnvironment
      Get an interpolant for two groups of formulas. This should be called only immediately after an BasicProverEnvironment.isUnsat() call that returned true.

      There is no direct guarantee that the interpolants returned are part of an inductive sequence', however this seems to work for most (all?) solvers as long as the same proof is used, i.e. all interpolants are computed after the same SAT-check.

      Specified by:
      getInterpolant in interface InterpolatingProverEnvironment<T>
      Parameters:
      pFormulasOfA - A collection of values returned by BasicProverEnvironment.push(BooleanFormula). All the corresponding formulas from group A, the remaining formulas form group B.
      Returns:
      An interpolant for A and B
      Throws:
      SolverException - if interpolant cannot be computed, for example because interpolation procedure is incomplete
      InterruptedException
    • getSeqInterpolants

      public List<BooleanFormula> getSeqInterpolants(List<? extends Collection<T>> pPartitionedFormulas) throws SolverException, InterruptedException
      Description copied from interface: InterpolatingProverEnvironment
      This method returns interpolants of an 'inductive sequence'. This property must be supported by the interpolation-strategy of the underlying SMT-solver! Depending on the underlying SMT-solver this method might be faster than N direct calls to getInterpolant().

      The prover stack should contain the partitioned formulas, but any order is allowed. For an input of N partitions we return N-1 interpolants. Any asserted formula that is on the prover stack and not part of the partitioned list, will be used for background theory and its symbols can appear in any interpolant.

      Specified by:
      getSeqInterpolants in interface InterpolatingProverEnvironment<T>
      Returns:
      a 'inductive sequence' of interpolants, such that the implication AND(I_i, P_i) => I_(i+1) is satisfied for all i, where P_i is the conjunction of all formulas in partition i.
      Throws:
      SolverException - if interpolant cannot be computed, for example because interpolation procedure is incomplete
      InterruptedException
    • getTreeInterpolants

      public List<BooleanFormula> getTreeInterpolants(List<? extends Collection<T>> pPartitionedFormulas, int[] pStartOfSubTree) throws SolverException, InterruptedException
      Description copied from interface: InterpolatingProverEnvironment
      Compute a sequence of interpolants. The nesting array describes the start of the subtree for tree interpolants. For inductive sequences of interpolants use a nesting array completely filled with 0.

      Example:

       A  D
       |  |
       B  E
       | /
       C
       |
       F  H
       | /
       G
      
       arrayIndex     = [0,1,2,3,4,5,6,7]  // only for demonstration, not needed
       partition      = [A,B,D,E,C,F,H,G]  // post-order of tree
       startOfSubTree = [0,0,2,2,0,0,6,0]  // index of left-most leaf of the current element
       

      The prover stack should contain the partitioned formulas. For an input of N partitions (nodes in the tree) we return N-1 interpolants (one interpolant for/below each node except the root). Any asserted formula that is on the prover stack and not part of the partitioned list, will be used for background theory and its symbols can appear in any interpolant.

      Specified by:
      getTreeInterpolants in interface InterpolatingProverEnvironment<T>
      Parameters:
      pPartitionedFormulas - of formulas
      pStartOfSubTree - The start of the subtree containing the formula at this index as root.
      Returns:
      Tree interpolants respecting the nesting relation.
      Throws:
      SolverException - if interpolant cannot be computed, for example because interpolation procedure is incomplete
      InterruptedException
    • registerPushedFormula

      protected void registerPushedFormula(T pPushResult)
      Description copied from class: BasicProverWithAssumptionsWrapper
      overridden in sub-class.
      Overrides:
      registerPushedFormula in class BasicProverWithAssumptionsWrapper<T,InterpolatingProverEnvironment<T>>
    • clearAssumptions

      protected void clearAssumptions()
      Overrides:
      clearAssumptions in class BasicProverWithAssumptionsWrapper<T,InterpolatingProverEnvironment<T>>