Last active
March 11, 2020 16:42
-
-
Save takanuva/99e6261bfbfdf4b13f00f8d62acd0399 to your computer and use it in GitHub Desktop.
Conversion between Scott encoding and Church endocing for naturals in CoC
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
\/(N: *) -> | |
\/(z: N) -> | |
\/(s: N -> N) -> | |
N |
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
./ChurchSucc ./ChurchZero |
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
\(n: ./Church ) -> | |
\(N: *) -> | |
\(z: N) -> | |
\(s: N -> N) -> | |
s (n N z s) |
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
./ChurchSucc ./ChurchTwo |
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
\(n: ./Church ) -> | |
n ./Scott ./ScottZero ./ScottSucc |
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
./ChurchSucc ./ChurchOne |
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
\(N: *) -> | |
\(z: N) -> | |
\(s: N -> N) -> | |
z |
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
./ScottToChurch | |
(./ScottSucc | |
(./ChurchToScott | |
(./ChurchSucc | |
(./ScottToChurch ./ScottThree )))) |
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
\(F: * -> *) -> | |
\/(A: *) -> | |
(F A -> A) -> | |
A |
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
./ScottF (./Mu ./ScottF ) |
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
\(n: ./Scott ) -> | |
\(R: *) -> | |
\(a: R) -> | |
\(f: ./Scott -> R) -> | |
n R a (\(x: ./Mu ./ScottF ) -> f (./ScottOut x)) |
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
\(X: *) -> \/(R: *) -> R -> (X -> R) -> R |
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
\(X: *) -> | |
\(Y: *) -> | |
\(f: X -> Y) -> | |
\(x: ./ScottF X) -> | |
\(R: *) -> | |
\(r: R) -> | |
\(ym: Y -> R) -> | |
x R r (\(xv: X) -> ym (f xv)) |
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
\(X: *) -> | |
\(k: ./ScottF X -> X) -> | |
\(t: ./Mu ./ScottF ) -> | |
t X k |
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
\(s: ./Scott ) -> | |
\(X: *) -> | |
\(k: ./ScottF X -> X) -> | |
k ((./ScottFmap (./Mu ./ScottF ) X) (./ScottFold X k) s) |
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
./ScottSucc ./ScottZero |
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
\(t: ./Mu ./ScottF ) -> | |
./ScottFold (./Scott ) (./ScottFmap (./Scott ) (./Mu ./ScottF ) ./ScottIn ) t |
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
\(n: ./Scott ) -> | |
./ScottCase n ./Scott ./ScottZero (\(pred: ./Scott ) -> pred) |
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
\(n: ./Scott ) -> | |
\(X: *) -> | |
\(x: X) -> | |
\(y: ./Mu ./ScottF -> X) -> | |
y (./ScottIn n) |
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
./ScottSucc ./ScottTwo |
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
\(n: ./Scott ) -> | |
./ScottFold | |
./Church | |
(\(k: ./ScottF ./Church ) -> k ./Church ./ChurchZero ./ChurchSucc ) | |
(./ScottIn n) |
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
./ScottSucc ./ScottOne |
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
\(X: *) -> | |
\(x: X) -> | |
\(y: ./Mu ./ScottF -> X) -> | |
x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment