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

SCM Repository

[diderot] Diff of /branches/charisee_dev/src/compiler/high-to-mid/ProbeEin.sml
ViewVC logotype

Diff of /branches/charisee_dev/src/compiler/high-to-mid/ProbeEin.sml

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

revision 3093, Wed Mar 18 01:56:17 2015 UTC revision 3094, Wed Mar 18 04:45:43 2015 UTC
# Line 38  Line 38 
38      *)      *)
39    
40      val testing=0      val testing=0
41      val testlift=1      val testlift=0
42      val cnt = ref 0      val cnt = ref 0
43    
44      fun printEINAPP e=MidToString.printEINAPP e      fun printEINAPP e=MidToString.printEINAPP e
# Line 47  Line 47 
47    
48      fun transitionToString(testreplace,a,b)=(case testreplace      fun transitionToString(testreplace,a,b)=(case testreplace
49          of 0=> 1          of 0=> 1
50          | _ => (print(String.concat["\n\n\n Replace probe:\n",P.printbody a,"\n=>",P.printbody b]);1)          | 2 => (print(String.concat["\n\n\n Replace probe:\n",P.printbody a,"\n=>",P.printbody b]);1)
51            |_ =>(print(String.concat["\n",P.printbody a]);1)
52          (*end case*))          (*end case*))
53      fun mkEin(params,index,body)=E.EIN{params=params, index=index,body=body}      fun mkEin(params,index,body)=E.EIN{params=params, index=index,body=body}
54      fun mkEinApp(rator,args)=DstIL.EINAPP(rator,args)      fun mkEinApp(rator,args)=DstIL.EINAPP(rator,args)
# Line 61  Line 62 
62          (*end case*))          (*end case*))
63      fun  einapptostring (body,a,b)=(case testlift      fun  einapptostring (body,a,b)=(case testlift
64          of 0=>1          of 0=>1
65          | _=> (print(String.concat["\n lift probe of ",P.printbody body,"=>\n\t", printEINAPP a,  "&\n\t", printEINAPP b]);1)          | 2=> (print(String.concat["\n lift probe of ",P.printbody body,"=>\n\t", printEINAPP a,  "&\n\t", printEINAPP b]);1)
66            |_ =>(print(String.concat["\n",P.printbody body]);1)
67          (*end case*))          (*end case*))
68    
69    
# Line 280  Line 282 
282          | checkConst ((_ ::es),a)=checkConst(es,a)          | checkConst ((_ ::es),a)=checkConst(es,a)
283          fun rewriteBody b=(case b          fun rewriteBody b=(case b
284              of E.Probe(E.Conv(_,_,_,[]),_)              of E.Probe(E.Conv(_,_,_,[]),_)
285                  => replaceProbe(1,e,b, [])                  => replaceProbe(0,e,b, [])
286              | E.Probe(E.Conv (_,alpha,_,dx),_)              | E.Probe(E.Conv (_,alpha,_,dx),_)
287                  => checkConst(alpha@dx,(0,e,b,[]))                  => checkConst(alpha@dx,(0,e,b,[]))
288              | E.Sum(sx,p as E.Probe(E.Conv(_,_,_,[]),_))              | E.Sum(sx,p as E.Probe(E.Conv(_,_,_,[]),_))
289                  => replaceProbe(1,e,p, sx)                  => replaceProbe(0,e,p, sx)
290              | E.Sum(sx,p as E.Probe(E.Conv(_,[],_,dx),_))              | E.Sum(sx,p as E.Probe(E.Conv(_,[],_,dx),_))
291                  => checkConst(dx,(0,e,p,sx))                  => checkConst(dx,(0,e,p,sx))
292              | E.Sum(sx,E.Probe p)              | E.Sum(sx,E.Probe p)
293                  => replaceProbe(1,e,E.Probe p, sx)                  => replaceProbe(0,e,E.Probe p, sx)
294              | E.Sum(sx,E.Prod[eps,E.Probe p])              | E.Sum(sx,E.Prod[eps,E.Probe p])
295                  => replaceProbe(1,e,E.Probe p,sx)                  => replaceProbe(0,e,E.Probe p,sx)
296              | _ => [e]              | _ => [e]
297              (* end case *))              (* end case *))
298          in          in

Legend:
Removed from v.3093  
changed lines
  Added in v.3094

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