| author | wenzelm |
| Tue, 09 Dec 2014 19:52:26 +0100 | |
| changeset 59120 | 74fde39274d5 |
| parent 58618 | 782f0b662cae |
| child 59917 | 9830c944670f |
| permissions | -rw-r--r-- |
| 27056 | 1 |
theory Misc |
| 42651 | 2 |
imports Base Main |
| 27056 | 3 |
begin |
4 |
||
| 58618 | 5 |
chapter \<open>Other commands\<close> |
| 27056 | 6 |
|
| 58618 | 7 |
section \<open>Inspecting the context\<close> |
| 27056 | 8 |
|
| 58618 | 9 |
text \<open> |
| 27056 | 10 |
\begin{matharray}{rcl}
|
|
28761
9ec4482c9201
updated/refined types of Isar language elements, removed special LaTeX macros;
wenzelm
parents:
28760
diff
changeset
|
11 |
@{command_def "print_theory"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
|
|
9ec4482c9201
updated/refined types of Isar language elements, removed special LaTeX macros;
wenzelm
parents:
28760
diff
changeset
|
12 |
@{command_def "print_methods"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
|
|
9ec4482c9201
updated/refined types of Isar language elements, removed special LaTeX macros;
wenzelm
parents:
28760
diff
changeset
|
13 |
@{command_def "print_attributes"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
|
|
9ec4482c9201
updated/refined types of Isar language elements, removed special LaTeX macros;
wenzelm
parents:
28760
diff
changeset
|
14 |
@{command_def "print_theorems"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
|
|
9ec4482c9201
updated/refined types of Isar language elements, removed special LaTeX macros;
wenzelm
parents:
28760
diff
changeset
|
15 |
@{command_def "find_theorems"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
|
| 29894 | 16 |
@{command_def "find_consts"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
|
|
28761
9ec4482c9201
updated/refined types of Isar language elements, removed special LaTeX macros;
wenzelm
parents:
28760
diff
changeset
|
17 |
@{command_def "thm_deps"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
|
| 41624 | 18 |
@{command_def "unused_thms"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
|
|
28761
9ec4482c9201
updated/refined types of Isar language elements, removed special LaTeX macros;
wenzelm
parents:
28760
diff
changeset
|
19 |
@{command_def "print_facts"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
|
|
57415
e721124f1b1e
command 'print_term_bindings' supersedes 'print_binds';
wenzelm
parents:
56582
diff
changeset
|
20 |
@{command_def "print_term_bindings"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
|
| 27056 | 21 |
\end{matharray}
|
22 |
||
|
55112
b1a5d603fd12
prefer rail cartouche -- avoid back-slashed quotes;
wenzelm
parents:
55029
diff
changeset
|
23 |
@{rail \<open>
|
|
56158
c2c6d560e7b2
more explicit treatment of verbose mode, which includes concealed entries;
wenzelm
parents:
55112
diff
changeset
|
24 |
(@@{command print_theory} | @@{command print_theorems} | @@{command print_facts}) ('!'?)
|
| 27056 | 25 |
; |
26 |
||
|
55029
61a6bf7d4b02
clarified @{rail} syntax: prefer explicit \<newline> symbol;
wenzelm
parents:
55011
diff
changeset
|
27 |
@@{command find_theorems} ('(' @{syntax nat}? 'with_dups'? ')')? \<newline> (thmcriterion * )
|
| 27056 | 28 |
; |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
41624
diff
changeset
|
29 |
thmcriterion: ('-'?) ('name' ':' @{syntax nameref} | 'intro' | 'elim' | 'dest' |
|
|
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
41624
diff
changeset
|
30 |
'solves' | 'simp' ':' @{syntax term} | @{syntax term})
|
| 27056 | 31 |
; |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
41624
diff
changeset
|
32 |
@@{command find_consts} (constcriterion * )
|
| 29894 | 33 |
; |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
41624
diff
changeset
|
34 |
constcriterion: ('-'?)
|
|
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
41624
diff
changeset
|
35 |
('name' ':' @{syntax nameref} | 'strict' ':' @{syntax type} | @{syntax type})
|
| 27056 | 36 |
; |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
41624
diff
changeset
|
37 |
@@{command thm_deps} @{syntax thmrefs}
|
| 41624 | 38 |
; |
|
42596
6c621a9d612a
modernized rail diagrams using @{rail} antiquotation;
wenzelm
parents:
41624
diff
changeset
|
39 |
@@{command unused_thms} ((@{syntax name} +) '-' (@{syntax name} * ))?
|
|
55112
b1a5d603fd12
prefer rail cartouche -- avoid back-slashed quotes;
wenzelm
parents:
55029
diff
changeset
|
40 |
\<close>} |
| 27056 | 41 |
|
42 |
These commands print certain parts of the theory and proof context. |
|
43 |
Note that there are some further ones available, such as for the set |
|
44 |
of rules declared for simplifications. |
|
45 |
||
|
28760
cbc435f7b16b
unified use of declaration environment with IsarImplementation;
wenzelm
parents:
27598
diff
changeset
|
46 |
\begin{description}
|
| 27056 | 47 |
|
|
28760
cbc435f7b16b
unified use of declaration environment with IsarImplementation;
wenzelm
parents:
27598
diff
changeset
|
48 |
\item @{command "print_theory"} prints the main logical content of
|
| 53499 | 49 |
the background theory; the ``@{text "!"}'' option indicates extra
|
| 27056 | 50 |
verbosity. |
51 |
||
|
28760
cbc435f7b16b
unified use of declaration environment with IsarImplementation;
wenzelm
parents:
27598
diff
changeset
|
52 |
\item @{command "print_methods"} prints all proof methods
|
| 27056 | 53 |
available in the current theory context. |
54 |
||
|
28760
cbc435f7b16b
unified use of declaration environment with IsarImplementation;
wenzelm
parents:
27598
diff
changeset
|
55 |
\item @{command "print_attributes"} prints all attributes
|
| 27056 | 56 |
available in the current theory context. |
57 |
||
| 53499 | 58 |
\item @{command "print_theorems"} prints theorems of the background
|
59 |
theory resulting from the last command; the ``@{text "!"}'' option
|
|
60 |
indicates extra verbosity. |
|
| 27056 | 61 |
|
|
56158
c2c6d560e7b2
more explicit treatment of verbose mode, which includes concealed entries;
wenzelm
parents:
55112
diff
changeset
|
62 |
\item @{command "print_facts"} prints all local facts of the
|
|
c2c6d560e7b2
more explicit treatment of verbose mode, which includes concealed entries;
wenzelm
parents:
55112
diff
changeset
|
63 |
current context, both named and unnamed ones; the ``@{text "!"}''
|
|
c2c6d560e7b2
more explicit treatment of verbose mode, which includes concealed entries;
wenzelm
parents:
55112
diff
changeset
|
64 |
option indicates extra verbosity. |
|
c2c6d560e7b2
more explicit treatment of verbose mode, which includes concealed entries;
wenzelm
parents:
55112
diff
changeset
|
65 |
|
|
57415
e721124f1b1e
command 'print_term_bindings' supersedes 'print_binds';
wenzelm
parents:
56582
diff
changeset
|
66 |
\item @{command "print_term_bindings"} prints all term bindings that
|
|
e721124f1b1e
command 'print_term_bindings' supersedes 'print_binds';
wenzelm
parents:
56582
diff
changeset
|
67 |
are present in the context. |
|
56158
c2c6d560e7b2
more explicit treatment of verbose mode, which includes concealed entries;
wenzelm
parents:
55112
diff
changeset
|
68 |
|
|
28760
cbc435f7b16b
unified use of declaration environment with IsarImplementation;
wenzelm
parents:
27598
diff
changeset
|
69 |
\item @{command "find_theorems"}~@{text criteria} retrieves facts
|
| 27056 | 70 |
from the theory or proof context matching all of given search |
71 |
criteria. The criterion @{text "name: p"} selects all theorems
|
|
72 |
whose fully qualified name matches pattern @{text p}, which may
|
|
73 |
contain ``@{text "*"}'' wildcards. The criteria @{text intro},
|
|
74 |
@{text elim}, and @{text dest} select theorems that match the
|
|
75 |
current goal as introduction, elimination or destruction rules, |
|
| 29896 | 76 |
respectively. The criterion @{text "solves"} returns all rules
|
|
29893
defab1c6a6b5
FindTheorems solves: update documentation (by Timothy Bourke)
kleing
parents:
28779
diff
changeset
|
77 |
that would directly solve the current goal. The criterion |
|
defab1c6a6b5
FindTheorems solves: update documentation (by Timothy Bourke)
kleing
parents:
28779
diff
changeset
|
78 |
@{text "simp: t"} selects all rewrite rules whose left-hand side
|
|
defab1c6a6b5
FindTheorems solves: update documentation (by Timothy Bourke)
kleing
parents:
28779
diff
changeset
|
79 |
matches the given term. The criterion term @{text t} selects all
|
|
defab1c6a6b5
FindTheorems solves: update documentation (by Timothy Bourke)
kleing
parents:
28779
diff
changeset
|
80 |
theorems that contain the pattern @{text t} -- as usual, patterns
|
|
defab1c6a6b5
FindTheorems solves: update documentation (by Timothy Bourke)
kleing
parents:
28779
diff
changeset
|
81 |
may contain occurrences of the dummy ``@{text _}'', schematic
|
|
defab1c6a6b5
FindTheorems solves: update documentation (by Timothy Bourke)
kleing
parents:
28779
diff
changeset
|
82 |
variables, and type constraints. |
| 27056 | 83 |
|
84 |
Criteria can be preceded by ``@{text "-"}'' to select theorems that
|
|
85 |
do \emph{not} match. Note that giving the empty list of criteria
|
|
86 |
yields \emph{all} currently known facts. An optional limit for the
|
|
87 |
number of printed facts may be given; the default is 40. By |
|
88 |
default, duplicates are removed from the search result. Use |
|
89 |
@{text with_dups} to display duplicates.
|
|
| 29894 | 90 |
|
91 |
\item @{command "find_consts"}~@{text criteria} prints all constants
|
|
92 |
whose type meets all of the given criteria. The criterion @{text
|
|
93 |
"strict: ty"} is met by any type that matches the type pattern |
|
94 |
@{text ty}. Patterns may contain both the dummy type ``@{text _}''
|
|
95 |
and sort constraints. The criterion @{text ty} is similar, but it
|
|
96 |
also matches against subtypes. The criterion @{text "name: p"} and
|
|
97 |
the prefix ``@{text "-"}'' function as described for @{command
|
|
98 |
"find_theorems"}. |
|
99 |
||
|
28760
cbc435f7b16b
unified use of declaration environment with IsarImplementation;
wenzelm
parents:
27598
diff
changeset
|
100 |
\item @{command "thm_deps"}~@{text "a\<^sub>1 \<dots> a\<^sub>n"}
|
| 27056 | 101 |
visualizes dependencies of facts, using Isabelle's graph browser |
| 58552 | 102 |
tool (see also @{cite "isabelle-sys"}).
|
| 41624 | 103 |
|
|
53015
a1119cf551e8
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm
parents:
50213
diff
changeset
|
104 |
\item @{command "unused_thms"}~@{text "A\<^sub>1 \<dots> A\<^sub>m - B\<^sub>1 \<dots> B\<^sub>n"}
|
| 55011 | 105 |
displays all theorems that are proved in theories @{text "B\<^sub>1 \<dots> B\<^sub>n"}
|
106 |
or their parents but not in @{text "A\<^sub>1 \<dots> A\<^sub>m"} or their parents and
|
|
107 |
that are never used. |
|
| 41624 | 108 |
If @{text n} is @{text 0}, the end of the range of theories
|
109 |
defaults to the current theory. If no range is specified, |
|
110 |
only the unused theorems in the current theory are displayed. |
|
| 27056 | 111 |
|
|
28760
cbc435f7b16b
unified use of declaration environment with IsarImplementation;
wenzelm
parents:
27598
diff
changeset
|
112 |
\end{description}
|
| 58618 | 113 |
\<close> |
| 27056 | 114 |
|
115 |
end |