public interface Script
Option | Type |
---|---|
:print-success | Boolean |
:produce-proofs | Boolean |
:produce-assignments | Boolean |
:produce-models | Boolean |
:regular-output-channel | String |
:diagnostic-output-channel | String |
:verbosity | Integer |
:interactive-mode | Boolean |
:random-seed | BigInteger |
:timeout | BigInteger |
Modifier and Type | Interface and Description |
---|---|
static class |
Script.LBool
A lifted three valued Boolean datatype.
|
Modifier and Type | Field and Description |
---|---|
static Sort[] |
EMPTY_SORT_ARRAY |
static Term[] |
EMPTY_TERM_ARRAY |
static int |
EXISTS
Constant representing existential quantification.
|
static int |
FORALL
Constant representing universal quantification.
|
Modifier and Type | Method and Description |
---|---|
Term |
annotate(Term t,
Annotation... annotations)
Annotate a term.
|
Script.LBool |
assertTerm(Term term)
Assert a Boolean term into the solver.
|
Term |
binary(java.lang.String bin)
Create a binary term.
|
java.lang.Iterable<Term[]> |
checkAllsat(Term[] predicates)
Perform an AllSAT computation over some important predicates.
|
Script.LBool |
checkSat()
Check for satisfiability of the current context.
|
Script.LBool |
checkSatAssuming(Term... assumptions)
Check for satisfiability of the current context under additional
assumptions.
|
Term |
decimal(java.math.BigDecimal decimal)
Create a decimal term.
|
Term |
decimal(java.lang.String decimal)
Create a decimal term.
|
void |
declareFun(java.lang.String fun,
Sort[] paramSorts,
Sort resultSort)
Declare a function symbol.
|
void |
declareSort(java.lang.String sort,
int arity)
Declare a user-defined sort.
|
void |
defineFun(java.lang.String fun,
TermVariable[] params,
Sort resultSort,
Term definition)
Define an alias of a function symbol.
|
void |
defineSort(java.lang.String sort,
Sort[] sortParams,
Sort definition)
Define an alias of a sort.
|
QuotedObject |
echo(QuotedObject msg)
Echo a message on the regular output channel of the solver.
|
void |
exit()
Exit the solver.
|
Term[] |
findImpliedEquality(Term[] x,
Term[] y)
Try to find an equality between
x and y that
is implied in the current satisfiable context. |
Term[] |
getAssertions()
Get all assertions contained in the assertion stack.
|
Assignments |
getAssignment()
Get values for all named boolean terms in the model.
|
java.lang.Object |
getInfo(java.lang.String info)
Get information from the solver.
|
Term[] |
getInterpolants(Term[] partition)
Get interpolants for the partitions.
|
Term[] |
getInterpolants(Term[] partition,
int[] startOfSubtree)
Compute a sequence of interpolants.
|
Model |
getModel()
Retrieve a complete model from the solver.
|
java.lang.Object |
getOption(java.lang.String opt)
Get the value of an option.
|
Term |
getProof()
Trigger a call to a proof processor.
|
Term[] |
getUnsatAssumptions()
Get the unsatisfiable assumptions.
|
Term[] |
getUnsatCore()
Get the unsat core.
|
java.util.Map<Term,Term> |
getValue(Term[] terms)
Get values for some terms in the model.
|
Term |
hexadecimal(java.lang.String hex)
Create a hexadecimal term.
|
Term |
let(TermVariable[] vars,
Term[] values,
Term body)
Create a let term.
|
Term |
numeral(java.math.BigInteger num)
Create a numeral term.
|
Term |
numeral(java.lang.String num)
Create a numeral term.
|
void |
pop(int levels)
Pop some levels from the assertion stack.
|
void |
push(int levels)
Push some levels onto the assertion stack.
|
Term |
quantifier(int quantor,
TermVariable[] vars,
Term body,
Term[]... patterns)
Create a quantified formula.
|
void |
reset()
Reset the solver completely.
|
void |
resetAssertions()
Resets the assertion stack.
|
void |
setInfo(java.lang.String info,
java.lang.Object value)
Set some information for the solver.
|
void |
setLogic(Logics logic)
Set the logic for the solver.
|
void |
setLogic(java.lang.String logic)
Set the logic for the solver.
|
void |
setOption(java.lang.String opt,
java.lang.Object value)
Set an option for the solver.
|
Term |
simplify(Term term)
Simplify a term.
|
Sort |
sort(java.lang.String sortname,
java.math.BigInteger[] indices,
Sort... params)
Instantiate an indexed n-ary sort with parameters.
|
Sort |
sort(java.lang.String sortname,
Sort... params)
Instantiate an n-ary sort with parameters.
|
Sort[] |
sortVariables(java.lang.String... names)
Create an array of sort parameters.
|
Term |
string(java.lang.String str)
Create a string term.
|
Term |
term(java.lang.String funcname,
java.math.BigInteger[] indices,
Sort returnSort,
Term... params)
Create an n-ary term by name, indices and return sort.
|
Term |
term(java.lang.String funcname,
Term... params)
Create an n-ary term by name.
|
TermVariable |
variable(java.lang.String varname,
Sort sort)
Create a term variable.
|
static final Sort[] EMPTY_SORT_ARRAY
static final Term[] EMPTY_TERM_ARRAY
static final int FORALL
static final int EXISTS
void setLogic(java.lang.String logic) throws java.lang.UnsupportedOperationException, SMTLIBException
Logics
enumeration.logic
- Name of the logic to set.java.lang.UnsupportedOperationException
- If the logic is not supported by
the solver.SMTLIBException
- If a logic is already set.void setLogic(Logics logic) throws java.lang.UnsupportedOperationException, SMTLIBException
logic
- Name of the logic to set.java.lang.UnsupportedOperationException
- If the logic is not supported by
the solver.SMTLIBException
- If a logic is already set.void setOption(java.lang.String opt, java.lang.Object value) throws java.lang.UnsupportedOperationException, SMTLIBException
opt
- Name of the option. Note that it has to start with
:.
value
- Value for this option.java.lang.UnsupportedOperationException
- If the option is unsupported.SMTLIBException
- In case of type errors.void setInfo(java.lang.String info, java.lang.Object value)
info
- Name of the info. Note that it has to start with
:.
value
- Value for this info.void declareSort(java.lang.String sort, int arity) throws SMTLIBException
sort
- The name of the new sort.arity
- The arity of the new sort.SMTLIBException
- If no logic is set, the logic does not allow
user-defined sorts, or a sort with this
name already exists.void defineSort(java.lang.String sort, Sort[] sortParams, Sort definition) throws SMTLIBException
sort
- Name of the alias.sortParams
- Sort parameters.definition
- Original sort.SMTLIBException
- If no logic is set, the logic does not allow
user-defined sorts, or a sort with this
name already exists.void declareFun(java.lang.String fun, Sort[] paramSorts, Sort resultSort) throws SMTLIBException
fun
- Name of the function symbol.paramSorts
- Sorts of the parameters.resultSort
- Sort of the result of an application of this function.SMTLIBException
- If the logic is not set, the logic is not an UF
logic but the function takes parameters, or a
function with this name already exists.void defineFun(java.lang.String fun, TermVariable[] params, Sort resultSort, Term definition) throws SMTLIBException
fun
- Name of the alias.params
- Parameters of the alias.resultSort
- Return sort of the alias.definition
- Definition of the function alias.SMTLIBException
- If the logic is not set, the logic is not an UF
logic but the function takes parameters, or a
function with this name already exists.void push(int levels) throws SMTLIBException
levels
- The number of levels to push.SMTLIBException
- If logic is not set.void pop(int levels) throws SMTLIBException
levels
- The number of levels to pop.SMTLIBException
- If not enough stack levels are available.Script.LBool assertTerm(Term term) throws SMTLIBException
Script.LBool.UNKNOWN
.term
- The Boolean term to assert.SMTLIBException
- If the term is not Boolean or a named term
matches an already defined function.Script.LBool checkSat() throws SMTLIBException
Script.LBool.UNKNOWN
in case of
errors.SMTLIBException
- If the logic is not set.Script.LBool checkSatAssuming(Term... assumptions) throws SMTLIBException
Script.LBool.UNKNOWN
in case of
errors.assumptions
- Additional assumptions as Boolean constants (nullary
ApplicationTerms of sort Bool or their negations).SMTLIBException
- If the logic is not set.Term[] getAssertions() throws SMTLIBException
setOption
(":interactive-mode", true).SMTLIBException
- If interactive mode is not enabled.Term getProof() throws SMTLIBException, java.lang.UnsupportedOperationException
checkSat()
returned Script.LBool.UNSAT
. To enable proof production, call
setOption
(":produce-proofs", true).SMTLIBException
- If proof production is not enabled or the solver
did not detect unsatisfiability.java.lang.UnsupportedOperationException
- If proof generation is unsupported.Term[] getUnsatCore() throws SMTLIBException, java.lang.UnsupportedOperationException
checkSat()
returned
Script.LBool.UNSAT
. To enable unsat core production, call
setOption
(":produce-unsat-cores",
true).SMTLIBException
- If proof production is not enabled or the solver
did not detect unsatisfiability.java.lang.UnsupportedOperationException
- If unsat core computation is
unsupported.Term[] getUnsatAssumptions() throws SMTLIBException, java.lang.UnsupportedOperationException
checkSatAssuming(Term...)
returned
Script.LBool.UNSAT
. To enable unsat assumption production, call
setOption
(":produce-unsat-assumptions", true).SMTLIBException
- If unsat assumption production is not enabled or
the solver did not detect unsatisfiability.java.lang.UnsupportedOperationException
- If unsat assumption computation is
unsupported.java.util.Map<Term,Term> getValue(Term[] terms) throws SMTLIBException, java.lang.UnsupportedOperationException
checkSat()
did not return Script.LBool.UNSAT
. To enable model production, call
setOption
(":produce-models", true).terms
- an array of terms whose value should be computed.SMTLIBException
- If model production is not enabled or the solver
detected unsatisfiability.java.lang.UnsupportedOperationException
- If model computation is
unsupportedAssignments getAssignment() throws SMTLIBException, java.lang.UnsupportedOperationException
checkSat()
did not return Script.LBool.UNSAT
. To
enable assignment production, call
setOption
(":produce-assignments",
true).Assignments
.SMTLIBException
- If assignment production is not enabled, or the
solver did not detect unsatisfiability.java.lang.UnsupportedOperationException
- If model computation is
unsupportedjava.lang.Object getOption(java.lang.String opt) throws java.lang.UnsupportedOperationException
opt
- Name of an option.java.lang.UnsupportedOperationException
- If option is unsupported.java.lang.Object getInfo(java.lang.String info) throws java.lang.UnsupportedOperationException, SMTLIBException
info
- Name of the info. Note that it has to start with
:.
java.lang.UnsupportedOperationException
- If the info is unsupported.SMTLIBException
- If info is :reason-unknown
but last
check did not return unknown.void exit()
Sort sort(java.lang.String sortname, Sort... params) throws SMTLIBException
sortname
- Name of the sort.params
- Sort parameters.SMTLIBException
- If and only if the sort does not exist.Sort sort(java.lang.String sortname, java.math.BigInteger[] indices, Sort... params) throws SMTLIBException
sortname
- Name of the sort.indices
- Sort indices.params
- Sort parameters.SMTLIBException
- If and only if the sort does not exist.Sort[] sortVariables(java.lang.String... names) throws SMTLIBException
names
- The names of the variablesSMTLIBException
- If an error occured.Term term(java.lang.String funcname, Term... params) throws SMTLIBException
funcname
- Name of the function.params
- The parameters of the function application.SMTLIBException
- If an error occurred.Term term(java.lang.String funcname, java.math.BigInteger[] indices, Sort returnSort, Term... params) throws SMTLIBException
funcname
- Name of the function.indices
- Indices for the function.returnSort
- Return sort of the function.params
- The parameters of the function application.SMTLIBException
- If an error occurred.TermVariable variable(java.lang.String varname, Sort sort) throws SMTLIBException
varname
- Name of the variable.sort
- Sort of the variable.SMTLIBException
- If no name or an invalid sort is given.Term quantifier(int quantor, TermVariable[] vars, Term body, Term[]... patterns) throws SMTLIBException
quantor
- The quantor flag (one of EXISTS
, or
FORALL
)vars
- The quantified variables.body
- The body of the quantified formula.patterns
- Possible patterns for e-matching (may be
null
).SMTLIBException
- If an error occurred.Term let(TermVariable[] vars, Term[] values, Term body) throws SMTLIBException
vars
- Variables bound by a let.values
- Values for these variables.body
- Body of the let term.SMTLIBException
- If an error occurred.Term annotate(Term t, Annotation... annotations) throws SMTLIBException
t
- Term to annotate.annotations
- Annotations for this term.SMTLIBException
- If the annotation is invalid, or the evaluation
of :named produces an error.Term numeral(java.lang.String num) throws SMTLIBException
num
- String representation of the numeral.SMTLIBException
- If an error occurred.Term numeral(java.math.BigInteger num) throws SMTLIBException
num
- the numeral as a big integer.SMTLIBException
- If an error occurred.Term decimal(java.lang.String decimal) throws SMTLIBException
decimal
- String representation of the decimal.SMTLIBException
Term decimal(java.math.BigDecimal decimal) throws SMTLIBException
decimal
- the decimal as a big decimal.SMTLIBException
Term hexadecimal(java.lang.String hex) throws SMTLIBException
hex
- String representation of the hexadecimal.SMTLIBException
- If an error occurred.Term binary(java.lang.String bin) throws SMTLIBException
bin
- String representation of the binary.SMTLIBException
- If an error occurred.Term string(java.lang.String str) throws SMTLIBException
str
- The parsed string with quotes removed.SMTLIBException
- If an error occurred.Term simplify(Term term) throws SMTLIBException
term
- A (usually Boolean) term to simplify.SMTLIBException
- If an error occurred or unsupported.void reset()
void resetAssertions()
Term[] getInterpolants(Term[] partition) throws SMTLIBException, java.lang.UnsupportedOperationException
partition
- Partitioning of the assertion stack.SMTLIBException
- An error occurred.java.lang.UnsupportedOperationException
- If interpolant computation is
unsupported.Term[] getInterpolants(Term[] partition, int[] startOfSubtree) throws SMTLIBException, java.lang.UnsupportedOperationException
partition
- The array of formulas. This should contain either
top-level names or conjunction of top-level names.startOfSubtree
- The start of the subtree containing the formula at
this index as root.SMTLIBException
- An error occurred.java.lang.UnsupportedOperationException
- If interpolant computation is
unsupported.Model getModel() throws SMTLIBException, java.lang.UnsupportedOperationException
checkSat()
returned Script.LBool.SAT
or (optionally)
Script.LBool.UNKNOWN
and no assertion stack command was issued after
this check.SMTLIBException
- Model production was not enabled.java.lang.UnsupportedOperationException
- The solver does not support this operation.java.lang.Iterable<Term[]> checkAllsat(Term[] predicates) throws SMTLIBException, java.lang.UnsupportedOperationException
predicates
- The important predicates. Must be Boolean.SMTLIBException
- If a predicate is non-Boolean.java.lang.UnsupportedOperationException
- If the operation is unsupported.Term[] findImpliedEquality(Term[] x, Term[] y)
x
and y
that
is implied in the current satisfiable context. If successful, this
method returns an array of parameters a,b,c
such that the
equality a*x = b*y + c
is implied by the current context.
Note that the x
array and the y
array must be
of equal length and of length at least 2.x
- The different incarnations of the lhs variable.y
- The different incarnations of the rhs variable.QuotedObject echo(QuotedObject msg)
msg
- The message to print.