- let demodulate_once ~jump_to_right bag (id, literal, vl, pr) table =
- match literal with
- | Terms.Predicate t -> assert false
- | Terms.Equation (l,r,ty,_) ->
- let bag,l,id1 = if jump_to_right then (bag,l,id) else
- parallel_positions bag [2]
- (fun x -> Terms.Node [ Terms.Leaf B.eqP; ty; x; r ]) id l
- (parallel_demod table vl)
- in
- let jump_to_right = id1 = id in
- let bag,r,id2 =
- parallel_positions bag [3]
- (fun x -> Terms.Node [ Terms.Leaf B.eqP; ty; l; x ]) id1 r
- (parallel_demod table vl)
- in
- if id = id2 then None
- else
- let cl,_,_ = Terms.get_from_bag id2 bag in
- Some ((bag,cl),jump_to_right)
- ;;
-
- let rec demodulate_old ~jump_to_right bag clause table =
- match demodulate_once ~jump_to_right bag clause table with
- | None -> bag, clause
- | Some ((bag, clause),r) -> demodulate ~jump_to_right:r
- bag clause table
- ;;
-(*
- let rec demodulate_old ~jump_to_right bag clause table =
- match demodulate_once_old ~jump_to_right bag clause table with
- | None -> bag, clause
- | Some ((bag, clause),r) -> demodulate_old ~jump_to_right:r
- bag clause table
- ;;
-*)
-