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
57
58
59
60
61
62
63
64
65
66
67
68
/*++
Copyright (c) 2012 Microsoft Corporation
Module Name:
macro_finder_tactic.h
Abstract:
Macro finder
Author:
Christoph (cwinter) 2012-10-26
Tactic Documentation
## Tactic macro-finder
### Short Description
Identifies and applies macros.
### Long Description
It finds implicit macro definitions in quantifiers.
A main instance of a macro an equality that defines a function `f` using some term `t` that does not contain `f`.
Other instances of macros are also recognized by the macro finder.
* `(forall (x) (= (f x) t))`
* `not (= (p x) t)` is recognized as `(p x) = (not t)`
* `(iff (= (f x) t) cond)` rewrites to `(f x) = (if cond t else (k x))`
* add clause `(not (= (k x) t))`
* `(= (+ (f x) s) t)` becomes `(= (f x) (- t s))`
* `(= (+ (* -1 (f x)) x) t)` becomes `(= (f x) (- (- t s)))`
### Example
```z3
(declare-fun f (Int) Int)
(declare-fun p (Int) Bool)
(assert (forall ((x Int)) (= (+ (f x) x) 3)))
(assert (p (f 8)))
(apply macro-finder)
```
### Notes
* Supports proofs, unsat cores, but not goals with recursive function definitions.
--*/
class ast_manager;
class tactic;
tactic * ;
/*
ADD_TACTIC("macro-finder", "Identifies and applies macros.", "mk_macro_finder_tactic(m, p)")
*/