Ignore:
Timestamp:
Apr 4, 2011, 5:18:15 PM (10 years ago)
Author:
ayache
Message:

New memory model and bug fixes in 8051 branch. Added primitive operations in interpreters from Clight to LIN.

Location:
Deliverables/D2.2/8051/src/utilities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/utilities/interference.mli

    r486 r740  
    4444     the key to be present in the map -- it will fail otherwise. *)
    4545
    46   module Map : Map.S with type key = t
     46  module Map : MyMap.S with type key = t
    4747
    4848end
  • Deliverables/D2.2/8051/src/utilities/miscPottier.ml

    r619 r740  
     1
     2let rec max_list = function
     3  | [] -> raise (Invalid_argument "MiscPottier.max_list")
     4  | [a] -> a
     5  | a :: l -> max a (max_list l)
     6
     7let pow a b =
     8  if b < 0 then raise (Invalid_argument "MiscPottier.pow2")
     9  else
     10    let rec aux = function
     11      | 0 -> 1
     12      | i -> a * aux (i-1) in
     13    aux b
    114
    215let rec make a n =
     
    1124  aux 0
    1225
    13 let foldi f a =
     26let rec remove_n_first n =
     27  let rec aux i = function
     28  | [] -> []
     29  | l when i = n -> l
     30  | _ :: l -> aux (i+1) l in
     31  aux 0
     32
     33let foldi_from_until n m f a l =
    1434  let rec aux i res = function
    1535    | [] -> res
    16     | e :: l -> aux (i+1) (f i res e) l
    17   in
    18   aux 0 a
     36    | _ when i >= m -> res
     37    | e :: l -> aux (i+1) (f i res e) l in
     38  aux 0 a (remove_n_first n l)
     39
     40let foldi_from n f a l = foldi_from_until n (List.length l) f a l
     41
     42let foldi_until m f a l = foldi_from_until 0 m f a l
     43
     44let foldi f a l = foldi_from_until 0 (List.length l) f a l
    1945
    2046let iteri f l =
  • Deliverables/D2.2/8051/src/utilities/miscPottier.mli

    r619 r740  
    11
    2 (** This module provides some additional functions on lists. *)
     2(** This module provides some additional functions on lists or arithmetics. *)
     3
     4val max_list : 'a list -> 'a
     5
     6val pow : int -> int -> int
    37
    48val make: 'a -> int -> 'a list
    59
    610val index_of : 'a -> 'a list -> int
     11
     12val foldi_until : int -> (int -> 'a -> 'b -> 'a) -> 'a -> 'b list -> 'a
    713
    814val foldi : (int -> 'a -> 'b -> 'a) -> 'a -> 'b list -> 'a
Note: See TracChangeset for help on using the changeset viewer.