diff --git a/dev/sidekick-base/Sidekick_base/Proof/index.html b/dev/sidekick-base/Sidekick_base/Proof/index.html index a8fc6123..b207ff3b 100644 --- a/dev/sidekick-base/Sidekick_base/Proof/index.html +++ b/dev/sidekick-base/Sidekick_base/Proof/index.html @@ -1,2 +1,2 @@ -Proof (sidekick-base.Sidekick_base.Proof)

Module Sidekick_base.Proof

Proof representation

module Config : sig ... end

Configuration of proofs

Main Proof API

type t

A container for the whole proof

type proof_step

A proof step in the trace.

The proof will store all steps, and at the end when we find the empty clause we can filter them to keep only the relevant ones.

include Sidekick_core.PROOF with type t := t and type proof_step := proof_step and type lit = Lit.t and type term = Base_types.Term.t
type term = Base_types.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

val lemma_lra : Lit.t Iter.t -> proof_rule
include Sidekick_th_data.PROOF with type proof := t and type proof_step := proof_step and type lit := Lit.t and type term := Base_types.Term.t
val lemma_isa_cstor : cstor_t:Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

lemma_isa_cstor (d …) (is-c t) returns the clause (c …) = t |- is-c t or (d …) = t |- ¬ (is-c t)

val lemma_select_cstor : cstor_t:Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

lemma_select_cstor (c t1…tn) (sel-c-i t) returns a proof of t = c t1…tn |- (sel-c-i t) = ti

val lemma_isa_split : Base_types.Term.t -> Lit.t Iter.t -> t -> proof_step

lemma_isa_split t lits is the proof of is-c1 t \/ is-c2 t \/ … \/ is-c_n t

val lemma_isa_sel : Base_types.Term.t -> t -> proof_step

lemma_isa_sel (is-c t) is the proof of is-c t |- t = c (sel-c-1 t)…(sel-c-n t)

val lemma_isa_disj : Lit.t -> Lit.t -> t -> proof_step

lemma_isa_disj (is-c t) (is-d t) is the proof of ¬ (is-c t) \/ ¬ (is-c t)

val lemma_cstor_inj : Base_types.Term.t -> Base_types.Term.t -> int -> t -> proof_step

lemma_cstor_inj (c t1…tn) (c u1…un) i is the proof of c t1…tn = c u1…un |- ti = ui

val lemma_cstor_distinct : Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

lemma_isa_distinct (c …) (d …) is the proof of the unit clause |- (c …) ≠ (d …)

val lemma_acyclicity : (Base_types.Term.t * Base_types.Term.t) Iter.t -> t -> proof_step

lemma_acyclicity pairs is a proof of t1=u1, …, tn=un |- false by acyclicity.

include Sidekick_th_bool_static.PROOF with type proof := t and type proof_step := proof_step and type lit := Lit.t and type term := Base_types.Term.t
val lemma_bool_tauto : Lit.t Iter.t -> t -> proof_step

Boolean tautology lemma (clause)

val lemma_bool_c : string -> Base_types.Term.t list -> t -> proof_step

Basic boolean logic lemma for a clause |- c. proof_bool_c b name cs is the rule designated by name.

val lemma_bool_equiv : Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

Boolean tautology lemma (equivalence)

val lemma_ite_true : ite:Base_types.Term.t -> t -> proof_step

lemma a ==> ite a b c = b

val lemma_ite_false : ite:Base_types.Term.t -> t -> proof_step

lemma ¬a ==> ite a b c = c

Creation

val create : ?config:Config.t -> unit -> t

Create new proof.

  • parameter config

    modifies the proof behavior

val empty : t

Empty proof, stores nothing

val disable : t -> unit

Disable proof, even if the config would enable it

Use the proof

val iter_steps_backward : t -> Base_types.Proof_ser.Step.t Iter.t

Iterates on all the steps of the proof, from the end.

This will yield nothing if the proof was disabled or used a dummy backend.

module Unsafe_ : sig ... end
\ No newline at end of file +Proof (sidekick-base.Sidekick_base.Proof)

Module Sidekick_base.Proof

Proof representation

module Config : sig ... end

Configuration of proofs

Main Proof API

type t

A container for the whole proof

type proof_step

A proof step in the trace.

The proof will store all steps, and at the end when we find the empty clause we can filter them to keep only the relevant ones.

include Sidekick_core.PROOF with type t := t and type proof_step := proof_step and type lit = Lit.t and type term = Base_types.Term.t
type term = Base_types.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

val lemma_lra : Lit.t Iter.t -> proof_rule
include Sidekick_th_data.PROOF with type proof := t and type proof_step := proof_step and type lit := Lit.t and type term := Base_types.Term.t
val lemma_isa_cstor : cstor_t:Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

lemma_isa_cstor (d …) (is-c t) returns the clause (c …) = t |- is-c t or (d …) = t |- ¬ (is-c t)

val lemma_select_cstor : cstor_t:Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

lemma_select_cstor (c t1…tn) (sel-c-i t) returns a proof of t = c t1…tn |- (sel-c-i t) = ti

val lemma_isa_split : Base_types.Term.t -> Lit.t Iter.t -> t -> proof_step

lemma_isa_split t lits is the proof of is-c1 t \/ is-c2 t \/ … \/ is-c_n t

val lemma_isa_sel : Base_types.Term.t -> t -> proof_step

lemma_isa_sel (is-c t) is the proof of is-c t |- t = c (sel-c-1 t)…(sel-c-n t)

val lemma_isa_disj : Lit.t -> Lit.t -> t -> proof_step

lemma_isa_disj (is-c t) (is-d t) is the proof of ¬ (is-c t) \/ ¬ (is-c t)

val lemma_cstor_inj : Base_types.Term.t -> Base_types.Term.t -> int -> t -> proof_step

lemma_cstor_inj (c t1…tn) (c u1…un) i is the proof of c t1…tn = c u1…un |- ti = ui

val lemma_cstor_distinct : Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

lemma_isa_distinct (c …) (d …) is the proof of the unit clause |- (c …) ≠ (d …)

val lemma_acyclicity : (Base_types.Term.t * Base_types.Term.t) Iter.t -> t -> proof_step

lemma_acyclicity pairs is a proof of t1=u1, …, tn=un |- false by acyclicity.

include Sidekick_th_bool_static.PROOF with type proof := t and type proof_step := proof_step and type lit := Lit.t and type term := Base_types.Term.t
val lemma_bool_tauto : Lit.t Iter.t -> t -> proof_step

Boolean tautology lemma (clause)

val lemma_bool_c : string -> Base_types.Term.t list -> t -> proof_step

Basic boolean logic lemma for a clause |- c. proof_bool_c b name cs is the rule designated by name.

val lemma_bool_equiv : Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

Boolean tautology lemma (equivalence)

val lemma_ite_true : ite:Base_types.Term.t -> t -> proof_step

lemma a ==> ite a b c = b

val lemma_ite_false : ite:Base_types.Term.t -> t -> proof_step

lemma ¬a ==> ite a b c = c

Creation

val create : ?config:Config.t -> unit -> t

Create new proof.

  • parameter config

    modifies the proof behavior

val empty : t

Empty proof, stores nothing

val disable : t -> unit

Disable proof, even if the config would enable it

Use the proof

val iter_steps_backward : t -> Base_types.Proof_ser.Step.t Iter.t

Iterates on all the steps of the proof, from the end.

This will yield nothing if the proof was disabled or used a dummy backend.

module Unsafe_ : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Proof_dummy/index.html b/dev/sidekick-base/Sidekick_base/Proof_dummy/index.html index d6b20791..ffa20389 100644 --- a/dev/sidekick-base/Sidekick_base/Proof_dummy/index.html +++ b/dev/sidekick-base/Sidekick_base/Proof_dummy/index.html @@ -1,3 +1,3 @@ Proof_dummy (sidekick-base.Sidekick_base.Proof_dummy)

Module Sidekick_base.Proof_dummy

Dummy proof module that does nothing.

include Sidekick_core.PROOF with type t = private unit and type proof_step = private unit and type -lit = Lit.t and type term = Base_types.Term.t
type t = private unit

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = private unit

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = Base_types.Term.t
type lit = Lit.t
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := t -> proof_step

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> t -> proof_step

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> t -> proof_step

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> t -> proof_step

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> t -> proof_step

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> t -> proof_step

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> t -> proof_step

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> t -> proof_step

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> t -> proof_step

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> t -> proof_step

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> t -> proof_step

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

type proof_rule = t -> proof_step
val create : unit -> t
val lemma_lra : Lit.t Iter.t -> proof_rule
include Sidekick_th_data.PROOF with type proof := t and type proof_step := proof_step and type lit := Lit.t and type term := Base_types.Term.t
val lemma_isa_cstor : cstor_t:Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

lemma_isa_cstor (d …) (is-c t) returns the clause (c …) = t |- is-c t or (d …) = t |- ¬ (is-c t)

val lemma_select_cstor : cstor_t:Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

lemma_select_cstor (c t1…tn) (sel-c-i t) returns a proof of t = c t1…tn |- (sel-c-i t) = ti

val lemma_isa_split : Base_types.Term.t -> Lit.t Iter.t -> t -> proof_step

lemma_isa_split t lits is the proof of is-c1 t \/ is-c2 t \/ … \/ is-c_n t

val lemma_isa_sel : Base_types.Term.t -> t -> proof_step

lemma_isa_sel (is-c t) is the proof of is-c t |- t = c (sel-c-1 t)…(sel-c-n t)

val lemma_isa_disj : Lit.t -> Lit.t -> t -> proof_step

lemma_isa_disj (is-c t) (is-d t) is the proof of ¬ (is-c t) \/ ¬ (is-c t)

val lemma_cstor_inj : Base_types.Term.t -> Base_types.Term.t -> int -> t -> proof_step

lemma_cstor_inj (c t1…tn) (c u1…un) i is the proof of c t1…tn = c u1…un |- ti = ui

val lemma_cstor_distinct : Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

lemma_isa_distinct (c …) (d …) is the proof of the unit clause |- (c …) ≠ (d …)

val lemma_acyclicity : (Base_types.Term.t * Base_types.Term.t) Iter.t -> t -> proof_step

lemma_acyclicity pairs is a proof of t1=u1, …, tn=un |- false by acyclicity.

include Sidekick_th_bool_static.PROOF with type proof := t and type proof_step := proof_step and type lit := Lit.t and type term := Base_types.Term.t
val lemma_bool_tauto : Lit.t Iter.t -> t -> proof_step

Boolean tautology lemma (clause)

val lemma_bool_c : string -> Base_types.Term.t list -> t -> proof_step

Basic boolean logic lemma for a clause |- c. proof_bool_c b name cs is the rule designated by name.

val lemma_bool_equiv : Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

Boolean tautology lemma (equivalence)

val lemma_ite_true : ite:Base_types.Term.t -> t -> proof_step

lemma a ==> ite a b c = b

val lemma_ite_false : ite:Base_types.Term.t -> t -> proof_step

lemma ¬a ==> ite a b c = c

\ No newline at end of file +lit = Lit.t and type term = Base_types.Term.t
type t = private unit

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = private unit

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = Base_types.Term.t
type lit = Lit.t
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := t -> proof_step

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> t -> proof_step

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> t -> proof_step

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> t -> proof_step

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> t -> proof_step

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> t -> proof_step

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> t -> proof_step

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> t -> proof_step

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> t -> proof_step

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> t -> proof_step

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> t -> proof_step

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> t -> proof_step

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

type proof_rule = t -> proof_step
val create : unit -> t
val lemma_lra : Lit.t Iter.t -> proof_rule
include Sidekick_th_data.PROOF with type proof := t and type proof_step := proof_step and type lit := Lit.t and type term := Base_types.Term.t
val lemma_isa_cstor : cstor_t:Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

lemma_isa_cstor (d …) (is-c t) returns the clause (c …) = t |- is-c t or (d …) = t |- ¬ (is-c t)

val lemma_select_cstor : cstor_t:Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

lemma_select_cstor (c t1…tn) (sel-c-i t) returns a proof of t = c t1…tn |- (sel-c-i t) = ti

val lemma_isa_split : Base_types.Term.t -> Lit.t Iter.t -> t -> proof_step

lemma_isa_split t lits is the proof of is-c1 t \/ is-c2 t \/ … \/ is-c_n t

val lemma_isa_sel : Base_types.Term.t -> t -> proof_step

lemma_isa_sel (is-c t) is the proof of is-c t |- t = c (sel-c-1 t)…(sel-c-n t)

val lemma_isa_disj : Lit.t -> Lit.t -> t -> proof_step

lemma_isa_disj (is-c t) (is-d t) is the proof of ¬ (is-c t) \/ ¬ (is-c t)

val lemma_cstor_inj : Base_types.Term.t -> Base_types.Term.t -> int -> t -> proof_step

lemma_cstor_inj (c t1…tn) (c u1…un) i is the proof of c t1…tn = c u1…un |- ti = ui

val lemma_cstor_distinct : Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

lemma_isa_distinct (c …) (d …) is the proof of the unit clause |- (c …) ≠ (d …)

val lemma_acyclicity : (Base_types.Term.t * Base_types.Term.t) Iter.t -> t -> proof_step

lemma_acyclicity pairs is a proof of t1=u1, …, tn=un |- false by acyclicity.

include Sidekick_th_bool_static.PROOF with type proof := t and type proof_step := proof_step and type lit := Lit.t and type term := Base_types.Term.t
val lemma_bool_tauto : Lit.t Iter.t -> t -> proof_step

Boolean tautology lemma (clause)

val lemma_bool_c : string -> Base_types.Term.t list -> t -> proof_step

Basic boolean logic lemma for a clause |- c. proof_bool_c b name cs is the rule designated by name.

val lemma_bool_equiv : Base_types.Term.t -> Base_types.Term.t -> t -> proof_step

Boolean tautology lemma (equivalence)

val lemma_ite_true : ite:Base_types.Term.t -> t -> proof_step

lemma a ==> ite a b c = b

val lemma_ite_false : ite:Base_types.Term.t -> t -> proof_step

lemma ¬a ==> ite a b c = c

\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_proof_trace/Proof_ser/Step_proof_res/index.html b/dev/sidekick-base/Sidekick_base_proof_trace/Proof_ser/Step_proof_res/index.html new file mode 100644 index 00000000..febbe36f --- /dev/null +++ b/dev/sidekick-base/Sidekick_base_proof_trace/Proof_ser/Step_proof_res/index.html @@ -0,0 +1,2 @@ + +Step_proof_res (sidekick-base.Sidekick_base_proof_trace.Proof_ser.Step_proof_res)

Module Proof_ser.Step_proof_res

type t = {
pivot : ID.t;
c1 : ID.t;
c2 : ID.t;
}
val decode : Bare.Decode.t -> t
  • raises Bare.Decode.Error

    in case of error.

val encode : Bare.Encode.t -> t -> unit
val pp : Stdlib.Format.formatter -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_proof_trace/Proof_ser/Step_view/index.html b/dev/sidekick-base/Sidekick_base_proof_trace/Proof_ser/Step_view/index.html index b951baa8..032422a0 100644 --- a/dev/sidekick-base/Sidekick_base_proof_trace/Proof_ser/Step_view/index.html +++ b/dev/sidekick-base/Sidekick_base_proof_trace/Proof_ser/Step_view/index.html @@ -1,2 +1,2 @@ -Step_view (sidekick-base.Sidekick_base_proof_trace.Proof_ser.Step_view)

Module Proof_ser.Step_view

type t =
| Step_input of Step_input.t
| Step_unsat of Step_unsat.t
| Step_rup of Step_rup.t
| Step_bridge_lit_expr of Step_bridge_lit_expr.t
| Step_cc of Step_cc.t
| Step_preprocess of Step_preprocess.t
| Step_clause_rw of Step_clause_rw.t
| Step_bool_tauto of Step_bool_tauto.t
| Step_bool_c of Step_bool_c.t
| Step_proof_p1 of Step_proof_p1.t
| Step_proof_r1 of Step_proof_r1.t
| Step_true of Step_true.t
| Fun_decl of Fun_decl.t
| Expr_def of Expr_def.t
| Expr_bool of Expr_bool.t
| Expr_if of Expr_if.t
| Expr_not of Expr_not.t
| Expr_isa of Expr_isa.t
| Expr_eq of Expr_eq.t
| Expr_app of Expr_app.t
val decode : Bare.Decode.t -> t
  • raises Bare.Decode.Error

    in case of error.

val encode : Bare.Encode.t -> t -> unit
val pp : Stdlib.Format.formatter -> t -> unit
\ No newline at end of file +Step_view (sidekick-base.Sidekick_base_proof_trace.Proof_ser.Step_view)

Module Proof_ser.Step_view

type t =
| Step_input of Step_input.t
| Step_unsat of Step_unsat.t
| Step_rup of Step_rup.t
| Step_bridge_lit_expr of Step_bridge_lit_expr.t
| Step_cc of Step_cc.t
| Step_preprocess of Step_preprocess.t
| Step_clause_rw of Step_clause_rw.t
| Step_bool_tauto of Step_bool_tauto.t
| Step_bool_c of Step_bool_c.t
| Step_proof_p1 of Step_proof_p1.t
| Step_proof_r1 of Step_proof_r1.t
| Step_proof_res of Step_proof_res.t
| Step_true of Step_true.t
| Fun_decl of Fun_decl.t
| Expr_def of Expr_def.t
| Expr_bool of Expr_bool.t
| Expr_if of Expr_if.t
| Expr_not of Expr_not.t
| Expr_isa of Expr_isa.t
| Expr_eq of Expr_eq.t
| Expr_app of Expr_app.t
val decode : Bare.Decode.t -> t
  • raises Bare.Decode.Error

    in case of error.

val encode : Bare.Encode.t -> t -> unit
val pp : Stdlib.Format.formatter -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_proof_trace/Proof_ser/index.html b/dev/sidekick-base/Sidekick_base_proof_trace/Proof_ser/index.html index 12721353..0a86571e 100644 --- a/dev/sidekick-base/Sidekick_base_proof_trace/Proof_ser/index.html +++ b/dev/sidekick-base/Sidekick_base_proof_trace/Proof_ser/index.html @@ -1,2 +1,2 @@ -Proof_ser (sidekick-base.Sidekick_base_proof_trace.Proof_ser)

Module Sidekick_base_proof_trace.Proof_ser

module Bare : sig ... end
module ID : sig ... end
module Lit : sig ... end
module Clause : sig ... end
module Step_input : sig ... end
module Step_rup : sig ... end
module Step_bridge_lit_expr : sig ... end
module Step_cc : sig ... end
module Step_preprocess : sig ... end
module Step_clause_rw : sig ... end
module Step_unsat : sig ... end
module Step_proof_p1 : sig ... end
module Step_proof_r1 : sig ... end
module Step_bool_tauto : sig ... end
module Step_bool_c : sig ... end
module Step_true : sig ... end
module Fun_decl : sig ... end
module Expr_def : sig ... end
module Expr_bool : sig ... end
module Expr_if : sig ... end
module Expr_not : sig ... end
module Expr_eq : sig ... end
module Expr_app : sig ... end
module Expr_isa : sig ... end
module Step_view : sig ... end
module Step : sig ... end
\ No newline at end of file +Proof_ser (sidekick-base.Sidekick_base_proof_trace.Proof_ser)

Module Sidekick_base_proof_trace.Proof_ser

module Bare : sig ... end
module ID : sig ... end
module Lit : sig ... end
module Clause : sig ... end
module Step_input : sig ... end
module Step_rup : sig ... end
module Step_bridge_lit_expr : sig ... end
module Step_cc : sig ... end
module Step_preprocess : sig ... end
module Step_clause_rw : sig ... end
module Step_unsat : sig ... end
module Step_proof_p1 : sig ... end
module Step_proof_r1 : sig ... end
module Step_proof_res : sig ... end
module Step_bool_tauto : sig ... end
module Step_bool_c : sig ... end
module Step_true : sig ... end
module Fun_decl : sig ... end
module Expr_def : sig ... end
module Expr_bool : sig ... end
module Expr_if : sig ... end
module Expr_not : sig ... end
module Expr_eq : sig ... end
module Expr_app : sig ... end
module Expr_isa : sig ... end
module Step_view : sig ... end
module Step : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Solver/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Solver/P/index.html index 852cc2e1..bf21200c 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Solver/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Solver/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Solver.P)

Module Solver.P

type proof_step = Solver_arg.proof_step
type lit = Solver_arg.Lit.t
type proof_rule = t -> proof_step
val lemma_cc : lit Iter.t -> t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Solver.P)

Module Solver.P

type proof_step = Solver_arg.proof_step
type lit = Solver_arg.Lit.t
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..814ebf09 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick-base.Sidekick_base_solver.Solver.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

type elt = proof_step
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit
val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/Actions/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/Actions/P/index.html index 4805350f..4e6e4a1e 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Solver.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Solver.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/Expl/index.html b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/Expl/index.html index d5d716a9..2e6d11e7 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick-base.Sidekick_base_solver.Solver.Solver_internal.CC.Expl)

Module CC.Expl

val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick-base.Sidekick_base_solver.Solver.Solver_internal.CC.Expl)

Module CC.Expl

val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..b7b072c5 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick-base.Sidekick_base_solver.Solver.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

type elt = proof_step
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit
val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/P/index.html index a13db5bb..d501cafe 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Solver.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Solver.Solver_internal.CC.P)

Module CC.P

type t = proof
type proof_step = proof_step
type lit = lit
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/P/index.html index 8ccbe2b0..c1cc739d 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Solver/Solver_internal/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Solver.Solver_internal.P)

Module Solver_internal.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
val lemma_cc : lit Iter.t -> t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Solver.Solver_internal.P)

Module Solver_internal.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Solver_arg/index.html b/dev/sidekick-base/Sidekick_base_solver/Solver_arg/index.html index 789a530d..835faa25 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Solver_arg/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Solver_arg/index.html @@ -1,2 +1,2 @@ -Solver_arg (sidekick-base.Sidekick_base_solver.Solver_arg)

Module Sidekick_base_solver.Solver_arg

Argument to the SMT solver

module Lit = Sidekick_base.Lit
val cc_view : Sidekick_base.Term.t -> (Sidekick_base__Base_types.fun_Sidekick_base.Term.tSidekick_base.Term.t Iter.t) Sidekick_core.CC_view.t
val is_valid_literal : 'a -> bool
type proof = P.t
type proof_step = P.proof_step
\ No newline at end of file +Solver_arg (sidekick-base.Sidekick_base_solver.Solver_arg)

Module Sidekick_base_solver.Solver_arg

Argument to the SMT solver

module Lit = Sidekick_base.Lit
val cc_view : Sidekick_base.Term.t -> (Sidekick_base__Base_types.fun_Sidekick_base.Term.tSidekick_base.Term.t Iter.t) Sidekick_core.CC_view.t
val is_valid_literal : 'a -> bool
type proof = P.t
type proof_step = P.proof_step
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/P/index.html index 22184808..cf9cf8df 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Th_bool.A.S.P)

Module S.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
val lemma_cc : lit Iter.t -> t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Th_bool.A.S.P)

Module S.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..7a287fc5 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick-base.Sidekick_base_solver.Th_bool.A.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

type elt = proof_step
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit
val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/Actions/P/index.html index 7da2ff63..5509b9b6 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Th_bool.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Th_bool.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/Expl/index.html index 3926f83c..8654977d 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick-base.Sidekick_base_solver.Th_bool.A.S.Solver_internal.CC.Expl)

Module CC.Expl

val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick-base.Sidekick_base_solver.Th_bool.A.S.Solver_internal.CC.Expl)

Module CC.Expl

val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..ffd695d0 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick-base.Sidekick_base_solver.Th_bool.A.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

type elt = proof_step
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit
val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/P/index.html index 3160f1b8..d74b313f 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Th_bool.A.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Th_bool.A.S.Solver_internal.CC.P)

Module CC.P

type t = proof
type proof_step = proof_step
type lit = lit
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/P/index.html index 7a4aab34..3af32fef 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_bool/A/S/Solver_internal/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Th_bool.A.S.Solver_internal.P)

Module Solver_internal.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
val lemma_cc : lit Iter.t -> t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Th_bool.A.S.Solver_internal.P)

Module Solver_internal.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/P/index.html index b955db3f..630365aa 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Th_data.A.S.P)

Module S.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
val lemma_cc : lit Iter.t -> t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Th_data.A.S.P)

Module S.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..b109a03e --- /dev/null +++ b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick-base.Sidekick_base_solver.Th_data.A.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

type elt = proof_step
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit
val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/Actions/P/index.html index c84c34ae..cc7156f7 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Th_data.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Th_data.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/Expl/index.html index 575eca86..402c7ed8 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick-base.Sidekick_base_solver.Th_data.A.S.Solver_internal.CC.Expl)

Module CC.Expl

val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick-base.Sidekick_base_solver.Th_data.A.S.Solver_internal.CC.Expl)

Module CC.Expl

val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..f3852fe5 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick-base.Sidekick_base_solver.Th_data.A.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

type elt = proof_step
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit
val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/P/index.html index 51c5da69..1c0a2388 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Th_data.A.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Th_data.A.S.Solver_internal.CC.P)

Module CC.P

type t = proof
type proof_step = proof_step
type lit = lit
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/P/index.html index 34ac424f..6b3803bc 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_data/A/S/Solver_internal/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Th_data.A.S.Solver_internal.P)

Module Solver_internal.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
val lemma_cc : lit Iter.t -> t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Th_data.A.S.Solver_internal.P)

Module Solver_internal.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/P/index.html index 0548873a..11f1d9ed 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Th_lra.A.S.P)

Module S.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
val lemma_cc : lit Iter.t -> t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Th_lra.A.S.P)

Module S.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..df35d0b4 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick-base.Sidekick_base_solver.Th_lra.A.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

type elt = proof_step
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit
val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/Actions/P/index.html index fca2092b..6ee5cb17 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Th_lra.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Th_lra.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/Expl/index.html index 66eea4d3..6012187a 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick-base.Sidekick_base_solver.Th_lra.A.S.Solver_internal.CC.Expl)

Module CC.Expl

val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick-base.Sidekick_base_solver.Th_lra.A.S.Solver_internal.CC.Expl)

Module CC.Expl

val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..e34b9aca --- /dev/null +++ b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick-base.Sidekick_base_solver.Th_lra.A.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

type elt = proof_step
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit
val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/P/index.html index 63bdff32..05bf4491 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Th_lra.A.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Th_lra.A.S.Solver_internal.CC.P)

Module CC.P

type t = proof
type proof_step = proof_step
type lit = lit
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/P/index.html b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/P/index.html index 4a024110..3e5402d7 100644 --- a/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/P/index.html +++ b/dev/sidekick-base/Sidekick_base_solver/Th_lra/A/S/Solver_internal/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-base.Sidekick_base_solver.Th_lra.A.S.Solver_internal.P)

Module Solver_internal.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
val lemma_cc : lit Iter.t -> t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file +P (sidekick-base.Sidekick_base_solver.Th_lra.A.S.Solver_internal.P)

Module Solver_internal.P

type t = proof
type proof_step = proof_step
type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
module Step_vec : sig ... end
val enabled : t -> bool
val emit_input_clause : lit Iter.t -> proof_rule
val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule
val emit_unsat_core : lit Iter.t -> proof_rule
val emit_unsat : proof_step -> t -> unit
val del_clause : proof_step -> lit Iter.t -> t -> unit
val lemma_cc : lit Iter.t -> proof_rule
val define_term : term -> term -> proof_rule
val proof_p1 : proof_step -> proof_step -> proof_rule
val proof_r1 : proof_step -> proof_step -> proof_rule
val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule
val with_defs : proof_step -> proof_step Iter.t -> proof_rule
val lemma_true : term -> proof_rule
val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule
val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/P/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/P/index.html index 6380e5a9..dfc292e2 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/P/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-bin.Sidekick_smtlib.Process.Solver.P)

Module Solver.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick-bin.Sidekick_smtlib.Process.Solver.P)

Module Solver.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..49a2472f --- /dev/null +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Actions/P/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Actions/P/index.html index d4fba7bb..c028e65f 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Actions/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Actions/index.html index 4a160e8c..bf6a0ca5 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Expl/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Expl/index.html index 3172431e..22cd91bb 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..8786a56b --- /dev/null +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/P/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/P/index.html index 81016244..0a7e44e5 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/P/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/index.html index 83afe8c8..f5bbcb69 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/P/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/P/index.html index 3dfcc1ae..2a1e8b44 100644 --- a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/P/index.html +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_arith_lra.Make.1-A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_arith_lra.Make.1-A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..019b8412 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html index 19cccdf0..cb52faf6 100644 --- a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html index 96a038ce..c56ff8b7 100644 --- a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html index 24a56a2f..d10b5321 100644 --- a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..757a5d66 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/P/index.html index 7d8bb0bb..691bb5aa 100644 --- a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/index.html index de68eea4..82240863 100644 --- a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/P/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/P/index.html index 92a0377c..7cfac8a9 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/P/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_arith_lra.ARG.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_arith_lra.ARG.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..8ab0465e --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html index 979de84c..d344cd2a 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/index.html index 0e068fb0..88814618 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Expl/index.html index 74f40376..23b67e7d 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..f274fe6d --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/P/index.html index 25d9c259..c5dd5e06 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/index.html index 75a2a4d4..1c1b425d 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/P/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/P/index.html index 1f882fd2..adbe9fae 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/P/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_arith_lra.S.A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_arith_lra.S.A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..21c09eff --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html index 160b0d80..e95f3c72 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/index.html index eff06a7c..8b48815c 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Expl/index.html index 23947cd1..e1f60f36 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..7d0d791d --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/P/index.html index b10170b2..13b34708 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/index.html index b88d64c8..a8197fcb 100644 --- a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_cc/Make/Expl/index.html b/dev/sidekick/Sidekick_cc/Make/Expl/index.html index 8990414f..98609a81 100644 --- a/dev/sidekick/Sidekick_cc/Make/Expl/index.html +++ b/dev/sidekick/Sidekick_cc/Make/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_cc.Make.Expl)

Module Make.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_cc.Make.Expl)

Module Make.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_cc/Make/P/Step_vec/index.html b/dev/sidekick/Sidekick_cc/Make/P/Step_vec/index.html new file mode 100644 index 00000000..a62f0b4d --- /dev/null +++ b/dev/sidekick/Sidekick_cc/Make/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_cc.Make.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_cc/Make/P/index.html b/dev/sidekick/Sidekick_cc/Make/P/index.html index 8565281f..f15dde1e 100644 --- a/dev/sidekick/Sidekick_cc/Make/P/index.html +++ b/dev/sidekick/Sidekick_cc/Make/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_cc.Make.P)

Module Make.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_cc.Make.P)

Module Make.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_cc/Make/argument-1-A/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_cc/Make/argument-1-A/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..895da6c1 --- /dev/null +++ b/dev/sidekick/Sidekick_cc/Make/argument-1-A/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_cc.Make.1-A.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_cc/Make/argument-1-A/Actions/P/index.html b/dev/sidekick/Sidekick_cc/Make/argument-1-A/Actions/P/index.html index 4ccb7c37..67fb0fb1 100644 --- a/dev/sidekick/Sidekick_cc/Make/argument-1-A/Actions/P/index.html +++ b/dev/sidekick/Sidekick_cc/Make/argument-1-A/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_cc.Make.1-A.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_cc.Make.1-A.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_cc/Make/argument-1-A/Actions/index.html b/dev/sidekick/Sidekick_cc/Make/argument-1-A/Actions/index.html index ea4bfa65..717c663c 100644 --- a/dev/sidekick/Sidekick_cc/Make/argument-1-A/Actions/index.html +++ b/dev/sidekick/Sidekick_cc/Make/argument-1-A/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_cc.Make.1-A.Actions)

Module 1-A.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step
type t

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_cc.Make.1-A.Actions)

Module 1-A.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step
type t

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_cc/Make/argument-1-A/P/Step_vec/index.html b/dev/sidekick/Sidekick_cc/Make/argument-1-A/P/Step_vec/index.html new file mode 100644 index 00000000..91d40ea8 --- /dev/null +++ b/dev/sidekick/Sidekick_cc/Make/argument-1-A/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_cc.Make.1-A.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_cc/Make/argument-1-A/P/index.html b/dev/sidekick/Sidekick_cc/Make/argument-1-A/P/index.html index b448ab58..1f7250de 100644 --- a/dev/sidekick/Sidekick_cc/Make/argument-1-A/P/index.html +++ b/dev/sidekick/Sidekick_cc/Make/argument-1-A/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_cc.Make.1-A.P)

Module 1-A.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_cc.Make.1-A.P)

Module 1-A.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_cc/Make/argument-1-A/index.html b/dev/sidekick/Sidekick_cc/Make/argument-1-A/index.html index e248fcbb..533c48f9 100644 --- a/dev/sidekick/Sidekick_cc/Make/argument-1-A/index.html +++ b/dev/sidekick/Sidekick_cc/Make/argument-1-A/index.html @@ -1,2 +1,2 @@ -A (sidekick.Sidekick_cc.Make.1-A)

Parameter Make.1-A

module Lit : Sidekick_core.LIT with module T = T
type proof
type proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step

View the term through the lens of the congruence closure

\ No newline at end of file +A (sidekick.Sidekick_cc.Make.1-A)

Parameter Make.1-A

module Lit : Sidekick_core.LIT with module T = T
type proof
type proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step

View the term through the lens of the congruence closure

val mk_lit_eq : ?sign:bool -> T.Term.store -> T.Term.t -> T.Term.t -> Lit.t

mk_lit_eq store t u makes the literal t=u

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_cc/Make/index.html b/dev/sidekick/Sidekick_cc/Make/index.html index 6ffe6573..b9682e4d 100644 --- a/dev/sidekick/Sidekick_cc/Make/index.html +++ b/dev/sidekick/Sidekick_cc/Make/index.html @@ -1,4 +1,4 @@ -Make (sidekick.Sidekick_cc.Make)

Module Sidekick_cc.Make

first, some aliases.

Parameters

Signature

module T = A.T
module Lit = A.Lit
type proof = A.proof
type proof_step = A.proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step
module Actions = A.Actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +Make (sidekick.Sidekick_cc.Make)

Module Sidekick_cc.Make

first, some aliases.

Parameters

Signature

module T = A.T
module Lit = A.Lit
type proof = A.proof
type proof_step = A.proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step
module Actions = A.Actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..3379c80f --- /dev/null +++ b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Actions/P/index.html b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Actions/P/index.html index c5daeaa6..8bca07e3 100644 --- a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Actions/index.html b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Actions/index.html index cd39b62e..1c26fb50 100644 --- a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Expl/index.html b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Expl/index.html index 3e1a96f9..3bbc7c95 100644 --- a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/P/Step_vec/index.html new file mode 100644 index 00000000..075d5628 --- /dev/null +++ b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/P/index.html b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/P/index.html index c35146d7..109e1315 100644 --- a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/P/index.html +++ b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/index.html b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/index.html index f694e31a..2d56caeb 100644 --- a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/index.html +++ b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.CC)

Module SI.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.CC)

Module SI.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/P/index.html b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/P/index.html index eb444830..0e2df459 100644 --- a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/P/index.html +++ b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.P)

Module SI.P

Proofs

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = term
type lit = Lit.t
type proof_rule = t -> proof_step
include CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.P)

Module SI.P

Proofs

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = term
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/index.html b/dev/sidekick/Sidekick_core/index.html index 74a067a9..ba65f856 100644 --- a/dev/sidekick/Sidekick_core/index.html +++ b/dev/sidekick/Sidekick_core/index.html @@ -1,2 +1,2 @@ -Sidekick_core (sidekick.Sidekick_core)

Module Sidekick_core

Main Signatures

Theories and concrete solvers rely on an environment that defines several important types:

  • sorts
  • terms (to represent logic expressions and formulas)
  • a congruence closure instance
  • a bridge to some SAT solver

In this module we define most of the main signatures used throughout Sidekick.

module Fmt = CCFormat
module CC_view : sig ... end

View terms through the lens of the Congruence Closure

module type TERM = sig ... end

Main representation of Terms and Types

module type CC_PROOF = sig ... end

Proofs for the congruence closure

module type SAT_PROOF = sig ... end

Signature for SAT-solver proof emission.

module type PROOF = sig ... end

Proofs of unsatisfiability.

module type LIT = sig ... end

Literals

module type CC_ACTIONS = sig ... end

Actions provided to the congruence closure.

module type CC_ARG = sig ... end

Arguments to a congruence closure's implementation

module type CC_S = sig ... end

Main congruence closure signature.

module type SOLVER_INTERNAL = sig ... end

A view of the solver from a theory's point of view.

module type SOLVER = sig ... end

User facing view of the solver.

module type MONOID_ARG = sig ... end

Helper for the congruence closure

module Monoid_of_repr (M : MONOID_ARG) : sig ... end

State for a per-equivalence-class monoid.

\ No newline at end of file +Sidekick_core (sidekick.Sidekick_core)

Module Sidekick_core

Main Signatures

Theories and concrete solvers rely on an environment that defines several important types:

  • sorts
  • terms (to represent logic expressions and formulas)
  • a congruence closure instance
  • a bridge to some SAT solver

In this module we define most of the main signatures used throughout Sidekick.

module Fmt = CCFormat
module CC_view : sig ... end

View terms through the lens of the Congruence Closure

module type TERM = sig ... end

Main representation of Terms and Types

module type SAT_PROOF = sig ... end

Signature for SAT-solver proof emission.

module type PROOF = sig ... end

Proofs of unsatisfiability.

module type LIT = sig ... end

Literals

module type CC_ACTIONS = sig ... end

Actions provided to the congruence closure.

module type CC_ARG = sig ... end

Arguments to a congruence closure's implementation

module type CC_S = sig ... end

Main congruence closure signature.

module type SOLVER_INTERNAL = sig ... end

A view of the solver from a theory's point of view.

module type SOLVER = sig ... end

User facing view of the solver.

module type MONOID_ARG = sig ... end

Helper for the congruence closure

module Monoid_of_repr (M : MONOID_ARG) : sig ... end

State for a per-equivalence-class monoid.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_ACTIONS/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/module-type-CC_ACTIONS/P/Step_vec/index.html new file mode 100644 index 00000000..715adcae --- /dev/null +++ b/dev/sidekick/Sidekick_core/module-type-CC_ACTIONS/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.CC_ACTIONS.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_ACTIONS/P/index.html b/dev/sidekick/Sidekick_core/module-type-CC_ACTIONS/P/index.html index 1ceee59e..05b4b01e 100644 --- a/dev/sidekick/Sidekick_core/module-type-CC_ACTIONS/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-CC_ACTIONS/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.CC_ACTIONS.P)

Module CC_ACTIONS.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.CC_ACTIONS.P)

Module CC_ACTIONS.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_ACTIONS/index.html b/dev/sidekick/Sidekick_core/module-type-CC_ACTIONS/index.html index 1d2daeb2..38f40aa4 100644 --- a/dev/sidekick/Sidekick_core/module-type-CC_ACTIONS/index.html +++ b/dev/sidekick/Sidekick_core/module-type-CC_ACTIONS/index.html @@ -1,2 +1,2 @@ -CC_ACTIONS (sidekick.Sidekick_core.CC_ACTIONS)

Module type Sidekick_core.CC_ACTIONS

Actions provided to the congruence closure.

The congruence closure must be able to propagate literals when it detects that they are true or false; it must also be able to create conflicts when the set of (dis)equalities is inconsistent

module T : TERM
module Lit : LIT with module T = T
type proof
type proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step
type t

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +CC_ACTIONS (sidekick.Sidekick_core.CC_ACTIONS)

Module type Sidekick_core.CC_ACTIONS

Actions provided to the congruence closure.

The congruence closure must be able to propagate literals when it detects that they are true or false; it must also be able to create conflicts when the set of (dis)equalities is inconsistent

module T : TERM
module Lit : LIT with module T = T
type proof
type proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step
type t

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_ARG/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/module-type-CC_ARG/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..7735d6c9 --- /dev/null +++ b/dev/sidekick/Sidekick_core/module-type-CC_ARG/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.CC_ARG.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_ARG/Actions/P/index.html b/dev/sidekick/Sidekick_core/module-type-CC_ARG/Actions/P/index.html index 2a16e4d9..30b4d0a5 100644 --- a/dev/sidekick/Sidekick_core/module-type-CC_ARG/Actions/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-CC_ARG/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.CC_ARG.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.CC_ARG.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_ARG/Actions/index.html b/dev/sidekick/Sidekick_core/module-type-CC_ARG/Actions/index.html index 72acea38..9b645a93 100644 --- a/dev/sidekick/Sidekick_core/module-type-CC_ARG/Actions/index.html +++ b/dev/sidekick/Sidekick_core/module-type-CC_ARG/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_core.CC_ARG.Actions)

Module CC_ARG.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step
type t

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_core.CC_ARG.Actions)

Module CC_ARG.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step
type t

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_ARG/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/module-type-CC_ARG/P/Step_vec/index.html new file mode 100644 index 00000000..b7fa8482 --- /dev/null +++ b/dev/sidekick/Sidekick_core/module-type-CC_ARG/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.CC_ARG.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_ARG/P/index.html b/dev/sidekick/Sidekick_core/module-type-CC_ARG/P/index.html index a1807d60..241fd90e 100644 --- a/dev/sidekick/Sidekick_core/module-type-CC_ARG/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-CC_ARG/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.CC_ARG.P)

Module CC_ARG.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.CC_ARG.P)

Module CC_ARG.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_ARG/index.html b/dev/sidekick/Sidekick_core/module-type-CC_ARG/index.html index e6a197bc..dc35b2c3 100644 --- a/dev/sidekick/Sidekick_core/module-type-CC_ARG/index.html +++ b/dev/sidekick/Sidekick_core/module-type-CC_ARG/index.html @@ -1,2 +1,2 @@ -CC_ARG (sidekick.Sidekick_core.CC_ARG)

Module type Sidekick_core.CC_ARG

Arguments to a congruence closure's implementation

module T : TERM
module Lit : LIT with module T = T
type proof
type proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step
module Actions : CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step
val cc_view : T.Term.t -> (T.Fun.tT.Term.tT.Term.t Iter.t) CC_view.t

View the term through the lens of the congruence closure

\ No newline at end of file +CC_ARG (sidekick.Sidekick_core.CC_ARG)

Module type Sidekick_core.CC_ARG

Arguments to a congruence closure's implementation

module T : TERM
module Lit : LIT with module T = T
type proof
type proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step
module Actions : CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step
val cc_view : T.Term.t -> (T.Fun.tT.Term.tT.Term.t Iter.t) CC_view.t

View the term through the lens of the congruence closure

val mk_lit_eq : ?sign:bool -> T.Term.store -> T.Term.t -> T.Term.t -> Lit.t

mk_lit_eq store t u makes the literal t=u

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_PROOF/index.html b/dev/sidekick/Sidekick_core/module-type-CC_PROOF/index.html deleted file mode 100644 index 1cd3208d..00000000 --- a/dev/sidekick/Sidekick_core/module-type-CC_PROOF/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CC_PROOF (sidekick.Sidekick_core.CC_PROOF)

Module type Sidekick_core.CC_PROOF

Proofs for the congruence closure

type proof_step
type t
type lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_S/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/module-type-CC_S/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..2293b6e8 --- /dev/null +++ b/dev/sidekick/Sidekick_core/module-type-CC_S/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.CC_S.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_S/Actions/P/index.html b/dev/sidekick/Sidekick_core/module-type-CC_S/Actions/P/index.html index d80be79f..862421ad 100644 --- a/dev/sidekick/Sidekick_core/module-type-CC_S/Actions/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-CC_S/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.CC_S.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.CC_S.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_S/Actions/index.html b/dev/sidekick/Sidekick_core/module-type-CC_S/Actions/index.html index 749ef029..f1ce5c35 100644 --- a/dev/sidekick/Sidekick_core/module-type-CC_S/Actions/index.html +++ b/dev/sidekick/Sidekick_core/module-type-CC_S/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_core.CC_S.Actions)

Module CC_S.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step
type t

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_core.CC_S.Actions)

Module CC_S.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step
type t

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_S/Expl/index.html b/dev/sidekick/Sidekick_core/module-type-CC_S/Expl/index.html index 6d69c902..2279adfd 100644 --- a/dev/sidekick/Sidekick_core/module-type-CC_S/Expl/index.html +++ b/dev/sidekick/Sidekick_core/module-type-CC_S/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_core.CC_S.Expl)

Module CC_S.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_core.CC_S.Expl)

Module CC_S.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_S/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/module-type-CC_S/P/Step_vec/index.html new file mode 100644 index 00000000..79bae91d --- /dev/null +++ b/dev/sidekick/Sidekick_core/module-type-CC_S/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.CC_S.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_S/P/index.html b/dev/sidekick/Sidekick_core/module-type-CC_S/P/index.html index d8560d5b..31266846 100644 --- a/dev/sidekick/Sidekick_core/module-type-CC_S/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-CC_S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.CC_S.P)

Module CC_S.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.CC_S.P)

Module CC_S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-CC_S/index.html b/dev/sidekick/Sidekick_core/module-type-CC_S/index.html index 0cae1357..85cb558b 100644 --- a/dev/sidekick/Sidekick_core/module-type-CC_S/index.html +++ b/dev/sidekick/Sidekick_core/module-type-CC_S/index.html @@ -1,4 +1,4 @@ -CC_S (sidekick.Sidekick_core.CC_S)

Module type Sidekick_core.CC_S

Main congruence closure signature.

The congruence closure handles the theory QF_UF (uninterpreted function symbols). It is also responsible for theory combination, and provides a general framework for equality reasoning that other theories piggyback on.

For example, the theory of datatypes relies on the congruence closure to do most of the work, and "only" adds injectivity/disjointness/acyclicity lemmas when needed.

Similarly, a theory of arrays would hook into the congruence closure and assert (dis)equalities as needed.

first, some aliases.

module T : TERM
module Lit : LIT with module T = T
type proof
type proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step
module Actions : CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC_S (sidekick.Sidekick_core.CC_S)

Module type Sidekick_core.CC_S

Main congruence closure signature.

The congruence closure handles the theory QF_UF (uninterpreted function symbols). It is also responsible for theory combination, and provides a general framework for equality reasoning that other theories piggyback on.

For example, the theory of datatypes relies on the congruence closure to do most of the work, and "only" adds injectivity/disjointness/acyclicity lemmas when needed.

Similarly, a theory of arrays would hook into the congruence closure and assert (dis)equalities as needed.

first, some aliases.

module T : TERM
module Lit : LIT with module T = T
type proof
type proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step
module Actions : CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..cd715950 --- /dev/null +++ b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.MONOID_ARG.SI.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Actions/P/index.html b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Actions/P/index.html index 68b7bbe7..474a1758 100644 --- a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.MONOID_ARG.SI.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.MONOID_ARG.SI.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Actions/index.html b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Actions/index.html index 920ddb6b..3e2d08a3 100644 --- a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_core.MONOID_ARG.SI.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_core.MONOID_ARG.SI.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Expl/index.html b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Expl/index.html index d38911bf..7d2f2b62 100644 --- a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_core.MONOID_ARG.SI.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_core.MONOID_ARG.SI.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/P/Step_vec/index.html new file mode 100644 index 00000000..e79d3ba5 --- /dev/null +++ b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.MONOID_ARG.SI.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/P/index.html b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/P/index.html index 77d67f80..bbe2863f 100644 --- a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.MONOID_ARG.SI.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.MONOID_ARG.SI.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/index.html b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/index.html index 26073477..da88c0e6 100644 --- a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/index.html +++ b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_core.MONOID_ARG.SI.CC)

Module SI.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_core.MONOID_ARG.SI.CC)

Module SI.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/P/index.html b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/P/index.html index ab538578..56379d8c 100644 --- a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.MONOID_ARG.SI.P)

Module SI.P

Proofs

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = term
type lit = Lit.t
type proof_rule = t -> proof_step
include CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_core.MONOID_ARG.SI.P)

Module SI.P

Proofs

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = term
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-PROOF/index.html b/dev/sidekick/Sidekick_core/module-type-PROOF/index.html index eb5f9b47..5336499a 100644 --- a/dev/sidekick/Sidekick_core/module-type-PROOF/index.html +++ b/dev/sidekick/Sidekick_core/module-type-PROOF/index.html @@ -1,2 +1,2 @@ -PROOF (sidekick.Sidekick_core.PROOF)

Module type Sidekick_core.PROOF

Proofs of unsatisfiability.

type t

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit
type proof_rule = t -> proof_step
include CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +PROOF (sidekick.Sidekick_core.PROOF)

Module type Sidekick_core.PROOF

Proofs of unsatisfiability.

type t

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER/P/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER/P/index.html index 8e223e36..cefd3192 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.SOLVER.P)

Module SOLVER.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_core.SOLVER.P)

Module SOLVER.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..97c417c7 --- /dev/null +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.SOLVER.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Actions/P/index.html index 49fa7589..497f6f90 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.SOLVER.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.SOLVER.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Actions/index.html index db274fd7..599a1b76 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_core.SOLVER.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_core.SOLVER.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Expl/index.html index a6c3dff7..4fba800a 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_core.SOLVER.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_core.SOLVER.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..2637e857 --- /dev/null +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.SOLVER.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/P/index.html index 7f67a0d6..2c0901ce 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.SOLVER.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.SOLVER.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/index.html index b0b8b367..15ada424 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_core.SOLVER.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_core.SOLVER.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..c797fd21 --- /dev/null +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.SOLVER_INTERNAL.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Actions/P/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Actions/P/index.html index b6156891..e50cb7ca 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.SOLVER_INTERNAL.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.SOLVER_INTERNAL.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Actions/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Actions/index.html index 5ca996d0..bf98514f 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_core.SOLVER_INTERNAL.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_core.SOLVER_INTERNAL.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Expl/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Expl/index.html index d1aeb515..8f2b6ba2 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_core.SOLVER_INTERNAL.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_core.SOLVER_INTERNAL.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/P/Step_vec/index.html new file mode 100644 index 00000000..66e0781c --- /dev/null +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_core.SOLVER_INTERNAL.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/P/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/P/index.html index 8adeaab1..3d85c526 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.SOLVER_INTERNAL.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_core.SOLVER_INTERNAL.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/index.html index 806738e6..73f88747 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_core.SOLVER_INTERNAL.CC)

Module SOLVER_INTERNAL.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_core.SOLVER_INTERNAL.CC)

Module SOLVER_INTERNAL.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/P/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/P/index.html index 44e8b1a8..2e0c84c9 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/P/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_core.SOLVER_INTERNAL.P)

Module SOLVER_INTERNAL.P

Proofs

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = term
type lit = Lit.t
type proof_rule = t -> proof_step
include CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_core.SOLVER_INTERNAL.P)

Module SOLVER_INTERNAL.P

Proofs

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = term
type lit = Lit.t
type proof_rule = t -> proof_step
include SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_quip/Proof/index.html b/dev/sidekick/Sidekick_quip/Proof/index.html index 06be892c..41dc8c0c 100644 --- a/dev/sidekick/Sidekick_quip/Proof/index.html +++ b/dev/sidekick/Sidekick_quip/Proof/index.html @@ -1,2 +1,2 @@ -Proof (sidekick.Sidekick_quip.Proof)

Module Sidekick_quip.Proof

type id = int

A reference to a previously defined object in the proof

module Ty : sig ... end

Representation of types

module Fun : sig ... end
module Cstor = Fun
module T : sig ... end

Representation of terms, with explicit sharing

type term = T.t
type ty = Ty.t
module Lit : sig ... end
type clause = Lit.t list
type t =
| Unspecified
| Sorry
| Sorry_c of clause
| Named of string
| Refl of term
| CC_lemma_imply of t list * term * term
| CC_lemma of clause
| Assertion of term
| Assertion_c of clause
| Hres of t * hres_step list
| Res of term * t * t
| Res1 of t * t
| Paramod1 of t * t
| Rup of clause * t list
| Clause_rw of {
res : clause;
c0 : t;
using : t list;(*

the rewriting equations/atoms

*)
}
| DT_isa_split of ty * term list
| DT_isa_disj of ty * term * term
| DT_cstor_inj of Cstor.t * int * term list * term list
| Bool_true_is_true
| Bool_true_neq_false
| Bool_eq of term * term
| Bool_c of bool_c_name * term list
| Ite_true of term
| Ite_false of term
| LRA of clause
| Composite of {
assumptions : (string * Lit.t) list;
steps : composite_step array;
}
and bool_c_name = string
and composite_step =
| S_step_c of {
name : string;
res : clause;
proof : t;
}
| S_define_t of term * term
| S_define_t_name of string * term
and hres_step =
| R of {
pivot : term;
p : t;
}
| R1 of t
| P of {
lhs : term;
rhs : term;
p : t;
}
| P1 of t
val r : t -> pivot:term -> hres_step
val r1 : t -> hres_step
val p : t -> lhs:term -> rhs:term -> hres_step
val p1 : t -> hres_step
val stepc : name:string -> clause -> t -> composite_step
val deft : term -> term -> composite_step
val deft_name : string -> term -> composite_step
val is_trivial_refl : t -> bool
val default : t
val sorry_c : Lit.t Iter.t -> t
val sorry_c_l : clause -> t
val sorry : t
val refl : term -> t
val ref_by_name : string -> t
val cc_lemma : clause -> t
val cc_imply_l : t list -> term -> term -> t
val cc_imply2 : t -> t -> term -> term -> t
val assertion : term -> t
val assertion_c : Lit.t Iter.t -> t
val assertion_c_l : clause -> t
val rup : clause -> t list -> t
val clause_rw : t -> res:clause -> using:t list -> t
val composite_a : ?assms:(string * Lit.t) list -> composite_step array -> t
val composite_l : ?assms:(string * Lit.t) list -> composite_step list -> t
val composite_iter : ?assms:(string * Lit.t) list -> composite_step Iter.t -> t
val isa_split : ty -> term Iter.t -> t
val isa_disj : ty -> term -> term -> t
val cstor_inj : Cstor.t -> int -> term list -> term list -> t
val ite_true : term -> t
val ite_false : term -> t
val true_is_true : t
val true_neq_false : t
val bool_eq : term -> term -> t
val bool_c : bool_c_name -> term list -> t
val hres_l : t -> hres_step list -> t
val hres_iter : t -> hres_step Iter.t -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val paramod1 : t -> t -> t
val lra_l : clause -> t
val lra : Lit.t Iter.t -> t
\ No newline at end of file +Proof (sidekick.Sidekick_quip.Proof)

Module Sidekick_quip.Proof

type id = int

A reference to a previously defined object in the proof

module Ty : sig ... end

Representation of types

module Fun : sig ... end
module Cstor = Fun
module T : sig ... end

Representation of terms, with explicit sharing

type term = T.t
type ty = Ty.t
module Lit : sig ... end
type clause = Lit.t list
type t =
| Unspecified
| Sorry
| Sorry_c of clause
| Named of string
| Refl of term
| CC_lemma_imply of t list * term * term
| CC_lemma of clause
| Assertion of term
| Assertion_c of clause
| Hres of t * hres_step list
| Res of term * t * t
| Res1 of t * t
| Paramod1 of t * t
| Rup of clause * t list
| Clause_rw of {
res : clause;
c0 : t;
using : t list;(*

the rewriting equations/atoms

*)
}
| DT_isa_split of ty * term list
| DT_isa_disj of ty * term * term
| DT_cstor_inj of Cstor.t * int * term list * term list
| Bool_true_is_true
| Bool_true_neq_false
| Bool_eq of term * term
| Bool_c of bool_c_name * term list
| Ite_true of term
| Ite_false of term
| LRA of clause
| Composite of {
assumptions : (string * Lit.t) list;
steps : composite_step array;
}
and bool_c_name = string
and composite_step =
| S_step_c of {
name : string;
res : clause;
proof : t;
}
(*

A named step in Composite, with the expected result. This decouples the checking of the sub-proof, from its use in the rest of the proof, as we can use res even if checking proof failed.

*)
| S_step_anon of {
name : string;
proof : t;
}
(*

A named intermediate proof, to be reused in subsequent proofs. Unlike S_step_c we do not specify the expected result so if this fails, any proof downstream will also fail.

*)
| S_define_t of term * term
| S_define_t_name of string * term
and hres_step =
| R of {
pivot : term;
p : t;
}
| R1 of t
| P of {
lhs : term;
rhs : term;
p : t;
}
| P1 of t
val r : t -> pivot:term -> hres_step
val r1 : t -> hres_step
val p : t -> lhs:term -> rhs:term -> hres_step
val p1 : t -> hres_step
val stepc : name:string -> clause -> t -> composite_step
val step_anon : name:string -> t -> composite_step
val deft : term -> term -> composite_step
val deft_name : string -> term -> composite_step
val is_trivial_refl : t -> bool
val default : t
val sorry_c : Lit.t Iter.t -> t
val sorry_c_l : clause -> t
val sorry : t
val refl : term -> t
val ref_by_name : string -> t
val cc_lemma : clause -> t
val cc_imply_l : t list -> term -> term -> t
val cc_imply2 : t -> t -> term -> term -> t
val assertion : term -> t
val assertion_c : Lit.t Iter.t -> t
val assertion_c_l : clause -> t
val rup : clause -> t list -> t
val clause_rw : t -> res:clause -> using:t list -> t
val composite_a : ?assms:(string * Lit.t) list -> composite_step array -> t
val composite_l : ?assms:(string * Lit.t) list -> composite_step list -> t
val composite_iter : ?assms:(string * Lit.t) list -> composite_step Iter.t -> t
val isa_split : ty -> term Iter.t -> t
val isa_disj : ty -> term -> term -> t
val cstor_inj : Cstor.t -> int -> term list -> term list -> t
val ite_true : term -> t
val ite_false : term -> t
val true_is_true : t
val true_neq_false : t
val bool_eq : term -> term -> t
val bool_c : bool_c_name -> term list -> t
val hres_l : t -> hres_step list -> t
val hres_iter : t -> hres_step Iter.t -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val paramod1 : t -> t -> t
val lra_l : clause -> t
val lra : Lit.t Iter.t -> t
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..2e0e15a3 --- /dev/null +++ b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_smt_solver.Make.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Actions/P/index.html index 2898d33e..9db84be0 100644 --- a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_smt_solver.Make.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_smt_solver.Make.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Actions/index.html index 2a369f8e..30ec6268 100644 --- a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_smt_solver.Make.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_smt_solver.Make.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Expl/index.html index 30f5f9a8..7d42810f 100644 --- a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_smt_solver.Make.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_smt_solver.Make.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..83a4d9e4 --- /dev/null +++ b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_smt_solver.Make.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/P/index.html index a8674e95..26e90121 100644 --- a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_smt_solver.Make.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_smt_solver.Make.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/index.html index cfb5f900..bac2e94a 100644 --- a/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_smt_solver/Make/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_smt_solver.Make.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_smt_solver.Make.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/Make/argument-1-A/P/index.html b/dev/sidekick/Sidekick_smt_solver/Make/argument-1-A/P/index.html index f953abbd..7cd9286e 100644 --- a/dev/sidekick/Sidekick_smt_solver/Make/argument-1-A/P/index.html +++ b/dev/sidekick/Sidekick_smt_solver/Make/argument-1-A/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_smt_solver.Make.1-A.P)

Module 1-A.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_smt_solver.Make.1-A.P)

Module 1-A.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/Make/argument-1-A/index.html b/dev/sidekick/Sidekick_smt_solver/Make/argument-1-A/index.html index 3458539c..2bd095e6 100644 --- a/dev/sidekick/Sidekick_smt_solver/Make/argument-1-A/index.html +++ b/dev/sidekick/Sidekick_smt_solver/Make/argument-1-A/index.html @@ -1,2 +1,2 @@ -A (sidekick.Sidekick_smt_solver.Make.1-A)

Parameter Make.1-A

module Lit : Sidekick_core.LIT with module T = T
type proof
type proof_step
module P : Sidekick_core.PROOF with type term = T.Term.t and type t = proof and type proof_step = proof_step and type lit = Lit.t
val is_valid_literal : T.Term.t -> bool

Is this a valid boolean literal? (e.g. is it a closed term, not inside a quantifier)

\ No newline at end of file +A (sidekick.Sidekick_smt_solver.Make.1-A)

Parameter Make.1-A

module Lit : Sidekick_core.LIT with module T = T
type proof
type proof_step
module P : Sidekick_core.PROOF with type term = T.Term.t and type t = proof and type proof_step = proof_step and type lit = Lit.t
val mk_eq : T.Term.store -> T.Term.t -> T.Term.t -> T.Term.t

mk_eq store t u builds the term t=u

val is_valid_literal : T.Term.t -> bool

Is this a valid boolean literal? (e.g. is it a closed term, not inside a quantifier)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/module-type-ARG/P/index.html b/dev/sidekick/Sidekick_smt_solver/module-type-ARG/P/index.html index 5f0ed1cc..e5769c6d 100644 --- a/dev/sidekick/Sidekick_smt_solver/module-type-ARG/P/index.html +++ b/dev/sidekick/Sidekick_smt_solver/module-type-ARG/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_smt_solver.ARG.P)

Module ARG.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_smt_solver.ARG.P)

Module ARG.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_smt_solver/module-type-ARG/index.html b/dev/sidekick/Sidekick_smt_solver/module-type-ARG/index.html index b3d6abc1..9e9bc485 100644 --- a/dev/sidekick/Sidekick_smt_solver/module-type-ARG/index.html +++ b/dev/sidekick/Sidekick_smt_solver/module-type-ARG/index.html @@ -1,2 +1,2 @@ -ARG (sidekick.Sidekick_smt_solver.ARG)

Module type Sidekick_smt_solver.ARG

Argument to pass to the functor Make in order to create a new Msat-based SMT solver.

module Lit : Sidekick_core.LIT with module T = T
type proof
type proof_step
module P : Sidekick_core.PROOF with type term = T.Term.t and type t = proof and type proof_step = proof_step and type lit = Lit.t
val is_valid_literal : T.Term.t -> bool

Is this a valid boolean literal? (e.g. is it a closed term, not inside a quantifier)

\ No newline at end of file +ARG (sidekick.Sidekick_smt_solver.ARG)

Module type Sidekick_smt_solver.ARG

Argument to pass to the functor Make in order to create a new Msat-based SMT solver.

module Lit : Sidekick_core.LIT with module T = T
type proof
type proof_step
module P : Sidekick_core.PROOF with type term = T.Term.t and type t = proof and type proof_step = proof_step and type lit = Lit.t
val mk_eq : T.Term.store -> T.Term.t -> T.Term.t -> T.Term.t

mk_eq store t u builds the term t=u

val is_valid_literal : T.Term.t -> bool

Is this a valid boolean literal? (e.g. is it a closed term, not inside a quantifier)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/P/index.html b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/P/index.html index 9b888ff4..25c72951 100644 --- a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/P/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_bool_static.Make.1-A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_th_bool_static.Make.1-A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..4b4f8bca --- /dev/null +++ b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html index d05fccdc..9fa8a487 100644 --- a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html index b9329e5d..2e5d9dc8 100644 --- a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html index be129109..1cc8b3df 100644 --- a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..f8313f33 --- /dev/null +++ b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/P/index.html index 33ab50ea..dc70ed31 100644 --- a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/index.html index 6a2aa2ec..74f694b1 100644 --- a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/P/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/P/index.html index 972d5f4a..3722a55d 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/P/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_bool_static.ARG.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_th_bool_static.ARG.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..ade5cc17 --- /dev/null +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html index 291acfd1..6e5fbb86 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Actions/index.html index 3efc3421..b3ea1e48 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Expl/index.html index 82b86789..4b0d997a 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..b608ad78 --- /dev/null +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/P/index.html index 85850a4e..4803b2b0 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/index.html index be3c1bd4..4295e19c 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/P/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/P/index.html index b7e9e31d..57c48702 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/P/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_bool_static.S.A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_th_bool_static.S.A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..700ff4e5 --- /dev/null +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html index 9546d294..0b210b31 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Actions/index.html index 7e37f43a..f3782e1d 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Expl/index.html index b1913c2b..4f883af4 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..caae3e69 --- /dev/null +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/P/index.html index 48757813..86932264 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/index.html index 8a869bb4..4b76a8dd 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/P/index.html b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/P/index.html index 404cbfd3..8cfc1492 100644 --- a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/P/index.html +++ b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_cstor.Make.1-A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_th_cstor.Make.1-A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..559c2f1c --- /dev/null +++ b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html index 7bf167a5..f2832920 100644 --- a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html index e6eed9d5..f5d1f82d 100644 --- a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html index aefbc99b..91243b26 100644 --- a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..0d3a0f8c --- /dev/null +++ b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/P/index.html index 27d3caa5..0a89087a 100644 --- a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/index.html index d11ed17e..049a7d41 100644 --- a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/P/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/P/index.html index 2f763be7..4c8d6172 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/P/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_cstor.ARG.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_th_cstor.ARG.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..362f263e --- /dev/null +++ b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html index 615dcf20..b03057f2 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Actions/index.html index 623558df..962158a0 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Expl/index.html index 242b5bc4..a2133c59 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..5f130252 --- /dev/null +++ b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/P/index.html index 39975cf6..46a68c51 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/index.html index 01d8293b..29aef64b 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/P/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/P/index.html index 755dbbe0..c9a8a652 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/P/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_cstor.S.A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_th_cstor.S.A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..247bd626 --- /dev/null +++ b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html index 6425eb70..62989fc8 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Actions/index.html index 4d158d6e..21515dcf 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Expl/index.html index e0e3f910..47e20fa1 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..9e21a1d9 --- /dev/null +++ b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/P/index.html index c8924942..4f9570a2 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/index.html index f65e96c2..5fca3997 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/P/index.html b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/P/index.html index fede49a6..a1ac2c45 100644 --- a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/P/index.html +++ b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_data.Make.1-A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_th_data.Make.1-A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..cbc81cf9 --- /dev/null +++ b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html index 4dc260e0..99e890fd 100644 --- a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html index a87e485b..200c3170 100644 --- a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html index 98310dcc..91826eb6 100644 --- a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..ce245e99 --- /dev/null +++ b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/P/index.html index e39927e8..0df325e4 100644 --- a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/index.html index 8822c776..52771f80 100644 --- a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/P/index.html b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/P/index.html index 4f91d26f..352dcc07 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/P/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_data.ARG.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_th_data.ARG.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..9aa346fc --- /dev/null +++ b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_data.ARG.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html index 8541226c..b0153ff0 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_data.ARG.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_data.ARG.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Actions/index.html index 0630089e..bac60e56 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_th_data.ARG.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_th_data.ARG.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Expl/index.html index 1f735081..2d15fde8 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_th_data.ARG.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_th_data.ARG.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..e858e813 --- /dev/null +++ b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_data.ARG.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/P/index.html index f1b9f376..6052f1fe 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_data.ARG.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_data.ARG.S.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/index.html index 2f82b59d..910eeaa5 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_th_data.ARG.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_th_data.ARG.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/P/index.html b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/P/index.html index b8c3c848..fecebcb5 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/P/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_data.S.A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.CC_PROOF with type t := t and type lit := lit and type proof_step := proof_step
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file +P (sidekick.Sidekick_th_data.S.A.S.P)

Module S.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html new file mode 100644 index 00000000..72d09f31 --- /dev/null +++ b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Actions/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_data.S.A.S.Solver_internal.CC.Actions.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html index 469be97f..51906fe5 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Actions/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_data.S.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type proof_step = proof_step
type t = proof
type lit = Lit.t
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_data.S.A.S.Solver_internal.CC.Actions.P)

Module Actions.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term = T.Term.t
type lit = Lit.t
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Actions/index.html b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Actions/index.html index 6e111a92..8f7e4a93 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Actions/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Actions/index.html @@ -1,2 +1,2 @@ -Actions (sidekick.Sidekick_th_data.S.A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file +Actions (sidekick.Sidekick_th_data.S.A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type term = T.Term.t and type proof_step = proof_step

An action handle. It is used by the congruence closure to perform the actions below. How it performs the actions is not specified and is solver-specific.

val proof : t -> proof
val raise_conflict : t -> Lit.t list -> proof_step -> 'a

raise_conflict acts c pr declares that c is a tautology of the theory of congruence. This does not return (it should raise an exception).

  • parameter pr

    the proof of c being a tautology

val propagate : t -> Lit.t -> reason:(unit -> Lit.t list * proof_step) -> unit

propagate acts lit ~reason pr declares that reason() => lit is a tautology.

  • reason() should return a list of literals that are currently true.
  • lit should be a literal of interest (see CC_S.set_as_lit).

This function might never be called, a congruence closure has the right to not propagate and only trigger conflicts.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Expl/index.html index 149e676d..e32cb7da 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Expl/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/Expl/index.html @@ -1,2 +1,2 @@ -Expl (sidekick.Sidekick_th_data.S.A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t
val mk_lit : lit -> t
val mk_list : t list -> t
val mk_theory : proof_step -> t list -> t
\ No newline at end of file +Expl (sidekick.Sidekick_th_data.S.A.S.Solver_internal.CC.Expl)

Module CC.Expl

Explanations

Explanations are specialized proofs, created by the congruence closure when asked to justify why 2 terms are equal.

type t
val pp : t Sidekick_core.Fmt.printer
val mk_merge : N.t -> N.t -> t
val mk_merge_t : term -> term -> t

Explanation: the terms were explicitly merged

val mk_lit : lit -> t

Explanation: we merged t and u because of literal t=u, or we merged t and true because of literal t, or t and false because of literal ¬t

val mk_list : t list -> t

Conjunction of explanations

val mk_theory : term -> term -> (term * term * t list) list -> proof_step -> t

mk_theory t u expl_sets pr builds a theory explanation for why |- t=u. It depends on sub-explanations expl_sets which are tuples (t_i, u_i, expls_i) where expls_i are explanations that justify t_i = u_i in the current congruence closure.

The proof pr is the theory lemma, of the form (t_i = u_i)_i |- t=u . It is resolved against each expls_i |- t_i=u_i obtained from expl_sets, on pivot t_i=u_i, to obtain a proof of Gamma |- t=u where Gamma is a subset of the literals asserted into the congruence closure.

For example for the lemma a=b deduced by injectivity from Some a=Some b in the theory of datatypes, the arguments would be a, b, [Some a, Some b, mk_merge_t (Some a)(Some b)], pr where pr is the injectivity lemma Some a=Some b |- a=b.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/P/Step_vec/index.html b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/P/Step_vec/index.html new file mode 100644 index 00000000..ce03909a --- /dev/null +++ b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/P/Step_vec/index.html @@ -0,0 +1,2 @@ + +Step_vec (sidekick.Sidekick_th_data.S.A.S.Solver_internal.CC.P.Step_vec)

Module P.Step_vec

A vector of steps

include Sidekick_util.Vec_sig.BASE with type elt = proof_step
include Sidekick_util.Vec_sig.BASE_RO with type elt = proof_step
type elt = proof_step
type t
val size : t -> int
val get : t -> int -> elt
val iter : f:(elt -> unit) -> t -> unit
val iteri : f:(int -> elt -> unit) -> t -> unit
val create : ?cap:int -> unit -> t
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val push : t -> elt -> unit
val fast_remove : t -> int -> unit

Remove element at index i without preserving order (swap with last element)

val filter_in_place : (elt -> bool) -> t -> unit
val ensure_size : t -> int -> unit
val pop : t -> elt
val set : t -> int -> elt -> unit
val shrink : t -> int -> unit
include Sidekick_util.Vec_sig.EXTENSIONS with type t := t and type elt := elt
val to_iter : t -> elt Iter.t
val to_array : t -> elt array
val fold_left : ('a -> elt -> 'a) -> 'a -> t -> 'a
val pp : elt CCFormat.printer -> t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/P/index.html b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/P/index.html index f5be8412..0a37ac13 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/P/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_th_data.S.A.S.Solver_internal.CC.P)

Module CC.P

type proof_step = proof_step
type t = proof
type lit = lit
val lemma_cc : lit Iter.t -> t -> proof_step

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

\ No newline at end of file +P (sidekick.Sidekick_th_data.S.A.S.Solver_internal.CC.P)

Module CC.P

type t = proof

The abstract representation of a proof. A proof always proves a clause to be valid (true in every possible interpretation of the problem's assertions, and the theories)

type proof_step = proof_step

Identifier for a proof proof_rule (like a unique ID for a clause previously added/proved)

type term
type lit = lit
type proof_rule = t -> proof_step
include Sidekick_core.SAT_PROOF with type t := t and type lit := lit and type proof_step := proof_step and type proof_rule := proof_rule

A vector of steps

val enabled : t -> bool

Returns true if proof production is enabled

val emit_input_clause : lit Iter.t -> proof_rule

Emit an input clause.

val emit_redundant_clause : lit Iter.t -> hyps:proof_step Iter.t -> proof_rule

Emit a clause deduced by the SAT solver, redundant wrt previous clauses. The clause must be RUP wrt hyps.

val emit_unsat_core : lit Iter.t -> proof_rule

Produce a proof of the empty clause given this subset of the assumptions. FIXME: probably needs the list of proof_step that disprove the lits?

val emit_unsat : proof_step -> t -> unit

Signal "unsat" result at the given proof

val del_clause : proof_step -> lit Iter.t -> t -> unit

Forget a clause. Only useful for performance considerations.

val lemma_cc : lit Iter.t -> proof_rule

lemma_cc proof lits asserts that lits form a tautology for the theory of uninterpreted functions.

val define_term : term -> term -> proof_rule

define_term cst u proof defines the new constant cst as being equal to u. The result is a proof of the clause cst = u

val proof_p1 : proof_step -> proof_step -> proof_rule

proof_p1 p1 p2, where p1 proves the unit clause t=u (t:bool) and p2 proves C \/ t, is the rule that produces C \/ u, i.e unit paramodulation.

val proof_r1 : proof_step -> proof_step -> proof_rule

proof_r1 p1 p2, where p1 proves the unit clause |- t (t:bool) and p2 proves C \/ ¬t, is the rule that produces C \/ u, i.e unit resolution.

val proof_res : pivot:term -> proof_step -> proof_step -> proof_rule

proof_res ~pivot p1 p2, where p1 proves the clause |- C \/ l and p2 proves D \/ ¬l, where l is either pivot or ¬pivot, is the rule that produces C \/ D, i.e boolean resolution.

val with_defs : proof_step -> proof_step Iter.t -> proof_rule

with_defs pr defs specifies that pr is valid only in a context where the definitions defs are present.

val lemma_true : term -> proof_rule

lemma_true (true) p asserts the clause (true)

val lemma_preprocess : term -> term -> using:proof_step Iter.t -> proof_rule

lemma_preprocess t u ~using p asserts that t = u is a tautology and that t has been preprocessed into u.

The theorem /\_{eqn in using} eqn |- t=u is proved using congruence closure, and then resolved against the clauses using to obtain a unit equality.

From now on, t and u will be used interchangeably.

  • returns

    a proof_rule ID for the clause (t=u).

val lemma_rw_clause : proof_step -> res:lit Iter.t -> using:proof_step Iter.t -> proof_rule

lemma_rw_clause prc ~res ~using, where prc is the proof of |- c, uses the equations |- p_i = q_i from using to rewrite some literals of c into res. This is used to preprocess literals of a clause (using lemma_preprocess individually).

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/index.html b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/index.html index cfd415e8..d031fee0 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/CC/index.html @@ -1,4 +1,4 @@ -CC (sidekick.Sidekick_th_data.S.A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.CC_PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> +CC (sidekick.Sidekick_th_data.S.A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

first, some aliases.

module T = T
module Lit = Lit
type proof = proof
type proof_step = proof_step
module P : Sidekick_core.PROOF with type lit = Lit.t and type t = proof and type proof_step = proof_step with type t = proof with type lit = lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and type proof = proof and type proof_step = proof_step with type t = theory_actions
type term_store = T.Term.store
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type actions = Actions.t
type t

The congruence closure object. It contains a fair amount of state and is mutable and backtrackable.

module N : sig ... end

Equivalence classes.

module Expl : sig ... end

Explanations

type node = N.t

A node of the congruence closure

type repr = N.t

Node that is currently a representative

type explanation = Expl.t

Accessors

val term_store : t -> term_store
val proof : t -> proof
val find : t -> node -> repr

Current representative

val add_term : t -> term -> node

Add the term to the congruence closure, if not present already. Will be backtracked.

val mem_term : t -> term -> bool

Returns true if the term is explicitly present in the congruence closure

Events

Events triggered by the congruence closure, to which other plugins can subscribe.

type ev_on_pre_merge = t -> actions -> N.t -> N.t -> Expl.t -> unit

ev_on_pre_merge cc acts n1 n2 expl is called right before n1 and n2 are merged with explanation expl.

type ev_on_post_merge = t -> actions -> N.t -> N.t -> unit

ev_on_post_merge cc acts n1 n2 is called right after n1 and n2 were merged. find cc n1 and find cc n2 will return the same node.

type ev_on_new_term = t -> N.t -> term -> unit

ev_on_new_term cc n t is called whenever a new term t is added to the congruence closure. Its node is n.

type ev_on_conflict = t -> th:bool -> lit list -> unit

ev_on_conflict acts ~th c is called when the congruence closure triggers a conflict by asserting the tautology c.

  • parameter th

    true if the explanation for this conflict involves at least one "theory" explanation; i.e. some of the equations participating in the conflict are purely syntactic theories like injectivity of constructors.

type ev_on_propagate = t -> lit -> (unit -> lit list * proof_step) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See CC_ACTIONS.propagate.

type ev_on_is_subterm = N.t -> term -> unit

ev_on_is_subterm n t is called when n is a subterm of another node for the first time. t is the term corresponding to the node n. This can be useful for theory combination.

val create : ?stat:Sidekick_util.Stat.t -> ?on_pre_merge:ev_on_pre_merge list -> ?on_post_merge:ev_on_post_merge list -> ?on_new_term:ev_on_new_term list -> ?on_conflict:ev_on_conflict list -> ?on_propagate:ev_on_propagate list -> ?on_is_subterm:ev_on_is_subterm list -> ?size:[ `Small | `Big ] -> term_store -> proof -> t

Create a new congruence closure.

  • parameter term_store

    used to be able to create new terms. All terms interacting with this congruence closure must belong in this term state as well.

val allocate_bitfield : descr:string -> t -> N.bitfield

Allocate a new node field (see N.bitfield).

This field descriptor is henceforth reserved for all nodes in this congruence closure, and can be set using set_bitfield for each node individually. This can be used to efficiently store some metadata on nodes (e.g. "is there a numeric value in the class" or "is there a constructor term in the class").

There may be restrictions on how many distinct fields are allocated for a given congruence closure (e.g. at most Sys.int_size fields).

val get_bitfield : t -> N.bitfield -> N.t -> bool

Access the bit field of the given node

val set_bitfield : t -> N.bitfield -> bool -> N.t -> unit

Set the bitfield for the node. This will be backtracked. See N.bitfield.

val on_pre_merge : t -> ev_on_pre_merge -> unit

Add a function to be called when two classes are merged

val on_post_merge : t -> ev_on_post_merge -> unit

Add a function to be called when two classes are merged

val on_new_term : t -> ev_on_new_term -> unit

Add a function to be called when a new node is created

val on_conflict : t -> ev_on_conflict -> unit

Called when the congruence closure finds a conflict

val on_propagate : t -> ev_on_propagate -> unit

Called when the congruence closure propagates a literal

val on_is_subterm : t -> ev_on_is_subterm -> unit

Called on terms that are subterms of function symbols

val set_as_lit : t -> N.t -> lit -> unit

map the given node to a literal.

val find_t : t -> term -> repr

Current representative of the term.

  • raises Not_found

    if the term is not already add-ed.

val add_seq : t -> term Iter.t -> unit

Add a sequence of terms to the congruence closure

val all_classes : t -> repr Iter.t

All current classes. This is costly, only use if there is no other solution

val assert_lit : t -> lit -> unit

Given a literal, assume it in the congruence closure and propagate its consequences. Will be backtracked.

Useful for the theory combination or the SAT solver's functor

val assert_lits : t -> lit Iter.t -> unit

Addition of many literals

val explain_eq : t -> N.t -> N.t -> lit list

Explain why the two nodes are equal. Fails if they are not, in an unspecified way

val raise_conflict_from_expl : t -> actions -> Expl.t -> 'a

Raise a conflict with the given explanation it must be a theory tautology that expl ==> absurd. To be used in theories.

val n_true : t -> N.t

Node for true

val n_false : t -> N.t

Node for false

val n_bool : t -> bool -> N.t

Node for either true or false

val merge : t -> N.t -> N.t -> Expl.t -> unit

Merge these two nodes given this explanation. It must be a theory tautology that expl ==> n1 = n2. To be used in theories.

val merge_t : t -> term -> term -> Expl.t -> unit

Shortcut for adding + merging

val check : t -> actions -> unit

Perform all pending operations done via assert_eq, assert_lit, etc. Will use the actions to propagate literals, declare conflicts, etc.

val new_merges : t -> bool

Called after check, returns true if some pairs of classes were merged.

val push_level : t -> unit

Push backtracking level

val pop_levels : t -> int -> unit

Restore to state n calls to push_level earlier. Used during backtracking.

val get_model : t -> N.t Iter.t Iter.t

get all the equivalence classes so they can be merged in the model

\ No newline at end of file