Module PdgIndex.Signature

module Signature: sig .. end
What we call a Signature a mapping between keys that represent either a function input or output, and some information.

type in_key = 
| InCtrl (*input control point*)
| InNum of int (*parameters numbered from 1*)
| InImpl of Locations.Zone.t (*key for implicit inputs. Used in function signatures only*)
key for input elements
type out_key = 
| OutRet (*key for the output corresponding to the return*)
| OutLoc of Locations.Zone.t (*key for output locations. used in call signatures only*)
type key = 
| In of in_key
| Out of out_key
a key represents either an input or an output of a function.
type 'info t = {
   in_ctrl : 'info option;
   in_params : (int * 'info) list; (*implicit inputs : Maybe we should use Lmap_bitwise.Make_bitwise ? but that would make things a lot more complicated... :-?*)
   in_implicits : (Locations.Zone.t * 'info) list;
   out_ret : 'info option;
   outputs : (Locations.Zone.t * 'info) list;
}
type of a signature where 'a is the type of the information that we * want to store for each input/output.
module Str_descr: sig .. end
val empty : 'a t
build a new, empty signature
val in_key : int -> key
val in_impl_key : Locations.Zone.t -> key
val in_top_key : key
val in_ctrl_key : key
val out_ret_key : key
val out_key : Locations.Zone.t -> key
val mk_undef_in_key : Locations.Zone.t -> in_key
val copy : 'a -> 'a
val cmp_in_key : in_key -> in_key -> int
InCtrl < InNum < InImpl
val cmp_out_key : out_key -> out_key -> int
OutRet < OutLoc
val equal_out_key : out_key -> out_key -> bool
val add_in_list : ('a * 'b) list -> 'a -> 'b -> ('b -> 'b -> 'b) -> ('a * 'b) list
add a mapping between num and info in lst. if we already have something for num, use function merge
val add_loc : (Locations.Zone.t * 'a) list ->
Locations.Zone.t -> 'a -> ('a -> 'a -> 'a) -> (Locations.Zone.t * 'a) list
val add_replace : bool -> 'a -> 'b -> 'b
val add_input : 'a t ->
int -> 'a -> replace:bool -> 'a t
val add_impl_input : 'a t ->
Locations.Zone.t -> 'a -> replace:bool -> 'a t
val add_output : 'a t ->
Locations.Zone.t -> 'a -> replace:bool -> 'a t
val add_in_ctrl : 'a t -> 'a -> replace:bool -> 'a t
val add_out_ret : 'a t -> 'a -> replace:bool -> 'a t
val add_info : 'a t ->
key -> 'a -> replace:bool -> 'a t
val find_input : 'a t -> int -> 'a
val find_output : 'a t -> Locations.Zone.t -> 'a
val find_out_ret : 'a t -> 'a
val find_in_ctrl : 'a t -> 'a
val find_implicit_input : 'a t -> Locations.Zone.t -> 'a
try to find an exact match with loc. we shouldn't try to find a zone that we don't have...
val find_in_top : 'a t -> 'a
val find_in_info : 'a t -> in_key -> 'a
val find_out_info : 'a t -> out_key -> 'a
val find_info : 'a t -> key -> 'a
val fold_outputs : ('a -> Locations.Zone.t * 'b -> 'a) -> 'a -> 'b t -> 'a
val fold_all_outputs : ('a -> out_key * 'b -> 'a) ->
'a -> 'b t -> 'a
val fold_num_inputs : ('a -> int * 'b -> 'a) -> 'a -> 'b t -> 'a
val fold_impl_inputs : ('a -> Locations.Zone.t * 'b -> 'a) -> 'a -> 'b t -> 'a
val fold_matching_impl_inputs : Locations.Zone.t ->
('a -> Locations.Zone.t * 'b -> 'a) -> 'a -> 'b t -> 'a
val fold_all_inputs : ('a -> in_key * 'b -> 'a) ->
'a -> 'b t -> 'a
val fold : ('a -> key * 'b -> 'a) ->
'a -> 'b t -> 'a
val merge : 'a t ->
'a t -> ('a -> 'a -> 'a) -> 'a t
val pretty_in_key : Format.formatter -> in_key -> unit
val pretty_out_key : Format.formatter -> out_key -> unit
val pretty_key : Format.formatter -> key -> unit
val pretty : (Format.formatter -> 'a -> unit) ->
Format.formatter -> 'a t -> unit