-
-
Save anonymous/b3b1af7808e8bfbcb471 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
Require Import String. | |
Require Import List. | |
Require Import Compare_dec. | |
Record user := | |
{ name : string | |
; age : nat | |
} | |
. | |
Inductive schlemazl := | |
| Loh | |
| Mudak | |
| Pots | |
. | |
Axiom action : Type. | |
Axiom deactivate : user -> action. | |
Definition ban_user (u : user) : (schlemazl * list action) := | |
let actions := deactivate u :: nil in | |
let res := | |
if lt_dec u.(age) 10 | |
then Loh | |
else | |
if lt_dec u.(age) 20 | |
then Mudak | |
else Pots | |
in | |
(res, actions) | |
. | |
Lemma ban_user_8 : | |
forall name, | |
let u := {| name := name; age := 8 |} in | |
exists actions, | |
ban_user u = (Loh, actions). | |
intros. | |
compute. | |
eauto. | |
Defined. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment