1995-08-09 08:06:35 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
2011-07-27 07:17:02 -07:00
|
|
|
(* OCaml *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
|
|
|
(* under the terms of the Q Public License version 1.0. *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
(* Inclusion checks for the core language *)
|
|
|
|
|
2003-07-02 02:14:35 -07:00
|
|
|
open Asttypes
|
1995-05-04 03:15:53 -07:00
|
|
|
open Path
|
1996-09-23 04:33:27 -07:00
|
|
|
open Types
|
1995-05-04 03:15:53 -07:00
|
|
|
open Typedtree
|
|
|
|
|
1995-05-05 03:05:18 -07:00
|
|
|
(* Inclusion between value descriptions *)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1995-10-23 09:59:41 -07:00
|
|
|
exception Dont_match
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
let value_descriptions env vd1 vd2 =
|
1997-04-01 12:52:36 -08:00
|
|
|
if Ctype.moregeneral env true vd1.val_type vd2.val_type then begin
|
1996-04-22 04:15:41 -07:00
|
|
|
match (vd1.val_kind, vd2.val_kind) with
|
|
|
|
(Val_prim p1, Val_prim p2) ->
|
1995-10-23 09:59:41 -07:00
|
|
|
if p1 = p2 then Tcoerce_none else raise Dont_match
|
2014-11-17 03:55:24 -08:00
|
|
|
| (Val_prim p, _) ->
|
|
|
|
let pc = {pc_desc = p; pc_type = vd2.val_type; pc_env = env } in
|
|
|
|
Tcoerce_primitive pc
|
1996-04-22 04:15:41 -07:00
|
|
|
| (_, Val_prim p) -> raise Dont_match
|
|
|
|
| (_, _) -> Tcoerce_none
|
1995-10-23 09:59:41 -07:00
|
|
|
end else
|
|
|
|
raise Dont_match
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2003-07-02 02:14:35 -07:00
|
|
|
(* Inclusion between "private" annotations *)
|
|
|
|
|
2007-11-28 14:27:35 -08:00
|
|
|
let private_flags decl1 decl2 =
|
|
|
|
match decl1.type_private, decl2.type_private with
|
2007-10-17 20:58:07 -07:00
|
|
|
| Private, Public ->
|
2010-01-20 08:26:46 -08:00
|
|
|
decl2.type_kind = Type_abstract &&
|
|
|
|
(decl2.type_manifest = None || decl1.type_kind <> Type_abstract)
|
2007-10-09 03:29:37 -07:00
|
|
|
| _, _ -> true
|
2003-07-02 02:14:35 -07:00
|
|
|
|
2005-08-07 22:40:52 -07:00
|
|
|
(* Inclusion between manifest types (particularly for private row types) *)
|
2005-03-22 19:08:37 -08:00
|
|
|
|
|
|
|
let is_absrow env ty =
|
|
|
|
match ty.desc with
|
|
|
|
Tconstr(Pident id, _, _) ->
|
|
|
|
begin match Ctype.expand_head env ty with
|
|
|
|
{desc=Tobject _|Tvariant _} -> true
|
|
|
|
| _ -> false
|
|
|
|
end
|
|
|
|
| _ -> false
|
|
|
|
|
2008-12-03 10:09:09 -08:00
|
|
|
let type_manifest env ty1 params1 ty2 params2 priv2 =
|
2005-03-22 19:08:37 -08:00
|
|
|
let ty1' = Ctype.expand_head env ty1 and ty2' = Ctype.expand_head env ty2 in
|
|
|
|
match ty1'.desc, ty2'.desc with
|
|
|
|
Tvariant row1, Tvariant row2 when is_absrow env (Btype.row_more row2) ->
|
|
|
|
let row1 = Btype.row_repr row1 and row2 = Btype.row_repr row2 in
|
|
|
|
Ctype.equal env true (ty1::params1) (row2.row_more::params2) &&
|
2011-11-24 01:02:48 -08:00
|
|
|
begin match row1.row_more with
|
|
|
|
{desc=Tvar _|Tconstr _|Tnil} -> true
|
|
|
|
| _ -> false
|
|
|
|
end &&
|
2005-03-22 19:08:37 -08:00
|
|
|
let r1, r2, pairs =
|
2010-01-22 04:48:24 -08:00
|
|
|
Ctype.merge_row_fields row1.row_fields row2.row_fields in
|
2005-03-22 19:08:37 -08:00
|
|
|
(not row2.row_closed ||
|
|
|
|
row1.row_closed && Ctype.filter_row_fields false r1 = []) &&
|
|
|
|
List.for_all
|
2010-01-22 04:48:24 -08:00
|
|
|
(fun (_,f) -> match Btype.row_field_repr f with
|
|
|
|
Rabsent | Reither _ -> true | Rpresent _ -> false)
|
|
|
|
r2 &&
|
2005-03-22 19:08:37 -08:00
|
|
|
let to_equal = ref (List.combine params1 params2) in
|
|
|
|
List.for_all
|
2010-01-22 04:48:24 -08:00
|
|
|
(fun (_, f1, f2) ->
|
|
|
|
match Btype.row_field_repr f1, Btype.row_field_repr f2 with
|
|
|
|
Rpresent(Some t1),
|
|
|
|
(Rpresent(Some t2) | Reither(false, [t2], _, _)) ->
|
|
|
|
to_equal := (t1,t2) :: !to_equal; true
|
|
|
|
| Rpresent None, (Rpresent None | Reither(true, [], _, _)) -> true
|
|
|
|
| Reither(c1,tl1,_,_), Reither(c2,tl2,_,_)
|
|
|
|
when List.length tl1 = List.length tl2 && c1 = c2 ->
|
|
|
|
to_equal := List.combine tl1 tl2 @ !to_equal; true
|
|
|
|
| Rabsent, (Reither _ | Rabsent) -> true
|
|
|
|
| _ -> false)
|
|
|
|
pairs &&
|
2005-03-22 19:08:37 -08:00
|
|
|
let tl1, tl2 = List.split !to_equal in
|
|
|
|
Ctype.equal env true tl1 tl2
|
|
|
|
| Tobject (fi1, _), Tobject (fi2, _)
|
|
|
|
when is_absrow env (snd(Ctype.flatten_fields fi2)) ->
|
|
|
|
let (fields2,rest2) = Ctype.flatten_fields fi2 in
|
|
|
|
Ctype.equal env true (ty1::params1) (rest2::params2) &&
|
|
|
|
let (fields1,rest1) = Ctype.flatten_fields fi1 in
|
2011-09-22 02:05:42 -07:00
|
|
|
(match rest1 with {desc=Tnil|Tvar _|Tconstr _} -> true | _ -> false) &&
|
2005-03-22 19:08:37 -08:00
|
|
|
let pairs, miss1, miss2 = Ctype.associate_fields fields1 fields2 in
|
|
|
|
miss2 = [] &&
|
|
|
|
let tl1, tl2 =
|
2010-01-22 04:48:24 -08:00
|
|
|
List.split (List.map (fun (_,_,t1,_,t2) -> t1, t2) pairs) in
|
2005-03-22 19:08:37 -08:00
|
|
|
Ctype.equal env true (params1 @ tl1) (params2 @ tl2)
|
2007-10-09 03:29:37 -07:00
|
|
|
| _ ->
|
2008-12-03 10:09:09 -08:00
|
|
|
let rec check_super ty1 =
|
|
|
|
Ctype.equal env true (ty1 :: params1) (ty2 :: params2) ||
|
|
|
|
priv2 = Private &&
|
|
|
|
try check_super
|
|
|
|
(Ctype.try_expand_once_opt env (Ctype.expand_head env ty1))
|
|
|
|
with Ctype.Cannot_expand -> false
|
|
|
|
in check_super ty1
|
2005-03-22 19:08:37 -08:00
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
(* Inclusion between type declarations *)
|
|
|
|
|
2010-05-20 20:36:52 -07:00
|
|
|
type type_mismatch =
|
|
|
|
Arity
|
|
|
|
| Privacy
|
|
|
|
| Kind
|
|
|
|
| Constraint
|
|
|
|
| Manifest
|
|
|
|
| Variance
|
2012-05-30 07:52:37 -07:00
|
|
|
| Field_type of Ident.t
|
|
|
|
| Field_mutable of Ident.t
|
|
|
|
| Field_arity of Ident.t
|
|
|
|
| Field_names of int * Ident.t * Ident.t
|
|
|
|
| Field_missing of bool * Ident.t
|
2010-05-21 08:13:47 -07:00
|
|
|
| Record_representation of bool
|
2010-05-20 20:36:52 -07:00
|
|
|
|
2010-05-21 08:13:47 -07:00
|
|
|
let report_type_mismatch0 first second decl ppf err =
|
|
|
|
let pr fmt = Format.fprintf ppf fmt in
|
|
|
|
match err with
|
|
|
|
Arity -> pr "They have different arities"
|
|
|
|
| Privacy -> pr "A private type would be revealed"
|
|
|
|
| Kind -> pr "Their kinds differ"
|
|
|
|
| Constraint -> pr "Their constraints differ"
|
|
|
|
| Manifest -> ()
|
|
|
|
| Variance -> pr "Their variances do not agree"
|
2010-05-20 20:36:52 -07:00
|
|
|
| Field_type s ->
|
2012-05-30 07:52:37 -07:00
|
|
|
pr "The types for field %s are not equal" (Ident.name s)
|
2010-05-20 20:36:52 -07:00
|
|
|
| Field_mutable s ->
|
2012-05-30 07:52:37 -07:00
|
|
|
pr "The mutability of field %s is different" (Ident.name s)
|
2010-05-20 20:36:52 -07:00
|
|
|
| Field_arity s ->
|
2012-05-30 07:52:37 -07:00
|
|
|
pr "The arities for field %s differ" (Ident.name s)
|
2010-05-20 20:36:52 -07:00
|
|
|
| Field_names (n, name1, name2) ->
|
2013-07-09 04:16:25 -07:00
|
|
|
pr "Fields number %i have different names, %s and %s"
|
|
|
|
n (Ident.name name1) (Ident.name name2)
|
2010-05-20 20:36:52 -07:00
|
|
|
| Field_missing (b, s) ->
|
2010-05-21 08:13:47 -07:00
|
|
|
pr "The field %s is only present in %s %s"
|
2012-05-30 07:52:37 -07:00
|
|
|
(Ident.name s) (if b then second else first) decl
|
2010-05-21 08:13:47 -07:00
|
|
|
| Record_representation b ->
|
|
|
|
pr "Their internal representations differ:@ %s %s %s"
|
|
|
|
(if b then second else first) decl
|
|
|
|
"uses unboxed float representation"
|
|
|
|
|
|
|
|
let report_type_mismatch first second decl ppf =
|
|
|
|
List.iter
|
|
|
|
(fun err ->
|
|
|
|
if err = Manifest then () else
|
2010-05-23 23:52:16 -07:00
|
|
|
Format.fprintf ppf "@ %a." (report_type_mismatch0 first second decl) err)
|
2010-05-20 20:36:52 -07:00
|
|
|
|
2014-10-14 08:51:30 -07:00
|
|
|
let rec compare_constructor_arguments env cstr params1 params2 arg1 arg2 =
|
|
|
|
match arg1, arg2 with
|
|
|
|
| Types.Cstr_tuple arg1, Types.Cstr_tuple arg2 ->
|
|
|
|
if List.length arg1 <> List.length arg2 then [Field_arity cstr]
|
|
|
|
else if Misc.for_all2
|
|
|
|
(fun ty1 ty2 -> Ctype.equal env true (ty1::params1) (ty2::params2))
|
|
|
|
(arg1) (arg2)
|
|
|
|
then [] else [Field_type cstr]
|
|
|
|
| Types.Cstr_record l1, Types.Cstr_record l2 ->
|
|
|
|
compare_records env params1 params2 0 l1 l2
|
|
|
|
| _ -> [Field_type cstr]
|
|
|
|
|
|
|
|
and compare_variants env params1 params2 n cstrs1 cstrs2 =
|
2010-05-20 20:36:52 -07:00
|
|
|
match cstrs1, cstrs2 with
|
|
|
|
[], [] -> []
|
2013-09-27 03:54:55 -07:00
|
|
|
| [], c::_ -> [Field_missing (true, c.Types.cd_id)]
|
|
|
|
| c::_, [] -> [Field_missing (false, c.Types.cd_id)]
|
|
|
|
| {Types.cd_id=cstr1; cd_args=arg1; cd_res=ret1}::rem1,
|
|
|
|
{Types.cd_id=cstr2; cd_args=arg2; cd_res=ret2}::rem2 ->
|
2012-05-31 01:07:31 -07:00
|
|
|
if Ident.name cstr1 <> Ident.name cstr2 then
|
|
|
|
[Field_names (n, cstr1, cstr2)]
|
|
|
|
else match ret1, ret2 with
|
2012-05-30 07:52:37 -07:00
|
|
|
| Some r1, Some r2 when not (Ctype.equal env true [r1] [r2]) ->
|
2012-07-30 11:04:46 -07:00
|
|
|
[Field_type cstr1]
|
2010-09-12 22:28:30 -07:00
|
|
|
| Some _, None | None, Some _ ->
|
2012-07-30 11:04:46 -07:00
|
|
|
[Field_type cstr1]
|
2012-05-30 07:52:37 -07:00
|
|
|
| _ ->
|
2014-10-14 08:51:30 -07:00
|
|
|
let r =
|
|
|
|
compare_constructor_arguments env cstr1
|
|
|
|
params1 params2 arg1 arg2
|
|
|
|
in
|
|
|
|
if r <> [] then r
|
|
|
|
else compare_variants env params1 params2 (n+1) rem1 rem2
|
2012-05-30 07:52:37 -07:00
|
|
|
|
|
|
|
|
2014-10-14 08:51:30 -07:00
|
|
|
and compare_records env params1 params2 n labels1 labels2 =
|
2010-05-20 20:36:52 -07:00
|
|
|
match labels1, labels2 with
|
|
|
|
[], [] -> []
|
2013-09-27 03:54:55 -07:00
|
|
|
| [], l::_ -> [Field_missing (true, l.ld_id)]
|
|
|
|
| l::_, [] -> [Field_missing (false, l.ld_id)]
|
|
|
|
| {Types.ld_id=lab1; ld_mutable=mut1; ld_type=arg1}::rem1,
|
|
|
|
{Types.ld_id=lab2; ld_mutable=mut2; ld_type=arg2}::rem2 ->
|
2012-05-31 01:07:31 -07:00
|
|
|
if Ident.name lab1 <> Ident.name lab2
|
|
|
|
then [Field_names (n, lab1, lab2)]
|
|
|
|
else if mut1 <> mut2 then [Field_mutable lab1] else
|
2014-10-03 05:26:11 -07:00
|
|
|
if Ctype.equal env true (arg1::params1)
|
|
|
|
(arg2::params2)
|
|
|
|
then compare_records env params1 params2 (n+1) rem1 rem2
|
2010-05-20 20:36:52 -07:00
|
|
|
else [Field_type lab1]
|
|
|
|
|
2012-04-25 00:34:41 -07:00
|
|
|
let type_declarations ?(equality = false) env name decl1 id decl2 =
|
2010-05-20 20:36:52 -07:00
|
|
|
if decl1.type_arity <> decl2.type_arity then [Arity] else
|
|
|
|
if not (private_flags decl1 decl2) then [Privacy] else
|
|
|
|
let err = match (decl1.type_kind, decl2.type_kind) with
|
|
|
|
(_, Type_abstract) -> []
|
2007-10-09 03:29:37 -07:00
|
|
|
| (Type_variant cstrs1, Type_variant cstrs2) ->
|
2012-04-25 00:34:41 -07:00
|
|
|
let mark cstrs usage name decl =
|
|
|
|
List.iter
|
2013-09-27 03:54:55 -07:00
|
|
|
(fun c ->
|
2014-08-22 06:45:02 -07:00
|
|
|
Env.mark_constructor_used usage env name decl
|
2014-04-12 03:17:02 -07:00
|
|
|
(Ident.name c.Types.cd_id))
|
2012-04-25 00:34:41 -07:00
|
|
|
cstrs
|
|
|
|
in
|
2012-04-18 02:01:17 -07:00
|
|
|
let usage =
|
|
|
|
if decl1.type_private = Private || decl2.type_private = Public
|
2012-05-31 01:07:31 -07:00
|
|
|
then Env.Positive else Env.Privatize
|
2012-04-18 02:01:17 -07:00
|
|
|
in
|
2012-04-25 00:34:41 -07:00
|
|
|
mark cstrs1 usage name decl1;
|
2012-05-31 01:07:31 -07:00
|
|
|
if equality then mark cstrs2 Env.Positive (Ident.name id) decl2;
|
2014-10-03 05:26:11 -07:00
|
|
|
compare_variants env decl1.type_params decl2.type_params 1 cstrs1 cstrs2
|
2007-10-09 03:29:37 -07:00
|
|
|
| (Type_record(labels1,rep1), Type_record(labels2,rep2)) ->
|
2014-10-03 05:26:11 -07:00
|
|
|
let err = compare_records env decl1.type_params decl2.type_params
|
|
|
|
1 labels1 labels2 in
|
2010-05-21 08:13:47 -07:00
|
|
|
if err <> [] || rep1 = rep2 then err else
|
|
|
|
[Record_representation (rep2 = Record_float)]
|
2014-05-04 16:08:45 -07:00
|
|
|
| (Type_open, Type_open) -> []
|
2010-05-20 20:36:52 -07:00
|
|
|
| (_, _) -> [Kind]
|
|
|
|
in
|
|
|
|
if err <> [] then err else
|
|
|
|
let err = match (decl1.type_manifest, decl2.type_manifest) with
|
1997-02-20 12:39:02 -08:00
|
|
|
(_, None) ->
|
2010-05-20 20:36:52 -07:00
|
|
|
if Ctype.equal env true decl1.type_params decl2.type_params
|
|
|
|
then [] else [Constraint]
|
1995-09-26 13:23:29 -07:00
|
|
|
| (Some ty1, Some ty2) ->
|
2010-05-20 20:36:52 -07:00
|
|
|
if type_manifest env ty1 decl1.type_params ty2 decl2.type_params
|
|
|
|
decl2.type_private
|
|
|
|
then [] else [Manifest]
|
1995-09-26 13:23:29 -07:00
|
|
|
| (None, Some ty2) ->
|
1996-04-22 04:15:41 -07:00
|
|
|
let ty1 =
|
1997-03-24 12:11:22 -08:00
|
|
|
Btype.newgenty (Tconstr(Pident id, decl2.type_params, ref Mnil))
|
|
|
|
in
|
2010-05-20 20:36:52 -07:00
|
|
|
if Ctype.equal env true decl1.type_params decl2.type_params then
|
|
|
|
if Ctype.equal env false [ty1] [ty2] then []
|
|
|
|
else [Manifest]
|
|
|
|
else [Constraint]
|
|
|
|
in
|
|
|
|
if err <> [] then err else
|
2013-05-03 06:38:30 -07:00
|
|
|
let abstr =
|
|
|
|
decl2.type_private = Private ||
|
|
|
|
decl2.type_kind = Type_abstract && decl2.type_manifest = None in
|
2014-05-04 16:08:45 -07:00
|
|
|
let opn = decl2.type_kind = Type_open && decl2.type_manifest = None in
|
|
|
|
let constrained ty = not (Btype.(is_Tvar (repr ty))) in
|
2013-05-03 06:38:30 -07:00
|
|
|
if List.for_all2
|
|
|
|
(fun ty (v1,v2) ->
|
|
|
|
let open Variance in
|
|
|
|
let imp a b = not a || b in
|
|
|
|
let (co1,cn1) = get_upper v1 and (co2,cn2) = get_upper v2 in
|
2014-05-04 16:08:45 -07:00
|
|
|
(if abstr then (imp co1 co2 && imp cn1 cn2)
|
|
|
|
else if opn || constrained ty then (co1 = co2 && cn1 = cn2)
|
|
|
|
else true) &&
|
2013-05-03 06:38:30 -07:00
|
|
|
let (p1,n1,i1,j1) = get_lower v1 and (p2,n2,i2,j2) = get_lower v2 in
|
|
|
|
imp abstr (imp p2 p1 && imp n2 n1 && imp i2 i1 && imp j2 j1))
|
|
|
|
decl2.type_params (List.combine decl1.type_variance decl2.type_variance)
|
|
|
|
then [] else [Variance]
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2014-05-04 16:08:45 -07:00
|
|
|
(* Inclusion between extension constructors *)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2014-05-04 16:08:45 -07:00
|
|
|
let extension_constructors env id ext1 ext2 =
|
|
|
|
let usage =
|
|
|
|
if ext1.ext_private = Private || ext2.ext_private = Public
|
|
|
|
then Env.Positive else Env.Privatize
|
|
|
|
in
|
2014-08-22 06:45:02 -07:00
|
|
|
Env.mark_extension_used usage env ext1 (Ident.name id);
|
2014-05-04 16:08:45 -07:00
|
|
|
let ty1 =
|
|
|
|
Btype.newgenty (Tconstr(ext1.ext_type_path, ext1.ext_type_params, ref Mnil))
|
|
|
|
in
|
|
|
|
let ty2 =
|
|
|
|
Btype.newgenty (Tconstr(ext2.ext_type_path, ext2.ext_type_params, ref Mnil))
|
|
|
|
in
|
|
|
|
if Ctype.equal env true
|
|
|
|
(ty1 :: ext1.ext_type_params)
|
|
|
|
(ty2 :: ext2.ext_type_params)
|
|
|
|
then
|
2014-10-14 08:51:30 -07:00
|
|
|
if compare_constructor_arguments env (Ident.create "")
|
|
|
|
ext1.ext_type_params ext2.ext_type_params
|
|
|
|
ext1.ext_args ext2.ext_args = [] then
|
2014-05-04 16:08:45 -07:00
|
|
|
if match ext1.ext_ret_type, ext2.ext_ret_type with
|
|
|
|
Some r1, Some r2 when not (Ctype.equal env true [r1] [r2]) -> false
|
|
|
|
| Some _, None | None, Some _ -> false
|
2014-10-14 08:51:30 -07:00
|
|
|
| _ -> true
|
2014-05-04 16:08:45 -07:00
|
|
|
then
|
|
|
|
match ext1.ext_private, ext2.ext_private with
|
|
|
|
Private, Public -> false
|
|
|
|
| _, _ -> true
|
|
|
|
else false
|
|
|
|
else false
|
|
|
|
else false
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1996-04-22 04:15:41 -07:00
|
|
|
(* Inclusion between class types *)
|
1996-05-14 08:38:36 -07:00
|
|
|
let encode_val (mut, ty) rem =
|
|
|
|
begin match mut with
|
|
|
|
Asttypes.Mutable -> Predef.type_unit
|
2011-09-22 02:05:42 -07:00
|
|
|
| Asttypes.Immutable -> Btype.newgenvar ()
|
1996-05-14 08:38:36 -07:00
|
|
|
end
|
|
|
|
::ty::rem
|
|
|
|
|
1997-05-11 14:48:21 -07:00
|
|
|
let meths meths1 meths2 =
|
|
|
|
Meths.fold
|
|
|
|
(fun nam t2 (ml1, ml2) ->
|
|
|
|
(begin try
|
|
|
|
Meths.find nam meths1 :: ml1
|
|
|
|
with Not_found ->
|
|
|
|
ml1
|
|
|
|
end,
|
|
|
|
t2 :: ml2))
|
|
|
|
meths2 ([], [])
|
|
|
|
|
1996-05-14 08:38:36 -07:00
|
|
|
let vars vars1 vars2 =
|
|
|
|
Vars.fold
|
|
|
|
(fun lab v2 (vl1, vl2) ->
|
|
|
|
(begin try
|
|
|
|
encode_val (Vars.find lab vars1) vl1
|
|
|
|
with Not_found ->
|
|
|
|
vl1
|
|
|
|
end,
|
|
|
|
encode_val v2 vl2))
|
|
|
|
vars2 ([], [])
|