-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add coq-stdpp as dependency, add abs_examples module (#12)
* add coq-stdpp as dependency, add abs_examples module * Typing examples * nits --------- Co-authored-by: Aqissiaq <aqissiaq@gmail.com>
- Loading branch information
Showing
5 changed files
with
47 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
From ABS Require Import abs_defs. | ||
From stdpp Require Import prelude base. | ||
|
||
(** * ABS Examples *) | ||
|
||
Definition e_const_5 : e := | ||
e_t (t_int 5%Z). | ||
|
||
Definition func_const_5 : F := | ||
F_fn T_int "const_5"%string [] e_const_5. | ||
|
||
Definition e_call_const_5 : e := | ||
e_fn_call "const_5"%string []. | ||
|
||
Definition Ctx : G := | ||
Map.add ("const_5"%string) (ctxv_sig (sig_sig [] T_int)) (Map.empty ctxv). | ||
|
||
Lemma e_const_5_T_int : | ||
typ_e Ctx e_const_5 T_int. | ||
Proof. by apply typ_int. Qed. | ||
|
||
Lemma e_call_const_typ_F : | ||
typ_F Ctx func_const_5. | ||
Proof. | ||
apply typ_func_decl. | ||
- easy. | ||
- apply e_const_5_T_int. | ||
Qed. | ||
|
||
Lemma e_call_const_5_T_int : | ||
typ_e Ctx e_call_const_5 T_int. | ||
Proof. | ||
unfold e_call_const_5. | ||
replace [] with (map (fun (pat_:(e*T)) => match pat_ with (e_,T_) => e_ end ) []) | ||
by auto. | ||
by apply typ_func_expr. | ||
Qed. |