mirror of
https://github.com/Z3Prover/z3
synced 2025-07-25 13:47:01 +00:00
other components
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
e9eab22e5c
commit
68269c43a6
250 changed files with 70871 additions and 0 deletions
65
test/th_propagation.cpp
Normal file
65
test/th_propagation.cpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*++
|
||||
Copyright (c) 2006 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
th_propagation.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Test theory propagation.
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo de Moura (leonardo) 2006-11-07.
|
||||
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
#include"core_theory.h"
|
||||
|
||||
class th_propagation_tester {
|
||||
static void tst1() {
|
||||
core_theory t;
|
||||
t.m_params.m_relevancy_lvl = 0;
|
||||
|
||||
enode * n1 = t.mk_const();
|
||||
enode * n2 = t.mk_const();
|
||||
enode * n3 = t.mk_const();
|
||||
|
||||
literal eq1 = t.mk_eq(n1,n2);
|
||||
literal eq2 = t.mk_eq(n2,n3);
|
||||
literal eq3 = t.mk_eq(n1,n3);
|
||||
|
||||
literal l1 = t.mk_lit();
|
||||
literal l2 = t.mk_lit();
|
||||
t.mk_main_clause(l1, l2, ~eq3);
|
||||
t.mk_main_clause(~l2, ~eq3);
|
||||
t.mk_main_clause(~l1, ~eq2);
|
||||
|
||||
t.push_scope();
|
||||
t.assign(eq1, mk_axiom());
|
||||
t.propagate();
|
||||
|
||||
t.push_scope();
|
||||
t.assign(eq2, mk_axiom());
|
||||
t.propagate();
|
||||
SASSERT(t.get_assignment(eq3) == l_true);
|
||||
SASSERT(t.inconsistent());
|
||||
bool r = t.m_sat->resolve_conflict();
|
||||
SASSERT(r);
|
||||
}
|
||||
|
||||
public:
|
||||
static void run_tests() {
|
||||
enable_trace("th_prop");
|
||||
enable_trace("scope");
|
||||
enable_trace("conflict");
|
||||
tst1();
|
||||
}
|
||||
};
|
||||
|
||||
void tst_th_propagation() {
|
||||
th_propagation_tester::run_tests();
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue