Module Ast.Syntax

module Lexing : sig ... end
type loc =
  1. | Nowhere
  2. | Location of Lexing.position * Lexing.position * string option
val loc_of_yojson : Yojson.Safe.t -> loc
val yojson_of_loc : loc -> Yojson.Safe.t
val append_loc : loc -> loc -> loc
val append_locs : loc list -> loc
type 'a annotated = {
  1. data : 'a;
  2. loc : loc;
  3. ty : type_expr' option Stdlib.ref;
}
and program = {
  1. template_decls : template_def list;
  2. events : event list;
  3. template_insts : template_instance list;
  4. relations : relation list;
  5. annotations : template_annotation' list;
}
and subprogram = event list * template_instance list * relation list * template_annotation' list
and type_expr = type_expr' annotated
and type_expr' =
  1. | UnitTy
  2. | StringTy
  3. | IntTy
  4. | BoolTy
  5. | EventTy of string annotated
  6. | RecordTy of type_expr record_field list
  7. | ListTy of type_expr'
and expr = expr' annotated
and expr' =
  1. | Unit
  2. | BoolLit of bool
  3. | IntLit of int
  4. | StringLit of string
  5. | Parenthesized of expr
  6. | BinaryOp of expr * expr * binary_op_type
  7. | UnaryOp of expr * unary_op_type
  8. | Identifier of string annotated
  9. | Trigger
  10. | PropDeref of expr * string annotated
  11. | List of expr list
  12. | Range of expr * expr
  13. | Record of expr record_field list
  14. | EventRef of event Stdlib.ref
  15. | Ref of expr Stdlib.ref
and binary_op_type =
  1. | Add
  2. | Sub
  3. | Mult
  4. | Div
  5. | Eq
  6. | NotEq
  7. | GreaterThan
  8. | GreaterOrEqual
  9. | LessThan
  10. | LessOrEqual
  11. | And
  12. | Or
and unary_op_type =
  1. | Minus
  2. | Negation
and 'a record_field = string annotated * 'a
and template_param' = string annotated * type_expr * expr option
and template_def = {
  1. export : event_id list;
  2. params : template_param' list;
  3. export_types : event_label list;
  4. graph : subprogram;
  5. id : string annotated;
}
and template_arg = string annotated * expr
and template_instance = template_instance' annotated
and template_instance' = {
  1. args : template_arg list;
  2. x : event_id list;
  3. tmpl_id : string annotated;
}
and template_annotation = template_annotation' annotated
and template_annotation' =
  1. | IfElse of {
    1. condition : expr;
    2. then_branch : subprogram;
    3. else_branch : subprogram option;
    }
  2. | Foreach of string annotated * expr * subprogram
and event = event' annotated
and event' = {
  1. info : event_info';
  2. io : event_io;
  3. marking : event_marking;
}
and event_id = string annotated
and event_label = string annotated
and event_info' = event_id * event_label
and event_io = event_io' annotated
and event_io' =
  1. | Input of type_expr
  2. | Output of expr
and event_type' =
  1. | InputType
  2. | OutputType
and event_marking = event_marking' annotated
and event_marking' = {
  1. executed : bool annotated;
  2. pending : bool annotated;
  3. included : bool annotated;
  4. value : expr Stdlib.ref;
}
and relation = relation' annotated
and relation' =
  1. | ControlRelation of event_id * expr * event_id * relation_type
  2. | SpawnRelation of event_id * expr * subprogram
and relation_type =
  1. | Condition
  2. | Include
  3. | Exclude
  4. | Milestone
  5. | Response
  6. | Cancel
val annotated_of_yojson : (Yojson.Safe.t -> 'a) -> Yojson.Safe.t -> 'a annotated
val program_of_yojson : Yojson.Safe.t -> program
val subprogram_of_yojson : Yojson.Safe.t -> subprogram
val type_expr_of_yojson : Yojson.Safe.t -> type_expr
val type_expr'_of_yojson : Yojson.Safe.t -> type_expr'
val expr_of_yojson : Yojson.Safe.t -> expr
val expr'_of_yojson : Yojson.Safe.t -> expr'
val binary_op_type_of_yojson : Yojson.Safe.t -> binary_op_type
val unary_op_type_of_yojson : Yojson.Safe.t -> unary_op_type
val record_field_of_yojson : (Yojson.Safe.t -> 'a) -> Yojson.Safe.t -> 'a record_field
val template_param'_of_yojson : Yojson.Safe.t -> template_param'
val template_def_of_yojson : Yojson.Safe.t -> template_def
val template_arg_of_yojson : Yojson.Safe.t -> template_arg
val template_instance_of_yojson : Yojson.Safe.t -> template_instance
val template_instance'_of_yojson : Yojson.Safe.t -> template_instance'
val template_annotation_of_yojson : Yojson.Safe.t -> template_annotation
val template_annotation'_of_yojson : Yojson.Safe.t -> template_annotation'
val event_of_yojson : Yojson.Safe.t -> event
val event'_of_yojson : Yojson.Safe.t -> event'
val event_id_of_yojson : Yojson.Safe.t -> event_id
val event_label_of_yojson : Yojson.Safe.t -> event_label
val event_info'_of_yojson : Yojson.Safe.t -> event_info'
val event_io_of_yojson : Yojson.Safe.t -> event_io
val event_io'_of_yojson : Yojson.Safe.t -> event_io'
val event_type'_of_yojson : Yojson.Safe.t -> event_type'
val event_marking_of_yojson : Yojson.Safe.t -> event_marking
val event_marking'_of_yojson : Yojson.Safe.t -> event_marking'
val relation_of_yojson : Yojson.Safe.t -> relation
val relation'_of_yojson : Yojson.Safe.t -> relation'
val relation_type_of_yojson : Yojson.Safe.t -> relation_type
val yojson_of_annotated : ('a -> Yojson.Safe.t) -> 'a annotated -> Yojson.Safe.t
val yojson_of_program : program -> Yojson.Safe.t
val yojson_of_subprogram : subprogram -> Yojson.Safe.t
val yojson_of_type_expr : type_expr -> Yojson.Safe.t
val yojson_of_type_expr' : type_expr' -> Yojson.Safe.t
val yojson_of_expr : expr -> Yojson.Safe.t
val yojson_of_expr' : expr' -> Yojson.Safe.t
val yojson_of_binary_op_type : binary_op_type -> Yojson.Safe.t
val yojson_of_unary_op_type : unary_op_type -> Yojson.Safe.t
val yojson_of_record_field : ('a -> Yojson.Safe.t) -> 'a record_field -> Yojson.Safe.t
val yojson_of_template_param' : template_param' -> Yojson.Safe.t
val yojson_of_template_def : template_def -> Yojson.Safe.t
val yojson_of_template_arg : template_arg -> Yojson.Safe.t
val yojson_of_template_instance : template_instance -> Yojson.Safe.t
val yojson_of_template_instance' : template_instance' -> Yojson.Safe.t
val yojson_of_template_annotation : template_annotation -> Yojson.Safe.t
val yojson_of_template_annotation' : template_annotation' -> Yojson.Safe.t
val yojson_of_event : event -> Yojson.Safe.t
val yojson_of_event' : event' -> Yojson.Safe.t
val yojson_of_event_id : event_id -> Yojson.Safe.t
val yojson_of_event_label : event_label -> Yojson.Safe.t
val yojson_of_event_info' : event_info' -> Yojson.Safe.t
val yojson_of_event_io : event_io -> Yojson.Safe.t
val yojson_of_event_io' : event_io' -> Yojson.Safe.t
val yojson_of_event_type' : event_type' -> Yojson.Safe.t
val yojson_of_event_marking : event_marking -> Yojson.Safe.t
val yojson_of_event_marking' : event_marking' -> Yojson.Safe.t
val yojson_of_relation : relation -> Yojson.Safe.t
val yojson_of_relation' : relation' -> Yojson.Safe.t
val yojson_of_relation_type : relation_type -> Yojson.Safe.t
val annotate : ?loc:loc -> ?ty:type_expr' option -> 'a -> 'a annotated
val deannotate : 'a annotated -> 'a
val deannotate_list : 'a annotated list -> 'a list
val mk_loc : ?filename:string -> Lexing.position -> Lexing.position -> loc
val mk_pos : ?filename:string -> int -> int -> Lexing.position
val mk_marking : ?executed:bool -> ?pending:bool -> ?included:bool -> ?value:expr' -> unit -> event_marking'
val default_marking : event_marking'
val default_marking_excl : event_marking'
val default_marking_pend : event_marking'
val default_marking_pend_excl : event_marking'
val mk_event : ?marking:event_marking' -> event_info' -> event_io -> event' annotated
val mk_ctrl_relation : from:event_id -> ?guard:expr -> dest:event_id -> relation_type -> relation' annotated
val mk_ctrl_relations : event_id list -> expr -> event_id list -> relation_type -> relation' annotated list
val mk_spawn_relation : from:event_id -> ?guard:expr -> subprogram -> relation' annotated
val mk_spawn_relations : event_id list -> expr -> subprogram -> relation' annotated list
val mk_program : ?template_decls:template_def list -> ?events:event list -> ?template_insts:template_instance list -> ?relations:relation list -> ?annotations:template_annotation' list -> 'a -> program
val to_program : (event list * template_instance list * relation list * template_annotation' list) -> program
val mk_subprogram : ?events:'a list -> ?template_insts:'b list -> ?relations:'c list -> ?annotations:'d list -> 'e -> 'a list * 'b list * 'c list * 'd list
val to_subprogram : program -> event list * template_instance list * relation list * template_annotation' list
val empty_program : program
val empty_subprogram : 'a list * 'b list * 'c list * 'd list
val mk_record : (string * expr') list -> expr' annotated
val get_event_type : event_io' annotated -> event_type'
val show_event_type' : string -> event_type' -> string
val trigger_id : string