mirror of
https://github.com/Z3Prover/z3
synced 2025-07-27 14:37:55 +00:00
extract karr invariants as a Datalog relation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
cd48a5164e
commit
4138e17b3f
15 changed files with 1082 additions and 574 deletions
|
@ -1028,21 +1028,23 @@ namespace datalog {
|
|||
func_decl * head_pred = *preds.begin();
|
||||
const rule_vector & rules = m_rule_set.get_predicate_rules(head_pred);
|
||||
|
||||
|
||||
|
||||
reg_idx output_delta;
|
||||
if(!output_deltas.find(head_pred, output_delta)) {
|
||||
if (!output_deltas.find(head_pred, output_delta)) {
|
||||
output_delta = execution_context::void_register;
|
||||
}
|
||||
|
||||
rule_vector::const_iterator it = rules.begin();
|
||||
rule_vector::const_iterator end = rules.end();
|
||||
for(; it!=end; ++it) {
|
||||
for (; it != end; ++it) {
|
||||
rule * r = *it;
|
||||
SASSERT(r->get_head()->get_decl()==head_pred);
|
||||
|
||||
compile_rule_evaluation(r, input_deltas, output_delta, false, acc);
|
||||
}
|
||||
|
||||
if(add_saturation_marks) {
|
||||
if (add_saturation_marks) {
|
||||
//now the predicate is saturated, so we may mark it as such
|
||||
acc.push_back(instruction::mk_mark_saturated(m_context.get_manager(), head_pred));
|
||||
}
|
||||
|
@ -1068,7 +1070,7 @@ namespace datalog {
|
|||
for(; sit!=send; ++sit) {
|
||||
func_decl_set & strat_preds = **sit;
|
||||
|
||||
if(all_saturated(strat_preds)) {
|
||||
if (all_saturated(strat_preds)) {
|
||||
//all predicates in stratum are saturated, so no need to compile rules for them
|
||||
continue;
|
||||
}
|
||||
|
@ -1084,7 +1086,7 @@ namespace datalog {
|
|||
tout << "\n";
|
||||
);
|
||||
|
||||
if(is_nonrecursive_stratum(strat_preds)) {
|
||||
if (is_nonrecursive_stratum(strat_preds)) {
|
||||
//this stratum contains just a single non-recursive rule
|
||||
compile_nonrecursive_stratum(strat_preds, input_deltas, output_deltas, add_saturation_marks, acc);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue