source: Deliverables/D2.2/8051-indexed-labels-branch/src/common/costLabel.mli @ 1305

Last change on this file since 1305 was 1305, checked in by tranquil, 9 years ago

added indexes to loop constructors. Branch does not compile atm

File size: 1.7 KB
Line 
1
2(** This module provides functions to manipulate and create indexed cost
3    labels. *)
4               
5(** [Atom] provides functions for cost atoms, the root of indexed costs *)
6module Atom : sig
7        include StringSig.S
8end
9
10(** Simple expressions corresponding to loop tranformations.
11    TODO: leave it abstract or not? *)
12type sexpr
13
14val sexpr_id : sexpr
15
16(* trying a nameless approach *)
17type index = int
18
19val make_id : string -> index -> string
20
21type indexing = sexpr array
22
23(** [id_indexing n] generates an identity indexing nested in [n] loops *) 
24val id_indexing : int -> indexing
25
26(** [compose_index i s l] applies the transformation [i] |--> [s] to [l] *) 
27val compose_index : index -> sexpr -> indexing -> unit
28
29(** [compose_index l m] applies all the transformations in  [l] to [m] *)
30val compose_indexing : indexing -> indexing -> unit
31
32module IndexingSet : Set.S with type elt = indexing
33
34type t = {
35        name : Atom.t;
36        i : indexing
37}
38
39(** [string_of_cost_label pref t] converts an indexed label to a
40    string suitable for a label name in source
41                [string_of_cost_label ~pretty:true t] prints a more readable form *)
42val string_of_cost_label : ?pretty : bool -> t -> string
43
44(** [fresh i u] creates a fresh label using [u] as name universe, inside
45    the indexing [i] (which represents the nested loops containing the label) *)
46val fresh : indexing -> Atom.Gen.universe -> t
47
48module Set : Set.S with type elt = t
49module Map : Map.S with type key = t
50
51(** [indexings_of a s] produces the set of indexings of an atom [a] occurring
52    in the set of indexed labels [s]. *)
53val indexings_of : Atom.t -> Set.t -> IndexingSet.t
54
55(** [constant_map d x] produces a finite map which associates
56    [x] to every element of the set [d]. *)
57val constant_map : Set.t -> 'a -> 'a Map.t
58
Note: See TracBrowser for help on using the repository browser.