mirror of
https://github.com/Z3Prover/z3
synced 2025-04-25 18:15:32 +00:00
increase minor version, update java/.net apis
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
92b4b9e7a7
commit
161b6a9983
3 changed files with 1 additions and 290 deletions
|
@ -2540,147 +2540,8 @@ public class Context implements AutoCloseable {
|
|||
AST.arrayToNative(assumptions), formula.getNativeObject());
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the given string using the SMT-LIB parser.
|
||||
* Remarks: The symbol
|
||||
* table of the parser can be initialized using the given sorts and
|
||||
* declarations. The symbols in the arrays {@code sortNames} and
|
||||
* {@code declNames} don't need to match the names of the sorts
|
||||
* and declarations in the arrays {@code sorts} and {@code decls}. This is a useful feature since we can use arbitrary names
|
||||
* to reference sorts and declarations.
|
||||
**/
|
||||
public void parseSMTLIBString(String str, Symbol[] sortNames, Sort[] sorts,
|
||||
Symbol[] declNames, FuncDecl[] decls)
|
||||
{
|
||||
int csn = Symbol.arrayLength(sortNames);
|
||||
int cs = Sort.arrayLength(sorts);
|
||||
int cdn = Symbol.arrayLength(declNames);
|
||||
int cd = AST.arrayLength(decls);
|
||||
if (csn != cs || cdn != cd)
|
||||
throw new Z3Exception("Argument size mismatch");
|
||||
Native.parseSmtlibString(nCtx(), str, AST.arrayLength(sorts),
|
||||
Symbol.arrayToNative(sortNames), AST.arrayToNative(sorts),
|
||||
AST.arrayLength(decls), Symbol.arrayToNative(declNames),
|
||||
AST.arrayToNative(decls));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the given file using the SMT-LIB parser.
|
||||
* @see #parseSMTLIBString
|
||||
**/
|
||||
public void parseSMTLIBFile(String fileName, Symbol[] sortNames,
|
||||
Sort[] sorts, Symbol[] declNames, FuncDecl[] decls)
|
||||
|
||||
{
|
||||
int csn = Symbol.arrayLength(sortNames);
|
||||
int cs = Sort.arrayLength(sorts);
|
||||
int cdn = Symbol.arrayLength(declNames);
|
||||
int cd = AST.arrayLength(decls);
|
||||
if (csn != cs || cdn != cd)
|
||||
throw new Z3Exception("Argument size mismatch");
|
||||
Native.parseSmtlibFile(nCtx(), fileName, AST.arrayLength(sorts),
|
||||
Symbol.arrayToNative(sortNames), AST.arrayToNative(sorts),
|
||||
AST.arrayLength(decls), Symbol.arrayToNative(declNames),
|
||||
AST.arrayToNative(decls));
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of SMTLIB formulas parsed by the last call to
|
||||
* {@code ParseSMTLIBString} or {@code ParseSMTLIBFile}.
|
||||
**/
|
||||
public int getNumSMTLIBFormulas()
|
||||
{
|
||||
return Native.getSmtlibNumFormulas(nCtx());
|
||||
}
|
||||
|
||||
/**
|
||||
* The formulas parsed by the last call to {@code ParseSMTLIBString} or
|
||||
* {@code ParseSMTLIBFile}.
|
||||
**/
|
||||
public BoolExpr[] getSMTLIBFormulas()
|
||||
{
|
||||
|
||||
int n = getNumSMTLIBFormulas();
|
||||
BoolExpr[] res = new BoolExpr[n];
|
||||
for (int i = 0; i < n; i++)
|
||||
res[i] = (BoolExpr) Expr.create(this,
|
||||
Native.getSmtlibFormula(nCtx(), i));
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of SMTLIB assumptions parsed by the last call to
|
||||
* {@code ParseSMTLIBString} or {@code ParseSMTLIBFile}.
|
||||
**/
|
||||
public int getNumSMTLIBAssumptions()
|
||||
{
|
||||
return Native.getSmtlibNumAssumptions(nCtx());
|
||||
}
|
||||
|
||||
/**
|
||||
* The assumptions parsed by the last call to {@code ParseSMTLIBString}
|
||||
* or {@code ParseSMTLIBFile}.
|
||||
**/
|
||||
public BoolExpr[] getSMTLIBAssumptions()
|
||||
{
|
||||
|
||||
int n = getNumSMTLIBAssumptions();
|
||||
BoolExpr[] res = new BoolExpr[n];
|
||||
for (int i = 0; i < n; i++)
|
||||
res[i] = (BoolExpr) Expr.create(this,
|
||||
Native.getSmtlibAssumption(nCtx(), i));
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of SMTLIB declarations parsed by the last call to
|
||||
* {@code ParseSMTLIBString} or {@code ParseSMTLIBFile}.
|
||||
**/
|
||||
public int getNumSMTLIBDecls()
|
||||
{
|
||||
return Native.getSmtlibNumDecls(nCtx());
|
||||
}
|
||||
|
||||
/**
|
||||
* The declarations parsed by the last call to
|
||||
* {@code ParseSMTLIBString} or {@code ParseSMTLIBFile}.
|
||||
**/
|
||||
public FuncDecl[] getSMTLIBDecls()
|
||||
{
|
||||
|
||||
int n = getNumSMTLIBDecls();
|
||||
FuncDecl[] res = new FuncDecl[n];
|
||||
for (int i = 0; i < n; i++)
|
||||
res[i] = new FuncDecl(this, Native.getSmtlibDecl(nCtx(), i));
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of SMTLIB sorts parsed by the last call to
|
||||
* {@code ParseSMTLIBString} or {@code ParseSMTLIBFile}.
|
||||
**/
|
||||
public int getNumSMTLIBSorts()
|
||||
{
|
||||
return Native.getSmtlibNumSorts(nCtx());
|
||||
}
|
||||
|
||||
/**
|
||||
* The declarations parsed by the last call to
|
||||
* {@code ParseSMTLIBString} or {@code ParseSMTLIBFile}.
|
||||
**/
|
||||
public Sort[] getSMTLIBSorts()
|
||||
{
|
||||
|
||||
int n = getNumSMTLIBSorts();
|
||||
Sort[] res = new Sort[n];
|
||||
for (int i = 0; i < n; i++)
|
||||
res[i] = Sort.create(this, Native.getSmtlibSort(nCtx(), i));
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the given string using the SMT-LIB2 parser.
|
||||
* @see #parseSMTLIBString
|
||||
*
|
||||
* @return A conjunction of assertions in the scope (up to push/pop) at the
|
||||
* end of the string.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue