- (try
- if List.assoc m1 table = m2 then table
- else raise NotMetaConvertible
- with Not_found ->
- try ignore(List.assoc m2 table);raise NotMetaConvertible
- with Not_found -> (m1,m2)::table)
+ let m1_binding, table_l =
+ try List.assoc m1 table_l, table_l
+ with Not_found -> m2, (m1, m2)::table_l
+ and m2_binding, table_r =
+ try List.assoc m2 table_r, table_r
+ with Not_found -> m1, (m2, m1)::table_r
+ in
+ if (m1_binding <> m2) || (m2_binding <> m1) then
+ raise NotMetaConvertible
+ else table_l,table_r