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
Here's half the proof that (==) on nats does the right thing.
eqComplete : (x : Nat) -> (y : Nat) -> so (not (x == y)) -> x = y -> Bool -> _|_
eqComplete Z Z oh eq _ impossible
eqComplete Z (S _) p refl _ impossible
eqComplete (S _) Z p refl _ impossible
eqComplete (S x) (S y) p eq True = eqComplete x y p (sucInj eq) True
eqComplete (S x) (S y) p eq False = eqComplete x y p (sucInj eq) False
Following discussion on Friday, I'm pretty sure this is due to fromInteger : Integer -> Nat taking time linear to the size of the Nat. Idris also takes quite some time to evaluate the Nat 10000.
Probably the way to fix this is to replace Nats with Integers in the evaluator, but there are some trade-offs regarding complexity of implementation there.
edwinb
changed the title
Mysterious slowness
Compile time Nats need to be optimised
Oct 19, 2015
I've changed the title to reflect the fact that the slowness is no longer mysterious, but we do need to get around to implementing better compile time Nats. I don't like implementing special cases, but as special cases go, this one is particularly special...
Here's half the proof that (==) on nats does the right thing.
This takes about 3s:
This is very strange since eqComplete cannot actually evaluate, as made sured by the spurious Bool argument.
The text was updated successfully, but these errors were encountered: