mirror of
https://github.com/Z3Prover/z3
synced 2025-06-19 12:23:38 +00:00
Added tactic for QF_FPLRA
This commit is contained in:
parent
dab8e49e22
commit
a1d870f19f
4 changed files with 123 additions and 10 deletions
|
@ -85,7 +85,8 @@ bool smt_logics::logic_has_arith(symbol const & s) {
|
||||||
s == "QF_S" ||
|
s == "QF_S" ||
|
||||||
s == "ALL" ||
|
s == "ALL" ||
|
||||||
s == "QF_FD" ||
|
s == "QF_FD" ||
|
||||||
s == "HORN";
|
s == "HORN" ||
|
||||||
|
s == "QF_FPLRA";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool smt_logics::logic_has_bv(symbol const & s) {
|
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) {
|
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) {
|
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,6 +28,7 @@ Notes:
|
||||||
#include "tactic/arith/probe_arith.h"
|
#include "tactic/arith/probe_arith.h"
|
||||||
#include "tactic/smtlogics/quant_tactics.h"
|
#include "tactic/smtlogics/quant_tactics.h"
|
||||||
#include "tactic/fpa/qffp_tactic.h"
|
#include "tactic/fpa/qffp_tactic.h"
|
||||||
|
#include "tactic/fpa/qffplra_tactic.h"
|
||||||
#include "tactic/smtlogics/qfaufbv_tactic.h"
|
#include "tactic/smtlogics/qfaufbv_tactic.h"
|
||||||
#include "tactic/smtlogics/qfauflia_tactic.h"
|
#include "tactic/smtlogics/qfauflia_tactic.h"
|
||||||
#include "tactic/smtlogics/qfufnra_tactic.h"
|
#include "tactic/smtlogics/qfufnra_tactic.h"
|
||||||
|
@ -44,8 +45,9 @@ tactic * mk_default_tactic(ast_manager & m, params_ref const & p) {
|
||||||
cond(mk_is_lira_probe(), mk_lira_tactic(m, p),
|
cond(mk_is_lira_probe(), mk_lira_tactic(m, p),
|
||||||
cond(mk_is_nra_probe(), mk_nra_tactic(m),
|
cond(mk_is_nra_probe(), mk_nra_tactic(m),
|
||||||
cond(mk_is_qffp_probe(), mk_qffp_tactic(m, p),
|
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),
|
//cond(mk_is_qfufnra_probe(), mk_qfufnra_tactic(m, p),
|
||||||
mk_smt_tactic()))))))))))),
|
mk_smt_tactic())))))))))))),
|
||||||
p);
|
p);
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue