Repository navigation
Closed
Description
The following minimal example does not cause a problem:
{-# OPTIONS --cubical #-}
open import Agda.Builtin.Cubical.Path
open import Agda.Primitive.Cubical
record _×_ (A B : Set) : Set where
constructor _,_
field
fst : A
snd : B
open _×_
eta : ∀ {A B} (p q r : A × B) → p ≡ p
eta p q@(q1 , q2) r i = {!!}so I will have to refer to my own code.
There are some holes at
- https://github.com/anuyts/ctx-alg/blob/15259093b0802315d7dc1d6b061540305680e1d7/src/Mat/Term.agda#L609
- https://github.com/anuyts/ctx-alg/blob/15259093b0802315d7dc1d6b061540305680e1d7/src/Mat/Term.agda#L623
- https://github.com/anuyts/ctx-alg/blob/15259093b0802315d7dc1d6b061540305680e1d7/src/Mat/Term.agda#L631
The latter 2 goals (and originally the first one) give me garbled boundary contexts in the output:
t = algebraHom t j, carrierHom₁ = i0 ⊢ ...
t = algebraHom t j, carrierHom₁ = i1 ⊢ ...
t = algebraHom t j, strHom₁ = i0 ⊢ ...
t = algebraHom t j, strHom₁ = i1 ⊢ ...
The appearance of the names carrierHom₁ and strHom₁, which are the names of the constructors of AlgebraHom (with a ₁ appended), gave me the idea that this is a de Bruijn fail related to some but not all of the Algebra and AlgebraHom arguments being eta-expanded on the LHS in the code base. So for the first hole I changed the LHS from
ModelHom1Eq→IsTermAlgebraHom' m1EqA m1EqB@(algebra msetB β1 , respectsEqB) m1EqF sort (joinFQ-varF t j) i = ?to
ModelHom1Eq→IsTermAlgebraHom'
m1EqA@(algebra msetA α1 , respectsEqA)
m1EqB@(algebra msetB β1 , respectsEqB)
m1EqF@(algebraHom f f-isalg1) sort (joinFQ-varF t j) i = ?and this actually solved the problem.
I am on Agda version 2.6.2-246a229.
Note: the linked repository contains a submodule and should be cloned with git clone --recurse-submodules.
Activity
anuyts commentedon May 12, 2022
Actually I cannot fill the hole using the boundaries obtained from the output:
The remaining
iis not accepted on the grounds of an ill-typed inequalitywhere
strHomis the name of the second field ofAlgebraHom, so I have the impression that the de Bruijn fail persists.Also, why can't I use C-c C-s (or just type an underscore) to have the boundaries of my
Squaretype filled in from the boundary constraints? This would make it MUCH easier to invoke h-levels, and I don't see any theoretical problem.[-]Garbled boundary contexts & naming eta expansion.[/-][+]De Bruijn fail in Cubical (Was: Garbled boundary contexts & naming eta expansion.)[/+]model1EqtoQ: giving up for now due to de Bruijn fail in Cubical? agda…
[ agda/agda#5900 ] matching on m1EqF@(algebraHom _ _) fixes problems
andreasabel commentedon May 15, 2022
@anuyts: Usually, when I tried to produce a minimal counterexample from my suspicion what the problem is, I could not reproduce the problem. In my experience, one has to go through the process of shrinking the original occurrence of the problem, and this typically takes 2 hours (however, this might take longer due to the slow response of Cubical Agda on this file when working interactively). The goal would be a MWE akin to #5838 (comment).
I tried your development with Agda-2.6.3 and a later cubical library (that builds with 2.6.3), but this gives me scope errors.
The version of
cubicalyou pin to does not build with Agda-2.6.3. We usually only fix bugs in Agdamaster, so a MWE should be targeting Agda-2.6.3.I looked at the goal https://github.com/anuyts/ctx-alg/blob/15259093b0802315d7dc1d6b061540305680e1d7/src/Mat/Term.agda#L609 with Agda-2.6.2.2 and trying to give the solution, get type errors. Some can be fixed by replacing
t(not a function) withf(a function). Then I saw that you fixed this in your second comment.Playing around a bit more, I found that explicitly matching on
m1EqFin all clauses ofModelHom1Eq→IsTermAlgebraHom'fixes the problems you mention: garbled boundary context and failure to givei. Pushed to: andreasabel/anuyts-ctx-alg@07c84e3AFAIK, Agda does not eagerly split on eta-records on the LHS. So doing the split explicitly does put you in different execution paths of Agda.
anuyts commentedon May 17, 2022
I'll see what I can do.
Meanwhile, I remain interested in a theoretical explanation of this:
I'm really quite puzzled that Agda's current metavariable solver cannot automatically do this; I've been manually copy-pasting terms from Agda's output.
anuyts commentedon May 17, 2022
Here I now get the following output:
I do not get it if I comment out the last uncommented line. (Line 90. Note: github syntax highlighting does not bother with well-nested comments.)
I do not know how to interpret this output. What does it mean that agda is "stuck"?
What is the meaning of something like
[$ i, $ i₁] ~~ [$ i, $ i₁]?Also, the cubical library is giving me a lot of warnings in the lines of
I've merged a pretty recent version of the cubical master branch. Should I consider this normal?
I'm currently on Agda version 2.6.3-9c6b052.
andreasabel commentedon May 20, 2022
This is unfortunately the status quo atm, indexed inductive types are still not well-supported by Cubical Agda.
jespercockx commentedon Aug 31, 2022
Might be fixed by #6053 ?
plt-amy commentedon Oct 23, 2022
I'll keep working on it over the next week but sadly I'm not sure boundary-sensitive evaluation will be ready for review, let alone merge-able, in the coming 9 days. Bumping this to 2.6.4.