feat: add is_valid_literal filter to add_term_rec

This commit is contained in:
Simon Cruanes 2019-10-02 18:15:06 -05:00
parent 7fe6f07c0b
commit 7552808c33
4 changed files with 10 additions and 3 deletions

View file

@ -7,7 +7,7 @@ author: ["Simon Cruanes" "Guillaume Bury"]
maintainer: ["simon.cruanes.2007@m4x.org"]
build: [
["dune" "build" "@install" "-p" name "-j" jobs]
["dune" "build" "@doc" "-p" name] {with-doc}
["dune" "build" "@doc" "-p" name "-j" jobs ] {with-doc}
# ["dune" "runtest" "-p" name] {with-test}
]
depends: [
@ -15,7 +15,7 @@ depends: [
"containers"
"iter"
"zarith"
"sidekick"
"sidekick" { = version }
"menhir"
"msat" { >= "0.8" < "0.9" }
"ocaml" { >= "4.03" }

View file

@ -7,7 +7,7 @@ author: ["Simon Cruanes" "Guillaume Bury"]
maintainer: ["simon.cruanes.2007@m4x.org"]
build: [
["dune" "build" "@install" "-p" name "-j" jobs]
["dune" "build" "@doc" "-p" name] {with-doc}
["dune" "build" "@doc" "-p" name "-j" jobs ] {with-doc}
# ["dune" "runtest" "-p" name] {with-test}
]
depends: [

View file

@ -6,7 +6,12 @@ module IM = Util.Int_map
module type ARG = sig
include Sidekick_core.TERM_PROOF
val cc_view : Term.t -> (Fun.t, Term.t, Term.t Iter.t) Sidekick_core.CC_view.t
val is_valid_literal : Term.t -> bool
(** Is this a valid boolean literal? (e.g. is it a closed term, not inside
a quantifier) *)
end
module type S = Sidekick_core.SOLVER
@ -458,6 +463,7 @@ module Make(A : ARG)
(fun t -> match A.cc_view t with
| Sidekick_core.CC_view.Not _ -> false (* will process the subterm just later *)
| _ -> true)
|> Iter.filter (fun t -> A.is_valid_literal t)
|> Iter.iter
(fun sub ->
Log.debugf 5 (fun k->k "(@[solver.map-bool-subterm-to-lit@ :subterm %a@])" T.pp sub);

View file

@ -397,6 +397,7 @@ module Solver_arg = struct
include Sidekick_base_term
let cc_view = Term.cc_view
let is_valid_literal _ = true
module Proof = struct
type t = Default
let default=Default