mirror of
https://github.com/Z3Prover/z3
synced 2025-05-09 00:35:47 +00:00
Z3 sources
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
3f9edad676
commit
e9eab22e5c
1186 changed files with 381859 additions and 0 deletions
44
lib/spc_eq_resolution.cpp
Normal file
44
lib/spc_eq_resolution.cpp
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*++
|
||||
Copyright (c) 2006 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
spc_eq_resolution.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
<abstract>
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2008-02-14.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"spc_eq_resolution.h"
|
||||
|
||||
namespace spc {
|
||||
|
||||
/**
|
||||
\brief Apply equality resolution rule on the given clause.
|
||||
Store the produced clauses in new_clauses.
|
||||
*/
|
||||
void eq_resolution::operator()(clause * cls, ptr_vector<clause> & new_clauses) {
|
||||
m_subst.reserve_vars(cls->get_num_vars());
|
||||
unsigned num = cls->get_num_literals();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
literal const & l = cls->get_literal(i);
|
||||
expr * atom = l.atom();
|
||||
if (l.sign() && m_manager.is_eq(atom)) {
|
||||
expr * lhs = to_app(atom)->get_arg(0);
|
||||
expr * rhs = to_app(atom)->get_arg(1);
|
||||
m_subst.reset();
|
||||
if (m_unifier(lhs, rhs, m_subst, false) && cls->is_eligible_for_resolution(m_order, l, 0, &m_subst)) {
|
||||
m_stats.m_num_eq_resolution++;
|
||||
new_clauses.push_back(mk_result(cls, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue