X-Git-Url: http://git.megacz.com/?p=coq-hetmet.git;a=blobdiff_plain;f=src%2FHaskFlattener.v;h=b3523985d74df8d979a3d6985cd243a02de391a4;hp=c19f81aed2a01698400f71fc65038435791ce614;hb=3161a8a65cb0190e83d32bde613c3b64dfe31739;hpb=3282a2b78028238987a5a49e59d8e8d495aea0e1 diff --git a/src/HaskFlattener.v b/src/HaskFlattener.v index c19f81a..b352398 100644 --- a/src/HaskFlattener.v +++ b/src/HaskFlattener.v @@ -161,9 +161,6 @@ Section HaskFlattener. (*******************************************************************************) - Context (hetmet_flatten : WeakExprVar). - Context (hetmet_unflatten : WeakExprVar). - Context (hetmet_id : WeakExprVar). Context {unitTy : forall TV, RawHaskType TV ECKind -> RawHaskType TV ★ }. Context {prodTy : forall TV, RawHaskType TV ECKind -> RawHaskType TV ★ -> RawHaskType TV ★ -> RawHaskType TV ★ }. Context {gaTy : forall TV, RawHaskType TV ECKind -> RawHaskType TV ★ -> RawHaskType TV ★ -> RawHaskType TV ★ }. @@ -777,9 +774,6 @@ Section HaskFlattener. (fun TV : Kind → Type => take_arg_types ○ t TV))))). reflexivity. unfold flatten_type. - clear hetmet_flatten. - clear hetmet_unflatten. - clear hetmet_id. clear gar. set (t tv ite) as x. admit. @@ -888,6 +882,7 @@ Section HaskFlattener. rename l into g. rename σ into l. destruct l as [|ec lev]; simpl. + (* destruct (eqd_dec (g:CoreVar) (hetmet_flatten:CoreVar)). set (flatten_type (g wev)) as t. set (RGlobal _ Δ nil (mkGlobal Γ t hetmet_id)) as q. @@ -902,6 +897,7 @@ Section HaskFlattener. apply nd_rule. apply q. apply INil. + *) unfold flatten_leveled_type. simpl. apply nd_rule; rewrite globals_do_not_have_code_types. apply RGlobal. @@ -1200,8 +1196,26 @@ Section HaskFlattener. reflexivity. destruct case_RCase. - simpl. - apply (Prelude_error "Case not supported (BIG FIXME)"). + destruct lev; [ idtac | apply (Prelude_error "case at depth >0") ]; simpl. + apply nd_rule. + rewrite <- mapOptionTree_compose. + replace (mapOptionTree + (fun x => flatten_judgment (pcb_judg (snd x))) + alts,, [Γ > Δ > mapOptionTree flatten_leveled_type Σ |- [flatten_type (caseType tc avars)] @ nil]) + with + (mapOptionTree + (fun x => @pcb_judg tc Γ Δ nil (flatten_type tbranches) avars (fst x) (snd x)) + alts,, + [Γ > Δ > mapOptionTree flatten_leveled_type Σ |- [caseType tc avars] @ nil]). + replace (mapOptionTree flatten_leveled_type + (mapOptionTreeAndFlatten + (fun x => (snd x)) alts)) + with (mapOptionTreeAndFlatten + (fun x => + (snd x)) alts). + apply RCase. + admit. + admit. destruct case_SBrak. simpl.