Replies: 4 comments 4 replies
-
Additional comments:
|
Beta Was this translation helpful? Give feedback.
-
Regarding the We also need to somehow represent variable renaming and general substitution. This is tricky. Currently, in the locally nameless representation we ended up having typeclass instances for each syntactic construct, basically because we wanted to avoid expanding the notations when applying substitution. We probably want the same property in the named representation, and therefore we will need some objects representing the notations and their properties anyway. So why not making these properties part of the definition of derived construct? Also, in the locally nameless representation we do not have one typeclass representing a construct properties, but a bunch of them - one for ebinder, one for sbinder, one for binary connective, one for nullary, etc. And if some derived construct falls outside those categories, we have to create a new typeclass for it. I would prefer not to duplicate this non-elegance into the named setting. |
Beta Was this translation helpful? Give feedback.
-
Just an idea: maybe we could refine the |
Beta Was this translation helpful? Give feedback.
-
We created an alternative representation for named patterns, in some sense similar to AML-Formalization/matching-logic/src/Experimental/NamedSyntax.v Lines 121 to 123 in 7707101 The coercion AML-Formalization/matching-logic/src/Experimental/NamedSyntax.v Lines 127 to 139 in 7707101 For these, we use the record constructor In case of the existential quantification, the body of the pattern (potentially) includes a new dangling index, for which the name is appended to the front of the list of names. Another key point of this formalism is blocking Coq's computation so that the named patterns are not automatically simplified to locally nameless patterns every case The derived notations should not be expressed with AML-Formalization/matching-logic/src/Experimental/NamedSyntax.v Lines 145 to 148 in 7707101 Based on these definitions, the usual notations can be introduced and used for the named syntax: AML-Formalization/matching-logic/src/Experimental/NamedSyntax.v Lines 170 to 178 in 7707101 Finally, the best feature of this approach is that the locally nameless lemmas and well-formedness can automatically be used in the named syntax (for this reason, the proof mode also works without any modification). There are a number of examples in NamedSyntax.v. There is one disadvantage: in case of substitutions the locally nameless notations are used. Adding well-formedness to this approachWe can also build the closedness into this representation by saying that there are at least as many names in the list as many dangling indices: AML-Formalization/matching-logic/src/Experimental/NamedSyntax.v Lines 334 to 337 in 7707101 This addition makes the definitions more robust, but obtaining locally nameless proofs from named ones is more challenging in this case. |
Beta Was this translation helpful? Give feedback.
-
What are the alternative approaches to having names in proof mode, and in imported Kore definitions?
ProofModePattern
- this implements something resembling a weak HOAS.If we introduce a new syntax for named patterns - are all translations of patterns into locally nameless well-formed?
Beta Was this translation helpful? Give feedback.
All reactions