-
Notifications
You must be signed in to change notification settings - Fork 357
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
Could the termination checker be less restrictive when the K rule is turned off? #4527
Comments
Well, if you do not have equality in the first place, there should be no difference in K or without-K. |
In Cubical Agda you would still have paths. |
The issue with termination checking When implementing inductive families for Cubical I do generate a clause that inserts the necessary transports, so termination checking that clause should catch the examples from the other thread. If your types are refining just because you are matching on some plain datatype then I don't think it should be rejected, as that wouldn't need extra desugaring. Someone should do a proof though? e.g., the following is easy to translate to eliminators/see terminating, but in general? open import Agda.Builtin.Nat
data Unit : Set where
unit : Unit
F : Unit -> Set
F unit = Nat
test : ∀ (x : Unit) → F x → Nat
test unit zero = zero
test unit (suc n) = suc (test unit n) |
The idea is that |
… --safe `--without-K` is supposed to be compatible with cubical but agda#1023 demonstrated an issue where cubical-compatible postulates could be used to evade termination analysis through type substitution introducing constructors. Here, we enable the Original Flavour termination analysis available when `--without-K` isn't enabled when both `--without-K` and `--safe` are enabled thus avoiding the 'cubical-compatible postulate' problem by simply outlawing postulates.
In particular, describe `--without-K` restriction and `--safe` behaviour.
The termination checker is currently more conservative when the K rule is turned off (#1023). I think that all the problematic examples that are listed in Issue #1023 rely on pattern matching on
refl
. If inductive families were disallowed (under some flag), would it be safe to loosen the restrictions?@Saizan is/was working on proper support for inductive families in Cubical Agda (#3733). Is this done in such a way that the restrictions become unnecessary?
The text was updated successfully, but these errors were encountered: