feat(proof): do not emit trivial clause_rw steps

if there is no rewriting going on, we can skip the step.
This commit is contained in:
Simon Cruanes 2021-11-28 16:33:57 -05:00
parent aad1daa4e4
commit e9b395b643
No known key found for this signature in database
GPG key ID: 4AC01D0849AA62B6

View file

@ -217,11 +217,16 @@ let lemma_cc lits (self:t) =
PS.(Step_view.Step_cc {Step_cc.eqns=lits}) PS.(Step_view.Step_cc {Step_cc.eqns=lits})
let lemma_rw_clause c ~res ~using (self:t) = let lemma_rw_clause c ~res ~using (self:t) =
emit_ self @@ fun() -> if enabled self then (
let lits = Iter.map (emit_lit_ self) res |> Iter.to_array in let using = Iter.to_array using in
let res = Proof_ser.{Clause.lits} in if Array.length using=0 then c (* useless step *)
let using = Iter.to_array using in else (
PS.(Step_view.Step_clause_rw {Step_clause_rw.c; res; using}) emit_ self @@ fun() ->
let lits = Iter.map (emit_lit_ self) res |> Iter.to_array in
let res = Proof_ser.{Clause.lits} in
PS.(Step_view.Step_clause_rw {Step_clause_rw.c; res; using})
)
) else dummy_step
(* TODO *) (* TODO *)
let with_defs _ _ (_pr:t) = dummy_step let with_defs _ _ (_pr:t) = dummy_step