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 3165, Sun Mar 29 19:06:39 2015 UTC revision 3166, Sun Mar 29 20:00:49 2015 UTC
# Line 48  Line 48 
48      fun transitionToString(testreplace,a,b)=(case testreplace      fun transitionToString(testreplace,a,b)=(case testreplace
49          of 0=> 1          of 0=> 1
50          | 2 => (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)          |_ =>(print(String.concat["\nReplaced:",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 63  Line 63 
63      fun  einapptostring (body,a,b)=(case testlift      fun  einapptostring (body,a,b)=(case testlift
64          of 0=>1          of 0=>1
65          | 2=> (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)          |_ =>(print(String.concat["\nLifted",P.printbody body]);1)
67          (*end case*))          (*end case*))
68    
69    
# Line 265  Line 265 
265          val einApp1=mkEinApp(ein1,args')          val einApp1=mkEinApp(ein1,args')
266          val rtn1=(FArg,einApp1)          val rtn1=(FArg,einApp1)
267          val rtn=code@[rtn1,rtn0]          val rtn=code@[rtn1,rtn0]
268          val _= einapptostring (p,rtn1,rtn0)          val _= einapptostring (originalb,rtn1,rtn0)
269          in          in
270              rtn              rtn
271          end          end
# Line 289  Line 289 
289                  => replaceProbe(0,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 as [(v,_,_)],p as (E.Probe((E.Conv(_,alpha,_,dx),_))))=>(case
293                        (List.find (fn x => x = v) dx)
294                        of NONE=>  checkConst(alpha@dx,(1,e,p,sx))
295                        (*need to push summation to lifted exp rather than transform exp.*)
296                        | SOME _=> replaceProbe(1,e, p, sx)
297                        (*end case*))*)
298              | E.Sum(sx,E.Probe p)              | E.Sum(sx,E.Probe p)
299                  => replaceProbe(0,e,E.Probe p, sx)                  => replaceProbe(0,e,E.Probe p, sx)
300              | E.Sum(sx,E.Prod[eps,E.Probe p])              | E.Sum(sx,E.Prod[eps,E.Probe p])

Legend:
Removed from v.3165  
changed lines
  Added in v.3166

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