Class SolverBase

  • All Implemented Interfaces:
    Solver
    Direct Known Subclasses:
    BoolectorSolver, Cvc4Solver, Z3Solver

    public abstract class SolverBase
    extends java.lang.Object
    implements Solver
    The SolverBase class implements basic functionality of solver representation.
    • Constructor Summary

      Constructors 
      Constructor Description
      SolverBase​(java.lang.String name, java.lang.String description, java.util.Set<ConstraintKind> supportedKinds, boolean isGeneric, java.lang.String envVarName)
      Default constructor.
    • Constructor Detail

      • SolverBase

        public SolverBase​(java.lang.String name,
                          java.lang.String description,
                          java.util.Set<ConstraintKind> supportedKinds,
                          boolean isGeneric,
                          java.lang.String envVarName)
        Default constructor.
        Parameters:
        name - The solver name.
        description - The solver descriptor.
        supportedKinds - The supported kinds of constraints.
        isGeneric - The generic object flag.
        envVarName - The name of environment variable.
    • Method Detail

      • supportedKindCheck

        protected final void supportedKindCheck​(ConstraintKind kind)
      • getName

        public final java.lang.String getName()
        Description copied from interface: Solver
        Returns the name of the solver.
        Specified by:
        getName in interface Solver
        Returns:
        Solver name.
      • getDescription

        public final java.lang.String getDescription()
        Description copied from interface: Solver
        Returns the description of the solver.
        Specified by:
        getDescription in interface Solver
        Returns:
        solver description.
      • isSupported

        public final boolean isSupported​(ConstraintKind kind)
        Description copied from interface: Solver
        Check whether the specified constraint kind is supported by the solver.
        Specified by:
        isSupported in interface Solver
        Parameters:
        kind - Constraint kind.
        Returns:
        true if the constraint kind is supported or false otherwise.
      • isGeneric

        public final boolean isGeneric()
        Description copied from interface: Solver
        Returns true if the solver is generic and false if it is custom.
        Specified by:
        isGeneric in interface Solver
        Returns:
        true for generic solvers or false for custom ones.
      • getOperations

        public final java.util.Map<java.lang.Enum<?>,​SolverOperation> getOperations()
      • addCustomOperation

        public final boolean addCustomOperation​(Function function)
        Description copied from interface: Solver
        Register a custom operation that extends the functionality of the solver. The operation is implemented in terms of existing operations and represents a function.
        Specified by:
        addCustomOperation in interface Solver
        Parameters:
        function - Object describing the semantics and syntax of the function.
        Returns:
        true if no such operation has been previously registered or false otherwise.
      • addCustomOperation

        public final boolean addCustomOperation​(FunctionTemplate template)
        Description copied from interface: Solver
        Register a custom operation that extends the functionality of the solver. The operation is implemented in terms of existing operation and represents a family of functions derived from the same template. Functions share the same logic, but may operate on different data types.
        Specified by:
        addCustomOperation in interface Solver
        Parameters:
        template - Function template that describes the semantics and syntax of a family of similar functions.
        Returns:
        true if no such operation has been previously registered or false otherwise.
      • addStandardOperation

        protected final void addStandardOperation​(StandardOperation id,
                                                  java.lang.String text)
      • getSolverPath

        public java.lang.String getSolverPath()
        Description copied from interface: Solver
        Returns the path to the external solver executable used by the current solver object.
        Specified by:
        getSolverPath in interface Solver
        Returns:
        Path
      • setSolverPath

        public void setSolverPath​(java.lang.String value)
        Description copied from interface: Solver
        Sets the path to the external solver executable used by the current solver object.
        Specified by:
        setSolverPath in interface Solver
        Parameters:
        value - Path