Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] module types and Ltac

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] module types and Ltac


Chronological Thread 
  • From: Jason Gross <jasongross9 AT gmail.com>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] module types and Ltac
  • Date: Wed, 2 Dec 2020 22:43:00 -0500
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jasongross9 AT gmail.com; spf=Pass smtp.mailfrom=jasongross9 AT gmail.com; spf=None smtp.helo=postmaster AT mail-il1-f182.google.com
  • Ironport-phdr: 9a23:qymidBwKOL7rq/nXCy+O+j09IxM/srCxBDY+r6Qd2+sUIJqq85mqBkHD//Il1AaPAdyErasa1qGN6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglVhjexe65+IRS2oAneuMQanZZpJ7osxBfOvnZGYfldy3lyJVKUkRb858Ow84Bm/i9Npf8v9NNOXLvjcaggQrNWEDopM2Yu5M32rhbDVheA5mEdUmoNjBVFBRXO4QzgUZfwtiv6sfd92DWfMMbrQ704RSiu4qF2QxLulSwJNSM28HvPh8N/gqJUohKvqRJ8zYDJfo+aKOFzcbnBcd4AX2dNQtpdWi5HD4ihb4UPFe0BPeNAoof5vVQOthy+BQ+xD+3u0D9IgWT23bYn2OkmEwHJxhcgH9UIsHTbttX1M7wSUfuxwaTTwjXDaulZ2Tb56ITSbh8hpvSMUKt2fMHMxkYhCxnLgU+MqYz5ITyVzOINvnCZ4udiSe+iimEqpgNwrzWz2sogl4nEi4YRx13H6yh3z4Q4K9OlRUN4ZdOoDpteuj+aOYZ2X88vTXxktScmxrAJv5OwYSsEyIw/yhLBd/CKd5KE7xHjWeqLPDt1hXNodKiiixux70StzPD3WNOu31ZQtCVFl8HBtnAT2BzX7ciKUv598V2g2TaLzgzT6+VELV0tmarVNpIswaA8moAcsUTEGS/2l0H2g7GMeko4/eio7vzrYrTgppCCK495kh/yPrgql8ClAuk1MhICU3Wa9Om9zrHv4E70TKtSgv0ziKbZsZTaJcoBpq6+Bg9YyoQj5AykDzeh1tQYkmMHLFVeeBKci4XkIF7OIPXiAve+h1Sgiitkx/fDPrH5GJXCMmDDkKv9fbZ680NT1A0zzclG651IDrEBPen8V1TqtN3YCx85Kxa7z/zmCNV7zIMeWHiADrWXMKPI4he04bckJPDJb4sIsn6pIP88ovXqkHURmFkHfKDv04FBO16iGfEzAUyCZnykrc0GCnxC6gg3V+vsh0eFSiUCT3m3VqM4oDo8DdT1Xs/4WomxjenZj2+AFZpMazUeUwHeITLTb4yBHsw0RmeXK85lnCYDUOH4GYAk3BCq8gT9zug+d7eGymgjrZvmkeNNyajTmBU1r2ImCs2c1ySMSzgxkDpYHXk526dwpUE7wVCGg/Ah365oUOdL7vYMaT8UcIbGxrUjWd/3UwPFONyOTQT+Tw==

The anomaly is definitely not intended, please report it as a bug on the issue tracker.  I suspect the other behavior is somewhere between intended and accidental.

On Wed, Dec 2, 2020, 22:33 jonikelee AT gmail.com <jonikelee AT gmail.com> wrote:
Did anyone know that it works to define Ltac in a Module Type, such
that instantiations of that Module Type with an instantiated Ltac def
(mostly) works?:

Module Type Foo.
  Ltac tac := idtac "you didn't instantiate Foo.tac!".
End Foo.

Module Bar(Export F:Foo).
  Ltac dobar := tac.
  Goal True.
    dobar. (*Prints "you didn't instantiate Foo.tac!"*)
  Abort.
End Bar.

Module Baz <: Foo.
  Ltac tac := idtac "Baz.tac called!".
End Baz.

Module Beep <: Foo.
  Ltac tac := idtac "Beep.tac called!".
End Beep.

Module Burp <: Foo.
  (*No tac defined here*)
End Burp. (*Not an error, unlike with missing Parameters*)

Module Test.
  Module BarBaz := Bar Baz.
  Module BarBeep := Bar Beep.
  Module BarBurp := Bar Burp.

  Goal True.
    BarBaz.dobar. (*Prints "Baz.tac called!"*)
    BarBeep.dobar. (*Prints "Beep.tac called!"*)
    Fail BarBurp.dobar. (*Oops! - an Anomaly "Uncaught exception Not_Found."*)
  Abort.
End Test.

This is in 8.12.  I haven't tried Ltac2 yet - hopefully, the
instantiations are required to type match the abstration.  Also, I
think it would be better if End Burp produced an error due to the
missing tac instantiation, instead of deferring the error (as an
Anomaly, no less) until runtime.  That is, assuming this is all
intended behavior, which I hope it is...  Is it?





Archive powered by MHonArc 2.6.19+.

Top of Page