(* 
 File: Expressions.sig

 Interface to arithmetic expressions
*)

signature Expressions =
sig

   type id = string
   type hid = HashTable.hashedstring

   exception cannotcompare
   exception idnotintable

   datatype Aexp =  
      IDENT of string
    | NUM of real
    | INTNUM of int
    | TOP
    | PLUS of Aexp * Aexp
    | DIFF of Aexp * Aexp
    | PROD of Aexp * Aexp
    | QUOT of Aexp * Aexp
    | MIN of Aexp * Aexp
    | RATE of hid

   val expids : ((id * Aexp) list) ref
   val printExpIDs : unit -> unit
   val addExpID : id -> Aexp -> unit
   val getExp : id -> Aexp

   val toString : Aexp -> string
   val lessThan : Aexp * Aexp -> bool
   val lt : Aexp * Aexp -> bool
   val aequals  : Aexp * Aexp -> bool
   val simplify : Aexp -> Aexp

   val flat: Aexp -> bool
   val simple: Aexp -> bool

   val subForIDs: Aexp -> Aexp
   val eval : Aexp -> Aexp

   (* gcla remove from sig later *)
   val factorTops : Aexp -> Aexp

end;





