-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTotal_Recall.thy
47 lines (39 loc) · 1.67 KB
/
Total_Recall.thy
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
(******************************************************************************)
(* Project: The Isabelle/UTP Proof System *)
(* File: Total_Recall.thy *)
(* Authors: Simon Foster & Frank Zeyda (University of York, UK) *)
(* Emails: simon.foster@york.ac.uk frank.zeyda@york.ac.uk *)
(******************************************************************************)
section \<open> Recall Undeclarations \<close>
theory Total_Recall
imports Main
keywords
"purge_syntax" :: thy_decl and
"purge_notation" :: thy_decl and
"recall_syntax" :: thy_decl
begin
subsection \<open> ML File Import \<close>
ML_file "Total_Recall.ML"
subsection \<open> Outer Commands \<close>
ML \<open>
val _ =
Outer_Syntax.command @{command_keyword purge_syntax}
"purge raw syntax clauses"
((Parse.syntax_mode -- Scan.repeat1 Parse.const_decl) >>
(Toplevel.theory o (fn (mode, args) =>
(TotalRecall.record_no_syntax mode args) o
(Sign.syntax_cmd false mode args))));
val _ =
Outer_Syntax.local_theory @{command_keyword purge_notation}
"purge concrete syntax for constants / fixed variables"
((Parse.syntax_mode -- Parse.and_list1 (Parse.const -- Parse.mixfix)) >>
(fn (mode, args) =>
(Local_Theory.background_theory
(TotalRecall.record_no_notation mode args)) o
(Local_Theory.notation_cmd false mode args)));
val _ =
Outer_Syntax.command @{command_keyword recall_syntax}
"recall undecarations of all purged items"
(Scan.succeed (Toplevel.theory TotalRecall.execute_all))
\<close>
end