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

SCM Repository

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

Diff of /branches/charisee/src/compiler/high-to-mid/splitEin.sml

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

revision 2614, Fri May 9 19:23:07 2014 UTC revision 2615, Wed May 14 00:22:49 2014 UTC
# Line 165  Line 165 
165      val n=length(index)      val n=length(index)
166      val default=([],(params,E.Sum(sx,(E.Prod list1)),args))      val default=([],(params,E.Sum(sx,(E.Prod list1)),args))
167    
168       fun found(E.Sum(sx',e'),rest,ix)=let       fun found(sx',e',rest,ix)=let
169          val (lft, newbies1,params1,args1) =handleGen(params,index@ix,[(E.Sum(sx',e'),2)])          val (lft, newbies1,params1,args1) =handleGen(params,index@ix,[(E.Sum(sx',e'),2)])
170          val (p',b',args')= SP.cleanParams(E.Sum(sx,E.Prod(rest@lft)), params@params1, args@args1)          val (p',b',args')= SP.cleanParams(E.Sum(sx,E.Prod(rest@lft)), params@params1, args@args1)
171          val z=List.map (fn(e)=> cleanA(params,args,e)) newbies1          val z=List.map (fn(e)=> cleanA(params,args,e)) newbies1
# Line 174  Line 174 
174          end          end
175       fun filterP([],rest)=default       fun filterP([],rest)=default
176         | filterP (E.Sum(sxx,e)::es,rest)=(case F.countSx(sx,e)         | filterP (E.Sum(sxx,e)::es,rest)=(case F.countSx(sx,e)
177              of (1,ix)=>found(E.Sum(sxx,e),rest@es,ix)              of (1,ix)=>found(sxx,e,rest@es,ix)
178              | _ => filterP(es,rest))              | _ => filterP(es,rest))
179         | filterP(e::es,rest)=filterP(es,rest@[e])         | filterP(e::es,rest)=filterP(es,rest@[e])
180    
181      fun ck([],_)= filterP(list1,[])      fun ck([],_)= filterP(list1,[])
182        | ck((E.V i, _, ub)::es,count)=if(i=count) then ck(es,count+1) else default        | ck((E.V i, _, ub)::es,count)=if(i=count) then ck(es,count+1) else default
183          | ck _ =raise Fail "Non-Variable index in summation expression"
184      in      in
185          ck(sx,n)          ck(sx,n)
186      end      end

Legend:
Removed from v.2614  
changed lines
  Added in v.2615

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