X-Git-Url: http://git.megacz.com/?p=coq-hetmet.git;a=blobdiff_plain;f=src%2FExtractionMain.v;h=6406f90f31489cc0a98fafc1c9edad9021d405d6;hp=05d059a81b4fc4c78b73ab23d3868cac0fc6cf60;hb=ec8ee5cde986e5b38bcae38cda9e63eba94f1d9f;hpb=20a9b4934a97e6801d6785ac940f771cb74a8cc1 diff --git a/src/ExtractionMain.v b/src/ExtractionMain.v index 05d059a..6406f90 100644 --- a/src/ExtractionMain.v +++ b/src/ExtractionMain.v @@ -36,11 +36,11 @@ Require Import HaskProofToStrong. Require Import ProgrammingLanguage. +Require Import HaskProofFlattener. +Require Import HaskProofStratified. Require Import HaskProofCategory. -(* -Require Import HaskStrongCategory. -*) -Require Import ReificationsEquivalentToGeneralizedArrows. + +Require Import ReificationsIsomorphicToGeneralizedArrows. Open Scope string_scope. Extraction Language Haskell. @@ -61,8 +61,7 @@ Extract Inductive unit => "()" [ "()" ]. Extract Inlined Constant string_dec => "(==)". Extract Inlined Constant ascii_dec => "(==)". -(* adapted from ExtrOcamlString.v *) -Extract Inductive ascii => "Char" [ "bin2ascii" ] "bin2ascii'". +Extract Inductive ascii => "Char" [ "you_forgot_to_patch_coq" ] "you_forgot_to_patch_coq". Extract Constant zero => "'\000'". Extract Constant one => "'\001'". Extract Constant shift => "shiftAscii". @@ -109,8 +108,6 @@ Section core2proof. end. - (* core-to-string (-dcoqpass) *) - Definition header : string := "\documentclass[9pt]{article}"+++eol+++ "\usepackage{amsmath}"+++eol+++ @@ -129,7 +126,7 @@ Section core2proof. eol+++"\end{document}"+++ eol. - + (* core-to-string (-dcoqpass) *) Definition coreToStringExpr' (ce:@CoreExpr CoreVar) : ???string := addErrorMessage ("input CoreSyn: " +++ toString ce) (addErrorMessage ("input CoreType: " +++ toString (coreTypeOfCoreExpr ce)) ( @@ -228,51 +225,6 @@ Section core2proof. apply t. Defined. - Definition env := ★::nil. - Definition freshTV : HaskType env ★ := haskTyVarToType (FreshHaskTyVar _). - Definition idproof0 : ND Rule [] [env > nil > [] |- [freshTV--->freshTV @@ nil]]. - eapply nd_comp. - eapply nd_comp. - eapply nd_rule. - apply RVar. - eapply nd_rule. - eapply (RURule _ _ _ _ (RuCanL _ _)) . - eapply nd_rule. - eapply RLam. - Defined. - -(* - Definition coreToCoreExpr' (ce:@CoreExpr CoreVar) : ???(@CoreExpr CoreVar) := - addErrorMessage ("input CoreSyn: " +++ toString ce) - (addErrorMessage ("input CoreType: " +++ toString (coreTypeOfCoreExpr ce)) ( - coreExprToWeakExpr ce >>= fun we => - addErrorMessage ("WeakExpr: " +++ toString we) - ((addErrorMessage ("CoreType of WeakExpr: " +++ toString (coreTypeOfCoreExpr (weakExprToCoreExpr we))) - ((weakTypeOfWeakExpr we) >>= fun t => - (addErrorMessage ("WeakType: " +++ toString t) - ((weakTypeToTypeOfKind φ t ★) >>= fun τ => - addErrorMessage ("HaskType: " +++ toString τ) - ((weakExprToStrongExpr Γ Δ φ ψ ξ (fun _ => true) τ nil we) >>= fun e => - (let haskProof := @expr2proof _ _ _ _ _ _ e - in (* insert HaskProof-to-HaskProof manipulations here *) - (unFresh (@proof2expr nat _ FreshNat _ _ _ _ (fun _ => Prelude_error "unbound unique") _ haskProof)) - >>= fun e' => Error (@toString _ (ExprToString _ _ _ _) (projT2 e')) -(* - >>= fun e' => - Prelude_error (@toString _ (@ExprToString nat _ _ _ _ _ _) (projT2 e')) - *) -) -)))))))). -(* Error "X").*) -(* - strongExprToWeakExpr hetmet_brak hetmet_esc mkWeakTypeVar mkWeakCoerVar mkWeakExprVar uniqueSupply - (projT2 e') - INil - >>= fun q => Error (toString q) - ))))))))). -*)*) - - Definition coreToCoreExpr' (ce:@CoreExpr CoreVar) : ???(@CoreExpr CoreVar) := addErrorMessage ("input CoreSyn: " +++ toString ce) (addErrorMessage ("input CoreType: " +++ toString (coreTypeOfCoreExpr ce)) (