|
|
@ -88,16 +88,14 @@ end = struct
|
|
|
|
|
|
|
|
|
|
|
|
(** compose a substitution with a mapping *)
|
|
|
|
(** compose a substitution with a mapping *)
|
|
|
|
let compose1 ~key ~data r =
|
|
|
|
let compose1 ~key ~data r =
|
|
|
|
match (key : Trm.t) with
|
|
|
|
if Trm.equal key data then r
|
|
|
|
| Z _ | Q _ -> r
|
|
|
|
else (
|
|
|
|
| _ when Trm.equal key data -> r
|
|
|
|
|
|
|
|
| _ ->
|
|
|
|
|
|
|
|
assert (
|
|
|
|
assert (
|
|
|
|
Option.for_all ~f:(Trm.equal key) (Trm.Map.find key r)
|
|
|
|
Option.for_all ~f:(Trm.equal key) (Trm.Map.find key r)
|
|
|
|
|| fail "domains intersect: %a" Trm.pp key () ) ;
|
|
|
|
|| fail "domains intersect: %a" Trm.pp key () ) ;
|
|
|
|
let s = Trm.Map.singleton key data in
|
|
|
|
let s = Trm.Map.singleton key data in
|
|
|
|
let r' = Trm.Map.map_endo ~f:(norm s) r in
|
|
|
|
let r' = Trm.Map.map_endo ~f:(norm s) r in
|
|
|
|
Trm.Map.add ~key ~data r'
|
|
|
|
Trm.Map.add ~key ~data r' )
|
|
|
|
|
|
|
|
|
|
|
|
(** add an identity entry if the term is not already present *)
|
|
|
|
(** add an identity entry if the term is not already present *)
|
|
|
|
let extend e s =
|
|
|
|
let extend e s =
|
|
|
|