mirror of
https://github.com/Z3Prover/z3
synced 2025-08-02 01:13:18 +00:00
Formatting, mostly tabs.
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
parent
cad841cff4
commit
0381e4317a
10 changed files with 1448 additions and 1478 deletions
|
@ -3197,7 +3197,7 @@ void fpa2bv_converter::mk_rounding_mode(func_decl * f, expr_ref & result)
|
|||
|
||||
void fpa2bv_converter::dbg_decouple(const char * prefix, expr_ref & e) {
|
||||
#ifdef Z3DEBUG
|
||||
// return;
|
||||
return;
|
||||
// CMW: This works only for quantifier-free formulas.
|
||||
expr_ref new_e(m);
|
||||
new_e = m.mk_fresh_const(prefix, m.get_sort(e));
|
||||
|
|
|
@ -172,8 +172,7 @@ namespace Duality {
|
|||
Term b(ctx);
|
||||
std::vector<Term> v;
|
||||
RedVars(child, b, v);
|
||||
for (unsigned i = 0; i < args.size(); i++)
|
||||
{
|
||||
for (unsigned i = 0; i < args.size(); i++) {
|
||||
if (eq(args[i].get_sort(), ctx.bool_sort()))
|
||||
args[i] = ctx.make(Iff, args[i], v[i]);
|
||||
else
|
||||
|
@ -231,8 +230,7 @@ namespace Duality {
|
|||
res = it->second;
|
||||
return res;
|
||||
}
|
||||
if (t.is_app())
|
||||
{
|
||||
if (t.is_app()) {
|
||||
func_decl f = t.decl();
|
||||
std::vector<Term> args;
|
||||
int nargs = t.num_args();
|
||||
|
@ -242,18 +240,15 @@ namespace Duality {
|
|||
if (rit != e->relMap.end())
|
||||
res = RedDualRela(e, args, (rit->second));
|
||||
else {
|
||||
if (args.size() == 0 && f.get_decl_kind() == Uninterpreted && !ls->is_constant(f))
|
||||
{
|
||||
if (args.size() == 0 && f.get_decl_kind() == Uninterpreted && !ls->is_constant(f)) {
|
||||
res = HideVariable(t, e->number);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
res = f(args.size(), &args[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (t.is_quantifier())
|
||||
{
|
||||
else if (t.is_quantifier()) {
|
||||
std::vector<expr> pats;
|
||||
t.get_patterns(pats);
|
||||
for (unsigned i = 0; i < pats.size(); i++)
|
||||
|
@ -353,8 +348,7 @@ namespace Duality {
|
|||
std::pair<hash_map<ast,Term>::iterator, bool> bar = memo.insert(foo);
|
||||
Term &res = bar.first->second;
|
||||
if(!bar.second) return res;
|
||||
if (t.is_app())
|
||||
{
|
||||
if (t.is_app()) {
|
||||
func_decl f = t.decl();
|
||||
std::vector<Term> args;
|
||||
int nargs = t.num_args();
|
||||
|
@ -362,8 +356,7 @@ namespace Duality {
|
|||
args.push_back(SubstRec(memo, t.arg(i)));
|
||||
res = f(args.size(), &args[0]);
|
||||
}
|
||||
else if (t.is_quantifier())
|
||||
{
|
||||
else if (t.is_quantifier()) {
|
||||
std::vector<expr> pats;
|
||||
t.get_patterns(pats);
|
||||
for (unsigned i = 0; i < pats.size(); i++)
|
||||
|
@ -382,8 +375,7 @@ namespace Duality {
|
|||
std::pair<hash_map<ast,Term>::iterator, bool> bar = memo.insert(foo);
|
||||
Term &res = bar.first->second;
|
||||
if(!bar.second) return res;
|
||||
if (t.is_app())
|
||||
{
|
||||
if (t.is_app()) {
|
||||
func_decl f = t.decl();
|
||||
std::vector<Term> args;
|
||||
int nargs = t.num_args();
|
||||
|
@ -394,8 +386,7 @@ namespace Duality {
|
|||
f = it->second;
|
||||
res = f(args.size(), &args[0]);
|
||||
}
|
||||
else if (t.is_quantifier())
|
||||
{
|
||||
else if (t.is_quantifier()) {
|
||||
std::vector<expr> pats;
|
||||
t.get_patterns(pats);
|
||||
for (unsigned i = 0; i < pats.size(); i++)
|
||||
|
@ -655,14 +646,12 @@ namespace Duality {
|
|||
}
|
||||
|
||||
|
||||
Z3User::Term Z3User::RemoveRedundancyRec(hash_map<ast, Term> &memo, hash_map<ast, Term> &smemo, const Term &t)
|
||||
{
|
||||
Z3User::Term Z3User::RemoveRedundancyRec(hash_map<ast, Term> &memo, hash_map<ast, Term> &smemo, const Term &t) {
|
||||
std::pair<ast, Term> foo(t, expr(ctx));
|
||||
std::pair<hash_map<ast, Term>::iterator, bool> bar = memo.insert(foo);
|
||||
Term &res = bar.first->second;
|
||||
if (!bar.second) return res;
|
||||
if (t.is_app())
|
||||
{
|
||||
if (t.is_app()) {
|
||||
func_decl f = t.decl();
|
||||
std::vector<Term> args;
|
||||
int nargs = t.num_args();
|
||||
|
@ -684,8 +673,7 @@ namespace Duality {
|
|||
res = f(args.size(), &args[0]);
|
||||
}
|
||||
}
|
||||
else if (t.is_quantifier())
|
||||
{
|
||||
else if (t.is_quantifier()) {
|
||||
Term body = RemoveRedundancyRec(memo, smemo, t.body());
|
||||
res = CloneQuantAndSimp(t, body);
|
||||
}
|
||||
|
@ -706,14 +694,12 @@ namespace Duality {
|
|||
return t;
|
||||
}
|
||||
|
||||
Z3User::Term Z3User::IneqToEqRec(hash_map<ast, Term> &memo, const Term &t)
|
||||
{
|
||||
Z3User::Term Z3User::IneqToEqRec(hash_map<ast, Term> &memo, const Term &t) {
|
||||
std::pair<ast, Term> foo(t, expr(ctx));
|
||||
std::pair<hash_map<ast, Term>::iterator, bool> bar = memo.insert(foo);
|
||||
Term &res = bar.first->second;
|
||||
if (!bar.second) return res;
|
||||
if (t.is_app())
|
||||
{
|
||||
if (t.is_app()) {
|
||||
func_decl f = t.decl();
|
||||
std::vector<Term> args;
|
||||
int nargs = t.num_args();
|
||||
|
@ -736,8 +722,7 @@ namespace Duality {
|
|||
}
|
||||
res = f(args.size(), &args[0]);
|
||||
}
|
||||
else if (t.is_quantifier())
|
||||
{
|
||||
else if (t.is_quantifier()) {
|
||||
Term body = IneqToEqRec(memo, t.body());
|
||||
res = clone_quantifier(t, body);
|
||||
}
|
||||
|
@ -750,14 +735,12 @@ namespace Duality {
|
|||
return IneqToEqRec(memo,t);
|
||||
}
|
||||
|
||||
Z3User::Term Z3User::SubstRecHide(hash_map<ast, Term> &memo, const Term &t, int number)
|
||||
{
|
||||
Z3User::Term Z3User::SubstRecHide(hash_map<ast, Term> &memo, const Term &t, int number) {
|
||||
std::pair<ast, Term> foo(t, expr(ctx));
|
||||
std::pair<hash_map<ast, Term>::iterator, bool> bar = memo.insert(foo);
|
||||
Term &res = bar.first->second;
|
||||
if (!bar.second) return res;
|
||||
if (t.is_app())
|
||||
{
|
||||
if (t.is_app()) {
|
||||
func_decl f = t.decl();
|
||||
std::vector<Term> args;
|
||||
int nargs = t.num_args();
|
||||
|
@ -855,11 +838,9 @@ namespace Duality {
|
|||
root->Annotation.Formula = annot;
|
||||
}
|
||||
|
||||
void RPFP::DecodeTree(Node *root, TermTree *interp, int persist)
|
||||
{
|
||||
void RPFP::DecodeTree(Node *root, TermTree *interp, int persist) {
|
||||
std::vector<TermTree *> &ic = interp->getChildren();
|
||||
if (ic.size() > 0)
|
||||
{
|
||||
if (ic.size() > 0) {
|
||||
std::vector<Node *> &nc = root->Outgoing->Children;
|
||||
for (unsigned i = 0; i < nc.size(); i++)
|
||||
DecodeTree(nc[i], ic[i], persist);
|
||||
|
@ -926,8 +907,7 @@ namespace Duality {
|
|||
#endif
|
||||
|
||||
|
||||
expr RPFP::GetEdgeFormula(Edge *e, int persist, bool with_children, bool underapprox)
|
||||
{
|
||||
expr RPFP::GetEdgeFormula(Edge *e, int persist, bool with_children, bool underapprox) {
|
||||
if (e->dual.null()) {
|
||||
timer_start("ReducedDualEdge");
|
||||
e->dual = ReducedDualEdge(e);
|
||||
|
@ -970,8 +950,7 @@ namespace Duality {
|
|||
*
|
||||
*/
|
||||
|
||||
void RPFP::AssertEdge(Edge *e, int persist, bool with_children, bool underapprox)
|
||||
{
|
||||
void RPFP::AssertEdge(Edge *e, int persist, bool with_children, bool underapprox) {
|
||||
if (eq(e->F.Formula, ctx.bool_val(true)) && (!with_children || e->Children.empty()))
|
||||
return;
|
||||
expr fmla = GetEdgeFormula(e, persist, with_children, underapprox);
|
||||
|
@ -1215,8 +1194,7 @@ namespace Duality {
|
|||
|
||||
void RPFP::AssertNode(Node *n)
|
||||
{
|
||||
if (n->dual.null())
|
||||
{
|
||||
if (n->dual.null()) {
|
||||
n->dual = GetUpperBound(n);
|
||||
stack.back().nodes.push_back(n);
|
||||
slvr_add(n->dual);
|
||||
|
@ -1225,8 +1203,7 @@ namespace Duality {
|
|||
|
||||
// caching version of above
|
||||
void RPFP_caching::AssertNodeCache(Node *n, std::vector<Term> lits){
|
||||
if (n->dual.null())
|
||||
{
|
||||
if (n->dual.null()) {
|
||||
n->dual = GetUpperBound(n);
|
||||
stack.back().nodes.push_back(n);
|
||||
GetAssumptionLits(n->dual, lits);
|
||||
|
@ -1373,8 +1350,7 @@ namespace Duality {
|
|||
timer_start("interpolate_tree");
|
||||
lbool res = ls_interpolate_tree(tree, interpolant, dualModel,goals,true);
|
||||
timer_stop("interpolate_tree");
|
||||
if (res == l_false)
|
||||
{
|
||||
if (res == l_false) {
|
||||
DecodeTree(root, interpolant->getChildren()[0], persist);
|
||||
delete interpolant;
|
||||
}
|
||||
|
@ -1419,8 +1395,7 @@ namespace Duality {
|
|||
timer_start("interpolate_tree");
|
||||
lbool res = ls_interpolate_tree(tree, interpolant, dualModel,0,true);
|
||||
timer_stop("interpolate_tree");
|
||||
if (res == l_false)
|
||||
{
|
||||
if (res == l_false) {
|
||||
DecodeTree(node, interpolant->getChildren()[0], 0);
|
||||
delete interpolant;
|
||||
}
|
||||
|
@ -1461,8 +1436,7 @@ namespace Duality {
|
|||
*
|
||||
*/
|
||||
|
||||
check_result RPFP::Check(Node *root, std::vector<Node *> underapproxes, std::vector<Node *> *underapprox_core )
|
||||
{
|
||||
check_result RPFP::Check(Node *root, std::vector<Node *> underapproxes, std::vector<Node *> *underapprox_core) {
|
||||
timer_start("Check");
|
||||
ClearProofCore();
|
||||
// if (dualModel != null) dualModel.Dispose();
|
||||
|
@ -1942,8 +1916,7 @@ namespace Duality {
|
|||
if (resolve_ite_memo.find(t) != resolve_ite_memo.end())
|
||||
return resolve_ite_memo[t];
|
||||
Term res;
|
||||
if (t.is_app())
|
||||
{
|
||||
if (t.is_app()) {
|
||||
func_decl f = t.decl();
|
||||
std::vector<Term> args;
|
||||
int nargs = t.num_args();
|
||||
|
@ -2085,15 +2058,13 @@ namespace Duality {
|
|||
params simp_params;
|
||||
|
||||
VariableProjector(Z3User &_user, std::vector<Term> &keep_vec) :
|
||||
Z3User(_user), simp_params()
|
||||
{
|
||||
Z3User(_user), simp_params() {
|
||||
num_vars = 0;
|
||||
for (unsigned i = 0; i < keep_vec.size(); i++) {
|
||||
keep.insert(keep_vec[i]);
|
||||
var_ord[keep_vec[i]] = num_vars++;
|
||||
}
|
||||
}
|
||||
|
||||
int VarNum(const Term &v) {
|
||||
if (var_ord.find(v) == var_ord.end())
|
||||
var_ord[v] = num_vars++;
|
||||
|
@ -2122,8 +2093,7 @@ namespace Duality {
|
|||
std::pair<hash_map<ast, int>::iterator, bool> bar = memo.insert(foo);
|
||||
// int &res = bar.first->second;
|
||||
if (!bar.second) return;
|
||||
if (t.is_app())
|
||||
{
|
||||
if (t.is_app()) {
|
||||
func_decl f = t.decl();
|
||||
std::vector<Term> args;
|
||||
int nargs = t.num_args();
|
||||
|
@ -2508,7 +2478,7 @@ namespace Duality {
|
|||
expr junct = negate ? Negate(f) : f;
|
||||
lits.push_back(junct);
|
||||
}
|
||||
}
|
||||
}|
|
||||
|
||||
struct TermLt {
|
||||
bool operator()(const expr &x, const expr &y){
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace Duality {
|
|||
if(rpfp)
|
||||
dealloc(rpfp);
|
||||
if(ls)
|
||||
dealloc(ls);
|
||||
(ls);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue