3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +00:00

Added support for the final draft of the FPA standard (and fpa2bv conversion).

Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
Christoph M. Wintersteiger 2014-01-24 15:36:23 +00:00
parent b2be81fd4d
commit 0e74362ecb
12 changed files with 290 additions and 14 deletions

View file

@ -36,3 +36,77 @@ tactic * mk_qffpa_tactic(ast_manager & m, params_ref const & p) {
mk_sat_tactic(m, p),
mk_fail_if_undecided_tactic());
}
struct is_non_qffpa_predicate {
struct found {};
ast_manager & m;
float_util u;
is_non_qffpa_predicate(ast_manager & _m) :m(_m), u(m) {}
void operator()(var *) { throw found(); }
void operator()(quantifier *) { throw found(); }
void operator()(app * n) {
sort * s = get_sort(n);
if (!m.is_bool(s) && !(u.is_float(s) || u.is_rm(s)))
throw found();
family_id fid = s->get_family_id();
if (fid == m.get_basic_family_id())
return;
if (fid == u.get_family_id())
return;
throw found();
}
};
struct is_non_qffpabv_predicate {
struct found {};
ast_manager & m;
bv_util bu;
float_util fu;
is_non_qffpabv_predicate(ast_manager & _m) :m(_m), bu(m), fu(m) {}
void operator()(var *) { throw found(); }
void operator()(quantifier *) { throw found(); }
void operator()(app * n) {
sort * s = get_sort(n);
if (!m.is_bool(s) && !(fu.is_float(s) || fu.is_rm(s) || bu.is_bv_sort(s)))
throw found();
family_id fid = s->get_family_id();
if (fid == m.get_basic_family_id())
return;
if (fid == fu.get_family_id() || fid == bu.get_family_id())
return;
throw found();
}
};
class is_qffpa_probe : public probe {
public:
virtual result operator()(goal const & g) {
return !test<is_non_qffpa_predicate>(g);
}
};
class is_qffpabv_probe : public probe {
public:
virtual result operator()(goal const & g) {
return !test<is_non_qffpabv_predicate>(g);
}
};
probe * mk_is_qffpa_probe() {
return alloc(is_qffpa_probe);
}
probe * mk_is_qffpabv_probe() {
return alloc(is_qffpabv_probe);
}