mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 17:44:08 +00:00
Whitespace
This commit is contained in:
parent
216c1b2989
commit
52bbd67cd3
|
@ -14,7 +14,7 @@ Author:
|
||||||
Christoph Wintersteiger (cwinter) 2012-03-16
|
Christoph Wintersteiger (cwinter) 2012-03-16
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@ -41,7 +41,7 @@ namespace test_mapi
|
||||||
/// forall (x_0, ..., x_n) finv(f(x_0, ..., x_i, ..., x_{n-1})) = x_i
|
/// forall (x_0, ..., x_n) finv(f(x_0, ..., x_i, ..., x_{n-1})) = x_i
|
||||||
/// </c>
|
/// </c>
|
||||||
/// Where, <code>finv</code>is a fresh function declaration.
|
/// Where, <code>finv</code>is a fresh function declaration.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static BoolExpr InjAxiom(Context ctx, FuncDecl f, int i)
|
public static BoolExpr InjAxiom(Context ctx, FuncDecl f, int i)
|
||||||
{
|
{
|
||||||
Sort[] domain = f.Domain;
|
Sort[] domain = f.Domain;
|
||||||
|
@ -155,11 +155,11 @@ namespace test_mapi
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Assert the axiom: function f is commutative.
|
/// Assert the axiom: function f is commutative.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This example uses the SMT-LIB parser to simplify the axiom construction.
|
/// This example uses the SMT-LIB parser to simplify the axiom construction.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
private static BoolExpr CommAxiom(Context ctx, FuncDecl f)
|
private static BoolExpr CommAxiom(Context ctx, FuncDecl f)
|
||||||
{
|
{
|
||||||
Sort t = f.Range;
|
Sort t = f.Range;
|
||||||
|
@ -453,7 +453,7 @@ namespace test_mapi
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sudoku solving example.
|
/// Sudoku solving example.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static void SudokuExample(Context ctx)
|
static void SudokuExample(Context ctx)
|
||||||
{
|
{
|
||||||
Console.WriteLine("SudokuExample");
|
Console.WriteLine("SudokuExample");
|
||||||
|
@ -649,7 +649,7 @@ namespace test_mapi
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prove that <tt>f(x, y) = f(w, v) implies y = v</tt> when
|
/// Prove that <tt>f(x, y) = f(w, v) implies y = v</tt> when
|
||||||
/// <code>f</code> is injective in the second argument. <seealso cref="inj_axiom"/>
|
/// <code>f</code> is injective in the second argument. <seealso cref="inj_axiom"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void QuantifierExample3(Context ctx)
|
public static void QuantifierExample3(Context ctx)
|
||||||
|
@ -687,7 +687,7 @@ namespace test_mapi
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prove that <tt>f(x, y) = f(w, v) implies y = v</tt> when
|
/// Prove that <tt>f(x, y) = f(w, v) implies y = v</tt> when
|
||||||
/// <code>f</code> is injective in the second argument. <seealso cref="inj_axiom"/>
|
/// <code>f</code> is injective in the second argument. <seealso cref="inj_axiom"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void QuantifierExample4(Context ctx)
|
public static void QuantifierExample4(Context ctx)
|
||||||
|
@ -726,7 +726,7 @@ namespace test_mapi
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Some basic tests.
|
/// Some basic tests.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static void BasicTests(Context ctx)
|
static void BasicTests(Context ctx)
|
||||||
{
|
{
|
||||||
Console.WriteLine("BasicTests");
|
Console.WriteLine("BasicTests");
|
||||||
|
@ -759,7 +759,7 @@ namespace test_mapi
|
||||||
foreach (BoolExpr a in g.Formulas)
|
foreach (BoolExpr a in g.Formulas)
|
||||||
solver.Assert(a);
|
solver.Assert(a);
|
||||||
|
|
||||||
if (solver.Check() != Status.SATISFIABLE)
|
if (solver.Check() != Status.SATISFIABLE)
|
||||||
throw new TestFailedException();
|
throw new TestFailedException();
|
||||||
|
|
||||||
ApplyResult ar = ApplyTactic(ctx, ctx.MkTactic("simplify"), g);
|
ApplyResult ar = ApplyTactic(ctx, ctx.MkTactic("simplify"), g);
|
||||||
|
@ -965,7 +965,7 @@ namespace test_mapi
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows how to read an SMT1 file.
|
/// Shows how to read an SMT1 file.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static void SMT1FileTest(string filename)
|
static void SMT1FileTest(string filename)
|
||||||
{
|
{
|
||||||
Console.Write("SMT File test ");
|
Console.Write("SMT File test ");
|
||||||
|
@ -1020,7 +1020,7 @@ namespace test_mapi
|
||||||
// break;
|
// break;
|
||||||
// case Z3_ast_kind.Z3_QUANTIFIER_AST:
|
// case Z3_ast_kind.Z3_QUANTIFIER_AST:
|
||||||
// q.Enqueue(((Quantifier)cur).Args[0]);
|
// q.Enqueue(((Quantifier)cur).Args[0]);
|
||||||
// break;
|
// break;
|
||||||
// case Z3_ast_kind.Z3_VAR_AST: break;
|
// case Z3_ast_kind.Z3_VAR_AST: break;
|
||||||
// case Z3_ast_kind.Z3_NUMERAL_AST: break;
|
// case Z3_ast_kind.Z3_NUMERAL_AST: break;
|
||||||
// case Z3_ast_kind.Z3_FUNC_DECL_AST: break;
|
// case Z3_ast_kind.Z3_FUNC_DECL_AST: break;
|
||||||
|
@ -1158,7 +1158,7 @@ namespace test_mapi
|
||||||
/// Prove <tt>x = y implies g(x) = g(y)</tt>, and
|
/// Prove <tt>x = y implies g(x) = g(y)</tt>, and
|
||||||
/// disprove <tt>x = y implies g(g(x)) = g(y)</tt>.
|
/// disprove <tt>x = y implies g(g(x)) = g(y)</tt>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>This function demonstrates how to create uninterpreted
|
/// <remarks>This function demonstrates how to create uninterpreted
|
||||||
/// types and functions.</remarks>
|
/// types and functions.</remarks>
|
||||||
public static void ProveExample1(Context ctx)
|
public static void ProveExample1(Context ctx)
|
||||||
{
|
{
|
||||||
|
@ -1203,8 +1203,8 @@ namespace test_mapi
|
||||||
/// Prove <tt>not(g(g(x) - g(y)) = g(z)), x + z <= y <= x implies z < 0 </tt>.
|
/// Prove <tt>not(g(g(x) - g(y)) = g(z)), x + z <= y <= x implies z < 0 </tt>.
|
||||||
/// Then, show that <tt>z < -1</tt> is not implied.
|
/// Then, show that <tt>z < -1</tt> is not implied.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>This example demonstrates how to combine uninterpreted functions
|
/// <remarks>This example demonstrates how to combine uninterpreted functions
|
||||||
/// and arithmetic.</remarks>
|
/// and arithmetic.</remarks>
|
||||||
public static void ProveExample2(Context ctx)
|
public static void ProveExample2(Context ctx)
|
||||||
{
|
{
|
||||||
Console.WriteLine("ProveExample2");
|
Console.WriteLine("ProveExample2");
|
||||||
|
@ -1255,7 +1255,7 @@ namespace test_mapi
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Show how push & pop can be used to create "backtracking" points.
|
/// Show how push & pop can be used to create "backtracking" points.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>This example also demonstrates how big numbers can be
|
/// <remarks>This example also demonstrates how big numbers can be
|
||||||
/// created in ctx.</remarks>
|
/// created in ctx.</remarks>
|
||||||
public static void PushPopExample1(Context ctx)
|
public static void PushPopExample1(Context ctx)
|
||||||
{
|
{
|
||||||
|
@ -1318,7 +1318,7 @@ namespace test_mapi
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tuples.
|
/// Tuples.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Check that the projection of a tuple
|
/// <remarks>Check that the projection of a tuple
|
||||||
/// returns the corresponding element.</remarks>
|
/// returns the corresponding element.</remarks>
|
||||||
public static void TupleExample(Context ctx)
|
public static void TupleExample(Context ctx)
|
||||||
{
|
{
|
||||||
|
@ -1328,7 +1328,7 @@ namespace test_mapi
|
||||||
TupleSort tuple = ctx.MkTupleSort(
|
TupleSort tuple = ctx.MkTupleSort(
|
||||||
ctx.MkSymbol("mk_tuple"), // name of tuple constructor
|
ctx.MkSymbol("mk_tuple"), // name of tuple constructor
|
||||||
new Symbol[] { ctx.MkSymbol("first"), ctx.MkSymbol("second") }, // names of projection operators
|
new Symbol[] { ctx.MkSymbol("first"), ctx.MkSymbol("second") }, // names of projection operators
|
||||||
new Sort[] { int_type, int_type } // types of projection operators
|
new Sort[] { int_type, int_type } // types of projection operators
|
||||||
);
|
);
|
||||||
FuncDecl first = tuple.FieldDecls[0]; // declarations are for projections
|
FuncDecl first = tuple.FieldDecls[0]; // declarations are for projections
|
||||||
FuncDecl second = tuple.FieldDecls[1];
|
FuncDecl second = tuple.FieldDecls[1];
|
||||||
|
@ -1342,7 +1342,7 @@ namespace test_mapi
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Simple bit-vector example.
|
/// Simple bit-vector example.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This example disproves that x - 10 <= 0 IFF x <= 10 for (32-bit) machine integers
|
/// This example disproves that x - 10 <= 0 IFF x <= 10 for (32-bit) machine integers
|
||||||
|
@ -1366,7 +1366,7 @@ namespace test_mapi
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Find x and y such that: x ^ y - 103 == x * y
|
/// Find x and y such that: x ^ y - 103 == x * y
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void BitvectorExample2(Context ctx)
|
public static void BitvectorExample2(Context ctx)
|
||||||
{
|
{
|
||||||
Console.WriteLine("BitvectorExample2");
|
Console.WriteLine("BitvectorExample2");
|
||||||
|
@ -1446,7 +1446,7 @@ namespace test_mapi
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Display the declarations, assumptions and formulas in a SMT-LIB string.
|
/// Display the declarations, assumptions and formulas in a SMT-LIB string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void ParserExample4(Context ctx)
|
public static void ParserExample4(Context ctx)
|
||||||
{
|
{
|
||||||
Console.WriteLine("ParserExample4");
|
Console.WriteLine("ParserExample4");
|
||||||
|
@ -1504,7 +1504,7 @@ namespace test_mapi
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create an enumeration data type.
|
/// Create an enumeration data type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void EnumExample(Context ctx)
|
public static void EnumExample(Context ctx)
|
||||||
{
|
{
|
||||||
Console.WriteLine("EnumExample");
|
Console.WriteLine("EnumExample");
|
||||||
|
@ -1603,7 +1603,7 @@ namespace test_mapi
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a binary tree datatype.
|
/// Create a binary tree datatype.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void TreeExample(Context ctx)
|
public static void TreeExample(Context ctx)
|
||||||
{
|
{
|
||||||
Console.WriteLine("TreeExample");
|
Console.WriteLine("TreeExample");
|
||||||
|
@ -1681,14 +1681,14 @@ namespace test_mapi
|
||||||
|
|
||||||
//
|
//
|
||||||
// Declare the names of the accessors for cons.
|
// Declare the names of the accessors for cons.
|
||||||
// Then declare the sorts of the accessors.
|
// Then declare the sorts of the accessors.
|
||||||
// For this example, all sorts refer to the new types 'forest' and 'tree'
|
// For this example, all sorts refer to the new types 'forest' and 'tree'
|
||||||
// being declared, so we pass in null for both sorts1 and sorts2.
|
// being declared, so we pass in null for both sorts1 and sorts2.
|
||||||
// On the other hand, the sort_refs arrays contain the indices of the
|
// On the other hand, the sort_refs arrays contain the indices of the
|
||||||
// two new sorts being declared. The first element in sort1_refs
|
// two new sorts being declared. The first element in sort1_refs
|
||||||
// points to 'tree', which has index 1, the second element in sort1_refs array
|
// points to 'tree', which has index 1, the second element in sort1_refs array
|
||||||
// points to 'forest', which has index 0.
|
// points to 'forest', which has index 0.
|
||||||
//
|
//
|
||||||
Symbol[] head_tail1 = new Symbol[] { ctx.MkSymbol("head"), ctx.MkSymbol("tail") };
|
Symbol[] head_tail1 = new Symbol[] { ctx.MkSymbol("head"), ctx.MkSymbol("tail") };
|
||||||
Sort[] sorts1 = new Sort[] { null, null };
|
Sort[] sorts1 = new Sort[] { null, null };
|
||||||
uint[] sort1_refs = new uint[] { 1, 0 }; // the first item points to a tree, the second to a forest
|
uint[] sort1_refs = new uint[] { 1, 0 }; // the first item points to a tree, the second to a forest
|
||||||
|
@ -1860,7 +1860,7 @@ namespace test_mapi
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Demonstrate how to use <code>Push</code>and <code>Pop</code>to
|
/// Demonstrate how to use <code>Push</code>and <code>Pop</code>to
|
||||||
/// control the size of models.
|
/// control the size of models.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Note: this test is specialized to 32-bit bitvectors.</remarks>
|
/// <remarks>Note: this test is specialized to 32-bit bitvectors.</remarks>
|
||||||
|
@ -1954,7 +1954,7 @@ namespace test_mapi
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Simplifier example.
|
/// Simplifier example.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void SimplifierExample(Context ctx)
|
public static void SimplifierExample(Context ctx)
|
||||||
{
|
{
|
||||||
Console.WriteLine("SimplifierExample");
|
Console.WriteLine("SimplifierExample");
|
||||||
|
@ -1970,7 +1970,7 @@ namespace test_mapi
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Extract unsatisfiable core example
|
/// Extract unsatisfiable core example
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void UnsatCoreAndProofExample(Context ctx)
|
public static void UnsatCoreAndProofExample(Context ctx)
|
||||||
{
|
{
|
||||||
|
@ -2023,7 +2023,7 @@ namespace test_mapi
|
||||||
BoolExpr pb = ctx.MkBoolConst("PredB");
|
BoolExpr pb = ctx.MkBoolConst("PredB");
|
||||||
BoolExpr pc = ctx.MkBoolConst("PredC");
|
BoolExpr pc = ctx.MkBoolConst("PredC");
|
||||||
BoolExpr pd = ctx.MkBoolConst("PredD");
|
BoolExpr pd = ctx.MkBoolConst("PredD");
|
||||||
|
|
||||||
BoolExpr f1 = ctx.MkAnd(new BoolExpr[] { pa, pb, pc });
|
BoolExpr f1 = ctx.MkAnd(new BoolExpr[] { pa, pb, pc });
|
||||||
BoolExpr f2 = ctx.MkAnd(new BoolExpr[] { pa, ctx.MkNot(pb), pc });
|
BoolExpr f2 = ctx.MkAnd(new BoolExpr[] { pa, ctx.MkNot(pb), pc });
|
||||||
BoolExpr f3 = ctx.MkOr(ctx.MkNot(pa), ctx.MkNot(pc));
|
BoolExpr f3 = ctx.MkOr(ctx.MkNot(pa), ctx.MkNot(pc));
|
||||||
|
@ -2042,7 +2042,7 @@ namespace test_mapi
|
||||||
|
|
||||||
if (result == Status.UNSATISFIABLE)
|
if (result == Status.UNSATISFIABLE)
|
||||||
{
|
{
|
||||||
Console.WriteLine("unsat");
|
Console.WriteLine("unsat");
|
||||||
Console.WriteLine("core: ");
|
Console.WriteLine("core: ");
|
||||||
foreach (Expr c in solver.UnsatCore)
|
foreach (Expr c in solver.UnsatCore)
|
||||||
{
|
{
|
||||||
|
@ -2066,7 +2066,7 @@ namespace test_mapi
|
||||||
Console.WriteLine("{0}", t1);
|
Console.WriteLine("{0}", t1);
|
||||||
// But you cannot mix numerals of different sorts
|
// But you cannot mix numerals of different sorts
|
||||||
// even if the size of their domains are the same:
|
// even if the size of their domains are the same:
|
||||||
// Console.WriteLine("{0}", ctx.MkEq(s1, t1));
|
// Console.WriteLine("{0}", ctx.MkEq(s1, t1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void FloatingPointExample1(Context ctx)
|
public static void FloatingPointExample1(Context ctx)
|
||||||
|
@ -2084,7 +2084,7 @@ namespace test_mapi
|
||||||
BoolExpr a = ctx.MkAnd(ctx.MkFPEq(x, y), ctx.MkFPEq(y, z));
|
BoolExpr a = ctx.MkAnd(ctx.MkFPEq(x, y), ctx.MkFPEq(y, z));
|
||||||
Check(ctx, ctx.MkNot(a), Status.UNSATISFIABLE);
|
Check(ctx, ctx.MkNot(a), Status.UNSATISFIABLE);
|
||||||
|
|
||||||
/* nothing is equal to NaN according to floating-point
|
/* nothing is equal to NaN according to floating-point
|
||||||
* equality, so NaN == k should be unsatisfiable. */
|
* equality, so NaN == k should be unsatisfiable. */
|
||||||
FPExpr k = (FPExpr)ctx.MkConst("x", s);
|
FPExpr k = (FPExpr)ctx.MkConst("x", s);
|
||||||
FPExpr nan = ctx.MkFPNaN(s);
|
FPExpr nan = ctx.MkFPNaN(s);
|
||||||
|
@ -2125,7 +2125,7 @@ namespace test_mapi
|
||||||
|
|
||||||
FPRMExpr rm = (FPRMExpr)ctx.MkConst(ctx.MkSymbol("rm"), rm_sort);
|
FPRMExpr rm = (FPRMExpr)ctx.MkConst(ctx.MkSymbol("rm"), rm_sort);
|
||||||
BitVecExpr x = (BitVecExpr)ctx.MkConst(ctx.MkSymbol("x"), ctx.MkBitVecSort(64));
|
BitVecExpr x = (BitVecExpr)ctx.MkConst(ctx.MkSymbol("x"), ctx.MkBitVecSort(64));
|
||||||
FPExpr y = (FPExpr)ctx.MkConst(ctx.MkSymbol("y"), double_sort);
|
FPExpr y = (FPExpr)ctx.MkConst(ctx.MkSymbol("y"), double_sort);
|
||||||
FPExpr fp_val = ctx.MkFP(42, double_sort);
|
FPExpr fp_val = ctx.MkFP(42, double_sort);
|
||||||
|
|
||||||
BoolExpr c1 = ctx.MkEq(y, fp_val);
|
BoolExpr c1 = ctx.MkEq(y, fp_val);
|
||||||
|
@ -2138,7 +2138,7 @@ namespace test_mapi
|
||||||
/* Generic solver */
|
/* Generic solver */
|
||||||
Solver s = ctx.MkSolver();
|
Solver s = ctx.MkSolver();
|
||||||
s.Assert(c5);
|
s.Assert(c5);
|
||||||
|
|
||||||
Console.WriteLine(s);
|
Console.WriteLine(s);
|
||||||
|
|
||||||
if (s.Check() != Status.SATISFIABLE)
|
if (s.Check() != Status.SATISFIABLE)
|
||||||
|
@ -2210,8 +2210,8 @@ namespace test_mapi
|
||||||
}
|
}
|
||||||
|
|
||||||
// These examples need proof generation turned on and auto-config set to false.
|
// These examples need proof generation turned on and auto-config set to false.
|
||||||
using (Context ctx = new Context(new Dictionary<string, string>()
|
using (Context ctx = new Context(new Dictionary<string, string>()
|
||||||
{ {"proof", "true" },
|
{ {"proof", "true" },
|
||||||
{"auto-config", "false" } }))
|
{"auto-config", "false" } }))
|
||||||
{
|
{
|
||||||
QuantifierExample3(ctx);
|
QuantifierExample3(ctx);
|
||||||
|
|
|
@ -28,7 +28,7 @@ Revision History:
|
||||||
bool is_numeral_sort(Z3_context c, Z3_sort ty) {
|
bool is_numeral_sort(Z3_context c, Z3_sort ty) {
|
||||||
sort * _ty = to_sort(ty);
|
sort * _ty = to_sort(ty);
|
||||||
family_id fid = _ty->get_family_id();
|
family_id fid = _ty->get_family_id();
|
||||||
if (fid != mk_c(c)->get_arith_fid() &&
|
if (fid != mk_c(c)->get_arith_fid() &&
|
||||||
fid != mk_c(c)->get_bv_fid() &&
|
fid != mk_c(c)->get_bv_fid() &&
|
||||||
fid != mk_c(c)->get_datalog_fid() &&
|
fid != mk_c(c)->get_datalog_fid() &&
|
||||||
fid != mk_c(c)->get_fpa_fid()) {
|
fid != mk_c(c)->get_fpa_fid()) {
|
||||||
|
@ -160,7 +160,7 @@ extern "C" {
|
||||||
expr* e = to_expr(a);
|
expr* e = to_expr(a);
|
||||||
if (!e) {
|
if (!e) {
|
||||||
SET_ERROR_CODE(Z3_INVALID_ARG);
|
SET_ERROR_CODE(Z3_INVALID_ARG);
|
||||||
return Z3_FALSE;
|
return Z3_FALSE;
|
||||||
}
|
}
|
||||||
if (mk_c(c)->autil().is_numeral(e, r)) {
|
if (mk_c(c)->autil().is_numeral(e, r)) {
|
||||||
return Z3_TRUE;
|
return Z3_TRUE;
|
||||||
|
@ -174,11 +174,11 @@ extern "C" {
|
||||||
r = rational(v, rational::ui64());
|
r = rational(v, rational::ui64());
|
||||||
return Z3_TRUE;
|
return Z3_TRUE;
|
||||||
}
|
}
|
||||||
return Z3_FALSE;
|
return Z3_FALSE;
|
||||||
Z3_CATCH_RETURN(Z3_FALSE);
|
Z3_CATCH_RETURN(Z3_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Z3_string Z3_API Z3_get_numeral_string(Z3_context c, Z3_ast a) {
|
Z3_string Z3_API Z3_get_numeral_string(Z3_context c, Z3_ast a) {
|
||||||
Z3_TRY;
|
Z3_TRY;
|
||||||
// This function invokes Z3_get_numeral_rational, but it is still ok to add LOG command here because it does not return a Z3 object.
|
// This function invokes Z3_get_numeral_rational, but it is still ok to add LOG command here because it does not return a Z3 object.
|
||||||
|
@ -196,11 +196,11 @@ extern "C" {
|
||||||
mpf_rounding_mode rm;
|
mpf_rounding_mode rm;
|
||||||
if (mk_c(c)->fpautil().is_rm_numeral(to_expr(a), rm)) {
|
if (mk_c(c)->fpautil().is_rm_numeral(to_expr(a), rm)) {
|
||||||
switch (rm) {
|
switch (rm) {
|
||||||
case OP_FPA_RM_NEAREST_TIES_TO_EVEN:
|
case OP_FPA_RM_NEAREST_TIES_TO_EVEN:
|
||||||
return mk_c(c)->mk_external_string("roundNearestTiesToEven");
|
return mk_c(c)->mk_external_string("roundNearestTiesToEven");
|
||||||
break;
|
break;
|
||||||
case OP_FPA_RM_NEAREST_TIES_TO_AWAY:
|
case OP_FPA_RM_NEAREST_TIES_TO_AWAY:
|
||||||
return mk_c(c)->mk_external_string("roundNearestTiesToAway");
|
return mk_c(c)->mk_external_string("roundNearestTiesToAway");
|
||||||
break;
|
break;
|
||||||
case OP_FPA_RM_TOWARD_POSITIVE:
|
case OP_FPA_RM_TOWARD_POSITIVE:
|
||||||
return mk_c(c)->mk_external_string("roundTowardPositive");
|
return mk_c(c)->mk_external_string("roundTowardPositive");
|
||||||
|
@ -212,7 +212,7 @@ extern "C" {
|
||||||
default:
|
default:
|
||||||
return mk_c(c)->mk_external_string("roundTowardZero");
|
return mk_c(c)->mk_external_string("roundTowardZero");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mk_c(c)->fpautil().is_numeral(to_expr(a), tmp)) {
|
else if (mk_c(c)->fpautil().is_numeral(to_expr(a), tmp)) {
|
||||||
return mk_c(c)->mk_external_string(fu.fm().to_string(tmp));
|
return mk_c(c)->mk_external_string(fu.fm().to_string(tmp));
|
||||||
|
@ -261,7 +261,7 @@ extern "C" {
|
||||||
|
|
||||||
Z3_bool Z3_API Z3_get_numeral_small(Z3_context c, Z3_ast a, long long* num, long long* den) {
|
Z3_bool Z3_API Z3_get_numeral_small(Z3_context c, Z3_ast a, long long* num, long long* den) {
|
||||||
Z3_TRY;
|
Z3_TRY;
|
||||||
// This function invokes Z3_get_numeral_rational, but it is still ok to add LOG command here because it does not return a Z3 object.
|
// This function invokes Z3_get_numeral_rational, but it is still ok to add LOG command here because it does not return a Z3 object.
|
||||||
LOG_Z3_get_numeral_small(c, a, num, den);
|
LOG_Z3_get_numeral_small(c, a, num, den);
|
||||||
RESET_ERROR_CODE();
|
RESET_ERROR_CODE();
|
||||||
rational r;
|
rational r;
|
||||||
|
@ -289,8 +289,8 @@ extern "C" {
|
||||||
// This function invokes Z3_get_numeral_int64, but it is still ok to add LOG command here because it does not return a Z3 object.
|
// This function invokes Z3_get_numeral_int64, but it is still ok to add LOG command here because it does not return a Z3 object.
|
||||||
LOG_Z3_get_numeral_int(c, v, i);
|
LOG_Z3_get_numeral_int(c, v, i);
|
||||||
RESET_ERROR_CODE();
|
RESET_ERROR_CODE();
|
||||||
if (!i) {
|
if (!i) {
|
||||||
SET_ERROR_CODE(Z3_INVALID_ARG);
|
SET_ERROR_CODE(Z3_INVALID_ARG);
|
||||||
return Z3_FALSE;
|
return Z3_FALSE;
|
||||||
}
|
}
|
||||||
long long l;
|
long long l;
|
||||||
|
@ -301,17 +301,17 @@ extern "C" {
|
||||||
return Z3_FALSE;
|
return Z3_FALSE;
|
||||||
Z3_CATCH_RETURN(Z3_FALSE);
|
Z3_CATCH_RETURN(Z3_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Z3_bool Z3_API Z3_get_numeral_uint(Z3_context c, Z3_ast v, unsigned* u) {
|
Z3_bool Z3_API Z3_get_numeral_uint(Z3_context c, Z3_ast v, unsigned* u) {
|
||||||
Z3_TRY;
|
Z3_TRY;
|
||||||
// This function invokes Z3_get_numeral_uint64, but it is still ok to add LOG command here because it does not return a Z3 object.
|
// This function invokes Z3_get_numeral_uint64, but it is still ok to add LOG command here because it does not return a Z3 object.
|
||||||
LOG_Z3_get_numeral_uint(c, v, u);
|
LOG_Z3_get_numeral_uint(c, v, u);
|
||||||
RESET_ERROR_CODE();
|
RESET_ERROR_CODE();
|
||||||
if (!u) {
|
if (!u) {
|
||||||
SET_ERROR_CODE(Z3_INVALID_ARG);
|
SET_ERROR_CODE(Z3_INVALID_ARG);
|
||||||
return Z3_FALSE;
|
return Z3_FALSE;
|
||||||
}
|
}
|
||||||
unsigned long long l;
|
unsigned long long l;
|
||||||
if (Z3_get_numeral_uint64(c, v, &l) && (l <= 0xFFFFFFFF)) {
|
if (Z3_get_numeral_uint64(c, v, &l) && (l <= 0xFFFFFFFF)) {
|
||||||
*u = static_cast<unsigned>(l);
|
*u = static_cast<unsigned>(l);
|
||||||
return Z3_TRUE;
|
return Z3_TRUE;
|
||||||
|
@ -319,7 +319,7 @@ extern "C" {
|
||||||
return Z3_FALSE;
|
return Z3_FALSE;
|
||||||
Z3_CATCH_RETURN(Z3_FALSE);
|
Z3_CATCH_RETURN(Z3_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Z3_bool Z3_API Z3_get_numeral_uint64(Z3_context c, Z3_ast v, unsigned long long* u) {
|
Z3_bool Z3_API Z3_get_numeral_uint64(Z3_context c, Z3_ast v, unsigned long long* u) {
|
||||||
Z3_TRY;
|
Z3_TRY;
|
||||||
// This function invokes Z3_get_numeral_rational, but it is still ok to add LOG command here because it does not return a Z3 object.
|
// This function invokes Z3_get_numeral_rational, but it is still ok to add LOG command here because it does not return a Z3 object.
|
||||||
|
@ -339,7 +339,7 @@ extern "C" {
|
||||||
return Z3_FALSE;
|
return Z3_FALSE;
|
||||||
Z3_CATCH_RETURN(Z3_FALSE);
|
Z3_CATCH_RETURN(Z3_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Z3_bool Z3_API Z3_get_numeral_int64(Z3_context c, Z3_ast v, long long* i) {
|
Z3_bool Z3_API Z3_get_numeral_int64(Z3_context c, Z3_ast v, long long* i) {
|
||||||
Z3_TRY;
|
Z3_TRY;
|
||||||
// This function invokes Z3_get_numeral_rational, but it is still ok to add LOG command here because it does not return a Z3 object.
|
// This function invokes Z3_get_numeral_rational, but it is still ok to add LOG command here because it does not return a Z3 object.
|
||||||
|
|
|
@ -309,7 +309,7 @@ namespace Microsoft.Z3
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new finite domain sort.
|
/// Create a new finite domain sort.
|
||||||
/// <returns>The result is a sort</returns>
|
/// <returns>The result is a sort</returns>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">The name used to identify the sort</param>
|
/// <param name="name">The name used to identify the sort</param>
|
||||||
/// <param name="size">The size of the sort</param>
|
/// <param name="size">The size of the sort</param>
|
||||||
|
@ -324,9 +324,9 @@ namespace Microsoft.Z3
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new finite domain sort.
|
/// Create a new finite domain sort.
|
||||||
/// <returns>The result is a sort</returns>
|
/// <returns>The result is a sort</returns>
|
||||||
/// Elements of the sort are created using <seealso cref="MkNumeral(ulong, Sort)"/>,
|
/// Elements of the sort are created using <seealso cref="MkNumeral(ulong, Sort)"/>,
|
||||||
/// and the elements range from 0 to <tt>size-1</tt>.
|
/// and the elements range from 0 to <tt>size-1</tt>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="name">The name used to identify the sort</param>
|
/// <param name="name">The name used to identify the sort</param>
|
||||||
/// <param name="size">The size of the sort</param>
|
/// <param name="size">The size of the sort</param>
|
||||||
|
@ -457,16 +457,16 @@ namespace Microsoft.Z3
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update a datatype field at expression t with value v.
|
/// Update a datatype field at expression t with value v.
|
||||||
/// The function performs a record update at t. The field
|
/// The function performs a record update at t. The field
|
||||||
/// that is passed in as argument is updated with value v,
|
/// that is passed in as argument is updated with value v,
|
||||||
/// the remainig fields of t are unchanged.
|
/// the remainig fields of t are unchanged.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Expr MkUpdateField(FuncDecl field, Expr t, Expr v)
|
public Expr MkUpdateField(FuncDecl field, Expr t, Expr v)
|
||||||
{
|
{
|
||||||
return Expr.Create(this, Native.Z3_datatype_update_field(
|
return Expr.Create(this, Native.Z3_datatype_update_field(
|
||||||
nCtx, field.NativeObject,
|
nCtx, field.NativeObject,
|
||||||
t.NativeObject, v.NativeObject));
|
t.NativeObject, v.NativeObject));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -2613,13 +2613,13 @@ namespace Microsoft.Z3
|
||||||
/// <paramref name="patterns"/> is an array of patterns, <paramref name="sorts"/> is an array
|
/// <paramref name="patterns"/> is an array of patterns, <paramref name="sorts"/> is an array
|
||||||
/// with the sorts of the bound variables, <paramref name="names"/> is an array with the
|
/// with the sorts of the bound variables, <paramref name="names"/> is an array with the
|
||||||
/// 'names' of the bound variables, and <paramref name="body"/> is the body of the
|
/// 'names' of the bound variables, and <paramref name="body"/> is the body of the
|
||||||
/// quantifier. Quantifiers are associated with weights indicating the importance of
|
/// quantifier. Quantifiers are associated with weights indicating the importance of
|
||||||
/// using the quantifier during instantiation.
|
/// using the quantifier during instantiation.
|
||||||
/// Note that the bound variables are de-Bruijn indices created using <see cref="MkBound"/>.
|
/// Note that the bound variables are de-Bruijn indices created using <see cref="MkBound"/>.
|
||||||
/// Z3 applies the convention that the last element in <paramref name="names"/> and
|
/// Z3 applies the convention that the last element in <paramref name="names"/> and
|
||||||
/// <paramref name="sorts"/> refers to the variable with index 0, the second to last element
|
/// <paramref name="sorts"/> refers to the variable with index 0, the second to last element
|
||||||
/// of <paramref name="names"/> and <paramref name="sorts"/> refers to the variable
|
/// of <paramref name="names"/> and <paramref name="sorts"/> refers to the variable
|
||||||
/// with index 1, etc.
|
/// with index 1, etc.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="sorts">the sorts of the bound variables.</param>
|
/// <param name="sorts">the sorts of the bound variables.</param>
|
||||||
/// <param name="names">names of the bound variables</param>
|
/// <param name="names">names of the bound variables</param>
|
||||||
|
@ -2650,8 +2650,8 @@ namespace Microsoft.Z3
|
||||||
/// Create a universal Quantifier.
|
/// Create a universal Quantifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Creates a universal quantifier using a list of constants that will
|
/// Creates a universal quantifier using a list of constants that will
|
||||||
/// form the set of bound variables.
|
/// form the set of bound variables.
|
||||||
/// <seealso cref="MkForall(Sort[], Symbol[], Expr, uint, Pattern[], Expr[], Symbol, Symbol)"/>
|
/// <seealso cref="MkForall(Sort[], Symbol[], Expr, uint, Pattern[], Expr[], Symbol, Symbol)"/>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public Quantifier MkForall(Expr[] boundConstants, Expr body, uint weight = 1, Pattern[] patterns = null, Expr[] noPatterns = null, Symbol quantifierID = null, Symbol skolemID = null)
|
public Quantifier MkForall(Expr[] boundConstants, Expr body, uint weight = 1, Pattern[] patterns = null, Expr[] noPatterns = null, Symbol quantifierID = null, Symbol skolemID = null)
|
||||||
|
@ -2670,7 +2670,7 @@ namespace Microsoft.Z3
|
||||||
/// Create an existential Quantifier.
|
/// Create an existential Quantifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Creates an existential quantifier using de-Brujin indexed variables.
|
/// Creates an existential quantifier using de-Brujin indexed variables.
|
||||||
/// (<see cref="MkForall(Sort[], Symbol[], Expr, uint, Pattern[], Expr[], Symbol, Symbol)"/>).
|
/// (<see cref="MkForall(Sort[], Symbol[], Expr, uint, Pattern[], Expr[], Symbol, Symbol)"/>).
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public Quantifier MkExists(Sort[] sorts, Symbol[] names, Expr body, uint weight = 1, Pattern[] patterns = null, Expr[] noPatterns = null, Symbol quantifierID = null, Symbol skolemID = null)
|
public Quantifier MkExists(Sort[] sorts, Symbol[] names, Expr body, uint weight = 1, Pattern[] patterns = null, Expr[] noPatterns = null, Symbol quantifierID = null, Symbol skolemID = null)
|
||||||
|
@ -2692,8 +2692,8 @@ namespace Microsoft.Z3
|
||||||
/// Create an existential Quantifier.
|
/// Create an existential Quantifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Creates an existential quantifier using a list of constants that will
|
/// Creates an existential quantifier using a list of constants that will
|
||||||
/// form the set of bound variables.
|
/// form the set of bound variables.
|
||||||
/// <seealso cref="MkForall(Sort[], Symbol[], Expr, uint, Pattern[], Expr[], Symbol, Symbol)"/>
|
/// <seealso cref="MkForall(Sort[], Symbol[], Expr, uint, Pattern[], Expr[], Symbol, Symbol)"/>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public Quantifier MkExists(Expr[] boundConstants, Expr body, uint weight = 1, Pattern[] patterns = null, Expr[] noPatterns = null, Symbol quantifierID = null, Symbol skolemID = null)
|
public Quantifier MkExists(Expr[] boundConstants, Expr body, uint weight = 1, Pattern[] patterns = null, Expr[] noPatterns = null, Symbol quantifierID = null, Symbol skolemID = null)
|
||||||
|
@ -4499,7 +4499,7 @@ namespace Microsoft.Z3
|
||||||
readonly private Statistics.DecRefQueue m_Statistics_DRQ = new Statistics.DecRefQueue(10);
|
readonly private Statistics.DecRefQueue m_Statistics_DRQ = new Statistics.DecRefQueue(10);
|
||||||
readonly private Tactic.DecRefQueue m_Tactic_DRQ = new Tactic.DecRefQueue(10);
|
readonly private Tactic.DecRefQueue m_Tactic_DRQ = new Tactic.DecRefQueue(10);
|
||||||
readonly private Fixedpoint.DecRefQueue m_Fixedpoint_DRQ = new Fixedpoint.DecRefQueue(10);
|
readonly private Fixedpoint.DecRefQueue m_Fixedpoint_DRQ = new Fixedpoint.DecRefQueue(10);
|
||||||
readonly private Optimize.DecRefQueue m_Optimize_DRQ = new Optimize.DecRefQueue(10);
|
readonly private Optimize.DecRefQueue m_Optimize_DRQ = new Optimize.DecRefQueue(10);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// AST DRQ
|
/// AST DRQ
|
||||||
|
|
|
@ -14,7 +14,7 @@ Author:
|
||||||
Christoph Wintersteiger (cwinter) 2012-03-20
|
Christoph Wintersteiger (cwinter) 2012-03-20
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@ -23,7 +23,7 @@ using System.Diagnostics.Contracts;
|
||||||
namespace Microsoft.Z3
|
namespace Microsoft.Z3
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Expressions are terms.
|
/// Expressions are terms.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ContractVerification(true)]
|
[ContractVerification(true)]
|
||||||
public class Expr : AST
|
public class Expr : AST
|
||||||
|
@ -74,7 +74,7 @@ namespace Microsoft.Z3
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The arguments of the expression.
|
/// The arguments of the expression.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Expr[] Args
|
public Expr[] Args
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -109,9 +109,9 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// The result is the new expression. The arrays <c>from</c> and <c>to</c> must have size <c>num_exprs</c>.
|
/// The result is the new expression. The arrays <c>from</c> and <c>to</c> must have size <c>num_exprs</c>.
|
||||||
/// For every <c>i</c> smaller than <c>num_exprs</c>, we must have that
|
/// For every <c>i</c> smaller than <c>num_exprs</c>, we must have that
|
||||||
/// sort of <c>from[i]</c> must be equal to sort of <c>to[i]</c>.
|
/// sort of <c>from[i]</c> must be equal to sort of <c>to[i]</c>.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public Expr Substitute(Expr[] from, Expr[] to)
|
public Expr Substitute(Expr[] from, Expr[] to)
|
||||||
{
|
{
|
||||||
Contract.Requires(from != null);
|
Contract.Requires(from != null);
|
||||||
|
@ -174,7 +174,7 @@ namespace Microsoft.Z3
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a string representation of the expression.
|
/// Returns a string representation of the expression.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return base.ToString();
|
return base.ToString();
|
||||||
|
@ -442,15 +442,15 @@ namespace Microsoft.Z3
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 &&
|
return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 &&
|
||||||
(Z3_sort_kind)Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject))
|
(Z3_sort_kind)Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject))
|
||||||
== Z3_sort_kind.Z3_ARRAY_SORT);
|
== Z3_sort_kind.Z3_ARRAY_SORT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is an array store.
|
/// Indicates whether the term is an array store.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>It satisfies select(store(a,i,v),j) = if i = j then v else select(a,j).
|
/// <remarks>It satisfies select(store(a,i,v),j) = if i = j then v else select(a,j).
|
||||||
/// Array store takes at least 3 arguments. </remarks>
|
/// Array store takes at least 3 arguments. </remarks>
|
||||||
public bool IsStore { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_STORE; } }
|
public bool IsStore { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_STORE; } }
|
||||||
|
|
||||||
|
@ -480,7 +480,7 @@ namespace Microsoft.Z3
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is an as-array term.
|
/// Indicates whether the term is an as-array term.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>An as-array term is n array value that behaves as the function graph of the
|
/// <remarks>An as-array term is n array value that behaves as the function graph of the
|
||||||
/// function passed as parameter.</remarks>
|
/// function passed as parameter.</remarks>
|
||||||
public bool IsAsArray { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_AS_ARRAY; } }
|
public bool IsAsArray { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_AS_ARRAY; } }
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -761,21 +761,21 @@ namespace Microsoft.Z3
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a coercion from integer to bit-vector
|
/// Indicates whether the term is a coercion from integer to bit-vector
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>This function is not supported by the decision procedures. Only the most
|
/// <remarks>This function is not supported by the decision procedures. Only the most
|
||||||
/// rudimentary simplification rules are applied to this function.</remarks>
|
/// rudimentary simplification rules are applied to this function.</remarks>
|
||||||
public bool IsIntToBV { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_INT2BV; } }
|
public bool IsIntToBV { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_INT2BV; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a coercion from bit-vector to integer
|
/// Indicates whether the term is a coercion from bit-vector to integer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>This function is not supported by the decision procedures. Only the most
|
/// <remarks>This function is not supported by the decision procedures. Only the most
|
||||||
/// rudimentary simplification rules are applied to this function.</remarks>
|
/// rudimentary simplification rules are applied to this function.</remarks>
|
||||||
public bool IsBVToInt { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BV2INT; } }
|
public bool IsBVToInt { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_BV2INT; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a bit-vector carry
|
/// Indicates whether the term is a bit-vector carry
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Compute the carry bit in a full-adder. The meaning is given by the
|
/// <remarks>Compute the carry bit in a full-adder. The meaning is given by the
|
||||||
/// equivalence (carry l1 l2 l3) <=> (or (and l1 l2) (and l1 l3) (and l2 l3)))</remarks>
|
/// equivalence (carry l1 l2 l3) <=> (or (and l1 l2) (and l1 l3) (and l2 l3)))</remarks>
|
||||||
public bool IsBVCarry { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_CARRY; } }
|
public bool IsBVCarry { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_CARRY; } }
|
||||||
|
|
||||||
|
@ -795,15 +795,15 @@ namespace Microsoft.Z3
|
||||||
public bool IsLabel { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_LABEL; } }
|
public bool IsLabel { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_LABEL; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a label literal (used by the Boogie Verification condition generator).
|
/// Indicates whether the term is a label literal (used by the Boogie Verification condition generator).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>A label literal has a set of string parameters. It takes no arguments.</remarks>
|
/// <remarks>A label literal has a set of string parameters. It takes no arguments.</remarks>
|
||||||
public bool IsLabelLit { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_LABEL_LIT; } }
|
public bool IsLabelLit { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_LABEL_LIT; } }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Proof Terms
|
#region Proof Terms
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a binary equivalence modulo namings.
|
/// Indicates whether the term is a binary equivalence modulo namings.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>This binary predicate is used in proof terms.
|
/// <remarks>This binary predicate is used in proof terms.
|
||||||
/// It captures equisatisfiability and equivalence modulo renamings.</remarks>
|
/// It captures equisatisfiability and equivalence modulo renamings.</remarks>
|
||||||
|
@ -838,8 +838,8 @@ namespace Microsoft.Z3
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a proof for (R t t), where R is a reflexive relation.
|
/// Indicates whether the term is a proof for (R t t), where R is a reflexive relation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>This proof object has no antecedents.
|
/// <remarks>This proof object has no antecedents.
|
||||||
/// The only reflexive relations that are used are
|
/// The only reflexive relations that are used are
|
||||||
/// equivalence modulo namings, equality and equivalence.
|
/// equivalence modulo namings, equality and equivalence.
|
||||||
/// That is, R is either '~', '=' or 'iff'.</remarks>
|
/// That is, R is either '~', '=' or 'iff'.</remarks>
|
||||||
public bool IsProofReflexivity { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_REFLEXIVITY; } }
|
public bool IsProofReflexivity { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_REFLEXIVITY; } }
|
||||||
|
@ -859,8 +859,8 @@ namespace Microsoft.Z3
|
||||||
/// Indicates whether the term is a proof by transitivity of a relation
|
/// Indicates whether the term is a proof by transitivity of a relation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Given a transitive relation R, and proofs for (R t s) and (R s u), produces a proof
|
/// Given a transitive relation R, and proofs for (R t s) and (R s u), produces a proof
|
||||||
/// for (R t u).
|
/// for (R t u).
|
||||||
/// T1: (R t s)
|
/// T1: (R t s)
|
||||||
/// T2: (R s u)
|
/// T2: (R s u)
|
||||||
/// [trans T1 T2]: (R t u)
|
/// [trans T1 T2]: (R t u)
|
||||||
|
@ -872,17 +872,17 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Condensed transitivity proof. This proof object is only used if the parameter PROOF_MODE is 1.
|
/// Condensed transitivity proof. This proof object is only used if the parameter PROOF_MODE is 1.
|
||||||
/// It combines several symmetry and transitivity proofs.
|
/// It combines several symmetry and transitivity proofs.
|
||||||
/// Example:
|
/// Example:
|
||||||
/// T1: (R a b)
|
/// T1: (R a b)
|
||||||
/// T2: (R c b)
|
/// T2: (R c b)
|
||||||
/// T3: (R c d)
|
/// T3: (R c d)
|
||||||
/// [trans* T1 T2 T3]: (R a d)
|
/// [trans* T1 T2 T3]: (R a d)
|
||||||
/// R must be a symmetric and transitive relation.
|
/// R must be a symmetric and transitive relation.
|
||||||
///
|
///
|
||||||
/// Assuming that this proof object is a proof for (R s t), then
|
/// Assuming that this proof object is a proof for (R s t), then
|
||||||
/// a proof checker must check if it is possible to prove (R s t)
|
/// a proof checker must check if it is possible to prove (R s t)
|
||||||
/// using the antecedents, symmetry and transitivity. That is,
|
/// using the antecedents, symmetry and transitivity. That is,
|
||||||
/// if there is a path from s to t, if we view every
|
/// if there is a path from s to t, if we view every
|
||||||
/// antecedent (R a b) as an edge between a and b.
|
/// antecedent (R a b) as an edge between a and b.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
@ -896,14 +896,14 @@ namespace Microsoft.Z3
|
||||||
/// T1: (R t_1 s_1)
|
/// T1: (R t_1 s_1)
|
||||||
/// ...
|
/// ...
|
||||||
/// Tn: (R t_n s_n)
|
/// Tn: (R t_n s_n)
|
||||||
/// [monotonicity T1 ... Tn]: (R (f t_1 ... t_n) (f s_1 ... s_n))
|
/// [monotonicity T1 ... Tn]: (R (f t_1 ... t_n) (f s_1 ... s_n))
|
||||||
/// Remark: if t_i == s_i, then the antecedent Ti is suppressed.
|
/// Remark: if t_i == s_i, then the antecedent Ti is suppressed.
|
||||||
/// That is, reflexivity proofs are supressed to save space.
|
/// That is, reflexivity proofs are supressed to save space.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsProofMonotonicity { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_MONOTONICITY; } }
|
public bool IsProofMonotonicity { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_MONOTONICITY; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a quant-intro proof
|
/// Indicates whether the term is a quant-intro proof
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Given a proof for (~ p q), produces a proof for (~ (forall (x) p) (forall (x) q)).
|
/// Given a proof for (~ p q), produces a proof for (~ (forall (x) p) (forall (x) q)).
|
||||||
|
@ -913,7 +913,7 @@ namespace Microsoft.Z3
|
||||||
public bool IsProofQuantIntro { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_QUANT_INTRO; } }
|
public bool IsProofQuantIntro { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_QUANT_INTRO; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a distributivity proof object.
|
/// Indicates whether the term is a distributivity proof object.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Given that f (= or) distributes over g (= and), produces a proof for
|
/// Given that f (= or) distributes over g (= and), produces a proof for
|
||||||
|
@ -923,9 +923,9 @@ namespace Microsoft.Z3
|
||||||
/// (= (f (g a b) (g c d))
|
/// (= (f (g a b) (g c d))
|
||||||
/// (g (f a c) (f a d) (f b c) (f b d)))
|
/// (g (f a c) (f a d) (f b c) (f b d)))
|
||||||
/// where each f and g can have arbitrary number of arguments.
|
/// where each f and g can have arbitrary number of arguments.
|
||||||
///
|
///
|
||||||
/// This proof object has no antecedents.
|
/// This proof object has no antecedents.
|
||||||
/// Remark. This rule is used by the CNF conversion pass and
|
/// Remark. This rule is used by the CNF conversion pass and
|
||||||
/// instantiated by f = or, and g = and.
|
/// instantiated by f = or, and g = and.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsProofDistributivity { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_DISTRIBUTIVITY; } }
|
public bool IsProofDistributivity { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_DISTRIBUTIVITY; } }
|
||||||
|
@ -946,7 +946,7 @@ namespace Microsoft.Z3
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Given a proof for (not (or l_1 ... l_n)), produces a proof for (not l_i).
|
/// Given a proof for (not (or l_1 ... l_n)), produces a proof for (not l_i).
|
||||||
/// T1: (not (or l_1 ... l_n))
|
/// T1: (not (or l_1 ... l_n))
|
||||||
/// [not-or-elim T1]: (not l_i)
|
/// [not-or-elim T1]: (not l_i)
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsProofOrElimination { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_NOT_OR_ELIM; } }
|
public bool IsProofOrElimination { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_NOT_OR_ELIM; } }
|
||||||
|
|
||||||
|
@ -956,16 +956,16 @@ namespace Microsoft.Z3
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// A proof for a local rewriting step (= t s).
|
/// A proof for a local rewriting step (= t s).
|
||||||
/// The head function symbol of t is interpreted.
|
/// The head function symbol of t is interpreted.
|
||||||
///
|
///
|
||||||
/// This proof object has no antecedents.
|
/// This proof object has no antecedents.
|
||||||
/// The conclusion of a rewrite rule is either an equality (= t s),
|
/// The conclusion of a rewrite rule is either an equality (= t s),
|
||||||
/// an equivalence (iff t s), or equi-satisfiability (~ t s).
|
/// an equivalence (iff t s), or equi-satisfiability (~ t s).
|
||||||
/// Remark: if f is bool, then = is iff.
|
/// Remark: if f is bool, then = is iff.
|
||||||
///
|
///
|
||||||
/// Examples:
|
/// Examples:
|
||||||
/// (= (+ x 0) x)
|
/// (= (+ x 0) x)
|
||||||
/// (= (+ x 1 2) (+ 3 x))
|
/// (= (+ x 1 2) (+ 3 x))
|
||||||
/// (iff (or x false) x)
|
/// (iff (or x false) x)
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsProofRewrite { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_REWRITE; } }
|
public bool IsProofRewrite { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_REWRITE; } }
|
||||||
|
|
||||||
|
@ -997,8 +997,8 @@ namespace Microsoft.Z3
|
||||||
/// Indicates whether the term is a proof for pulling quantifiers out.
|
/// Indicates whether the term is a proof for pulling quantifiers out.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// A proof for (iff P Q) where Q is in prenex normal form.
|
/// A proof for (iff P Q) where Q is in prenex normal form.
|
||||||
/// This proof object is only used if the parameter PROOF_MODE is 1.
|
/// This proof object is only used if the parameter PROOF_MODE is 1.
|
||||||
/// This proof object has no antecedents
|
/// This proof object has no antecedents
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsProofPullQuantStar { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_PULL_QUANT_STAR; } }
|
public bool IsProofPullQuantStar { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_PULL_QUANT_STAR; } }
|
||||||
|
@ -1010,8 +1010,8 @@ namespace Microsoft.Z3
|
||||||
/// A proof for:
|
/// A proof for:
|
||||||
/// (iff (forall (x_1 ... x_m) (and p_1[x_1 ... x_m] ... p_n[x_1 ... x_m]))
|
/// (iff (forall (x_1 ... x_m) (and p_1[x_1 ... x_m] ... p_n[x_1 ... x_m]))
|
||||||
/// (and (forall (x_1 ... x_m) p_1[x_1 ... x_m])
|
/// (and (forall (x_1 ... x_m) p_1[x_1 ... x_m])
|
||||||
/// ...
|
/// ...
|
||||||
/// (forall (x_1 ... x_m) p_n[x_1 ... x_m])))
|
/// (forall (x_1 ... x_m) p_n[x_1 ... x_m])))
|
||||||
/// This proof object has no antecedents
|
/// This proof object has no antecedents
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsProofPushQuant { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_PUSH_QUANT; } }
|
public bool IsProofPushQuant { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_PUSH_QUANT; } }
|
||||||
|
@ -1021,8 +1021,8 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// A proof for (iff (forall (x_1 ... x_n y_1 ... y_m) p[x_1 ... x_n])
|
/// A proof for (iff (forall (x_1 ... x_n y_1 ... y_m) p[x_1 ... x_n])
|
||||||
/// (forall (x_1 ... x_n) p[x_1 ... x_n]))
|
/// (forall (x_1 ... x_n) p[x_1 ... x_n]))
|
||||||
///
|
///
|
||||||
/// It is used to justify the elimination of unused variables.
|
/// It is used to justify the elimination of unused variables.
|
||||||
/// This proof object has no antecedents.
|
/// This proof object has no antecedents.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
@ -1035,9 +1035,9 @@ namespace Microsoft.Z3
|
||||||
/// A proof for destructive equality resolution:
|
/// A proof for destructive equality resolution:
|
||||||
/// (iff (forall (x) (or (not (= x t)) P[x])) P[t])
|
/// (iff (forall (x) (or (not (= x t)) P[x])) P[t])
|
||||||
/// if x does not occur in t.
|
/// if x does not occur in t.
|
||||||
///
|
///
|
||||||
/// This proof object has no antecedents.
|
/// This proof object has no antecedents.
|
||||||
///
|
///
|
||||||
/// Several variables can be eliminated simultaneously.
|
/// Several variables can be eliminated simultaneously.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsProofDER { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_DER; } }
|
public bool IsProofDER { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_DER; } }
|
||||||
|
@ -1062,7 +1062,7 @@ namespace Microsoft.Z3
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// T1: false
|
/// T1: false
|
||||||
/// [lemma T1]: (or (not l_1) ... (not l_n))
|
/// [lemma T1]: (or (not l_1) ... (not l_n))
|
||||||
///
|
///
|
||||||
/// This proof object has one antecedent: a hypothetical proof for false.
|
/// This proof object has one antecedent: a hypothetical proof for false.
|
||||||
/// It converts the proof in a proof for (or (not l_1) ... (not l_n)),
|
/// It converts the proof in a proof for (or (not l_1) ... (not l_n)),
|
||||||
/// when T1 contains the hypotheses: l_1, ..., l_n.
|
/// when T1 contains the hypotheses: l_1, ..., l_n.
|
||||||
|
@ -1104,9 +1104,9 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// [comm]: (= (f a b) (f b a))
|
/// [comm]: (= (f a b) (f b a))
|
||||||
///
|
///
|
||||||
/// f is a commutative operator.
|
/// f is a commutative operator.
|
||||||
///
|
///
|
||||||
/// This proof object has no antecedents.
|
/// This proof object has no antecedents.
|
||||||
/// Remark: if f is bool, then = is iff.
|
/// Remark: if f is bool, then = is iff.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
@ -1117,7 +1117,7 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Proof object used to justify Tseitin's like axioms:
|
/// Proof object used to justify Tseitin's like axioms:
|
||||||
///
|
///
|
||||||
/// (or (not (and p q)) p)
|
/// (or (not (and p q)) p)
|
||||||
/// (or (not (and p q)) q)
|
/// (or (not (and p q)) q)
|
||||||
/// (or (not (and p q r)) p)
|
/// (or (not (and p q r)) p)
|
||||||
|
@ -1138,7 +1138,7 @@ namespace Microsoft.Z3
|
||||||
/// (or (ite a b c) a (not c))
|
/// (or (ite a b c) a (not c))
|
||||||
/// (or (not (not a)) (not a))
|
/// (or (not (not a)) (not a))
|
||||||
/// (or (not a) a)
|
/// (or (not a) a)
|
||||||
///
|
///
|
||||||
/// This proof object has no antecedents.
|
/// This proof object has no antecedents.
|
||||||
/// Note: all axioms are propositional tautologies.
|
/// Note: all axioms are propositional tautologies.
|
||||||
/// Note also that 'and' and 'or' can take multiple arguments.
|
/// Note also that 'and' and 'or' can take multiple arguments.
|
||||||
|
@ -1155,19 +1155,19 @@ namespace Microsoft.Z3
|
||||||
/// Introduces a name for a formula/term.
|
/// Introduces a name for a formula/term.
|
||||||
/// Suppose e is an expression with free variables x, and def-intro
|
/// Suppose e is an expression with free variables x, and def-intro
|
||||||
/// introduces the name n(x). The possible cases are:
|
/// introduces the name n(x). The possible cases are:
|
||||||
///
|
///
|
||||||
/// When e is of Boolean type:
|
/// When e is of Boolean type:
|
||||||
/// [def-intro]: (and (or n (not e)) (or (not n) e))
|
/// [def-intro]: (and (or n (not e)) (or (not n) e))
|
||||||
///
|
///
|
||||||
/// or:
|
/// or:
|
||||||
/// [def-intro]: (or (not n) e)
|
/// [def-intro]: (or (not n) e)
|
||||||
/// when e only occurs positively.
|
/// when e only occurs positively.
|
||||||
///
|
///
|
||||||
/// When e is of the form (ite cond th el):
|
/// When e is of the form (ite cond th el):
|
||||||
/// [def-intro]: (and (or (not cond) (= n th)) (or cond (= n el)))
|
/// [def-intro]: (and (or (not cond) (= n th)) (or cond (= n el)))
|
||||||
///
|
///
|
||||||
/// Otherwise:
|
/// Otherwise:
|
||||||
/// [def-intro]: (= n e)
|
/// [def-intro]: (= n e)
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsProofDefIntro { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_DEF_INTRO; } }
|
public bool IsProofDefIntro { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_DEF_INTRO; } }
|
||||||
|
|
||||||
|
@ -1195,7 +1195,7 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Proof for a (positive) NNF step. Example:
|
/// Proof for a (positive) NNF step. Example:
|
||||||
///
|
///
|
||||||
/// T1: (not s_1) ~ r_1
|
/// T1: (not s_1) ~ r_1
|
||||||
/// T2: (not s_2) ~ r_2
|
/// T2: (not s_2) ~ r_2
|
||||||
/// T3: s_1 ~ r_1'
|
/// T3: s_1 ~ r_1'
|
||||||
|
@ -1207,9 +1207,9 @@ namespace Microsoft.Z3
|
||||||
/// (a) When creating the NNF of a positive force quantifier.
|
/// (a) When creating the NNF of a positive force quantifier.
|
||||||
/// The quantifier is retained (unless the bound variables are eliminated).
|
/// The quantifier is retained (unless the bound variables are eliminated).
|
||||||
/// Example
|
/// Example
|
||||||
/// T1: q ~ q_new
|
/// T1: q ~ q_new
|
||||||
/// [nnf-pos T1]: (~ (forall (x T) q) (forall (x T) q_new))
|
/// [nnf-pos T1]: (~ (forall (x T) q) (forall (x T) q_new))
|
||||||
///
|
///
|
||||||
/// (b) When recursively creating NNF over Boolean formulas, where the top-level
|
/// (b) When recursively creating NNF over Boolean formulas, where the top-level
|
||||||
/// connective is changed during NNF conversion. The relevant Boolean connectives
|
/// connective is changed during NNF conversion. The relevant Boolean connectives
|
||||||
/// for NNF_POS are 'implies', 'iff', 'xor', 'ite'.
|
/// for NNF_POS are 'implies', 'iff', 'xor', 'ite'.
|
||||||
|
@ -1223,7 +1223,7 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Proof for a (negative) NNF step. Examples:
|
/// Proof for a (negative) NNF step. Examples:
|
||||||
///
|
///
|
||||||
/// T1: (not s_1) ~ r_1
|
/// T1: (not s_1) ~ r_1
|
||||||
/// ...
|
/// ...
|
||||||
/// Tn: (not s_n) ~ r_n
|
/// Tn: (not s_n) ~ r_n
|
||||||
|
@ -1248,9 +1248,9 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// A proof for (~ P Q) where Q is in negation normal form.
|
/// A proof for (~ P Q) where Q is in negation normal form.
|
||||||
///
|
///
|
||||||
/// This proof object is only used if the parameter PROOF_MODE is 1.
|
/// This proof object is only used if the parameter PROOF_MODE is 1.
|
||||||
///
|
///
|
||||||
/// This proof object may have n antecedents. Each antecedent is a PR_DEF_INTRO.
|
/// This proof object may have n antecedents. Each antecedent is a PR_DEF_INTRO.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsProofNNFStar { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_NNF_STAR; } }
|
public bool IsProofNNFStar { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_NNF_STAR; } }
|
||||||
|
@ -1260,8 +1260,8 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// A proof for (~ P Q) where Q is in conjunctive normal form.
|
/// A proof for (~ P Q) where Q is in conjunctive normal form.
|
||||||
/// This proof object is only used if the parameter PROOF_MODE is 1.
|
/// This proof object is only used if the parameter PROOF_MODE is 1.
|
||||||
/// This proof object may have n antecedents. Each antecedent is a PR_DEF_INTRO.
|
/// This proof object may have n antecedents. Each antecedent is a PR_DEF_INTRO.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsProofCNFStar { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_CNF_STAR; } }
|
public bool IsProofCNFStar { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_CNF_STAR; } }
|
||||||
|
|
||||||
|
@ -1269,11 +1269,11 @@ namespace Microsoft.Z3
|
||||||
/// Indicates whether the term is a proof for a Skolemization step
|
/// Indicates whether the term is a proof for a Skolemization step
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Proof for:
|
/// Proof for:
|
||||||
///
|
///
|
||||||
/// [sk]: (~ (not (forall x (p x y))) (not (p (sk y) y)))
|
/// [sk]: (~ (not (forall x (p x y))) (not (p (sk y) y)))
|
||||||
/// [sk]: (~ (exists x (p x y)) (p (sk y) y))
|
/// [sk]: (~ (exists x (p x y)) (p (sk y) y))
|
||||||
///
|
///
|
||||||
/// This proof object has no antecedents.
|
/// This proof object has no antecedents.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsProofSkolemize { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_SKOLEMIZE; } }
|
public bool IsProofSkolemize { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_SKOLEMIZE; } }
|
||||||
|
@ -1285,7 +1285,7 @@ namespace Microsoft.Z3
|
||||||
/// Modus ponens style rule for equi-satisfiability.
|
/// Modus ponens style rule for equi-satisfiability.
|
||||||
/// T1: p
|
/// T1: p
|
||||||
/// T2: (~ p q)
|
/// T2: (~ p q)
|
||||||
/// [mp~ T1 T2]: q
|
/// [mp~ T1 T2]: q
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsProofModusPonensOEQ { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_MODUS_PONENS_OEQ; } }
|
public bool IsProofModusPonensOEQ { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_PR_MODUS_PONENS_OEQ; } }
|
||||||
|
|
||||||
|
@ -1294,15 +1294,15 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Generic proof for theory lemmas.
|
/// Generic proof for theory lemmas.
|
||||||
///
|
///
|
||||||
/// The theory lemma function comes with one or more parameters.
|
/// The theory lemma function comes with one or more parameters.
|
||||||
/// The first parameter indicates the name of the theory.
|
/// The first parameter indicates the name of the theory.
|
||||||
/// For the theory of arithmetic, additional parameters provide hints for
|
/// For the theory of arithmetic, additional parameters provide hints for
|
||||||
/// checking the theory lemma.
|
/// checking the theory lemma.
|
||||||
/// The hints for arithmetic are:
|
/// The hints for arithmetic are:
|
||||||
/// - farkas - followed by rational coefficients. Multiply the coefficients to the
|
/// - farkas - followed by rational coefficients. Multiply the coefficients to the
|
||||||
/// inequalities in the lemma, add the (negated) inequalities and obtain a contradiction.
|
/// inequalities in the lemma, add the (negated) inequalities and obtain a contradiction.
|
||||||
/// - triangle-eq - Indicates a lemma related to the equivalence:
|
/// - triangle-eq - Indicates a lemma related to the equivalence:
|
||||||
/// (iff (= t1 t2) (and (<= t1 t2) (<= t2 t1)))
|
/// (iff (= t1 t2) (and (<= t1 t2) (<= t2 t1)))
|
||||||
/// - gcd-test - Indicates an integer linear arithmetic lemma that uses a gcd test.
|
/// - gcd-test - Indicates an integer linear arithmetic lemma that uses a gcd test.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
@ -1318,7 +1318,7 @@ namespace Microsoft.Z3
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 &&
|
return (Native.Z3_is_app(Context.nCtx, NativeObject) != 0 &&
|
||||||
Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject))
|
Native.Z3_get_sort_kind(Context.nCtx, Native.Z3_get_sort(Context.nCtx, NativeObject))
|
||||||
== (uint)Z3_sort_kind.Z3_RELATION_SORT);
|
== (uint)Z3_sort_kind.Z3_RELATION_SORT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1328,7 +1328,7 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Insert a record into a relation.
|
/// Insert a record into a relation.
|
||||||
/// The function takes <c>n+1</c> arguments, where the first argument is the relation and the remaining <c>n</c> elements
|
/// The function takes <c>n+1</c> arguments, where the first argument is the relation and the remaining <c>n</c> elements
|
||||||
/// correspond to the <c>n</c> columns of the relation.
|
/// correspond to the <c>n</c> columns of the relation.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsRelationStore { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_STORE; } }
|
public bool IsRelationStore { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_STORE; } }
|
||||||
|
@ -1349,7 +1349,7 @@ namespace Microsoft.Z3
|
||||||
public bool IsRelationalJoin { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_JOIN; } }
|
public bool IsRelationalJoin { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_JOIN; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is the union or convex hull of two relations.
|
/// Indicates whether the term is the union or convex hull of two relations.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>The function takes two arguments.</remarks>
|
/// <remarks>The function takes two arguments.</remarks>
|
||||||
public bool IsRelationUnion { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_UNION; } }
|
public bool IsRelationUnion { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_UNION; } }
|
||||||
|
@ -1371,7 +1371,7 @@ namespace Microsoft.Z3
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Filter (restrict) a relation with respect to a predicate.
|
/// Filter (restrict) a relation with respect to a predicate.
|
||||||
/// The first argument is a relation.
|
/// The first argument is a relation.
|
||||||
/// The second argument is a predicate with free de-Brujin indices
|
/// The second argument is a predicate with free de-Brujin indices
|
||||||
/// corresponding to the columns of the relation.
|
/// corresponding to the columns of the relation.
|
||||||
/// So the first column in the relation has index 0.
|
/// So the first column in the relation has index 0.
|
||||||
|
@ -1385,9 +1385,9 @@ namespace Microsoft.Z3
|
||||||
/// Intersect the first relation with respect to negation
|
/// Intersect the first relation with respect to negation
|
||||||
/// of the second relation (the function takes two arguments).
|
/// of the second relation (the function takes two arguments).
|
||||||
/// Logically, the specification can be described by a function
|
/// Logically, the specification can be described by a function
|
||||||
///
|
///
|
||||||
/// target = filter_by_negation(pos, neg, columns)
|
/// target = filter_by_negation(pos, neg, columns)
|
||||||
///
|
///
|
||||||
/// where columns are pairs c1, d1, .., cN, dN of columns from pos and neg, such that
|
/// where columns are pairs c1, d1, .., cN, dN of columns from pos and neg, such that
|
||||||
/// target are elements in x in pos, such that there is no y in neg that agrees with
|
/// target are elements in x in pos, such that there is no y in neg that agrees with
|
||||||
/// x on the columns c1, d1, .., cN, dN.
|
/// x on the columns c1, d1, .., cN, dN.
|
||||||
|
@ -1397,7 +1397,7 @@ namespace Microsoft.Z3
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is the renaming of a column in a relation
|
/// Indicates whether the term is the renaming of a column in a relation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// The function takes one argument.
|
/// The function takes one argument.
|
||||||
/// The parameters contain the renaming as a cycle.
|
/// The parameters contain the renaming as a cycle.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
@ -1422,10 +1422,10 @@ namespace Microsoft.Z3
|
||||||
/// Indicates whether the term is a relational clone (copy)
|
/// Indicates whether the term is a relational clone (copy)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Create a fresh copy (clone) of a relation.
|
/// Create a fresh copy (clone) of a relation.
|
||||||
/// The function is logically the identity, but
|
/// The function is logically the identity, but
|
||||||
/// in the context of a register machine allows
|
/// in the context of a register machine allows
|
||||||
/// for terms of kind <seealso cref="IsRelationUnion"/>
|
/// for terms of kind <seealso cref="IsRelationUnion"/>
|
||||||
/// to perform destructive updates to the first argument.
|
/// to perform destructive updates to the first argument.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool IsRelationClone { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_CLONE; } }
|
public bool IsRelationClone { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_RA_CLONE; } }
|
||||||
|
@ -1481,11 +1481,11 @@ namespace Microsoft.Z3
|
||||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToEven
|
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToEven
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsFPRMRoundNearestTiesToEven{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; } }
|
public bool IsFPRMRoundNearestTiesToEven{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToAway
|
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToAway
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsFPRMRoundNearestTiesToAway{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; } }
|
public bool IsFPRMRoundNearestTiesToAway{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardNegative
|
/// Indicates whether the term is the floating-point rounding numeral roundTowardNegative
|
||||||
|
@ -1506,11 +1506,11 @@ namespace Microsoft.Z3
|
||||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToEven
|
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToEven
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsFPRMExprRNE{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; } }
|
public bool IsFPRMExprRNE{ get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToAway
|
/// Indicates whether the term is the floating-point rounding numeral roundNearestTiesToAway
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsFPRMExprRNA { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; } }
|
public bool IsFPRMExprRNA { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is the floating-point rounding numeral roundTowardNegative
|
/// Indicates whether the term is the floating-point rounding numeral roundTowardNegative
|
||||||
|
@ -1530,9 +1530,9 @@ namespace Microsoft.Z3
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a floating-point rounding mode numeral
|
/// Indicates whether the term is a floating-point rounding mode numeral
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsFPRMExpr {
|
public bool IsFPRMExpr {
|
||||||
get {
|
get {
|
||||||
return IsApp &&
|
return IsApp &&
|
||||||
(FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY||
|
(FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY||
|
||||||
FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN ||
|
FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN ||
|
||||||
FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_POSITIVE ||
|
FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_POSITIVE ||
|
||||||
|
@ -1540,7 +1540,7 @@ namespace Microsoft.Z3
|
||||||
FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_ZERO);
|
FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_RM_TOWARD_ZERO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a floating-point +oo
|
/// Indicates whether the term is a floating-point +oo
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1586,7 +1586,7 @@ namespace Microsoft.Z3
|
||||||
/// Indicates whether the term is a floating-point multiplication term
|
/// Indicates whether the term is a floating-point multiplication term
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsFPMul { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_MUL; } }
|
public bool IsFPMul { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_MUL; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a floating-point divison term
|
/// Indicates whether the term is a floating-point divison term
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1680,12 +1680,12 @@ namespace Microsoft.Z3
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a floating-point isNegative predicate term
|
/// Indicates whether the term is a floating-point isNegative predicate term
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsFPisNegative { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_IS_NEGATIVE; } }
|
public bool IsFPisNegative { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_IS_NEGATIVE; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a floating-point isPositive predicate term
|
/// Indicates whether the term is a floating-point isPositive predicate term
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsFPisPositive { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_IS_POSITIVE; } }
|
public bool IsFPisPositive { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_IS_POSITIVE; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a floating-point constructor term
|
/// Indicates whether the term is a floating-point constructor term
|
||||||
|
@ -1715,7 +1715,7 @@ namespace Microsoft.Z3
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicates whether the term is a floating-point conversion to real term
|
/// Indicates whether the term is a floating-point conversion to real term
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsFPToReal { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_TO_REAL; } }
|
public bool IsFPToReal { get { return IsApp && FuncDecl.DeclKind == Z3_decl_kind.Z3_OP_FPA_TO_REAL; } }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1761,8 +1761,8 @@ namespace Microsoft.Z3
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Internal
|
#region Internal
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor for Expr
|
/// Constructor for Expr
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal protected Expr(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
|
internal protected Expr(Context ctx, IntPtr obj) : base(ctx, obj) { Contract.Requires(ctx != null); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue