I want to find theorems. I have read the section on find_theorems
in the Isabelle/Isar reference manual:
find_theorems criteria
Retrieves facts from the theory or proof context matching all of given search criteria. The criterion
name: p
selects all theorems whose fully qualified name matches pattern p, which may contain "*
" wildcards. The criteriaintro
,elim
, anddest
select theorems that match the current goal as introduction, elimination or destruction rules, respectively. The criterionsolves
returns all rules that would directly solve the current goal. The criterionsimp: t
selects all rewrite rules whose left-hand side matches the given term. The criterion term t selects all theorems that contain the pattern t -- as usual, patterns may contain occurrences of the dummy "_
" , schematic variables, and type constraints.Criteria can be preceded by "
-
" to select theorems that do not match. Note that giving the empty list of criteria yields all currently known facts. An optional limit for the number of printed facts may be given; the default is 40. By default, duplicates are removed from the search result. Usewith_dups
to display duplicates.
As far as I understand, find_theorems
is used in the find window of Isabelle/jEdit. The above does not help me finding relevant theorems for the following situation (Lambda is a theory of the Nominal Isabelle extension. The tarball is here):
theory First
imports Lambda
begin
theorem "Lam [x].(Lam [y].(App (Var x)(Var y))) = Lam [y].(Lam [x].(App (Var y)(Var x)))"
When I try the search expression Lam
Isabelle/jedit says
Inner syntax error: unexpected end of input
Failed to parse term
How can I make it look for all the theorems that contain the constant Lam
?
Since Lam
like the ordinary lambda (%
) is not a term on its own, you should add the remaining parts to get a proper term, which may contain wildcards. In your example, I would perform
find_theorems "Lam [_]. _"
which gives lots of answers.
Typically this happens whenever special syntax was defined for some constant. But there is (almost) always an underlying ("raw") constant. To find out which constant provides the Lam [_]. _
syntax. You can Ctrl-click Lam
(inside a proper term) within Isabelle/jEdit. This will jump to the definition of the underlying constant.
For Lam
there is the additional complication that the binder syntax uses exactly the same string as the underlying constant, namely Lam
, as can be seen at the place of definition:
nominal_datatype lam =
Var "name"
| App "lam" "lam"
| Lam x::"name" l::"lam" binds x in l ("Lam [_]. _" [100, 100] 100)
In such cases you can use the long name of the constant by prefixing it with the theory name, i.e., Lambda.Lam
.
Note: The same works for binders like ALL x. P x
(with underlying constant All
), but not for the built-in %x. x
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With