let rec max_sub_hom1 e s =
(** m : longueur max. *) |
let m = ref 0 in
(** n : longueur courante. *) |
let n = ref 0 in
let rec loop s =
match s with
[] -> ()
| [e1] -> if (e = e1) then (incr n; m := max !m !n)
| e1::e2::s' ->
if (e1 = e) then
if (e2 = e) then (incr n; (loop (e2::s')))
else (incr n; m := max !m !n; n := 0; (loop (e2::s')))
else (loop (e2::s'))
in
(loop s);
!m