-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathmacro_substitution.h
57 lines (40 loc) · 1.68 KB
/
macro_substitution.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*++
Copyright (c) 2012 Microsoft Corporation
Module Name:
macro_substitution.h
Abstract:
Mapping from func_decl to quantifiers of the form
Forall X. f(X) = T[X]
Forall X. f(X) iff C[X]
Author:
Leonardo (leonardo) 2012-02-17
Notes:
--*/
#pragma once
#include "ast/ast.h"
class macro_substitution {
ast_manager & m_manager;
obj_map<func_decl, quantifier *> m_decl2macro;
scoped_ptr<obj_map<func_decl, proof *> > m_decl2macro_pr;
scoped_ptr<obj_map<func_decl, expr_dependency *> > m_decl2macro_dep;
unsigned m_cores_enabled:1;
unsigned m_proofs_enabled:1;
void init();
public:
macro_substitution(ast_manager & m);
macro_substitution(ast_manager & m, bool cores_enabled);
macro_substitution(ast_manager & m, bool cores_enabled, bool proofs_enabled);
~macro_substitution();
ast_manager & m() const { return m_manager; }
bool proofs_enabled() const { return m_proofs_enabled; }
bool unsat_core_enabled() const { return m_cores_enabled; }
bool empty() const { return m_decl2macro.empty(); }
void insert(func_decl * f, quantifier * m, proof * pr, expr_dependency * dep = nullptr);
void erase(func_decl * f);
bool contains(func_decl * f) { return m_decl2macro.contains(f); }
bool find(func_decl * f, quantifier * & q, proof * & pr);
bool find(func_decl * f, quantifier * & q, proof * & pr, expr_dependency * & dep);
void get_head_def(quantifier * q, func_decl * f, app * & head, expr * & def);
void reset();
void cleanup();
};