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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/basis/basis-vars.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/basis/basis-vars.sml

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

revision 4587, Sun Sep 18 19:58:38 2016 UTC revision 4588, Mon Sep 19 02:13:20 2016 UTC
# Line 889  Line 889 
889      val set_stable = mkSetFn N.set_stable      val set_stable = mkSetFn N.set_stable
890      end      end
891    
892      (* functions for getting the number of strands in a set *)
893        local
894          fun mkNumberOf name = monoVar (name, [] --> Ty.T_Int)
895        in
896        val fn_numActive = mkNumberOf N.fn_numActive
897        val fn_numStable = mkNumberOf N.fn_numStable
898        val fn_numStrands = mkNumberOf N.fn_numStrands
899        end (* local *)
900    
901    (* reduction operators *)    (* reduction operators *)
902      local      local
903        fun reduction (name, elemTy) =        fun reduction (name, elemTy) =
# Line 896  Line 905 
905      in      in
906      val red_all         = reduction (N.fn_all, Ty.T_Bool)      val red_all         = reduction (N.fn_all, Ty.T_Bool)
907      val red_exists      = reduction (N.fn_exists, Ty.T_Bool)      val red_exists      = reduction (N.fn_exists, Ty.T_Bool)
908  (* FIXME: allow max on integers *)      val red_max_i       = reduction (N.fn_max, Ty.T_Int)
909      val red_max         = reduction (N.fn_max, Ty.realTy)      val red_max_r       = reduction (N.fn_max, Ty.realTy)
910      val red_mean        = reduction (N.fn_mean, Ty.realTy)      val red_mean        = reduction (N.fn_mean, Ty.realTy)
911  (* FIXME: allow min on integers *)      val red_min_i       = reduction (N.fn_min, Ty.T_Int)
912      val red_min         = reduction (N.fn_min, Ty.realTy)      val red_min_r       = reduction (N.fn_min, Ty.realTy)
913      val red_product     = reduction (N.fn_product, Ty.realTy)      val red_product_i   = reduction (N.fn_product, Ty.T_Int)
914  (* FIXME: allow sum on int and tensor types *)      val red_product_r   = reduction (N.fn_product, Ty.realTy)
915      val red_sum         = reduction (N.fn_sum, Ty.realTy)  (* FIXME: allow sum on tensor types *)
916        val red_sum_i       = reduction (N.fn_sum, Ty.T_Int)
917        val red_sum_r       = reduction (N.fn_sum, Ty.realTy)
918      val red_variance    = reduction (N.fn_variance, Ty.realTy)      val red_variance    = reduction (N.fn_variance, Ty.realTy)
919      end (* local *)      end (* local *)
920    
# Line 950  Line 961 
961    (* boolean and *)    (* boolean and *)
962      val and_b = monoVar (Atom.atom "$and", [Ty.T_Bool, Ty.T_Bool] --> Ty.T_Bool)      val and_b = monoVar (Atom.atom "$and", [Ty.T_Bool, Ty.T_Bool] --> Ty.T_Bool)
963    
   (* strand-set operations *)  
     local  
       fun mkNumberOf name = monoVar (Atom.atom name, [] --> Ty.T_Int)  
       fun mkTest name strandTy = monoVar (Atom.atom name, [strandTy] --> Ty.T_Bool)  
     in  
     val numActive = mkNumberOf "$numActive"  
     val numStable = mkNumberOf "$numStable"  
     val numStrands = mkNumberOf "$numStrands"  
     val isActive = mkTest "$active"  
     val isStable = mkTest "$stable"  
     end (* local *)  
   
964      end (* local *)      end (* local *)
965    
966    end    end

Legend:
Removed from v.4587  
changed lines
  Added in v.4588

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