| 716 |
let rec aux accu1 accu2 = function |
let rec aux accu1 accu2 = function |
| 717 |
| (t1,t2)::left -> |
| (t1,t2)::left -> |
| 718 |
let accu1' = diff_t accu1 t1 in |
let accu1' = diff_t accu1 t1 in |
| 719 |
if not (empty_rec accu1') then aux accu1 accu2 left; |
if non_empty accu1' then aux accu1 accu2 left; |
| 720 |
let accu2' = cap_t accu2 t2 in |
let accu2' = cap_t accu2 t2 in |
| 721 |
if not (empty_rec accu2') then aux accu1 accu2 left |
if non_empty accu2' then aux accu1 accu2 left |
| 722 |
| [] -> raise NotEmpty |
| [] -> raise NotEmpty |
| 723 |
in |
in |
| 724 |
let accu1 = descr s1 in |
let accu1 = descr s1 in |
| 737 |
in |
in |
| 738 |
aux s.arrow |
aux s.arrow |
| 739 |
|
|
| 740 |
|
let check_simple_iface left s1 s2 = |
| 741 |
|
let rec aux accu1 accu2 = function |
| 742 |
|
| (t1,t2)::left -> |
| 743 |
|
let accu1' = diff accu1 t1 in |
| 744 |
|
if non_empty accu1' then aux accu1 accu2 left; |
| 745 |
|
let accu2' = cap accu2 t2 in |
| 746 |
|
if non_empty accu2' then aux accu1 accu2 left |
| 747 |
|
| [] -> raise NotEmpty |
| 748 |
|
in |
| 749 |
|
let accu1 = descr s1 in |
| 750 |
|
(is_empty accu1) || |
| 751 |
|
(try aux accu1 (diff any (descr s2)) left; true with NotEmpty -> false) |
| 752 |
|
|
| 753 |
|
let check_iface iface s = |
| 754 |
|
let rec aux = function |
| 755 |
|
| [] -> false |
| 756 |
|
| (p,n) :: rem -> |
| 757 |
|
((List.for_all (fun (a,b) -> check_simple_iface iface a b) p) && |
| 758 |
|
(List.for_all (fun (a,b) -> not (check_simple_iface iface a b)) n)) |
| 759 |
|
|| (aux rem) |
| 760 |
|
in |
| 761 |
|
aux s.arrow |
| 762 |
|
|
| 763 |
type t = descr * (descr * descr) list list |
type t = descr * (descr * descr) list list |
| 764 |
|
|
| 765 |
let get t = |
let get t = |
| 819 |
|
|
| 820 |
|
|
| 821 |
module Int = struct |
module Int = struct |
| 822 |
|
let has_int d i = Intervals.contains i d.ints |
| 823 |
|
|
| 824 |
let get d = d.ints |
let get d = d.ints |
| 825 |
let put i = { empty with ints = i } |
let put i = { empty with ints = i } |
| 826 |
let is_int d = is_empty { d with ints = Intervals.empty } |
let is_int d = is_empty { d with ints = Intervals.empty } |
| 831 |
let has_atom d a = Atoms.contains a d.atoms |
let has_atom d a = Atoms.contains a d.atoms |
| 832 |
end |
end |
| 833 |
|
|
| 834 |
|
module Char = struct |
| 835 |
|
let has_char d c = Chars.contains c d.chars |
| 836 |
|
end |
| 837 |
|
|
| 838 |
(* |
(* |
| 839 |
let rec print_normal_record ppf = function |
let rec print_normal_record ppf = function |
| 840 |
| Success -> Format.fprintf ppf "Yes" |
| Success -> Format.fprintf ppf "Yes" |