Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Difference between uconstr and open_constr

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Difference between uconstr and open_constr


Chronological Thread 
  • From: Jonathan Leivent <jonikelee AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Difference between uconstr and open_constr
  • Date: Tue, 26 Jul 2016 18:52:30 -0400
  • 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-qk0-f172.google.com
  • Ironport-phdr: 9a23:Gk096xw+0FbjgXbXCy+O+j09IxM/srCxBDY+r6Qd0ekVIJqq85mqBkHD//Il1AaPBtSDrawYwLOP+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2WVTerzWI4CIIHV2nbEwud7yzRNKZ1p3//tvx0qWbWx9Piju5bOE6BzSNhiKViPMrh5B/IL060BrDrygAUe1XwWR1OQDbxE6ktY/jtKJkpi9Xorcq89NKeaT8ZaUxC7JCXxo8NGVgxsrtvAXDRA3HwnYdTGgQjlIcAQ/D7RL3Wpr8miT/v+t5niKdOJulHvgPRT2+4vIzG1fTgyAdOmth/Q==



On 07/26/2016 06:31 PM, Jonathan Leivent wrote:


On 07/26/2016 06:23 PM, Robbert Krebbers wrote:
Dear Coq club,

Could someone explain me the difference between the tactic argument types uconstr and open_constr?

Thanks,

Robbert

The differences are (I may be forgetting some):

1. uconstrs are not type-checked until converted to something else (constr, open_constr) or until type_term is called on them. Hence it is possible to construct uconstrs that can't possibly type check:

Goal True.
let X := uconstr:(I I I) in idtac X.

But, one can save time by not type-checking while constructing complex uconstrs.

2. the holes in uconstrs do not become subgoals until the above type checking occurs, while the holes in open_constrs become subgoals immediately (as the type checking on open_constrs occurs immediately).

Oops - my mistake. It looks like the holes in uconstrs don't become subgoals at all. Instead, they are either required to be filled or inferrable when the uconstr is finally type checked (as by type_term) - or, if the uconstr is passed as an open_constr (to a Tactic Notation), or to something that acts like an open_constr (like the arg of the refine tactic), then the open_constr's rules take over, and subgoals are created for holes. However, each time the same uconstr is passed as an open_constr, any holes will create new goals, not drag along the same goals (as would happen in the case of an open_constr passed as an open_constr).

I guess the way to conceptualize this is that a uconstr is an unchecked template for an open_constr.

-- Jonathan


3. there is a "uconstr:(..)" form for Ltac, but no corresponding one for open_constr (although one can somewhat get around this via a Tactic Notation).

-- Jonathan





Archive powered by MHonArc 2.6.18.

Top of Page