Separate flags for explicit/implicit parameters and inductive/non-inductive variables #255
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Beluga features two kinds of markings for LF declarations, namely
plicity
anddepend
:Beluga/src/core/syncom.ml
Lines 7 to 10 in 608145b
Beluga/src/core/syncom.ml
Lines 33 to 36 in 608145b
The
depend
flags were copied over from Twelf for determining whether splitting on a variable generates induction hypotheses.As the comments suggest, the plicity of such variables was also specified using
No
for variables explicitly introduced by the user (as{g : ctx}
), andMaybe
for variables implicitly introduced either by the user (as(g : ctx)
) or during reconstruction. These constructor names do not effectively convey their meaning.Variables marked as
Inductive
generate induction hypotheses when split on. In Twelf, only variables explicitly specified by the user could be inductive. It is unclear whether this invariant was maintained in Beluga. Issues such as #221 suggest that handling of explicit/implicit parameters in Harpoon is flawed.The functions
Beluga.Total.annotate'
andBeluga.Total.strip
were intended to only toggle the inductivity of a parameter without affecting its plicity. The following comment was left out to highlight this issue:Beluga/src/core/total.ml
Lines 999 to 1012 in 608145b
This PR realizes the suggested change of introducing orthogonal plicity and inductivity flags, found in
Beluga.Plicity.t
andBeluga.Inductivity.t
respectively. The internal, approximate and external syntaxes were updated to use them, which is a breaking change.Inductivity flags are only used in the internal syntax. Introducing the separate
Plicity.t
flag simplifies the elaboration of declarations since the invariant thatInductive
does not occur in the external syntax is now maintained by design.Identifying and rectifying existing misuses of the
plicity
anddepend
flags are out of this PR's scope.