Skip to content

Interaction boundaries - #4164

Merged
Saizan merged 12 commits into
agda:masterfrom
Saizan:interaction-boundaries
Nov 20, 2019
Merged

Saizan merged 12 commits into
agda:masterfrom
Saizan:interaction-boundaries

Conversation

@Saizan

@Saizan Saizan commented Oct 31, 2019

Copy link
Copy Markdown
Collaborator

Printing the constraints together with a goal is quite helpful, but they might be more normalized then needed, as the come from the conversion checker, and they are presented in whatever context they happen to be.

For goals appearing directly on the RHS of a definition we can collect the boundaries imposed by path applications directly in the info for the interaction point, and print them with less noise whenever possible.

e.g. we could consider the following goal, taken from https://github.com/agda/cubical/blob/master/Cubical/HITs/Torus/Base.agda

c2t-t2c : ∀ (t : Torus) → c2t (t2c t) ≡ t
c2t-t2c point        i = point
c2t-t2c (line1 _)    = refl
c2t-t2c (line2 _)    = refl
c2t-t2c (square j k) i = { }0

would give this printout for the goal and context:

Goal: Torus
———— Boundary ——————————————————————————————————————————————
j = i0 ⊢ line2 k
j = i1 ⊢ line2 k
k = i0 ⊢ line1 j
k = i1 ⊢ line1 j
i = i0 ⊢ square j k
i = i1 ⊢ square j k
————————————————————————————————————————————————————————————
i : I
k : I
j : I

(Plus a Constraints section, which is redundant in this case).

This is especially useful when the boundaries involve more complicated expression we do not necessarily want to see the WHNF of.

Also note how the variables i k j match their declaration in the context, rather than having some arbitrary aliases or freshly generated names.

In principle the boundary information could be available at the time of meta creation after @jespercockx proposed refactoring of LHS and Coverage, simplifying the implementation.
However I think the current workaround is lightweight enough to be worthwhile.

Also moving constraints into the right context is generally useful for readability.

Pings:

@mortberg , who has been requesting something like this.

Generally improving the issues raised in #3605.

@Saizan Saizan added type: enhancement Issues and pull requests about possible improvements ux: error reporting Issues to do with how Agda reports errors cubical Cubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transp labels Oct 31, 2019
@Saizan
Saizan requested a review from andreasabel October 31, 2019 12:50
@Saizan Saizan self-assigned this Oct 31, 2019
@mortberg

mortberg commented Nov 1, 2019

Copy link
Copy Markdown
Contributor

This should make programming with HITs a lot more pleasant! it would be great if the boundary information could also be printed when for example constructing an hcomp, but for now this seems like a great improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cubical Cubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transp type: enhancement Issues and pull requests about possible improvements ux: error reporting Issues to do with how Agda reports errors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants