Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thanks to a change by Atze, forward and backward reasoning (needed fo…
…r an example in the left-corner paper of Atze and Doaitse) now seems to work (although slow :( )
- Loading branch information
Showing
8 changed files
with
123 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
let | ||
|
||
data Ref a env | ||
= Zero , env = (a, env') | ||
| Succ (Ref a env') , env = (x, env') | ||
in let | ||
data Equal a b | ||
= Eq, a = b | ||
in let | ||
data Maybe a | ||
= Nothing | ||
| Just a | ||
in let | ||
match :: Ref a env -> Ref b env -> Maybe (Equal a b) | ||
match = \r1 -> \r2 -> | ||
case (r1, r2) of | ||
(Zero, Zero) -> Just Eq | ||
(Succ x, Succ y) -> match x y | ||
(_, _) -> Nothing | ||
in 3 |