Ignore:
Timestamp:
Oct 5, 2011, 6:04:47 PM (8 years ago)
Author:
tranquil
Message:

changed representation of indexings to a nameless one implemented with arrays

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051-indexed-labels-branch/src/common/costLabel.mli

    r1291 r1297  
    88end
    99
    10 (** Loop indices, to be identified with Clight identifiers *)
    11 module Index : sig
    12         include StringSig.S
    13 end
    14 
    15 (** Simple expressions corresponding to loop tranformations. *)
     10(** Simple expressions corresponding to loop tranformations.
     11    TODO: leave it abstract or not? *)
    1612type sexpr
    1713
    1814val sexpr_id : sexpr
    1915
    20 module Indexing : sig
    21         include Set.OrderedType
    22         val empty : t
    23 end
     16(* trying a nameless approach *)
     17type index = int
    2418
    25 (** [sexpr_of i l] extracts the simple expression relative to [i] in [l].
    26     It raises an [Invalid_argument] exception if [i] is not handled by [l] *)
    27 val sexpr_of : Index.t -> Indexing.t -> sexpr
     19type indexing = sexpr array
     20
     21(** [id_indexing n] generates an identity indexing nested in [n] loops *)
     22val id_indexing : int -> indexing
    2823
    2924(** [compose_index i s l] applies the transformation [i] |--> [s] to [l] *)
    30 val compose_index : Index.t -> sexpr -> Indexing.t -> Indexing.t
     25val compose_index : index -> sexpr -> indexing -> unit
    3126
    3227(** [compose_index l m] applies all the transformations in  [l] to [m] *)
    33 val compose_indexing : Indexing.t -> Indexing.t -> Indexing.t
     28val compose_indexing : indexing -> indexing -> unit
    3429
    35 module IndexingSet : Set.S with type elt = Indexing.t
     30module IndexingSet : Set.S with type elt = indexing
    3631
    3732type t = {
    3833        name : Atom.t;
    39         i : Indexing.t
     34        i : indexing
    4035}
    4136
    42 (** [string_of_cost_label t] converts an indexed label to a
    43     string suitable for a label name in source.
     37(** [string_of_cost_label pref t] converts an indexed label to a
     38    string suitable for a label name in source
    4439                [string_of_cost_label ~pretty:true t] prints a more readable form *)
    4540val string_of_cost_label : ?pretty : bool -> t -> string
     
    4742(** [fresh i u] creates a fresh label using [u] as name universe, inside
    4843    the indexing [i] (which represents the nested loops containing the label) *)
    49 val fresh : Indexing.t -> Atom.Gen.universe -> t
     44val fresh : indexing -> Atom.Gen.universe -> t
    5045
    5146module Set : Set.S with type elt = t
Note: See TracChangeset for help on using the changeset viewer.