|
5 | 5 | * Yutaka Nagashima, Daniel Goc Sebastian |
6 | 6 | * Huawei Technologies Research & Development (UK) Limited. |
7 | 7 | *) |
8 | | -(*** SeLFiE_for_Top_Down ***) |
9 | | -structure SeLFiE_for_Top_Down = |
10 | | -struct |
11 | | - |
12 | | -open Eval_Syntactic_Sugar; |
13 | | - |
14 | | -val fvars_in_prem_should_appear_in_concl = |
15 | | - All ("trm_occ_in_prem", SeLFiE_Util.QOuter_Path, |
16 | | - Imply ( |
17 | | - And ( |
18 | | - Node_Is_Free (Variable "trm_occ_in_prem"), |
19 | | - Is_A_Meta_Premise_Or_Below (Variable "trm_occ_in_prem") |
20 | | - ), |
21 | | - Some ("trm_occ_in_cncl", SeLFiE_Util.QOuter_Path, |
22 | | - Ands [ |
23 | | - Has_Same_Prnt_As (Variable "trm_occ_in_prem", Variable "trm_occ_in_cncl"), |
24 | | - Node_Is_Free (Variable "trm_occ_in_cncl"), |
25 | | - Is_A_Meta_Conclusion_Or_Below (Variable "trm_occ_in_cncl") |
26 | | - ] |
27 | | - ) |
28 | | - ) |
29 | | - ); |
30 | | - |
31 | | -(* Due to the use of simplifier, this might be obsolete.*) |
32 | | -val does_not_have_trivial_equality = |
33 | | - Not ( |
34 | | - Some ("equality", SeLFiE_Util.QOuter_Path, |
35 | | - And ( |
36 | | - Unode_Has_Print (Variable "equality", Print "HOL.eq"), |
37 | | - Some ("lhs", SeLFiE_Util.QOuter_Path, |
38 | | - And ( |
39 | | - Is_Nth_Argument_Of (Variable "lhs", Number 0, Variable "equality"), |
40 | | - Some ("rhs", SeLFiE_Util.QOuter_Path, |
41 | | - And ( |
42 | | - Has_Same_Prnt_As (Variable "lhs", Variable "rhs"), |
43 | | - Is_Nth_Argument_Of (Variable "rhs", Number 1, Variable "equality") |
44 | | - ) |
45 | | - ) |
46 | | - ) |
47 | | - ) |
48 | | - ) |
49 | | - ) |
50 | | - ); |
51 | | - |
52 | | -val has_func_with_three_occs_in_a_row = |
53 | | - Some ("func", SeLFiE_Util.QOuter_Print, |
54 | | - Ands [ |
55 | | - Print_Is_Cnst (Variable "func"), |
56 | | - Not (Is_Subprint_Of (Print "Pure", Variable "func")), |
57 | | - Not (Is_Subprint_Of (Print "HOL", Variable "func")), |
58 | | - Some_Of ("func_occ1", Variable "func", |
59 | | - Ands [ |
60 | | - Some ("arg_of_func_occ1", SeLFiE_Util.QOuter_Path, |
61 | | - Ands [ |
62 | | - Node_Is_App (Variable "arg_of_func_occ1"), |
63 | | - Is_An_Argument_Of (Variable "arg_of_func_occ1", Variable "func_occ1"), |
64 | | - Some_Of ("func_occ2", Variable "func", |
65 | | - Ands [ |
66 | | - Is_Nth_Child_Of (Variable "func_occ2", Number 0, Variable "arg_of_func_occ1"), |
67 | | - |
68 | | - Some ("arg_of_func_occ2", SeLFiE_Util.QOuter_Path, |
69 | | - Ands [ |
70 | | - Node_Is_App (Variable "arg_of_func_occ2"), |
71 | | - Is_An_Argument_Of (Variable "arg_of_func_occ2", Variable "func_occ2"), |
72 | | - Some_Of ("func_occ3", Variable "func", |
73 | | - Ands [ |
74 | | - Is_Nth_Child_Of (Variable "func_occ3", Number 0, Variable "arg_of_func_occ2") |
75 | | - ] |
76 | | - ) |
77 | | - ] |
78 | | - ) |
79 | | - |
80 | | - ] |
81 | | - ) |
82 | | - ] |
83 | | - ) |
84 | | - ] |
85 | | - ) |
86 | | - ] |
87 | | - ); |
88 | | - |
89 | | -fun run_assertion (pst:Proof.state) (assrt:assert) (cnjctr:term) = |
90 | | - let |
91 | | - val outer_path_to_unode_table = Outer_Path_To_Unode.pst_n_trm_to_path_to_unode_table pst cnjctr : Outer_Path_To_Unode.path_to_unode_table; |
92 | | - val gen_path_table = Gen_Path.Outer_Path_To_Unode outer_path_to_unode_table : Gen_Path.gen_path_to_unode_table; |
93 | | - val empty_argument = SeLFiE_Util.Induct_Arguments {ons = [], arbs = [], rules = []} : SeLFiE_Util.induct_arguments; |
94 | | - val outer_domains = Quantifier_Domain.inout_pst_n_trm_n_induct_args_to_domains Quantifier_Domain.Out gen_path_table empty_argument: Quantifier_Domain.domains; |
95 | | - in |
96 | | - eval pst outer_path_to_unode_table outer_domains empty_argument assrt = True |
97 | | - end; |
98 | | - |
99 | | -end; |
100 | | - |
101 | 8 | (*** structure All_Top_Down_Conjecturing ***) |
102 | 9 | structure All_Top_Down_Conjecturing: TOP_DOWN_CONJECTURING = |
103 | 10 | struct |
@@ -158,7 +65,7 @@ fun template_conjectures (ctxt:Proof.context) (trm:term): (string * term) list = |
158 | 65 | result |
159 | 66 | end; |
160 | 67 |
|
161 | | -structure S4TD = SeLFiE_for_Top_Down; |
| 68 | +structure S4TD = SeLFiE_For_Top_Down; |
162 | 69 |
|
163 | 70 | fun run_assertion (ctxt:Proof.context) (trm:term) (assert:Eval_Syntactic_Sugar.assert) = |
164 | 71 | S4TD.run_assertion (Top_Down_Util.mk_pst_to_prove_from_term ctxt trm) assert trm; |
|
0 commit comments