mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 20:18:18 +00:00
Fix typos.
This commit is contained in:
parent
54ba25175c
commit
ae8027e594
|
@ -427,11 +427,11 @@ Version 3.0
|
||||||
|
|
||||||
- New Bitvector (QF_BV) solver. The new solver is only available when using the new SMT2 front-end.
|
- New Bitvector (QF_BV) solver. The new solver is only available when using the new SMT2 front-end.
|
||||||
|
|
||||||
- Major performace improvements.
|
- Major performance improvements.
|
||||||
|
|
||||||
- New preprocessing stack.
|
- New preprocessing stack.
|
||||||
|
|
||||||
- Performance improvements for linear and nonlinear arithmetic. The improvements are only available when using the the SMT2 front-end.
|
- Performance improvements for linear and nonlinear arithmetic. The improvements are only available when using the SMT2 front-end.
|
||||||
|
|
||||||
- Added API for parsing SMT2 files.
|
- Added API for parsing SMT2 files.
|
||||||
|
|
||||||
|
@ -772,7 +772,7 @@ This release also introduces some new preprocessing features:
|
||||||
|
|
||||||
- More efficient destructive equality resolution DER=true.
|
- More efficient destructive equality resolution DER=true.
|
||||||
|
|
||||||
- DISTRIBUTE_FORALL=true (distributes universal quatifiers over conjunctions, this transformation may affect pattern inference).
|
- DISTRIBUTE_FORALL=true (distributes universal quantifiers over conjunctions, this transformation may affect pattern inference).
|
||||||
|
|
||||||
- Rewriter that uses universally quantified equations PRE_DEMODULATOR=true (yes, the option name is not good, we will change it in a future release).
|
- Rewriter that uses universally quantified equations PRE_DEMODULATOR=true (yes, the option name is not good, we will change it in a future release).
|
||||||
|
|
||||||
|
@ -842,7 +842,7 @@ This release introduces the following features:
|
||||||
|
|
||||||
It fixes the following bugs:
|
It fixes the following bugs:
|
||||||
|
|
||||||
- Incorrect simplification of map over store in the extendted array theory. Reported by Catalin Hritcu.
|
- Incorrect simplification of map over store in the extended array theory. Reported by Catalin Hritcu.
|
||||||
|
|
||||||
- Incomplete handling of equality propagation with constant arrays. Reported by Catalin Hritcu.
|
- Incomplete handling of equality propagation with constant arrays. Reported by Catalin Hritcu.
|
||||||
|
|
||||||
|
@ -886,7 +886,7 @@ Version 2.0
|
||||||
proof object.
|
proof object.
|
||||||
|
|
||||||
- Proof Objects.
|
- Proof Objects.
|
||||||
The #Z3_check_assumptions retuns a proof object if
|
The #Z3_check_assumptions returns a proof object if
|
||||||
the configuration flag PROOF_MODE is set to 1 or 2.
|
the configuration flag PROOF_MODE is set to 1 or 2.
|
||||||
|
|
||||||
- Partial support for non-linear arithmetic.
|
- Partial support for non-linear arithmetic.
|
||||||
|
@ -899,4 +899,4 @@ Version 2.0
|
||||||
The theory of well-founded recursive data-types is supported
|
The theory of well-founded recursive data-types is supported
|
||||||
over the binary APIs. It supports ground satisfiability checking
|
over the binary APIs. It supports ground satisfiability checking
|
||||||
for tuples, enumeration types (scalars),
|
for tuples, enumeration types (scalars),
|
||||||
lists and mututally recursive data-types.
|
lists and mutually recursive data-types.
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace api {
|
||||||
class context : public tactic_manager {
|
class context : public tactic_manager {
|
||||||
struct add_plugins { add_plugins(ast_manager & m); };
|
struct add_plugins { add_plugins(ast_manager & m); };
|
||||||
context_params m_params;
|
context_params m_params;
|
||||||
bool m_user_ref_count; //!< if true, the user is responsible for managing referenc counters.
|
bool m_user_ref_count; //!< if true, the user is responsible for managing reference counters.
|
||||||
scoped_ptr<ast_manager> m_manager;
|
scoped_ptr<ast_manager> m_manager;
|
||||||
add_plugins m_plugins;
|
add_plugins m_plugins;
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ namespace api {
|
||||||
// Create a numeral of the given sort
|
// Create a numeral of the given sort
|
||||||
expr * mk_numeral_core(rational const & n, sort * s);
|
expr * mk_numeral_core(rational const & n, sort * s);
|
||||||
|
|
||||||
// Return a conjuction that will be exposed to the "external" world.
|
// Return a conjunction that will be exposed to the "external" world.
|
||||||
expr * mk_and(unsigned num_exprs, expr * const * exprs);
|
expr * mk_and(unsigned num_exprs, expr * const * exprs);
|
||||||
|
|
||||||
// Hack for preventing an AST for being GC when ref-count is not used
|
// Hack for preventing an AST for being GC when ref-count is not used
|
||||||
|
|
|
@ -187,8 +187,8 @@ namespace z3 {
|
||||||
\brief The C++ API uses by defaults exceptions on errors.
|
\brief The C++ API uses by defaults exceptions on errors.
|
||||||
For applications that don't work well with exceptions (there should be only few)
|
For applications that don't work well with exceptions (there should be only few)
|
||||||
you have the ability to turn off exceptions. The tradeoffs are that applications
|
you have the ability to turn off exceptions. The tradeoffs are that applications
|
||||||
have to very careful about using check_error() after calls that may result in an errornous
|
have to very careful about using check_error() after calls that may result in an
|
||||||
state.
|
erroneous state.
|
||||||
*/
|
*/
|
||||||
void set_enable_exceptions(bool f) { m_enable_exceptions = f; }
|
void set_enable_exceptions(bool f) { m_enable_exceptions = f; }
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ namespace z3 {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Interrupt the current procedure being executed by any object managed by this context.
|
\brief Interrupt the current procedure being executed by any object managed by this context.
|
||||||
This is a soft interruption: there is no guarantee the object will actualy stop.
|
This is a soft interruption: there is no guarantee the object will actually stop.
|
||||||
*/
|
*/
|
||||||
void interrupt() { Z3_interrupt(m_ctx); }
|
void interrupt() { Z3_interrupt(m_ctx); }
|
||||||
|
|
||||||
|
@ -709,7 +709,7 @@ namespace z3 {
|
||||||
|
|
||||||
It only makes sense to use this function if the caller can ensure that
|
It only makes sense to use this function if the caller can ensure that
|
||||||
the result is an integer or if exceptions are enabled.
|
the result is an integer or if exceptions are enabled.
|
||||||
If exceptions are disabled, then use the the is_numeral_i function.
|
If exceptions are disabled, then use the is_numeral_i function.
|
||||||
|
|
||||||
\pre is_numeral()
|
\pre is_numeral()
|
||||||
*/
|
*/
|
||||||
|
@ -729,7 +729,7 @@ namespace z3 {
|
||||||
|
|
||||||
It only makes sense to use this function if the caller can ensure that
|
It only makes sense to use this function if the caller can ensure that
|
||||||
the result is an integer or if exceptions are enabled.
|
the result is an integer or if exceptions are enabled.
|
||||||
If exceptions are disabled, then use the the is_numeral_u function.
|
If exceptions are disabled, then use the is_numeral_u function.
|
||||||
\pre is_numeral()
|
\pre is_numeral()
|
||||||
*/
|
*/
|
||||||
unsigned get_numeral_uint() const {
|
unsigned get_numeral_uint() const {
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace Microsoft.Z3
|
||||||
public bool IsDouble { get { return m_is_double; } }
|
public bool IsDouble { get { return m_is_double; } }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The string representation of the the entry's value.
|
/// The string representation of the entry's value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Value
|
public string Value
|
||||||
{
|
{
|
||||||
|
|
|
@ -934,7 +934,7 @@ public class Context implements AutoCloseable {
|
||||||
* exposed. It follows the semantics prescribed by the SMT-LIB standard.
|
* exposed. It follows the semantics prescribed by the SMT-LIB standard.
|
||||||
*
|
*
|
||||||
* You can take the floor of a real by creating an auxiliary integer Term
|
* You can take the floor of a real by creating an auxiliary integer Term
|
||||||
* {@code k} and and asserting
|
* {@code k} and asserting
|
||||||
* {@code MakeInt2Real(k) <= t1 < MkInt2Real(k)+1}. The argument
|
* {@code MakeInt2Real(k) <= t1 < MkInt2Real(k)+1}. The argument
|
||||||
* must be of integer sort.
|
* must be of integer sort.
|
||||||
**/
|
**/
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class Statistics extends Z3Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The string representation of the the entry's value.
|
* The string representation of the entry's value.
|
||||||
*
|
*
|
||||||
* @throws Z3Exception
|
* @throws Z3Exception
|
||||||
**/
|
**/
|
||||||
|
|
|
@ -5741,7 +5741,7 @@ class ModelRef(Z3PPObject):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def num_sorts(self):
|
def num_sorts(self):
|
||||||
"""Return the number of unintepreted sorts that contain an interpretation in the model `self`.
|
"""Return the number of uninterpreted sorts that contain an interpretation in the model `self`.
|
||||||
|
|
||||||
>>> A = DeclareSort('A')
|
>>> A = DeclareSort('A')
|
||||||
>>> a, b = Consts('a b', A)
|
>>> a, b = Consts('a b', A)
|
||||||
|
@ -5756,7 +5756,7 @@ class ModelRef(Z3PPObject):
|
||||||
return int(Z3_model_get_num_sorts(self.ctx.ref(), self.model))
|
return int(Z3_model_get_num_sorts(self.ctx.ref(), self.model))
|
||||||
|
|
||||||
def get_sort(self, idx):
|
def get_sort(self, idx):
|
||||||
"""Return the unintepreted sort at position `idx` < self.num_sorts().
|
"""Return the uninterpreted sort at position `idx` < self.num_sorts().
|
||||||
|
|
||||||
>>> A = DeclareSort('A')
|
>>> A = DeclareSort('A')
|
||||||
>>> B = DeclareSort('B')
|
>>> B = DeclareSort('B')
|
||||||
|
@ -5796,7 +5796,7 @@ class ModelRef(Z3PPObject):
|
||||||
return [ self.get_sort(i) for i in range(self.num_sorts()) ]
|
return [ self.get_sort(i) for i in range(self.num_sorts()) ]
|
||||||
|
|
||||||
def get_universe(self, s):
|
def get_universe(self, s):
|
||||||
"""Return the intepretation for the uninterpreted sort `s` in the model `self`.
|
"""Return the interpretation for the uninterpreted sort `s` in the model `self`.
|
||||||
|
|
||||||
>>> A = DeclareSort('A')
|
>>> A = DeclareSort('A')
|
||||||
>>> a, b = Consts('a b', A)
|
>>> a, b = Consts('a b', A)
|
||||||
|
@ -5816,7 +5816,7 @@ class ModelRef(Z3PPObject):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def __getitem__(self, idx):
|
def __getitem__(self, idx):
|
||||||
"""If `idx` is an integer, then the declaration at position `idx` in the model `self` is returned. If `idx` is a declaration, then the actual interpreation is returned.
|
"""If `idx` is an integer, then the declaration at position `idx` in the model `self` is returned. If `idx` is a declaration, then the actual interpretation is returned.
|
||||||
|
|
||||||
The elements can be retrieved using position or the actual declaration.
|
The elements can be retrieved using position or the actual declaration.
|
||||||
|
|
||||||
|
@ -5860,7 +5860,7 @@ class ModelRef(Z3PPObject):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def decls(self):
|
def decls(self):
|
||||||
"""Return a list with all symbols that have an interpreation in the model `self`.
|
"""Return a list with all symbols that have an interpretation in the model `self`.
|
||||||
>>> f = Function('f', IntSort(), IntSort())
|
>>> f = Function('f', IntSort(), IntSort())
|
||||||
>>> x = Int('x')
|
>>> x = Int('x')
|
||||||
>>> s = Solver()
|
>>> s = Solver()
|
||||||
|
|
|
@ -363,7 +363,7 @@ extern "C" {
|
||||||
void Z3_API Z3_fixedpoint_set_reduce_assign_callback(
|
void Z3_API Z3_fixedpoint_set_reduce_assign_callback(
|
||||||
Z3_context c ,Z3_fixedpoint d, Z3_fixedpoint_reduce_assign_callback_fptr cb);
|
Z3_context c ,Z3_fixedpoint d, Z3_fixedpoint_reduce_assign_callback_fptr cb);
|
||||||
|
|
||||||
/** \brief Register a callback for buildling terms based on the relational operators. */
|
/** \brief Register a callback for building terms based on the relational operators. */
|
||||||
void Z3_API Z3_fixedpoint_set_reduce_app_callback(
|
void Z3_API Z3_fixedpoint_set_reduce_app_callback(
|
||||||
Z3_context c, Z3_fixedpoint d, Z3_fixedpoint_reduce_app_callback_fptr cb);
|
Z3_context c, Z3_fixedpoint d, Z3_fixedpoint_reduce_app_callback_fptr cb);
|
||||||
|
|
||||||
|
|
|
@ -433,7 +433,7 @@ extern "C" {
|
||||||
\param c logical context
|
\param c logical context
|
||||||
\param rm term of RoundingMode sort
|
\param rm term of RoundingMode sort
|
||||||
\param t1 term of FloatingPoint sort
|
\param t1 term of FloatingPoint sort
|
||||||
\param t2 term of FloatingPoint sor
|
\param t2 term of FloatingPoint sort
|
||||||
\param t3 term of FloatingPoint sort
|
\param t3 term of FloatingPoint sort
|
||||||
|
|
||||||
The result is round((t1 * t2) + t3)
|
The result is round((t1 * t2) + t3)
|
||||||
|
|
|
@ -83,7 +83,7 @@ class reduce_hypotheses {
|
||||||
// map from unit literals to their hypotheses-free derivations
|
// map from unit literals to their hypotheses-free derivations
|
||||||
obj_map<expr, proof*> m_units;
|
obj_map<expr, proof*> m_units;
|
||||||
|
|
||||||
// -- all hypotheses in the the proof
|
// -- all hypotheses in the proof
|
||||||
obj_hashtable<expr> m_hyps;
|
obj_hashtable<expr> m_hyps;
|
||||||
|
|
||||||
// marks hypothetical proofs
|
// marks hypothetical proofs
|
||||||
|
@ -192,7 +192,7 @@ class reduce_hypotheses {
|
||||||
res = mk_lemma_core(args.get(0), m.get_fact(p));
|
res = mk_lemma_core(args.get(0), m.get_fact(p));
|
||||||
compute_mark1(res);
|
compute_mark1(res);
|
||||||
} else if (m.is_unit_resolution(p)) {
|
} else if (m.is_unit_resolution(p)) {
|
||||||
// unit: reduce untis; reduce the first premise; rebuild unit resolution
|
// unit: reduce units; reduce the first premise; rebuild unit resolution
|
||||||
res = mk_unit_resolution_core(args.size(), args.c_ptr());
|
res = mk_unit_resolution_core(args.size(), args.c_ptr());
|
||||||
compute_mark1(res);
|
compute_mark1(res);
|
||||||
} else {
|
} else {
|
||||||
|
@ -340,7 +340,7 @@ void reduce_hypotheses(proof_ref &pr) {
|
||||||
class reduce_hypotheses0 {
|
class reduce_hypotheses0 {
|
||||||
typedef obj_hashtable<expr> expr_set;
|
typedef obj_hashtable<expr> expr_set;
|
||||||
ast_manager& m;
|
ast_manager& m;
|
||||||
// reference for any expression created by the tranformation
|
// reference for any expression created by the transformation
|
||||||
expr_ref_vector m_refs;
|
expr_ref_vector m_refs;
|
||||||
// currently computed result
|
// currently computed result
|
||||||
obj_map<proof,proof*> m_cache;
|
obj_map<proof,proof*> m_cache;
|
||||||
|
@ -352,7 +352,7 @@ class reduce_hypotheses0 {
|
||||||
unsigned_vector m_limits;
|
unsigned_vector m_limits;
|
||||||
// map from proofs to active hypotheses
|
// map from proofs to active hypotheses
|
||||||
obj_map<proof, expr_set*> m_hypmap;
|
obj_map<proof, expr_set*> m_hypmap;
|
||||||
// refernce train for hypotheses sets
|
// reference train for hypotheses sets
|
||||||
ptr_vector<expr_set> m_hyprefs;
|
ptr_vector<expr_set> m_hyprefs;
|
||||||
ptr_vector<expr> m_literals;
|
ptr_vector<expr> m_literals;
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ public:
|
||||||
// replace result by m_units[m.get_fact (p)] if defined
|
// replace result by m_units[m.get_fact (p)] if defined
|
||||||
// AG: This is the main step. Replace a hypothesis by a derivation of its consequence
|
// AG: This is the main step. Replace a hypothesis by a derivation of its consequence
|
||||||
if (!m_units.find(m.get_fact(p), result)) {
|
if (!m_units.find(m.get_fact(p), result)) {
|
||||||
// restore ther result back to p
|
// restore the result back to p
|
||||||
result = p.get();
|
result = p.get();
|
||||||
}
|
}
|
||||||
// compute hypothesis of the result
|
// compute hypothesis of the result
|
||||||
|
|
|
@ -761,7 +761,7 @@ public:
|
||||||
return m_array_fid;
|
return m_array_fid;
|
||||||
}
|
}
|
||||||
virtual char const * get_usage() const { return "<symbol> (<sort>+) <func-decl-ref>"; }
|
virtual char const * get_usage() const { return "<symbol> (<sort>+) <func-decl-ref>"; }
|
||||||
virtual char const * get_descr(cmd_context & ctx) const { return "declare a new array map operator with name <symbol> using the given function declaration.\n<func-decl-ref> ::= <symbol>\n | (<symbol> (<sort>*) <sort>)\n | ((_ <symbol> <numeral>+) (<sort>*) <sort>)\nThe last two cases are used to disumbiguate between declarations with the same name and/or select (indexed) builtin declarations.\nFor more details about the the array map operator, see 'Generalized and Efficient Array Decision Procedures' (FMCAD 2009).\nExample: (declare-map set-union (Int) (or (Bool Bool) Bool))\nDeclares a new function (declare-fun set-union ((Array Int Bool) (Array Int Bool)) (Array Int Bool)).\nThe instance of the map axiom for this new declaration is:\n(forall ((a1 (Array Int Bool)) (a2 (Array Int Bool)) (i Int)) (= (select (set-union a1 a2) i) (or (select a1 i) (select a2 i))))"; }
|
virtual char const * get_descr(cmd_context & ctx) const { return "declare a new array map operator with name <symbol> using the given function declaration.\n<func-decl-ref> ::= <symbol>\n | (<symbol> (<sort>*) <sort>)\n | ((_ <symbol> <numeral>+) (<sort>*) <sort>)\nThe last two cases are used to disumbiguate between declarations with the same name and/or select (indexed) builtin declarations.\nFor more details about the array map operator, see 'Generalized and Efficient Array Decision Procedures' (FMCAD 2009).\nExample: (declare-map set-union (Int) (or (Bool Bool) Bool))\nDeclares a new function (declare-fun set-union ((Array Int Bool) (Array Int Bool)) (Array Int Bool)).\nThe instance of the map axiom for this new declaration is:\n(forall ((a1 (Array Int Bool)) (a2 (Array Int Bool)) (i Int)) (= (select (set-union a1 a2) i) (or (select a1 i) (select a2 i))))"; }
|
||||||
virtual unsigned get_arity() const { return 3; }
|
virtual unsigned get_arity() const { return 3; }
|
||||||
virtual void prepare(cmd_context & ctx) { m_name = symbol::null; m_domain.reset(); }
|
virtual void prepare(cmd_context & ctx) { m_name = symbol::null; m_domain.reset(); }
|
||||||
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
|
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const {
|
||||||
|
|
|
@ -114,7 +114,7 @@ namespace Duality {
|
||||||
|
|
||||||
/** This is the main solver. It takes an arbitrary (possibly cyclic)
|
/** This is the main solver. It takes an arbitrary (possibly cyclic)
|
||||||
RPFP and either annotates it with a solution, or returns a
|
RPFP and either annotates it with a solution, or returns a
|
||||||
counterexample derivation in the form of an embedd RPFP tree. */
|
counterexample derivation in the form of an embedded RPFP tree. */
|
||||||
|
|
||||||
class Duality : public Solver {
|
class Duality : public Solver {
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ namespace polynomial {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Install a "delete polynomial" event handler.
|
\brief Install a "delete polynomial" event handler.
|
||||||
The even hanlder is not owned by the polynomial manager.
|
The event handler is not owned by the polynomial manager.
|
||||||
If eh = 0, then it uninstall the event handler.
|
If eh = 0, then it uninstall the event handler.
|
||||||
*/
|
*/
|
||||||
void add_del_eh(del_eh * eh);
|
void add_del_eh(del_eh * eh);
|
||||||
|
@ -426,7 +426,7 @@ namespace polynomial {
|
||||||
polynomial * flip_sign_if_lm_neg(polynomial const * p);
|
polynomial * flip_sign_if_lm_neg(polynomial const * p);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\breif Return the gcd g of p and q.
|
\brief Return the gcd g of p and q.
|
||||||
*/
|
*/
|
||||||
void gcd(polynomial const * p, polynomial const * q, polynomial_ref & g);
|
void gcd(polynomial const * p, polynomial const * q, polynomial_ref & g);
|
||||||
|
|
||||||
|
@ -853,7 +853,7 @@ namespace polynomial {
|
||||||
void resultant(polynomial const * p, polynomial const * q, var x, polynomial_ref & r);
|
void resultant(polynomial const * p, polynomial const * q, var x, polynomial_ref & r);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Stroe in r the discriminant of p with respect to variable x.
|
\brief Store in r the discriminant of p with respect to variable x.
|
||||||
discriminant(p, x, r) == resultant(p, derivative(p, x), x, r)
|
discriminant(p, x, r) == resultant(p, derivative(p, x), x, r)
|
||||||
*/
|
*/
|
||||||
void discriminant(polynomial const * p, var x, polynomial_ref & r);
|
void discriminant(polynomial const * p, var x, polynomial_ref & r);
|
||||||
|
@ -959,7 +959,7 @@ namespace polynomial {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Apply substiution [x -> p/q] in r.
|
\brief Apply substitution [x -> p/q] in r.
|
||||||
That is, given r \in Z[x, y_1, .., y_m] return
|
That is, given r \in Z[x, y_1, .., y_m] return
|
||||||
polynomial q^k * r(p/q, y_1, .., y_m), where k is the maximal degree of x in r.
|
polynomial q^k * r(p/q, y_1, .., y_m), where k is the maximal degree of x in r.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -152,7 +152,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief 'Disagonalizes' the matrix using only column operations. The reusling matrix will have -1 at pivot
|
\brief 'Diagonalizes' the matrix using only column operations. The resulting matrix will have -1 at pivot
|
||||||
elements. Returns the rank of the null space.
|
elements. Returns the rank of the null space.
|
||||||
*/
|
*/
|
||||||
unsigned diagonalize() {
|
unsigned diagonalize() {
|
||||||
|
@ -170,7 +170,7 @@ public:
|
||||||
m_column_pivot[j] = i;
|
m_column_pivot[j] = i;
|
||||||
m_row_pivot[i] = j;
|
m_row_pivot[i] = j;
|
||||||
|
|
||||||
// found a pivot, to make it -1 we compute the multuplier -p^-1
|
// found a pivot, to make it -1 we compute the multiplier -p^-1
|
||||||
m_zpm.set(multiplier, get(i, j));
|
m_zpm.set(multiplier, get(i, j));
|
||||||
m_zpm.inv(multiplier);
|
m_zpm.inv(multiplier);
|
||||||
m_zpm.neg(multiplier);
|
m_zpm.neg(multiplier);
|
||||||
|
@ -201,7 +201,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
If rank of the matrix is n - r, we are interested in linearly indeprendent vectors v_1, ..., v_r (the basis of
|
If rank of the matrix is n - r, we are interested in linearly independent vectors v_1, ..., v_r (the basis of
|
||||||
the null space), such that v_k A = 0. This method will give one at a time. The method returns true if vector has
|
the null space), such that v_k A = 0. This method will give one at a time. The method returns true if vector has
|
||||||
been computed properly. The first vector [1, 0, ..., 0] is ignored (m_null_row starts from 1).
|
been computed properly. The first vector [1, 0, ..., 0] is ignored (m_null_row starts from 1).
|
||||||
*/
|
*/
|
||||||
|
@ -417,7 +417,7 @@ bool zp_factor_square_free_berlekamp(zp_manager & upm, numeral_vector const & f,
|
||||||
// construct the berlekamp Q matrix to get the null space
|
// construct the berlekamp Q matrix to get the null space
|
||||||
berlekamp_matrix Q_I(upm, f);
|
berlekamp_matrix Q_I(upm, f);
|
||||||
|
|
||||||
// copy the inital polynomial to factors
|
// copy the initial polynomial to factors
|
||||||
unsigned first_factor = factors.distinct_factors();
|
unsigned first_factor = factors.distinct_factors();
|
||||||
factors.push_back(f, 1);
|
factors.push_back(f, 1);
|
||||||
|
|
||||||
|
@ -473,7 +473,7 @@ bool zp_factor_square_free_berlekamp(zp_manager & upm, numeral_vector const & f,
|
||||||
// get the gcd
|
// get the gcd
|
||||||
upm.gcd(v_k.size(), v_k.c_ptr(), current_factor.size(), current_factor.c_ptr(), gcd);
|
upm.gcd(v_k.size(), v_k.c_ptr(), current_factor.size(), current_factor.c_ptr(), gcd);
|
||||||
|
|
||||||
// if the gcd is 1, or the the gcd is f, we just ignroe it
|
// if the gcd is 1, or the gcd is f, we just ignore it
|
||||||
if (gcd.size() != 1 && gcd.size() != current_factor.size()) {
|
if (gcd.size() != 1 && gcd.size() != current_factor.size()) {
|
||||||
|
|
||||||
// get the divisor also (no need to normalize the div, both are monic)
|
// get the divisor also (no need to normalize the div, both are monic)
|
||||||
|
@ -568,12 +568,12 @@ bool check_hansel_lift(z_manager & upm, numeral_vector const & C,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Performs a Hensel lift of A and B in Z_a to Z_b, where p is prime and and a = p^{a_k}, b = p^{b_k},
|
Performs a Hensel lift of A and B in Z_a to Z_b, where p is prime and a = p^{a_k}, b = p^{b_k},
|
||||||
r = (a, b), with the following assumptions:
|
r = (a, b), with the following assumptions:
|
||||||
|
|
||||||
(1) UA + VB = 1 (mod a)
|
(1) UA + VB = 1 (mod a)
|
||||||
(2) C = A*B (mod b)
|
(2) C = A*B (mod b)
|
||||||
(3) (l(A), r) = 1 (importand in order to divide by A, i.e. to invert l(A))
|
(3) (l(A), r) = 1 (important in order to divide by A, i.e. to invert l(A))
|
||||||
(4) deg(A) + deg(B) = deg(C)
|
(4) deg(A) + deg(B) = deg(C)
|
||||||
|
|
||||||
The output of is two polynomials A1, B1 such that A1 = A (mod b), B1 = B (mod b),
|
The output of is two polynomials A1, B1 such that A1 = A (mod b), B1 = B (mod b),
|
||||||
|
@ -625,7 +625,7 @@ void hensel_lift(z_manager & upm, numeral const & a, numeral const & b, numeral
|
||||||
// having (1) AU + BV = 1 (mod r) and (5) AT + BS = f (mod r), we know that
|
// having (1) AU + BV = 1 (mod r) and (5) AT + BS = f (mod r), we know that
|
||||||
// A*(fU) + B*(fV) = f (mod r), i.e. T = fU, S = fV is a solution
|
// A*(fU) + B*(fV) = f (mod r), i.e. T = fU, S = fV is a solution
|
||||||
// but we also know that we need an S with deg(S) <= deg(A) so we can do the following
|
// but we also know that we need an S with deg(S) <= deg(A) so we can do the following
|
||||||
// we know that l(A) is invertible so we can find the exact remainder of fV with A, i.e. find the qotient
|
// we know that l(A) is invertible so we can find the exact remainder of fV with A, i.e. find the quotient
|
||||||
// t in the division and set
|
// t in the division and set
|
||||||
// A*(fU + tB) + B*(fV - tA) = f
|
// A*(fU + tB) + B*(fV - tA) = f
|
||||||
// T = fU + tB, S = fU - tA
|
// T = fU + tB, S = fU - tA
|
||||||
|
@ -1093,7 +1093,7 @@ bool factor_square_free(z_manager & upm, numeral_vector const & f, factors & fs,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it's not square free, we also try somehting else
|
// if it's not square free, we also try something else
|
||||||
scoped_numeral_vector f_pp_zp(nm);
|
scoped_numeral_vector f_pp_zp(nm);
|
||||||
to_zp_manager(zp_upm, f_pp, f_pp_zp);
|
to_zp_manager(zp_upm, f_pp, f_pp_zp);
|
||||||
|
|
||||||
|
@ -1170,7 +1170,7 @@ bool factor_square_free(z_manager & upm, numeral_vector const & f, factors & fs,
|
||||||
zp_numeral_manager & zpe_nm = zpe_upm.m();
|
zp_numeral_manager & zpe_nm = zpe_upm.m();
|
||||||
|
|
||||||
zp_factors zpe_fs(zpe_upm);
|
zp_factors zpe_fs(zpe_upm);
|
||||||
// this might give something bigger than p^e, but the lifting proocedure will update the zpe_nm
|
// this might give something bigger than p^e, but the lifting procedure will update the zpe_nm
|
||||||
// zp factors are monic, so will be the zpe factors, i.e. f_pp = zpe_fs * lc(f_pp) (mod p^e)
|
// zp factors are monic, so will be the zpe factors, i.e. f_pp = zpe_fs * lc(f_pp) (mod p^e)
|
||||||
hensel_lift(upm, f_pp, zp_fs, e, zpe_fs);
|
hensel_lift(upm, f_pp, zp_fs, e, zpe_fs);
|
||||||
|
|
||||||
|
@ -1182,7 +1182,7 @@ bool factor_square_free(z_manager & upm, numeral_vector const & f, factors & fs,
|
||||||
scoped_numeral f_pp_lc(nm);
|
scoped_numeral f_pp_lc(nm);
|
||||||
zpe_nm.set(f_pp_lc, f_pp.back());
|
zpe_nm.set(f_pp_lc, f_pp.back());
|
||||||
|
|
||||||
// we always keep in f_pp the the actual primitive part f_pp*lc(f_pp)
|
// we always keep in f_pp the actual primitive part f_pp*lc(f_pp)
|
||||||
upm.mul(f_pp, f_pp_lc);
|
upm.mul(f_pp, f_pp_lc);
|
||||||
|
|
||||||
// now we go through the combinations of factors to check construct the factorization
|
// now we go through the combinations of factors to check construct the factorization
|
||||||
|
@ -1287,7 +1287,7 @@ bool factor_square_free(z_manager & upm, numeral_vector const & f, factors & fs,
|
||||||
fs.push_back(f_pp, k);
|
fs.push_back(f_pp, k);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// if a constant it must be 1 (it was primitve)
|
// if a constant it must be 1 (it was primitive)
|
||||||
SASSERT(f_pp.size() == 1 && nm.is_one(f_pp.back()));
|
SASSERT(f_pp.size() == 1 && nm.is_one(f_pp.back()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,12 +34,12 @@ namespace upolynomial {
|
||||||
typedef manager::scoped_numeral scoped_numeral;
|
typedef manager::scoped_numeral scoped_numeral;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\breif Factor f into f = f_1^k_1 * ... * p_n^k_n, such that p_i are square-free and coprime.
|
\brief Factor f into f = f_1^k_1 * ... * p_n^k_n, such that p_i are square-free and coprime.
|
||||||
*/
|
*/
|
||||||
void zp_square_free_factor(zp_manager & zp_upm, numeral_vector const & f, zp_factors & sq_free_factors);
|
void zp_square_free_factor(zp_manager & zp_upm, numeral_vector const & f, zp_factors & sq_free_factors);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Factor the monic square-free polynomial f from Z_p[x]. Returns true if factorization was sucesseful, or false
|
\brief Factor the monic square-free polynomial f from Z_p[x]. Returns true if factorization was successful, or false
|
||||||
if f is an irreducible square-free polynomial in Z_p[x].
|
if f is an irreducible square-free polynomial in Z_p[x].
|
||||||
*/
|
*/
|
||||||
bool zp_factor_square_free(zp_manager & zp_upm, numeral_vector const & f, zp_factors & factors);
|
bool zp_factor_square_free(zp_manager & zp_upm, numeral_vector const & f, zp_factors & factors);
|
||||||
|
@ -55,17 +55,17 @@ namespace upolynomial {
|
||||||
bool zp_factor_square_free_berlekamp(zp_manager & zp_upm, numeral_vector const & f, zp_factors & factors, bool randomized = true);
|
bool zp_factor_square_free_berlekamp(zp_manager & zp_upm, numeral_vector const & f, zp_factors & factors, bool randomized = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Factor the polynomial f from Z_p[x]. Returns true if factorization was sucesseful, or false if f is
|
\brief Factor the polynomial f from Z_p[x]. Returns true if factorization was successful, or false if f is
|
||||||
an irreducible polynomial in Z_p[x]
|
an irreducible polynomial in Z_p[x]
|
||||||
*/
|
*/
|
||||||
bool zp_factor(zp_manager & zp_upm, numeral_vector const & f, zp_factors & factors);
|
bool zp_factor(zp_manager & zp_upm, numeral_vector const & f, zp_factors & factors);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Performs a Hensel lift of A and B in Z_a to Z_b, where p is prime and and a = p^{a_k}, b = p^{b_k},
|
\brief Performs a Hensel lift of A and B in Z_a to Z_b, where p is prime and a = p^{a_k}, b = p^{b_k},
|
||||||
r = (a, b), with the following assumptions:
|
r = (a, b), with the following assumptions:
|
||||||
* UA + VB = 1 (mod a)
|
* UA + VB = 1 (mod a)
|
||||||
* C = AB (mod b)
|
* C = AB (mod b)
|
||||||
* (l(A), r) = 1 (importand in order to divide by A, i.e. to invert l(A))
|
* (l(A), r) = 1 (important in order to divide by A, i.e. to invert l(A))
|
||||||
the output of is two polynomials A1, B1 (replacing A and B) such that A1 = A (mod b), B1 = B (mod b),
|
the output of is two polynomials A1, B1 (replacing A and B) such that A1 = A (mod b), B1 = B (mod b),
|
||||||
l(A1) = l(A), deg(A1) = deg(A), deg(B1) = deg(B) and C = A1 B1 (mod b*r). Such A1, B1 are unique if
|
l(A1) = l(A), deg(A1) = deg(A), deg(B1) = deg(B) and C = A1 B1 (mod b*r). Such A1, B1 are unique if
|
||||||
r is prime. See [3] p. 138.
|
r is prime. See [3] p. 138.
|
||||||
|
@ -82,7 +82,7 @@ namespace upolynomial {
|
||||||
void hensel_lift(z_manager & upm, numeral_vector const & f, zp_factors const & factors_p, unsigned e, zp_factors & factors_pe);
|
void hensel_lift(z_manager & upm, numeral_vector const & f, zp_factors const & factors_p, unsigned e, zp_factors & factors_pe);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Factor the square-free polynomial f from Z[x]. Returns true if factorization was sucesseful, or false if
|
\brief Factor the square-free polynomial f from Z[x]. Returns true if factorization was successful, or false if
|
||||||
f is an irreducible polynomial in Z[x]. The vector of factors is cleared.
|
f is an irreducible polynomial in Z[x]. The vector of factors is cleared.
|
||||||
*/
|
*/
|
||||||
bool factor_square_free(z_manager & upm, numeral_vector const & f, factors & fs, factor_params const & ps = factor_params());
|
bool factor_square_free(z_manager & upm, numeral_vector const & f, factors & fs, factor_params const & ps = factor_params());
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace datalog {
|
||||||
predicates.insert(I->first);
|
predicates.insert(I->first);
|
||||||
}
|
}
|
||||||
|
|
||||||
// reserve pred id = 0 for initalization purposes
|
// reserve pred id = 0 for initialization purposes
|
||||||
unsigned num_preds = (unsigned)predicates.size() + 1;
|
unsigned num_preds = (unsigned)predicates.size() + 1;
|
||||||
|
|
||||||
// poor's man round-up log2
|
// poor's man round-up log2
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace datalog {
|
||||||
}
|
}
|
||||||
|
|
||||||
relation_base * sieve_relation::complement(func_decl* p) const {
|
relation_base * sieve_relation::complement(func_decl* p) const {
|
||||||
//this is not precisely a complement, because we still treat the ignored collumns as
|
//this is not precisely a complement, because we still treat the ignored columns as
|
||||||
//full, but it should give reasonable results inside the product relation
|
//full, but it should give reasonable results inside the product relation
|
||||||
relation_base * new_inner = get_inner().complement(p);
|
relation_base * new_inner = get_inner().complement(p);
|
||||||
return get_plugin().mk_from_inner(get_signature(), m_inner_cols.c_ptr(), new_inner);
|
return get_plugin().mk_from_inner(get_signature(), m_inner_cols.c_ptr(), new_inner);
|
||||||
|
|
|
@ -424,7 +424,7 @@ namespace datalog {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\c array \c removed_cols contains column indexes to be removed in ascending order and
|
\c array \c removed_cols contains column indexes to be removed in ascending order and
|
||||||
is terminated by a number greated than the highest column index of a join the the two tables.
|
is terminated by a number greater than the highest column index of a join the two tables.
|
||||||
This is to simplify the traversal of the array when building facts.
|
This is to simplify the traversal of the array when building facts.
|
||||||
*/
|
*/
|
||||||
static void concatenate_rows(const column_layout & layout1, const column_layout & layout2,
|
static void concatenate_rows(const column_layout & layout1, const column_layout & layout2,
|
||||||
|
@ -436,7 +436,7 @@ namespace datalog {
|
||||||
columns from t2 using indexing.
|
columns from t2 using indexing.
|
||||||
|
|
||||||
\c array \c removed_cols contains column indexes to be removed in ascending order and
|
\c array \c removed_cols contains column indexes to be removed in ascending order and
|
||||||
is terminated by a number greated than the highest column index of a join the the two tables.
|
is terminated by a number greater than the highest column index of a join the two tables.
|
||||||
This is to simplify the traversal of the array when building facts.
|
This is to simplify the traversal of the array when building facts.
|
||||||
|
|
||||||
\c tables_swapped value means that the resulting facts should contain facts from t2 first,
|
\c tables_swapped value means that the resulting facts should contain facts from t2 first,
|
||||||
|
|
|
@ -25,7 +25,7 @@ namespace spacer {
|
||||||
|
|
||||||
class spacer_matrix {
|
class spacer_matrix {
|
||||||
public:
|
public:
|
||||||
spacer_matrix(unsigned m, unsigned n); // m rows, n colums
|
spacer_matrix(unsigned m, unsigned n); // m rows, n columns
|
||||||
|
|
||||||
unsigned num_rows();
|
unsigned num_rows();
|
||||||
unsigned num_cols();
|
unsigned num_cols();
|
||||||
|
|
|
@ -242,7 +242,7 @@ namespace nlsat {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\breif Store in ps the polynomials occurring in the given literals.
|
\brief Store in ps the polynomials occurring in the given literals.
|
||||||
*/
|
*/
|
||||||
void collect_polys(unsigned num, literal const * ls, polynomial_ref_vector & ps) {
|
void collect_polys(unsigned num, literal const * ls, polynomial_ref_vector & ps) {
|
||||||
ps.reset();
|
ps.reset();
|
||||||
|
@ -332,7 +332,7 @@ namespace nlsat {
|
||||||
if (!is_zero(lc)) {
|
if (!is_zero(lc)) {
|
||||||
if (sign(lc) != 0)
|
if (sign(lc) != 0)
|
||||||
return;
|
return;
|
||||||
// lc is not the zero polynomial, but it vanished in the current interpretaion.
|
// lc is not the zero polynomial, but it vanished in the current interpretation.
|
||||||
// so we keep searching...
|
// so we keep searching...
|
||||||
add_zero_assumption(lc);
|
add_zero_assumption(lc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -387,9 +387,9 @@ static void tst9() {
|
||||||
|
|
||||||
static void tst10(bool use_ints) {
|
static void tst10(bool use_ints) {
|
||||||
if (use_ints)
|
if (use_ints)
|
||||||
std::cout << "Testing multiplication performace using small ints\n";
|
std::cout << "Testing multiplication performance using small ints\n";
|
||||||
else
|
else
|
||||||
std::cout << "Testing multiplication performace using small rationals\n";
|
std::cout << "Testing multiplication performance using small rationals\n";
|
||||||
vector<rational> vals;
|
vector<rational> vals;
|
||||||
vector<rational> vals2;
|
vector<rational> vals2;
|
||||||
vector<float> fvals;
|
vector<float> fvals;
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
set_global_param('pp.decimal', 'true')
|
set_global_param('pp.decimal', 'true')
|
||||||
will set the parameter "decimal" in the module "pp" to true.
|
will set the parameter "decimal" in the module "pp" to true.
|
||||||
|
|
||||||
An exception is thrown if the the parameter name is unknown, or if the value is incorrect.
|
An exception is thrown if the parameter name is unknown, or if the value is incorrect.
|
||||||
*/
|
*/
|
||||||
static void set(char const * name, char const * value);
|
static void set(char const * name, char const * value);
|
||||||
static void set(symbol const & name, char const * value);
|
static void set(symbol const & name, char const * value);
|
||||||
|
@ -57,7 +57,7 @@ public:
|
||||||
|
|
||||||
If the parameter is not set, then it just returns 'default'.
|
If the parameter is not set, then it just returns 'default'.
|
||||||
|
|
||||||
An exception is thrown if the the parameter name is unknown.
|
An exception is thrown if the parameter name is unknown.
|
||||||
*/
|
*/
|
||||||
static std::string get_value(char const * name);
|
static std::string get_value(char const * name);
|
||||||
static std::string get_value(symbol const & name);
|
static std::string get_value(symbol const & name);
|
||||||
|
|
|
@ -187,7 +187,7 @@ class mpz_manager {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Set \c a with the value stored at m_tmp[IDX], and the given sign.
|
\brief Set \c a with the value stored at m_tmp[IDX], and the given sign.
|
||||||
\c sz is an overapproximation of the the size of the number stored at \c tmp.
|
\c sz is an overapproximation of the size of the number stored at \c tmp.
|
||||||
*/
|
*/
|
||||||
template<int IDX>
|
template<int IDX>
|
||||||
void set(mpz & a, int sign, unsigned sz);
|
void set(mpz & a, int sign, unsigned sz);
|
||||||
|
|
Loading…
Reference in a new issue