--- trunk/src/basis/basis.sml 2010/05/24 20:41:18 75 +++ trunk/src/basis/basis.sml 2010/05/24 22:31:49 78 @@ -6,8 +6,11 @@ * Type definitions for Basis functions. *) -structure Basis = - struct +structure Basis : sig + + val env : Env.env + + end = struct local structure N = BasisNames structure Ty = Types @@ -69,7 +72,7 @@ in [field(k, d, dd), tensor[d]] --> Ty.T_Tensor dd end)), - (N.op_at, all([DK, NK, SK], + (N.op_D, all([DK, NK, SK], fn [Ty.DIFF k, Ty.DIM d, Ty.SHAPE dd] => let val k0 = Ty.DiffVar(k, 0) val km1 = Ty.DiffVar(k, ~1) @@ -121,5 +124,16 @@ (N.kn_tent, ty(Ty.T_Kernel(Ty.DiffConst 0))) ] + (* seed the basis environment *) + val env = let + fun ins ((name, ty), env) = let + val x = Var.newPoly (name, AST.BasisVar, ty) + in + Env.insertGlobal (env, name, x) + end + in + List.foldl ins (Env.new()) basis + end + end (* local *) end
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: ) + end + in + List.foldl ins (Env.new()) basis + end + end (* local *) end