-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recursor of inductive-inductive type does not pass termination check in Cubical Agda #5953
Comments
If you switch from
|
…erns With #4606, --cubical no longer considered dotted patterns as patterns for termination certification. This patch considers dotted variables and dotted record patterns as benign and considers then as pattern always in the termination checker, even in the first phase (no dot-patterns) which is the only phase with --cubical. (The other modes have the dot-pattern termination phase as well.)
…erns With #4606, --cubical no longer considered dotted patterns as patterns for termination certification. This patch considers dotted variables and dotted record patterns as benign and considers then as pattern always in the termination checker, even in the first phase (no dot-patterns) which is the only phase with --cubical. (The other modes have the dot-pattern termination phase as well.)
…erns With #4606, --cubical no longer considered dotted patterns as patterns for termination certification. This patch considers dotted variables and dotted record patterns as benign and considers then as pattern always in the termination checker, even in the first phase (no dot-patterns) which is the only phase with --cubical. (The other modes have the dot-pattern termination phase as well.)
If the program should be rejected when |
Turning off dot-pattern termination for {-# OPTIONS --without-K #-}
open import Agda.Builtin.Nat using (Nat; zero; suc)
data Acc {A : Set} (R : A → A → Set) (x : A) : Set where
acc : (∀ y → R y x → Acc R y) → Acc R x
data _<_ (x : Nat) : Nat → Set where
<S : x < suc x
iswf< : ∀ x → Acc _<_ x
iswf< x = acc (h x)
where
h : ∀ x y → y < x → Acc _<_ y
h .(suc y) y <S = acc (h y) |
After the fix, it is accepted in both modes. But see my previous comment for a violation of your principle. Likely, the termination checker rejects too many programs under |
…erns With #4606, --cubical no longer considered dotted patterns as patterns for termination certification. This patch considers dotted variables and dotted record patterns as benign and considers then as pattern always in the termination checker, even in the first phase (no dot-patterns) which is the only phase with --cubical. (The other modes have the dot-pattern termination phase as well.)
"My principle" is that code that is accepted when
The code is accepted (with iswf< : ∀ x → Acc _<_ x
iswf< x = acc (h x)
where
h : ∀ x y → y < x → Acc _<_ y
h (suc y) .y <S = acc (h y) However, Agda emits a warning:
|
I realised that my statement is too strong. One could make Cubical Agda checks unnecessarily strict without the risk of breaking anything, and that may be the case for the check under discussion. @Saizan wrote the following: agda/src/full/Agda/Termination/TermCheck.hs Lines 243 to 252 in 66643bc
I'm not sure exactly how to interpret this. Would it make sense to include dot patterns when checking termination for a Cubical Agda definition that does not involve matching for HITs? |
I suppose so. |
The following code typechecks without the
--cubical
flag, but does not pass the termination checker with the flag:The text was updated successfully, but these errors were encountered: