Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/branches/primop-branch-2/src/compiler/FLINT/kernel/kindchk.sml
ViewVC logotype

View of /sml/branches/primop-branch-2/src/compiler/FLINT/kernel/kindchk.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2019 - (download) (annotate)
Thu Aug 17 15:36:17 2006 UTC (13 years, 11 months ago) by georgekuan
File size: 1020 byte(s)
beginning full FLINT kind checker
structure KindChk =
struct

structure LT = LtyExtern
open Lty

datatype frame = Beta of int * tyc list * tkind list (* suspension from beta red, r1 *)
	       | Lam of int * tkind list (* lifted lambda at given nesting level, r10 *)
withtype env = frame list

(* 
fun eqKind (TK_MONO, TK_MONO) = true
  | eqKind (TK_BOX, TK_BOX) = true
  | eqKind (TK_SEQ ks, TK_SEQ ks') = List.all eqKind (ListPair.zip (ks,ks'))
  | eqKind (TK_FUN (paramks, retknd), TK_FUN (paramks', retknd')) =
      (List.all eqKind (ListPair.zip (paramks, paramks'))) andalso eqKind(retknd,retknd')
 *)

(* lty.sml has a tk_eq "pointer" equality on normalized tkind *)
(* ltyextern.sml has a tkSubkind and tksSubkind functions *)

(* ltyextern.sml has a tkTycGen() that returns a function that returns the 
   kind of a given tyc using a given kenv *)
fun chkKind(tyc : tyc, kenv) =
    (case (tc_outX tyc) of
	 TC_VAR(n,argnum) => lookupKind(kenv, n, argnum)
       | TC_NVAR(lv) => raise Fail "Unimplemented" (* ... *)
       | TC_PRIM(ptyc) => 

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0