add commented-out definitions for analytic proofs and cut elimination
[coq-hetmet.git] / src / HaskCore.v
1 (*********************************************************************************************************************************)
2 (* HaskCore: basically GHC's CoreSyn.Expr imported into Coqland                                                                  *)
3 (*********************************************************************************************************************************)
4
5 Generalizable All Variables.
6 Require Import Preamble.
7 Require Import General.
8 Require Import Coq.Strings.String.
9 Require Import HaskKinds.
10 Require Import HaskLiteralsAndTyCons.
11 Require Import HaskCoreTypes.
12 Require Import HaskCoreVars.
13
14 (* this type must extract to EXACTLY match TypeRep.Type *)
15 Inductive CoreExpr {b:Type} :=
16 | CoreEVar   : CoreVar                          -> CoreExpr
17 | CoreELit   : HaskLiteral                      -> CoreExpr
18 | CoreEApp   : CoreExpr        ->  CoreExpr     -> CoreExpr
19 | CoreELam   : b               ->  CoreExpr     -> CoreExpr
20 | CoreELet   : CoreBind        ->  CoreExpr     -> CoreExpr
21 | CoreECase  : CoreExpr   -> b ->  CoreType     -> list (@triple CoreAltCon (list b) CoreExpr) -> CoreExpr
22 | CoreECast  : CoreExpr        ->  CoreCoercion -> CoreExpr
23 | CoreENote  : Note            ->  CoreExpr     -> CoreExpr
24 | CoreEType  : CoreType                         -> CoreExpr
25 with      CoreBind {b:Type} :=
26 | CoreNonRec : b -> CoreExpr         -> CoreBind  
27 | CoreRec    : list (b * CoreExpr  ) -> CoreBind.
28 Extract Inductive CoreExpr =>
29    "CoreSyn.Expr" [
30       "CoreSyn.Var"
31       "CoreSyn.Lit"
32       "CoreSyn.App"
33       "CoreSyn.Lam"
34       "CoreSyn.Let"
35       "CoreSyn.Case"
36       "CoreSyn.Cast"
37       "CoreSyn.Note"
38       "CoreSyn.Type" ].
39 Extract Inductive CoreBind =>
40   "CoreSyn.Bind" [ "CoreSyn.NonRec" "CoreSyn.Rec" ].
41
42 Variable coreExprToString : @CoreExpr CoreVar -> string.  Extract Inlined Constant coreExprToString => "outputableToString".
43 Instance CoreExprToString : ToString (@CoreExpr CoreVar) := { toString := coreExprToString }.
44
45 Variable coreTypeOfCoreExpr    : @CoreExpr CoreVar -> CoreType.
46   Extract Inlined Constant coreTypeOfCoreExpr => "CoreUtils.exprType".