Project

General

Profile

Revision 40ac0ede src/backends/VHDL/mini_vhdl_utils.ml

View differences:

src/backends/VHDL/mini_vhdl_utils.ml
44 44
  | [] -> false
45 45
  | hd::tl -> equals x hd || vhdl_name_t_mem x tl
46 46

  
47
let rec diff l1 l2 to_string_name =
47
let rec diff l1 l2 =
48 48
  match l1 with
49 49
  | [] -> []
50 50
  | hd::tl -> 
51
      if vhdl_name_t_mem hd l2 then diff tl l2 to_string_name else hd::(diff tl l2 to_string_name)
51
      if vhdl_name_t_mem hd l2 then diff tl l2 else hd::(diff tl l2)
52 52

  
53
let n_intersection ll =
54
  let rec n_intersection_aux e_inter l = 
55
    match e_inter with 
56
    | [] -> l 
57
    | hd::tl -> if (vhdl_name_t_mem hd l) then hd::(n_intersection_aux tl l) else n_intersection_aux tl l
58
  in
59
  List.fold_left n_intersection_aux [] ll
60

  
61
let rec times : 'a list list -> 'a list list -> 'a list list=
62
  fun a ->
63
    fun b ->
64
      match a with
65
      | [] -> b
66
      | hda::tla -> match b with
67
                    | [] -> a
68
                    | hdb::tlb -> [hdb@hda]@(times tla tlb)

Also available in: Unified diff