3
0
Fork 0
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:
Leonardo de Moura 2012-10-02 11:35:25 -07:00
parent 3f9edad676
commit e9eab22e5c
1186 changed files with 381859 additions and 0 deletions

49
lib/uses_theory.cpp Normal file
View file

@ -0,0 +1,49 @@
/*++
Copyright (c) 2006 Microsoft Corporation
Module Name:
uses_theory.cpp
Abstract:
<abstract>
Author:
Leonardo de Moura (leonardo) 2008-10-21.
Revision History:
--*/
#include"uses_theory.h"
#include"for_each_expr.h"
bool uses_theory(expr * n, family_id fid) {
expr_mark visited;
return uses_theory(n, fid, visited);
}
namespace uses_theory_ns {
struct found {};
struct proc {
family_id m_fid;
proc(family_id fid):m_fid(fid) {}
void operator()(var * n) {}
void operator()(app * n) { if (n->get_family_id() == m_fid) throw found(); }
void operator()(quantifier * n) {}
};
};
bool uses_theory(expr * n, family_id fid, expr_mark & visited) {
uses_theory_ns::proc p(fid);
try {
for_each_expr(p, visited, n);
}
catch (uses_theory_ns::found) {
return true;
}
return false;
}