You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module Again
%default total
%access public export
||| A "full" or non-empty list
FList : Type -> Type
FList a = (xs : List a ** NonEmpty xs)
infixr 5 :::
(:::) : a -> List a -> FList a
(:::) x xs = ((x :: xs) ** IsNonEmpty)
||| Proof that the first list is an improper prefix of the second list, with the
||| third list as the remainder.
data IsPrefixOf : FList a -> FList a -> List a -> Type where
SingletonPrefix : IsPrefixOf (x ::: []) (x ::: rem) rem
SuccPrefix : IsPrefixOf (xs ** _) (ys ** _) rem
-> IsPrefixOf (x ::: xs) (x ::: ys) rem
prefixAntisym : (xs : FList a) -> (ys : FList a) -> (zs : List a)
-> IsPrefixOf xs ys zs -> IsPrefixOf ys xs zs
-> (xs = ys, zs = [])
prefixAntisym (xs ** xpf) (ys ** ypf) [] SingletonPrefix _ impossible
prefixAntisym (xs ** xpf) (ys ** ypf) [] (SuccPrefix _) _ impossible
prefixAntisym (xs ** xpf) (ys ** ypf) (_ :: _) SingletonPrefix _ impossible
prefixAntisym (xs ** xpf) (ys ** ypf) (_ :: _) (SuccPrefix _) _ impossible
I got these impossible cases by using case splitting. However, convinced that there are possible cases, I then began to write this definition out more by hand, without so much reliance on Idris' auto-editing capabilities:
which though it is incomplete, type checks, thus demonstrating that Idris disagrees with itself about the impossibility of the first several cases. I wonder if this is a duplicate of #4582 , but being that I experienced it in a different way, I thought I might open a separate issue. I am at least hoping that this is not a separate root problem though!
Expected Behavior
On case splitting: that Idris would give me case splits which still contained equations with holes.
On type checking: that Idris would not type-check the proof that falsely claims all cases are impossible. I have seen before where it goofed up on the auto-editing but caught the problem it had introduced on a subsequent type check.
Observed Behavior
On case splitting: Idris falsely jumps to the conclusion that all cases are impossible.
On type checking: Idris doesn't catch the bug it introduced during case splitting.
The text was updated successfully, but these errors were encountered:
Steps to Reproduce
Using Idris 1.3.1, I am able to compile
I got these
impossible
cases by using case splitting. However, convinced that there are possible cases, I then began to write this definition out more by hand, without so much reliance on Idris' auto-editing capabilities:which though it is incomplete, type checks, thus demonstrating that Idris disagrees with itself about the impossibility of the first several cases. I wonder if this is a duplicate of #4582 , but being that I experienced it in a different way, I thought I might open a separate issue. I am at least hoping that this is not a separate root problem though!
Expected Behavior
Observed Behavior
impossible
.The text was updated successfully, but these errors were encountered: