Created
February 28, 2013 13:11
-
-
Save deech/5056607 to your computer and use it in GitHub Desktop.
Indexed natural numbers
This file contains hidden or 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
(datatype natnum | |
if (integer? X) | |
if (> X -1) | |
________________ | |
X : (natnum X); | |
(let A (+ X 1)); | |
X : (natnum X); | |
__________ | |
(+ X 1) : (natnum A); | |
(let A (- X 1)); | |
(not (= X 0)) : verified; X : (natnum X); | |
_____________________________________ | |
(- X 1) : (natnum A);) | |
(define plus | |
{(natnum X) --> (natnum Y) --> (natnum Z)} | |
0 X -> X | |
X Y -> (plus (- X 1) (+ Y 1)) where(not (= X 0)) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment