-
-
Save anonymous/bd1191653b04bc59aa44 to your computer and use it in GitHub Desktop.
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
Inductive odd : nat -> Prop := | |
| odd_1 : odd 1 | |
| odd_S n : even (n ) -> odd (n+1) | |
with even : nat -> Prop := | |
| even_S n : odd n -> even (n+1). | |
Fixpoint oddmembers (l : natlist) : natlist := | |
match l with | |
| nil => [] | |
| O :: t => oddmembers(t) | |
| S n :: t => match S n with | |
| odd => S n :: oddmembers(t) | |
end | |
end. | |
Example test_oddmembers: oddmembers [0,1,0,2,3,0,0] = [1,3]. | |
Proof. intros. simpl. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment