Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] match context and evars

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] match context and evars


Chronological Thread 
  • From: Jonathan Leivent <jonikelee AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] match context and evars
  • Date: Thu, 24 Nov 2016 10:56:01 -0500
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qt0-f174.google.com
  • Ironport-phdr: 9a23:P0OHPBWXwSND0/NUUMhSJwL1yBvV8LGtZVwlr6E/grcLSJyIuqrYYxCOt8tkgFKBZ4jH8fUM07OQ6PG7HzZRqsnR+Fk5M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aFRrwLxd6KfroEYDOkcu3y/qy+5rOaAlUmTaxe71/IRG4oAnLqMUbhYRuJ6QyxxDUvnZGZuNayH9yK1mOhRj8/MCw/JBi8yRUpf0s8tNLXLv5caolU7FWFSwqPG8p6sLlsxnDVhaP6WAHUmoKiBpIAhPK4w/8U5zsryb1rOt92C2dPc3rUbA5XCmp4ql3RBP0jioMKjg0+3zVhMNtlqJWuA+vqQJxw4DUY4+bOvRxcazfctwGSmRMRdpRWi5bD4+gc4cCAegMMOBFpIf9vVsOqh6+CBGoCuPozD9HnGP23a0g3OQnDArI2hIvH9MQsHvKqtX1KLoZXOe3zKnPyzXDbvBW1in56IfWbB8suv6MXbdqfsrQzUkjDR/KjlKVqYH8OT6ey+cDs3CD4uZ+Se6ij3QrpgJxrzS12Msgl4jEipgIxl3G+ih12IQ4KcCiREJlb9OpH4FcuzyUOodqWM8uXW9ltSQ8x7Ybo5C0ZjIKx44ixxPHa/yIbYyI4hX7WeaUOzh4hXZldKumhxau7USs0+P8WtS23VtFtCZFnd7MtncC1xzX9MeLUOdy/kCk2TqX1gDT7P9LIVwsmKbFN5IsxqQ8m5kTvEjZACP6hUT7gLWLekgm9eWk8+Hnba/npp+YOY90kAb+MqE2l8y9BuQ4NAkOX2uF9uS4yrLs41b0QLpPjvIsk6nZtIrWKtgcpq68GwNVyJos6w6jDze619QVhWUILFVceB6ek4fpP0zOL+vjAPekg1WslS9ryOrcMr3gBJXNNHnDn637cbZz8U4PgDY0mNtY/tdfDqwLCPP1QE748tLCXTEjNAnh4eHhAcl934VWfW+OHKKfLOuGs1iO5+EiJ+SBTIAQsTf5bfMi4qi93jcChVYBcPzxjtMsY3eiE6E+Lg==

Hi Jan-Oliver,

This will demonstrate the issue:

exvar Type (fun t => unify t nat; idtac t; let t2 := eval lazy delta [id] in t in idtac t2).

The first idtac will print something like "?X6", while the second will print "nat". What type of reduction is done is not important (obviously, there is no id function to delta reduce here, so this reduction is a no-op). Coq isn't always very good about noticing the instantiation of an evar through the raw evar itself, so this reduction step just prods it into doing so.

-- Jonathan


On 11/24/2016 09:59 AM, Jan-Oliver Kaiser wrote:
Hello,

I am trying to find occurrences of an instantiated existential variable in a bigger term. I have yet to find a way to make this work. I have, however, identified a rather peculiar minimal failing example of interaction between evars and match context:

(* Some notation to hide a the overhead associated with evars *)
Tactic Notation "exvar" constr(type) tactic(cnt) :=
let name := fresh in
evar (name : type);
let var := (eval unfold name in name) in
clear name;
cnt var.

Goal True.
exvar Type (fun t => unify t nat; match nat with context f [nat] => idtac "yay" end).
Fail exvar Type (fun t => unify t nat; match nat with context f [t] => idtac "yay" end).
Abort.

The first call to exvar is just a sanity check to see if the evar machinery works and the context pattern work as intended. The second call is what really baffles me. t is successfully unified with nat - but it cannot be found in the term nat. What is going on here?

Thanks,
Jan-Oliver





Archive powered by MHonArc 2.6.18.

Top of Page