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

SCM Repository

[diderot] View of /branches/charisee/src/compiler/einTest/testNormalize.sml
ViewVC logotype

View of /branches/charisee/src/compiler/einTest/testNormalize.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2399 - (download) (annotate)
Sun Jul 7 02:22:44 2013 UTC (6 years, 2 months ago) by cchiw
File size: 1462 byte(s)
Tester
(*Test transform function*)
structure  tNormalize = struct

    local
    structure E = Ein
    structure P= Printer
	structure N = NormalizeEin
   structure ExN =ExamplesN
    in

(* Change current to true if you want to test normalize.sml*)

val current=false;


fun test(e)= if(current=false) then print("")
            else (print" \n " ;print(P.printerE(e)); print("     =>  "); print(P.printerE(N.normalize(e)));print" \n ")


fun create(b)= test(E.EIN{params=[], index=[], body=b})


(*-----Test more complicated terms in Normalize Function:normalize.sml---------------*)

val id= List.map test [ExN.dotGrad, ExN.dotCross,ExN.crossGrad,ExN.curlCurl]
val partials=List.map test [ ExN.S6, ExN.S7]
val epsSub=List.map test [ExN.S8,ExN.S9, ExN.S10,ExN.S11, ExN.S12]
(*

(* --------Test Rewrite Rule in Normalize function: normalize.sml--------*)

val rules1= List.map create [ExN.R1,ExN.R2,ExN.R3, ExN.R4,ExN.R5,ExN.R7, ExN.R8, ExN.R9]
(*Test R5 change eps to delts*)
val rule10= List.map create [ExN.R10, ExN.R10b,ExN.R10c,ExN.R10d, ExN.R10e, ExN.R10f]
val eps= List.map test[ExN.S9,ExN.S10,ExN.S11,ExN.S12]
val dels=List.map create [ExN.R11, ExN.R11b, ExN.R11c, ExN.R11d, ExN.R11e, ExN.R11f, ExN.R11g, ExN.R11h, ExN.R11i, ExN.R11j, ExN.R11k ,ExN.R11l, ExN.R11m, ExN.R11n, ExN.R11o ,ExN.R11p, ExN.R11q, ExN.R11r]
val rules3=List.map create [ExN.sR12,ExN.sR13,ExN.sR14, ExN.sR14b, ExN.sR14c]
*)


(*not written R6*)



  end; (* local *)

    end (* local *)

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