Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Need help making a modular reflection reifier

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Need help making a modular reflection reifier


Chronological Thread 
  • From: "jonikelee AT gmail.com" <jonikelee AT gmail.com>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: [Coq-Club] Need help making a modular reflection reifier
  • Date: Thu, 22 Oct 2020 15:46:19 -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-qv1-f45.google.com
  • Ironport-phdr: 9a23:3OK2sBYllvDbPtu4YmO4bDj/LSx+4OfEezUN459isYplN5qZr8WzbnLW6fgltlLVR4KTs6sC17OJ9f+wEjFQqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba5wIRmsrwjctcYajIthJ60s1hbHv3xEdvhMy2h1P1yThRH85smx/J5n7Stdvu8q+tBDX6vnYak2VKRUAzs6PW874s3rrgTDQhCU5nQASGUWkwFHDBbD4RrnQ5r+qCr6tu562CmHIc37SK0/VDq+46t3ThLjlSEKPCM7/m7KkMx9lKxVrhK/qRJiwIDaZ46aO+ZxcK7GYdMXR3BMUtpLWiBdHI+xaZYEAeobPeZfqonwv1UCrRm5BQmqBePvySFHhnvo0qIkyOkhHgTG0xYhH9IKqnjbsNL1NKIcXeuoy6TIzzLDb/VX2Tf+9ofIdg4uru+XULJ/dMre00gvFwffglqMrozlOiqY2+IQuGeU8+RuT/igi3I7qw5vuDivwN8hhpTJi4wVxV3J6zl1zZo1KNC6RkN2fdGpHIdQui2HOYV6XscvTmBotis51LAKpYK2cTUUxJkl2xPSdvKKfoiG7B/lSe2fIi94iWp7dL6jgxu+60utx+3mWsWqzVpHqjBJn9bMu3wVyRDe69SLRuZ480u83TuAywXe5+5FLEwoiabWLoMtzqAwm5cWv0nOHTL5lUbzgaKSeEUk9Oao5uHpYrr4uJOQKYp5hh/6P6kvmsGyB/kzPBIUUGiB4+u80aXu/U3nT7VOif07iqzZv4rbJcQfv6K5GhFV3ps65xaxADqr0M4UnXYALFJCdxKHi5bmN0vSL/D/CPezm1WskDF1yPDaJrDtHInBI3zZnLrifbtx8VBQxBc3wNxF6J9ZCqkNIPfpVU/wsNzYAAU5Mwuxw+v/CtV90YUeWWOMAqCHNKPdr0GH6/kgI+mJfoAVuTL9J+I56P7piH81gUUdcrWx3ZsLdHC4GexrLFmeYXr1m9sODWMKvhclQ+Hxk12DUTtTZ26oUK4m5zE7DpimDYbZSYy3jryBxnTzIpoDbWdfT1uIDH2gI46DQrIHbD+YCs5niD0NE7a7HdwPzxar4UX4zLxmLefQ9yAwupfq1dwz7OrW31lm9ztyDseQ12yAZ25xl2IMATQx2fYs8gRG1l6f3P0g0LRjHttJ6qYRC1toBdvn1+V/TuvKdEfZZN7QEQSpR9ynBXc6Sddjm4ZTMXY4IM2ri1X45wTvA7IRkObWVpk986aZxmaoYsghljDJ064ui1RgScxKZzX/1/xPsjPLDouMqH230qOjdKASxinIrT7Rwm+HvUUeWwl1A/zI

I'm trying to make a particular reflection procedure I have into an
abstract module, and have hit a problem with its reifier. The
problem is that the reifier, being a tactic, doesn't recognize that a
abstract (module parameter) operation is equivalent to an instatiation
of that operation. The reifier is of course a tactic defined using a
match on the abstract operation, and since the instantiation is not
syntactically the same, it can't reify terms that use the instantiation
operation instead of the abstract one.

I mean something like:

Module Type XT.
...
Parameter op : A -> A -> Prop.
...
End XT.
Module R(Import X: XT).
....
Ltac reifier := ...
match ...
| op ?X ?y => ...
End R.
Module X <: XT.
...
Definition op := anop.
...
End X.
Module Import MyR := R X.
...
(* attempt to call reifier on some code containing: *)
anop a b

The reifier tactic will not see that "anop" is convertible with "op",
and so will not reify "anop a b". It will reify "op a b", but clients
of module R will be using "anop" instead of "op".

Is there a way around this? I am contemplating defining "op" to be
overloaded using canonical structures. But is there any way to make it
work with a purely module-style abstraction? I guess I'm looking for a
way to make "op" be syntactically the same as "anop", as if defined by
Notation instead of Definition.

Perhaps another way is to force the reifier to notice convertibility by
doing something like this:

Ltac reifier := ...
match ...
| ?OP ?X ?Y => unify OP op; ...

But that seems like it could slow down the reifier dramatically.




Archive powered by MHonArc 2.6.19+.

Top of Page