@@ -86,8 +86,7 @@ wfInd : WellFounded rel => {P : a -> Type} ->
8686wfInd {rel} step x = accInd step x (wellFounded {rel} x)
8787
8888||| Interface of types with sized values.
89−|||
90−||| The sizes are used for proofs of termination via accessibility.
89+||| The size is used for proofs of termination via accessibility.
9190|||
9291||| @ a the type whose elements can be mapped to Nat
9392interface Sized a where
@@ -96,16 +95,17 @@ interface Sized a where
9695Smaller : Sized a => a -> a -> Type
9796Smaller x y = size x `LT` size y
9897
99−SizeAcc : Sized a => a -> Type
100−SizeAcc = Accessible Smaller
98+SizeAccessible : Sized a => a -> Type
99+SizeAccessible = Accessible Smaller
101100
102101||| Proof of well-foundedness of `Smaller`.
103102||| Constructs accessibility for any given element of `a`, provided `Sized a`.
104−sizeAcc : Sized a => (x : a) -> SizeAcc x
105−sizeAcc x = Access $ f (size x) (ltAccessible $ size x)
103+sizeAccessible : Sized a => (x : a) -> SizeAccessible x
104+sizeAccessible x = Access $ f (size x) (ltAccessible $ size x)
106105 where
106+ -- prove well-foundedness of `Smaller` from well-foundedness of `LT`
107107 f : (sizeX : Nat) -> (acc : Accessible LT sizeX)
108− -> (y : a) -> (size y `LT` sizeX) -> Accessible Smaller y
108+ -> (y : a) -> (size y `LT` sizeX) -> SizeAccessible y
109109 f Z acc y pf = absurd pf
110110 f (S n) (Access acc) y (LTESucc yLEx)
111111 = Access (\z, zLTy =>
@@ -127,14 +127,14 @@ sizeInd : Sized a
127127 -> (step : (x : a) -> ((y : a) -> Smaller y x -> P y) -> P x)
128128 -> (z : a)
129129 -> P z
130−sizeInd step z = accInd step z (sizeAcc z)
130+sizeInd step z = accInd step z (sizeAccessible z)
131131
132132||| Strong recursion principle for sized types.
133133sizeRec : Sized a
134134 => (step : (x : a) -> ((y : a) -> Smaller y x -> b) -> b)
135135 -> (z : a)
136136 -> b
137−sizeRec step z = accRec step z (sizeAcc z)
137+sizeRec step z = accRec step z (sizeAccessible z)
138138
139139
140140implementation Sized Nat where