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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/einTest/testCheck.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/einTest/testCheck.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2496, Tue Oct 29 05:29:46 2013 UTC revision 2497, Wed Oct 30 17:29:20 2013 UTC
# Line 4  Line 4 
4    
5  structure E = Ein  structure E = Ein
6  structure P = Printer  structure P = Printer
7  structure C=TypeCheck  structure TE= TypeEin
8  structure Op=Operators  structure PE= PhaseEin
9    structure F=ExamplesF
10    structure N = NormalizeEin
11    
12  in  in
13    
14    
15  fun tester(e1,t)=  
16      let val m=C.printType(C.checker (e1,t))  fun tester(e,phase,expect)=
17      in      let
18  (P.printerE e1; print m;print "\n")  
19        val b= PE.checkPhase(e,phase)
20        in if(b=expect) then(
21              if(b=true) then (let
22                 val p=print(P.printerE e)
23                 val a1=TE.checker(e,phase)
24                 val x= TE.printTy(a1)
25                 val n=N.normalize(e)
26                 val a2=TE.checker(n,phase)
27    
28    in (print "==>";print(P.printerE n);TE.printTy(a1))end )
29             else print "")
30            else (print(P.printerE e);print "\n Failed")
31      end      end
32    
33    
34  val addTensor = (  (*
35      E.EIN{  
36      params = [E.TEN, E.TEN],  val r1=List.map tester [(F.probe1,1,true),(F.probe1,2,false),(F.probe2,1,true),(F.probe3,2,false),(F.probe4,1,true),(F.probe5,2,false),(F.probe6,1,true),(F.probe7,2,false),(F.probe8,1,true),(F.probe8,2,false)]
     index = [],  
     body = E.Add[E.Tensor(0, []),E.Tensor(1, [])]  
     },1)  
37    
38    val r1=List.map tester [(F.sum1,1,true),(F.sum2,1,true),(F.sum3,1,true),(F.sum4,1,true),(F.sum5,1,true),(F.sum6,1,true),(F.sum7,1,true),(F.sum8,1,true),(F.sum9,1,true)]
39    
40    *)
41    
 val r=tester(addTensor)  
42    
43    val r1=List.map tester [(F.sumapply1,1,true),(F.sumapply2,1,true),(F.sumapply3,1,true),(F.sumapply4,1,true),(F.sumapply5,1,true),(F.sumapply6,1,true),(F.sumapply7,1,true)]
44    
45  end; (* local *)  end; (* local *)
46    

Legend:
Removed from v.2496  
changed lines
  Added in v.2497

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