on master help sign in
Fixed some accidentally wrong renamings.

Also, adapted some tests to the new names

commit17bab906e5c9b1d055a05a99bc91be5c14a2822b authorAhmad Salim Al-Sibahi <asal@itu.dk> dateFri 26 Sep 2014, 13:44 (12 years ago) parenteb9ce2e
11 files changed+67−67
test/error004/FunErrTest.idr+1−1 test/proof002/Reflect.idr+24−24 test/reg009/reg009.lidr+6−6 test/reg012/reg012.lidr+10−10 test/reg026/reg026.idr+1−1 test/reg035/reg035a.lidr+7−7 test/reg047/reg047.idr+3−3 test/reg047/reg047a.idr+4−4 test/totality006/expected+1−1 test/totality006/totality006.idr+5−5 test/totality006/totality006a.idr+5−5
test/error004/FunErrTest.idr+1−1
@@ -16,7 +16,7 @@ cadr (x :: []) {cons1=Refl} {cons2=Refl} impossible
1616cadr [] {cons1=Refl} {cons2=Refl} impossible
1717
1818extractList : TT -> Maybe TT
19−extractList (App (App ReflCon (App isCons lst)) _) = Just lst
19+extractList (App (App reflCon (App isCons lst)) _) = Just lst
2020extractList _ = Nothing
2121
2222total
test/proof002/Reflect.idr+24−24
@@ -9,7 +9,7 @@ using (xs : List a, ys : List a, G : List (List a))
99 Stop : Elem x (x :: xs)
1010 Pop : Elem x ys -> Elem x (y :: xs)
1111
12−-- Expr is a Reflection of a list, indexed over the concrete list,
12+-- Expr is a reflection of a list, indexed over the concrete list,
1313-- and over a set of list variables.
1414
1515 data Expr : List (List a) -> List a -> Type where
@@ -76,7 +76,7 @@ using (xs : List a, ys : List a, G : List (List a))
7676 eqExpr ENil ENil = Just Refl
7777 eqExpr _ _ = Nothing
7878
79−-- Given a couple of Reflected expressions, try to produce a proof that
79+-- Given a couple of reflected expressions, try to produce a proof that
8080-- they are equal
8181
8282 buildProof : {xs : List a} -> {ys : List a} ->
@@ -91,7 +91,7 @@ using (xs : List a, ys : List a, G : List (List a))
9191 let (rn ** (r', rPrf)) = reduce r in
9292 buildProof l' r' lPrf rPrf
9393
94−-- Given a Reflected equality, try to produce a proof that holds
94+-- Given a reflected equality, try to produce a proof that holds
9595
9696 prove : ListEq G t -> Maybe t
9797 prove (EqP xs ys) = testEq xs ys
@@ -103,7 +103,7 @@ using (xs : List a, ys : List a, G : List (List a))
103103-- Some helpers for later... 'prim__syntactic_eq' is a primitive which
104104-- (at compile-time only) attempts to construct a proof that its arguments
105105-- are syntactically equal. We'll find this useful for referring to variables
106−-- in Reflected terms.
106+-- in reflected terms.
107107
108108 isElem : (x : a) -> (xs : List a) -> Maybe (Elem x xs)
109109 isElem x [] = Nothing
@@ -122,44 +122,44 @@ using (xs : List a, ys : List a, G : List (List a))
122122 weaken G' ENil = ENil
123123
124124
125−-- Now, some Reflection magic.
126−-- %Reflection means a function runs on syntax, rather than on constructors.
127−-- So, 'ReflectList' builds a Reflected List expression as defined above.
125+-- Now, some reflection magic.
126+-- %reflection means a function runs on syntax, rather than on constructors.
127+-- So, 'reflectList' builds a reflected List expression as defined above.
128128
129−-- It also converts (x :: xs) into a Reflected [x] ++ xs so that the above
129+-- It also converts (x :: xs) into a reflected [x] ++ xs So that the above
130130-- reduction will work the right way.
131131
132−%Reflection
133−ReflectList : (G : List (List a)) ->
132+%reflection
133+reflectList : (G : List (List a)) ->
134134 (xs : List a) -> (G' ** Expr (G' ++ G) xs)
135−ReflectList G [] = ([] ** ENil)
135+reflectList G [] = ([] ** ENil)
136136
137−ReflectList G (x :: xs) with (ReflectList G xs)
137+reflectList G (x :: xs) with (reflectList G xs)
138138 | (G' ** xs') with (isElem (List.(::) x []) (G' ++ G))
139139 | Just p = (G' ** App (Var p) xs')
140140 | Nothing = ([x] :: G' ** App (Var Stop) (weaken [[x]] xs'))
141141
142−ReflectList G (xs ++ ys) with (ReflectList G xs)
143− | (G' ** xs') with (ReflectList (G' ++ G) ys)
142+reflectList G (xs ++ ys) with (reflectList G xs)
143+ | (G' ** xs') with (reflectList (G' ++ G) ys)
144144 | (G'' ** ys') = ((G'' ++ G') **
145145 rewrite (sym (appendAssociative G'' G' G)) in
146146 App (weaken G'' xs') ys')
147−ReflectList G t with (isElem t G)
147+reflectList G t with (isElem t G)
148148 | Just p = ([] ** Var p)
149149 | Nothing = ([t] ** Var Stop)
150150
151151
152−-- Similarly, ReflectEq converts an equality proof on Lists into the ListEq
153−-- Reflection. Note that it isn't total, and we have to give the element type
152+-- Similarly, reflectEq converts an equality proof on Lists into the ListEq
153+-- reflection. Note that it isn't total, and we have to give the element type
154154-- explicitly because it can't be inferred from P.
155155
156−-- This is not really a problem - we'll want different Reflections for different
156+-- This is not really a problem - we'll want different reflections for different
157157-- forms of equality proofs anyway.
158158
159−%Reflection
160−ReflectEq : (a : Type) -> (G : List (List a)) -> (P : Type) -> (G' ** ListEq (G' ++ G) P)
161−ReflectEq a G (the (List a) xs = the (List a) ys) with (ReflectList G xs)
162− | (G' ** xs') with (ReflectList (G' ++ G) ys)
159+%reflection
160+reflectEq : (a : Type) -> (G : List (List a)) -> (P : Type) -> (G' ** ListEq (G' ++ G) P)
161+reflectEq a G (the (List a) xs = the (List a) ys) with (reflectList G xs)
162+ | (G' ** xs') with (reflectList (G' ++ G) ys)
163163 | (G'' ** ys') = ((G'' ++ G') **
164164 rewrite (sym (appendAssociative G'' G' G)) in
165165 EqP (weaken G'' xs') ys')
@@ -196,14 +196,14 @@ Reflect.bp1 = proof {
196196
197197-- "quoteGoal x by p in e" does some magic
198198-- The effect is to bind x to p applied to the current goal. If 'p' is a
199−-- Reflection function (which is the most likely thing to be useful...)
199+-- reflection function (which is the most likely thing to be useful...)
200200-- then we can feed the result to the above 'prove' function and pull out
201201-- the proof, if it exists.
202202
203203-- The syntax declaration below just gives us an easy way to invoke the
204204-- prover.
205205
206−syntax AssocProof [ty] = quoteGoal x by ReflectEq ty [] in
206+syntax AssocProof [ty] = quoteGoal x by reflectEq ty [] in
207207 getJust (prove (getProof x)) ItIsJust
208208
209209
test/reg009/reg009.lidr+6−6
@@ -4,15 +4,15 @@
44
55> filterTagP : (p : alpha -> Bool) ->
66> (as : Vect n alpha) ->
7−> so (isAnyBy p (n ** as)) ->
8−> (m : Nat ** (Vect m (a : alpha ** so (p a)), so (m > Z)))
7+> So (isAnyBy p (n ** as)) ->
8+> (m : Nat ** (Vect m (a : alpha ** So (p a)), So (m > Z)))
99> filterTagP {n = S m} p (a :: as) q with (p a)
1010> | True = (_
1111> **
12−> ((a ** believe_me oh)
12+> ((a ** believe_me Oh)
1313> ::
14−> (fst (getProof (filterTagP p as (believe_me oh)))),
15−> oh
14+> (fst (getProof (filterTagP p as (believe_me Oh)))),
15+> Oh
1616> )
1717> )
18−> | False = filterTagP p as (believe_me oh)
18+> | False = filterTagP p as (believe_me Oh)
test/reg012/reg012.lidr+10−10
@@ -1,21 +1,21 @@
1−> total soElim : (C : (b : Bool) -> so b -> Type) ->
2−> C True oh ->
3−> (b : Bool) -> (s : so b) -> (C b s)
4−> soElim C coh .True .oh = coh
1+> total soElim : (C : (b : Bool) -> So b -> Type) ->
2+> C True Oh ->
3+> (b : Bool) -> (s : So b) -> (C b s)
4+> soElim C coh .True .Oh = coh
55
6−> soFalseElim : so False -> a
6+> soFalseElim : So False -> a
77> soFalseElim x = FalseElim (soElim C () False x)
88> where
9−> C : (b : Bool) -> so b -> Type
9+> C : (b : Bool) -> So b -> Type
1010> C True s = ()
1111> C False s = _|_
1212
13−> soTrue : so b -> b = True
13+> soTrue : So b -> b = True
1414> soTrue {b = False} x = soFalseElim x
1515> soTrue {b = True} x = Refl
1616
1717> class Eq alpha => ReflEqEq alpha where
18−> Reflexive_eqeq : (a : alpha) -> so (a == a)
18+> reflexive_eqeq : (a : alpha) -> So (a == a)
1919
2020> modifyFun : (Eq alpha) =>
2121> (alpha -> beta) ->
@@ -28,7 +28,7 @@
2828> (ab : (alpha, beta)) ->
2929> modifyFun f ab (fst ab) = snd ab
3030> modifyFunLemma f (a,b) =
31−> rewrite soTrue (Reflexive_eqeq a) in Refl
31+> rewrite soTrue (reflexive_eqeq a) in Refl
3232
3333 replace {P = \ z => boolElim (a == a) b (f a) = boolElim z b (f a)}
34− (soTrue (Reflexive_eqeq a)) Refl
34+ (soTrue (reflexive_eqeq a)) Refl
test/reg026/reg026.idr+1−1
@@ -1,7 +1,7 @@
11module Test
22
33X : Nat -> Type
4−X t = (c : Nat ** so (c < 5))
4+X t = (c : Nat ** So (c < 5))
55
66column : X t -> Nat
77column = getWitness
test/reg035/reg035a.lidr+7−7
@@ -6,9 +6,9 @@
66> (q : beta -> Bool) ->
77> (a : alpha) ->
88> (b : beta) ->
9−> so (p a) ->
10−> so (q b) ->
11−> so (p a && q b)
9+> So (p a) ->
10+> So (q b) ->
11+> So (p a && q b)
1212
1313> hasNoDuplicates : (Eq alpha) => List alpha -> Bool
1414> hasNoDuplicates as = as == nub as
@@ -33,7 +33,7 @@
3333
3434> postulate reflexive_Set_eqeq : (Eq a) =>
3535> (as : Set a) ->
36−> so (as == as)
36+> So (as == as)
3737
3838> unwrap : Set a -> List a
3939> unwrap (setify as) = as
@@ -53,14 +53,14 @@
5353
5454> partitionLemma0 : (Eq alpha) =>
5555> (ass : Set (Set alpha)) ->
56−> so (arePairwiseDisjoint ass) ->
57−> so (ass `isPartition` union ass)
56+> So (arePairwiseDisjoint ass) ->
57+> So (ass `isPartition` union ass)
5858> partitionLemma0 ass asspd = (soAndIntro (\ xss => arePairwiseDisjoint xss)
5959> (\ xs => union ass == xs)
6060> ass
6161> (union ass)
6262> asspd
6363> uasseqas) where
64−> uasseqas : so (union ass == union ass)
64+> uasseqas : So (union ass == union ass)
6565> uasseqas = reflexive_Set_eqeq (union ass)
6666
test/reg047/reg047.idr+3−3
@@ -8,11 +8,11 @@ data Nat = zero | succ Nat
88Id : (A : Type) -> A -> A -> Type
99Id A = (=) {a0 = A} {b0 = A}
1010
11−Refl : (A : Type) -> (a : A) -> Id A a a
12−Refl A a = Refl {a}
11+IdRefl : (A : Type) -> (a : A) -> Id A a a
12+IdRefl A a = Refl {a}
1313
1414zzz : Id Nat zero zero
15−zzz = Refl Nat zero
15+zzz = IdRefl Nat zero
1616
1717eep : TTSigma Nat (\ a => Id Nat a zero)
1818eep = sigma Nat (\ a => Id Nat a zero) zero zzz
test/reg047/reg047a.idr+4−4
@@ -8,17 +8,17 @@ data MNat = zero | succ MNat
88Id : (A : Type) -> A -> A -> Type
99Id = \A,x,y => x = y -- {a = A} {b = A}
1010
11−Refl : (A : Type) -> (a : A) -> Id A a a
12−Refl A a = Refl {a}
11+IdRefl : (A : Type) -> (a : A) -> Id A a a
12+IdRefl A a = Refl {a}
1313
1414zzzz : Id MNat zero zero
15−zzzz = Refl MNat zero
15+zzzz = IdRefl MNat zero
1616
1717eep : TTSigma MNat (\ c => Id MNat c zero)
1818eep = (sigma MNat (\b => Id MNat b zero) zero zzzz)
1919
2020eep2 : TTSigma MNat (\ c => Id MNat c zero)
21−eep2 = (sigma MNat (\b => Id MNat b zero) zero (Refl MNat zero))
21+eep2 = (sigma MNat (\b => Id MNat b zero) zero (IdRefl MNat zero))
2222
2323
2424
test/totality006/expected+1−1
@@ -1,2 +1,2 @@
11totality006.idr:6:1:Main.prf is not total as there are missing cases
2−totality006a.idr:9:6:prf' (S _) (S _) oh is a valid case
2+totality006a.idr:9:6:prf' (S _) (S _) Oh is a valid case
test/totality006/totality006.idr+5−5
@@ -1,11 +1,11 @@
1−antitrue : so False -> a
2−antitrue oh impossible
1+antitrue : So False -> a
2+antitrue Oh impossible
33
44total
5−prf : (a:Nat) -> (b:Nat) -> so (a > b) -> GT a b
6−prf Z Z oh impossible
5+prf : (a:Nat) -> (b:Nat) -> So (a > b) -> GT a b
6+prf Z Z Oh impossible
77prf Z (S k) um = antitrue um
88prf (S k) Z um = lteSucc lteZero
9−-- prf (S _) (S _) oh impossible
9+-- prf (S _) (S _) Oh impossible
1010
1111
test/totality006/totality006a.idr+5−5
@@ -1,10 +1,10 @@
1−antitrue : so False -> a
2−antitrue oh impossible
1+antitrue : So False -> a
2+antitrue Oh impossible
33
44total
5−prf' : (a:Nat) -> (b:Nat) -> so (a > b) -> GT a b
6−prf' Z Z oh impossible
5+prf' : (a:Nat) -> (b:Nat) -> So (a > b) -> GT a b
6+prf' Z Z Oh impossible
77prf' Z (S k) um = antitrue um
88prf' (S k) Z um = lteSucc lteZero
9−prf' (S _) (S _) oh impossible
9+prf' (S _) (S _) Oh impossible
1010