@ -32,7 +32,7 @@ let uninterpreted e = equal_kind (classify e) Uninterpreted
let rec max_solvables e =
let rec max_solvables e =
if non_interpreted e then Iter . return e
if non_interpreted e then Iter . return e
else Iter . flat_map ~ f : max_solvables ( Trm . sub trms e )
else Iter . flat_map ~ f : max_solvables ( Trm . trms e )
let fold_max_solvables e s ~ f = Iter . fold ~ f ( max_solvables e ) s
let fold_max_solvables e s ~ f = Iter . fold ~ f ( max_solvables e ) s
@ -168,8 +168,8 @@ end = struct
in
in
( is_var_in xs e
( is_var_in xs e
| | is_var_in xs f
| | is_var_in xs f
| | ( uninterpreted e && Iter . exists ~ f : ( is_var_in xs ) ( Trm . sub trms e ) )
| | ( uninterpreted e && Iter . exists ~ f : ( is_var_in xs ) ( Trm . trms e ) )
| | ( uninterpreted f && Iter . exists ~ f : ( is_var_in xs ) ( Trm . sub trms f ) ) )
| | ( uninterpreted f && Iter . exists ~ f : ( is_var_in xs ) ( Trm . trms f ) ) )
$> fun b ->
$> fun b ->
[ % Trace . info
[ % Trace . info
" is_valid_eq %a%a=%a = %b " Var . Set . pp_xs xs Trm . pp e Trm . pp f b ]
" is_valid_eq %a%a=%a = %b " Var . Set . pp_xs xs Trm . pp e Trm . pp f b ]
@ -457,7 +457,7 @@ let pre_invariant r =
(* no interpreted terms in carrier *)
(* no interpreted terms in carrier *)
assert ( non_interpreted trm | | fail " non-interp %a " Trm . pp trm () ) ;
assert ( non_interpreted trm | | fail " non-interp %a " Trm . pp trm () ) ;
(* carrier is closed under subterms *)
(* carrier is closed under subterms *)
Iter . iter ( Trm . sub trms trm ) ~ f : ( fun subtrm ->
Iter . iter ( Trm . trms trm ) ~ f : ( fun subtrm ->
assert (
assert (
( not ( non_interpreted subtrm ) )
( not ( non_interpreted subtrm ) )
| | ( match subtrm with Z _ | Q _ -> true | _ -> false )
| | ( match subtrm with Z _ | Q _ -> true | _ -> false )
@ -525,12 +525,12 @@ let rec extend_ a r =
match ( a : Trm . t ) with
match ( a : Trm . t ) with
| Z _ | Q _ -> r
| Z _ | Q _ -> r
| _ -> (
| _ -> (
if interpreted a then Iter . fold ~ f : extend_ ( Trm . sub trms a ) r
if interpreted a then Iter . fold ~ f : extend_ ( Trm . trms a ) r
else
else
(* add uninterpreted terms *)
(* add uninterpreted terms *)
match Subst . extend a r with
match Subst . extend a r with
(* and their subterms if newly added *)
(* and their subterms if newly added *)
| Some r -> Iter . fold ~ f : extend_ ( Trm . sub trms a ) r
| Some r -> Iter . fold ~ f : extend_ ( Trm . trms a ) r
| None -> r )
| None -> r )
(* * add a term to the carrier *)
(* * add a term to the carrier *)
@ -640,10 +640,10 @@ let ppx_diff var_strength fs parent_ctx fml ctx =
let fold_uses_of r t s ~ f =
let fold_uses_of r t s ~ f =
let rec fold_ e s ~ f =
let rec fold_ e s ~ f =
let s =
let s =
Iter . fold ( Trm . sub trms e ) s ~ f : ( fun sub s ->
Iter . fold ( Trm . trms e ) s ~ f : ( fun sub s ->
if Trm . equal t sub then f s e else s )
if Trm . equal t sub then f s e else s )
in
in
if interpreted e then Iter . fold ~ f : ( fold_ ~ f ) ( Trm . sub trms e ) s else s
if interpreted e then Iter . fold ~ f : ( fold_ ~ f ) ( Trm . trms e ) s else s
in
in
Subst . fold r . rep s ~ f : ( fun ~ key : trm ~ data : rep s ->
Subst . fold r . rep s ~ f : ( fun ~ key : trm ~ data : rep s ->
fold_ ~ f trm ( fold_ ~ f rep s ) )
fold_ ~ f trm ( fold_ ~ f rep s ) )