feat(goal): Branch unification #217
No reviewers
Labels
No Label
category
bug
category
chore
category
doc
category
feature
category
optimization
category
organization
part/Delation
part/Elab
part/Environment
part/FFI
part/Frontend
part/Goal
part/REPL
part/Serial
priority
high
priority
irrelevant
priority
low
priority
medium
priority
pending-measurement
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Blocks
#132 Branch unification
aniva/Pantograph
Reference: aniva/Pantograph#217
Loading…
Reference in New Issue
No description provided.
Delete Branch "goal/branch-unification"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This allows merger of goal states.
We have to refactor the existing handling mechanism for
conv
andcalc
since the old interface is not conducive to any branch unification.conv
andcalc
handlers into fragmented tactic objects, which could be compatible with syntax-level features.We need to think about the interaction between tactic fragments and resumption.
Before the existence of tactic fragments, we assume every goal can become dormant and can participate in the type unification process. This allows goals to be solved in-passing.
Examples
e.g. If there are states
G = { ?0, ?1f }
(where?0f
has a fragment) andG' = { ?2, ?3 }
, it should be possible to resumeG'
's goals intoG
(no fragments). This would not affect things very much.However, if we have
G = { ?0, ?1f }
andG' = { ?2, ?3f }
, such resumption demands a state with multiple tactic fragments. We can permit this possibility in principle.Syntax-Level Fragment
The real trouble begins when we have syntax-level fragments. Suppose we implement this so the user can execute on
?1
the fragment (assumingx
is an inductive with multiple cases)it would feed back that there are missing cases for
x
. However, we cannot actually assign anything to?1
yet, since the above expression cannot be fully elaborated. It would be stored as a syntax level stub.At this point, nothing troublesome is happening yet. However, if the goal is allowed to become dormant, and during the solution of
?2
, it modifies?1
in passing, there is no immediate feedback into?1
upon resumption. This lack of immediate feedback violates the design principle of Pantograph.This is less of an issue for
conv
andcalc
since they operate on the expression level.Possible Solutions
Before this PR, there could be at most one tactic fragment in a goal state, and syntax-level tactics do not exist yet.
.syntheticOpaque
metavariables can be assigned withwithAssignableSyntheticOpaque
. Hence one solution is that upon the completion of tactic fragments, its assignment has to unify against the existing assignment if one exists. When such unification is impossible, the tactic fragment is not allowed to conclude.There is one more problem about conversion tactic mode. In such a mode, a goal state could have a mixture of conversion and non-conversion goals. When we decree an exit from conversion tactic mode, all sibling conversion goals must be concluded via
rfl
. This is an operation in between goal level and state level.