Module Syntax


module Syntax: sig .. end
This module contains the AST.


Syntax



type e = private
| SExp of s
| Let of plab * Location.LSet.t option * var * s * e
| Mask of plab * Location.LSet.t option * e
expressions

type s = private
| Val of v
| App of plab * v * v
| New of plab * Location.Loc.t
| Read of p
| Write of plab * p * v
| MethodCall of plab * p * v
serious expressions

type v = private
| Var of plab * var
| Lam of plab * var * var * e
| Undef of plab
| Pointer of plab * Location.P.t
| Int of plab * int
values

type p = private
| Prop of plab * v * label
type var 
variables
type label 
labels
type plab 
program labels

Expressions


val e_sexp : s -> e
Creates an expression from a serious expression
val e_let : var -> s -> e -> e
Creates a let expression
val e_mask : Location.LSet.t -> e -> e
Creates a mask expression (Maske)
val string_of_e : e -> string
Returns a string representation of an expression
val string_of_e_with_plabs : e -> string
Returns an expression together with it's program locations as a string

Serious expressions


val s_val : v -> s
Creates a serious expression from a value
val s_app : v -> v -> s
Creates a serious expression (application)
val s_new : unit -> s
Creates a serious expression (new)
val s_new_loc : Location.Loc.t -> s
Creates a serious expression (new) with the given abstract location
val s_read : v -> label -> s
Creates a serious expression (read)
val s_write : v -> label -> v -> s
Creates a serious expression (write)
val s_mcall : v -> label -> v -> s
Creates a serious expression (method call)

Values


val v_var : var -> v
Creates a value (var)
val v_lam : var -> var -> e -> v
Creates a value (lambda expression)
val v_undef : unit -> v
Creates a value (undefined)
val v_int : int -> v
Creates an integer as a value
val string_of_v : v -> string
Returns a string representation of a value. Depending on the global option with_label then the program labels are part of the result string.
val string_of_lam : var -> var -> e -> string
Returns a string represenation of a lambda expression
val string_of_v_with_plabs : v -> string
Returns a value together with it's program locations as a string
val string_of_lam_with_plabs : var -> var -> e -> string
Returns a lambda expression together with it's program locations as a string
val string_of_v_without_plabs : v -> string
Returns a string representation of a value

Variables


val create_var : string -> var
creates a new variable from a string
val compare_var : var -> var -> int
compares to variables.
val string_of_var : var -> string
Returns a string representation of a variable

Labels


val create_label : string -> label
creates a new label
val compare_label : label -> label -> int
comapres to labels
val string_of_label : label -> string
Returns a string representation of a variable

Program labels


val create_plab : unit -> plab
create a program label
val compare_plab : plab -> plab -> int
comapre to program labels
val string_of_plab : plab -> string
Returns a string represenation of a program label
val e_get_plab : e -> plab
returns the program label
val s_get_plab : s -> plab
returns the program label
val v_get_plab : v -> plab
returns the program label
val p_get_plab : p -> plab
returns the program label
val collect_locs : e -> Location.LSet.t
collects all locations from a program

Free Variables


module VarSet: ExtSSet.S  with type elt = var
val free_e : e -> VarSet.t
free_e e computes the free variables of e and returns it as a set.
val free_s : s -> VarSet.t
free_s s computes the free variables of s and returns it as a set.
val free_v : v -> VarSet.t
free_e v computes the free variables of v and returns it as a set.
module LabelSet: ProglangUtils.ExtSSet.S 
module LabelSetRef: sig .. end 
  with type elt = label
val set_print_with_label : unit -> unit
val set_print_without_label : unit -> unit