fact: Fixpoint to_formula (pol:bool) (k:kind) (f:BForm k) : LForm:= match f with | BTT k => TT | BFF k => FF | BAT k i => if keep_atom k i then LAT i else if pol then FF else TT | BOP k o f1 f2 => match o with | NOT => LIMPL (map_hcons (to_formula (negb pol) k) f1::nil) hFF | AND => LOP LAND ((map_hcons (to_formula pol k) f1):: (map_hcons (to_formula pol k) f2)::nil) | OR => LOP LOR ((map_hcons (to_formula pol k) f1):: (map_hcons (to_formula pol k) f2)::nil) | IMPL => LIMPL ((map_hcons (to_formula (negb pol) k) f1):: nil) (map_hcons (to_formula pol k) f2) | IFF i1 i2 => let f1' := LIMPL ((map_hcons (to_formula (negb pol) k) f1):: nil) (map_hcons (to_formula pol k) f2) in let f2' := LIMPL ((map_hcons (to_formula (negb pol) k) f2):: nil) (map_hcons (to_formula pol k) f1) in let dec := f1.(is_dec) && f2.(is_dec) in LOP LAND (HCons.mk i1 dec f1' :: HCons.mk i2 dec f2' :: nil) end | BPROP (EQB i1 i2) f1 f2 => let f1' := LIMPL ((map_hcons (to_formula (negb pol) IsBool) f1):: nil) (map_hcons (to_formula pol IsBool) f2) in let f2' := LIMPL ((map_hcons (to_formula (negb pol) IsBool) f2):: nil) (map_hcons (to_formula pol IsBool) f1) in let dec := f1.(is_dec) && f2.(is_dec) in LOP LAND (HCons.mk i1 dec f1' :: HCons.mk i2 dec f2' :: nil) | BITE k (ITE i1 i2) c f1 f2 => let f1' := LIMPL ((map_hcons (to_formula (negb pol) IsBool) c):: nil) (map_hcons (to_formula pol k) f1) in let f2' := LOP LOR ((map_hcons (to_formula pol IsBool) c):: map_hcons (to_formula pol k) f2::nil) in let dec := f1.(is_dec) && f2.(is_dec) in LOP LAND (HCons.mk i1 dec f1' :: HCons.mk i2 dec f2' :: nil) end.
imports: Cdcl.PatriciaR Cdcl.KeyInt Cdcl.ReifClasses Cdcl.Lib Bool Setoid ZifyBool ZArith Uint63 Lia List Cdcl.Syntax Cdcl.Clause