Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/vis15/src/compiler/translate/translate.sml
ViewVC logotype

View of /branches/vis15/src/compiler/translate/translate.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3485 - (download) (annotate)
Sun Dec 6 13:48:48 2015 UTC (3 years, 7 months ago) by jhr
File size: 26695 byte(s)
working on merge
(* translate.sml
 *
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2015 The University of Chicago
 * All rights reserved.
 *
 * Translate Simple-AST code into the HighIR representation.  This translation is based on the
 * algorithm described in
 *
 *      Single-pass generation of static single assignment form for structured languages
 *      ACM TOPLAS, Nov. 1994
 *      by Brandis and MossenBock.
 *)

structure Translate : sig

    val translate : Simple.program -> HighIR.program

  end = struct

    structure S = Simple
    structure Ty = SimpleTypes
    structure SV = SimpleVar
    structure VMap = SV.Map
    structure VSet = SV.Set
    structure IR = HighIR
    structure Op = HighOps
    structure DstTy = HighTypes
    structure Census = HighCensus

    val cvtTy = TranslateTy.tr

  (* maps from SimpleAST variables to the current corresponding SSA variable *)
    type env = IR.var VMap.map

(* +DEBUG *)
    fun prEnv (prefix, env) = let
          val wid = ref 0
          fun pr s = (print s; wid := !wid + size s)
          fun nl () = if (!wid > 0) then (print "\n"; wid := 0) else ()
          fun prElem (src, dst) = let
                val s = String.concat [
                        " ", SV.uniqueNameOf src, "->", IR.Var.toString dst
                      ]
                in
                  pr s;
                  if (!wid >= 100) then (nl(); pr " ") else ()
                end
          in
            pr prefix; pr " ENV: {"; nl(); pr " ";
            VMap.appi prElem env;
            nl(); pr "}"; nl()
          end
(* -DEBUG *)

    fun lookup env x = (case VMap.find (env, x)
           of SOME x' => x'
            | NONE => raise Fail(concat[
                  "no binding for ", SV.uniqueNameOf x, " in environment"
                ])
          (* end case *))

  (* create a new instance of a variable *)
    fun newVar x = IR.Var.new (SV.nameOf x, cvtTy(SV.typeOf x))

  (* generate fresh SSA variables and add them to the environment *)
    fun freshVars (env, xs) = let
          fun cvtVar (x, (env, xs)) = let
                val x' = newVar x
                in
                  (VMap.insert(env, x, x'), x'::xs)
                end
          val (env, xs) = List.foldl cvtVar (env, []) xs
          in
            (env, List.rev xs)
          end

  (* a pending-join node tracks the phi nodes needed to join the assignments
   * that flow into the join node.
   *)
    datatype join = JOIN of {
        env : env,                      (* the environment that was current at the conditional *)
                                        (* associated with this node. *)
        arity : int ref,                (* actual number of predecessors *)
        nd : IR.node,                   (* the CFG node for this pending join *)
        phiMap : (IR.var * IR.var list) VMap.map ref,
                                        (* a mapping from Simple AST variables that are assigned *)
                                        (* to their phi nodes. *)
        predKill : bool array           (* killed predecessor edges (because of DIE or STABILIZE *)
      }

  (* a stack of pending joins.  The first component specifies the path index of the current
   * path to the join.
   *)
    type pending_joins = (int * join) list

  (* create a new pending-join node *)
    fun newJoin (env, arity) = JOIN{
            env = env, arity = ref arity, nd = IR.Node.mkJOIN [], phiMap = ref VMap.empty,
            predKill = Array.array(arity, false)
          }

  (* record that a path to the top join in the stack has been killed because f DIE or STABILIZE *)
    fun killPath ((i, JOIN{arity, predKill, ...}) :: _) = (
          arity := !arity - 1;
          Array.update (predKill, i, true))
      | killPath _ = ()

  (* record an assignment to the IR variable dstVar (corresponding to the Simple AST variable
   * srcVar) in the current pending-join node.  The predIndex specifies which path into the
   * JOIN node this assignment occurs on.
   *)
    fun recordAssign ([], _, _) = ()
      | recordAssign ((predIndex, JOIN{env, phiMap, predKill, nd, ...})::_, srcVar, dstVar) = let
          val arity = Array.length predKill (* the original arity before any killPath calls *)
          val m = !phiMap
          in
            case VMap.find (env, srcVar)
             of NONE => () (* local temporary *)
              | SOME dstVar' => (case VMap.find (m, srcVar)
                   of NONE => let
                        val lhs = newVar srcVar
                        val rhs = List.tabulate (arity, fn i => if (i = predIndex) then dstVar else dstVar')
                        in
(*
print(concat["recordAssign: ", SV.uniqueNameOf srcVar, " --> ", IR.Var.toString lhs,
" @ ", IR.Node.toString nd, "\n"]);
*)
                          phiMap := VMap.insert (m, srcVar, (lhs, rhs))
                        end
                    | SOME(lhs, rhs) => let
                        fun update (i, l as x::r) = if (i = predIndex)
                              then dstVar::r
                              else x::update(i+1, r)
                          | update _ = raise Fail "invalid predecessor index"
                        in
                          phiMap := VMap.insert (m, srcVar, (lhs, update(0, rhs)))
                        end
                  (* end case *))
            (* end case *)
          end

  (* complete a pending join operation by filling in the phi nodes from the phi map and
   * updating the environment.
   *)
    fun commitJoin (joinStk, JOIN{env, arity, nd, phiMap, predKill}) = let
          val IR.JOIN{preds, mask, phis, ...} = IR.Node.kind nd
        (* update the predKill array based on reachability *)
          val _ = let
                fun update (_, []) = ()
                  | update (i, nd::nds) = (
                      if IR.Node.isReachable nd then ()
                      else if Array.sub(predKill, i) then ()
                      else (arity := !arity-1; Array.update(predKill, i, true));
                      update (i+1, nds))
                in
                  update (0, !preds)
                end
        (* compute the predecessor mask *)
          val mask' = Array.foldr (op ::) [] predKill
          in
            mask := mask';
            case !arity
             of 0 => env (* all incoming edges are fake *)
              | 1 => let
                (* there is only one path to the join, so we do not need phi nodes, but
                 * we still need to propogate assignments to the next join on the stack.
                 *)
                  val ix = let (* find pred index of this join *)
                        fun find i = if Array.sub(predKill, i) then find(i+1) else i
                        in
                          find 0
                        end
                  fun doVar (srcVar, (_, xs), env) = let
                        val dstVar = List.nth(xs, ix)
                        in
(*
print(concat["doVar (", SV.uniqueNameOf srcVar, ", ", IR.phiToString phi, ", _) @ ", IR.Node.toString nd, "\n"]);
*)
                          recordAssign (joinStk, srcVar, dstVar);
                          VMap.insert (env, srcVar, dstVar)
                        end
                  val env = VMap.foldli doVar env (!phiMap)
                  in
                    env
                  end
              | nPreds => if (nPreds < Array.length predKill)
                  then let
                    (* filter out variables that correspond to fake preds from the RHS of a phi *)
                      fun filterPhiRHS xs = let
                            fun f ([], _, xs') = List.rev xs'
                              | f (x::xs, i, xs') = if Array.sub(predKill, i)
                                    then f (xs, i+1, NONE :: xs')
                                    else f (xs, i+1, (SOME x) :: xs')
                            in
                              f (xs, 0, [])
                            end
                      fun doVar (srcVar, phi as (dstVar, srcVars), (env, phis)) = (
(*
print(concat["doVar (", SV.uniqueNameOf srcVar, ", ", IR.phiToString phi, ", _) @ ", IR.Node.toString nd, "\n"]);
*)
                            recordAssign (joinStk, srcVar, dstVar);
                            (VMap.insert (env, srcVar, dstVar), (dstVar, filterPhiRHS srcVars) ::phis))
                      val (env, phis') = VMap.foldli doVar (env, []) (!phiMap)
                      in
                        phis := phis';
                        env
                      end
                  else let
                    fun doVar (srcVar, phi as (dstVar, xs), (env, phis)) = let
                          val xs = List.map SOME xs
                          in
(*
print(concat["doVar (", SV.uniqueNameOf srcVar, ", ", IR.phiToString phi, ", _) @ ", IR.Node.toString nd, "\n"]);
*)
                            recordAssign (joinStk, srcVar, dstVar);
                            IR.Var.setBinding (dstVar, IR.VB_PHI xs);
                            (VMap.insert (env, srcVar, dstVar), (dstVar, xs)::phis)
                          end
                    val (env, phis') = VMap.foldli doVar (env, []) (!phiMap)
                    in
                      phis := phis';
                      env
                    end
            (* end case *)
          end

  (* expression translation *)
    fun cvtExp (env : env, lhs, exp) = (case exp
           of S.E_Var x => [IR.ASSGN(lhs, IR.VAR(lookup env x))]
            | S.E_Lit lit => [IR.ASSGN(lhs, IR.LIT lit)]
	    | S.E_Select(x, fld) => raise Fail "FIXME"
            | S.E_Apply _ => raise Fail "unexpected E_Apply"
            | S.E_Prim(f, tyArgs, args, ty) => let
                val args' = List.map (lookup env) args
                in
                  TranslateBasis.translate (lhs, f, tyArgs, args')
                end
            | S.E_Tensor(args, _) => [IR.ASSGN(lhs, IR.CONS(List.map (lookup env) args, IR.Var.ty lhs))]
            | S.E_Seq(args, _) => [IR.ASSGN(lhs, IR.SEQ(List.map (lookup env) args, IR.Var.ty lhs))]
            | S.E_Slice(x, indices, ty) => let
                val x = lookup env x
                val mask = List.map isSome indices
                fun cvt NONE = NONE
                  | cvt (SOME x) = SOME(lookup env x)
                val indices = List.mapPartial cvt indices
                in
                  if List.all (fn b => b) mask
                    then [IR.ASSGN(lhs, IR.OP(Op.TensorSub(IR.Var.ty x), x::indices))]
                    else [IR.ASSGN(lhs, IR.OP(Op.Slice(IR.Var.ty x, mask), x::indices))]
                end
            | S.E_Coerce{srcTy, dstTy, x} => (case (srcTy, dstTy)
                 of (Ty.T_Int, Ty.T_Tensor _) =>
                      [IR.ASSGN(lhs, IR.OP(Op.IntToReal, [lookup env x]))]
                  | (Ty.T_Sequence(ty, SOME n), Ty.T_Sequence(_, NONE)) =>
                      [IR.ASSGN(lhs, IR.OP(Op.MkDynamic(cvtTy ty, n), [lookup env x]))]
                  | (Ty.T_Field _, Ty.T_Field _) =>
                    (* change in continuity is a no-op *)
                      [IR.ASSGN(lhs, IR.VAR(lookup env x))]
                  | _ => raise Fail(concat[
                        "unsupported type coercion: ", Ty.toString srcTy,
                        " ==> ", Ty.toString dstTy
                      ])
                (* end case *))
            | S.E_LoadSeq(ty, nrrd) => [IR.ASSGN(lhs, IR.OP(Op.LoadSeq(cvtTy ty, nrrd), []))]
            | S.E_LoadImage(_, nrrd, info) => [IR.ASSGN(lhs, IR.OP(Op.LoadImage(DstTy.ImageTy info, nrrd), []))]
          (* end case *))

  (* add nodes to save the strand state, followed by an exit node *)
    fun saveStrandState (env, (srcState, dstState), exit) = let
          val stateOut = List.map (lookup env) srcState
          fun save (x, x', cfg) = IR.CFG.appendNode (cfg, IR.Node.mkSAVE(x, x'))
          in
            IR.CFG.appendNode (
              ListPair.foldlEq save IR.CFG.empty (dstState, stateOut),
              exit)
          end
(*DEBUG*)handle ex => raise ex

    fun cvtBlock (state, env : env, joinStk, S.Block stms) = let
          fun cvt (env : env, cfg, []) = (cfg, env)
            | cvt (env, cfg, stm::stms) = (case stm
                 of S.S_Var(x, NONE) => let
                      val x' = newVar x
                      in
                        cvt (VMap.insert (env, x, x'), cfg, stms)
                      end
		  | S.S_Var(x, SOME e) => let
                      val x' = newVar x
                      val assigns = cvtExp (env, x', e)
		      in
                        recordAssign (joinStk, x, x');
                        cvt (
                          VMap.insert(env, x, x'),
                          IR.CFG.concat(cfg, IR.CFG.mkBlock assigns),
                          stms)
		      end
                  | S.S_Assign(lhs, rhs) => let
                      val lhs' = newVar lhs
                      val assigns = cvtExp (env, lhs', rhs)
                      in
(*
print "doAssign\n";
*)
                        recordAssign (joinStk, lhs, lhs');
                        cvt (
                          VMap.insert(env, lhs, lhs'),
                          IR.CFG.concat(cfg, IR.CFG.mkBlock assigns),
                          stms)
                      end
                  | S.S_IfThenElse(x, b0, b1) => let
                      val x' = lookup env x
                      val join as JOIN{nd=joinNd, ...} = newJoin (env, 2)
                      val (cfg0, _) = cvtBlock (state, env, (0, join)::joinStk, b0)
                      val (cfg1, _) = cvtBlock (state, env, (1, join)::joinStk, b1)
                      val cond = IR.Node.mkCOND x'
                      fun addEdgeToJoin nd = (case IR.Node.kind nd
                             of IR.EXIT{succ, ...} => (
                                  succ := SOME joinNd;
                                  IR.Node.setPred (joinNd, nd))  (* will be converted to fake later *)
                              | _ => IR.Node.addEdge(nd, joinNd)
                            (* end case *))
                    (* package the CFG the represents the conditional (cond, two blocks, and join) *)
(* QUESTION: under what conditions do we insert an UNREACHABLE exit node?  Is it when there
 * are no real predecessors to the join and the join stack is empty?
 *)
                      val condCFG = (
                            if IR.CFG.isEmpty cfg0
                              then (
                                IR.Node.setTrueBranch (cond, joinNd);
                                IR.Node.setPred (joinNd, cond))
                              else (
                                IR.Node.setTrueBranch (cond, IR.CFG.entry cfg0);
                                IR.Node.setPred (IR.CFG.entry cfg0, cond);
                                addEdgeToJoin (IR.CFG.exit cfg0));
                            if IR.CFG.isEmpty cfg1
                              then (
                                IR.Node.setFalseBranch (cond, joinNd);
                                IR.Node.setPred (joinNd, cond))
                              else (
                                IR.Node.setFalseBranch (cond, IR.CFG.entry cfg1);
                                IR.Node.setPred (IR.CFG.entry cfg1, cond);
                                addEdgeToJoin (IR.CFG.exit cfg1));
                            IR.CFG{entry = cond, exit = joinNd})
                      val env = commitJoin (joinStk, join)
                      in
                        cvt (env, IR.CFG.concat (cfg, condCFG), stms)
                      end
                  | S.S_New(strandId, args) => let
                      val nd = IR.Node.mkNEW{
                              strand = strandId,
                              args = List.map (lookup env) args
                            }
                      in
                        cvt (env, IR.CFG.appendNode (cfg, nd), stms)
                      end
                  | S.S_Continue => (
                      killPath joinStk;
                      (IR.CFG.concat (cfg, saveStrandState (env, state, IR.Node.mkACTIVE())), env))
                  | S.S_Die => (
                      killPath joinStk;
                      (IR.CFG.appendNode (cfg, IR.Node.mkDIE ()), env))
                  | S.S_Stabilize => (
                      killPath joinStk;
                      (IR.CFG.concat (cfg, saveStrandState (env, state, IR.Node.mkSTABILIZE())), env))
                  | S.S_Return _ => raise Fail "unexpected return"
                  | S.S_Print args => let
                      val args = List.map (lookup env) args
                      val nd = IR.Node.mkMASSIGN([], Op.Print(List.map IR.Var.ty args), args)
                      in
                        cvt (env, IR.CFG.appendNode (cfg, nd), stms)
                      end
                (* end case *))
          in
            cvt (env, IR.CFG.empty, stms)
          end
(*DEBUG*)handle ex => raise ex

    fun cvtFragmentBlock (env0, prefixCFG, blk) = let
          val (cfg, env) = cvtBlock (([], []), env0, [], blk)
          val cfg = IR.CFG.concat(prefixCFG, cfg)
          val entry = IR.Node.mkENTRY ()
        (* the live variables out are those that were not live coming in *)
          val liveOut = VMap.foldli
                (fn (x, x', xs) => if VMap.inDomain(env0, x) then xs else x'::xs)
                  [] env
          val exit = IR.Node.mkFRAGMENT liveOut
          in
            if IR.CFG.isEmpty cfg
              then IR.Node.addEdge (entry, exit)
              else (
                IR.Node.addEdge (entry, IR.CFG.entry cfg);
                IR.Node.addEdge (IR.CFG.exit cfg, exit));
            (IR.CFG{entry = entry, exit = exit}, env)
          end
(*DEBUG*)handle ex => raise ex

    fun cvtMethod (loadGlobals, env, name, state, svars, blk) = let
        (* load the globals into fresh variables *)
          val (loadGlobsCFG, env) = loadGlobals env
        (* load the state into fresh variables *)
          val (env, loadCFG) = let
              (* allocate shadow variables for the state variables *)
                val (env, stateIn) = freshVars (env, state)
                fun load (x, x') = IR.ASSGN(x, IR.STATE x')
                val cfg = IR.CFG.mkBlock (ListPair.map load (stateIn, svars))
                in
                  (env, IR.CFG.concat(loadGlobsCFG, cfg))
                end
        (* convert the body of the method *)
          val (cfg, env) = cvtBlock ((state, svars), env, [], blk)
        (* add the entry/exit nodes *)
          val entry = IR.Node.mkENTRY ()
          val loadCFG = IR.CFG.prependNode (entry, loadCFG)
          val exit = (case name
                 of StrandUtil.Initially => IR.Node.mkACTIVE ()
                  | StrandUtil.Update => IR.Node.mkACTIVE ()
                  | StrandUtil.Stabilize => IR.Node.mkRETURN []
                (* end case *))
          val body = IR.CFG.concat (loadCFG, cfg)
(*DEBUG**val _ = prEnv (StrandUtil.nameToString name, env);*)
(* FIXME: the following code doesn't work properly *)
          val body = if IR.Node.hasSucc(IR.CFG.exit body)
                then IR.CFG.concat (body, saveStrandState (env, (state, svars), exit))
                else IR.CFG{entry = IR.CFG.entry body, exit = exit}
          in
            IR.Method{
                name = name,
                body = body
              }
          end
(*DEBUG*)handle ex => (print(concat["error in cvtMethod(", StrandUtil.nameToString name, ", ...)\n"]); raise ex)

  (* convert the initially code *)
    fun cvtInitially (loadGlobals, S.Initially{isArray, rangeInit, create, iters}) = let
          val (loadCFG, env) = loadGlobals VMap.empty
          val S.C_Create{argInit, name, args} = create
          fun cvtIter ({param, lo, hi}, (env, iters)) = let
                val param' = newVar param
                val env = VMap.insert (env, param, param')
                val iter = (param', lookup env lo, lookup env hi)
                in
                  (env, iter::iters)
                end
          val (cfg, env) = cvtFragmentBlock (env, loadCFG, rangeInit)
          val (env, iters) = List.foldl cvtIter (env, []) iters
          val (argInitCFG, env) = cvtFragmentBlock (env, IR.CFG.empty, argInit)
          in
            IR.Initially{
                isArray = isArray,
                rangeInit = cfg,
                iters = List.rev iters,
                create = (argInitCFG, name, List.map (lookup env) args)
              }
          end
(*DEBUG*)handle ex => raise ex

  (* a function for generating a block of assignments to load globals *)
    fun loadGlobs globs env = let
          fun load (env, [], stms) = (IR.CFG.mkBlock(List.rev stms), env)
            | load (env, (x, x')::globs, stms) = let
                val x'' = newVar x
                val stm = IR.ASSGN(x'', IR.GLOBAL x')
                val env = VMap.insert (env, x, x'')
                in
                  load (env, globs, stm::stms)
                end
          in
            load (env, globs, [])
          end

    fun cvtInputs (inputInit, inputs) = let
          val (initBlk, env) = cvtBlock (([], []), VMap.empty, [], inputInit)
          fun cvt ((x, inp), (gvs, stms)) = let
                val x' = newVar x
                val gx = IR.GlobalVar.new(
                        true,
                        SV.nameOf x,
                        cvtTy(SV.typeOf x))
                val rhs = (case VMap.find(env, x)
                       of SOME dflt => IR.OP(Op.InputWithDefault(Inputs.map cvtTy inp), [dflt])
                        | NONE => IR.OP(Op.Input(Inputs.map cvtTy inp), [])
                      (* end case *))
                val stms =  IR.ASSGN(x', rhs) :: IR.GASSGN(gx, x') :: stms
                in
                  ((x, gx)::gvs, stms)
                end
          val (gvs, stms) = List.foldr cvt ([], []) inputs
          val cfg = IR.CFG.appendBlock (initBlk, stms)
          val cfg = IR.CFG.prependNode (IR.Node.mkENTRY(), cfg)
          val cfg = IR.CFG.appendNode (cfg, IR.Node.mkRETURN [])
          in
            (cfg, gvs)
          end

  (* convert Simple globals to HighIR globals and return a function that generates
   * an initial binding of globals to local shadow variables.
   *)
    fun cvtGlobals globals = let
          fun cvt x = let
                val gx = IR.GlobalVar.new(
                        false,
                        SV.nameOf x,
                        cvtTy(SV.typeOf x))
                in
                  (x, gx)
                end
          in
            List.map cvt globals
          end

    fun translate prog = let
	  val S.Program{
		  props, consts, inputs, constInit, globals, funcs, init, strand, create, update
		} = prog
          val (inputInit, inputGlobs) = cvtInputs (inputDefaults, inputs)
          val globals = cvtGlobals globals
        (* create the global initialization code *)
          val globalInit = let
              (* we start by loading the input globals, since they may be needed to compute the
               * other globals
               *)
                val (cfg, env) = loadGlobs inputGlobs VMap.empty
                val (globBlk, env) = cvtBlock (([], []), env, [], globalInit)
              (* build a sequence of statements for initializing the IR globals *)
                val saveGlobsBlk = let
                      fun saveGlob (x, gx) = let
                            val x' = lookup env x (* the local variable that holds the global *)
                            in
                              IR.GASSGN(gx, x')
                            end
                      in
                        IR.CFG.mkBlock (List.map saveGlob globals)
                      end
                val cfg = IR.CFG.prependNode (IR.Node.mkENTRY(), cfg)
                val cfg = IR.CFG.concat(cfg, globBlk)
                val cfg = IR.CFG.concat(cfg, saveGlobsBlk)
                val cfg = IR.CFG.appendNode (cfg, IR.Node.mkRETURN [])                
                in
                  cfg
                end
          val loadGlobals = loadGlobs (inputGlobs @ globals)
          val init = cvtInitially (loadGlobals, init)
          fun cvtStrand (S.Strand{name, params, state, stateInit, methods}) = let
              (* extend the global environment with the strand's parameters *)
                val (env, params) = let
                      fun cvtParam (x, (env, xs)) = let
                            val x' = newVar x
                            in
                              (VMap.insert(env, x, x'), x'::xs)
                            end
                      val (env, params) = List.foldl cvtParam (VMap.empty, []) params
                      in
                        (env, List.rev params)
                      end
              (* create the state variables *)
                val svars = let
                      fun newSVar x = IR.StateVar.new (
                            SV.kindOf x = SV.StrandOutputVar,
                            SV.nameOf x, cvtTy(SV.typeOf x))
                      in
                        List.map newSVar state
                      end
              (* convert the state initialization code *)
                val (stateInit, env) = let
                    (* load globals into local variables *)
                      val (loadGlobsCFG, env) = loadGlobals env
                      val (cfg, env) = cvtBlock (([], []), env, [], stateInit)
                      val cfg = IR.CFG.concat(loadGlobsCFG, cfg)
                      val cfg = IR.CFG.prependNode (IR.Node.mkENTRY(), cfg)
                      val cfg = IR.CFG.concat (cfg,
                            saveStrandState (env, (state, svars), IR.Node.mkSINIT()))
                      in
                        (cfg, env)
                      end
                fun cvtMeth (S.Method(name, blk)) =
                      cvtMethod (loadGlobals, env, name, state, svars, blk)
                in
                  IR.Strand{
                      name = name,
                      params = params,
                      state = svars,
                      stateInit = stateInit,
                      methods = List.map cvtMeth methods
                    }
                end
          val prog = IR.Program{
                  props = props,
                  globals = List.map #2 (inputGlobs @ globals),
                  inputInit = inputInit,
                  globalInit = globalInit,
                  initially = init,
                  strands = List.map cvtStrand strands
                }
          in
            Census.init prog;
            prog
          end

  end

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