Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ #2492 ] Folding ℕs during Abstract to Concrete
We turn `suc^n zero` into `Lit n` when converting from Abstract to Concrete. The most obvious benefit is that Auto doesn't spit out massive terms when it has built a big natural number (however it still takes a long time: internally Auto does generate the big chain of `suc`s and we need to go through it. There is another opportunity to call `tryToRecoverNatural` in `toConcrete` in the `Con` case: toConcrete (Con (AmbQ (x:_))) = Ident <$> toConcrete x However that turns the warning about `{-# BUILTIN ZERO zero #-}` into a weird warning about `{-# BUILTIN ZERO 0 #-}` so I figured it was not worth the trouble.
- Loading branch information
Showing
5 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
NonTerminatingReduce.agda:16,9-13 | ||
loop n != suc 41 of type Nat | ||
loop n != 42 of type Nat | ||
when checking that the expression refl has type loop n ≡ 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Issue2492 where | ||
|
||
open import Agda.Builtin.Nat | ||
|
||
infix 0 _! | ||
data Singleton {A : Set} : A → Set where | ||
_! : (a : A) → Singleton a | ||
|
||
_ : Singleton 10 | ||
_ = {!!} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
top_command (cmd_load currentFile []) | ||
goal_command 0 cmd_auto "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
(agda2-status-action "") | ||
(agda2-info-action "*Type-checking*" "" nil) | ||
(agda2-highlight-clear) | ||
(agda2-info-action "*Type-checking*" "Checking Issue2492 (Issue2492.agda). " t) | ||
(agda2-info-action "*Type-checking*" " Checking Agda.Builtin.Nat (agda-default-include-path/Agda/Builtin/Nat.agda). " t) | ||
(agda2-info-action "*Type-checking*" " Checking Agda.Builtin.Bool (agda-default-include-path/Agda/Builtin/Bool.agda). " t) | ||
(agda2-info-action "*Type-checking*" " Finished Agda.Builtin.Bool. " t) | ||
(agda2-info-action "*Type-checking*" " Finished Agda.Builtin.Nat. " t) | ||
(agda2-status-action "") | ||
(agda2-info-action "*All Goals*" "?0 : Singleton 10 " nil) | ||
((last . 1) . (agda2-goals-action '(0))) | ||
(agda2-give-action 0 "10 !") | ||
(agda2-status-action "") | ||
(agda2-info-action "*All Done*" "" nil) | ||
((last . 1) . (agda2-goals-action '())) |