# Re: [isabelle] Higher-order matching against schematic variables

```
```
```
Perhaps the higher-order matcher somehow fails, since 1. and 3. should
be returned by it. 2. is essentially 4., but with the schematic type
variables instantiated. Now, is 4. a valid matcher even when ?'a and ?'b
can be clearly instantiated (to become 2.)? If it is valid, isn't it
redundant to have a separate matcher with the type variables
uninstantiated?

```
```
```
I can confirm that the first lemma's matcher 4. and the second lemma's only matcher are results of the FO matcher. So, I guess the above question becomes: how come the FO matcher doesn't instantiate the type variables? Of course, this is a different question to why the HO matcher doesn't return matchers to the second lemma.
```
Michael

```
```Thanks
Michael

```
```Larry Paulson

On 18 Nov 2010, at 13:37, Michael Chan wrote:

```
```Hi all,

I have a question with higher-order matching against schematic
variables. I can't figure out why the pattern trm1 can't be matched
against lem if lem was "A x y --> x y = 0". However, if the RHS
contains constants instead, e.g., "A x y --> g a = 0", a matcher is
found. Since x and y have the same types of g and a respectively, how
come there isn't a matcher in the former case? A difference is that x
and y are schematic variables, but why can't schematic variables be
matched against?

Here's the code:

locale A =
fixes f :: "nat => nat"
and a :: nat
assumes ax: "f a = 0"

consts
g :: "nat => nat"
a :: nat

lemma lem: "A x y --> x y = 0"
sorry

ML {*

val trm1 = term_of @{cpat "?P --> (?f::((?'a=>?'b)=>?'c)) ?stuff = ?v"};
val trm2 = Thm.prop_of @{thm lem};

val mtch_seq = let
val init = Envir.empty 0
val ctxt = @{context}
val (Const ("Trueprop",_) \$ trm2) = Thm.prop_of (ProofContext.get_thm
ctxt "lem")
in
Unify.matchers @{theory} [(trm1,trm2)]
end;

val seq as SOME (mtch,_) = nthseq 0 mtch_seq;
pretty_env @{context} (Envir.term_env mtch);
*}

Thanks
Michael

--
Postal Address: School of Informatics, University of Edinburgh,
Room 2.05, Informatics Forum, 10 Crichton Street,
Edinburgh EH8 9AB, UK.
Telephone Number: +44-131-651-3077,
Fax Number: +44-131-650-6899,
Email: M.Chan at ed.ac.uk
Web Page: http://homepages.inf.ed.ac.uk/mchan/

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

```
```

```
```

```
```

--
Postal Address: School of Informatics, University of Edinburgh,
Room 2.05, Informatics Forum, 10 Crichton Street,
Edinburgh EH8 9AB, UK.
Telephone Number: +44-131-651-3077,
Fax Number: +44-131-650-6899,
Email: M.Chan at ed.ac.uk
Web Page: http://homepages.inf.ed.ac.uk/mchan/

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

```

This archive was generated by a fusion of Pipermail (Mailman edition) and MHonArc.