-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3043 from dunhamsteve/issue-3030
[ fix ] Totality checker misses indirect references to negative data
- Loading branch information
Showing
14 changed files
with
180 additions
and
11 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
-- %default total | ||
|
||
record Oops where | ||
constructor MkOops | ||
runOops : Not Oops | ||
|
||
total | ||
notOops : Not Oops | ||
notOops x = runOops x x | ||
|
||
-- total | ||
oops : Oops | ||
oops = MkOops notOops | ||
|
||
total | ||
boom : Void | ||
boom = runOops oops oops | ||
|
||
data Foo = MkFoo (Not Foo) | ||
|
||
runFoo : Foo -> Not Foo | ||
runFoo (MkFoo nf) = nf | ||
|
||
notFoo : Not Foo | ||
notFoo x = runFoo x x | ||
|
||
foo : Foo | ||
foo = MkFoo notFoo | ||
|
||
total | ||
boom2 : Void | ||
boom2 = runFoo foo foo |
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,18 @@ | ||
|
||
data Oops = MkOops (Not Oops) | ||
|
||
total | ||
runOops : Oops -> Not Oops | ||
runOops (MkOops nf) = nf | ||
|
||
total | ||
notOops : Not Oops | ||
notOops x = runOops x x | ||
|
||
covering | ||
oops : Oops | ||
oops = MkOops notOops | ||
|
||
total | ||
boom : Void | ||
boom = runOops oops oops |
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,14 @@ | ||
data Bad = MkBad (Not Bad) | ||
|
||
hmmm : Bad -> Not Bad | ||
hmmm (MkBad n) = n | ||
|
||
ok : Not Bad | ||
ok bad = hmmm bad bad | ||
|
||
bad : Bad | ||
bad = MkBad ok | ||
|
||
total | ||
ohno : Void | ||
ohno = ok bad |
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,27 @@ | ||
1/1: Building Issue-3030 (Issue-3030.idr) | ||
Error: boom is not total, possibly not terminating due to function Main.MkOops being reachable via Main.oops -> Main.MkOops | ||
|
||
Issue-3030:16:1--17:12 | ||
16 | total | ||
17 | boom : Void | ||
|
||
Error: boom2 is not total, possibly not terminating due to function Main.MkFoo being reachable via Main.foo -> Main.MkFoo | ||
|
||
Issue-3030:31:1--32:13 | ||
31 | total | ||
32 | boom2 : Void | ||
|
||
1/1: Building Issue-3030b (Issue-3030b.idr) | ||
Error: boom is not total, possibly not terminating due to function Main.MkOops being reachable via Main.oops -> Main.MkOops | ||
|
||
Issue-3030b:16:1--17:12 | ||
16 | total | ||
17 | boom : Void | ||
|
||
1/1: Building Issue-524 (Issue-524.idr) | ||
Error: ohno is not total, possibly not terminating due to function Main.MkBad being reachable via Main.bad -> Main.MkBad | ||
|
||
Issue-524:12:1--13:12 | ||
12 | total | ||
13 | ohno : Void | ||
|
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,6 @@ | ||
rm -rf build | ||
|
||
$1 --no-color --console-width 0 --no-banner --check Issue-3030.idr | ||
$1 --no-color --console-width 0 --no-banner --check Issue-3030b.idr | ||
$1 --no-color --console-width 0 --no-banner --check Issue-524.idr | ||
|