[/] [trunk/] [src/] [cmdlang/] [ntautil.sml] - Diff 18 ⟶ 19

Diff between revs 18 and 19
Rev 18 Rev 19
Line 1... Line 1...
(* $Id: ntautil.sml 18 2007-11-20 03:29:43Z tbourke $ *)
(* $Id: ntautil.sml 19 2007-11-27 00:20:37Z tbourke $ *)
 
 
(* TODO:
(* TODO:
    * Make error handling more descriptive:
    * Make error handling more descriptive:
        -catch the exception
        -catch the exception
        -name the template and state
        -name the template and state
Line 191... Line 191...
                              guard=guard, sync=sync, update=update,
                              guard=guard, sync=sync, update=update,
                              color=color, comments=comments,
                              color=color, comments=comments,
                              position=position, nails=nails})
                              position=position, nails=nails})
        end
        end
 
 
 
  fun locsWithoutPositions (P.Template {locations,...}) = let
 
      val add = IntBinarySet.add
 
      fun f (P.Location {id=P.LocId i, position=NONE, ...}, s) = add (s, i)
 
        | f (_, s) = s
 
      val locs = foldl f IntBinarySet.empty locations
 
    in fn (P.LocId i) => IntBinarySet.member (locs, i) end
 
 
  fun stripTransitionIds (P.Template  {name, parameter, declaration, initial,
  fun stripTransitionIds (P.Template  {name, parameter, declaration, initial,
                                       locations, transitions}) =
                                       locations, transitions}) =
      P.Template {name=name, parameter=parameter, declaration=declaration,
      P.Template {name=name, parameter=parameter, declaration=declaration,
                  initial=initial, locations=locations,
                  initial=initial, locations=locations,
                  transitions=map (setTransId NONE) transitions}
                  transitions=map (setTransId NONE) transitions}
                  transitions=map (setTransId NONE) transitions}
                  transitions=map (setTransId NONE) transitions}