mirror of
https://github.com/Z3Prover/z3
synced 2025-04-08 18:31:49 +00:00
Added tactic for QF_FPLRA
This commit is contained in:
parent
dab8e49e22
commit
a1d870f19f
|
@ -22,14 +22,14 @@ Revision History:
|
|||
|
||||
|
||||
bool smt_logics::supported_logic(symbol const & s) {
|
||||
return logic_has_uf(s) || logic_is_all(s) || logic_has_fd(s) ||
|
||||
return logic_has_uf(s) || logic_is_all(s) || logic_has_fd(s) ||
|
||||
logic_has_arith(s) || logic_has_bv(s) ||
|
||||
logic_has_array(s) || logic_has_seq(s) || logic_has_str(s) ||
|
||||
logic_has_horn(s) || logic_has_fpa(s);
|
||||
}
|
||||
|
||||
bool smt_logics::logic_has_reals_only(symbol const& s) {
|
||||
return
|
||||
return
|
||||
s == "QF_RDL" ||
|
||||
s == "QF_LRA" ||
|
||||
s == "UFLRA" ||
|
||||
|
@ -84,8 +84,9 @@ bool smt_logics::logic_has_arith(symbol const & s) {
|
|||
s == "QF_BVFP" ||
|
||||
s == "QF_S" ||
|
||||
s == "ALL" ||
|
||||
s == "QF_FD" ||
|
||||
s == "HORN";
|
||||
s == "QF_FD" ||
|
||||
s == "HORN" ||
|
||||
s == "QF_FPLRA";
|
||||
}
|
||||
|
||||
bool smt_logics::logic_has_bv(symbol const & s) {
|
||||
|
@ -137,7 +138,7 @@ bool smt_logics::logic_has_str(symbol const & s) {
|
|||
}
|
||||
|
||||
bool smt_logics::logic_has_fpa(symbol const & s) {
|
||||
return s == "QF_FP" || s == "QF_FPBV" || s == "QF_BVFP" || s == "ALL";
|
||||
return s == "QF_FP" || s == "QF_FPBV" || s == "QF_BVFP" || s == "QF_FPLRA" || s == "ALL";
|
||||
}
|
||||
|
||||
bool smt_logics::logic_has_uf(symbol const & s) {
|
||||
|
|
72
src/tactic/fpa/qffplra_tactic.cpp
Normal file
72
src/tactic/fpa/qffplra_tactic.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qffpalra_tactic.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_FPLRA benchmarks.
|
||||
|
||||
Author:
|
||||
|
||||
Christoph (cwinter) 2018-04-24
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include "tactic/tactical.h"
|
||||
#include "tactic/fpa/qffp_tactic.h"
|
||||
#include "tactic/fpa/qffplra_tactic.h"
|
||||
|
||||
tactic * mk_qffplra_tactic(ast_manager & m, params_ref const & p) {
|
||||
tactic * st = mk_qffp_tactic(m, p);
|
||||
st->updt_params(p);
|
||||
return st;
|
||||
}
|
||||
|
||||
struct is_non_qffplra_predicate {
|
||||
struct found {};
|
||||
ast_manager & m;
|
||||
bv_util bu;
|
||||
fpa_util fu;
|
||||
arith_util au;
|
||||
|
||||
is_non_qffplra_predicate(ast_manager & _m) : m(_m), bu(m), fu(m), au(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) && !au.is_real(s))
|
||||
throw found();
|
||||
family_id fid = n->get_family_id();
|
||||
if (fid == m.get_basic_family_id() ||
|
||||
fid == fu.get_family_id() ||
|
||||
fid == bu.get_family_id() ||
|
||||
fid == au.get_family_id())
|
||||
return;
|
||||
if (is_uninterp_const(n))
|
||||
return;
|
||||
if (au.is_real(s))
|
||||
return;
|
||||
|
||||
throw found();
|
||||
}
|
||||
};
|
||||
|
||||
class is_qffplra_probe : public probe {
|
||||
public:
|
||||
result operator()(goal const & g) override {
|
||||
return !test<is_non_qffplra_predicate>(g);
|
||||
}
|
||||
|
||||
~is_qffplra_probe() override {}
|
||||
};
|
||||
|
||||
probe * mk_is_qffplra_probe() {
|
||||
return alloc(is_qffplra_probe);
|
||||
}
|
38
src/tactic/fpa/qffplra_tactic.h
Normal file
38
src/tactic/fpa/qffplra_tactic.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
/*++
|
||||
Copyright (c) 2012 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
qffplra_tactic.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Tactic for QF_FPLRA benchmarks.
|
||||
|
||||
Author:
|
||||
|
||||
Christoph (cwinter) 2018-04-24
|
||||
|
||||
Notes:
|
||||
|
||||
|
||||
--*/
|
||||
#ifndef QFFPLRA_TACTIC_H_
|
||||
#define QFFPLRA_TACTIC_H_
|
||||
|
||||
#include "util/params.h"
|
||||
class ast_manager;
|
||||
class tactic;
|
||||
|
||||
tactic * mk_qffplra_tactic(ast_manager & m, params_ref const & p = params_ref());
|
||||
/*
|
||||
ADD_TACTIC("qffplra", "(try to) solve goal using the tactic for QF_FPLRA.", "mk_qffplra_tactic(m, p)")
|
||||
*/
|
||||
|
||||
probe * mk_is_qffplra_probe();
|
||||
/*
|
||||
ADD_PROBE("is-qffplra", "true if the goal is in QF_FPLRA.", "mk_is_qffplra_probe()")
|
||||
*/
|
||||
|
||||
#endif
|
|
@ -28,24 +28,26 @@ Notes:
|
|||
#include "tactic/arith/probe_arith.h"
|
||||
#include "tactic/smtlogics/quant_tactics.h"
|
||||
#include "tactic/fpa/qffp_tactic.h"
|
||||
#include "tactic/fpa/qffplra_tactic.h"
|
||||
#include "tactic/smtlogics/qfaufbv_tactic.h"
|
||||
#include "tactic/smtlogics/qfauflia_tactic.h"
|
||||
#include "tactic/smtlogics/qfufnra_tactic.h"
|
||||
|
||||
tactic * mk_default_tactic(ast_manager & m, params_ref const & p) {
|
||||
tactic * st = using_params(and_then(mk_simplify_tactic(m),
|
||||
cond(mk_is_qfbv_probe(), mk_qfbv_tactic(m),
|
||||
cond(mk_is_qfaufbv_probe(), mk_qfaufbv_tactic(m),
|
||||
cond(mk_is_qfbv_probe(), mk_qfbv_tactic(m),
|
||||
cond(mk_is_qfaufbv_probe(), mk_qfaufbv_tactic(m),
|
||||
cond(mk_is_qflia_probe(), mk_qflia_tactic(m),
|
||||
cond(mk_is_qfauflia_probe(), mk_qfauflia_tactic(m),
|
||||
cond(mk_is_qflra_probe(), mk_qflra_tactic(m),
|
||||
cond(mk_is_qfnra_probe(), mk_qfnra_tactic(m),
|
||||
cond(mk_is_qfnia_probe(), mk_qfnia_tactic(m),
|
||||
cond(mk_is_lira_probe(), mk_lira_tactic(m, p),
|
||||
cond(mk_is_nra_probe(), mk_nra_tactic(m),
|
||||
cond(mk_is_lira_probe(), mk_lira_tactic(m, p),
|
||||
cond(mk_is_nra_probe(), mk_nra_tactic(m),
|
||||
cond(mk_is_qffp_probe(), mk_qffp_tactic(m, p),
|
||||
cond(mk_is_qffplra_probe(), mk_qffplra_tactic(m, p),
|
||||
//cond(mk_is_qfufnra_probe(), mk_qfufnra_tactic(m, p),
|
||||
mk_smt_tactic()))))))))))),
|
||||
mk_smt_tactic())))))))))))),
|
||||
p);
|
||||
return st;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue