ladder-calculus/coq/terms.v

43 lines
1.3 KiB
Coq

(* Define the abstract syntax of the calculus
* by inductive definition of type-terms
* and expression-terms.
*)
From Coq Require Import Strings.String.
Module Terms.
(* types *)
Inductive type_term : Type :=
| type_unit : type_term
| type_id : string -> type_term
| type_var : string -> type_term
| type_num : nat -> type_term
| type_fun : type_term -> type_term -> type_term
| type_univ : string -> type_term -> type_term
| type_spec : type_term -> type_term -> type_term
| type_ladder : type_term -> type_term -> type_term
.
(* expressions *)
Inductive expr_term : Type :=
| expr_var : string -> expr_term
| expr_ty_abs : string -> expr_term -> expr_term
| expr_ty_app : expr_term -> type_term -> expr_term
| expr_tm_abs : string -> type_term -> expr_term -> expr_term
| expr_tm_app : expr_term -> expr_term -> expr_term
| expr_let : string -> type_term -> expr_term -> expr_term -> expr_term
| expr_ascend : type_term -> expr_term -> expr_term
| expr_descend : type_term -> expr_term -> expr_term
.
Coercion type_var : string >-> type_term.
Coercion expr_var : string >-> expr_term.
(*
Notation "( x )" := x (at level 70).
Notation "x ~ y" := (type_rung x y) (at level 69, left associativity).
Notation "< x y >" := (type_app x y) (at level 68, left associativity).
Notation "'$' x" := (type_id x) (at level 66).
*)
End Terms.