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

SCM Repository

[diderot] View of /branches/vis15/src/compiler/common/properties.sml
ViewVC logotype

View of /branches/vis15/src/compiler/common/properties.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3812 - (download) (annotate)
Wed May 4 13:16:31 2016 UTC (2 years, 10 months ago) by jhr
File size: 2416 byte(s)
  working on merge
(* properties.sml
 *
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2015 The University of Chicago
 * All rights reserved.
 *
 * Various properties of Diderot programs that we want to track.
 *)

structure Properties =
  struct

  (* program properties *)
    datatype t
      = HasGlobals                      (* present if the program has global variables *)
      | HasInputs                       (* present if the program has input variables *)
      | StrandArray                     (* present if the strands are organized in a grid *)
      | DynamicSeq                      (* present if strands compute dynamic sequences *)
      | StrandsMayDie                   (* present if strands may die *)
      | HasInitiallyMethod              (* present if there is a user-defined initially method *)
      | HasStabilizeMethod              (* present if there is a user-defined stabilize method *)
      | NewStrands                      (* present if new strands may be created dynamically *)
      | StrandCommunication             (* present if strands read the state of other strands *)
      | GlobalInit			(* present if there is a global initialization block *)
      | GlobalUpdate                    (* present if there is a global update block *)
      | GlobalReduce                    (* present if there is a global reduction (implies GlobalUpdate) *)
      | StrandSets			(* present if there are strand sets in the global update *)

    fun toString HasGlobals = "HasGlobals"
      | toString HasInputs = "HasInputs"
      | toString StrandArray = "StrandArray"
      | toString DynamicSeq = "DynamicSeq"
      | toString StrandsMayDie = "StrandsMayDie"
      | toString HasInitiallyMethod = "HasInitiallyMethod"
      | toString HasStabilizeMethod = "HasStabilizeMethod"
      | toString NewStrands = "NewStrands"
      | toString StrandCommunication = "StrandCommunication"
      | toString GlobalInit = "GlobalInit"
      | toString GlobalUpdate = "GlobalUpdate"
      | toString GlobalReduce = "GlobalReduce"
      | toString StrandSets = "StrandSets"

    fun propsToString [] = "none"
      | propsToString [p] = toString p
      | propsToString (p::props) = String.concatWithMap "," toString props

    fun hasProp (prop : t) = List.exists (fn p => prop = p)

    fun clearProp (prop : t) = List.filter (fn p => (p <> prop))

  end

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