diff --git a/dev/index.html b/dev/index.html index 92cf2744..b76179ef 100644 --- a/dev/index.html +++ b/dev/index.html @@ -12,7 +12,7 @@

OCaml package documentation

  1. sidekick dev
  2. -
  3. sidekick-arith dev
  4. +
  5. sidekick-base dev
  6. sidekick-bin dev
diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Comb/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Comb/index.html deleted file mode 100644 index c910f185..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Comb/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comb (sidekick-arith.Sidekick_arith_lra.Linear_expr.Make.Comb)

Module Make.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Constr/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Constr/index.html deleted file mode 100644 index 27ef1ee1..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Constr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constr (sidekick-arith.Sidekick_arith_lra.Linear_expr.Make.Constr)

Module Make.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Expr/index.html deleted file mode 100644 index 253fc558..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expr (sidekick-arith.Sidekick_arith_lra.Linear_expr.Make.Expr)

Module Make.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/argument-1-C/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/argument-1-C/index.html deleted file mode 100644 index a32563bf..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/argument-1-C/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -1-C (sidekick-arith.Sidekick_arith_lra.Linear_expr.Make.1-C)

Parameter Make.1-C

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/argument-2-Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/argument-2-Var/index.html deleted file mode 100644 index 61aeff2d..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/argument-2-Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -2-Var (sidekick-arith.Sidekick_arith_lra.Linear_expr.Make.2-Var)

Parameter Make.2-Var

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/index.html deleted file mode 100644 index e1a11b0d..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (sidekick-arith.Sidekick_arith_lra.Linear_expr.Make)

Module Linear_expr.Make

Parameters

Signature

module C = C

Coeficients used. Can be integers as well as rationals.

module Var = Var

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map = CCMap.Make(Var)

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/index.html deleted file mode 100644 index 868fbe3a..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Linear_expr (sidekick-arith.Sidekick_arith_lra.Linear_expr)

Module Sidekick_arith_lra.Linear_expr

Arithmetic expressions

module type COEFF = Sidekick_arith_lra__.Linear_expr_intf.COEFF
module type VAR = Sidekick_arith_lra__.Linear_expr_intf.VAR
module type S = Sidekick_arith_lra__.Linear_expr_intf.S
type nonrec bool_op = Sidekick_arith_lra__.Linear_expr_intf.bool_op =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
module Make : functor (C : COEFF) -> functor (Var : VAR) -> S with module C = C and module Var = Var and module Var_map = CCMap.Make(Var)
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-COEFF/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-COEFF/index.html deleted file mode 100644 index a460a233..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-COEFF/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -COEFF (sidekick-arith.Sidekick_arith_lra.Linear_expr.COEFF)

Module type Linear_expr.COEFF

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/C/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/C/index.html deleted file mode 100644 index 54f4003c..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/C/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -C (sidekick-arith.Sidekick_arith_lra.Linear_expr.S.C)

Module S.C

Coeficients used. Can be integers as well as rationals.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Comb/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Comb/Infix/index.html deleted file mode 100644 index 93faf587..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Comb/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra.Linear_expr.S.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Comb/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Comb/index.html deleted file mode 100644 index 821d94db..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Comb/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comb (sidekick-arith.Sidekick_arith_lra.Linear_expr.S.Comb)

Module S.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Constr/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Constr/index.html deleted file mode 100644 index b0b2c71d..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Constr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constr (sidekick-arith.Sidekick_arith_lra.Linear_expr.S.Constr)

Module S.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Expr/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Expr/Infix/index.html deleted file mode 100644 index 627a8fc3..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Expr/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra.Linear_expr.S.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Expr/index.html deleted file mode 100644 index 6e39b116..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expr (sidekick-arith.Sidekick_arith_lra.Linear_expr.S.Expr)

Module S.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Var/index.html deleted file mode 100644 index dc9ac21c..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Var (sidekick-arith.Sidekick_arith_lra.Linear_expr.S.Var)

Module S.Var

Variables used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/index.html deleted file mode 100644 index d84ae8b3..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra.Linear_expr.S)

Module type Linear_expr.S

module C : Sidekick_arith_lra__.Linear_expr_intf.COEFF

Coeficients used. Can be integers as well as rationals.

module Var : Sidekick_arith_lra__.Linear_expr_intf.VAR

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-VAR/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-VAR/index.html deleted file mode 100644 index 83aa7439..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/module-type-VAR/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -VAR (sidekick-arith.Sidekick_arith_lra.Linear_expr.VAR)

Module type Linear_expr.VAR

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/Gensym/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/Gensym/index.html deleted file mode 100644 index 30ec4b92..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/Gensym/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Gensym (sidekick-arith.Sidekick_arith_lra.Make.1-A.Gensym)

Module 1-A.Gensym

type t
val create : S.T.Term.state -> t
val tst : t -> S.T.Term.state
val copy : t -> t
val fresh_term : t -> pre:string -> S.T.Ty.t -> term

Make a fresh term of the given type

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Atom/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Atom/index.html deleted file mode 100644 index 8541bddb..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Atom (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.Atom)

Module S.Atom

Boolean Atoms

Atoms are the SAT solver's version of our boolean literals (they may have a different representation).

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t CCFormat.printer
val neg : t -> t
val formula : t -> lit
val sign : t -> bool
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Lit/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Lit/index.html deleted file mode 100644 index da90129d..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Lit/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Lit (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.Lit)

Module S.Lit

module T = T

Literals depend on terms

type t

A literal

val term : t -> T.Term.t

Get the (positive) term

val sign : t -> bool

Get the sign. A negated literal has sign false.

val neg : t -> t

Take negation of literal. sign (neg lit) = not (sign lit).

val abs : t -> t

abs lit is like lit but always positive, i.e. sign (abs lit) = true

val signed_term : t -> T.Term.t * bool
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Model/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Model/index.html deleted file mode 100644 index ed8ced21..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Model/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Model (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.Model)

Module S.Model

Models

A model can be produced when the solver is found to be in a satisfiable state after a call to solve.

type t
val empty : t
val mem : t -> term -> bool
val find : t -> term -> term option
val eval : t -> term -> term option
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/P/Quip/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/P/Quip/index.html deleted file mode 100644 index 844b4da5..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/P/Quip/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Quip (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.P.Quip)

Module P.Quip

val output : Stdlib.out_channel -> t -> unit

Printer in Quip format (experimental)

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

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Pre_proof/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Pre_proof/index.html deleted file mode 100644 index ba72323f..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Pre_proof/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Pre_proof (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.Pre_proof)

Module S.Pre_proof

Internal representation of proofs

A type or state convertible into P.t

type t
val output : Stdlib.out_channel -> t -> unit

Output onto a channel, efficiently

val pp_debug : t Sidekick_core.Fmt.printer
val pp_dot : t Sidekick_core.Fmt.printer option

Optional printer into DOT/graphviz

val check : t -> unit

Check the proof (to an unspecified level of confidence; this can be a no-op). May fail.

val to_proof : t -> P.t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html deleted file mode 100644 index a32af7fa..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Actions (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
module P = P
type t = actions

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 raise_conflict : t -> Lit.t list -> P.t -> '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 * P.t) -> unit

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

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-arith/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html deleted file mode 100644 index 019254b2..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expl (sidekick-arith.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_proof : P.t -> t
val mk_theory : t -> t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/N/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/N/index.html deleted file mode 100644 index f3e4df16..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/N/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -N (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.N)

Module CC.N

An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".

All information pertaining to the whole equivalence class is stored in this representative's node.

When two classes become equal (are "merged"), one of the two representatives is picked as the representative of the new class. The new class contains the union of the two old classes' nodes.

We also allow theories to store additional information in the representative. This information can be used when two classes are merged, to detect conflicts and solve equations à la Shostak.

type t

An equivalent class, containing terms that are proved to be equal.

A value of type t points to a particular term, but see find to get the representative of the class.

val term : t -> term
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
val is_root : t -> bool

Is the node a root (ie the representative of its class)? See find to get the root.

val iter_class : t -> t Iter.t

Traverse the congruence class. Precondition: is_root n (see find below)

val iter_parents : t -> t Iter.t

Traverse the parents of the class. Precondition: is_root n (see find below)

type bitfield

A field in the bitfield of this node. This should only be allocated when a theory is initialized.

All fields are initially 0, are backtracked automatically, and are merged automatically when classes are merged.

val get_field : bitfield -> t -> bool

Access the bit field

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

Module Solver_internal.CC

Congruence closure instance

module T = T
module P = P
module Lit = Lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and module P = P and type t = actions
type term_state = T.Term.state
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type proof = P.t
type actions = Actions.t
type t

State of the congruence closure

module N : sig ... end

An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".

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_state : t -> term_state
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 * P.t) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See Sidekick_core.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_state -> t

Create a new congruence closure.

parameter term_state

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 bitfield for the nodes. See N.bitfield.

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-arith/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/Simplify/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/Simplify/index.html deleted file mode 100644 index 98d81425..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/Simplify/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Simplify (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.Solver_internal.Simplify)

Module Solver_internal.Simplify

Simplify terms

type t
val tst : t -> term_state
val ty_st : t -> ty_state
val clear : t -> unit

Reset internal cache, etc.

type hook = t -> term -> (term * proof) option

Given a term, try to simplify it. Return None if it didn't change.

A simple example could be a hook that takes a term t, and if t is app "+" (const x) (const y) where x and y are number, returns Some (const (x+y)), and None otherwise.

val normalize : t -> term -> (term * P.t) option

Normalize a term using all the hooks. This performs a fixpoint, i.e. it only stops when no hook applies anywhere inside the term.

val normalize_t : t -> term -> term * P.t

Normalize a term using all the hooks, along with a proof that the simplification is correct. returns t, refl t if no simplification occurred.

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

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/T/Fun/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/T/Fun/index.html deleted file mode 100644 index 9b4012e4..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/T/Fun/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.T.Fun)

Module T.Fun

A function symbol, like "f" or "plus" or "is_human" or "socrates"

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/T/Term/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/T/Term/index.html deleted file mode 100644 index 65b140c4..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/T/Term/index.html +++ /dev/null @@ -1,8 +0,0 @@ - -Term (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.T.Term)

Module T.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
-let y = f x x in
-let z = g y x in
-z = z

the DAG has the following nodes:

n1: 2
-n2: f n1 n1
-n3: g n2 n1
-n4: = n3 n3
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/T/Ty/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/T/Ty/index.html deleted file mode 100644 index 57bfa85f..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/T/Ty/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ty (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.T.Ty)

Module T.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/T/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/T/index.html deleted file mode 100644 index 4928dbbf..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/T/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -T (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.T)

Module S.T

module Fun : sig ... end

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end

Types

module Term : sig ... end

Term structure.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Unknown/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Unknown/index.html deleted file mode 100644 index 8a189194..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/Unknown/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Unknown (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.Unknown)

Module S.Unknown

type t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/index.html deleted file mode 100644 index 7ff8e927..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra.Make.1-A.S)

Module 1-A.S

module T : Sidekick_core.TERM
module P : Sidekick_core.PROOF with type term = T.Term.t
module Lit : Sidekick_core.LIT with module T = T
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = Lit

Internal solver, available to theories.

type t

The solver's state.

type solver = t
type term = T.Term.t
type ty = T.Ty.t
type lit = Lit.t
type proof = P.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

type 'a theory_p = (module THEORY with type t = 'a)

A theory that can be used for this particular solver, with state of type 'a.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory.

module Atom : sig ... end
module Model : sig ... end

Models

module Unknown : sig ... end

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> T.Term.state
val ty_st : t -> T.Ty.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> unit -> t

Create a new solver.

It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.

parameter store_proof

if true, proofs from the SAT solver and theories are retained and potentially accessible after solve returns UNSAT.

parameter size

influences the size of initial allocations.

parameter theories

theories to load from the start. Other theories can be added using add_theory.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val add_theory_p : t -> 'a theory_p -> 'a

Add the given theory and obtain its state

val add_theory_l : t -> theory list -> unit
val mk_atom_lit : t -> lit -> Atom.t * P.t

mk_atom_lit _ lit returns atom, pr where atom is an internal atom for the solver, and pr is a proof of |- lit = atom

val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t * P.t

mk_atom_t _ ~sign t returns atom, pr where atom is an internal representation of ± t, and pr is a proof of |- atom = (± t)

val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unit

add_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.

val add_clause_l : t -> Atom.t list -> P.t -> unit

Add a clause to the solver, given as a list.

module Pre_proof : sig ... end
type res =
| Sat of Model.t

Satisfiable

| Unsat of {
proof : Pre_proof.t option lazy_t;

proof of unsat

unsat_core : Atom.t list lazy_t;

subset of assumptions responsible for unsat

}

Unsatisfiable

| Unknown of Unknown.t

Unknown, obtained after a timeout, memory limit, etc.

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> ?⁠on_progress:(t -> unit) -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the clauses added so far to s.

parameter check

if true, the model is checked before returning.

parameter on_progress

called regularly during solving.

parameter assumptions

a set of atoms held to be true. The unsat core, if any, will be a subset of assumptions.

parameter on_exit

functions to be run before this returns

val pp_stats : t CCFormat.printer

Print some statistics. What it prints exactly is unspecified.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/module-type-THEORY/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/module-type-THEORY/index.html deleted file mode 100644 index 86110944..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/S/module-type-THEORY/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -THEORY (sidekick-arith.Sidekick_arith_lra.Make.1-A.S.THEORY)

Module type S.THEORY

A theory

Theories are abstracted over the concrete implementation of the solver, so they can work with any implementation.

Typically a theory should be a functor taking an argument containing a SOLVER_INTERNAL or even a full SOLVER, and some additional views on terms, literals, etc. that are specific to the theory (e.g. to map terms to linear expressions). The theory can then be instantiated on any kind of solver for any term representation that also satisfies the additional theory-specific requirements. Instantiated theories (ie values of type Sidekick_core.SOLVER.theory) can be added to the solver.

type t

The theory's state

val name : string

Name of the theory (ideally, unique and short)

val create_and_setup : Solver_internal.t -> t

Instantiate the theory's state for the given (internal) solver, register callbacks, create keys, etc.

Called once for every solver this theory is added to.

val push_level : t -> unit

Push backtracking level. When the corresponding pop is called, the theory's state should be restored to a state equivalent to what it was just before push_level.

it does not have to be exactly the same state, it just needs to be equivalent.

val pop_levels : t -> int -> unit

pop_levels theory n pops n backtracking levels, restoring theory to its state before calling push_level n times.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/index.html deleted file mode 100644 index 3313be3f..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/argument-1-A/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -1-A (sidekick-arith.Sidekick_arith_lra.Make.1-A)

Parameter Make.1-A

module S : Sidekick_core.SOLVER
type term = S.T.Term.t
type ty = S.T.Ty.t
val view_as_lra : term -> term lra_view

Project the term into the theory view

val mk_bool : S.T.Term.state -> bool -> term
val mk_lra : S.T.Term.state -> term lra_view -> term

Make a term from the given theory view

val ty_lra : S.T.Term.state -> ty
val mk_eq : S.T.Term.state -> term -> term -> term

syntactic equality

val has_ty_real : term -> bool

Does this term have the type Real

val proof_lra : S.P.lit Iter.t -> S.P.t

TODO: more accurate certificates

val proof_lra_l : S.P.lit list -> S.P.t
module Gensym : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Make/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Make/index.html deleted file mode 100644 index 0ebfa8ba..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (sidekick-arith.Sidekick_arith_lra.Make)

Module Sidekick_arith_lra.Make

Parameters

Signature

module A = A
type state
val create : ?⁠stat:Sidekick_util.Stat.t -> A.S.T.Term.state -> A.S.T.Ty.state -> state
val theory : A.S.theory
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Predicate/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Predicate/index.html deleted file mode 100644 index e9df801e..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Predicate/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Predicate (sidekick-arith.Sidekick_arith_lra.Predicate)

Module Sidekick_arith_lra.Predicate

type t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
val neg : t -> t
val neg_sign : t -> t
val to_string : t -> string
val pp : Sidekick_util.Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/Constraint/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/Constraint/index.html deleted file mode 100644 index 52e00bc4..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/Constraint/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constraint (sidekick-arith.Sidekick_arith_lra.Simplex2.Make.Constraint)

Module Make.Constraint

type op = Op.t
type t = {
op : op;
lhs : V.t;
rhs : num;
}

A constraint is the comparison of a variable to a constant.

val mk : V.t -> op -> num -> t
val leq : V.t -> num -> t
val lt : V.t -> num -> t
val geq : V.t -> num -> t
val gt : V.t -> num -> t
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/Subst/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/Subst/index.html deleted file mode 100644 index 70fc5304..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/Subst/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Subst (sidekick-arith.Sidekick_arith_lra.Simplex2.Make.Subst)

Module Make.Subst

type t = num V_map.t
val eval : t -> V.t -> Q.t
val pp : t Sidekick_util.Fmt.printer
val to_string : t -> string
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/Unsat_cert/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/Unsat_cert/index.html deleted file mode 100644 index 9789f1b3..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/Unsat_cert/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Unsat_cert (sidekick-arith.Sidekick_arith_lra.Simplex2.Make.Unsat_cert)

Module Make.Unsat_cert

type t = unsat_cert
val lits : t -> V.lit list
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/argument-1-Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/argument-1-Var/index.html deleted file mode 100644 index 027e96d6..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/argument-1-Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -1-Var (sidekick-arith.Sidekick_arith_lra.Simplex2.Make.1-Var)

Parameter Make.1-Var

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/index.html deleted file mode 100644 index 891d1711..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (sidekick-arith.Sidekick_arith_lra.Simplex2.Make)

Module Simplex2.Make

Parameters

Signature

module V = Var
module V_map : CCMap.S with type V_map.key = V.t
type num = Q.t

Numbers

module Constraint : sig ... end
module Subst : sig ... end
type t
val create : ?⁠stat:Sidekick_util.Stat.t -> unit -> t

Create a new simplex.

val push_level : t -> unit
val pop_levels : t -> int -> unit
val define : t -> V.t -> (num * V.t) list -> unit

Define a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t

type unsat_cert
module Unsat_cert : sig ... end
exception E_unsat of Unsat_cert.t
type ev_on_propagate = V.lit -> reason:V.lit list -> unit
val add_var : t -> V.t -> unit

Make sure the variable exists in the simplex.

val add_constraint : on_propagate:ev_on_propagate -> t -> Constraint.t -> V.lit -> unit

Add a constraint to the simplex.

raises Unsat

if it's immediately obvious that this is not satisfiable.

val declare_bound : t -> Constraint.t -> V.lit -> unit

Declare that this constraint exists, so we can possibly propagate it. Unlike add_constraint this does NOT assert that the constraint is true

val check_exn : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> unit

Check the whole simplex for satisfiability.

parameter on_propagate

is called with arguments lit, reason whenever reason => lit is found to be true by the simplex.

raises Unsat

if the constraints are not satisfiable.

type result =
| Sat of Subst.t
| Unsat of Unsat_cert.t
val check : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> result

Call check_exn and return a model or a proof of unsat.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Op/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Op/index.html deleted file mode 100644 index 429e4d05..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/Op/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Op (sidekick-arith.Sidekick_arith_lra.Simplex2.Op)

Module Simplex2.Op

Basic operator

type t =
| Leq
| Lt
| Geq
| Gt
val neg_sign : t -> t
val not_ : t -> t
val to_string : t -> string
val pp : Sidekick_util.Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/index.html deleted file mode 100644 index b402b6a1..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Simplex2 (sidekick-arith.Sidekick_arith_lra.Simplex2)

Module Sidekick_arith_lra.Simplex2

Fast Simplex for CDCL(T)

We follow the paper "Integrating Simplex with DPLL(T )" from de Moura and Dutertre.

module type VAR = Sidekick_arith_lra__.Linear_expr_intf.VAR
module Op : sig ... end
module type S = sig ... end
module Make : functor (Var : VAR) -> S with module V = Var
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/Constraint/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/Constraint/index.html deleted file mode 100644 index 6698cd6f..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/Constraint/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constraint (sidekick-arith.Sidekick_arith_lra.Simplex2.S.Constraint)

Module S.Constraint

type op = Op.t
type t = {
op : op;
lhs : V.t;
rhs : num;
}

A constraint is the comparison of a variable to a constant.

val mk : V.t -> op -> num -> t
val leq : V.t -> num -> t
val lt : V.t -> num -> t
val geq : V.t -> num -> t
val gt : V.t -> num -> t
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/Subst/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/Subst/index.html deleted file mode 100644 index 1c87f7bf..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/Subst/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Subst (sidekick-arith.Sidekick_arith_lra.Simplex2.S.Subst)

Module S.Subst

type t = num V_map.t
val eval : t -> V.t -> Q.t
val pp : t Sidekick_util.Fmt.printer
val to_string : t -> string
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/Unsat_cert/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/Unsat_cert/index.html deleted file mode 100644 index 42624508..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/Unsat_cert/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Unsat_cert (sidekick-arith.Sidekick_arith_lra.Simplex2.S.Unsat_cert)

Module S.Unsat_cert

type t = unsat_cert
val lits : t -> V.lit list
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/V/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/V/index.html deleted file mode 100644 index 9245d9ee..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/V/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -V (sidekick-arith.Sidekick_arith_lra.Simplex2.S.V)

Module S.V

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/index.html deleted file mode 100644 index 7e75b738..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra.Simplex2.S)

Module type Simplex2.S

module V : VAR
module V_map : CCMap.S with type V_map.key = V.t
type num = Q.t

Numbers

module Constraint : sig ... end
module Subst : sig ... end
type t
val create : ?⁠stat:Sidekick_util.Stat.t -> unit -> t

Create a new simplex.

val push_level : t -> unit
val pop_levels : t -> int -> unit
val define : t -> V.t -> (num * V.t) list -> unit

Define a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t

type unsat_cert
module Unsat_cert : sig ... end
exception E_unsat of Unsat_cert.t
type ev_on_propagate = V.lit -> reason:V.lit list -> unit
val add_var : t -> V.t -> unit

Make sure the variable exists in the simplex.

val add_constraint : on_propagate:ev_on_propagate -> t -> Constraint.t -> V.lit -> unit

Add a constraint to the simplex.

raises Unsat

if it's immediately obvious that this is not satisfiable.

val declare_bound : t -> Constraint.t -> V.lit -> unit

Declare that this constraint exists, so we can possibly propagate it. Unlike add_constraint this does NOT assert that the constraint is true

val check_exn : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> unit

Check the whole simplex for satisfiability.

parameter on_propagate

is called with arguments lit, reason whenever reason => lit is found to be true by the simplex.

raises Unsat

if the constraints are not satisfiable.

type result =
| Sat of Subst.t
| Unsat of Unsat_cert.t
val check : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> result

Call check_exn and return a model or a proof of unsat.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-VAR/index.html b/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-VAR/index.html deleted file mode 100644 index c6b13ea3..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/Simplex2/module-type-VAR/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -VAR (sidekick-arith.Sidekick_arith_lra.Simplex2.VAR)

Module type Simplex2.VAR

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/index.html b/dev/sidekick-arith/Sidekick_arith_lra/index.html deleted file mode 100644 index 9d950b6d..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_arith_lra (sidekick-arith.Sidekick_arith_lra)

Module Sidekick_arith_lra

Linear Rational Arithmetic

module Simplex2 : sig ... end
module Predicate : sig ... end
module Linear_expr : sig ... end

Arithmetic expressions

module S_op = Simplex2.Op
type pred = Sidekick_arith_lra__.Linear_expr_intf.bool_op =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
type op =
| Plus
| Minus
type 'a lra_view =
| LRA_pred of pred * 'a * 'a
| LRA_op of op * 'a * 'a
| LRA_mult of Q.t * 'a
| LRA_const of Q.t
| LRA_simplex_var of 'a
| LRA_simplex_pred of 'a * S_op.t * Q.t
| LRA_other of 'a
val map_view : ('a -> 'b) -> 'a lra_view -> 'b lra_view
module type ARG = sig ... end
module type S = sig ... end
module Make : functor (A : ARG) -> S with module A = A
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/Gensym/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/Gensym/index.html deleted file mode 100644 index 6d50879f..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/Gensym/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Gensym (sidekick-arith.Sidekick_arith_lra.ARG.Gensym)

Module ARG.Gensym

type t
val create : S.T.Term.state -> t
val tst : t -> S.T.Term.state
val copy : t -> t
val fresh_term : t -> pre:string -> S.T.Ty.t -> term

Make a fresh term of the given type

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Atom/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Atom/index.html deleted file mode 100644 index 488a322a..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Atom (sidekick-arith.Sidekick_arith_lra.ARG.S.Atom)

Module S.Atom

Boolean Atoms

Atoms are the SAT solver's version of our boolean literals (they may have a different representation).

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t CCFormat.printer
val neg : t -> t
val formula : t -> lit
val sign : t -> bool
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Lit/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Lit/index.html deleted file mode 100644 index f08c7a42..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Lit/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Lit (sidekick-arith.Sidekick_arith_lra.ARG.S.Lit)

Module S.Lit

module T = T

Literals depend on terms

type t

A literal

val term : t -> T.Term.t

Get the (positive) term

val sign : t -> bool

Get the sign. A negated literal has sign false.

val neg : t -> t

Take negation of literal. sign (neg lit) = not (sign lit).

val abs : t -> t

abs lit is like lit but always positive, i.e. sign (abs lit) = true

val signed_term : t -> T.Term.t * bool
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Model/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Model/index.html deleted file mode 100644 index 7654e471..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Model/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Model (sidekick-arith.Sidekick_arith_lra.ARG.S.Model)

Module S.Model

Models

A model can be produced when the solver is found to be in a satisfiable state after a call to solve.

type t
val empty : t
val mem : t -> term -> bool
val find : t -> term -> term option
val eval : t -> term -> term option
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/P/Quip/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/P/Quip/index.html deleted file mode 100644 index 1430ded7..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/P/Quip/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Quip (sidekick-arith.Sidekick_arith_lra.ARG.S.P.Quip)

Module P.Quip

val output : Stdlib.out_channel -> t -> unit

Printer in Quip format (experimental)

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

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Pre_proof/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Pre_proof/index.html deleted file mode 100644 index 09f02d5d..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Pre_proof/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Pre_proof (sidekick-arith.Sidekick_arith_lra.ARG.S.Pre_proof)

Module S.Pre_proof

Internal representation of proofs

A type or state convertible into P.t

type t
val output : Stdlib.out_channel -> t -> unit

Output onto a channel, efficiently

val pp_debug : t Sidekick_core.Fmt.printer
val pp_dot : t Sidekick_core.Fmt.printer option

Optional printer into DOT/graphviz

val check : t -> unit

Check the proof (to an unspecified level of confidence; this can be a no-op). May fail.

val to_proof : t -> P.t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/index.html deleted file mode 100644 index 02738fb2..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Actions (sidekick-arith.Sidekick_arith_lra.ARG.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
module P = P
type t = actions

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 raise_conflict : t -> Lit.t list -> P.t -> '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 * P.t) -> unit

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

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-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Expl/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Expl/index.html deleted file mode 100644 index 5e78c888..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Expl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expl (sidekick-arith.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_proof : P.t -> t
val mk_theory : t -> t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/N/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/N/index.html deleted file mode 100644 index b0bdda97..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/N/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -N (sidekick-arith.Sidekick_arith_lra.ARG.S.Solver_internal.CC.N)

Module CC.N

An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".

All information pertaining to the whole equivalence class is stored in this representative's node.

When two classes become equal (are "merged"), one of the two representatives is picked as the representative of the new class. The new class contains the union of the two old classes' nodes.

We also allow theories to store additional information in the representative. This information can be used when two classes are merged, to detect conflicts and solve equations à la Shostak.

type t

An equivalent class, containing terms that are proved to be equal.

A value of type t points to a particular term, but see find to get the representative of the class.

val term : t -> term
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
val is_root : t -> bool

Is the node a root (ie the representative of its class)? See find to get the root.

val iter_class : t -> t Iter.t

Traverse the congruence class. Precondition: is_root n (see find below)

val iter_parents : t -> t Iter.t

Traverse the parents of the class. Precondition: is_root n (see find below)

type bitfield

A field in the bitfield of this node. This should only be allocated when a theory is initialized.

All fields are initially 0, are backtracked automatically, and are merged automatically when classes are merged.

val get_field : bitfield -> t -> bool

Access the bit field

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

Module Solver_internal.CC

Congruence closure instance

module T = T
module P = P
module Lit = Lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and module P = P and type t = actions
type term_state = T.Term.state
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type proof = P.t
type actions = Actions.t
type t

State of the congruence closure

module N : sig ... end

An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".

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_state : t -> term_state
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 * P.t) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See Sidekick_core.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_state -> t

Create a new congruence closure.

parameter term_state

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 bitfield for the nodes. See N.bitfield.

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-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/Simplify/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/Simplify/index.html deleted file mode 100644 index 16c4a06c..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/Simplify/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Simplify (sidekick-arith.Sidekick_arith_lra.ARG.S.Solver_internal.Simplify)

Module Solver_internal.Simplify

Simplify terms

type t
val tst : t -> term_state
val ty_st : t -> ty_state
val clear : t -> unit

Reset internal cache, etc.

type hook = t -> term -> (term * proof) option

Given a term, try to simplify it. Return None if it didn't change.

A simple example could be a hook that takes a term t, and if t is app "+" (const x) (const y) where x and y are number, returns Some (const (x+y)), and None otherwise.

val normalize : t -> term -> (term * P.t) option

Normalize a term using all the hooks. This performs a fixpoint, i.e. it only stops when no hook applies anywhere inside the term.

val normalize_t : t -> term -> term * P.t

Normalize a term using all the hooks, along with a proof that the simplification is correct. returns t, refl t if no simplification occurred.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/T/Fun/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/T/Fun/index.html deleted file mode 100644 index 68f7a532..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/T/Fun/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun (sidekick-arith.Sidekick_arith_lra.ARG.S.T.Fun)

Module T.Fun

A function symbol, like "f" or "plus" or "is_human" or "socrates"

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/T/Term/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/T/Term/index.html deleted file mode 100644 index c8531e3e..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/T/Term/index.html +++ /dev/null @@ -1,8 +0,0 @@ - -Term (sidekick-arith.Sidekick_arith_lra.ARG.S.T.Term)

Module T.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
-let y = f x x in
-let z = g y x in
-z = z

the DAG has the following nodes:

n1: 2
-n2: f n1 n1
-n3: g n2 n1
-n4: = n3 n3
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/T/Ty/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/T/Ty/index.html deleted file mode 100644 index d2b44da4..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/T/Ty/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ty (sidekick-arith.Sidekick_arith_lra.ARG.S.T.Ty)

Module T.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/T/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/T/index.html deleted file mode 100644 index 12803fbf..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/T/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -T (sidekick-arith.Sidekick_arith_lra.ARG.S.T)

Module S.T

module Fun : sig ... end

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end

Types

module Term : sig ... end

Term structure.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Unknown/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Unknown/index.html deleted file mode 100644 index 5338a621..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Unknown/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Unknown (sidekick-arith.Sidekick_arith_lra.ARG.S.Unknown)

Module S.Unknown

type t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/index.html deleted file mode 100644 index 5ac29028..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra.ARG.S)

Module ARG.S

module T : Sidekick_core.TERM
module P : Sidekick_core.PROOF with type term = T.Term.t
module Lit : Sidekick_core.LIT with module T = T
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = Lit

Internal solver, available to theories.

type t

The solver's state.

type solver = t
type term = T.Term.t
type ty = T.Ty.t
type lit = Lit.t
type proof = P.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

type 'a theory_p = (module THEORY with type t = 'a)

A theory that can be used for this particular solver, with state of type 'a.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory.

module Atom : sig ... end
module Model : sig ... end

Models

module Unknown : sig ... end

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> T.Term.state
val ty_st : t -> T.Ty.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> unit -> t

Create a new solver.

It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.

parameter store_proof

if true, proofs from the SAT solver and theories are retained and potentially accessible after solve returns UNSAT.

parameter size

influences the size of initial allocations.

parameter theories

theories to load from the start. Other theories can be added using add_theory.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val add_theory_p : t -> 'a theory_p -> 'a

Add the given theory and obtain its state

val add_theory_l : t -> theory list -> unit
val mk_atom_lit : t -> lit -> Atom.t * P.t

mk_atom_lit _ lit returns atom, pr where atom is an internal atom for the solver, and pr is a proof of |- lit = atom

val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t * P.t

mk_atom_t _ ~sign t returns atom, pr where atom is an internal representation of ± t, and pr is a proof of |- atom = (± t)

val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unit

add_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.

val add_clause_l : t -> Atom.t list -> P.t -> unit

Add a clause to the solver, given as a list.

module Pre_proof : sig ... end
type res =
| Sat of Model.t

Satisfiable

| Unsat of {
proof : Pre_proof.t option lazy_t;

proof of unsat

unsat_core : Atom.t list lazy_t;

subset of assumptions responsible for unsat

}

Unsatisfiable

| Unknown of Unknown.t

Unknown, obtained after a timeout, memory limit, etc.

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> ?⁠on_progress:(t -> unit) -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the clauses added so far to s.

parameter check

if true, the model is checked before returning.

parameter on_progress

called regularly during solving.

parameter assumptions

a set of atoms held to be true. The unsat core, if any, will be a subset of assumptions.

parameter on_exit

functions to be run before this returns

val pp_stats : t CCFormat.printer

Print some statistics. What it prints exactly is unspecified.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/module-type-THEORY/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/module-type-THEORY/index.html deleted file mode 100644 index 32c53395..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/module-type-THEORY/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -THEORY (sidekick-arith.Sidekick_arith_lra.ARG.S.THEORY)

Module type S.THEORY

A theory

Theories are abstracted over the concrete implementation of the solver, so they can work with any implementation.

Typically a theory should be a functor taking an argument containing a SOLVER_INTERNAL or even a full SOLVER, and some additional views on terms, literals, etc. that are specific to the theory (e.g. to map terms to linear expressions). The theory can then be instantiated on any kind of solver for any term representation that also satisfies the additional theory-specific requirements. Instantiated theories (ie values of type Sidekick_core.SOLVER.theory) can be added to the solver.

type t

The theory's state

val name : string

Name of the theory (ideally, unique and short)

val create_and_setup : Solver_internal.t -> t

Instantiate the theory's state for the given (internal) solver, register callbacks, create keys, etc.

Called once for every solver this theory is added to.

val push_level : t -> unit

Push backtracking level. When the corresponding pop is called, the theory's state should be restored to a state equivalent to what it was just before push_level.

it does not have to be exactly the same state, it just needs to be equivalent.

val pop_levels : t -> int -> unit

pop_levels theory n pops n backtracking levels, restoring theory to its state before calling push_level n times.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/index.html deleted file mode 100644 index 89ffe5c6..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ARG (sidekick-arith.Sidekick_arith_lra.ARG)

Module type Sidekick_arith_lra.ARG

module S : Sidekick_core.SOLVER
type term = S.T.Term.t
type ty = S.T.Ty.t
val view_as_lra : term -> term lra_view

Project the term into the theory view

val mk_bool : S.T.Term.state -> bool -> term
val mk_lra : S.T.Term.state -> term lra_view -> term

Make a term from the given theory view

val ty_lra : S.T.Term.state -> ty
val mk_eq : S.T.Term.state -> term -> term -> term

syntactic equality

val has_ty_real : term -> bool

Does this term have the type Real

val proof_lra : S.P.lit Iter.t -> S.P.t

TODO: more accurate certificates

val proof_lra_l : S.P.lit list -> S.P.t
module Gensym : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Atom/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Atom/index.html deleted file mode 100644 index dab4799b..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Atom/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Atom (sidekick-arith.Sidekick_arith_lra.S.A.S.Atom)

Module S.Atom

Boolean Atoms

Atoms are the SAT solver's version of our boolean literals (they may have a different representation).

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t CCFormat.printer
val neg : t -> t
val formula : t -> lit
val sign : t -> bool
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Lit/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Lit/index.html deleted file mode 100644 index ee55c2fc..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Lit/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Lit (sidekick-arith.Sidekick_arith_lra.S.A.S.Lit)

Module S.Lit

module T = T

Literals depend on terms

type t

A literal

val term : t -> T.Term.t

Get the (positive) term

val sign : t -> bool

Get the sign. A negated literal has sign false.

val neg : t -> t

Take negation of literal. sign (neg lit) = not (sign lit).

val abs : t -> t

abs lit is like lit but always positive, i.e. sign (abs lit) = true

val signed_term : t -> T.Term.t * bool
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Model/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Model/index.html deleted file mode 100644 index 585fff68..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Model/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Model (sidekick-arith.Sidekick_arith_lra.S.A.S.Model)

Module S.Model

Models

A model can be produced when the solver is found to be in a satisfiable state after a call to solve.

type t
val empty : t
val mem : t -> term -> bool
val find : t -> term -> term option
val eval : t -> term -> term option
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/P/Quip/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/P/Quip/index.html deleted file mode 100644 index 0004fb36..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/P/Quip/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Quip (sidekick-arith.Sidekick_arith_lra.S.A.S.P.Quip)

Module P.Quip

val output : Stdlib.out_channel -> t -> unit

Printer in Quip format (experimental)

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/P/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/P/index.html deleted file mode 100644 index 1dae0649..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/P/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -P (sidekick-arith.Sidekick_arith_lra.S.A.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Pre_proof/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Pre_proof/index.html deleted file mode 100644 index c3430f63..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Pre_proof/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Pre_proof (sidekick-arith.Sidekick_arith_lra.S.A.S.Pre_proof)

Module S.Pre_proof

Internal representation of proofs

A type or state convertible into P.t

type t
val output : Stdlib.out_channel -> t -> unit

Output onto a channel, efficiently

val pp_debug : t Sidekick_core.Fmt.printer
val pp_dot : t Sidekick_core.Fmt.printer option

Optional printer into DOT/graphviz

val check : t -> unit

Check the proof (to an unspecified level of confidence; this can be a no-op). May fail.

val to_proof : t -> P.t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/index.html deleted file mode 100644 index 83a1abed..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Actions (sidekick-arith.Sidekick_arith_lra.S.A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
module P = P
type t = actions

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 raise_conflict : t -> Lit.t list -> P.t -> '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 * P.t) -> unit

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

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-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Expl/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Expl/index.html deleted file mode 100644 index 61693a88..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Expl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expl (sidekick-arith.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_proof : P.t -> t
val mk_theory : t -> t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/N/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/N/index.html deleted file mode 100644 index eec3672f..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/N/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -N (sidekick-arith.Sidekick_arith_lra.S.A.S.Solver_internal.CC.N)

Module CC.N

An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".

All information pertaining to the whole equivalence class is stored in this representative's node.

When two classes become equal (are "merged"), one of the two representatives is picked as the representative of the new class. The new class contains the union of the two old classes' nodes.

We also allow theories to store additional information in the representative. This information can be used when two classes are merged, to detect conflicts and solve equations à la Shostak.

type t

An equivalent class, containing terms that are proved to be equal.

A value of type t points to a particular term, but see find to get the representative of the class.

val term : t -> term
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
val is_root : t -> bool

Is the node a root (ie the representative of its class)? See find to get the root.

val iter_class : t -> t Iter.t

Traverse the congruence class. Precondition: is_root n (see find below)

val iter_parents : t -> t Iter.t

Traverse the parents of the class. Precondition: is_root n (see find below)

type bitfield

A field in the bitfield of this node. This should only be allocated when a theory is initialized.

All fields are initially 0, are backtracked automatically, and are merged automatically when classes are merged.

val get_field : bitfield -> t -> bool

Access the bit field

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/index.html deleted file mode 100644 index 4066d3e5..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CC (sidekick-arith.Sidekick_arith_lra.S.A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

module T = T
module P = P
module Lit = Lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and module P = P and type t = actions
type term_state = T.Term.state
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type proof = P.t
type actions = Actions.t
type t

State of the congruence closure

module N : sig ... end

An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".

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_state : t -> term_state
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 * P.t) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See Sidekick_core.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_state -> t

Create a new congruence closure.

parameter term_state

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 bitfield for the nodes. See N.bitfield.

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-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/Simplify/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/Simplify/index.html deleted file mode 100644 index 329e9e69..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/Simplify/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Simplify (sidekick-arith.Sidekick_arith_lra.S.A.S.Solver_internal.Simplify)

Module Solver_internal.Simplify

Simplify terms

type t
val tst : t -> term_state
val ty_st : t -> ty_state
val clear : t -> unit

Reset internal cache, etc.

type hook = t -> term -> (term * proof) option

Given a term, try to simplify it. Return None if it didn't change.

A simple example could be a hook that takes a term t, and if t is app "+" (const x) (const y) where x and y are number, returns Some (const (x+y)), and None otherwise.

val normalize : t -> term -> (term * P.t) option

Normalize a term using all the hooks. This performs a fixpoint, i.e. it only stops when no hook applies anywhere inside the term.

val normalize_t : t -> term -> term * P.t

Normalize a term using all the hooks, along with a proof that the simplification is correct. returns t, refl t if no simplification occurred.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/index.html deleted file mode 100644 index c0b2f82e..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Solver_internal (sidekick-arith.Sidekick_arith_lra.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/T/Fun/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/T/Fun/index.html deleted file mode 100644 index 75220d95..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/T/Fun/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun (sidekick-arith.Sidekick_arith_lra.S.A.S.T.Fun)

Module T.Fun

A function symbol, like "f" or "plus" or "is_human" or "socrates"

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/T/Term/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/T/Term/index.html deleted file mode 100644 index d431877c..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/T/Term/index.html +++ /dev/null @@ -1,8 +0,0 @@ - -Term (sidekick-arith.Sidekick_arith_lra.S.A.S.T.Term)

Module T.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
-let y = f x x in
-let z = g y x in
-z = z

the DAG has the following nodes:

n1: 2
-n2: f n1 n1
-n3: g n2 n1
-n4: = n3 n3
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/T/Ty/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/T/Ty/index.html deleted file mode 100644 index 6084fe0b..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/T/Ty/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ty (sidekick-arith.Sidekick_arith_lra.S.A.S.T.Ty)

Module T.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/T/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/T/index.html deleted file mode 100644 index 0215eb4c..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/T/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -T (sidekick-arith.Sidekick_arith_lra.S.A.S.T)

Module S.T

module Fun : sig ... end

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end

Types

module Term : sig ... end

Term structure.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Unknown/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Unknown/index.html deleted file mode 100644 index efd7a0aa..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/Unknown/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Unknown (sidekick-arith.Sidekick_arith_lra.S.A.S.Unknown)

Module S.Unknown

type t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/index.html deleted file mode 100644 index c29a953f..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra.S.A.S)

Module A.S

module T : Sidekick_core.TERM
module P : Sidekick_core.PROOF with type term = T.Term.t
module Lit : Sidekick_core.LIT with module T = T
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = Lit

Internal solver, available to theories.

type t

The solver's state.

type solver = t
type term = T.Term.t
type ty = T.Ty.t
type lit = Lit.t
type proof = P.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

type 'a theory_p = (module THEORY with type t = 'a)

A theory that can be used for this particular solver, with state of type 'a.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory.

module Atom : sig ... end
module Model : sig ... end

Models

module Unknown : sig ... end

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> T.Term.state
val ty_st : t -> T.Ty.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> unit -> t

Create a new solver.

It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.

parameter store_proof

if true, proofs from the SAT solver and theories are retained and potentially accessible after solve returns UNSAT.

parameter size

influences the size of initial allocations.

parameter theories

theories to load from the start. Other theories can be added using add_theory.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val add_theory_p : t -> 'a theory_p -> 'a

Add the given theory and obtain its state

val add_theory_l : t -> theory list -> unit
val mk_atom_lit : t -> lit -> Atom.t * P.t

mk_atom_lit _ lit returns atom, pr where atom is an internal atom for the solver, and pr is a proof of |- lit = atom

val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t * P.t

mk_atom_t _ ~sign t returns atom, pr where atom is an internal representation of ± t, and pr is a proof of |- atom = (± t)

val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unit

add_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.

val add_clause_l : t -> Atom.t list -> P.t -> unit

Add a clause to the solver, given as a list.

module Pre_proof : sig ... end
type res =
| Sat of Model.t

Satisfiable

| Unsat of {
proof : Pre_proof.t option lazy_t;

proof of unsat

unsat_core : Atom.t list lazy_t;

subset of assumptions responsible for unsat

}

Unsatisfiable

| Unknown of Unknown.t

Unknown, obtained after a timeout, memory limit, etc.

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> ?⁠on_progress:(t -> unit) -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the clauses added so far to s.

parameter check

if true, the model is checked before returning.

parameter on_progress

called regularly during solving.

parameter assumptions

a set of atoms held to be true. The unsat core, if any, will be a subset of assumptions.

parameter on_exit

functions to be run before this returns

val pp_stats : t CCFormat.printer

Print some statistics. What it prints exactly is unspecified.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/module-type-THEORY/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/module-type-THEORY/index.html deleted file mode 100644 index a0b3f282..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/S/module-type-THEORY/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -THEORY (sidekick-arith.Sidekick_arith_lra.S.A.S.THEORY)

Module type S.THEORY

A theory

Theories are abstracted over the concrete implementation of the solver, so they can work with any implementation.

Typically a theory should be a functor taking an argument containing a SOLVER_INTERNAL or even a full SOLVER, and some additional views on terms, literals, etc. that are specific to the theory (e.g. to map terms to linear expressions). The theory can then be instantiated on any kind of solver for any term representation that also satisfies the additional theory-specific requirements. Instantiated theories (ie values of type Sidekick_core.SOLVER.theory) can be added to the solver.

type t

The theory's state

val name : string

Name of the theory (ideally, unique and short)

val create_and_setup : Solver_internal.t -> t

Instantiate the theory's state for the given (internal) solver, register callbacks, create keys, etc.

Called once for every solver this theory is added to.

val push_level : t -> unit

Push backtracking level. When the corresponding pop is called, the theory's state should be restored to a state equivalent to what it was just before push_level.

it does not have to be exactly the same state, it just needs to be equivalent.

val pop_levels : t -> int -> unit

pop_levels theory n pops n backtracking levels, restoring theory to its state before calling push_level n times.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/index.html deleted file mode 100644 index 96a2c7ea..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -A (sidekick-arith.Sidekick_arith_lra.S.A)

Module S.A

module S : Sidekick_core.SOLVER
type term = S.T.Term.t
type ty = S.T.Ty.t
val view_as_lra : term -> term lra_view

Project the term into the theory view

val mk_bool : S.T.Term.state -> bool -> term
val mk_lra : S.T.Term.state -> term lra_view -> term

Make a term from the given theory view

val ty_lra : S.T.Term.state -> ty
val mk_eq : S.T.Term.state -> term -> term -> term

syntactic equality

val has_ty_real : term -> bool

Does this term have the type Real

val proof_lra : S.P.lit Iter.t -> S.P.t

TODO: more accurate certificates

val proof_lra_l : S.P.lit list -> S.P.t
module Gensym : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/index.html b/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/index.html deleted file mode 100644 index 7a7fd2df..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra.S)

Module type Sidekick_arith_lra.S

module A : ARG
type state
val create : ?⁠stat:Sidekick_util.Stat.t -> A.S.T.Term.state -> A.S.T.Ty.state -> state
val theory : A.S.theory
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Comb/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Comb/Infix/index.html deleted file mode 100644 index b8a1e18a..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Comb/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__.Linear_expr.Make.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Comb/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Comb/index.html deleted file mode 100644 index ac3c8916..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Comb/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comb (sidekick-arith.Sidekick_arith_lra__.Linear_expr.Make.Comb)

Module Make.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Constr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Constr/index.html deleted file mode 100644 index eb67226a..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Constr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constr (sidekick-arith.Sidekick_arith_lra__.Linear_expr.Make.Constr)

Module Make.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Expr/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Expr/Infix/index.html deleted file mode 100644 index ded6c6dc..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Expr/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__.Linear_expr.Make.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Expr/index.html deleted file mode 100644 index 9693524b..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/Expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expr (sidekick-arith.Sidekick_arith_lra__.Linear_expr.Make.Expr)

Module Make.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/argument-1-C/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/argument-1-C/index.html deleted file mode 100644 index 54ca5429..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/argument-1-C/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -1-C (sidekick-arith.Sidekick_arith_lra__.Linear_expr.Make.1-C)

Parameter Make.1-C

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/argument-2-Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/argument-2-Var/index.html deleted file mode 100644 index 3e927c41..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/argument-2-Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -2-Var (sidekick-arith.Sidekick_arith_lra__.Linear_expr.Make.2-Var)

Parameter Make.2-Var

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/index.html deleted file mode 100644 index 9422d8a3..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (sidekick-arith.Sidekick_arith_lra__.Linear_expr.Make)

Module Linear_expr.Make

Parameters

Signature

module C = C

Coeficients used. Can be integers as well as rationals.

module Var = Var

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map = CCMap.Make(Var)

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/index.html deleted file mode 100644 index 8cae799a..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Linear_expr (sidekick-arith.Sidekick_arith_lra__.Linear_expr)

Module Sidekick_arith_lra__.Linear_expr

module type COEFF = Sidekick_arith_lra__.Linear_expr_intf.COEFF
module type VAR = Sidekick_arith_lra__.Linear_expr_intf.VAR
module type S = Sidekick_arith_lra__.Linear_expr_intf.S
type nonrec bool_op = Sidekick_arith_lra__.Linear_expr_intf.bool_op =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
module Make : functor (C : COEFF) -> functor (Var : VAR) -> S with module C = C and module Var = Var and module Var_map = CCMap.Make(Var)
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-COEFF/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-COEFF/index.html deleted file mode 100644 index 62806260..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-COEFF/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -COEFF (sidekick-arith.Sidekick_arith_lra__.Linear_expr.COEFF)

Module type Linear_expr.COEFF

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/C/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/C/index.html deleted file mode 100644 index 294d1b19..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/C/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -C (sidekick-arith.Sidekick_arith_lra__.Linear_expr.S.C)

Module S.C

Coeficients used. Can be integers as well as rationals.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Comb/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Comb/Infix/index.html deleted file mode 100644 index e88b5e87..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Comb/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__.Linear_expr.S.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Comb/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Comb/index.html deleted file mode 100644 index 55449792..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Comb/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comb (sidekick-arith.Sidekick_arith_lra__.Linear_expr.S.Comb)

Module S.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Constr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Constr/index.html deleted file mode 100644 index 39999db4..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Constr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constr (sidekick-arith.Sidekick_arith_lra__.Linear_expr.S.Constr)

Module S.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Expr/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Expr/Infix/index.html deleted file mode 100644 index 35fec89e..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Expr/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__.Linear_expr.S.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Expr/index.html deleted file mode 100644 index 92a36d55..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expr (sidekick-arith.Sidekick_arith_lra__.Linear_expr.S.Expr)

Module S.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Var/index.html deleted file mode 100644 index ec91e34f..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Var (sidekick-arith.Sidekick_arith_lra__.Linear_expr.S.Var)

Module S.Var

Variables used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/index.html deleted file mode 100644 index d79a6982..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra__.Linear_expr.S)

Module type Linear_expr.S

module C : Sidekick_arith_lra__.Linear_expr_intf.COEFF

Coeficients used. Can be integers as well as rationals.

module Var : Sidekick_arith_lra__.Linear_expr_intf.VAR

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-VAR/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-VAR/index.html deleted file mode 100644 index e71f2571..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr/module-type-VAR/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -VAR (sidekick-arith.Sidekick_arith_lra__.Linear_expr.VAR)

Module type Linear_expr.VAR

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/index.html deleted file mode 100644 index 13f8cb01..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Linear_expr_intf (sidekick-arith.Sidekick_arith_lra__.Linear_expr_intf)

Module Sidekick_arith_lra__.Linear_expr_intf

Linear expressions interface

module type COEFF = sig ... end
module type VAR = sig ... end
type bool_op = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq

Linear expressions & formulas

module type S = sig ... end

Linear expressions & formulas.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-COEFF/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-COEFF/index.html deleted file mode 100644 index 5701e67e..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-COEFF/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -COEFF (sidekick-arith.Sidekick_arith_lra__.Linear_expr_intf.COEFF)

Module type Linear_expr_intf.COEFF

Coefficients

Coefficients are used in expressions. They usually are either rationals, or integers.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/C/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/C/index.html deleted file mode 100644 index 93b14dc7..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/C/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -C (sidekick-arith.Sidekick_arith_lra__.Linear_expr_intf.S.C)

Module S.C

Coeficients used. Can be integers as well as rationals.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Comb/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Comb/Infix/index.html deleted file mode 100644 index d6606bf3..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Comb/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__.Linear_expr_intf.S.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Comb/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Comb/index.html deleted file mode 100644 index f5fd13a7..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Comb/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comb (sidekick-arith.Sidekick_arith_lra__.Linear_expr_intf.S.Comb)

Module S.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Constr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Constr/index.html deleted file mode 100644 index 5a0a82d1..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Constr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constr (sidekick-arith.Sidekick_arith_lra__.Linear_expr_intf.S.Constr)

Module S.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> bool_op -> t
val make : Comb.t -> bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Expr/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Expr/Infix/index.html deleted file mode 100644 index d2e33125..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Expr/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__.Linear_expr_intf.S.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Expr/index.html deleted file mode 100644 index 04d62715..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expr (sidekick-arith.Sidekick_arith_lra__.Linear_expr_intf.S.Expr)

Module S.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Var/index.html deleted file mode 100644 index 199a9a04..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Var (sidekick-arith.Sidekick_arith_lra__.Linear_expr_intf.S.Var)

Module S.Var

Variables used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/index.html deleted file mode 100644 index e4f2a9cb..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra__.Linear_expr_intf.S)

Module type Linear_expr_intf.S

Linear expressions & formulas.

This modules defines linear expressions (which are linear combinations of variables), and linear constraints, where the value of a linear expressions is constrained.

module C : COEFF

Coeficients used. Can be integers as well as rationals.

module Var : VAR

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-VAR/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-VAR/index.html deleted file mode 100644 index 179f7fb2..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Linear_expr_intf/module-type-VAR/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -VAR (sidekick-arith.Sidekick_arith_lra__.Linear_expr_intf.VAR)

Module type Linear_expr_intf.VAR

Variable interface

Standard interface for variables that are meant to be used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Predicate/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Predicate/index.html deleted file mode 100644 index 98fd3471..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Predicate/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Predicate (sidekick-arith.Sidekick_arith_lra__.Predicate)

Module Sidekick_arith_lra__.Predicate

type t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
val neg : t -> t
val neg_sign : t -> t
val to_string : t -> string
val pp : Sidekick_util.Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/Constraint/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/Constraint/index.html deleted file mode 100644 index 99384aa5..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/Constraint/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constraint (sidekick-arith.Sidekick_arith_lra__.Simplex2.Make.Constraint)

Module Make.Constraint

type op = Op.t
type t = {
op : op;
lhs : V.t;
rhs : num;
}

A constraint is the comparison of a variable to a constant.

val mk : V.t -> op -> num -> t
val leq : V.t -> num -> t
val lt : V.t -> num -> t
val geq : V.t -> num -> t
val gt : V.t -> num -> t
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/Subst/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/Subst/index.html deleted file mode 100644 index 91bdde78..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/Subst/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Subst (sidekick-arith.Sidekick_arith_lra__.Simplex2.Make.Subst)

Module Make.Subst

type t = num V_map.t
val eval : t -> V.t -> Q.t
val pp : t Sidekick_util.Fmt.printer
val to_string : t -> string
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/Unsat_cert/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/Unsat_cert/index.html deleted file mode 100644 index 24a7e8d9..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/Unsat_cert/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Unsat_cert (sidekick-arith.Sidekick_arith_lra__.Simplex2.Make.Unsat_cert)

Module Make.Unsat_cert

type t = unsat_cert
val lits : t -> V.lit list
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/argument-1-Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/argument-1-Var/index.html deleted file mode 100644 index b141be62..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/argument-1-Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -1-Var (sidekick-arith.Sidekick_arith_lra__.Simplex2.Make.1-Var)

Parameter Make.1-Var

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/index.html deleted file mode 100644 index 51e5f7a3..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (sidekick-arith.Sidekick_arith_lra__.Simplex2.Make)

Module Simplex2.Make

Parameters

Signature

module V = Var
module V_map : CCMap.S with type V_map.key = V.t
type num = Q.t

Numbers

module Constraint : sig ... end
module Subst : sig ... end
type t
val create : ?⁠stat:Sidekick_util.Stat.t -> unit -> t

Create a new simplex.

val push_level : t -> unit
val pop_levels : t -> int -> unit
val define : t -> V.t -> (num * V.t) list -> unit

Define a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t

type unsat_cert
module Unsat_cert : sig ... end
exception E_unsat of Unsat_cert.t
type ev_on_propagate = V.lit -> reason:V.lit list -> unit
val add_var : t -> V.t -> unit

Make sure the variable exists in the simplex.

val add_constraint : on_propagate:ev_on_propagate -> t -> Constraint.t -> V.lit -> unit

Add a constraint to the simplex.

raises Unsat

if it's immediately obvious that this is not satisfiable.

val declare_bound : t -> Constraint.t -> V.lit -> unit

Declare that this constraint exists, so we can possibly propagate it. Unlike add_constraint this does NOT assert that the constraint is true

val check_exn : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> unit

Check the whole simplex for satisfiability.

parameter on_propagate

is called with arguments lit, reason whenever reason => lit is found to be true by the simplex.

raises Unsat

if the constraints are not satisfiable.

type result =
| Sat of Subst.t
| Unsat of Unsat_cert.t
val check : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> result

Call check_exn and return a model or a proof of unsat.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Op/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Op/index.html deleted file mode 100644 index 4f32b47e..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/Op/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Op (sidekick-arith.Sidekick_arith_lra__.Simplex2.Op)

Module Simplex2.Op

Basic operator

type t =
| Leq
| Lt
| Geq
| Gt
val neg_sign : t -> t
val not_ : t -> t
val to_string : t -> string
val pp : Sidekick_util.Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/index.html deleted file mode 100644 index 6aa99e95..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Simplex2 (sidekick-arith.Sidekick_arith_lra__.Simplex2)

Module Sidekick_arith_lra__.Simplex2

Fast Simplex for CDCL(T)

We follow the paper "Integrating Simplex with DPLL(T )" from de Moura and Dutertre.

module Op : sig ... end
module type S = sig ... end
module Make : functor (Var : VAR) -> S with module V = Var
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/Constraint/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/Constraint/index.html deleted file mode 100644 index e6467e7d..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/Constraint/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constraint (sidekick-arith.Sidekick_arith_lra__.Simplex2.S.Constraint)

Module S.Constraint

type op = Op.t
type t = {
op : op;
lhs : V.t;
rhs : num;
}

A constraint is the comparison of a variable to a constant.

val mk : V.t -> op -> num -> t
val leq : V.t -> num -> t
val lt : V.t -> num -> t
val geq : V.t -> num -> t
val gt : V.t -> num -> t
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/Subst/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/Subst/index.html deleted file mode 100644 index d132c5e4..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/Subst/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Subst (sidekick-arith.Sidekick_arith_lra__.Simplex2.S.Subst)

Module S.Subst

type t = num V_map.t
val eval : t -> V.t -> Q.t
val pp : t Sidekick_util.Fmt.printer
val to_string : t -> string
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/Unsat_cert/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/Unsat_cert/index.html deleted file mode 100644 index 7a3383a3..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/Unsat_cert/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Unsat_cert (sidekick-arith.Sidekick_arith_lra__.Simplex2.S.Unsat_cert)

Module S.Unsat_cert

type t = unsat_cert
val lits : t -> V.lit list
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/V/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/V/index.html deleted file mode 100644 index 46f547e1..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/V/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -V (sidekick-arith.Sidekick_arith_lra__.Simplex2.S.V)

Module S.V

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/index.html deleted file mode 100644 index 5f537048..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra__.Simplex2.S)

Module type Simplex2.S

module V : VAR
module V_map : CCMap.S with type V_map.key = V.t
type num = Q.t

Numbers

module Constraint : sig ... end
module Subst : sig ... end
type t
val create : ?⁠stat:Sidekick_util.Stat.t -> unit -> t

Create a new simplex.

val push_level : t -> unit
val pop_levels : t -> int -> unit
val define : t -> V.t -> (num * V.t) list -> unit

Define a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t

type unsat_cert
module Unsat_cert : sig ... end
exception E_unsat of Unsat_cert.t
type ev_on_propagate = V.lit -> reason:V.lit list -> unit
val add_var : t -> V.t -> unit

Make sure the variable exists in the simplex.

val add_constraint : on_propagate:ev_on_propagate -> t -> Constraint.t -> V.lit -> unit

Add a constraint to the simplex.

raises Unsat

if it's immediately obvious that this is not satisfiable.

val declare_bound : t -> Constraint.t -> V.lit -> unit

Declare that this constraint exists, so we can possibly propagate it. Unlike add_constraint this does NOT assert that the constraint is true

val check_exn : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> unit

Check the whole simplex for satisfiability.

parameter on_propagate

is called with arguments lit, reason whenever reason => lit is found to be true by the simplex.

raises Unsat

if the constraints are not satisfiable.

type result =
| Sat of Subst.t
| Unsat of Unsat_cert.t
val check : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> result

Call check_exn and return a model or a proof of unsat.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-VAR/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-VAR/index.html deleted file mode 100644 index c9a168fc..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex2/module-type-VAR/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -VAR (sidekick-arith.Sidekick_arith_lra__.Simplex2.VAR)

Module type Simplex2.VAR

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/index.html deleted file mode 100644 index a74fc05e..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Simplex_intf (sidekick-arith.Sidekick_arith_lra__.Simplex_intf)

Module Sidekick_arith_lra__.Simplex_intf

Modular and incremental implementation of the general simplex

module type S = sig ... end
module type S_FULL = sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S/index.html deleted file mode 100644 index 20c7fb3a..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra__.Simplex_intf.S)

Module type Simplex_intf.S

type var

The given type of the variables

module Var_map : CCMap.S with type Var_map.key = var

A map on variables

type param

Parameter required at the creation of the simplex

type lit
type t

The type of a (possibly not solved) linear system

type cert = {
cert_var : var;
cert_expr : (Q.t * var) list;
}

An unsatisfiability explanation is a couple (x, expr). If expr is the empty list, then there is a contradiction between two given bounds of x. Else, the explanation is an equality x = expr that is valid (it can be derived from the original equations of the system) from which a bound can be deduced which contradicts an already given bound of the system.

type res =
| Solution of Q.t Var_map.t
| Unsatisfiable of cert

Generic type returned when solving the simplex. A solution is a list of bindings that satisfies all the constraints inside the system. If the system is unsatisfiable, an explanation of type 'cert is returned.

Simplex construction

val create : param -> t

The empty system.

parameter fresh

the state for generating fresh variables on demand.

val add_eq : t -> (var * (Q.t * var) list) -> unit

add_eq s (x, eq) adds the equation x=eq to s

val add_bounds : t -> ?⁠strict_lower:bool -> ?⁠strict_upper:bool -> ?⁠lower_reason:lit -> ?⁠upper_reason:lit -> (var * Q.t * Q.t) -> unit

add_bounds (x, lower, upper) adds to s the bounds lower and upper for the given variable x. If the bound is loose on one side (no upper bounds for instance), the values Q.inf and Q.minus_inf can be used. By default, in a system, all variables have no bounds, i.e have lower bound Q.minus_inf and upper bound Q.inf. Optional parameters allow to make the the bounds strict. Defaults to false, so that bounds are large by default.

val add_lower_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit
val add_upper_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit

Simplex solving

val solve : t -> res

solve s solves the system s and returns a solution, if one exists. This function may change the internal representation of the system to that of an equivalent one (permutation of basic and non basic variables and pivot operation on the tableaux).

val check_cert : t -> cert -> [ `Ok of lit list | `Bad_bounds of string * string | `Diff_not_0 of Q.t Var_map.t ]

checks that the certificat indeed yields to a contradiction in the current state of the simplex.

returns

`Ok unsat_core if the certificate is valid.

val pp_cert : cert CCFormat.printer
val pp_full_state : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/C/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/C/index.html deleted file mode 100644 index d298441e..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/C/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -C (sidekick-arith.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.C)

Module L.C

Coeficients used. Can be integers as well as rationals.

type t = Q.t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Comb/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Comb/Infix/index.html deleted file mode 100644 index 82f44afa..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Comb/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Comb/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Comb/index.html deleted file mode 100644 index 5553a511..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Comb/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comb (sidekick-arith.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.Comb)

Module L.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Constr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Constr/index.html deleted file mode 100644 index d1d06d26..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Constr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constr (sidekick-arith.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.Constr)

Module L.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Expr/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Expr/Infix/index.html deleted file mode 100644 index 2d09be3c..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Expr/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Expr/index.html deleted file mode 100644 index d378b010..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expr (sidekick-arith.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.Expr)

Module L.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Var/index.html deleted file mode 100644 index 74cad045..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Var (sidekick-arith.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.Var)

Module L.Var

Variables used in expressions.

type t = var

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit = lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/index.html deleted file mode 100644 index 3c2f0ea3..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -L (sidekick-arith.Sidekick_arith_lra__.Simplex_intf.S_FULL.L)

Module S_FULL.L

module C : Sidekick_arith_lra__.Linear_expr_intf.COEFF with type t = Q.t

Coeficients used. Can be integers as well as rationals.

module Var : Sidekick_arith_lra__.Linear_expr_intf.VAR with type t = var and type lit = lit

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/index.html deleted file mode 100644 index cdf3384d..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S_FULL (sidekick-arith.Sidekick_arith_lra__.Simplex_intf.S_FULL)

Module type Simplex_intf.S_FULL

include S
type var

The given type of the variables

module Var_map : CCMap.S with type Var_map.key = var

A map on variables

type param

Parameter required at the creation of the simplex

type lit
type t

The type of a (possibly not solved) linear system

type cert = {
cert_var : var;
cert_expr : (Q.t * var) list;
}

An unsatisfiability explanation is a couple (x, expr). If expr is the empty list, then there is a contradiction between two given bounds of x. Else, the explanation is an equality x = expr that is valid (it can be derived from the original equations of the system) from which a bound can be deduced which contradicts an already given bound of the system.

type res =
| Solution of Q.t Var_map.t
| Unsatisfiable of cert

Generic type returned when solving the simplex. A solution is a list of bindings that satisfies all the constraints inside the system. If the system is unsatisfiable, an explanation of type 'cert is returned.

Simplex construction

val create : param -> t

The empty system.

parameter fresh

the state for generating fresh variables on demand.

val add_eq : t -> (var * (Q.t * var) list) -> unit

add_eq s (x, eq) adds the equation x=eq to s

val add_bounds : t -> ?⁠strict_lower:bool -> ?⁠strict_upper:bool -> ?⁠lower_reason:lit -> ?⁠upper_reason:lit -> (var * Q.t * Q.t) -> unit

add_bounds (x, lower, upper) adds to s the bounds lower and upper for the given variable x. If the bound is loose on one side (no upper bounds for instance), the values Q.inf and Q.minus_inf can be used. By default, in a system, all variables have no bounds, i.e have lower bound Q.minus_inf and upper bound Q.inf. Optional parameters allow to make the the bounds strict. Defaults to false, so that bounds are large by default.

val add_lower_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit
val add_upper_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit

Simplex solving

val solve : t -> res

solve s solves the system s and returns a solution, if one exists. This function may change the internal representation of the system to that of an equivalent one (permutation of basic and non basic variables and pivot operation on the tableaux).

val check_cert : t -> cert -> [ `Ok of lit list | `Bad_bounds of string * string | `Diff_not_0 of Q.t Var_map.t ]

checks that the certificat indeed yields to a contradiction in the current state of the simplex.

returns

`Ok unsat_core if the certificate is valid.

val pp_cert : cert CCFormat.printer
val pp_full_state : t CCFormat.printer
module L : Sidekick_arith_lra__.Linear_expr_intf.S with type C.t = Q.t and type Var.t = var and type Var.lit = lit
type op = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
type constr = L.Constr.t
val add_constr : t -> constr -> lit -> unit

Add a constraint to a simplex state.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/index.html b/dev/sidekick-arith/Sidekick_arith_lra__/index.html deleted file mode 100644 index 9cb43f5a..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_arith_lra__ (sidekick-arith.Sidekick_arith_lra__)

Module Sidekick_arith_lra__

module Linear_expr : sig ... end
module Linear_expr_intf : sig ... end
module Predicate : sig ... end
module Simplex2 : sig ... end
module Simplex_intf : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Comb/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Comb/Infix/index.html deleted file mode 100644 index 1dbb863f..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Comb/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__Linear_expr.Make.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Comb/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Comb/index.html deleted file mode 100644 index 91b87cec..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Comb/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comb (sidekick-arith.Sidekick_arith_lra__Linear_expr.Make.Comb)

Module Make.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Constr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Constr/index.html deleted file mode 100644 index ecb76e73..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Constr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constr (sidekick-arith.Sidekick_arith_lra__Linear_expr.Make.Constr)

Module Make.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Expr/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Expr/Infix/index.html deleted file mode 100644 index 8f4c281b..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Expr/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__Linear_expr.Make.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Expr/index.html deleted file mode 100644 index 25c08b82..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/Expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expr (sidekick-arith.Sidekick_arith_lra__Linear_expr.Make.Expr)

Module Make.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/argument-1-C/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/argument-1-C/index.html deleted file mode 100644 index 49b75c80..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/argument-1-C/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -1-C (sidekick-arith.Sidekick_arith_lra__Linear_expr.Make.1-C)

Parameter Make.1-C

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/argument-2-Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/argument-2-Var/index.html deleted file mode 100644 index 7d3fcc6e..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/argument-2-Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -2-Var (sidekick-arith.Sidekick_arith_lra__Linear_expr.Make.2-Var)

Parameter Make.2-Var

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/index.html deleted file mode 100644 index 34890ea9..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (sidekick-arith.Sidekick_arith_lra__Linear_expr.Make)

Module Sidekick_arith_lra__Linear_expr.Make

Parameters

Signature

module C = C

Coeficients used. Can be integers as well as rationals.

module Var = Var

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map = CCMap.Make(Var)

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/index.html deleted file mode 100644 index 452363e6..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_arith_lra__Linear_expr (sidekick-arith.Sidekick_arith_lra__Linear_expr)

Module Sidekick_arith_lra__Linear_expr

Arithmetic expressions

module type COEFF = Sidekick_arith_lra__.Linear_expr_intf.COEFF
module type VAR = Sidekick_arith_lra__.Linear_expr_intf.VAR
module type S = Sidekick_arith_lra__.Linear_expr_intf.S
type nonrec bool_op = Sidekick_arith_lra__.Linear_expr_intf.bool_op =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
module Make : functor (C : COEFF) -> functor (Var : VAR) -> S with module C = C and module Var = Var and module Var_map = CCMap.Make(Var)
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-COEFF/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-COEFF/index.html deleted file mode 100644 index 44ecdf31..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-COEFF/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -COEFF (sidekick-arith.Sidekick_arith_lra__Linear_expr.COEFF)

Module type Sidekick_arith_lra__Linear_expr.COEFF

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/C/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/C/index.html deleted file mode 100644 index 87f63c58..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/C/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -C (sidekick-arith.Sidekick_arith_lra__Linear_expr.S.C)

Module S.C

Coeficients used. Can be integers as well as rationals.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Comb/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Comb/Infix/index.html deleted file mode 100644 index 1f309686..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Comb/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__Linear_expr.S.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Comb/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Comb/index.html deleted file mode 100644 index 3984456e..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Comb/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comb (sidekick-arith.Sidekick_arith_lra__Linear_expr.S.Comb)

Module S.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Constr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Constr/index.html deleted file mode 100644 index 48ec5ca9..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Constr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constr (sidekick-arith.Sidekick_arith_lra__Linear_expr.S.Constr)

Module S.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Expr/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Expr/Infix/index.html deleted file mode 100644 index 52b222e6..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Expr/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__Linear_expr.S.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Expr/index.html deleted file mode 100644 index 3abdf8f3..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expr (sidekick-arith.Sidekick_arith_lra__Linear_expr.S.Expr)

Module S.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Var/index.html deleted file mode 100644 index 94e73885..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Var (sidekick-arith.Sidekick_arith_lra__Linear_expr.S.Var)

Module S.Var

Variables used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/index.html deleted file mode 100644 index 036f0074..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra__Linear_expr.S)

Module type Sidekick_arith_lra__Linear_expr.S

module C : Sidekick_arith_lra__.Linear_expr_intf.COEFF

Coeficients used. Can be integers as well as rationals.

module Var : Sidekick_arith_lra__.Linear_expr_intf.VAR

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-VAR/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-VAR/index.html deleted file mode 100644 index c4617dd9..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/module-type-VAR/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -VAR (sidekick-arith.Sidekick_arith_lra__Linear_expr.VAR)

Module type Sidekick_arith_lra__Linear_expr.VAR

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/index.html deleted file mode 100644 index cf26f3b0..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_arith_lra__Linear_expr_intf (sidekick-arith.Sidekick_arith_lra__Linear_expr_intf)

Module Sidekick_arith_lra__Linear_expr_intf

Linear expressions interface

module type COEFF = sig ... end
module type VAR = sig ... end
type bool_op = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq

Linear expressions & formulas

module type S = sig ... end

Linear expressions & formulas.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-COEFF/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-COEFF/index.html deleted file mode 100644 index 715e6d7a..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-COEFF/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -COEFF (sidekick-arith.Sidekick_arith_lra__Linear_expr_intf.COEFF)

Module type Sidekick_arith_lra__Linear_expr_intf.COEFF

Coefficients

Coefficients are used in expressions. They usually are either rationals, or integers.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/C/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/C/index.html deleted file mode 100644 index 6a2519b4..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/C/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -C (sidekick-arith.Sidekick_arith_lra__Linear_expr_intf.S.C)

Module S.C

Coeficients used. Can be integers as well as rationals.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Comb/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Comb/Infix/index.html deleted file mode 100644 index 594a45c5..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Comb/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__Linear_expr_intf.S.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Comb/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Comb/index.html deleted file mode 100644 index 8f7d86f3..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Comb/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comb (sidekick-arith.Sidekick_arith_lra__Linear_expr_intf.S.Comb)

Module S.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Constr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Constr/index.html deleted file mode 100644 index b32dab21..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Constr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constr (sidekick-arith.Sidekick_arith_lra__Linear_expr_intf.S.Constr)

Module S.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> bool_op -> t
val make : Comb.t -> bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Expr/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Expr/Infix/index.html deleted file mode 100644 index d45e5a91..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Expr/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__Linear_expr_intf.S.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Expr/index.html deleted file mode 100644 index 81d8ac58..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expr (sidekick-arith.Sidekick_arith_lra__Linear_expr_intf.S.Expr)

Module S.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Var/index.html deleted file mode 100644 index 3e21fc1b..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Var (sidekick-arith.Sidekick_arith_lra__Linear_expr_intf.S.Var)

Module S.Var

Variables used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/index.html deleted file mode 100644 index 00b9bdab..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra__Linear_expr_intf.S)

Module type Sidekick_arith_lra__Linear_expr_intf.S

Linear expressions & formulas.

This modules defines linear expressions (which are linear combinations of variables), and linear constraints, where the value of a linear expressions is constrained.

module C : COEFF

Coeficients used. Can be integers as well as rationals.

module Var : VAR

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-VAR/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-VAR/index.html deleted file mode 100644 index 0992ec25..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/module-type-VAR/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -VAR (sidekick-arith.Sidekick_arith_lra__Linear_expr_intf.VAR)

Module type Sidekick_arith_lra__Linear_expr_intf.VAR

Variable interface

Standard interface for variables that are meant to be used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Predicate/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Predicate/index.html deleted file mode 100644 index ed65a589..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Predicate/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_arith_lra__Predicate (sidekick-arith.Sidekick_arith_lra__Predicate)

Module Sidekick_arith_lra__Predicate

type t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
val neg : t -> t
val neg_sign : t -> t
val to_string : t -> string
val pp : Sidekick_util.Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/Constraint/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/Constraint/index.html deleted file mode 100644 index 356d2fe2..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/Constraint/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constraint (sidekick-arith.Sidekick_arith_lra__Simplex2.Make.Constraint)

Module Make.Constraint

type op = Op.t
type t = {
op : op;
lhs : V.t;
rhs : num;
}

A constraint is the comparison of a variable to a constant.

val mk : V.t -> op -> num -> t
val leq : V.t -> num -> t
val lt : V.t -> num -> t
val geq : V.t -> num -> t
val gt : V.t -> num -> t
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/Subst/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/Subst/index.html deleted file mode 100644 index ba69df8f..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/Subst/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Subst (sidekick-arith.Sidekick_arith_lra__Simplex2.Make.Subst)

Module Make.Subst

type t = num V_map.t
val eval : t -> V.t -> Q.t
val pp : t Sidekick_util.Fmt.printer
val to_string : t -> string
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/Unsat_cert/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/Unsat_cert/index.html deleted file mode 100644 index bc541c8c..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/Unsat_cert/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Unsat_cert (sidekick-arith.Sidekick_arith_lra__Simplex2.Make.Unsat_cert)

Module Make.Unsat_cert

type t = unsat_cert
val lits : t -> V.lit list
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/argument-1-Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/argument-1-Var/index.html deleted file mode 100644 index 62a429d8..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/argument-1-Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -1-Var (sidekick-arith.Sidekick_arith_lra__Simplex2.Make.1-Var)

Parameter Make.1-Var

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/index.html deleted file mode 100644 index 1e9679e7..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (sidekick-arith.Sidekick_arith_lra__Simplex2.Make)

Module Sidekick_arith_lra__Simplex2.Make

Parameters

Signature

module V = Var
module V_map : CCMap.S with type V_map.key = V.t
type num = Q.t

Numbers

module Constraint : sig ... end
module Subst : sig ... end
type t
val create : ?⁠stat:Sidekick_util.Stat.t -> unit -> t

Create a new simplex.

val push_level : t -> unit
val pop_levels : t -> int -> unit
val define : t -> V.t -> (num * V.t) list -> unit

Define a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t

type unsat_cert
module Unsat_cert : sig ... end
exception E_unsat of Unsat_cert.t
type ev_on_propagate = V.lit -> reason:V.lit list -> unit
val add_var : t -> V.t -> unit

Make sure the variable exists in the simplex.

val add_constraint : on_propagate:ev_on_propagate -> t -> Constraint.t -> V.lit -> unit

Add a constraint to the simplex.

raises Unsat

if it's immediately obvious that this is not satisfiable.

val declare_bound : t -> Constraint.t -> V.lit -> unit

Declare that this constraint exists, so we can possibly propagate it. Unlike add_constraint this does NOT assert that the constraint is true

val check_exn : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> unit

Check the whole simplex for satisfiability.

parameter on_propagate

is called with arguments lit, reason whenever reason => lit is found to be true by the simplex.

raises Unsat

if the constraints are not satisfiable.

type result =
| Sat of Subst.t
| Unsat of Unsat_cert.t
val check : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> result

Call check_exn and return a model or a proof of unsat.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Op/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Op/index.html deleted file mode 100644 index 41da3101..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/Op/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Op (sidekick-arith.Sidekick_arith_lra__Simplex2.Op)

Module Sidekick_arith_lra__Simplex2.Op

Basic operator

type t =
| Leq
| Lt
| Geq
| Gt
val neg_sign : t -> t
val not_ : t -> t
val to_string : t -> string
val pp : Sidekick_util.Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/index.html deleted file mode 100644 index 174d5b77..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_arith_lra__Simplex2 (sidekick-arith.Sidekick_arith_lra__Simplex2)

Module Sidekick_arith_lra__Simplex2

Fast Simplex for CDCL(T)

We follow the paper "Integrating Simplex with DPLL(T )" from de Moura and Dutertre.

module type VAR = Sidekick_arith_lra__.Linear_expr_intf.VAR
module Op : sig ... end
module type S = sig ... end
module Make : functor (Var : VAR) -> S with module V = Var
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/Constraint/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/Constraint/index.html deleted file mode 100644 index f5931856..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/Constraint/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constraint (sidekick-arith.Sidekick_arith_lra__Simplex2.S.Constraint)

Module S.Constraint

type op = Op.t
type t = {
op : op;
lhs : V.t;
rhs : num;
}

A constraint is the comparison of a variable to a constant.

val mk : V.t -> op -> num -> t
val leq : V.t -> num -> t
val lt : V.t -> num -> t
val geq : V.t -> num -> t
val gt : V.t -> num -> t
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/Subst/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/Subst/index.html deleted file mode 100644 index 4c87e36a..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/Subst/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Subst (sidekick-arith.Sidekick_arith_lra__Simplex2.S.Subst)

Module S.Subst

type t = num V_map.t
val eval : t -> V.t -> Q.t
val pp : t Sidekick_util.Fmt.printer
val to_string : t -> string
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/Unsat_cert/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/Unsat_cert/index.html deleted file mode 100644 index 6c45b6eb..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/Unsat_cert/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Unsat_cert (sidekick-arith.Sidekick_arith_lra__Simplex2.S.Unsat_cert)

Module S.Unsat_cert

type t = unsat_cert
val lits : t -> V.lit list
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/V/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/V/index.html deleted file mode 100644 index aada7f56..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/V/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -V (sidekick-arith.Sidekick_arith_lra__Simplex2.S.V)

Module S.V

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/index.html deleted file mode 100644 index 6303dd77..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra__Simplex2.S)

Module type Sidekick_arith_lra__Simplex2.S

module V : VAR
module V_map : CCMap.S with type V_map.key = V.t
type num = Q.t

Numbers

module Constraint : sig ... end
module Subst : sig ... end
type t
val create : ?⁠stat:Sidekick_util.Stat.t -> unit -> t

Create a new simplex.

val push_level : t -> unit
val pop_levels : t -> int -> unit
val define : t -> V.t -> (num * V.t) list -> unit

Define a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t

type unsat_cert
module Unsat_cert : sig ... end
exception E_unsat of Unsat_cert.t
type ev_on_propagate = V.lit -> reason:V.lit list -> unit
val add_var : t -> V.t -> unit

Make sure the variable exists in the simplex.

val add_constraint : on_propagate:ev_on_propagate -> t -> Constraint.t -> V.lit -> unit

Add a constraint to the simplex.

raises Unsat

if it's immediately obvious that this is not satisfiable.

val declare_bound : t -> Constraint.t -> V.lit -> unit

Declare that this constraint exists, so we can possibly propagate it. Unlike add_constraint this does NOT assert that the constraint is true

val check_exn : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> unit

Check the whole simplex for satisfiability.

parameter on_propagate

is called with arguments lit, reason whenever reason => lit is found to be true by the simplex.

raises Unsat

if the constraints are not satisfiable.

type result =
| Sat of Subst.t
| Unsat of Unsat_cert.t
val check : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> result

Call check_exn and return a model or a proof of unsat.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-VAR/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-VAR/index.html deleted file mode 100644 index f3ba4546..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/module-type-VAR/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -VAR (sidekick-arith.Sidekick_arith_lra__Simplex2.VAR)

Module type Sidekick_arith_lra__Simplex2.VAR

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/index.html deleted file mode 100644 index 02644b6b..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_arith_lra__Simplex_intf (sidekick-arith.Sidekick_arith_lra__Simplex_intf)

Module Sidekick_arith_lra__Simplex_intf

Modular and incremental implementation of the general simplex

module type S = sig ... end
module type S_FULL = sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S/index.html deleted file mode 100644 index 1f09a4cf..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (sidekick-arith.Sidekick_arith_lra__Simplex_intf.S)

Module type Sidekick_arith_lra__Simplex_intf.S

type var

The given type of the variables

module Var_map : CCMap.S with type Var_map.key = var

A map on variables

type param

Parameter required at the creation of the simplex

type lit
type t

The type of a (possibly not solved) linear system

type cert = {
cert_var : var;
cert_expr : (Q.t * var) list;
}

An unsatisfiability explanation is a couple (x, expr). If expr is the empty list, then there is a contradiction between two given bounds of x. Else, the explanation is an equality x = expr that is valid (it can be derived from the original equations of the system) from which a bound can be deduced which contradicts an already given bound of the system.

type res =
| Solution of Q.t Var_map.t
| Unsatisfiable of cert

Generic type returned when solving the simplex. A solution is a list of bindings that satisfies all the constraints inside the system. If the system is unsatisfiable, an explanation of type 'cert is returned.

Simplex construction

val create : param -> t

The empty system.

parameter fresh

the state for generating fresh variables on demand.

val add_eq : t -> (var * (Q.t * var) list) -> unit

add_eq s (x, eq) adds the equation x=eq to s

val add_bounds : t -> ?⁠strict_lower:bool -> ?⁠strict_upper:bool -> ?⁠lower_reason:lit -> ?⁠upper_reason:lit -> (var * Q.t * Q.t) -> unit

add_bounds (x, lower, upper) adds to s the bounds lower and upper for the given variable x. If the bound is loose on one side (no upper bounds for instance), the values Q.inf and Q.minus_inf can be used. By default, in a system, all variables have no bounds, i.e have lower bound Q.minus_inf and upper bound Q.inf. Optional parameters allow to make the the bounds strict. Defaults to false, so that bounds are large by default.

val add_lower_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit
val add_upper_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit

Simplex solving

val solve : t -> res

solve s solves the system s and returns a solution, if one exists. This function may change the internal representation of the system to that of an equivalent one (permutation of basic and non basic variables and pivot operation on the tableaux).

val check_cert : t -> cert -> [ `Ok of lit list | `Bad_bounds of string * string | `Diff_not_0 of Q.t Var_map.t ]

checks that the certificat indeed yields to a contradiction in the current state of the simplex.

returns

`Ok unsat_core if the certificate is valid.

val pp_cert : cert CCFormat.printer
val pp_full_state : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/C/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/C/index.html deleted file mode 100644 index aec80aef..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/C/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -C (sidekick-arith.Sidekick_arith_lra__Simplex_intf.S_FULL.L.C)

Module L.C

Coeficients used. Can be integers as well as rationals.

type t = Q.t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Comb/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Comb/Infix/index.html deleted file mode 100644 index ca944b01..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Comb/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__Simplex_intf.S_FULL.L.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Comb/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Comb/index.html deleted file mode 100644 index 3bc099fb..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Comb/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comb (sidekick-arith.Sidekick_arith_lra__Simplex_intf.S_FULL.L.Comb)

Module L.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Constr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Constr/index.html deleted file mode 100644 index 48685d90..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Constr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Constr (sidekick-arith.Sidekick_arith_lra__Simplex_intf.S_FULL.L.Constr)

Module L.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Expr/Infix/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Expr/Infix/index.html deleted file mode 100644 index 67e18a72..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Expr/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (sidekick-arith.Sidekick_arith_lra__Simplex_intf.S_FULL.L.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Expr/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Expr/index.html deleted file mode 100644 index 7d9f314c..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Expr/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expr (sidekick-arith.Sidekick_arith_lra__Simplex_intf.S_FULL.L.Expr)

Module L.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Var/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Var/index.html deleted file mode 100644 index 4bcb5a91..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Var/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Var (sidekick-arith.Sidekick_arith_lra__Simplex_intf.S_FULL.L.Var)

Module L.Var

Variables used in expressions.

type t = var

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit = lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/index.html deleted file mode 100644 index 29393c5b..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -L (sidekick-arith.Sidekick_arith_lra__Simplex_intf.S_FULL.L)

Module S_FULL.L

module C : Sidekick_arith_lra__.Linear_expr_intf.COEFF with type t = Q.t

Coeficients used. Can be integers as well as rationals.

module Var : Sidekick_arith_lra__.Linear_expr_intf.VAR with type t = var and type lit = lit

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/index.html b/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/index.html deleted file mode 100644 index 61268b0b..00000000 --- a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S_FULL (sidekick-arith.Sidekick_arith_lra__Simplex_intf.S_FULL)

Module type Sidekick_arith_lra__Simplex_intf.S_FULL

include S
type var

The given type of the variables

module Var_map : CCMap.S with type Var_map.key = var

A map on variables

type param

Parameter required at the creation of the simplex

type lit
type t

The type of a (possibly not solved) linear system

type cert = {
cert_var : var;
cert_expr : (Q.t * var) list;
}

An unsatisfiability explanation is a couple (x, expr). If expr is the empty list, then there is a contradiction between two given bounds of x. Else, the explanation is an equality x = expr that is valid (it can be derived from the original equations of the system) from which a bound can be deduced which contradicts an already given bound of the system.

type res =
| Solution of Q.t Var_map.t
| Unsatisfiable of cert

Generic type returned when solving the simplex. A solution is a list of bindings that satisfies all the constraints inside the system. If the system is unsatisfiable, an explanation of type 'cert is returned.

Simplex construction

val create : param -> t

The empty system.

parameter fresh

the state for generating fresh variables on demand.

val add_eq : t -> (var * (Q.t * var) list) -> unit

add_eq s (x, eq) adds the equation x=eq to s

val add_bounds : t -> ?⁠strict_lower:bool -> ?⁠strict_upper:bool -> ?⁠lower_reason:lit -> ?⁠upper_reason:lit -> (var * Q.t * Q.t) -> unit

add_bounds (x, lower, upper) adds to s the bounds lower and upper for the given variable x. If the bound is loose on one side (no upper bounds for instance), the values Q.inf and Q.minus_inf can be used. By default, in a system, all variables have no bounds, i.e have lower bound Q.minus_inf and upper bound Q.inf. Optional parameters allow to make the the bounds strict. Defaults to false, so that bounds are large by default.

val add_lower_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit
val add_upper_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit

Simplex solving

val solve : t -> res

solve s solves the system s and returns a solution, if one exists. This function may change the internal representation of the system to that of an equivalent one (permutation of basic and non basic variables and pivot operation on the tableaux).

val check_cert : t -> cert -> [ `Ok of lit list | `Bad_bounds of string * string | `Diff_not_0 of Q.t Var_map.t ]

checks that the certificat indeed yields to a contradiction in the current state of the simplex.

returns

`Ok unsat_core if the certificate is valid.

val pp_cert : cert CCFormat.printer
val pp_full_state : t CCFormat.printer
module L : Sidekick_arith_lra__.Linear_expr_intf.S with type C.t = Q.t and type Var.t = var and type Var.lit = lit
type op = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
type constr = L.Constr.t
val add_constr : t -> constr -> lit -> unit

Add a constraint to a simplex state.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Arg/Fun/index.html b/dev/sidekick-arith/Sidekick_base_term/Arg/Fun/index.html deleted file mode 100644 index 820cfdaf..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Arg/Fun/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun (sidekick-arith.Sidekick_base_term.Arg.Fun)

Module Arg.Fun

A function symbol, like "f" or "plus" or "is_human" or "socrates"

type t = Fun.t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Arg/Term/index.html b/dev/sidekick-arith/Sidekick_base_term/Arg/Term/index.html deleted file mode 100644 index 723a021f..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Arg/Term/index.html +++ /dev/null @@ -1,8 +0,0 @@ - -Term (sidekick-arith.Sidekick_base_term.Arg.Term)

Module Arg.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t = Term.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Term.state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
-let y = f x x in
-let z = g y x in
-z = z

the DAG has the following nodes:

n1: 2
-n2: f n1 n1
-n3: g n2 n1
-n4: = n3 n3
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Arg/Ty/index.html b/dev/sidekick-arith/Sidekick_base_term/Arg/Ty/index.html deleted file mode 100644 index 1b1346d7..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Arg/Ty/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ty (sidekick-arith.Sidekick_base_term.Arg.Ty)

Module Arg.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t = Ty.t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Arg/index.html b/dev/sidekick-arith/Sidekick_base_term/Arg/index.html deleted file mode 100644 index 02443359..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Arg/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Arg (sidekick-arith.Sidekick_base_term.Arg)

Module Sidekick_base_term.Arg

module Fun : sig ... end with type t = Fun.t

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end with type t = Ty.t

Types

module Term : sig ... end with type t = Term.t and type state = Term.state

Term structure.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Cstor/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Cstor/index.html deleted file mode 100644 index 26edea74..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Cstor/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Cstor (sidekick-arith.Sidekick_base_term.Base_types.Cstor)

Module Base_types.Cstor

type t = cstor = {
cstor_id : ID.t;
cstor_is_a : ID.t;
mutable cstor_arity : int;
cstor_args : select list lazy_t;
cstor_ty_as_data : data;
cstor_ty : ty lazy_t;
}
val id : t -> ID.t
val ty_args : t -> ty Iter.t
val equal : cstor -> cstor -> bool
val pp : CCFormat.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Data/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Data/index.html deleted file mode 100644 index d7923dc9..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Data/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Data (sidekick-arith.Sidekick_base_term.Base_types.Data)

Module Base_types.Data

type t = data = {
data_id : ID.t;
data_cstors : cstor Sidekick_base_term__.ID.Map.t lazy_t;
data_as_ty : ty lazy_t;
}
val pp : CCFormat.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Fun/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Fun/index.html deleted file mode 100644 index b5326d29..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Fun/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun (sidekick-arith.Sidekick_base_term.Base_types.Fun)

Module Base_types.Fun

type view = fun_view =
| Fun_undef of fun_ty
| Fun_select of select
| Fun_cstor of cstor
| Fun_is_a of cstor
| Fun_def of {
pp : a. ('a Fmt.printer -> 'a Sidekick_util.IArray.t Fmt.printer) option;
abs : self:term -> term Sidekick_util.IArray.t -> term * bool;
do_cc : bool;
relevant : a. ID.t -> 'a Sidekick_util.IArray.t -> int -> bool;
ty : ID.t -> term Sidekick_util.IArray.t -> ty;
eval : value Sidekick_util.IArray.t -> value;
}
type t = fun_ = {
fun_id : ID.t;
fun_view : fun_view;
}
val id : t -> ID.t
val view : t -> view
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val as_undefined : t -> (t * Ty.Fun.t) option
val as_undefined_exn : t -> t * Ty.Fun.t
val is_undefined : t -> bool
val select : select -> t
val select_idx : cstor -> int -> t
val cstor : cstor -> t
val is_a : cstor -> t
val do_cc : t -> bool
val mk_undef : ID.t -> Ty.Fun.t -> t
val mk_undef' : ID.t -> Ty.t list -> Ty.t -> t
val mk_undef_const : ID.t -> Ty.t -> t
val pp : t CCFormat.printer
module Map : CCMap.S with type Map.key = t
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Select/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Select/index.html deleted file mode 100644 index 4901af5d..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Select/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Select (sidekick-arith.Sidekick_base_term.Base_types.Select)

Module Base_types.Select

type t = select = {
select_id : ID.t;
select_cstor : cstor;
select_ty : ty lazy_t;
select_i : int;
}
val ty : t -> ty
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Statement/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Statement/index.html deleted file mode 100644 index fc3925cc..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Statement/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Statement (sidekick-arith.Sidekick_base_term.Base_types.Statement)

Module Base_types.Statement

type t = statement =
| Stmt_set_logic of string
| Stmt_set_option of string list
| Stmt_set_info of string * string
| Stmt_data of data list
| Stmt_ty_decl of ID.t * int
| Stmt_decl of ID.t * ty list * ty
| Stmt_define of definition list
| Stmt_assert of term
| Stmt_assert_clause of term list
| Stmt_check_sat of (bool * term) list
| Stmt_exit
val pp : Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Term/Iter_dag/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Term/Iter_dag/index.html deleted file mode 100644 index dfb2af5c..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Term/Iter_dag/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Iter_dag (sidekick-arith.Sidekick_base_term.Base_types.Term.Iter_dag)

Module Term.Iter_dag

type t
type order =
| Pre
| Post
val create : unit -> t
val iter_dag : ?⁠order:order -> t -> term -> term Iter.t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Term/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Term/index.html deleted file mode 100644 index 80125d4e..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Term/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Term (sidekick-arith.Sidekick_base_term.Base_types.Term)

Module Base_types.Term

type t = term = {
mutable term_id : int;
mutable term_ty : ty;
term_view : t term_view;
}
type 'a view = 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of 'a lra_view
val id : t -> int
val view : t -> term view
val ty : t -> Ty.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
type state
val create : ?⁠size:int -> unit -> state
val make : state -> t view -> t
val true_ : state -> t
val false_ : state -> t
val bool : state -> bool -> t
val const : state -> fun_ -> t
val app_fun : state -> fun_ -> t Sidekick_util.IArray.t -> t
val eq : state -> t -> t -> t
val not_ : state -> t -> t
val ite : state -> t -> t -> t -> t
val select : state -> select -> t -> t
val app_cstor : state -> cstor -> t Sidekick_util.IArray.t -> t
val is_a : state -> cstor -> t -> t
val lra : state -> t lra_view -> t
val abs : state -> t -> t * bool

Obtain unsigned version of t, + the sign as a boolean

module Iter_dag : sig ... end
val iter_dag_with : order:Iter_dag.order -> t -> t Iter.t
val iter_dag : t -> t Iter.t
val map_shallow : state -> (t -> t) -> t -> t
val pp : t Fmt.printer
Views
val is_true : t -> bool
val is_false : t -> bool
val is_const : t -> bool
val cc_view : t -> (fun_tt Iter.t) CC_view.t
val as_fun_undef : t -> (fun_ * Ty.Fun.t) option
val as_bool : t -> bool option
Containers
module Tbl : CCHashtbl.S with type Tbl.key = t
module Map : CCMap.S with type Map.key = t
module Set : CCSet.S with type Set.elt = t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Term_cell/Make_eq/argument-1-X/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Term_cell/Make_eq/argument-1-X/index.html deleted file mode 100644 index ea8bafa7..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Term_cell/Make_eq/argument-1-X/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -1-X (sidekick-arith.Sidekick_base_term.Base_types.Term_cell.Make_eq.1-X)

Parameter Make_eq.1-X

type t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Term_cell/Make_eq/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Term_cell/Make_eq/index.html deleted file mode 100644 index b584f8f1..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Term_cell/Make_eq/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make_eq (sidekick-arith.Sidekick_base_term.Base_types.Term_cell.Make_eq)

Module Term_cell.Make_eq

Parameters

Signature

val equal : X.t view -> X.t view -> bool
val hash : X.t view -> int
val pp : X.t view Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Term_cell/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Term_cell/index.html deleted file mode 100644 index 460859cd..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Term_cell/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Term_cell (sidekick-arith.Sidekick_base_term.Base_types.Term_cell)

Module Base_types.Term_cell

type 'a view = 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of 'a lra_view
type t = term view
val equal : t -> t -> bool
val hash : t -> int
val true_ : t
val false_ : t
val const : fun_ -> t
val app_fun : fun_ -> term Sidekick_util.IArray.t -> t
val eq : term -> term -> t
val not_ : term -> t
val ite : term -> term -> term -> t
val lra : term lra_view -> t
val ty : t -> Ty.t

Compute the type of this term cell. Not totally free

val pp : t Fmt.printer
val map : ('a -> 'b) -> 'a view -> 'b view
val iter : ('a -> unit) -> 'a view -> unit
module type ARG = sig ... end
module Make_eq : functor (X : ARG) -> sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Term_cell/module-type-ARG/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Term_cell/module-type-ARG/index.html deleted file mode 100644 index d4aeff23..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Term_cell/module-type-ARG/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ARG (sidekick-arith.Sidekick_base_term.Base_types.Term_cell.ARG)

Module type Term_cell.ARG

type t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Ty/Fun/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Ty/Fun/index.html deleted file mode 100644 index 07d2d407..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Ty/Fun/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun (sidekick-arith.Sidekick_base_term.Base_types.Ty.Fun)

Module Ty.Fun

type t = fun_ty
val args : t -> ty list
val ret : t -> ty
val arity : t -> int
val unfold : t -> ty list * ty
val mk : ty list -> ty -> t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Ty/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Ty/index.html deleted file mode 100644 index 612e588f..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Ty/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ty (sidekick-arith.Sidekick_base_term.Base_types.Ty)

Module Base_types.Ty

type t = ty
type state = unit
type view = ty_view =
| Ty_bool
| Ty_real
| Ty_atomic of {
def : ty_def;
args : ty list;
mutable finite : bool;
}
type def = ty_def =
| Ty_uninterpreted of ID.t
| Ty_data of {
data : data;
}
| Ty_def of {
id : ID.t;
pp : ty Fmt.printer -> ty list Fmt.printer;
default_val : value list -> value;
}
val id : t -> int
val view : t -> view
val bool : state -> t
val real : state -> t
val atomic : def -> t list -> t
val id_of_def : def -> ID.t
val atomic_uninterpreted : ID.t -> t
val finite : t -> bool
val set_finite : t -> bool -> unit
val is_bool : t -> bool
val is_uninterpreted : t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t CCFormat.printer
module Tbl : CCHashtbl.S with type Tbl.key = t
module Fun : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/Value/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/Value/index.html deleted file mode 100644 index 318196aa..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/Value/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Value (sidekick-arith.Sidekick_base_term.Base_types.Value)

Module Base_types.Value

type t = value =
| V_bool of bool
| V_element of {
id : ID.t;
ty : ty;
}
| V_cstor of {
c : cstor;
args : value list;
}
| V_custom of {
view : value_custom_view;
pp : value_custom_view Fmt.printer;
eq : value_custom_view -> value_custom_view -> bool;
hash : value_custom_view -> int;
}
| V_real of Q.t
val true_ : t
val false_ : t
val bool : bool -> t
val real : Q.t -> t
val real_of_string : string -> t
val mk_elt : ID.t -> Ty.t -> t
val is_bool : t -> bool
val is_true : t -> bool
val is_false : t -> bool
val cstor_app : cstor -> t list -> t
val fresh : Term.t -> t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Base_types/index.html b/dev/sidekick-arith/Sidekick_base_term/Base_types/index.html deleted file mode 100644 index 584d1be6..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Base_types/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Base_types (sidekick-arith.Sidekick_base_term.Base_types)

Module Sidekick_base_term.Base_types

module Vec = Msat.Vec
module Log = Msat.Log
module Fmt = CCFormat
module CC_view = Sidekick_core.CC_view
type lra_pred = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
type lra_op = Sidekick_arith_lra.op =
| Plus
| Minus
type 'a lra_view = 'a Sidekick_arith_lra.lra_view =
| LRA_pred of lra_pred * 'a * 'a
| LRA_op of lra_op * 'a * 'a
| LRA_mult of Q.t * 'a
| LRA_const of Q.t
| LRA_simplex_var of 'a
| LRA_simplex_pred of 'a * Sidekick_arith_lra.S_op.t * Q.t
| LRA_other of 'a
type term = {
mutable term_id : int;
mutable term_ty : ty;
term_view : term term_view;
}
and 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of 'a lra_view
and fun_ = {
fun_id : ID.t;
fun_view : fun_view;
}
and fun_view =
| Fun_undef of fun_ty
| Fun_select of select
| Fun_cstor of cstor
| Fun_is_a of cstor
| Fun_def of {
pp : a. ('a Fmt.printer -> 'a Sidekick_util.IArray.t Fmt.printer) option;
abs : self:term -> term Sidekick_util.IArray.t -> term * bool;
do_cc : bool;
relevant : a. ID.t -> 'a Sidekick_util.IArray.t -> int -> bool;
ty : ID.t -> term Sidekick_util.IArray.t -> ty;
eval : value Sidekick_util.IArray.t -> value;
}

Methods on the custom term view whose arguments are 'a. Terms must be printable, and provide some additional theory handles.

  • relevant must return a subset of args (possibly the same set). The terms it returns will be activated and evaluated whenever possible. Terms in args \ relevant args are considered for congruence but not for evaluation.
and fun_ty = {
fun_ty_args : ty list;
fun_ty_ret : ty;
}

Function type

and ty = {
mutable ty_id : int;
ty_view : ty_view;
}

Hashconsed type

and ty_view =
| Ty_bool
| Ty_real
| Ty_atomic of {
def : ty_def;
args : ty list;
mutable finite : bool;
}
and ty_def =
| Ty_uninterpreted of ID.t
| Ty_data of {
data : data;
}
| Ty_def of {
id : ID.t;
pp : ty Fmt.printer -> ty list Fmt.printer;
default_val : value list -> value;
}
and data = {
data_id : ID.t;
data_cstors : cstor Sidekick_base_term__.ID.Map.t lazy_t;
data_as_ty : ty lazy_t;
}
and cstor = {
cstor_id : ID.t;
cstor_is_a : ID.t;
mutable cstor_arity : int;
cstor_args : select list lazy_t;
cstor_ty_as_data : data;
cstor_ty : ty lazy_t;
}
and select = {
select_id : ID.t;
select_cstor : cstor;
select_ty : ty lazy_t;
select_i : int;
}
and value =
| V_bool of bool
| V_element of {
id : ID.t;
ty : ty;
}

a named constant, distinct from any other constant

| V_cstor of {
c : cstor;
args : value list;
}
| V_custom of {
view : value_custom_view;
pp : value_custom_view Fmt.printer;
eq : value_custom_view -> value_custom_view -> bool;
hash : value_custom_view -> int;
}

Custom value

| V_real of Q.t

Semantic values, used for models (and possibly model-constructing calculi)

and value_custom_view = ..
type definition = ID.t * ty * term
type statement =
| Stmt_set_logic of string
| Stmt_set_option of string list
| Stmt_set_info of string * string
| Stmt_data of data list
| Stmt_ty_decl of ID.t * int
| Stmt_decl of ID.t * ty list * ty
| Stmt_define of definition list
| Stmt_assert of term
| Stmt_assert_clause of term list
| Stmt_check_sat of (bool * term) list
| Stmt_exit
val term_equal_ : term -> term -> bool
val term_hash_ : term -> int
val term_cmp_ : term -> term -> int
val fun_compare : fun_ -> fun_ -> int
val pp_fun : CCFormat.t -> fun_ -> unit
val id_of_fun : fun_ -> ID.t
val eq_ty : ty -> ty -> bool
val eq_cstor : cstor -> cstor -> bool
val eq_value : value -> value -> bool
val hash_value : value Sidekick_util.Hash.t
val pp_value : value Sidekick_util.Util.printer
val pp_db : Stdlib.Format.formatter -> (int * 'a) -> unit
val pp_ty : ty Sidekick_util.Util.printer
val string_of_lra_pred : lra_pred -> string
val pp_pred : Fmt.t -> lra_pred -> unit
val string_of_lra_op : lra_op -> string
val pp_lra_op : Fmt.t -> lra_op -> unit
val pp_term_view_gen : pp_id:(Fmt.t -> ID.t -> unit) -> pp_t:'a Fmt.printer -> Fmt.t -> 'a term_view -> unit
val pp_term_top : ids:bool -> Fmt.t -> term -> unit
val pp_term : Fmt.t -> term -> unit
val pp_term_view : Fmt.t -> term term_view -> unit
module Ty : sig ... end
module Fun : sig ... end
module Term_cell : sig ... end
module Term : sig ... end
module Value : sig ... end
module Data : sig ... end
module Select : sig ... end
module Cstor : sig ... end
module Statement : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/ID/B/index.html b/dev/sidekick-arith/Sidekick_base_term/ID/B/index.html deleted file mode 100644 index 38397272..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/ID/B/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -B (sidekick-arith.Sidekick_base_term.ID.B)

Module ID.B

val rat : t
val int : t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/ID/index.html b/dev/sidekick-arith/Sidekick_base_term/ID/index.html deleted file mode 100644 index d1d7d91d..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/ID/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ID (sidekick-arith.Sidekick_base_term.ID)

Module Sidekick_base_term.ID

Unique Identifiers

type t
val make : string -> t
val makef : ('a, Stdlib.Format.formatter, unit, t) Stdlib.format4 -> 'a
val copy : t -> t
val id : t -> int
val to_string : t -> string
val to_string_full : t -> string
include Sidekick_util.Intf.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_util.Intf.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_util.Intf.HASH with type t := t
type t
val hash : t -> int
include Sidekick_util.Intf.PRINT with type t := t
type t
val pp : t CCFormat.printer
val pp_name : t CCFormat.printer
module Map : CCMap.S with type Map.key = t
module Set : CCSet.S with type Set.elt = t
module Tbl : CCHashtbl.S with type Tbl.key = t
module B : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Model/Fun_interpretation/index.html b/dev/sidekick-arith/Sidekick_base_term/Model/Fun_interpretation/index.html deleted file mode 100644 index d454f000..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Model/Fun_interpretation/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun_interpretation (sidekick-arith.Sidekick_base_term.Model.Fun_interpretation)

Module Model.Fun_interpretation

type t = {
cases : Base_types.Value.t Val_map.t;
default : Base_types.Value.t;
}
val default : t -> Base_types.Value.t
val cases_list : t -> (Base_types.Value.t list * Base_types.Value.t) list
val make : default:Base_types.Value.t -> (Base_types.Value.t list * Base_types.Value.t) list -> t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Model/Val_map/index.html b/dev/sidekick-arith/Sidekick_base_term/Model/Val_map/index.html deleted file mode 100644 index 4252d864..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Model/Val_map/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Val_map (sidekick-arith.Sidekick_base_term.Model.Val_map)

Module Model.Val_map

type key = Base_types.Value.t list
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val cardinal : _ t -> int
val find : key -> 'a t -> 'a option
val add : key -> 'a -> 'a t -> 'a t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Model/index.html b/dev/sidekick-arith/Sidekick_base_term/Model/index.html deleted file mode 100644 index af079852..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Model/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Model (sidekick-arith.Sidekick_base_term.Model)

Module Sidekick_base_term.Model

Model

module Val_map : sig ... end
module Fun_interpretation : sig ... end
type t = {
values : Base_types.Value.t Sidekick_base_term__.Base_types.Term.Map.t;
funs : Fun_interpretation.t Sidekick_base_term__.Base_types.Fun.Map.t;
}
val empty : t
val add : Base_types.Term.t -> Base_types.Value.t -> t -> t
val mem : Base_types.Term.t -> t -> bool
val find : Base_types.Term.t -> t -> Base_types.Value.t option
val merge : t -> t -> t
val pp : t CCFormat.printer
val eval : t -> Base_types.Term.t -> Base_types.Value.t option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Proof/Quip/index.html b/dev/sidekick-arith/Sidekick_base_term/Proof/Quip/index.html deleted file mode 100644 index f3b95fdc..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Proof/Quip/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Quip (sidekick-arith.Sidekick_base_term.Proof.Quip)

Module Proof.Quip

val output : Stdlib.out_channel -> t -> unit

Printer in Quip format (experimental)

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/Proof/index.html b/dev/sidekick-arith/Sidekick_base_term/Proof/index.html deleted file mode 100644 index 4b0bd10a..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/Proof/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Proof (sidekick-arith.Sidekick_base_term.Proof)

Module Sidekick_base_term.Proof

include Sidekick_core.PROOF with type term = Base_types.Term.t and type ty = Base_types.Ty.t
type term = Base_types.Term.t
type ty = Base_types.Ty.t
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
val isa_split : ty -> term Iter.t -> t
val isa_disj : ty -> term -> term -> t
val cstor_inj : Base_types.Cstor.t -> int -> term list -> term list -> t
val bool_eq : term -> term -> t
val bool_c : string -> term list -> t
val ite_true : term -> t
val ite_false : term -> t
val lra : lit Iter.t -> t
val lra_l : lit list -> t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/index.html b/dev/sidekick-arith/Sidekick_base_term/index.html deleted file mode 100644 index 3d6ac549..00000000 --- a/dev/sidekick-arith/Sidekick_base_term/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_base_term (sidekick-arith.Sidekick_base_term)

Module Sidekick_base_term

module Base_types : sig ... end
module ID : sig ... end
module Fun = Base_types.Fun
module Stat = Sidekick_util.Stat
module Model : sig ... end
module Term = Base_types.Term
module Value = Base_types.Value
module Term_cell = Base_types.Term_cell
module Ty = Base_types.Ty
module Statement = Base_types.Statement
module Data = Base_types.Data
module Select = Base_types.Select
module Proof : sig ... end
module Arg : Sidekick_core.TERM with type Term.t = Term.t and type Fun.t = Fun.t and type Ty.t = Ty.t and type Term.state = Term.state
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Cstor/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Cstor/index.html deleted file mode 100644 index f1ea194f..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Cstor/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Cstor (sidekick-arith.Sidekick_base_term__.Base_types.Cstor)

Module Base_types.Cstor

type t = cstor = {
cstor_id : Sidekick_base_term.ID.t;
cstor_is_a : Sidekick_base_term.ID.t;
mutable cstor_arity : int;
cstor_args : select list lazy_t;
cstor_ty_as_data : data;
cstor_ty : ty lazy_t;
}
val id : t -> Sidekick_base_term.ID.t
val ty_args : t -> ty Iter.t
val equal : cstor -> cstor -> bool
val pp : CCFormat.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Data/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Data/index.html deleted file mode 100644 index c6a93de2..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Data/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Data (sidekick-arith.Sidekick_base_term__.Base_types.Data)

Module Base_types.Data

type t = data = {
data_id : Sidekick_base_term.ID.t;
data_cstors : cstor Sidekick_base_term__.ID.Map.t lazy_t;
data_as_ty : ty lazy_t;
}
val pp : CCFormat.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Fun/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Fun/index.html deleted file mode 100644 index 2f8f6a3b..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Fun/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun (sidekick-arith.Sidekick_base_term__.Base_types.Fun)

Module Base_types.Fun

type view = fun_view =
| Fun_undef of fun_ty
| Fun_select of select
| Fun_cstor of cstor
| Fun_is_a of cstor
| Fun_def of {
pp : a. ('a Fmt.printer -> 'a Sidekick_util.IArray.t Fmt.printer) option;
abs : self:term -> term Sidekick_util.IArray.t -> term * bool;
do_cc : bool;
relevant : a. Sidekick_base_term.ID.t -> 'a Sidekick_util.IArray.t -> int -> bool;
ty : Sidekick_base_term.ID.t -> term Sidekick_util.IArray.t -> ty;
eval : value Sidekick_util.IArray.t -> value;
}
type t = fun_ = {
fun_id : Sidekick_base_term.ID.t;
fun_view : fun_view;
}
val id : t -> Sidekick_base_term.ID.t
val view : t -> view
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val as_undefined : t -> (t * Ty.Fun.t) option
val as_undefined_exn : t -> t * Ty.Fun.t
val is_undefined : t -> bool
val select : select -> t
val select_idx : cstor -> int -> t
val cstor : cstor -> t
val is_a : cstor -> t
val do_cc : t -> bool
val mk_undef : Sidekick_base_term.ID.t -> Ty.Fun.t -> t
val mk_undef' : Sidekick_base_term.ID.t -> Ty.t list -> Ty.t -> t
val mk_undef_const : Sidekick_base_term.ID.t -> Ty.t -> t
val pp : t CCFormat.printer
module Map : CCMap.S with type Map.key = t
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Select/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Select/index.html deleted file mode 100644 index 4aff3f5c..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Select/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Select (sidekick-arith.Sidekick_base_term__.Base_types.Select)

Module Base_types.Select

type t = select = {
select_id : Sidekick_base_term.ID.t;
select_cstor : cstor;
select_ty : ty lazy_t;
select_i : int;
}
val ty : t -> ty
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Statement/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Statement/index.html deleted file mode 100644 index 0e3926ba..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Statement/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Statement (sidekick-arith.Sidekick_base_term__.Base_types.Statement)

Module Base_types.Statement

type t = statement =
| Stmt_set_logic of string
| Stmt_set_option of string list
| Stmt_set_info of string * string
| Stmt_data of data list
| Stmt_ty_decl of Sidekick_base_term.ID.t * int
| Stmt_decl of Sidekick_base_term.ID.t * ty list * ty
| Stmt_define of definition list
| Stmt_assert of term
| Stmt_assert_clause of term list
| Stmt_check_sat of (bool * term) list
| Stmt_exit
val pp : Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term/Iter_dag/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term/Iter_dag/index.html deleted file mode 100644 index bdeddd02..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term/Iter_dag/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Iter_dag (sidekick-arith.Sidekick_base_term__.Base_types.Term.Iter_dag)

Module Term.Iter_dag

type t
type order =
| Pre
| Post
val create : unit -> t
val iter_dag : ?⁠order:order -> t -> term -> term Iter.t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term/index.html deleted file mode 100644 index 76f8538c..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Term (sidekick-arith.Sidekick_base_term__.Base_types.Term)

Module Base_types.Term

type t = term = {
mutable term_id : int;
mutable term_ty : ty;
term_view : t term_view;
}
type 'a view = 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of 'a lra_view
val id : t -> int
val view : t -> term view
val ty : t -> Ty.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
type state
val create : ?⁠size:int -> unit -> state
val make : state -> t view -> t
val true_ : state -> t
val false_ : state -> t
val bool : state -> bool -> t
val const : state -> fun_ -> t
val app_fun : state -> fun_ -> t Sidekick_util.IArray.t -> t
val eq : state -> t -> t -> t
val not_ : state -> t -> t
val ite : state -> t -> t -> t -> t
val select : state -> select -> t -> t
val app_cstor : state -> cstor -> t Sidekick_util.IArray.t -> t
val is_a : state -> cstor -> t -> t
val lra : state -> t lra_view -> t
val abs : state -> t -> t * bool

Obtain unsigned version of t, + the sign as a boolean

module Iter_dag : sig ... end
val iter_dag_with : order:Iter_dag.order -> t -> t Iter.t
val iter_dag : t -> t Iter.t
val map_shallow : state -> (t -> t) -> t -> t
val pp : t Fmt.printer
Views
val is_true : t -> bool
val is_false : t -> bool
val is_const : t -> bool
val cc_view : t -> (fun_tt Iter.t) CC_view.t
val as_fun_undef : t -> (fun_ * Ty.Fun.t) option
val as_bool : t -> bool option
Containers
module Tbl : CCHashtbl.S with type Tbl.key = t
module Map : CCMap.S with type Map.key = t
module Set : CCSet.S with type Set.elt = t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term_cell/Make_eq/argument-1-X/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term_cell/Make_eq/argument-1-X/index.html deleted file mode 100644 index 234477d8..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term_cell/Make_eq/argument-1-X/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -1-X (sidekick-arith.Sidekick_base_term__.Base_types.Term_cell.Make_eq.1-X)

Parameter Make_eq.1-X

type t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term_cell/Make_eq/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term_cell/Make_eq/index.html deleted file mode 100644 index d65f4394..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term_cell/Make_eq/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make_eq (sidekick-arith.Sidekick_base_term__.Base_types.Term_cell.Make_eq)

Module Term_cell.Make_eq

Parameters

Signature

val equal : X.t view -> X.t view -> bool
val hash : X.t view -> int
val pp : X.t view Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term_cell/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term_cell/index.html deleted file mode 100644 index c46b1f8d..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term_cell/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Term_cell (sidekick-arith.Sidekick_base_term__.Base_types.Term_cell)

Module Base_types.Term_cell

type 'a view = 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of 'a lra_view
type t = term view
val equal : t -> t -> bool
val hash : t -> int
val true_ : t
val false_ : t
val const : fun_ -> t
val app_fun : fun_ -> term Sidekick_util.IArray.t -> t
val eq : term -> term -> t
val not_ : term -> t
val ite : term -> term -> term -> t
val lra : term lra_view -> t
val ty : t -> Ty.t

Compute the type of this term cell. Not totally free

val pp : t Fmt.printer
val map : ('a -> 'b) -> 'a view -> 'b view
val iter : ('a -> unit) -> 'a view -> unit
module type ARG = sig ... end
module Make_eq : functor (X : ARG) -> sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term_cell/module-type-ARG/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term_cell/module-type-ARG/index.html deleted file mode 100644 index 55c6c45a..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Term_cell/module-type-ARG/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ARG (sidekick-arith.Sidekick_base_term__.Base_types.Term_cell.ARG)

Module type Term_cell.ARG

type t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Ty/Fun/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Ty/Fun/index.html deleted file mode 100644 index de689a19..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Ty/Fun/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun (sidekick-arith.Sidekick_base_term__.Base_types.Ty.Fun)

Module Ty.Fun

type t = fun_ty
val args : t -> ty list
val ret : t -> ty
val arity : t -> int
val unfold : t -> ty list * ty
val mk : ty list -> ty -> t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Ty/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Ty/index.html deleted file mode 100644 index a0ea5efe..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Ty/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ty (sidekick-arith.Sidekick_base_term__.Base_types.Ty)

Module Base_types.Ty

type t = ty
type state = unit
type view = ty_view =
| Ty_bool
| Ty_real
| Ty_atomic of {
def : ty_def;
args : ty list;
mutable finite : bool;
}
type def = ty_def =
| Ty_uninterpreted of Sidekick_base_term.ID.t
| Ty_data of {
data : data;
}
| Ty_def of {
id : Sidekick_base_term.ID.t;
pp : ty Fmt.printer -> ty list Fmt.printer;
default_val : value list -> value;
}
val id : t -> int
val view : t -> view
val bool : state -> t
val real : state -> t
val atomic : def -> t list -> t
val id_of_def : def -> Sidekick_base_term.ID.t
val atomic_uninterpreted : Sidekick_base_term.ID.t -> t
val finite : t -> bool
val set_finite : t -> bool -> unit
val is_bool : t -> bool
val is_uninterpreted : t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t CCFormat.printer
module Tbl : CCHashtbl.S with type Tbl.key = t
module Fun : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Value/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/Value/index.html deleted file mode 100644 index 1eab8796..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/Value/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Value (sidekick-arith.Sidekick_base_term__.Base_types.Value)

Module Base_types.Value

type t = value =
| V_bool of bool
| V_element of {
id : Sidekick_base_term.ID.t;
ty : ty;
}
| V_cstor of {
c : cstor;
args : value list;
}
| V_custom of {
view : value_custom_view;
pp : value_custom_view Fmt.printer;
eq : value_custom_view -> value_custom_view -> bool;
hash : value_custom_view -> int;
}
| V_real of Q.t
val true_ : t
val false_ : t
val bool : bool -> t
val real : Q.t -> t
val real_of_string : string -> t
val mk_elt : Sidekick_base_term.ID.t -> Ty.t -> t
val is_bool : t -> bool
val is_true : t -> bool
val is_false : t -> bool
val cstor_app : cstor -> t list -> t
val fresh : Term.t -> t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Base_types/index.html b/dev/sidekick-arith/Sidekick_base_term__/Base_types/index.html deleted file mode 100644 index 62932a78..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Base_types/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Base_types (sidekick-arith.Sidekick_base_term__.Base_types)

Module Sidekick_base_term__.Base_types

module Vec = Msat.Vec
module Log = Msat.Log
module Fmt = CCFormat
module CC_view = Sidekick_core.CC_view
type lra_pred = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
type lra_op = Sidekick_arith_lra.op =
| Plus
| Minus
type 'a lra_view = 'a Sidekick_arith_lra.lra_view =
| LRA_pred of lra_pred * 'a * 'a
| LRA_op of lra_op * 'a * 'a
| LRA_mult of Q.t * 'a
| LRA_const of Q.t
| LRA_simplex_var of 'a
| LRA_simplex_pred of 'a * Sidekick_arith_lra.S_op.t * Q.t
| LRA_other of 'a
type term = {
mutable term_id : int;
mutable term_ty : ty;
term_view : term term_view;
}
and 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of 'a lra_view
and fun_ = {
fun_id : Sidekick_base_term.ID.t;
fun_view : fun_view;
}
and fun_view =
| Fun_undef of fun_ty
| Fun_select of select
| Fun_cstor of cstor
| Fun_is_a of cstor
| Fun_def of {
pp : a. ('a Fmt.printer -> 'a Sidekick_util.IArray.t Fmt.printer) option;
abs : self:term -> term Sidekick_util.IArray.t -> term * bool;
do_cc : bool;
relevant : a. Sidekick_base_term.ID.t -> 'a Sidekick_util.IArray.t -> int -> bool;
ty : Sidekick_base_term.ID.t -> term Sidekick_util.IArray.t -> ty;
eval : value Sidekick_util.IArray.t -> value;
}

Methods on the custom term view whose arguments are 'a. Terms must be printable, and provide some additional theory handles.

  • relevant must return a subset of args (possibly the same set). The terms it returns will be activated and evaluated whenever possible. Terms in args \ relevant args are considered for congruence but not for evaluation.
and fun_ty = {
fun_ty_args : ty list;
fun_ty_ret : ty;
}

Function type

and ty = {
mutable ty_id : int;
ty_view : ty_view;
}

Hashconsed type

and ty_view =
| Ty_bool
| Ty_real
| Ty_atomic of {
def : ty_def;
args : ty list;
mutable finite : bool;
}
and ty_def =
| Ty_uninterpreted of Sidekick_base_term.ID.t
| Ty_data of {
data : data;
}
| Ty_def of {
id : Sidekick_base_term.ID.t;
pp : ty Fmt.printer -> ty list Fmt.printer;
default_val : value list -> value;
}
and data = {
data_id : Sidekick_base_term.ID.t;
data_cstors : cstor Sidekick_base_term__.ID.Map.t lazy_t;
data_as_ty : ty lazy_t;
}
and cstor = {
cstor_id : Sidekick_base_term.ID.t;
cstor_is_a : Sidekick_base_term.ID.t;
mutable cstor_arity : int;
cstor_args : select list lazy_t;
cstor_ty_as_data : data;
cstor_ty : ty lazy_t;
}
and select = {
select_id : Sidekick_base_term.ID.t;
select_cstor : cstor;
select_ty : ty lazy_t;
select_i : int;
}
and value =
| V_bool of bool
| V_element of {
id : Sidekick_base_term.ID.t;
ty : ty;
}

a named constant, distinct from any other constant

| V_cstor of {
c : cstor;
args : value list;
}
| V_custom of {
view : value_custom_view;
pp : value_custom_view Fmt.printer;
eq : value_custom_view -> value_custom_view -> bool;
hash : value_custom_view -> int;
}

Custom value

| V_real of Q.t

Semantic values, used for models (and possibly model-constructing calculi)

and value_custom_view = ..
type definition = Sidekick_base_term.ID.t * ty * term
type statement =
| Stmt_set_logic of string
| Stmt_set_option of string list
| Stmt_set_info of string * string
| Stmt_data of data list
| Stmt_ty_decl of Sidekick_base_term.ID.t * int
| Stmt_decl of Sidekick_base_term.ID.t * ty list * ty
| Stmt_define of definition list
| Stmt_assert of term
| Stmt_assert_clause of term list
| Stmt_check_sat of (bool * term) list
| Stmt_exit
val term_equal_ : term -> term -> bool
val term_hash_ : term -> int
val term_cmp_ : term -> term -> int
val fun_compare : fun_ -> fun_ -> int
val pp_fun : CCFormat.t -> fun_ -> unit
val id_of_fun : fun_ -> Sidekick_base_term.ID.t
val eq_ty : ty -> ty -> bool
val eq_cstor : cstor -> cstor -> bool
val eq_value : value -> value -> bool
val hash_value : value Sidekick_util.Hash.t
val pp_value : value Sidekick_util.Util.printer
val pp_db : Stdlib.Format.formatter -> (int * 'a) -> unit
val pp_ty : ty Sidekick_util.Util.printer
val string_of_lra_pred : lra_pred -> string
val pp_pred : Fmt.t -> lra_pred -> unit
val string_of_lra_op : lra_op -> string
val pp_lra_op : Fmt.t -> lra_op -> unit
val pp_term_view_gen : pp_id:(Fmt.t -> Sidekick_base_term.ID.t -> unit) -> pp_t:'a Fmt.printer -> Fmt.t -> 'a term_view -> unit
val pp_term_top : ids:bool -> Fmt.t -> term -> unit
val pp_term : Fmt.t -> term -> unit
val pp_term_view : Fmt.t -> term term_view -> unit
module Ty : sig ... end
module Fun : sig ... end
module Term_cell : sig ... end
module Term : sig ... end
module Value : sig ... end
module Data : sig ... end
module Select : sig ... end
module Cstor : sig ... end
module Statement : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/CCHet/Key/index.html b/dev/sidekick-arith/Sidekick_base_term__/CCHet/Key/index.html deleted file mode 100644 index 12f8290a..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/CCHet/Key/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Key (sidekick-arith.Sidekick_base_term__.CCHet.Key)

Module CCHet.Key

type 'a t
val create : unit -> 'a t
val equal : 'a t -> 'a t -> bool

Compare two keys that have compatible types.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/CCHet/Map/index.html b/dev/sidekick-arith/Sidekick_base_term__/CCHet/Map/index.html deleted file mode 100644 index a5d7578f..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/CCHet/Map/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Map (sidekick-arith.Sidekick_base_term__.CCHet.Map)

Module CCHet.Map

Immutable map

type t
val empty : t
val mem : _ Key.t -> t -> bool
val add : 'a Key.t -> 'a -> t -> t
val remove : _ Key.t -> t -> t
val length : t -> int
val cardinal : t -> int
val find : 'a Key.t -> t -> 'a option
val find_exn : 'a Key.t -> t -> 'a
raises Not_found

if the key is not in the table.

val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> t
val add_list : t -> pair list -> t
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/CCHet/Tbl/index.html b/dev/sidekick-arith/Sidekick_base_term__/CCHet/Tbl/index.html deleted file mode 100644 index 9578b3bf..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/CCHet/Tbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Tbl (sidekick-arith.Sidekick_base_term__.CCHet.Tbl)

Module CCHet.Tbl

Imperative table indexed by Key

type t
val create : ?⁠size:int -> unit -> t
val mem : t -> _ Key.t -> bool
val add : t -> 'a Key.t -> 'a -> unit
val remove : t -> _ Key.t -> unit
val length : t -> int
val find : t -> 'a Key.t -> 'a option
val find_exn : t -> 'a Key.t -> 'a
raises Not_found

if the key is not in the table.

val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> unit
val add_list : t -> pair list -> unit
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/CCHet/index.html b/dev/sidekick-arith/Sidekick_base_term__/CCHet/index.html deleted file mode 100644 index 6eb961d3..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/CCHet/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CCHet (sidekick-arith.Sidekick_base_term__.CCHet)

Module Sidekick_base_term__.CCHet

Associative containers with Heterogeneous Values

This is similar to CCMixtbl, but the injection is directly used as a key.

since
0.17
type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
module Key : sig ... end
type pair =
| Pair : 'a Key.t * 'a -> pair
module Tbl : sig ... end
module Map : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Config/Key/index.html b/dev/sidekick-arith/Sidekick_base_term__/Config/Key/index.html deleted file mode 100644 index d534ef39..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Config/Key/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Key (sidekick-arith.Sidekick_base_term__.Config.Key)

Module Config.Key

type 'a t
val create : unit -> 'a t
val equal : 'a t -> 'a t -> bool

Compare two keys that have compatible types

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Config/index.html b/dev/sidekick-arith/Sidekick_base_term__/Config/index.html deleted file mode 100644 index d0aa22ef..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Config/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Config (sidekick-arith.Sidekick_base_term__.Config)

Module Sidekick_base_term__.Config

Configuration

type 'a sequence = ('a -> unit) -> unit
module Key : sig ... end
type t
val empty : t
val mem : _ Key.t -> t -> bool
val add : 'a Key.t -> 'a -> t -> t
val length : t -> int
val cardinal : t -> int
val find : 'a Key.t -> t -> 'a option
val find_exn : 'a Key.t -> t -> 'a
raises Not_found

if the key is not in the table

type pair =
| Pair : 'a Key.t * 'a -> pair
val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair sequence
val of_iter : pair sequence -> t
val add_iter : t -> pair sequence -> t
val add_list : t -> pair list -> t
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Hashcons/Make/argument-1-A/index.html b/dev/sidekick-arith/Sidekick_base_term__/Hashcons/Make/argument-1-A/index.html deleted file mode 100644 index c39acd42..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Hashcons/Make/argument-1-A/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -1-A (sidekick-arith.Sidekick_base_term__.Hashcons.Make.1-A)

Parameter Make.1-A

type t
val equal : t -> t -> bool
val hash : t -> int
val set_id : t -> int -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Hashcons/Make/index.html b/dev/sidekick-arith/Sidekick_base_term__/Hashcons/Make/index.html deleted file mode 100644 index 8860fd55..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Hashcons/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (sidekick-arith.Sidekick_base_term__.Hashcons.Make)

Module Hashcons.Make

Parameters

Signature

type t
val create : ?⁠size:int -> unit -> t
val hashcons : t -> A.t -> A.t
val to_seq : t -> A.t Iter.t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Hashcons/index.html b/dev/sidekick-arith/Sidekick_base_term__/Hashcons/index.html deleted file mode 100644 index dac0348a..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Hashcons/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashcons (sidekick-arith.Sidekick_base_term__.Hashcons)

Module Sidekick_base_term__.Hashcons

module type ARG = sig ... end
module Make : functor (A : ARG) -> sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Hashcons/module-type-ARG/index.html b/dev/sidekick-arith/Sidekick_base_term__/Hashcons/module-type-ARG/index.html deleted file mode 100644 index 3df2ae5e..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Hashcons/module-type-ARG/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ARG (sidekick-arith.Sidekick_base_term__.Hashcons.ARG)

Module type Hashcons.ARG

type t
val equal : t -> t -> bool
val hash : t -> int
val set_id : t -> int -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/ID/B/index.html b/dev/sidekick-arith/Sidekick_base_term__/ID/B/index.html deleted file mode 100644 index 46f9e78f..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/ID/B/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -B (sidekick-arith.Sidekick_base_term__.ID.B)

Module ID.B

val rat : t
val int : t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/ID/index.html b/dev/sidekick-arith/Sidekick_base_term__/ID/index.html deleted file mode 100644 index fa056176..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/ID/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ID (sidekick-arith.Sidekick_base_term__.ID)

Module Sidekick_base_term__.ID

Unique Identifiers

type t
val make : string -> t
val makef : ('a, Stdlib.Format.formatter, unit, t) Stdlib.format4 -> 'a
val copy : t -> t
val id : t -> int
val to_string : t -> string
val to_string_full : t -> string
include Sidekick_util.Intf.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_util.Intf.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_util.Intf.HASH with type t := t
type t
val hash : t -> int
include Sidekick_util.Intf.PRINT with type t := t
type t
val pp : t CCFormat.printer
val pp_name : t CCFormat.printer
module Map : CCMap.S with type Map.key = t
module Set : CCSet.S with type Set.elt = t
module Tbl : CCHashtbl.S with type Tbl.key = t
module B : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Model/Fun_interpretation/index.html b/dev/sidekick-arith/Sidekick_base_term__/Model/Fun_interpretation/index.html deleted file mode 100644 index d46252a8..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Model/Fun_interpretation/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun_interpretation (sidekick-arith.Sidekick_base_term__.Model.Fun_interpretation)

Module Model.Fun_interpretation

type t = {
cases : Sidekick_base_term.Base_types.Value.t Val_map.t;
default : Sidekick_base_term.Base_types.Value.t;
}
val default : t -> Sidekick_base_term.Base_types.Value.t
val cases_list : t -> (Sidekick_base_term.Base_types.Value.t list * Sidekick_base_term.Base_types.Value.t) list
val make : default:Sidekick_base_term.Base_types.Value.t -> (Sidekick_base_term.Base_types.Value.t list * Sidekick_base_term.Base_types.Value.t) list -> t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Model/Val_map/index.html b/dev/sidekick-arith/Sidekick_base_term__/Model/Val_map/index.html deleted file mode 100644 index 7ce7204a..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Model/Val_map/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Val_map (sidekick-arith.Sidekick_base_term__.Model.Val_map)

Module Model.Val_map

type key = Sidekick_base_term.Base_types.Value.t list
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val cardinal : _ t -> int
val find : key -> 'a t -> 'a option
val add : key -> 'a -> 'a t -> 'a t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Model/index.html b/dev/sidekick-arith/Sidekick_base_term__/Model/index.html deleted file mode 100644 index dc1d69e2..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Model/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Model (sidekick-arith.Sidekick_base_term__.Model)

Module Sidekick_base_term__.Model

Model

module Val_map : sig ... end
module Fun_interpretation : sig ... end
type t = {
values : Sidekick_base_term.Base_types.Value.t Sidekick_base_term__.Base_types.Term.Map.t;
funs : Fun_interpretation.t Sidekick_base_term__.Base_types.Fun.Map.t;
}
val empty : t
val add : Sidekick_base_term.Base_types.Term.t -> Sidekick_base_term.Base_types.Value.t -> t -> t
val mem : Sidekick_base_term.Base_types.Term.t -> t -> bool
val find : Sidekick_base_term.Base_types.Term.t -> t -> Sidekick_base_term.Base_types.Value.t option
val merge : t -> t -> t
val pp : t CCFormat.printer
val eval : t -> Sidekick_base_term.Base_types.Term.t -> Sidekick_base_term.Base_types.Value.t option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Proof/Quip/index.html b/dev/sidekick-arith/Sidekick_base_term__/Proof/Quip/index.html deleted file mode 100644 index 8c8f2527..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Proof/Quip/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Quip (sidekick-arith.Sidekick_base_term__.Proof.Quip)

Module Proof.Quip

val output : Stdlib.out_channel -> t -> unit

Printer in Quip format (experimental)

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/Proof/index.html b/dev/sidekick-arith/Sidekick_base_term__/Proof/index.html deleted file mode 100644 index c42d7d34..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/Proof/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Proof (sidekick-arith.Sidekick_base_term__.Proof)

Module Sidekick_base_term__.Proof

include Sidekick_core.PROOF with type term = Sidekick_base_term.Base_types.Term.t and type ty = Sidekick_base_term.Base_types.Ty.t
type term = Sidekick_base_term.Base_types.Term.t
type ty = Sidekick_base_term.Base_types.Ty.t
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
val isa_split : ty -> term Iter.t -> t
val isa_disj : ty -> term -> term -> t
val cstor_inj : Sidekick_base_term.Base_types.Cstor.t -> int -> term list -> term list -> t
val bool_eq : term -> term -> t
val bool_c : string -> term list -> t
val ite_true : term -> t
val ite_false : term -> t
val lra : lit Iter.t -> t
val lra_l : lit list -> t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/index.html b/dev/sidekick-arith/Sidekick_base_term__/index.html deleted file mode 100644 index 2c654b94..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_base_term__ (sidekick-arith.Sidekick_base_term__)

Module Sidekick_base_term__

module Base_types : sig ... end
module CCHet : sig ... end
module Config : sig ... end
module Hashcons : sig ... end
module ID : sig ... end
module Model : sig ... end
module Proof : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Cstor/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Cstor/index.html deleted file mode 100644 index 5af4e490..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Cstor/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Cstor (sidekick-arith.Sidekick_base_term__Base_types.Cstor)

Module Sidekick_base_term__Base_types.Cstor

type t = cstor = {
cstor_id : Sidekick_base_term.ID.t;
cstor_is_a : Sidekick_base_term.ID.t;
mutable cstor_arity : int;
cstor_args : select list lazy_t;
cstor_ty_as_data : data;
cstor_ty : ty lazy_t;
}
val id : t -> Sidekick_base_term.ID.t
val ty_args : t -> ty Iter.t
val equal : cstor -> cstor -> bool
val pp : CCFormat.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Data/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Data/index.html deleted file mode 100644 index eb63fd61..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Data/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Data (sidekick-arith.Sidekick_base_term__Base_types.Data)

Module Sidekick_base_term__Base_types.Data

type t = data = {
data_id : Sidekick_base_term.ID.t;
data_cstors : cstor Sidekick_base_term__.ID.Map.t lazy_t;
data_as_ty : ty lazy_t;
}
val pp : CCFormat.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Fun/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Fun/index.html deleted file mode 100644 index 825e7796..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Fun/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun (sidekick-arith.Sidekick_base_term__Base_types.Fun)

Module Sidekick_base_term__Base_types.Fun

type view = fun_view =
| Fun_undef of fun_ty
| Fun_select of select
| Fun_cstor of cstor
| Fun_is_a of cstor
| Fun_def of {
pp : a. ('a Fmt.printer -> 'a Sidekick_util.IArray.t Fmt.printer) option;
abs : self:term -> term Sidekick_util.IArray.t -> term * bool;
do_cc : bool;
relevant : a. Sidekick_base_term.ID.t -> 'a Sidekick_util.IArray.t -> int -> bool;
ty : Sidekick_base_term.ID.t -> term Sidekick_util.IArray.t -> ty;
eval : value Sidekick_util.IArray.t -> value;
}
type t = fun_ = {
fun_id : Sidekick_base_term.ID.t;
fun_view : fun_view;
}
val id : t -> Sidekick_base_term.ID.t
val view : t -> view
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val as_undefined : t -> (t * Ty.Fun.t) option
val as_undefined_exn : t -> t * Ty.Fun.t
val is_undefined : t -> bool
val select : select -> t
val select_idx : cstor -> int -> t
val cstor : cstor -> t
val is_a : cstor -> t
val do_cc : t -> bool
val mk_undef : Sidekick_base_term.ID.t -> Ty.Fun.t -> t
val mk_undef' : Sidekick_base_term.ID.t -> Ty.t list -> Ty.t -> t
val mk_undef_const : Sidekick_base_term.ID.t -> Ty.t -> t
val pp : t CCFormat.printer
module Map : CCMap.S with type Map.key = t
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Select/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Select/index.html deleted file mode 100644 index 66ce7c24..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Select/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Select (sidekick-arith.Sidekick_base_term__Base_types.Select)

Module Sidekick_base_term__Base_types.Select

type t = select = {
select_id : Sidekick_base_term.ID.t;
select_cstor : cstor;
select_ty : ty lazy_t;
select_i : int;
}
val ty : t -> ty
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Statement/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Statement/index.html deleted file mode 100644 index f3b1821a..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Statement/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Statement (sidekick-arith.Sidekick_base_term__Base_types.Statement)

Module Sidekick_base_term__Base_types.Statement

type t = statement =
| Stmt_set_logic of string
| Stmt_set_option of string list
| Stmt_set_info of string * string
| Stmt_data of data list
| Stmt_ty_decl of Sidekick_base_term.ID.t * int
| Stmt_decl of Sidekick_base_term.ID.t * ty list * ty
| Stmt_define of definition list
| Stmt_assert of term
| Stmt_assert_clause of term list
| Stmt_check_sat of (bool * term) list
| Stmt_exit
val pp : Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Term/Iter_dag/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Term/Iter_dag/index.html deleted file mode 100644 index 23eb281c..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Term/Iter_dag/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Iter_dag (sidekick-arith.Sidekick_base_term__Base_types.Term.Iter_dag)

Module Term.Iter_dag

type t
type order =
| Pre
| Post
val create : unit -> t
val iter_dag : ?⁠order:order -> t -> term -> term Iter.t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Term/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Term/index.html deleted file mode 100644 index 14b7873c..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Term/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Term (sidekick-arith.Sidekick_base_term__Base_types.Term)

Module Sidekick_base_term__Base_types.Term

type t = term = {
mutable term_id : int;
mutable term_ty : ty;
term_view : t term_view;
}
type 'a view = 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of 'a lra_view
val id : t -> int
val view : t -> term view
val ty : t -> Ty.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
type state
val create : ?⁠size:int -> unit -> state
val make : state -> t view -> t
val true_ : state -> t
val false_ : state -> t
val bool : state -> bool -> t
val const : state -> fun_ -> t
val app_fun : state -> fun_ -> t Sidekick_util.IArray.t -> t
val eq : state -> t -> t -> t
val not_ : state -> t -> t
val ite : state -> t -> t -> t -> t
val select : state -> select -> t -> t
val app_cstor : state -> cstor -> t Sidekick_util.IArray.t -> t
val is_a : state -> cstor -> t -> t
val lra : state -> t lra_view -> t
val abs : state -> t -> t * bool

Obtain unsigned version of t, + the sign as a boolean

module Iter_dag : sig ... end
val iter_dag_with : order:Iter_dag.order -> t -> t Iter.t
val iter_dag : t -> t Iter.t
val map_shallow : state -> (t -> t) -> t -> t
val pp : t Fmt.printer
Views
val is_true : t -> bool
val is_false : t -> bool
val is_const : t -> bool
val cc_view : t -> (fun_tt Iter.t) CC_view.t
val as_fun_undef : t -> (fun_ * Ty.Fun.t) option
val as_bool : t -> bool option
Containers
module Tbl : CCHashtbl.S with type Tbl.key = t
module Map : CCMap.S with type Map.key = t
module Set : CCSet.S with type Set.elt = t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Term_cell/Make_eq/argument-1-X/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Term_cell/Make_eq/argument-1-X/index.html deleted file mode 100644 index 094cdc44..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Term_cell/Make_eq/argument-1-X/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -1-X (sidekick-arith.Sidekick_base_term__Base_types.Term_cell.Make_eq.1-X)

Parameter Make_eq.1-X

type t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Term_cell/Make_eq/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Term_cell/Make_eq/index.html deleted file mode 100644 index 8a0c77d9..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Term_cell/Make_eq/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make_eq (sidekick-arith.Sidekick_base_term__Base_types.Term_cell.Make_eq)

Module Term_cell.Make_eq

Parameters

Signature

val equal : X.t view -> X.t view -> bool
val hash : X.t view -> int
val pp : X.t view Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Term_cell/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Term_cell/index.html deleted file mode 100644 index e16fe7e4..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Term_cell/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Term_cell (sidekick-arith.Sidekick_base_term__Base_types.Term_cell)

Module Sidekick_base_term__Base_types.Term_cell

type 'a view = 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of 'a lra_view
type t = term view
val equal : t -> t -> bool
val hash : t -> int
val true_ : t
val false_ : t
val const : fun_ -> t
val app_fun : fun_ -> term Sidekick_util.IArray.t -> t
val eq : term -> term -> t
val not_ : term -> t
val ite : term -> term -> term -> t
val lra : term lra_view -> t
val ty : t -> Ty.t

Compute the type of this term cell. Not totally free

val pp : t Fmt.printer
val map : ('a -> 'b) -> 'a view -> 'b view
val iter : ('a -> unit) -> 'a view -> unit
module type ARG = sig ... end
module Make_eq : functor (X : ARG) -> sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Term_cell/module-type-ARG/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Term_cell/module-type-ARG/index.html deleted file mode 100644 index 073eb619..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Term_cell/module-type-ARG/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ARG (sidekick-arith.Sidekick_base_term__Base_types.Term_cell.ARG)

Module type Term_cell.ARG

type t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Ty/Fun/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Ty/Fun/index.html deleted file mode 100644 index 9c432b29..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Ty/Fun/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun (sidekick-arith.Sidekick_base_term__Base_types.Ty.Fun)

Module Ty.Fun

type t = fun_ty
val args : t -> ty list
val ret : t -> ty
val arity : t -> int
val unfold : t -> ty list * ty
val mk : ty list -> ty -> t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Ty/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Ty/index.html deleted file mode 100644 index 70c7505e..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Ty/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ty (sidekick-arith.Sidekick_base_term__Base_types.Ty)

Module Sidekick_base_term__Base_types.Ty

type t = ty
type state = unit
type view = ty_view =
| Ty_bool
| Ty_real
| Ty_atomic of {
def : ty_def;
args : ty list;
mutable finite : bool;
}
type def = ty_def =
| Ty_uninterpreted of Sidekick_base_term.ID.t
| Ty_data of {
data : data;
}
| Ty_def of {
id : Sidekick_base_term.ID.t;
pp : ty Fmt.printer -> ty list Fmt.printer;
default_val : value list -> value;
}
val id : t -> int
val view : t -> view
val bool : state -> t
val real : state -> t
val atomic : def -> t list -> t
val id_of_def : def -> Sidekick_base_term.ID.t
val atomic_uninterpreted : Sidekick_base_term.ID.t -> t
val finite : t -> bool
val set_finite : t -> bool -> unit
val is_bool : t -> bool
val is_uninterpreted : t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t CCFormat.printer
module Tbl : CCHashtbl.S with type Tbl.key = t
module Fun : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/Value/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/Value/index.html deleted file mode 100644 index 4aee2773..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/Value/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Value (sidekick-arith.Sidekick_base_term__Base_types.Value)

Module Sidekick_base_term__Base_types.Value

type t = value =
| V_bool of bool
| V_element of {
id : Sidekick_base_term.ID.t;
ty : ty;
}
| V_cstor of {
c : cstor;
args : value list;
}
| V_custom of {
view : value_custom_view;
pp : value_custom_view Fmt.printer;
eq : value_custom_view -> value_custom_view -> bool;
hash : value_custom_view -> int;
}
| V_real of Q.t
val true_ : t
val false_ : t
val bool : bool -> t
val real : Q.t -> t
val real_of_string : string -> t
val mk_elt : Sidekick_base_term.ID.t -> Ty.t -> t
val is_bool : t -> bool
val is_true : t -> bool
val is_false : t -> bool
val cstor_app : cstor -> t list -> t
val fresh : Term.t -> t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/index.html b/dev/sidekick-arith/Sidekick_base_term__Base_types/index.html deleted file mode 100644 index 3c765592..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Base_types/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_base_term__Base_types (sidekick-arith.Sidekick_base_term__Base_types)

Module Sidekick_base_term__Base_types

module Vec = Msat.Vec
module Log = Msat.Log
module Fmt = CCFormat
module CC_view = Sidekick_core.CC_view
type lra_pred = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
type lra_op = Sidekick_arith_lra.op =
| Plus
| Minus
type 'a lra_view = 'a Sidekick_arith_lra.lra_view =
| LRA_pred of lra_pred * 'a * 'a
| LRA_op of lra_op * 'a * 'a
| LRA_mult of Q.t * 'a
| LRA_const of Q.t
| LRA_simplex_var of 'a
| LRA_simplex_pred of 'a * Sidekick_arith_lra.S_op.t * Q.t
| LRA_other of 'a
type term = {
mutable term_id : int;
mutable term_ty : ty;
term_view : term term_view;
}
and 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of 'a lra_view
and fun_ = {
fun_id : Sidekick_base_term.ID.t;
fun_view : fun_view;
}
and fun_view =
| Fun_undef of fun_ty
| Fun_select of select
| Fun_cstor of cstor
| Fun_is_a of cstor
| Fun_def of {
pp : a. ('a Fmt.printer -> 'a Sidekick_util.IArray.t Fmt.printer) option;
abs : self:term -> term Sidekick_util.IArray.t -> term * bool;
do_cc : bool;
relevant : a. Sidekick_base_term.ID.t -> 'a Sidekick_util.IArray.t -> int -> bool;
ty : Sidekick_base_term.ID.t -> term Sidekick_util.IArray.t -> ty;
eval : value Sidekick_util.IArray.t -> value;
}

Methods on the custom term view whose arguments are 'a. Terms must be printable, and provide some additional theory handles.

  • relevant must return a subset of args (possibly the same set). The terms it returns will be activated and evaluated whenever possible. Terms in args \ relevant args are considered for congruence but not for evaluation.
and fun_ty = {
fun_ty_args : ty list;
fun_ty_ret : ty;
}

Function type

and ty = {
mutable ty_id : int;
ty_view : ty_view;
}

Hashconsed type

and ty_view =
| Ty_bool
| Ty_real
| Ty_atomic of {
def : ty_def;
args : ty list;
mutable finite : bool;
}
and ty_def =
| Ty_uninterpreted of Sidekick_base_term.ID.t
| Ty_data of {
data : data;
}
| Ty_def of {
id : Sidekick_base_term.ID.t;
pp : ty Fmt.printer -> ty list Fmt.printer;
default_val : value list -> value;
}
and data = {
data_id : Sidekick_base_term.ID.t;
data_cstors : cstor Sidekick_base_term__.ID.Map.t lazy_t;
data_as_ty : ty lazy_t;
}
and cstor = {
cstor_id : Sidekick_base_term.ID.t;
cstor_is_a : Sidekick_base_term.ID.t;
mutable cstor_arity : int;
cstor_args : select list lazy_t;
cstor_ty_as_data : data;
cstor_ty : ty lazy_t;
}
and select = {
select_id : Sidekick_base_term.ID.t;
select_cstor : cstor;
select_ty : ty lazy_t;
select_i : int;
}
and value =
| V_bool of bool
| V_element of {
id : Sidekick_base_term.ID.t;
ty : ty;
}

a named constant, distinct from any other constant

| V_cstor of {
c : cstor;
args : value list;
}
| V_custom of {
view : value_custom_view;
pp : value_custom_view Fmt.printer;
eq : value_custom_view -> value_custom_view -> bool;
hash : value_custom_view -> int;
}

Custom value

| V_real of Q.t

Semantic values, used for models (and possibly model-constructing calculi)

and value_custom_view = ..
type definition = Sidekick_base_term.ID.t * ty * term
type statement =
| Stmt_set_logic of string
| Stmt_set_option of string list
| Stmt_set_info of string * string
| Stmt_data of data list
| Stmt_ty_decl of Sidekick_base_term.ID.t * int
| Stmt_decl of Sidekick_base_term.ID.t * ty list * ty
| Stmt_define of definition list
| Stmt_assert of term
| Stmt_assert_clause of term list
| Stmt_check_sat of (bool * term) list
| Stmt_exit
val term_equal_ : term -> term -> bool
val term_hash_ : term -> int
val term_cmp_ : term -> term -> int
val fun_compare : fun_ -> fun_ -> int
val pp_fun : CCFormat.t -> fun_ -> unit
val id_of_fun : fun_ -> Sidekick_base_term.ID.t
val eq_ty : ty -> ty -> bool
val eq_cstor : cstor -> cstor -> bool
val eq_value : value -> value -> bool
val hash_value : value Sidekick_util.Hash.t
val pp_value : value Sidekick_util.Util.printer
val pp_db : Stdlib.Format.formatter -> (int * 'a) -> unit
val pp_ty : ty Sidekick_util.Util.printer
val string_of_lra_pred : lra_pred -> string
val pp_pred : Fmt.t -> lra_pred -> unit
val string_of_lra_op : lra_op -> string
val pp_lra_op : Fmt.t -> lra_op -> unit
val pp_term_view_gen : pp_id:(Fmt.t -> Sidekick_base_term.ID.t -> unit) -> pp_t:'a Fmt.printer -> Fmt.t -> 'a term_view -> unit
val pp_term_top : ids:bool -> Fmt.t -> term -> unit
val pp_term : Fmt.t -> term -> unit
val pp_term_view : Fmt.t -> term term_view -> unit
module Ty : sig ... end
module Fun : sig ... end
module Term_cell : sig ... end
module Term : sig ... end
module Value : sig ... end
module Data : sig ... end
module Select : sig ... end
module Cstor : sig ... end
module Statement : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__CCHet/Key/index.html b/dev/sidekick-arith/Sidekick_base_term__CCHet/Key/index.html deleted file mode 100644 index 712ba532..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__CCHet/Key/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Key (sidekick-arith.Sidekick_base_term__CCHet.Key)

Module Sidekick_base_term__CCHet.Key

type 'a t
val create : unit -> 'a t
val equal : 'a t -> 'a t -> bool

Compare two keys that have compatible types.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__CCHet/Map/index.html b/dev/sidekick-arith/Sidekick_base_term__CCHet/Map/index.html deleted file mode 100644 index fd450388..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__CCHet/Map/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Map (sidekick-arith.Sidekick_base_term__CCHet.Map)

Module Sidekick_base_term__CCHet.Map

Immutable map

type t
val empty : t
val mem : _ Key.t -> t -> bool
val add : 'a Key.t -> 'a -> t -> t
val remove : _ Key.t -> t -> t
val length : t -> int
val cardinal : t -> int
val find : 'a Key.t -> t -> 'a option
val find_exn : 'a Key.t -> t -> 'a
raises Not_found

if the key is not in the table.

val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> t
val add_list : t -> pair list -> t
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__CCHet/Tbl/index.html b/dev/sidekick-arith/Sidekick_base_term__CCHet/Tbl/index.html deleted file mode 100644 index 0cacc629..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__CCHet/Tbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Tbl (sidekick-arith.Sidekick_base_term__CCHet.Tbl)

Module Sidekick_base_term__CCHet.Tbl

Imperative table indexed by Key

type t
val create : ?⁠size:int -> unit -> t
val mem : t -> _ Key.t -> bool
val add : t -> 'a Key.t -> 'a -> unit
val remove : t -> _ Key.t -> unit
val length : t -> int
val find : t -> 'a Key.t -> 'a option
val find_exn : t -> 'a Key.t -> 'a
raises Not_found

if the key is not in the table.

val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> unit
val add_list : t -> pair list -> unit
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__CCHet/index.html b/dev/sidekick-arith/Sidekick_base_term__CCHet/index.html deleted file mode 100644 index db8791d2..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__CCHet/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_base_term__CCHet (sidekick-arith.Sidekick_base_term__CCHet)

Module Sidekick_base_term__CCHet

Associative containers with Heterogeneous Values

This is similar to CCMixtbl, but the injection is directly used as a key.

since
0.17
type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
module Key : sig ... end
type pair =
| Pair : 'a Key.t * 'a -> pair
module Tbl : sig ... end
module Map : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Config/Key/index.html b/dev/sidekick-arith/Sidekick_base_term__Config/Key/index.html deleted file mode 100644 index 72212e28..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Config/Key/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Key (sidekick-arith.Sidekick_base_term__Config.Key)

Module Sidekick_base_term__Config.Key

type 'a t
val create : unit -> 'a t
val equal : 'a t -> 'a t -> bool

Compare two keys that have compatible types

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Config/index.html b/dev/sidekick-arith/Sidekick_base_term__Config/index.html deleted file mode 100644 index 6a84ca2c..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Config/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_base_term__Config (sidekick-arith.Sidekick_base_term__Config)

Module Sidekick_base_term__Config

Configuration

type 'a sequence = ('a -> unit) -> unit
module Key : sig ... end
type t
val empty : t
val mem : _ Key.t -> t -> bool
val add : 'a Key.t -> 'a -> t -> t
val length : t -> int
val cardinal : t -> int
val find : 'a Key.t -> t -> 'a option
val find_exn : 'a Key.t -> t -> 'a
raises Not_found

if the key is not in the table

type pair =
| Pair : 'a Key.t * 'a -> pair
val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair sequence
val of_iter : pair sequence -> t
val add_iter : t -> pair sequence -> t
val add_list : t -> pair list -> t
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Hashcons/Make/argument-1-A/index.html b/dev/sidekick-arith/Sidekick_base_term__Hashcons/Make/argument-1-A/index.html deleted file mode 100644 index f35f8899..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Hashcons/Make/argument-1-A/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -1-A (sidekick-arith.Sidekick_base_term__Hashcons.Make.1-A)

Parameter Make.1-A

type t
val equal : t -> t -> bool
val hash : t -> int
val set_id : t -> int -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Hashcons/Make/index.html b/dev/sidekick-arith/Sidekick_base_term__Hashcons/Make/index.html deleted file mode 100644 index e8fc18e2..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Hashcons/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (sidekick-arith.Sidekick_base_term__Hashcons.Make)

Module Sidekick_base_term__Hashcons.Make

Parameters

Signature

type t
val create : ?⁠size:int -> unit -> t
val hashcons : t -> A.t -> A.t
val to_seq : t -> A.t Iter.t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Hashcons/index.html b/dev/sidekick-arith/Sidekick_base_term__Hashcons/index.html deleted file mode 100644 index 3e52fbd7..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Hashcons/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_base_term__Hashcons (sidekick-arith.Sidekick_base_term__Hashcons)

Module Sidekick_base_term__Hashcons

module type ARG = sig ... end
module Make : functor (A : ARG) -> sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Hashcons/module-type-ARG/index.html b/dev/sidekick-arith/Sidekick_base_term__Hashcons/module-type-ARG/index.html deleted file mode 100644 index 9779911d..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Hashcons/module-type-ARG/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ARG (sidekick-arith.Sidekick_base_term__Hashcons.ARG)

Module type Sidekick_base_term__Hashcons.ARG

type t
val equal : t -> t -> bool
val hash : t -> int
val set_id : t -> int -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__ID/B/index.html b/dev/sidekick-arith/Sidekick_base_term__ID/B/index.html deleted file mode 100644 index 33301c0e..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__ID/B/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -B (sidekick-arith.Sidekick_base_term__ID.B)

Module Sidekick_base_term__ID.B

val rat : t
val int : t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__ID/index.html b/dev/sidekick-arith/Sidekick_base_term__ID/index.html deleted file mode 100644 index 20bc2e4c..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__ID/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_base_term__ID (sidekick-arith.Sidekick_base_term__ID)

Module Sidekick_base_term__ID

Unique Identifiers

type t
val make : string -> t
val makef : ('a, Stdlib.Format.formatter, unit, t) Stdlib.format4 -> 'a
val copy : t -> t
val id : t -> int
val to_string : t -> string
val to_string_full : t -> string
include Sidekick_util.Intf.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_util.Intf.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_util.Intf.HASH with type t := t
type t
val hash : t -> int
include Sidekick_util.Intf.PRINT with type t := t
type t
val pp : t CCFormat.printer
val pp_name : t CCFormat.printer
module Map : CCMap.S with type Map.key = t
module Set : CCSet.S with type Set.elt = t
module Tbl : CCHashtbl.S with type Tbl.key = t
module B : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Model/Fun_interpretation/index.html b/dev/sidekick-arith/Sidekick_base_term__Model/Fun_interpretation/index.html deleted file mode 100644 index db102117..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Model/Fun_interpretation/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun_interpretation (sidekick-arith.Sidekick_base_term__Model.Fun_interpretation)

Module Sidekick_base_term__Model.Fun_interpretation

type t = {
cases : Sidekick_base_term.Base_types.Value.t Val_map.t;
default : Sidekick_base_term.Base_types.Value.t;
}
val default : t -> Sidekick_base_term.Base_types.Value.t
val cases_list : t -> (Sidekick_base_term.Base_types.Value.t list * Sidekick_base_term.Base_types.Value.t) list
val make : default:Sidekick_base_term.Base_types.Value.t -> (Sidekick_base_term.Base_types.Value.t list * Sidekick_base_term.Base_types.Value.t) list -> t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Model/Val_map/index.html b/dev/sidekick-arith/Sidekick_base_term__Model/Val_map/index.html deleted file mode 100644 index f2f49f98..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Model/Val_map/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Val_map (sidekick-arith.Sidekick_base_term__Model.Val_map)

Module Sidekick_base_term__Model.Val_map

type key = Sidekick_base_term.Base_types.Value.t list
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val cardinal : _ t -> int
val find : key -> 'a t -> 'a option
val add : key -> 'a -> 'a t -> 'a t
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Model/index.html b/dev/sidekick-arith/Sidekick_base_term__Model/index.html deleted file mode 100644 index 6b1c6d66..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Model/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_base_term__Model (sidekick-arith.Sidekick_base_term__Model)

Module Sidekick_base_term__Model

Model

module Val_map : sig ... end
module Fun_interpretation : sig ... end
type t = {
values : Sidekick_base_term.Base_types.Value.t Sidekick_base_term__.Base_types.Term.Map.t;
funs : Fun_interpretation.t Sidekick_base_term__.Base_types.Fun.Map.t;
}
val empty : t
val add : Sidekick_base_term.Base_types.Term.t -> Sidekick_base_term.Base_types.Value.t -> t -> t
val mem : Sidekick_base_term.Base_types.Term.t -> t -> bool
val find : Sidekick_base_term.Base_types.Term.t -> t -> Sidekick_base_term.Base_types.Value.t option
val merge : t -> t -> t
val pp : t CCFormat.printer
val eval : t -> Sidekick_base_term.Base_types.Term.t -> Sidekick_base_term.Base_types.Value.t option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Proof/Quip/index.html b/dev/sidekick-arith/Sidekick_base_term__Proof/Quip/index.html deleted file mode 100644 index c3513afc..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Proof/Quip/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Quip (sidekick-arith.Sidekick_base_term__Proof.Quip)

Module Sidekick_base_term__Proof.Quip

val output : Stdlib.out_channel -> t -> unit

Printer in Quip format (experimental)

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Proof/index.html b/dev/sidekick-arith/Sidekick_base_term__Proof/index.html deleted file mode 100644 index 91a9a2fc..00000000 --- a/dev/sidekick-arith/Sidekick_base_term__Proof/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_base_term__Proof (sidekick-arith.Sidekick_base_term__Proof)

Module Sidekick_base_term__Proof

include Sidekick_core.PROOF with type term = Sidekick_base_term.Base_types.Term.t and type ty = Sidekick_base_term.Base_types.Ty.t
type term = Sidekick_base_term.Base_types.Term.t
type ty = Sidekick_base_term.Base_types.Ty.t
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
val isa_split : ty -> term Iter.t -> t
val isa_disj : ty -> term -> term -> t
val cstor_inj : Sidekick_base_term.Base_types.Cstor.t -> int -> term list -> term list -> t
val bool_eq : term -> term -> t
val bool_c : string -> term list -> t
val ite_true : term -> t
val ite_false : term -> t
val lra : lit Iter.t -> t
val lra_l : lit list -> t
\ No newline at end of file diff --git a/dev/sidekick-arith/index.html b/dev/sidekick-arith/index.html deleted file mode 100644 index 22693305..00000000 --- a/dev/sidekick-arith/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -index (sidekick-arith.index)

sidekick-arith index

Library sidekick-arith.base-term

The entry point of this library is the module: Sidekick_base_term.

Library sidekick-arith.lra

The entry point of this library is the module: Sidekick_arith_lra.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/.dune-keep b/dev/sidekick-base/Sidekick_base/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_arith_lra/.dune-keep rename to dev/sidekick-base/Sidekick_base/.dune-keep diff --git a/dev/sidekick-base/Sidekick_base/Arg/Fun/index.html b/dev/sidekick-base/Sidekick_base/Arg/Fun/index.html new file mode 100644 index 00000000..722ed96d --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Arg/Fun/index.html @@ -0,0 +1,2 @@ + +Fun (sidekick-base.Sidekick_base.Arg.Fun)

Module Arg.Fun

A function symbol, like "f" or "plus" or "is_human" or "socrates"

type t = Fun.t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Arg/Term/index.html b/dev/sidekick-base/Sidekick_base/Arg/Term/index.html new file mode 100644 index 00000000..e92f2344 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Arg/Term/index.html @@ -0,0 +1,8 @@ + +Term (sidekick-base.Sidekick_base.Arg.Term)

Module Arg.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t = Term.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Term.state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
+let y = f x x in
+let z = g y x in
+z = z

the DAG has the following nodes:

n1: 2
+n2: f n1 n1
+n3: g n2 n1
+n4: = n3 n3
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Arg/Ty/index.html b/dev/sidekick-base/Sidekick_base/Arg/Ty/index.html new file mode 100644 index 00000000..2bda895c --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Arg/Ty/index.html @@ -0,0 +1,2 @@ + +Ty (sidekick-base.Sidekick_base.Arg.Ty)

Module Arg.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t = Ty.t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Arg/index.html b/dev/sidekick-base/Sidekick_base/Arg/index.html new file mode 100644 index 00000000..8ab40017 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Arg/index.html @@ -0,0 +1,2 @@ + +Arg (sidekick-base.Sidekick_base.Arg)

Module Sidekick_base.Arg

module Fun : sig ... end with type t = Fun.t

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end with type t = Ty.t

Types

module Term : sig ... end with type t = Term.t and type state = Term.state

Term structure.

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

Module Base_types.Cstor

type t = cstor = {
cstor_id : ID.t;
cstor_is_a : ID.t;
mutable cstor_arity : int;
cstor_args : select list lazy_t;
cstor_ty_as_data : data;
cstor_ty : ty lazy_t;
}
val id : t -> ID.t
val ty_args : t -> ty Iter.t
val equal : cstor -> cstor -> bool
val pp : CCFormat.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Data/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Data/index.html new file mode 100644 index 00000000..89544223 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Data/index.html @@ -0,0 +1,2 @@ + +Data (sidekick-base.Sidekick_base.Base_types.Data)

Module Base_types.Data

type t = data = {
data_id : ID.t;
data_cstors : cstor Sidekick_base__.ID.Map.t lazy_t;
data_as_ty : ty lazy_t;
}
val pp : CCFormat.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Fun/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Fun/index.html new file mode 100644 index 00000000..ac915316 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Fun/index.html @@ -0,0 +1,2 @@ + +Fun (sidekick-base.Sidekick_base.Base_types.Fun)

Module Base_types.Fun

type view = fun_view =
| Fun_undef of fun_ty
| Fun_select of select
| Fun_cstor of cstor
| Fun_is_a of cstor
| Fun_def of {
pp : a. ('a Fmt.printer -> 'a Sidekick_util.IArray.t Fmt.printer) option;
abs : self:term -> term Sidekick_util.IArray.t -> term * bool;
do_cc : bool;
relevant : a. ID.t -> 'a Sidekick_util.IArray.t -> int -> bool;
ty : ID.t -> term Sidekick_util.IArray.t -> ty;
eval : value Sidekick_util.IArray.t -> value;
}
type t = fun_ = {
fun_id : ID.t;
fun_view : fun_view;
}
val id : t -> ID.t
val view : t -> view
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val as_undefined : t -> (t * Ty.Fun.t) option
val as_undefined_exn : t -> t * Ty.Fun.t
val is_undefined : t -> bool
val select : select -> t
val select_idx : cstor -> int -> t
val cstor : cstor -> t
val is_a : cstor -> t
val do_cc : t -> bool
val mk_undef : ID.t -> Ty.Fun.t -> t
val mk_undef' : ID.t -> Ty.t list -> Ty.t -> t
val mk_undef_const : ID.t -> Ty.t -> t
val pp : t CCFormat.printer
module Map : CCMap.S with type Map.key = t
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Select/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Select/index.html new file mode 100644 index 00000000..3cf4fb03 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Select/index.html @@ -0,0 +1,2 @@ + +Select (sidekick-base.Sidekick_base.Base_types.Select)

Module Base_types.Select

type t = select = {
select_id : ID.t;
select_cstor : cstor;
select_ty : ty lazy_t;
select_i : int;
}
val ty : t -> ty
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Statement/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Statement/index.html new file mode 100644 index 00000000..a54e9183 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Statement/index.html @@ -0,0 +1,2 @@ + +Statement (sidekick-base.Sidekick_base.Base_types.Statement)

Module Base_types.Statement

type t = statement =
| Stmt_set_logic of string
| Stmt_set_option of string list
| Stmt_set_info of string * string
| Stmt_data of data list
| Stmt_ty_decl of ID.t * int
| Stmt_decl of ID.t * ty list * ty
| Stmt_define of definition list
| Stmt_assert of term
| Stmt_assert_clause of term list
| Stmt_check_sat of (bool * term) list
| Stmt_exit
val pp : Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Term/Iter_dag/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Term/Iter_dag/index.html new file mode 100644 index 00000000..4a77a833 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Term/Iter_dag/index.html @@ -0,0 +1,2 @@ + +Iter_dag (sidekick-base.Sidekick_base.Base_types.Term.Iter_dag)

Module Term.Iter_dag

type t
type order =
| Pre
| Post
val create : unit -> t
val iter_dag : ?⁠order:order -> t -> term -> term Iter.t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Term/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Term/index.html new file mode 100644 index 00000000..870694c7 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Term/index.html @@ -0,0 +1,2 @@ + +Term (sidekick-base.Sidekick_base.Base_types.Term)

Module Base_types.Term

type t = term = {
mutable term_id : int;
mutable term_ty : ty;
term_view : t term_view;
}
type 'a view = 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of (Q.t, 'a) lra_view
val id : t -> int
val view : t -> term view
val ty : t -> Ty.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
type state
val create : ?⁠size:int -> unit -> state
val make : state -> t view -> t
val true_ : state -> t
val false_ : state -> t
val bool : state -> bool -> t
val const : state -> fun_ -> t
val app_fun : state -> fun_ -> t Sidekick_util.IArray.t -> t
val eq : state -> t -> t -> t
val not_ : state -> t -> t
val ite : state -> t -> t -> t -> t
val select : state -> select -> t -> t
val app_cstor : state -> cstor -> t Sidekick_util.IArray.t -> t
val is_a : state -> cstor -> t -> t
val lra : state -> (Q.t, t) lra_view -> t
val abs : state -> t -> t * bool

Obtain unsigned version of t, + the sign as a boolean

module Iter_dag : sig ... end
val iter_dag_with : order:Iter_dag.order -> t -> t Iter.t
val iter_dag : t -> t Iter.t
val map_shallow : state -> (t -> t) -> t -> t
val pp : t Fmt.printer

Views

val is_true : t -> bool
val is_false : t -> bool
val is_const : t -> bool
val cc_view : t -> (fun_tt Iter.t) CC_view.t
val as_fun_undef : t -> (fun_ * Ty.Fun.t) option
val as_bool : t -> bool option

Containers

module Tbl : CCHashtbl.S with type Tbl.key = t
module Map : CCMap.S with type Map.key = t
module Set : CCSet.S with type Set.elt = t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Term_cell/Make_eq/argument-1-X/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Term_cell/Make_eq/argument-1-X/index.html new file mode 100644 index 00000000..1b48a701 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Term_cell/Make_eq/argument-1-X/index.html @@ -0,0 +1,2 @@ + +1-X (sidekick-base.Sidekick_base.Base_types.Term_cell.Make_eq.1-X)

Parameter Make_eq.1-X

type t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Term_cell/Make_eq/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Term_cell/Make_eq/index.html new file mode 100644 index 00000000..5ee9ae29 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Term_cell/Make_eq/index.html @@ -0,0 +1,2 @@ + +Make_eq (sidekick-base.Sidekick_base.Base_types.Term_cell.Make_eq)

Module Term_cell.Make_eq

Parameters

Signature

val equal : X.t view -> X.t view -> bool
val hash : X.t view -> int
val pp : X.t view Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Term_cell/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Term_cell/index.html new file mode 100644 index 00000000..8de786d5 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Term_cell/index.html @@ -0,0 +1,2 @@ + +Term_cell (sidekick-base.Sidekick_base.Base_types.Term_cell)

Module Base_types.Term_cell

type 'a view = 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of (Q.t, 'a) lra_view
type t = term view
val equal : t -> t -> bool
val hash : t -> int
val true_ : t
val false_ : t
val const : fun_ -> t
val app_fun : fun_ -> term Sidekick_util.IArray.t -> t
val eq : term -> term -> t
val not_ : term -> t
val ite : term -> term -> term -> t
val lra : (Q.t, term) lra_view -> t
val ty : t -> Ty.t

Compute the type of this term cell. Not totally free

val pp : t Fmt.printer
val map : ('a -> 'b) -> 'a view -> 'b view
val iter : ('a -> unit) -> 'a view -> unit
module type ARG = sig ... end
module Make_eq : functor (X : ARG) -> sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Term_cell/module-type-ARG/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Term_cell/module-type-ARG/index.html new file mode 100644 index 00000000..07b74a7c --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Term_cell/module-type-ARG/index.html @@ -0,0 +1,2 @@ + +ARG (sidekick-base.Sidekick_base.Base_types.Term_cell.ARG)

Module type Term_cell.ARG

type t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Ty/Fun/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Ty/Fun/index.html new file mode 100644 index 00000000..1086e8ae --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Ty/Fun/index.html @@ -0,0 +1,2 @@ + +Fun (sidekick-base.Sidekick_base.Base_types.Ty.Fun)

Module Ty.Fun

type t = fun_ty
val args : t -> ty list
val ret : t -> ty
val arity : t -> int
val unfold : t -> ty list * ty
val mk : ty list -> ty -> t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Ty/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Ty/index.html new file mode 100644 index 00000000..05f1072a --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Ty/index.html @@ -0,0 +1,2 @@ + +Ty (sidekick-base.Sidekick_base.Base_types.Ty)

Module Base_types.Ty

type t = ty
type state = unit
type view = ty_view =
| Ty_bool
| Ty_real
| Ty_atomic of {
def : ty_def;
args : ty list;
mutable finite : bool;
}
type def = ty_def =
| Ty_uninterpreted of ID.t
| Ty_data of {
data : data;
}
| Ty_def of {
id : ID.t;
pp : ty Fmt.printer -> ty list Fmt.printer;
default_val : value list -> value;
}
val id : t -> int
val view : t -> view
val bool : state -> t
val real : state -> t
val atomic : def -> t list -> t
val id_of_def : def -> ID.t
val atomic_uninterpreted : ID.t -> t
val finite : t -> bool
val set_finite : t -> bool -> unit
val is_bool : t -> bool
val is_uninterpreted : t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t CCFormat.printer
module Tbl : CCHashtbl.S with type Tbl.key = t
module Fun : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/Value/index.html b/dev/sidekick-base/Sidekick_base/Base_types/Value/index.html new file mode 100644 index 00000000..ef529fb9 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/Value/index.html @@ -0,0 +1,2 @@ + +Value (sidekick-base.Sidekick_base.Base_types.Value)

Module Base_types.Value

type t = value =
| V_bool of bool
| V_element of {
id : ID.t;
ty : ty;
}
| V_cstor of {
c : cstor;
args : value list;
}
| V_custom of {
view : value_custom_view;
pp : value_custom_view Fmt.printer;
eq : value_custom_view -> value_custom_view -> bool;
hash : value_custom_view -> int;
}
| V_real of Q.t
val true_ : t
val false_ : t
val bool : bool -> t
val real : Q.t -> t
val real_of_string : string -> t
val mk_elt : ID.t -> Ty.t -> t
val is_bool : t -> bool
val is_true : t -> bool
val is_false : t -> bool
val cstor_app : cstor -> t list -> t
val fresh : Term.t -> t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Base_types/index.html b/dev/sidekick-base/Sidekick_base/Base_types/index.html new file mode 100644 index 00000000..115a3925 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Base_types/index.html @@ -0,0 +1,2 @@ + +Base_types (sidekick-base.Sidekick_base.Base_types)

Module Sidekick_base.Base_types

module Vec = Msat.Vec
module Log = Msat.Log
module Fmt = CCFormat
module CC_view = Sidekick_core.CC_view
type lra_pred = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
type lra_op = Sidekick_arith_lra.op =
| Plus
| Minus
type ('num, 'a) lra_view = ('num'a) Sidekick_arith_lra.lra_view =
| LRA_pred of lra_pred * 'a * 'a
| LRA_op of lra_op * 'a * 'a
| LRA_mult of 'num * 'a
| LRA_const of 'num
| LRA_simplex_var of 'a
| LRA_simplex_pred of 'a * Sidekick_arith_lra.S_op.t * 'num
| LRA_other of 'a
type term = {
mutable term_id : int;
mutable term_ty : ty;
term_view : term term_view;
}
and 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of (Q.t, 'a) lra_view
and fun_ = {
fun_id : ID.t;
fun_view : fun_view;
}
and fun_view =
| Fun_undef of fun_ty
| Fun_select of select
| Fun_cstor of cstor
| Fun_is_a of cstor
| Fun_def of {
pp : a. ('a Fmt.printer -> 'a Sidekick_util.IArray.t Fmt.printer) option;
abs : self:term -> term Sidekick_util.IArray.t -> term * bool;
do_cc : bool;
relevant : a. ID.t -> 'a Sidekick_util.IArray.t -> int -> bool;
ty : ID.t -> term Sidekick_util.IArray.t -> ty;
eval : value Sidekick_util.IArray.t -> value;
}

Methods on the custom term view whose arguments are 'a. Terms must be printable, and provide some additional theory handles.

  • relevant must return a subset of args (possibly the same set). The terms it returns will be activated and evaluated whenever possible. Terms in args \ relevant args are considered for congruence but not for evaluation.
and fun_ty = {
fun_ty_args : ty list;
fun_ty_ret : ty;
}

Function type

and ty = {
mutable ty_id : int;
ty_view : ty_view;
}

Hashconsed type

and ty_view =
| Ty_bool
| Ty_real
| Ty_atomic of {
def : ty_def;
args : ty list;
mutable finite : bool;
}
and ty_def =
| Ty_uninterpreted of ID.t
| Ty_data of {
data : data;
}
| Ty_def of {
id : ID.t;
pp : ty Fmt.printer -> ty list Fmt.printer;
default_val : value list -> value;
}
and data = {
data_id : ID.t;
data_cstors : cstor Sidekick_base__.ID.Map.t lazy_t;
data_as_ty : ty lazy_t;
}
and cstor = {
cstor_id : ID.t;
cstor_is_a : ID.t;
mutable cstor_arity : int;
cstor_args : select list lazy_t;
cstor_ty_as_data : data;
cstor_ty : ty lazy_t;
}
and select = {
select_id : ID.t;
select_cstor : cstor;
select_ty : ty lazy_t;
select_i : int;
}
and value =
| V_bool of bool
| V_element of {
id : ID.t;
ty : ty;
}

a named constant, distinct from any other constant

| V_cstor of {
c : cstor;
args : value list;
}
| V_custom of {
view : value_custom_view;
pp : value_custom_view Fmt.printer;
eq : value_custom_view -> value_custom_view -> bool;
hash : value_custom_view -> int;
}

Custom value

| V_real of Q.t

Semantic values, used for models (and possibly model-constructing calculi)

and value_custom_view = ..
type definition = ID.t * ty * term
type statement =
| Stmt_set_logic of string
| Stmt_set_option of string list
| Stmt_set_info of string * string
| Stmt_data of data list
| Stmt_ty_decl of ID.t * int
| Stmt_decl of ID.t * ty list * ty
| Stmt_define of definition list
| Stmt_assert of term
| Stmt_assert_clause of term list
| Stmt_check_sat of (bool * term) list
| Stmt_exit
val term_equal_ : term -> term -> bool
val term_hash_ : term -> int
val term_cmp_ : term -> term -> int
val fun_compare : fun_ -> fun_ -> int
val pp_fun : CCFormat.t -> fun_ -> unit
val id_of_fun : fun_ -> ID.t
val eq_ty : ty -> ty -> bool
val eq_cstor : cstor -> cstor -> bool
val eq_value : value -> value -> bool
val hash_value : value Sidekick_util.Hash.t
val pp_value : value Sidekick_util.Util.printer
val pp_db : Stdlib.Format.formatter -> (int * 'a) -> unit
val pp_ty : ty Sidekick_util.Util.printer
val string_of_lra_pred : lra_pred -> string
val pp_pred : Fmt.t -> lra_pred -> unit
val string_of_lra_op : lra_op -> string
val pp_lra_op : Fmt.t -> lra_op -> unit
val pp_term_view_gen : pp_id:(Fmt.t -> ID.t -> unit) -> pp_t:'a Fmt.printer -> Fmt.t -> 'a term_view -> unit
val pp_term_top : ids:bool -> Fmt.t -> term -> unit
val pp_term : Fmt.t -> term -> unit
val pp_term_view : Fmt.t -> term term_view -> unit
module Ty : sig ... end
module Fun : sig ... end
module Term_cell : sig ... end
module Term : sig ... end
module Value : sig ... end
module Data : sig ... end
module Select : sig ... end
module Cstor : sig ... end
module Statement : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/ID/B/index.html b/dev/sidekick-base/Sidekick_base/ID/B/index.html new file mode 100644 index 00000000..67eb647b --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/ID/B/index.html @@ -0,0 +1,2 @@ + +B (sidekick-base.Sidekick_base.ID.B)

Module ID.B

val rat : t
val int : t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/ID/index.html b/dev/sidekick-base/Sidekick_base/ID/index.html new file mode 100644 index 00000000..4ab25a99 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/ID/index.html @@ -0,0 +1,2 @@ + +ID (sidekick-base.Sidekick_base.ID)

Module Sidekick_base.ID

Unique Identifiers

type t
val make : string -> t
val makef : ('a, Stdlib.Format.formatter, unit, t) Stdlib.format4 -> 'a
val copy : t -> t
val id : t -> int
val to_string : t -> string
val to_string_full : t -> string
include Sidekick_util.Intf.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_util.Intf.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_util.Intf.HASH with type t := t
type t
val hash : t -> int
include Sidekick_util.Intf.PRINT with type t := t
type t
val pp : t CCFormat.printer
val pp_name : t CCFormat.printer
module Map : CCMap.S with type Map.key = t
module Set : CCSet.S with type Set.elt = t
module Tbl : CCHashtbl.S with type Tbl.key = t
module B : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Model/Fun_interpretation/index.html b/dev/sidekick-base/Sidekick_base/Model/Fun_interpretation/index.html new file mode 100644 index 00000000..37ea47af --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Model/Fun_interpretation/index.html @@ -0,0 +1,2 @@ + +Fun_interpretation (sidekick-base.Sidekick_base.Model.Fun_interpretation)

Module Model.Fun_interpretation

type t = {
cases : Base_types.Value.t Val_map.t;
default : Base_types.Value.t;
}
val default : t -> Base_types.Value.t
val cases_list : t -> (Base_types.Value.t list * Base_types.Value.t) list
val make : default:Base_types.Value.t -> (Base_types.Value.t list * Base_types.Value.t) list -> t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Model/Val_map/index.html b/dev/sidekick-base/Sidekick_base/Model/Val_map/index.html new file mode 100644 index 00000000..cc7c10bd --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Model/Val_map/index.html @@ -0,0 +1,2 @@ + +Val_map (sidekick-base.Sidekick_base.Model.Val_map)

Module Model.Val_map

type key = Base_types.Value.t list
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val cardinal : _ t -> int
val find : key -> 'a t -> 'a option
val add : key -> 'a -> 'a t -> 'a t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Model/index.html b/dev/sidekick-base/Sidekick_base/Model/index.html new file mode 100644 index 00000000..47d48969 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Model/index.html @@ -0,0 +1,2 @@ + +Model (sidekick-base.Sidekick_base.Model)

Module Sidekick_base.Model

Model

module Val_map : sig ... end
module Fun_interpretation : sig ... end
type t = {
values : Base_types.Value.t Sidekick_base__.Base_types.Term.Map.t;
funs : Fun_interpretation.t Sidekick_base__.Base_types.Fun.Map.t;
}
val empty : t
val add : Base_types.Term.t -> Base_types.Value.t -> t -> t
val mem : Base_types.Term.t -> t -> bool
val find : Base_types.Term.t -> t -> Base_types.Value.t option
val merge : t -> t -> t
val pp : t CCFormat.printer
val eval : t -> Base_types.Term.t -> Base_types.Value.t option
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/Proof/Quip/index.html b/dev/sidekick-base/Sidekick_base/Proof/Quip/index.html new file mode 100644 index 00000000..fec3b2d3 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/Proof/Quip/index.html @@ -0,0 +1,2 @@ + +Quip (sidekick-base.Sidekick_base.Proof.Quip)

Module Proof.Quip

val output : Stdlib.out_channel -> t -> unit

Printer in Quip format (experimental)

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

Module Sidekick_base.Proof

include Sidekick_core.PROOF with type term = Base_types.Term.t and type ty = Base_types.Ty.t
type term = Base_types.Term.t
type ty = Base_types.Ty.t
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
val isa_split : ty -> term Iter.t -> t
val isa_disj : ty -> term -> term -> t
val cstor_inj : Base_types.Cstor.t -> int -> term list -> term list -> t
val bool_eq : term -> term -> t
val bool_c : string -> term list -> t
val ite_true : term -> t
val ite_false : term -> t
val lra : lit Iter.t -> t
val lra_l : lit list -> t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base/index.html b/dev/sidekick-base/Sidekick_base/index.html new file mode 100644 index 00000000..9ce512d3 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base/index.html @@ -0,0 +1,2 @@ + +Sidekick_base (sidekick-base.Sidekick_base)

Module Sidekick_base

Sidekick base

This library is a starting point for writing concrete implementations of SMT solvers with Sidekick.

It provides a representation of terms, boolean formulas, linear arithmetic expressions, datatypes for the functors in Sidekick.

In addition, it has a notion of Statement. Statements are instructions for the SMT solver to do something, such as: define a new constant, declare a new constant, assert a formula as being true, set an option, check satisfiability of the set of statements added so far, etc. Logic formats such as SMT-LIB 2.6 are in fact based on a similar notion of statements, and a .smt2 files contains a list of statements.

module Base_types : sig ... end
module ID : sig ... end
module Fun = Base_types.Fun
module Stat = Sidekick_util.Stat
module Model : sig ... end
module Term = Base_types.Term
module Value = Base_types.Value
module Term_cell = Base_types.Term_cell
module Ty = Base_types.Ty
module Statement = Base_types.Statement
module Data = Base_types.Data
module Select = Base_types.Select
module Proof : sig ... end
module Arg : Sidekick_core.TERM with type Term.t = Term.t and type Fun.t = Fun.t and type Ty.t = Ty.t and type Term.state = Term.state
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__/.dune-keep b/dev/sidekick-base/Sidekick_base__/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_arith_lra__/.dune-keep rename to dev/sidekick-base/Sidekick_base__/.dune-keep diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Cstor/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Cstor/index.html new file mode 100644 index 00000000..98a2b957 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Cstor/index.html @@ -0,0 +1,2 @@ + +Cstor (sidekick-base.Sidekick_base__.Base_types.Cstor)

Module Base_types.Cstor

type t = cstor = {
cstor_id : Sidekick_base.ID.t;
cstor_is_a : Sidekick_base.ID.t;
mutable cstor_arity : int;
cstor_args : select list lazy_t;
cstor_ty_as_data : data;
cstor_ty : ty lazy_t;
}
val id : t -> Sidekick_base.ID.t
val ty_args : t -> ty Iter.t
val equal : cstor -> cstor -> bool
val pp : CCFormat.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Data/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Data/index.html new file mode 100644 index 00000000..07d50057 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Data/index.html @@ -0,0 +1,2 @@ + +Data (sidekick-base.Sidekick_base__.Base_types.Data)

Module Base_types.Data

type t = data = {
data_id : Sidekick_base.ID.t;
data_cstors : cstor Sidekick_base__.ID.Map.t lazy_t;
data_as_ty : ty lazy_t;
}
val pp : CCFormat.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Fun/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Fun/index.html new file mode 100644 index 00000000..21871ac5 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Fun/index.html @@ -0,0 +1,2 @@ + +Fun (sidekick-base.Sidekick_base__.Base_types.Fun)

Module Base_types.Fun

type view = fun_view =
| Fun_undef of fun_ty
| Fun_select of select
| Fun_cstor of cstor
| Fun_is_a of cstor
| Fun_def of {
pp : a. ('a Fmt.printer -> 'a Sidekick_util.IArray.t Fmt.printer) option;
abs : self:term -> term Sidekick_util.IArray.t -> term * bool;
do_cc : bool;
relevant : a. Sidekick_base.ID.t -> 'a Sidekick_util.IArray.t -> int -> bool;
ty : Sidekick_base.ID.t -> term Sidekick_util.IArray.t -> ty;
eval : value Sidekick_util.IArray.t -> value;
}
type t = fun_ = {
fun_id : Sidekick_base.ID.t;
fun_view : fun_view;
}
val id : t -> Sidekick_base.ID.t
val view : t -> view
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val as_undefined : t -> (t * Ty.Fun.t) option
val as_undefined_exn : t -> t * Ty.Fun.t
val is_undefined : t -> bool
val select : select -> t
val select_idx : cstor -> int -> t
val cstor : cstor -> t
val is_a : cstor -> t
val do_cc : t -> bool
val mk_undef : Sidekick_base.ID.t -> Ty.Fun.t -> t
val mk_undef' : Sidekick_base.ID.t -> Ty.t list -> Ty.t -> t
val mk_undef_const : Sidekick_base.ID.t -> Ty.t -> t
val pp : t CCFormat.printer
module Map : CCMap.S with type Map.key = t
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Select/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Select/index.html new file mode 100644 index 00000000..f24b153b --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Select/index.html @@ -0,0 +1,2 @@ + +Select (sidekick-base.Sidekick_base__.Base_types.Select)

Module Base_types.Select

type t = select = {
select_id : Sidekick_base.ID.t;
select_cstor : cstor;
select_ty : ty lazy_t;
select_i : int;
}
val ty : t -> ty
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Statement/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Statement/index.html new file mode 100644 index 00000000..521b0e8e --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Statement/index.html @@ -0,0 +1,2 @@ + +Statement (sidekick-base.Sidekick_base__.Base_types.Statement)

Module Base_types.Statement

type t = statement =
| Stmt_set_logic of string
| Stmt_set_option of string list
| Stmt_set_info of string * string
| Stmt_data of data list
| Stmt_ty_decl of Sidekick_base.ID.t * int
| Stmt_decl of Sidekick_base.ID.t * ty list * ty
| Stmt_define of definition list
| Stmt_assert of term
| Stmt_assert_clause of term list
| Stmt_check_sat of (bool * term) list
| Stmt_exit
val pp : Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Term/Iter_dag/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Term/Iter_dag/index.html new file mode 100644 index 00000000..57425cd5 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Term/Iter_dag/index.html @@ -0,0 +1,2 @@ + +Iter_dag (sidekick-base.Sidekick_base__.Base_types.Term.Iter_dag)

Module Term.Iter_dag

type t
type order =
| Pre
| Post
val create : unit -> t
val iter_dag : ?⁠order:order -> t -> term -> term Iter.t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Term/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Term/index.html new file mode 100644 index 00000000..3a54dba7 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Term/index.html @@ -0,0 +1,2 @@ + +Term (sidekick-base.Sidekick_base__.Base_types.Term)

Module Base_types.Term

type t = term = {
mutable term_id : int;
mutable term_ty : ty;
term_view : t term_view;
}
type 'a view = 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of (Q.t, 'a) lra_view
val id : t -> int
val view : t -> term view
val ty : t -> Ty.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
type state
val create : ?⁠size:int -> unit -> state
val make : state -> t view -> t
val true_ : state -> t
val false_ : state -> t
val bool : state -> bool -> t
val const : state -> fun_ -> t
val app_fun : state -> fun_ -> t Sidekick_util.IArray.t -> t
val eq : state -> t -> t -> t
val not_ : state -> t -> t
val ite : state -> t -> t -> t -> t
val select : state -> select -> t -> t
val app_cstor : state -> cstor -> t Sidekick_util.IArray.t -> t
val is_a : state -> cstor -> t -> t
val lra : state -> (Q.t, t) lra_view -> t
val abs : state -> t -> t * bool

Obtain unsigned version of t, + the sign as a boolean

module Iter_dag : sig ... end
val iter_dag_with : order:Iter_dag.order -> t -> t Iter.t
val iter_dag : t -> t Iter.t
val map_shallow : state -> (t -> t) -> t -> t
val pp : t Fmt.printer

Views

val is_true : t -> bool
val is_false : t -> bool
val is_const : t -> bool
val cc_view : t -> (fun_tt Iter.t) CC_view.t
val as_fun_undef : t -> (fun_ * Ty.Fun.t) option
val as_bool : t -> bool option

Containers

module Tbl : CCHashtbl.S with type Tbl.key = t
module Map : CCMap.S with type Map.key = t
module Set : CCSet.S with type Set.elt = t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Term_cell/Make_eq/argument-1-X/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Term_cell/Make_eq/argument-1-X/index.html new file mode 100644 index 00000000..3d13143c --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Term_cell/Make_eq/argument-1-X/index.html @@ -0,0 +1,2 @@ + +1-X (sidekick-base.Sidekick_base__.Base_types.Term_cell.Make_eq.1-X)

Parameter Make_eq.1-X

type t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Term_cell/Make_eq/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Term_cell/Make_eq/index.html new file mode 100644 index 00000000..4ef47bb4 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Term_cell/Make_eq/index.html @@ -0,0 +1,2 @@ + +Make_eq (sidekick-base.Sidekick_base__.Base_types.Term_cell.Make_eq)

Module Term_cell.Make_eq

Parameters

Signature

val equal : X.t view -> X.t view -> bool
val hash : X.t view -> int
val pp : X.t view Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Term_cell/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Term_cell/index.html new file mode 100644 index 00000000..039813dc --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Term_cell/index.html @@ -0,0 +1,2 @@ + +Term_cell (sidekick-base.Sidekick_base__.Base_types.Term_cell)

Module Base_types.Term_cell

type 'a view = 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of (Q.t, 'a) lra_view
type t = term view
val equal : t -> t -> bool
val hash : t -> int
val true_ : t
val false_ : t
val const : fun_ -> t
val app_fun : fun_ -> term Sidekick_util.IArray.t -> t
val eq : term -> term -> t
val not_ : term -> t
val ite : term -> term -> term -> t
val lra : (Q.t, term) lra_view -> t
val ty : t -> Ty.t

Compute the type of this term cell. Not totally free

val pp : t Fmt.printer
val map : ('a -> 'b) -> 'a view -> 'b view
val iter : ('a -> unit) -> 'a view -> unit
module type ARG = sig ... end
module Make_eq : functor (X : ARG) -> sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Term_cell/module-type-ARG/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Term_cell/module-type-ARG/index.html new file mode 100644 index 00000000..e2b0630b --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Term_cell/module-type-ARG/index.html @@ -0,0 +1,2 @@ + +ARG (sidekick-base.Sidekick_base__.Base_types.Term_cell.ARG)

Module type Term_cell.ARG

type t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Ty/Fun/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Ty/Fun/index.html new file mode 100644 index 00000000..41e8ec65 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Ty/Fun/index.html @@ -0,0 +1,2 @@ + +Fun (sidekick-base.Sidekick_base__.Base_types.Ty.Fun)

Module Ty.Fun

type t = fun_ty
val args : t -> ty list
val ret : t -> ty
val arity : t -> int
val unfold : t -> ty list * ty
val mk : ty list -> ty -> t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Ty/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Ty/index.html new file mode 100644 index 00000000..6abbfba6 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Ty/index.html @@ -0,0 +1,2 @@ + +Ty (sidekick-base.Sidekick_base__.Base_types.Ty)

Module Base_types.Ty

type t = ty
type state = unit
type view = ty_view =
| Ty_bool
| Ty_real
| Ty_atomic of {
def : ty_def;
args : ty list;
mutable finite : bool;
}
type def = ty_def =
| Ty_uninterpreted of Sidekick_base.ID.t
| Ty_data of {
data : data;
}
| Ty_def of {
id : Sidekick_base.ID.t;
pp : ty Fmt.printer -> ty list Fmt.printer;
default_val : value list -> value;
}
val id : t -> int
val view : t -> view
val bool : state -> t
val real : state -> t
val atomic : def -> t list -> t
val id_of_def : def -> Sidekick_base.ID.t
val atomic_uninterpreted : Sidekick_base.ID.t -> t
val finite : t -> bool
val set_finite : t -> bool -> unit
val is_bool : t -> bool
val is_uninterpreted : t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t CCFormat.printer
module Tbl : CCHashtbl.S with type Tbl.key = t
module Fun : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/Value/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/Value/index.html new file mode 100644 index 00000000..ff6444b5 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/Value/index.html @@ -0,0 +1,2 @@ + +Value (sidekick-base.Sidekick_base__.Base_types.Value)

Module Base_types.Value

type t = value =
| V_bool of bool
| V_element of {
id : Sidekick_base.ID.t;
ty : ty;
}
| V_cstor of {
c : cstor;
args : value list;
}
| V_custom of {
view : value_custom_view;
pp : value_custom_view Fmt.printer;
eq : value_custom_view -> value_custom_view -> bool;
hash : value_custom_view -> int;
}
| V_real of Q.t
val true_ : t
val false_ : t
val bool : bool -> t
val real : Q.t -> t
val real_of_string : string -> t
val mk_elt : Sidekick_base.ID.t -> Ty.t -> t
val is_bool : t -> bool
val is_true : t -> bool
val is_false : t -> bool
val cstor_app : cstor -> t list -> t
val fresh : Term.t -> t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Base_types/index.html b/dev/sidekick-base/Sidekick_base__/Base_types/index.html new file mode 100644 index 00000000..a763837b --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Base_types/index.html @@ -0,0 +1,2 @@ + +Base_types (sidekick-base.Sidekick_base__.Base_types)

Module Sidekick_base__.Base_types

module Vec = Msat.Vec
module Log = Msat.Log
module Fmt = CCFormat
module CC_view = Sidekick_core.CC_view
type lra_pred = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
type lra_op = Sidekick_arith_lra.op =
| Plus
| Minus
type ('num, 'a) lra_view = ('num'a) Sidekick_arith_lra.lra_view =
| LRA_pred of lra_pred * 'a * 'a
| LRA_op of lra_op * 'a * 'a
| LRA_mult of 'num * 'a
| LRA_const of 'num
| LRA_simplex_var of 'a
| LRA_simplex_pred of 'a * Sidekick_arith_lra.S_op.t * 'num
| LRA_other of 'a
type term = {
mutable term_id : int;
mutable term_ty : ty;
term_view : term term_view;
}
and 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of (Q.t, 'a) lra_view
and fun_ = {
fun_id : Sidekick_base.ID.t;
fun_view : fun_view;
}
and fun_view =
| Fun_undef of fun_ty
| Fun_select of select
| Fun_cstor of cstor
| Fun_is_a of cstor
| Fun_def of {
pp : a. ('a Fmt.printer -> 'a Sidekick_util.IArray.t Fmt.printer) option;
abs : self:term -> term Sidekick_util.IArray.t -> term * bool;
do_cc : bool;
relevant : a. Sidekick_base.ID.t -> 'a Sidekick_util.IArray.t -> int -> bool;
ty : Sidekick_base.ID.t -> term Sidekick_util.IArray.t -> ty;
eval : value Sidekick_util.IArray.t -> value;
}

Methods on the custom term view whose arguments are 'a. Terms must be printable, and provide some additional theory handles.

  • relevant must return a subset of args (possibly the same set). The terms it returns will be activated and evaluated whenever possible. Terms in args \ relevant args are considered for congruence but not for evaluation.
and fun_ty = {
fun_ty_args : ty list;
fun_ty_ret : ty;
}

Function type

and ty = {
mutable ty_id : int;
ty_view : ty_view;
}

Hashconsed type

and ty_view =
| Ty_bool
| Ty_real
| Ty_atomic of {
def : ty_def;
args : ty list;
mutable finite : bool;
}
and ty_def =
| Ty_uninterpreted of Sidekick_base.ID.t
| Ty_data of {
data : data;
}
| Ty_def of {
id : Sidekick_base.ID.t;
pp : ty Fmt.printer -> ty list Fmt.printer;
default_val : value list -> value;
}
and data = {
data_id : Sidekick_base.ID.t;
data_cstors : cstor Sidekick_base__.ID.Map.t lazy_t;
data_as_ty : ty lazy_t;
}
and cstor = {
cstor_id : Sidekick_base.ID.t;
cstor_is_a : Sidekick_base.ID.t;
mutable cstor_arity : int;
cstor_args : select list lazy_t;
cstor_ty_as_data : data;
cstor_ty : ty lazy_t;
}
and select = {
select_id : Sidekick_base.ID.t;
select_cstor : cstor;
select_ty : ty lazy_t;
select_i : int;
}
and value =
| V_bool of bool
| V_element of {
id : Sidekick_base.ID.t;
ty : ty;
}

a named constant, distinct from any other constant

| V_cstor of {
c : cstor;
args : value list;
}
| V_custom of {
view : value_custom_view;
pp : value_custom_view Fmt.printer;
eq : value_custom_view -> value_custom_view -> bool;
hash : value_custom_view -> int;
}

Custom value

| V_real of Q.t

Semantic values, used for models (and possibly model-constructing calculi)

and value_custom_view = ..
type definition = Sidekick_base.ID.t * ty * term
type statement =
| Stmt_set_logic of string
| Stmt_set_option of string list
| Stmt_set_info of string * string
| Stmt_data of data list
| Stmt_ty_decl of Sidekick_base.ID.t * int
| Stmt_decl of Sidekick_base.ID.t * ty list * ty
| Stmt_define of definition list
| Stmt_assert of term
| Stmt_assert_clause of term list
| Stmt_check_sat of (bool * term) list
| Stmt_exit
val term_equal_ : term -> term -> bool
val term_hash_ : term -> int
val term_cmp_ : term -> term -> int
val fun_compare : fun_ -> fun_ -> int
val pp_fun : CCFormat.t -> fun_ -> unit
val id_of_fun : fun_ -> Sidekick_base.ID.t
val eq_ty : ty -> ty -> bool
val eq_cstor : cstor -> cstor -> bool
val eq_value : value -> value -> bool
val hash_value : value Sidekick_util.Hash.t
val pp_value : value Sidekick_util.Util.printer
val pp_db : Stdlib.Format.formatter -> (int * 'a) -> unit
val pp_ty : ty Sidekick_util.Util.printer
val string_of_lra_pred : lra_pred -> string
val pp_pred : Fmt.t -> lra_pred -> unit
val string_of_lra_op : lra_op -> string
val pp_lra_op : Fmt.t -> lra_op -> unit
val pp_term_view_gen : pp_id:(Fmt.t -> Sidekick_base.ID.t -> unit) -> pp_t:'a Fmt.printer -> Fmt.t -> 'a term_view -> unit
val pp_term_top : ids:bool -> Fmt.t -> term -> unit
val pp_term : Fmt.t -> term -> unit
val pp_term_view : Fmt.t -> term term_view -> unit
module Ty : sig ... end
module Fun : sig ... end
module Term_cell : sig ... end
module Term : sig ... end
module Value : sig ... end
module Data : sig ... end
module Select : sig ... end
module Cstor : sig ... end
module Statement : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/CCHet/Key/index.html b/dev/sidekick-base/Sidekick_base__/CCHet/Key/index.html new file mode 100644 index 00000000..2236a256 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/CCHet/Key/index.html @@ -0,0 +1,2 @@ + +Key (sidekick-base.Sidekick_base__.CCHet.Key)

Module CCHet.Key

type 'a t
val create : unit -> 'a t
val equal : 'a t -> 'a t -> bool

Compare two keys that have compatible types.

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

Module CCHet.Map

Immutable map

type t
val empty : t
val mem : _ Key.t -> t -> bool
val add : 'a Key.t -> 'a -> t -> t
val remove : _ Key.t -> t -> t
val length : t -> int
val cardinal : t -> int
val find : 'a Key.t -> t -> 'a option
val find_exn : 'a Key.t -> t -> 'a
raises Not_found

if the key is not in the table.

val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> t
val add_list : t -> pair list -> t
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/CCHet/Tbl/index.html b/dev/sidekick-base/Sidekick_base__/CCHet/Tbl/index.html new file mode 100644 index 00000000..0d3b78da --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/CCHet/Tbl/index.html @@ -0,0 +1,2 @@ + +Tbl (sidekick-base.Sidekick_base__.CCHet.Tbl)

Module CCHet.Tbl

Imperative table indexed by Key

type t
val create : ?⁠size:int -> unit -> t
val mem : t -> _ Key.t -> bool
val add : t -> 'a Key.t -> 'a -> unit
val remove : t -> _ Key.t -> unit
val length : t -> int
val find : t -> 'a Key.t -> 'a option
val find_exn : t -> 'a Key.t -> 'a
raises Not_found

if the key is not in the table.

val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> unit
val add_list : t -> pair list -> unit
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/CCHet/index.html b/dev/sidekick-base/Sidekick_base__/CCHet/index.html new file mode 100644 index 00000000..ec9bd907 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/CCHet/index.html @@ -0,0 +1,2 @@ + +CCHet (sidekick-base.Sidekick_base__.CCHet)

Module Sidekick_base__.CCHet

Associative containers with Heterogeneous Values

This is similar to CCMixtbl, but the injection is directly used as a key.

since
0.17
type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
module Key : sig ... end
type pair =
| Pair : 'a Key.t * 'a -> pair
module Tbl : sig ... end
module Map : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Config/Key/index.html b/dev/sidekick-base/Sidekick_base__/Config/Key/index.html new file mode 100644 index 00000000..37d768d4 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Config/Key/index.html @@ -0,0 +1,2 @@ + +Key (sidekick-base.Sidekick_base__.Config.Key)

Module Config.Key

type 'a t
val create : unit -> 'a t
val equal : 'a t -> 'a t -> bool

Compare two keys that have compatible types

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

Module Sidekick_base__.Config

Configuration

type 'a sequence = ('a -> unit) -> unit
module Key : sig ... end
type t
val empty : t
val mem : _ Key.t -> t -> bool
val add : 'a Key.t -> 'a -> t -> t
val length : t -> int
val cardinal : t -> int
val find : 'a Key.t -> t -> 'a option
val find_exn : 'a Key.t -> t -> 'a
raises Not_found

if the key is not in the table

type pair =
| Pair : 'a Key.t * 'a -> pair
val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair sequence
val of_iter : pair sequence -> t
val add_iter : t -> pair sequence -> t
val add_list : t -> pair list -> t
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Hashcons/Make/argument-1-A/index.html b/dev/sidekick-base/Sidekick_base__/Hashcons/Make/argument-1-A/index.html new file mode 100644 index 00000000..c79c3f1b --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Hashcons/Make/argument-1-A/index.html @@ -0,0 +1,2 @@ + +1-A (sidekick-base.Sidekick_base__.Hashcons.Make.1-A)

Parameter Make.1-A

type t
val equal : t -> t -> bool
val hash : t -> int
val set_id : t -> int -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Hashcons/Make/index.html b/dev/sidekick-base/Sidekick_base__/Hashcons/Make/index.html new file mode 100644 index 00000000..2586f26e --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Hashcons/Make/index.html @@ -0,0 +1,2 @@ + +Make (sidekick-base.Sidekick_base__.Hashcons.Make)

Module Hashcons.Make

Parameters

Signature

type t
val create : ?⁠size:int -> unit -> t
val hashcons : t -> A.t -> A.t
val to_seq : t -> A.t Iter.t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Hashcons/index.html b/dev/sidekick-base/Sidekick_base__/Hashcons/index.html new file mode 100644 index 00000000..83feefdc --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Hashcons/index.html @@ -0,0 +1,2 @@ + +Hashcons (sidekick-base.Sidekick_base__.Hashcons)

Module Sidekick_base__.Hashcons

module type ARG = sig ... end
module Make : functor (A : ARG) -> sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Hashcons/module-type-ARG/index.html b/dev/sidekick-base/Sidekick_base__/Hashcons/module-type-ARG/index.html new file mode 100644 index 00000000..33616c1c --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Hashcons/module-type-ARG/index.html @@ -0,0 +1,2 @@ + +ARG (sidekick-base.Sidekick_base__.Hashcons.ARG)

Module type Hashcons.ARG

type t
val equal : t -> t -> bool
val hash : t -> int
val set_id : t -> int -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/ID/B/index.html b/dev/sidekick-base/Sidekick_base__/ID/B/index.html new file mode 100644 index 00000000..d9bae380 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/ID/B/index.html @@ -0,0 +1,2 @@ + +B (sidekick-base.Sidekick_base__.ID.B)

Module ID.B

val rat : t
val int : t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/ID/index.html b/dev/sidekick-base/Sidekick_base__/ID/index.html new file mode 100644 index 00000000..6b64eed7 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/ID/index.html @@ -0,0 +1,2 @@ + +ID (sidekick-base.Sidekick_base__.ID)

Module Sidekick_base__.ID

Unique Identifiers

type t
val make : string -> t
val makef : ('a, Stdlib.Format.formatter, unit, t) Stdlib.format4 -> 'a
val copy : t -> t
val id : t -> int
val to_string : t -> string
val to_string_full : t -> string
include Sidekick_util.Intf.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_util.Intf.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_util.Intf.HASH with type t := t
type t
val hash : t -> int
include Sidekick_util.Intf.PRINT with type t := t
type t
val pp : t CCFormat.printer
val pp_name : t CCFormat.printer
module Map : CCMap.S with type Map.key = t
module Set : CCSet.S with type Set.elt = t
module Tbl : CCHashtbl.S with type Tbl.key = t
module B : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Model/Fun_interpretation/index.html b/dev/sidekick-base/Sidekick_base__/Model/Fun_interpretation/index.html new file mode 100644 index 00000000..d58677a5 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Model/Fun_interpretation/index.html @@ -0,0 +1,2 @@ + +Fun_interpretation (sidekick-base.Sidekick_base__.Model.Fun_interpretation)

Module Model.Fun_interpretation

type t = {
cases : Sidekick_base.Base_types.Value.t Val_map.t;
default : Sidekick_base.Base_types.Value.t;
}
val default : t -> Sidekick_base.Base_types.Value.t
val cases_list : t -> (Sidekick_base.Base_types.Value.t list * Sidekick_base.Base_types.Value.t) list
val make : default:Sidekick_base.Base_types.Value.t -> (Sidekick_base.Base_types.Value.t list * Sidekick_base.Base_types.Value.t) list -> t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Model/Val_map/index.html b/dev/sidekick-base/Sidekick_base__/Model/Val_map/index.html new file mode 100644 index 00000000..0621ce67 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Model/Val_map/index.html @@ -0,0 +1,2 @@ + +Val_map (sidekick-base.Sidekick_base__.Model.Val_map)

Module Model.Val_map

type key = Sidekick_base.Base_types.Value.t list
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val cardinal : _ t -> int
val find : key -> 'a t -> 'a option
val add : key -> 'a -> 'a t -> 'a t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Model/index.html b/dev/sidekick-base/Sidekick_base__/Model/index.html new file mode 100644 index 00000000..98a9f546 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Model/index.html @@ -0,0 +1,2 @@ + +Model (sidekick-base.Sidekick_base__.Model)

Module Sidekick_base__.Model

Model

module Val_map : sig ... end
module Fun_interpretation : sig ... end
type t = {
values : Sidekick_base.Base_types.Value.t Sidekick_base__.Base_types.Term.Map.t;
funs : Fun_interpretation.t Sidekick_base__.Base_types.Fun.Map.t;
}
val empty : t
val add : Sidekick_base.Base_types.Term.t -> Sidekick_base.Base_types.Value.t -> t -> t
val mem : Sidekick_base.Base_types.Term.t -> t -> bool
val find : Sidekick_base.Base_types.Term.t -> t -> Sidekick_base.Base_types.Value.t option
val merge : t -> t -> t
val pp : t CCFormat.printer
val eval : t -> Sidekick_base.Base_types.Term.t -> Sidekick_base.Base_types.Value.t option
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/Proof/Quip/index.html b/dev/sidekick-base/Sidekick_base__/Proof/Quip/index.html new file mode 100644 index 00000000..e7c6e809 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/Proof/Quip/index.html @@ -0,0 +1,2 @@ + +Quip (sidekick-base.Sidekick_base__.Proof.Quip)

Module Proof.Quip

val output : Stdlib.out_channel -> t -> unit

Printer in Quip format (experimental)

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

Module Sidekick_base__.Proof

include Sidekick_core.PROOF with type term = Sidekick_base.Base_types.Term.t and type ty = Sidekick_base.Base_types.Ty.t
type term = Sidekick_base.Base_types.Term.t
type ty = Sidekick_base.Base_types.Ty.t
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
val isa_split : ty -> term Iter.t -> t
val isa_disj : ty -> term -> term -> t
val cstor_inj : Sidekick_base.Base_types.Cstor.t -> int -> term list -> term list -> t
val bool_eq : term -> term -> t
val bool_c : string -> term list -> t
val ite_true : term -> t
val ite_false : term -> t
val lra : lit Iter.t -> t
val lra_l : lit list -> t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__/index.html b/dev/sidekick-base/Sidekick_base__/index.html new file mode 100644 index 00000000..acb8b58e --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__/index.html @@ -0,0 +1,2 @@ + +Sidekick_base__ (sidekick-base.Sidekick_base__)

Module Sidekick_base__

module Base_types : sig ... end
module CCHet : sig ... end
module Config : sig ... end
module Hashcons : sig ... end
module ID : sig ... end
module Model : sig ... end
module Proof : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/.dune-keep b/dev/sidekick-base/Sidekick_base__Base_types/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_arith_lra__Linear_expr/.dune-keep rename to dev/sidekick-base/Sidekick_base__Base_types/.dune-keep diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Cstor/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Cstor/index.html new file mode 100644 index 00000000..ed988f86 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Cstor/index.html @@ -0,0 +1,2 @@ + +Cstor (sidekick-base.Sidekick_base__Base_types.Cstor)

Module Sidekick_base__Base_types.Cstor

type t = cstor = {
cstor_id : Sidekick_base.ID.t;
cstor_is_a : Sidekick_base.ID.t;
mutable cstor_arity : int;
cstor_args : select list lazy_t;
cstor_ty_as_data : data;
cstor_ty : ty lazy_t;
}
val id : t -> Sidekick_base.ID.t
val ty_args : t -> ty Iter.t
val equal : cstor -> cstor -> bool
val pp : CCFormat.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Data/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Data/index.html new file mode 100644 index 00000000..43483e9d --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Data/index.html @@ -0,0 +1,2 @@ + +Data (sidekick-base.Sidekick_base__Base_types.Data)

Module Sidekick_base__Base_types.Data

type t = data = {
data_id : Sidekick_base.ID.t;
data_cstors : cstor Sidekick_base__.ID.Map.t lazy_t;
data_as_ty : ty lazy_t;
}
val pp : CCFormat.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Fun/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Fun/index.html new file mode 100644 index 00000000..59f2a4ef --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Fun/index.html @@ -0,0 +1,2 @@ + +Fun (sidekick-base.Sidekick_base__Base_types.Fun)

Module Sidekick_base__Base_types.Fun

type view = fun_view =
| Fun_undef of fun_ty
| Fun_select of select
| Fun_cstor of cstor
| Fun_is_a of cstor
| Fun_def of {
pp : a. ('a Fmt.printer -> 'a Sidekick_util.IArray.t Fmt.printer) option;
abs : self:term -> term Sidekick_util.IArray.t -> term * bool;
do_cc : bool;
relevant : a. Sidekick_base.ID.t -> 'a Sidekick_util.IArray.t -> int -> bool;
ty : Sidekick_base.ID.t -> term Sidekick_util.IArray.t -> ty;
eval : value Sidekick_util.IArray.t -> value;
}
type t = fun_ = {
fun_id : Sidekick_base.ID.t;
fun_view : fun_view;
}
val id : t -> Sidekick_base.ID.t
val view : t -> view
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val as_undefined : t -> (t * Ty.Fun.t) option
val as_undefined_exn : t -> t * Ty.Fun.t
val is_undefined : t -> bool
val select : select -> t
val select_idx : cstor -> int -> t
val cstor : cstor -> t
val is_a : cstor -> t
val do_cc : t -> bool
val mk_undef : Sidekick_base.ID.t -> Ty.Fun.t -> t
val mk_undef' : Sidekick_base.ID.t -> Ty.t list -> Ty.t -> t
val mk_undef_const : Sidekick_base.ID.t -> Ty.t -> t
val pp : t CCFormat.printer
module Map : CCMap.S with type Map.key = t
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Select/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Select/index.html new file mode 100644 index 00000000..2dd2f07b --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Select/index.html @@ -0,0 +1,2 @@ + +Select (sidekick-base.Sidekick_base__Base_types.Select)

Module Sidekick_base__Base_types.Select

type t = select = {
select_id : Sidekick_base.ID.t;
select_cstor : cstor;
select_ty : ty lazy_t;
select_i : int;
}
val ty : t -> ty
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Statement/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Statement/index.html new file mode 100644 index 00000000..be8a522b --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Statement/index.html @@ -0,0 +1,2 @@ + +Statement (sidekick-base.Sidekick_base__Base_types.Statement)

Module Sidekick_base__Base_types.Statement

type t = statement =
| Stmt_set_logic of string
| Stmt_set_option of string list
| Stmt_set_info of string * string
| Stmt_data of data list
| Stmt_ty_decl of Sidekick_base.ID.t * int
| Stmt_decl of Sidekick_base.ID.t * ty list * ty
| Stmt_define of definition list
| Stmt_assert of term
| Stmt_assert_clause of term list
| Stmt_check_sat of (bool * term) list
| Stmt_exit
val pp : Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Term/Iter_dag/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Term/Iter_dag/index.html new file mode 100644 index 00000000..38b866a9 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Term/Iter_dag/index.html @@ -0,0 +1,2 @@ + +Iter_dag (sidekick-base.Sidekick_base__Base_types.Term.Iter_dag)

Module Term.Iter_dag

type t
type order =
| Pre
| Post
val create : unit -> t
val iter_dag : ?⁠order:order -> t -> term -> term Iter.t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Term/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Term/index.html new file mode 100644 index 00000000..51691135 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Term/index.html @@ -0,0 +1,2 @@ + +Term (sidekick-base.Sidekick_base__Base_types.Term)

Module Sidekick_base__Base_types.Term

type t = term = {
mutable term_id : int;
mutable term_ty : ty;
term_view : t term_view;
}
type 'a view = 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of (Q.t, 'a) lra_view
val id : t -> int
val view : t -> term view
val ty : t -> Ty.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
type state
val create : ?⁠size:int -> unit -> state
val make : state -> t view -> t
val true_ : state -> t
val false_ : state -> t
val bool : state -> bool -> t
val const : state -> fun_ -> t
val app_fun : state -> fun_ -> t Sidekick_util.IArray.t -> t
val eq : state -> t -> t -> t
val not_ : state -> t -> t
val ite : state -> t -> t -> t -> t
val select : state -> select -> t -> t
val app_cstor : state -> cstor -> t Sidekick_util.IArray.t -> t
val is_a : state -> cstor -> t -> t
val lra : state -> (Q.t, t) lra_view -> t
val abs : state -> t -> t * bool

Obtain unsigned version of t, + the sign as a boolean

module Iter_dag : sig ... end
val iter_dag_with : order:Iter_dag.order -> t -> t Iter.t
val iter_dag : t -> t Iter.t
val map_shallow : state -> (t -> t) -> t -> t
val pp : t Fmt.printer

Views

val is_true : t -> bool
val is_false : t -> bool
val is_const : t -> bool
val cc_view : t -> (fun_tt Iter.t) CC_view.t
val as_fun_undef : t -> (fun_ * Ty.Fun.t) option
val as_bool : t -> bool option

Containers

module Tbl : CCHashtbl.S with type Tbl.key = t
module Map : CCMap.S with type Map.key = t
module Set : CCSet.S with type Set.elt = t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Term_cell/Make_eq/argument-1-X/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Term_cell/Make_eq/argument-1-X/index.html new file mode 100644 index 00000000..9887dc1d --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Term_cell/Make_eq/argument-1-X/index.html @@ -0,0 +1,2 @@ + +1-X (sidekick-base.Sidekick_base__Base_types.Term_cell.Make_eq.1-X)

Parameter Make_eq.1-X

type t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Term_cell/Make_eq/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Term_cell/Make_eq/index.html new file mode 100644 index 00000000..f4ad8028 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Term_cell/Make_eq/index.html @@ -0,0 +1,2 @@ + +Make_eq (sidekick-base.Sidekick_base__Base_types.Term_cell.Make_eq)

Module Term_cell.Make_eq

Parameters

Signature

val equal : X.t view -> X.t view -> bool
val hash : X.t view -> int
val pp : X.t view Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Term_cell/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Term_cell/index.html new file mode 100644 index 00000000..6170bd0c --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Term_cell/index.html @@ -0,0 +1,2 @@ + +Term_cell (sidekick-base.Sidekick_base__Base_types.Term_cell)

Module Sidekick_base__Base_types.Term_cell

type 'a view = 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of (Q.t, 'a) lra_view
type t = term view
val equal : t -> t -> bool
val hash : t -> int
val true_ : t
val false_ : t
val const : fun_ -> t
val app_fun : fun_ -> term Sidekick_util.IArray.t -> t
val eq : term -> term -> t
val not_ : term -> t
val ite : term -> term -> term -> t
val lra : (Q.t, term) lra_view -> t
val ty : t -> Ty.t

Compute the type of this term cell. Not totally free

val pp : t Fmt.printer
val map : ('a -> 'b) -> 'a view -> 'b view
val iter : ('a -> unit) -> 'a view -> unit
module type ARG = sig ... end
module Make_eq : functor (X : ARG) -> sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Term_cell/module-type-ARG/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Term_cell/module-type-ARG/index.html new file mode 100644 index 00000000..96eb211e --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Term_cell/module-type-ARG/index.html @@ -0,0 +1,2 @@ + +ARG (sidekick-base.Sidekick_base__Base_types.Term_cell.ARG)

Module type Term_cell.ARG

type t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Ty/Fun/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Ty/Fun/index.html new file mode 100644 index 00000000..7c2a8a33 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Ty/Fun/index.html @@ -0,0 +1,2 @@ + +Fun (sidekick-base.Sidekick_base__Base_types.Ty.Fun)

Module Ty.Fun

type t = fun_ty
val args : t -> ty list
val ret : t -> ty
val arity : t -> int
val unfold : t -> ty list * ty
val mk : ty list -> ty -> t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Ty/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Ty/index.html new file mode 100644 index 00000000..0dd1230b --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Ty/index.html @@ -0,0 +1,2 @@ + +Ty (sidekick-base.Sidekick_base__Base_types.Ty)

Module Sidekick_base__Base_types.Ty

type t = ty
type state = unit
type view = ty_view =
| Ty_bool
| Ty_real
| Ty_atomic of {
def : ty_def;
args : ty list;
mutable finite : bool;
}
type def = ty_def =
| Ty_uninterpreted of Sidekick_base.ID.t
| Ty_data of {
data : data;
}
| Ty_def of {
id : Sidekick_base.ID.t;
pp : ty Fmt.printer -> ty list Fmt.printer;
default_val : value list -> value;
}
val id : t -> int
val view : t -> view
val bool : state -> t
val real : state -> t
val atomic : def -> t list -> t
val id_of_def : def -> Sidekick_base.ID.t
val atomic_uninterpreted : Sidekick_base.ID.t -> t
val finite : t -> bool
val set_finite : t -> bool -> unit
val is_bool : t -> bool
val is_uninterpreted : t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t CCFormat.printer
module Tbl : CCHashtbl.S with type Tbl.key = t
module Fun : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/Value/index.html b/dev/sidekick-base/Sidekick_base__Base_types/Value/index.html new file mode 100644 index 00000000..23d57206 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/Value/index.html @@ -0,0 +1,2 @@ + +Value (sidekick-base.Sidekick_base__Base_types.Value)

Module Sidekick_base__Base_types.Value

type t = value =
| V_bool of bool
| V_element of {
id : Sidekick_base.ID.t;
ty : ty;
}
| V_cstor of {
c : cstor;
args : value list;
}
| V_custom of {
view : value_custom_view;
pp : value_custom_view Fmt.printer;
eq : value_custom_view -> value_custom_view -> bool;
hash : value_custom_view -> int;
}
| V_real of Q.t
val true_ : t
val false_ : t
val bool : bool -> t
val real : Q.t -> t
val real_of_string : string -> t
val mk_elt : Sidekick_base.ID.t -> Ty.t -> t
val is_bool : t -> bool
val is_true : t -> bool
val is_false : t -> bool
val cstor_app : cstor -> t list -> t
val fresh : Term.t -> t
val hash : t -> int
val equal : t -> t -> bool
val pp : t Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Base_types/index.html b/dev/sidekick-base/Sidekick_base__Base_types/index.html new file mode 100644 index 00000000..bd18d812 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Base_types/index.html @@ -0,0 +1,2 @@ + +Sidekick_base__Base_types (sidekick-base.Sidekick_base__Base_types)

Module Sidekick_base__Base_types

module Vec = Msat.Vec
module Log = Msat.Log
module Fmt = CCFormat
module CC_view = Sidekick_core.CC_view
type lra_pred = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
type lra_op = Sidekick_arith_lra.op =
| Plus
| Minus
type ('num, 'a) lra_view = ('num'a) Sidekick_arith_lra.lra_view =
| LRA_pred of lra_pred * 'a * 'a
| LRA_op of lra_op * 'a * 'a
| LRA_mult of 'num * 'a
| LRA_const of 'num
| LRA_simplex_var of 'a
| LRA_simplex_pred of 'a * Sidekick_arith_lra.S_op.t * 'num
| LRA_other of 'a
type term = {
mutable term_id : int;
mutable term_ty : ty;
term_view : term term_view;
}
and 'a term_view =
| Bool of bool
| App_fun of fun_ * 'a Sidekick_util.IArray.t
| Eq of 'a * 'a
| Not of 'a
| Ite of 'a * 'a * 'a
| LRA of (Q.t, 'a) lra_view
and fun_ = {
fun_id : Sidekick_base.ID.t;
fun_view : fun_view;
}
and fun_view =
| Fun_undef of fun_ty
| Fun_select of select
| Fun_cstor of cstor
| Fun_is_a of cstor
| Fun_def of {
pp : a. ('a Fmt.printer -> 'a Sidekick_util.IArray.t Fmt.printer) option;
abs : self:term -> term Sidekick_util.IArray.t -> term * bool;
do_cc : bool;
relevant : a. Sidekick_base.ID.t -> 'a Sidekick_util.IArray.t -> int -> bool;
ty : Sidekick_base.ID.t -> term Sidekick_util.IArray.t -> ty;
eval : value Sidekick_util.IArray.t -> value;
}

Methods on the custom term view whose arguments are 'a. Terms must be printable, and provide some additional theory handles.

  • relevant must return a subset of args (possibly the same set). The terms it returns will be activated and evaluated whenever possible. Terms in args \ relevant args are considered for congruence but not for evaluation.
and fun_ty = {
fun_ty_args : ty list;
fun_ty_ret : ty;
}

Function type

and ty = {
mutable ty_id : int;
ty_view : ty_view;
}

Hashconsed type

and ty_view =
| Ty_bool
| Ty_real
| Ty_atomic of {
def : ty_def;
args : ty list;
mutable finite : bool;
}
and ty_def =
| Ty_uninterpreted of Sidekick_base.ID.t
| Ty_data of {
data : data;
}
| Ty_def of {
id : Sidekick_base.ID.t;
pp : ty Fmt.printer -> ty list Fmt.printer;
default_val : value list -> value;
}
and data = {
data_id : Sidekick_base.ID.t;
data_cstors : cstor Sidekick_base__.ID.Map.t lazy_t;
data_as_ty : ty lazy_t;
}
and cstor = {
cstor_id : Sidekick_base.ID.t;
cstor_is_a : Sidekick_base.ID.t;
mutable cstor_arity : int;
cstor_args : select list lazy_t;
cstor_ty_as_data : data;
cstor_ty : ty lazy_t;
}
and select = {
select_id : Sidekick_base.ID.t;
select_cstor : cstor;
select_ty : ty lazy_t;
select_i : int;
}
and value =
| V_bool of bool
| V_element of {
id : Sidekick_base.ID.t;
ty : ty;
}

a named constant, distinct from any other constant

| V_cstor of {
c : cstor;
args : value list;
}
| V_custom of {
view : value_custom_view;
pp : value_custom_view Fmt.printer;
eq : value_custom_view -> value_custom_view -> bool;
hash : value_custom_view -> int;
}

Custom value

| V_real of Q.t

Semantic values, used for models (and possibly model-constructing calculi)

and value_custom_view = ..
type definition = Sidekick_base.ID.t * ty * term
type statement =
| Stmt_set_logic of string
| Stmt_set_option of string list
| Stmt_set_info of string * string
| Stmt_data of data list
| Stmt_ty_decl of Sidekick_base.ID.t * int
| Stmt_decl of Sidekick_base.ID.t * ty list * ty
| Stmt_define of definition list
| Stmt_assert of term
| Stmt_assert_clause of term list
| Stmt_check_sat of (bool * term) list
| Stmt_exit
val term_equal_ : term -> term -> bool
val term_hash_ : term -> int
val term_cmp_ : term -> term -> int
val fun_compare : fun_ -> fun_ -> int
val pp_fun : CCFormat.t -> fun_ -> unit
val id_of_fun : fun_ -> Sidekick_base.ID.t
val eq_ty : ty -> ty -> bool
val eq_cstor : cstor -> cstor -> bool
val eq_value : value -> value -> bool
val hash_value : value Sidekick_util.Hash.t
val pp_value : value Sidekick_util.Util.printer
val pp_db : Stdlib.Format.formatter -> (int * 'a) -> unit
val pp_ty : ty Sidekick_util.Util.printer
val string_of_lra_pred : lra_pred -> string
val pp_pred : Fmt.t -> lra_pred -> unit
val string_of_lra_op : lra_op -> string
val pp_lra_op : Fmt.t -> lra_op -> unit
val pp_term_view_gen : pp_id:(Fmt.t -> Sidekick_base.ID.t -> unit) -> pp_t:'a Fmt.printer -> Fmt.t -> 'a term_view -> unit
val pp_term_top : ids:bool -> Fmt.t -> term -> unit
val pp_term : Fmt.t -> term -> unit
val pp_term_view : Fmt.t -> term term_view -> unit
module Ty : sig ... end
module Fun : sig ... end
module Term_cell : sig ... end
module Term : sig ... end
module Value : sig ... end
module Data : sig ... end
module Select : sig ... end
module Cstor : sig ... end
module Statement : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/.dune-keep b/dev/sidekick-base/Sidekick_base__CCHet/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_arith_lra__Linear_expr_intf/.dune-keep rename to dev/sidekick-base/Sidekick_base__CCHet/.dune-keep diff --git a/dev/sidekick-base/Sidekick_base__CCHet/Key/index.html b/dev/sidekick-base/Sidekick_base__CCHet/Key/index.html new file mode 100644 index 00000000..c56839bf --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__CCHet/Key/index.html @@ -0,0 +1,2 @@ + +Key (sidekick-base.Sidekick_base__CCHet.Key)

Module Sidekick_base__CCHet.Key

type 'a t
val create : unit -> 'a t
val equal : 'a t -> 'a t -> bool

Compare two keys that have compatible types.

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

Module Sidekick_base__CCHet.Map

Immutable map

type t
val empty : t
val mem : _ Key.t -> t -> bool
val add : 'a Key.t -> 'a -> t -> t
val remove : _ Key.t -> t -> t
val length : t -> int
val cardinal : t -> int
val find : 'a Key.t -> t -> 'a option
val find_exn : 'a Key.t -> t -> 'a
raises Not_found

if the key is not in the table.

val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> t
val add_list : t -> pair list -> t
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__CCHet/Tbl/index.html b/dev/sidekick-base/Sidekick_base__CCHet/Tbl/index.html new file mode 100644 index 00000000..fa480c78 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__CCHet/Tbl/index.html @@ -0,0 +1,2 @@ + +Tbl (sidekick-base.Sidekick_base__CCHet.Tbl)

Module Sidekick_base__CCHet.Tbl

Imperative table indexed by Key

type t
val create : ?⁠size:int -> unit -> t
val mem : t -> _ Key.t -> bool
val add : t -> 'a Key.t -> 'a -> unit
val remove : t -> _ Key.t -> unit
val length : t -> int
val find : t -> 'a Key.t -> 'a option
val find_exn : t -> 'a Key.t -> 'a
raises Not_found

if the key is not in the table.

val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair iter
val of_iter : pair iter -> t
val add_iter : t -> pair iter -> unit
val add_list : t -> pair list -> unit
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__CCHet/index.html b/dev/sidekick-base/Sidekick_base__CCHet/index.html new file mode 100644 index 00000000..613a2d13 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__CCHet/index.html @@ -0,0 +1,2 @@ + +Sidekick_base__CCHet (sidekick-base.Sidekick_base__CCHet)

Module Sidekick_base__CCHet

Associative containers with Heterogeneous Values

This is similar to CCMixtbl, but the injection is directly used as a key.

since
0.17
type 'a iter = ('a -> unit) -> unit
type 'a gen = unit -> 'a option
module Key : sig ... end
type pair =
| Pair : 'a Key.t * 'a -> pair
module Tbl : sig ... end
module Map : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Predicate/.dune-keep b/dev/sidekick-base/Sidekick_base__Config/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_arith_lra__Predicate/.dune-keep rename to dev/sidekick-base/Sidekick_base__Config/.dune-keep diff --git a/dev/sidekick-base/Sidekick_base__Config/Key/index.html b/dev/sidekick-base/Sidekick_base__Config/Key/index.html new file mode 100644 index 00000000..7100fd9a --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Config/Key/index.html @@ -0,0 +1,2 @@ + +Key (sidekick-base.Sidekick_base__Config.Key)

Module Sidekick_base__Config.Key

type 'a t
val create : unit -> 'a t
val equal : 'a t -> 'a t -> bool

Compare two keys that have compatible types

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

Module Sidekick_base__Config

Configuration

type 'a sequence = ('a -> unit) -> unit
module Key : sig ... end
type t
val empty : t
val mem : _ Key.t -> t -> bool
val add : 'a Key.t -> 'a -> t -> t
val length : t -> int
val cardinal : t -> int
val find : 'a Key.t -> t -> 'a option
val find_exn : 'a Key.t -> t -> 'a
raises Not_found

if the key is not in the table

type pair =
| Pair : 'a Key.t * 'a -> pair
val iter : (pair -> unit) -> t -> unit
val to_iter : t -> pair sequence
val of_iter : pair sequence -> t
val add_iter : t -> pair sequence -> t
val add_list : t -> pair list -> t
val of_list : pair list -> t
val to_list : t -> pair list
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex2/.dune-keep b/dev/sidekick-base/Sidekick_base__Hashcons/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_arith_lra__Simplex2/.dune-keep rename to dev/sidekick-base/Sidekick_base__Hashcons/.dune-keep diff --git a/dev/sidekick-base/Sidekick_base__Hashcons/Make/argument-1-A/index.html b/dev/sidekick-base/Sidekick_base__Hashcons/Make/argument-1-A/index.html new file mode 100644 index 00000000..55f8ffa9 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Hashcons/Make/argument-1-A/index.html @@ -0,0 +1,2 @@ + +1-A (sidekick-base.Sidekick_base__Hashcons.Make.1-A)

Parameter Make.1-A

type t
val equal : t -> t -> bool
val hash : t -> int
val set_id : t -> int -> unit
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Hashcons/Make/index.html b/dev/sidekick-base/Sidekick_base__Hashcons/Make/index.html new file mode 100644 index 00000000..13210917 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Hashcons/Make/index.html @@ -0,0 +1,2 @@ + +Make (sidekick-base.Sidekick_base__Hashcons.Make)

Module Sidekick_base__Hashcons.Make

Parameters

Signature

type t
val create : ?⁠size:int -> unit -> t
val hashcons : t -> A.t -> A.t
val to_seq : t -> A.t Iter.t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Hashcons/index.html b/dev/sidekick-base/Sidekick_base__Hashcons/index.html new file mode 100644 index 00000000..cc05421b --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Hashcons/index.html @@ -0,0 +1,2 @@ + +Sidekick_base__Hashcons (sidekick-base.Sidekick_base__Hashcons)

Module Sidekick_base__Hashcons

module type ARG = sig ... end
module Make : functor (A : ARG) -> sig ... end
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Hashcons/module-type-ARG/index.html b/dev/sidekick-base/Sidekick_base__Hashcons/module-type-ARG/index.html new file mode 100644 index 00000000..16ce96b7 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Hashcons/module-type-ARG/index.html @@ -0,0 +1,2 @@ + +ARG (sidekick-base.Sidekick_base__Hashcons.ARG)

Module type Sidekick_base__Hashcons.ARG

type t
val equal : t -> t -> bool
val hash : t -> int
val set_id : t -> int -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/.dune-keep b/dev/sidekick-base/Sidekick_base__ID/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_arith_lra__Simplex_intf/.dune-keep rename to dev/sidekick-base/Sidekick_base__ID/.dune-keep diff --git a/dev/sidekick-base/Sidekick_base__ID/B/index.html b/dev/sidekick-base/Sidekick_base__ID/B/index.html new file mode 100644 index 00000000..5c4d6fd6 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__ID/B/index.html @@ -0,0 +1,2 @@ + +B (sidekick-base.Sidekick_base__ID.B)

Module Sidekick_base__ID.B

val rat : t
val int : t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__ID/index.html b/dev/sidekick-base/Sidekick_base__ID/index.html new file mode 100644 index 00000000..f44afd12 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__ID/index.html @@ -0,0 +1,2 @@ + +Sidekick_base__ID (sidekick-base.Sidekick_base__ID)

Module Sidekick_base__ID

Unique Identifiers

type t
val make : string -> t
val makef : ('a, Stdlib.Format.formatter, unit, t) Stdlib.format4 -> 'a
val copy : t -> t
val id : t -> int
val to_string : t -> string
val to_string_full : t -> string
include Sidekick_util.Intf.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_util.Intf.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_util.Intf.HASH with type t := t
type t
val hash : t -> int
include Sidekick_util.Intf.PRINT with type t := t
type t
val pp : t CCFormat.printer
val pp_name : t CCFormat.printer
module Map : CCMap.S with type Map.key = t
module Set : CCSet.S with type Set.elt = t
module Tbl : CCHashtbl.S with type Tbl.key = t
module B : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term/.dune-keep b/dev/sidekick-base/Sidekick_base__Model/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_base_term/.dune-keep rename to dev/sidekick-base/Sidekick_base__Model/.dune-keep diff --git a/dev/sidekick-base/Sidekick_base__Model/Fun_interpretation/index.html b/dev/sidekick-base/Sidekick_base__Model/Fun_interpretation/index.html new file mode 100644 index 00000000..041dbd9c --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Model/Fun_interpretation/index.html @@ -0,0 +1,2 @@ + +Fun_interpretation (sidekick-base.Sidekick_base__Model.Fun_interpretation)

Module Sidekick_base__Model.Fun_interpretation

type t = {
cases : Sidekick_base.Base_types.Value.t Val_map.t;
default : Sidekick_base.Base_types.Value.t;
}
val default : t -> Sidekick_base.Base_types.Value.t
val cases_list : t -> (Sidekick_base.Base_types.Value.t list * Sidekick_base.Base_types.Value.t) list
val make : default:Sidekick_base.Base_types.Value.t -> (Sidekick_base.Base_types.Value.t list * Sidekick_base.Base_types.Value.t) list -> t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Model/Val_map/index.html b/dev/sidekick-base/Sidekick_base__Model/Val_map/index.html new file mode 100644 index 00000000..b6778e84 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Model/Val_map/index.html @@ -0,0 +1,2 @@ + +Val_map (sidekick-base.Sidekick_base__Model.Val_map)

Module Sidekick_base__Model.Val_map

type key = Sidekick_base.Base_types.Value.t list
type 'a t
val empty : 'a t
val is_empty : _ t -> bool
val cardinal : _ t -> int
val find : key -> 'a t -> 'a option
val add : key -> 'a -> 'a t -> 'a t
\ No newline at end of file diff --git a/dev/sidekick-base/Sidekick_base__Model/index.html b/dev/sidekick-base/Sidekick_base__Model/index.html new file mode 100644 index 00000000..5b12b4a2 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Model/index.html @@ -0,0 +1,2 @@ + +Sidekick_base__Model (sidekick-base.Sidekick_base__Model)

Module Sidekick_base__Model

Model

module Val_map : sig ... end
module Fun_interpretation : sig ... end
type t = {
values : Sidekick_base.Base_types.Value.t Sidekick_base__.Base_types.Term.Map.t;
funs : Fun_interpretation.t Sidekick_base__.Base_types.Fun.Map.t;
}
val empty : t
val add : Sidekick_base.Base_types.Term.t -> Sidekick_base.Base_types.Value.t -> t -> t
val mem : Sidekick_base.Base_types.Term.t -> t -> bool
val find : Sidekick_base.Base_types.Term.t -> t -> Sidekick_base.Base_types.Value.t option
val merge : t -> t -> t
val pp : t CCFormat.printer
val eval : t -> Sidekick_base.Base_types.Term.t -> Sidekick_base.Base_types.Value.t option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__/.dune-keep b/dev/sidekick-base/Sidekick_base__Proof/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_base_term__/.dune-keep rename to dev/sidekick-base/Sidekick_base__Proof/.dune-keep diff --git a/dev/sidekick-base/Sidekick_base__Proof/Quip/index.html b/dev/sidekick-base/Sidekick_base__Proof/Quip/index.html new file mode 100644 index 00000000..bdd42651 --- /dev/null +++ b/dev/sidekick-base/Sidekick_base__Proof/Quip/index.html @@ -0,0 +1,2 @@ + +Quip (sidekick-base.Sidekick_base__Proof.Quip)

Module Sidekick_base__Proof.Quip

val output : Stdlib.out_channel -> t -> unit

Printer in Quip format (experimental)

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

Module Sidekick_base__Proof

include Sidekick_core.PROOF with type term = Sidekick_base.Base_types.Term.t and type ty = Sidekick_base.Base_types.Ty.t
type term = Sidekick_base.Base_types.Term.t
type ty = Sidekick_base.Base_types.Ty.t
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
val isa_split : ty -> term Iter.t -> t
val isa_disj : ty -> term -> term -> t
val cstor_inj : Sidekick_base.Base_types.Cstor.t -> int -> term list -> term list -> t
val bool_eq : term -> term -> t
val bool_c : string -> term list -> t
val ite_true : term -> t
val ite_false : term -> t
val lra : lit Iter.t -> t
val lra_l : lit list -> t
\ No newline at end of file diff --git a/dev/sidekick-base/index.html b/dev/sidekick-base/index.html new file mode 100644 index 00000000..952ff705 --- /dev/null +++ b/dev/sidekick-base/index.html @@ -0,0 +1,2 @@ + +index (sidekick-base.index)

sidekick-base index

Library sidekick-base

The entry point of this library is the module: Sidekick_base.

\ 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 7ca4aec9..d0e3d0cc 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick-bin.Sidekick_smtlib.Process.Solver.P)

Module Solver.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/index.html index 6a40171d..03c9c0c4 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick-bin.Sidekick_smtlib.Process.Solver.Solver_internal)

Module Solver.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

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

Module Solver.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/Term/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/Term/index.html index 4265fdae..77e57ba5 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/Term/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/Term/index.html @@ -1,5 +1,5 @@ -Term (sidekick-bin.Sidekick_smtlib.Process.Solver.T.Term)

Module T.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t = Sidekick_base_term.Term.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Sidekick_base_term.Term.state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
+Term (sidekick-bin.Sidekick_smtlib.Process.Solver.T.Term)

Module T.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t = Sidekick_base.Term.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Sidekick_base.Term.state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
 let y = f x x in
 let z = g y x in
 z = z

the DAG has the following nodes:

n1: 2
diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/Ty/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/Ty/index.html
index 3a689276..8d288d31 100644
--- a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/Ty/index.html
+++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/Ty/index.html
@@ -1,2 +1,2 @@
 
-Ty (sidekick-bin.Sidekick_smtlib.Process.Solver.T.Ty)

Module T.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t = Sidekick_base_term.Ty.t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Sidekick_base_term.Ty.state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file +Ty (sidekick-bin.Sidekick_smtlib.Process.Solver.T.Ty)

Module T.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t = Sidekick_base.Ty.t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Sidekick_base.Ty.state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/index.html index 841f55b5..f79455e2 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/T/index.html @@ -1,2 +1,2 @@ -T (sidekick-bin.Sidekick_smtlib.Process.Solver.T)

Module Solver.T

module Fun : sig ... end

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end with type t = Sidekick_base_term.Ty.t and type state = Sidekick_base_term.Ty.state

Types

module Term : sig ... end with type t = Sidekick_base_term.Term.t and type state = Sidekick_base_term.Term.state

Term structure.

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

Module Solver.T

module Fun : sig ... end

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end with type t = Sidekick_base.Ty.t and type state = Sidekick_base.Ty.state

Types

module Term : sig ... end with type t = Sidekick_base.Term.t and type state = Sidekick_base.Term.state

Term structure.

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/index.html index f257d8ff..d96a46eb 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/Solver/index.html @@ -1,2 +1,2 @@ -Solver (sidekick-bin.Sidekick_smtlib.Process.Solver)

Module Process.Solver

module P : Sidekick_core.PROOF with type term = T.Term.t
module Lit : Sidekick_core.LIT with module T = T
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = Lit

Internal solver, available to theories.

type t

The solver's state.

type solver = t
type term = T.Term.t
type ty = T.Ty.t
type lit = Lit.t
type proof = P.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

type 'a theory_p = (module THEORY with type t = 'a)

A theory that can be used for this particular solver, with state of type 'a.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory.

module Atom : sig ... end
module Model : sig ... end

Models

module Unknown : sig ... end

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> T.Term.state
val ty_st : t -> T.Ty.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> unit -> t

Create a new solver.

It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.

parameter store_proof

if true, proofs from the SAT solver and theories are retained and potentially accessible after solve returns UNSAT.

parameter size

influences the size of initial allocations.

parameter theories

theories to load from the start. Other theories can be added using add_theory.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val add_theory_p : t -> 'a theory_p -> 'a

Add the given theory and obtain its state

val add_theory_l : t -> theory list -> unit
val mk_atom_lit : t -> lit -> Atom.t * P.t

mk_atom_lit _ lit returns atom, pr where atom is an internal atom for the solver, and pr is a proof of |- lit = atom

val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t * P.t

mk_atom_t _ ~sign t returns atom, pr where atom is an internal representation of ± t, and pr is a proof of |- atom = (± t)

val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unit

add_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.

val add_clause_l : t -> Atom.t list -> P.t -> unit

Add a clause to the solver, given as a list.

module Pre_proof : sig ... end
type res =
| Sat of Model.t

Satisfiable

| Unsat of {
proof : Pre_proof.t option lazy_t;

proof of unsat

unsat_core : Atom.t list lazy_t;

subset of assumptions responsible for unsat

}

Unsatisfiable

| Unknown of Unknown.t

Unknown, obtained after a timeout, memory limit, etc.

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> ?⁠on_progress:(t -> unit) -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the clauses added so far to s.

parameter check

if true, the model is checked before returning.

parameter on_progress

called regularly during solving.

parameter assumptions

a set of atoms held to be true. The unsat core, if any, will be a subset of assumptions.

parameter on_exit

functions to be run before this returns

val pp_stats : t CCFormat.printer

Print some statistics. What it prints exactly is unspecified.

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

Module Process.Solver

module P : Sidekick_core.PROOF with type term = T.Term.t
module Lit : Sidekick_core.LIT with module T = T
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = Lit

Internal solver, available to theories.

type t

The solver's state.

type solver = t
type term = T.Term.t
type ty = T.Ty.t
type lit = Lit.t
type proof = P.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

type 'a theory_p = (module THEORY with type t = 'a)

A theory that can be used for this particular solver, with state of type 'a.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory.

module Atom : sig ... end
module Model : sig ... end

Models

module Unknown : sig ... end

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> T.Term.state
val ty_st : t -> T.Ty.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> unit -> t

Create a new solver.

It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.

parameter store_proof

if true, proofs from the SAT solver and theories are retained and potentially accessible after solve returns UNSAT.

parameter size

influences the size of initial allocations.

parameter theories

theories to load from the start. Other theories can be added using add_theory.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val add_theory_p : t -> 'a theory_p -> 'a

Add the given theory and obtain its state

val add_theory_l : t -> theory list -> unit
val mk_atom_lit : t -> lit -> Atom.t * P.t

mk_atom_lit _ lit returns atom, pr where atom is an internal atom for the solver, and pr is a proof of |- lit = atom

val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t * P.t

mk_atom_t _ ~sign t returns atom, pr where atom is an internal representation of ± t, and pr is a proof of |- atom = (± t)

val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unit

add_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.

val add_clause_l : t -> Atom.t list -> P.t -> unit

Add a clause to the solver, given as a list.

module Pre_proof : sig ... end
type res =
| Sat of Model.t

Satisfiable

| Unsat of {
proof : Pre_proof.t option lazy_t;

proof of unsat

unsat_core : Atom.t list lazy_t;

subset of assumptions responsible for unsat

}

Unsatisfiable

| Unknown of Unknown.t

Unknown, obtained after a timeout, memory limit, etc.

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> ?⁠on_progress:(t -> unit) -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the clauses added so far to s.

parameter check

if true, the model is checked before returning.

parameter on_progress

called regularly during solving.

parameter assumptions

a set of atoms held to be true. The unsat core, if any, will be a subset of assumptions.

parameter on_exit

functions to be run before this returns

val pp_stats : t CCFormat.printer

Print some statistics. What it prints exactly is unspecified.

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/Process/index.html b/dev/sidekick-bin/Sidekick_smtlib/Process/index.html index 7459d840..85e41998 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/Process/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/Process/index.html @@ -1,2 +1,2 @@ -Process (sidekick-bin.Sidekick_smtlib.Process)

Module Sidekick_smtlib.Process

Process Statements

val th_bool : Solver.theory
val th_data : Solver.theory
val th_lra : Solver.theory
type 'a or_error = ('a, string) CCResult.t
module Check_cc : sig ... end
val process_stmt : ?⁠hyps:Solver.Atom.t list Sidekick_util.Vec.t -> ?⁠gc:bool -> ?⁠restarts:bool -> ?⁠pp_cnf:bool -> ?⁠dot_proof:string -> ?⁠proof_file:string -> ?⁠pp_model:bool -> ?⁠check:bool -> ?⁠time:float -> ?⁠memory:float -> ?⁠progress:bool -> Solver.t -> Sidekick_base_term.Statement.t -> unit or_error
\ No newline at end of file +Process (sidekick-bin.Sidekick_smtlib.Process)

Module Sidekick_smtlib.Process

Process Statements

val th_bool : Solver.theory
val th_data : Solver.theory
val th_lra : Solver.theory
type 'a or_error = ('a, string) CCResult.t
module Check_cc : sig ... end
val process_stmt : ?⁠hyps:Solver.Atom.t list Sidekick_util.Vec.t -> ?⁠gc:bool -> ?⁠restarts:bool -> ?⁠pp_cnf:bool -> ?⁠dot_proof:string -> ?⁠proof_file:string -> ?⁠pp_model:bool -> ?⁠check:bool -> ?⁠time:float -> ?⁠memory:float -> ?⁠progress:bool -> Solver.t -> Sidekick_base.Statement.t -> unit or_error
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib/index.html b/dev/sidekick-bin/Sidekick_smtlib/index.html index 0aa6373c..2dc5ae19 100644 --- a/dev/sidekick-bin/Sidekick_smtlib/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib/index.html @@ -1,2 +1,2 @@ -Sidekick_smtlib (sidekick-bin.Sidekick_smtlib)

Module Sidekick_smtlib

SMTLib-2 Interface

type 'a or_error = ('a, string) CCResult.t
module Process : sig ... end
module Solver = Process.Solver
val parse : Term.state -> string -> Stmt.t list or_error
val parse_stdin : Term.state -> Stmt.t list or_error
\ No newline at end of file +Sidekick_smtlib (sidekick-bin.Sidekick_smtlib)

Module Sidekick_smtlib

SMTLib-2 Interface

type 'a or_error = ('a, string) CCResult.t
module Term = Sidekick_base.Term
module Process : sig ... end
module Solver = Process.Solver
val parse : Term.state -> string -> Stmt.t list or_error
val parse_stdin : Term.state -> Stmt.t list or_error
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__/Form/Funs/index.html b/dev/sidekick-bin/Sidekick_smtlib__/Form/Funs/index.html index 95f36395..4f536b5d 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__/Form/Funs/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__/Form/Funs/index.html @@ -1,2 +1,2 @@ -Funs (sidekick-bin.Sidekick_smtlib__.Form.Funs) \ No newline at end of file +Funs (sidekick-bin.Sidekick_smtlib__.Form.Funs)

Module Form.Funs

val get_ty : 'a -> 'b -> Sidekick_base.Ty.t
val abs : self:T.t -> 'a -> T.t * bool
val relevant : 'a -> 'b -> 'c -> bool
val eval : Sidekick_base.ID.t -> Sidekick_base.Value.t Sidekick_util.IArray.t -> Sidekick_base.Value.t
val mk_fun : ?⁠do_cc:bool -> Sidekick_base.ID.t -> Sidekick_base.Fun.t
val and_ : Sidekick_base.Fun.t
val or_ : Sidekick_base.Fun.t
val imply : Sidekick_base.Fun.t
val ite : Sidekick_base.Term.state -> Sidekick_base.Term.t -> Sidekick_base.Term.t -> Sidekick_base.Term.t -> Sidekick_base.Term.t
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__/Form/Gensym/index.html b/dev/sidekick-bin/Sidekick_smtlib__/Form/Gensym/index.html index a6b923e9..f31fe2cf 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__/Form/Gensym/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__/Form/Gensym/index.html @@ -1,2 +1,2 @@ -Gensym (sidekick-bin.Sidekick_smtlib__.Form.Gensym)

Module Form.Gensym

type t = {
tst : T.state;
mutable fresh : int;
}
val create : T.state -> t
val fresh_term : t -> pre:string -> Sidekick_base_term.Ty.t -> T.t
\ No newline at end of file +Gensym (sidekick-bin.Sidekick_smtlib__.Form.Gensym)

Module Form.Gensym

type t = {
tst : T.state;
mutable fresh : int;
}
val create : T.state -> t
val fresh_term : t -> pre:string -> Sidekick_base.Ty.t -> T.t
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__/Form/index.html b/dev/sidekick-bin/Sidekick_smtlib__/Form/index.html index f02ec011..794e3e96 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__/Form/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__/Form/index.html @@ -1,2 +1,2 @@ -Form (sidekick-bin.Sidekick_smtlib__.Form)

Module Sidekick_smtlib__.Form

exception Not_a_th_term
val id_and : Sidekick_base_term.ID.t
val id_or : Sidekick_base_term.ID.t
val id_imply : Sidekick_base_term.ID.t
val view_id : Sidekick_base_term.ID.t -> 'a Sidekick_util.IArray.t -> ('a'a Sidekick_util.IArray.iter) Sidekick_th_bool_static.bool_view
val view_as_bool : T.t -> (T.tT.t Sidekick_util.IArray.iter) Sidekick_th_bool_static.bool_view
module Funs : sig ... end
val as_id : Sidekick_base_term.ID.t -> T.t -> T.t Sidekick_util.IArray.t option
val flatten_id : Sidekick_base_term.ID.t -> bool -> T.t list -> T.t list
val and_l : T.state -> T.t list -> T.t
val or_l : T.state -> T.t list -> T.t
val and_ : T.state -> T.t -> T.t -> T.t
val or_ : T.state -> T.t -> T.t -> T.t
val and_a : T.state -> T.t Sidekick_util.IArray.t -> T.t
val or_a : T.state -> T.t Sidekick_util.IArray.t -> T.t
val eq : T.state -> T.t -> T.t -> T.t
val not_ : T.state -> T.t -> T.t
val ite : T.state -> T.t -> T.t -> T.t -> T.t
val equiv : T.state -> T.t -> T.t -> T.t
val neq : T.state -> T.t -> T.t -> T.t
val imply_a : T.state -> T.t Sidekick_util.IArray.t -> T.t -> T.t
val imply_l : T.state -> T.t list -> T.t -> T.t
val imply : T.state -> T.t -> T.t -> T.t
val xor : T.state -> T.t -> T.t -> T.t
val distinct_l : T.state -> T.t CCList.t -> T.t
val mk_bool : T.state -> (T.tT.t Sidekick_util.IArray.t) Sidekick_th_bool_static.bool_view -> T.t
module Gensym : sig ... end
val check_congruence_classes : bool
\ No newline at end of file +Form (sidekick-bin.Sidekick_smtlib__.Form)

Module Sidekick_smtlib__.Form

exception Not_a_th_term
val id_and : Sidekick_base.ID.t
val id_or : Sidekick_base.ID.t
val id_imply : Sidekick_base.ID.t
val view_id : Sidekick_base.ID.t -> 'a Sidekick_util.IArray.t -> ('a'a Sidekick_util.IArray.iter) Sidekick_th_bool_static.bool_view
val view_as_bool : T.t -> (T.tT.t Sidekick_util.IArray.iter) Sidekick_th_bool_static.bool_view
module Funs : sig ... end
val as_id : Sidekick_base.ID.t -> T.t -> T.t Sidekick_util.IArray.t option
val flatten_id : Sidekick_base.ID.t -> bool -> T.t list -> T.t list
val and_l : T.state -> T.t list -> T.t
val or_l : T.state -> T.t list -> T.t
val and_ : T.state -> T.t -> T.t -> T.t
val or_ : T.state -> T.t -> T.t -> T.t
val and_a : T.state -> T.t Sidekick_util.IArray.t -> T.t
val or_a : T.state -> T.t Sidekick_util.IArray.t -> T.t
val eq : T.state -> T.t -> T.t -> T.t
val not_ : T.state -> T.t -> T.t
val ite : T.state -> T.t -> T.t -> T.t -> T.t
val equiv : T.state -> T.t -> T.t -> T.t
val neq : T.state -> T.t -> T.t -> T.t
val imply_a : T.state -> T.t Sidekick_util.IArray.t -> T.t -> T.t
val imply_l : T.state -> T.t list -> T.t -> T.t
val imply : T.state -> T.t -> T.t -> T.t
val xor : T.state -> T.t -> T.t -> T.t
val distinct_l : T.state -> T.t CCList.t -> T.t
val mk_bool : T.state -> (T.tT.t Sidekick_util.IArray.t) Sidekick_th_bool_static.bool_view -> T.t
module Gensym : sig ... end
val check_congruence_classes : bool
\ 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 104df3e2..0fb1fe98 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick-bin.Sidekick_smtlib__.Process.Solver.P)

Module Solver.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/Solver_internal/index.html b/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/Solver_internal/index.html index 6a024843..956deaf8 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/Solver_internal/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick-bin.Sidekick_smtlib__.Process.Solver.Solver_internal)

Module Solver.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

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

Module Solver.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/T/Term/index.html b/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/T/Term/index.html index 482b4eb6..1ef3b049 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/T/Term/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/T/Term/index.html @@ -1,5 +1,5 @@ -Term (sidekick-bin.Sidekick_smtlib__.Process.Solver.T.Term)

Module T.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t = Sidekick_base_term.Term.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Sidekick_base_term.Term.state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
+Term (sidekick-bin.Sidekick_smtlib__.Process.Solver.T.Term)

Module T.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t = Sidekick_base.Term.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Sidekick_base.Term.state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
 let y = f x x in
 let z = g y x in
 z = z

the DAG has the following nodes:

n1: 2
diff --git a/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/T/Ty/index.html b/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/T/Ty/index.html
index 2a4db782..ba71f4e2 100644
--- a/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/T/Ty/index.html
+++ b/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/T/Ty/index.html
@@ -1,2 +1,2 @@
 
-Ty (sidekick-bin.Sidekick_smtlib__.Process.Solver.T.Ty)

Module T.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t = Sidekick_base_term.Ty.t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Sidekick_base_term.Ty.state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file +Ty (sidekick-bin.Sidekick_smtlib__.Process.Solver.T.Ty)

Module T.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t = Sidekick_base.Ty.t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Sidekick_base.Ty.state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/T/index.html b/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/T/index.html index 28fc3a8c..114f5b33 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/T/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/T/index.html @@ -1,2 +1,2 @@ -T (sidekick-bin.Sidekick_smtlib__.Process.Solver.T)

Module Solver.T

module Fun : sig ... end

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end with type t = Sidekick_base_term.Ty.t and type state = Sidekick_base_term.Ty.state

Types

module Term : sig ... end with type t = Sidekick_base_term.Term.t and type state = Sidekick_base_term.Term.state

Term structure.

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

Module Solver.T

module Fun : sig ... end

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end with type t = Sidekick_base.Ty.t and type state = Sidekick_base.Ty.state

Types

module Term : sig ... end with type t = Sidekick_base.Term.t and type state = Sidekick_base.Term.state

Term structure.

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/index.html b/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/index.html index 29373542..91fae815 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__/Process/Solver/index.html @@ -1,2 +1,2 @@ -Solver (sidekick-bin.Sidekick_smtlib__.Process.Solver)

Module Process.Solver

module P : Sidekick_core.PROOF with type term = T.Term.t
module Lit : Sidekick_core.LIT with module T = T
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = Lit

Internal solver, available to theories.

type t

The solver's state.

type solver = t
type term = T.Term.t
type ty = T.Ty.t
type lit = Lit.t
type proof = P.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

type 'a theory_p = (module THEORY with type t = 'a)

A theory that can be used for this particular solver, with state of type 'a.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory.

module Atom : sig ... end
module Model : sig ... end

Models

module Unknown : sig ... end

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> T.Term.state
val ty_st : t -> T.Ty.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> unit -> t

Create a new solver.

It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.

parameter store_proof

if true, proofs from the SAT solver and theories are retained and potentially accessible after solve returns UNSAT.

parameter size

influences the size of initial allocations.

parameter theories

theories to load from the start. Other theories can be added using add_theory.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val add_theory_p : t -> 'a theory_p -> 'a

Add the given theory and obtain its state

val add_theory_l : t -> theory list -> unit
val mk_atom_lit : t -> lit -> Atom.t * P.t

mk_atom_lit _ lit returns atom, pr where atom is an internal atom for the solver, and pr is a proof of |- lit = atom

val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t * P.t

mk_atom_t _ ~sign t returns atom, pr where atom is an internal representation of ± t, and pr is a proof of |- atom = (± t)

val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unit

add_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.

val add_clause_l : t -> Atom.t list -> P.t -> unit

Add a clause to the solver, given as a list.

module Pre_proof : sig ... end
type res =
| Sat of Model.t

Satisfiable

| Unsat of {
proof : Pre_proof.t option lazy_t;

proof of unsat

unsat_core : Atom.t list lazy_t;

subset of assumptions responsible for unsat

}

Unsatisfiable

| Unknown of Unknown.t

Unknown, obtained after a timeout, memory limit, etc.

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> ?⁠on_progress:(t -> unit) -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the clauses added so far to s.

parameter check

if true, the model is checked before returning.

parameter on_progress

called regularly during solving.

parameter assumptions

a set of atoms held to be true. The unsat core, if any, will be a subset of assumptions.

parameter on_exit

functions to be run before this returns

val pp_stats : t CCFormat.printer

Print some statistics. What it prints exactly is unspecified.

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

Module Process.Solver

module P : Sidekick_core.PROOF with type term = T.Term.t
module Lit : Sidekick_core.LIT with module T = T
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = Lit

Internal solver, available to theories.

type t

The solver's state.

type solver = t
type term = T.Term.t
type ty = T.Ty.t
type lit = Lit.t
type proof = P.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

type 'a theory_p = (module THEORY with type t = 'a)

A theory that can be used for this particular solver, with state of type 'a.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory.

module Atom : sig ... end
module Model : sig ... end

Models

module Unknown : sig ... end

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> T.Term.state
val ty_st : t -> T.Ty.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> unit -> t

Create a new solver.

It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.

parameter store_proof

if true, proofs from the SAT solver and theories are retained and potentially accessible after solve returns UNSAT.

parameter size

influences the size of initial allocations.

parameter theories

theories to load from the start. Other theories can be added using add_theory.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val add_theory_p : t -> 'a theory_p -> 'a

Add the given theory and obtain its state

val add_theory_l : t -> theory list -> unit
val mk_atom_lit : t -> lit -> Atom.t * P.t

mk_atom_lit _ lit returns atom, pr where atom is an internal atom for the solver, and pr is a proof of |- lit = atom

val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t * P.t

mk_atom_t _ ~sign t returns atom, pr where atom is an internal representation of ± t, and pr is a proof of |- atom = (± t)

val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unit

add_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.

val add_clause_l : t -> Atom.t list -> P.t -> unit

Add a clause to the solver, given as a list.

module Pre_proof : sig ... end
type res =
| Sat of Model.t

Satisfiable

| Unsat of {
proof : Pre_proof.t option lazy_t;

proof of unsat

unsat_core : Atom.t list lazy_t;

subset of assumptions responsible for unsat

}

Unsatisfiable

| Unknown of Unknown.t

Unknown, obtained after a timeout, memory limit, etc.

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> ?⁠on_progress:(t -> unit) -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the clauses added so far to s.

parameter check

if true, the model is checked before returning.

parameter on_progress

called regularly during solving.

parameter assumptions

a set of atoms held to be true. The unsat core, if any, will be a subset of assumptions.

parameter on_exit

functions to be run before this returns

val pp_stats : t CCFormat.printer

Print some statistics. What it prints exactly is unspecified.

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__/Process/index.html b/dev/sidekick-bin/Sidekick_smtlib__/Process/index.html index 20c13fbb..05218ce1 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__/Process/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__/Process/index.html @@ -1,2 +1,2 @@ -Process (sidekick-bin.Sidekick_smtlib__.Process)

Module Sidekick_smtlib__.Process

Process Statements

val th_bool : Solver.theory
val th_data : Solver.theory
val th_lra : Solver.theory
type 'a or_error = ('a, string) CCResult.t
module Check_cc : sig ... end
val process_stmt : ?⁠hyps:Solver.Atom.t list Sidekick_util.Vec.t -> ?⁠gc:bool -> ?⁠restarts:bool -> ?⁠pp_cnf:bool -> ?⁠dot_proof:string -> ?⁠proof_file:string -> ?⁠pp_model:bool -> ?⁠check:bool -> ?⁠time:float -> ?⁠memory:float -> ?⁠progress:bool -> Solver.t -> Sidekick_base_term.Statement.t -> unit or_error
\ No newline at end of file +Process (sidekick-bin.Sidekick_smtlib__.Process)

Module Sidekick_smtlib__.Process

Process Statements

val th_bool : Solver.theory
val th_data : Solver.theory
val th_lra : Solver.theory
type 'a or_error = ('a, string) CCResult.t
module Check_cc : sig ... end
val process_stmt : ?⁠hyps:Solver.Atom.t list Sidekick_util.Vec.t -> ?⁠gc:bool -> ?⁠restarts:bool -> ?⁠pp_cnf:bool -> ?⁠dot_proof:string -> ?⁠proof_file:string -> ?⁠pp_model:bool -> ?⁠check:bool -> ?⁠time:float -> ?⁠memory:float -> ?⁠progress:bool -> Solver.t -> Sidekick_base.Statement.t -> unit or_error
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__/Typecheck/Ctx/index.html b/dev/sidekick-bin/Sidekick_smtlib__/Typecheck/Ctx/index.html index 500a3955..dc9c4b93 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__/Typecheck/Ctx/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__/Typecheck/Ctx/index.html @@ -1,2 +1,2 @@ -Ctx (sidekick-bin.Sidekick_smtlib__.Typecheck.Ctx)

Module Typecheck.Ctx

type t
val create : T.state -> t
\ No newline at end of file +Ctx (sidekick-bin.Sidekick_smtlib__.Typecheck.Ctx)

Module Typecheck.Ctx

type t
val create : T.state -> t
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__/Typecheck/index.html b/dev/sidekick-bin/Sidekick_smtlib__/Typecheck/index.html index ad0a3897..85b7c521 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__/Typecheck/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__/Typecheck/index.html @@ -1,2 +1,2 @@ -Typecheck (sidekick-bin.Sidekick_smtlib__.Typecheck)

Module Sidekick_smtlib__.Typecheck

Preprocessing AST

module Loc = Smtlib_utils.V_2_6.Loc
module PA = Smtlib_utils.V_2_6.Ast
type 'a or_error = ('a, string) CCResult.t

Parsing and Typing

module Ctx : sig ... end
val conv_term : Ctx.t -> PA.term -> T.t
val conv_statement : Ctx.t -> PA.statement -> Stmt.t list
\ No newline at end of file +Typecheck (sidekick-bin.Sidekick_smtlib__.Typecheck)

Module Sidekick_smtlib__.Typecheck

Preprocessing AST

module Loc = Smtlib_utils.V_2_6.Loc
module PA = Smtlib_utils.V_2_6.Ast
type 'a or_error = ('a, string) CCResult.t

Parsing and Typing

module Ctx : sig ... end
val conv_term : Ctx.t -> PA.term -> T.t
val conv_statement : Ctx.t -> PA.statement -> Stmt.t list
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__Form/Funs/index.html b/dev/sidekick-bin/Sidekick_smtlib__Form/Funs/index.html index 6da961a9..4bc65fc1 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__Form/Funs/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__Form/Funs/index.html @@ -1,2 +1,2 @@ -Funs (sidekick-bin.Sidekick_smtlib__Form.Funs) \ No newline at end of file +Funs (sidekick-bin.Sidekick_smtlib__Form.Funs)

Module Sidekick_smtlib__Form.Funs

val get_ty : 'a -> 'b -> Sidekick_base.Ty.t
val abs : self:T.t -> 'a -> T.t * bool
val relevant : 'a -> 'b -> 'c -> bool
val eval : Sidekick_base.ID.t -> Sidekick_base.Value.t Sidekick_util.IArray.t -> Sidekick_base.Value.t
val mk_fun : ?⁠do_cc:bool -> Sidekick_base.ID.t -> Sidekick_base.Fun.t
val and_ : Sidekick_base.Fun.t
val or_ : Sidekick_base.Fun.t
val imply : Sidekick_base.Fun.t
val ite : Sidekick_base.Term.state -> Sidekick_base.Term.t -> Sidekick_base.Term.t -> Sidekick_base.Term.t -> Sidekick_base.Term.t
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__Form/Gensym/index.html b/dev/sidekick-bin/Sidekick_smtlib__Form/Gensym/index.html index 14cd4f04..0f996495 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__Form/Gensym/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__Form/Gensym/index.html @@ -1,2 +1,2 @@ -Gensym (sidekick-bin.Sidekick_smtlib__Form.Gensym)

Module Sidekick_smtlib__Form.Gensym

type t = {
tst : T.state;
mutable fresh : int;
}
val create : T.state -> t
val fresh_term : t -> pre:string -> Sidekick_base_term.Ty.t -> T.t
\ No newline at end of file +Gensym (sidekick-bin.Sidekick_smtlib__Form.Gensym)

Module Sidekick_smtlib__Form.Gensym

type t = {
tst : T.state;
mutable fresh : int;
}
val create : T.state -> t
val fresh_term : t -> pre:string -> Sidekick_base.Ty.t -> T.t
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__Form/index.html b/dev/sidekick-bin/Sidekick_smtlib__Form/index.html index 1fddcf2e..525ba85b 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__Form/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__Form/index.html @@ -1,2 +1,2 @@ -Sidekick_smtlib__Form (sidekick-bin.Sidekick_smtlib__Form)

Module Sidekick_smtlib__Form

exception Not_a_th_term
val id_and : Sidekick_base_term.ID.t
val id_or : Sidekick_base_term.ID.t
val id_imply : Sidekick_base_term.ID.t
val view_id : Sidekick_base_term.ID.t -> 'a Sidekick_util.IArray.t -> ('a'a Sidekick_util.IArray.iter) Sidekick_th_bool_static.bool_view
val view_as_bool : T.t -> (T.tT.t Sidekick_util.IArray.iter) Sidekick_th_bool_static.bool_view
module Funs : sig ... end
val as_id : Sidekick_base_term.ID.t -> T.t -> T.t Sidekick_util.IArray.t option
val flatten_id : Sidekick_base_term.ID.t -> bool -> T.t list -> T.t list
val and_l : T.state -> T.t list -> T.t
val or_l : T.state -> T.t list -> T.t
val and_ : T.state -> T.t -> T.t -> T.t
val or_ : T.state -> T.t -> T.t -> T.t
val and_a : T.state -> T.t Sidekick_util.IArray.t -> T.t
val or_a : T.state -> T.t Sidekick_util.IArray.t -> T.t
val eq : T.state -> T.t -> T.t -> T.t
val not_ : T.state -> T.t -> T.t
val ite : T.state -> T.t -> T.t -> T.t -> T.t
val equiv : T.state -> T.t -> T.t -> T.t
val neq : T.state -> T.t -> T.t -> T.t
val imply_a : T.state -> T.t Sidekick_util.IArray.t -> T.t -> T.t
val imply_l : T.state -> T.t list -> T.t -> T.t
val imply : T.state -> T.t -> T.t -> T.t
val xor : T.state -> T.t -> T.t -> T.t
val distinct_l : T.state -> T.t CCList.t -> T.t
val mk_bool : T.state -> (T.tT.t Sidekick_util.IArray.t) Sidekick_th_bool_static.bool_view -> T.t
module Gensym : sig ... end
val check_congruence_classes : bool
\ No newline at end of file +Sidekick_smtlib__Form (sidekick-bin.Sidekick_smtlib__Form)

Module Sidekick_smtlib__Form

exception Not_a_th_term
val id_and : Sidekick_base.ID.t
val id_or : Sidekick_base.ID.t
val id_imply : Sidekick_base.ID.t
val view_id : Sidekick_base.ID.t -> 'a Sidekick_util.IArray.t -> ('a'a Sidekick_util.IArray.iter) Sidekick_th_bool_static.bool_view
val view_as_bool : T.t -> (T.tT.t Sidekick_util.IArray.iter) Sidekick_th_bool_static.bool_view
module Funs : sig ... end
val as_id : Sidekick_base.ID.t -> T.t -> T.t Sidekick_util.IArray.t option
val flatten_id : Sidekick_base.ID.t -> bool -> T.t list -> T.t list
val and_l : T.state -> T.t list -> T.t
val or_l : T.state -> T.t list -> T.t
val and_ : T.state -> T.t -> T.t -> T.t
val or_ : T.state -> T.t -> T.t -> T.t
val and_a : T.state -> T.t Sidekick_util.IArray.t -> T.t
val or_a : T.state -> T.t Sidekick_util.IArray.t -> T.t
val eq : T.state -> T.t -> T.t -> T.t
val not_ : T.state -> T.t -> T.t
val ite : T.state -> T.t -> T.t -> T.t -> T.t
val equiv : T.state -> T.t -> T.t -> T.t
val neq : T.state -> T.t -> T.t -> T.t
val imply_a : T.state -> T.t Sidekick_util.IArray.t -> T.t -> T.t
val imply_l : T.state -> T.t list -> T.t -> T.t
val imply : T.state -> T.t -> T.t -> T.t
val xor : T.state -> T.t -> T.t -> T.t
val distinct_l : T.state -> T.t CCList.t -> T.t
val mk_bool : T.state -> (T.tT.t Sidekick_util.IArray.t) Sidekick_th_bool_static.bool_view -> T.t
module Gensym : sig ... end
val check_congruence_classes : bool
\ 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 94da99a9..e07888ae 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick-bin.Sidekick_smtlib__Process.Solver.P)

Module Solver.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/Solver_internal/index.html b/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/Solver_internal/index.html index 9c0ad11e..93345163 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/Solver_internal/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick-bin.Sidekick_smtlib__Process.Solver.Solver_internal)

Module Solver.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick-bin.Sidekick_smtlib__Process.Solver.Solver_internal)

Module Solver.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/T/Term/index.html b/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/T/Term/index.html index 36238d0e..2f92b3e8 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/T/Term/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/T/Term/index.html @@ -1,5 +1,5 @@ -Term (sidekick-bin.Sidekick_smtlib__Process.Solver.T.Term)

Module T.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t = Sidekick_base_term.Term.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Sidekick_base_term.Term.state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
+Term (sidekick-bin.Sidekick_smtlib__Process.Solver.T.Term)

Module T.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t = Sidekick_base.Term.t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Sidekick_base.Term.state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
 let y = f x x in
 let z = g y x in
 z = z

the DAG has the following nodes:

n1: 2
diff --git a/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/T/Ty/index.html b/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/T/Ty/index.html
index 8ddfb169..51cf0f3a 100644
--- a/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/T/Ty/index.html
+++ b/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/T/Ty/index.html
@@ -1,2 +1,2 @@
 
-Ty (sidekick-bin.Sidekick_smtlib__Process.Solver.T.Ty)

Module T.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t = Sidekick_base_term.Ty.t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Sidekick_base_term.Ty.state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file +Ty (sidekick-bin.Sidekick_smtlib__Process.Solver.T.Ty)

Module T.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t = Sidekick_base.Ty.t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state = Sidekick_base.Ty.state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/T/index.html b/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/T/index.html index 30e17a26..1fc2cf78 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/T/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/T/index.html @@ -1,2 +1,2 @@ -T (sidekick-bin.Sidekick_smtlib__Process.Solver.T)

Module Solver.T

module Fun : sig ... end

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end with type t = Sidekick_base_term.Ty.t and type state = Sidekick_base_term.Ty.state

Types

module Term : sig ... end with type t = Sidekick_base_term.Term.t and type state = Sidekick_base_term.Term.state

Term structure.

\ No newline at end of file +T (sidekick-bin.Sidekick_smtlib__Process.Solver.T)

Module Solver.T

module Fun : sig ... end

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end with type t = Sidekick_base.Ty.t and type state = Sidekick_base.Ty.state

Types

module Term : sig ... end with type t = Sidekick_base.Term.t and type state = Sidekick_base.Term.state

Term structure.

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/index.html b/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/index.html index f6c62ab0..c986e46c 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__Process/Solver/index.html @@ -1,2 +1,2 @@ -Solver (sidekick-bin.Sidekick_smtlib__Process.Solver)

Module Sidekick_smtlib__Process.Solver

module P : Sidekick_core.PROOF with type term = T.Term.t
module Lit : Sidekick_core.LIT with module T = T
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = Lit

Internal solver, available to theories.

type t

The solver's state.

type solver = t
type term = T.Term.t
type ty = T.Ty.t
type lit = Lit.t
type proof = P.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

type 'a theory_p = (module THEORY with type t = 'a)

A theory that can be used for this particular solver, with state of type 'a.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory.

module Atom : sig ... end
module Model : sig ... end

Models

module Unknown : sig ... end

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> T.Term.state
val ty_st : t -> T.Ty.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> unit -> t

Create a new solver.

It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.

parameter store_proof

if true, proofs from the SAT solver and theories are retained and potentially accessible after solve returns UNSAT.

parameter size

influences the size of initial allocations.

parameter theories

theories to load from the start. Other theories can be added using add_theory.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val add_theory_p : t -> 'a theory_p -> 'a

Add the given theory and obtain its state

val add_theory_l : t -> theory list -> unit
val mk_atom_lit : t -> lit -> Atom.t * P.t

mk_atom_lit _ lit returns atom, pr where atom is an internal atom for the solver, and pr is a proof of |- lit = atom

val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t * P.t

mk_atom_t _ ~sign t returns atom, pr where atom is an internal representation of ± t, and pr is a proof of |- atom = (± t)

val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unit

add_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.

val add_clause_l : t -> Atom.t list -> P.t -> unit

Add a clause to the solver, given as a list.

module Pre_proof : sig ... end
type res =
| Sat of Model.t

Satisfiable

| Unsat of {
proof : Pre_proof.t option lazy_t;

proof of unsat

unsat_core : Atom.t list lazy_t;

subset of assumptions responsible for unsat

}

Unsatisfiable

| Unknown of Unknown.t

Unknown, obtained after a timeout, memory limit, etc.

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> ?⁠on_progress:(t -> unit) -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the clauses added so far to s.

parameter check

if true, the model is checked before returning.

parameter on_progress

called regularly during solving.

parameter assumptions

a set of atoms held to be true. The unsat core, if any, will be a subset of assumptions.

parameter on_exit

functions to be run before this returns

val pp_stats : t CCFormat.printer

Print some statistics. What it prints exactly is unspecified.

\ No newline at end of file +Solver (sidekick-bin.Sidekick_smtlib__Process.Solver)

Module Sidekick_smtlib__Process.Solver

module P : Sidekick_core.PROOF with type term = T.Term.t
module Lit : Sidekick_core.LIT with module T = T
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = Lit

Internal solver, available to theories.

type t

The solver's state.

type solver = t
type term = T.Term.t
type ty = T.Ty.t
type lit = Lit.t
type proof = P.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

type 'a theory_p = (module THEORY with type t = 'a)

A theory that can be used for this particular solver, with state of type 'a.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory.

module Atom : sig ... end
module Model : sig ... end

Models

module Unknown : sig ... end

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> T.Term.state
val ty_st : t -> T.Ty.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> unit -> t

Create a new solver.

It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.

parameter store_proof

if true, proofs from the SAT solver and theories are retained and potentially accessible after solve returns UNSAT.

parameter size

influences the size of initial allocations.

parameter theories

theories to load from the start. Other theories can be added using add_theory.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val add_theory_p : t -> 'a theory_p -> 'a

Add the given theory and obtain its state

val add_theory_l : t -> theory list -> unit
val mk_atom_lit : t -> lit -> Atom.t * P.t

mk_atom_lit _ lit returns atom, pr where atom is an internal atom for the solver, and pr is a proof of |- lit = atom

val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t * P.t

mk_atom_t _ ~sign t returns atom, pr where atom is an internal representation of ± t, and pr is a proof of |- atom = (± t)

val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unit

add_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.

val add_clause_l : t -> Atom.t list -> P.t -> unit

Add a clause to the solver, given as a list.

module Pre_proof : sig ... end
type res =
| Sat of Model.t

Satisfiable

| Unsat of {
proof : Pre_proof.t option lazy_t;

proof of unsat

unsat_core : Atom.t list lazy_t;

subset of assumptions responsible for unsat

}

Unsatisfiable

| Unknown of Unknown.t

Unknown, obtained after a timeout, memory limit, etc.

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> ?⁠on_progress:(t -> unit) -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the clauses added so far to s.

parameter check

if true, the model is checked before returning.

parameter on_progress

called regularly during solving.

parameter assumptions

a set of atoms held to be true. The unsat core, if any, will be a subset of assumptions.

parameter on_exit

functions to be run before this returns

val pp_stats : t CCFormat.printer

Print some statistics. What it prints exactly is unspecified.

\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__Process/index.html b/dev/sidekick-bin/Sidekick_smtlib__Process/index.html index 168414e9..c016fa44 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__Process/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__Process/index.html @@ -1,2 +1,2 @@ -Sidekick_smtlib__Process (sidekick-bin.Sidekick_smtlib__Process)

Module Sidekick_smtlib__Process

Process Statements

val th_bool : Solver.theory
val th_data : Solver.theory
val th_lra : Solver.theory
type 'a or_error = ('a, string) CCResult.t
module Check_cc : sig ... end
val process_stmt : ?⁠hyps:Solver.Atom.t list Sidekick_util.Vec.t -> ?⁠gc:bool -> ?⁠restarts:bool -> ?⁠pp_cnf:bool -> ?⁠dot_proof:string -> ?⁠proof_file:string -> ?⁠pp_model:bool -> ?⁠check:bool -> ?⁠time:float -> ?⁠memory:float -> ?⁠progress:bool -> Solver.t -> Sidekick_base_term.Statement.t -> unit or_error
\ No newline at end of file +Sidekick_smtlib__Process (sidekick-bin.Sidekick_smtlib__Process)

Module Sidekick_smtlib__Process

Process Statements

val th_bool : Solver.theory
val th_data : Solver.theory
val th_lra : Solver.theory
type 'a or_error = ('a, string) CCResult.t
module Check_cc : sig ... end
val process_stmt : ?⁠hyps:Solver.Atom.t list Sidekick_util.Vec.t -> ?⁠gc:bool -> ?⁠restarts:bool -> ?⁠pp_cnf:bool -> ?⁠dot_proof:string -> ?⁠proof_file:string -> ?⁠pp_model:bool -> ?⁠check:bool -> ?⁠time:float -> ?⁠memory:float -> ?⁠progress:bool -> Solver.t -> Sidekick_base.Statement.t -> unit or_error
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__Typecheck/Ctx/index.html b/dev/sidekick-bin/Sidekick_smtlib__Typecheck/Ctx/index.html index 46d9067d..9f207d14 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__Typecheck/Ctx/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__Typecheck/Ctx/index.html @@ -1,2 +1,2 @@ -Ctx (sidekick-bin.Sidekick_smtlib__Typecheck.Ctx)

Module Sidekick_smtlib__Typecheck.Ctx

type t
val create : T.state -> t
\ No newline at end of file +Ctx (sidekick-bin.Sidekick_smtlib__Typecheck.Ctx)

Module Sidekick_smtlib__Typecheck.Ctx

type t
val create : T.state -> t
\ No newline at end of file diff --git a/dev/sidekick-bin/Sidekick_smtlib__Typecheck/index.html b/dev/sidekick-bin/Sidekick_smtlib__Typecheck/index.html index 6dc919c0..a2f142dd 100644 --- a/dev/sidekick-bin/Sidekick_smtlib__Typecheck/index.html +++ b/dev/sidekick-bin/Sidekick_smtlib__Typecheck/index.html @@ -1,2 +1,2 @@ -Sidekick_smtlib__Typecheck (sidekick-bin.Sidekick_smtlib__Typecheck)

Module Sidekick_smtlib__Typecheck

Preprocessing AST

module Loc = Smtlib_utils.V_2_6.Loc
module PA = Smtlib_utils.V_2_6.Ast
type 'a or_error = ('a, string) CCResult.t

Parsing and Typing

module Ctx : sig ... end
val conv_term : Ctx.t -> PA.term -> T.t
val conv_statement : Ctx.t -> PA.statement -> Stmt.t list
\ No newline at end of file +Sidekick_smtlib__Typecheck (sidekick-bin.Sidekick_smtlib__Typecheck)

Module Sidekick_smtlib__Typecheck

Preprocessing AST

module Loc = Smtlib_utils.V_2_6.Loc
module PA = Smtlib_utils.V_2_6.Ast
type 'a or_error = ('a, string) CCResult.t

Parsing and Typing

module Ctx : sig ... end
val conv_term : Ctx.t -> PA.term -> T.t
val conv_statement : Ctx.t -> PA.statement -> Stmt.t list
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Base_types/.dune-keep b/dev/sidekick/Sidekick_arith/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_base_term__Base_types/.dune-keep rename to dev/sidekick/Sidekick_arith/.dune-keep diff --git a/dev/sidekick/Sidekick_arith/index.html b/dev/sidekick/Sidekick_arith/index.html new file mode 100644 index 00000000..73460aa5 --- /dev/null +++ b/dev/sidekick/Sidekick_arith/index.html @@ -0,0 +1,2 @@ + +Sidekick_arith (sidekick.Sidekick_arith)

Module Sidekick_arith

module type NUM = sig ... end
module type INT = sig ... end
module type RATIONAL = sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith/module-type-INT/index.html b/dev/sidekick/Sidekick_arith/module-type-INT/index.html new file mode 100644 index 00000000..55c909ee --- /dev/null +++ b/dev/sidekick/Sidekick_arith/module-type-INT/index.html @@ -0,0 +1,2 @@ + +INT (sidekick.Sidekick_arith.INT)

Module type Sidekick_arith.INT

include NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val succ : t -> t
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith/module-type-NUM/index.html b/dev/sidekick/Sidekick_arith/module-type-NUM/index.html new file mode 100644 index 00000000..61380d24 --- /dev/null +++ b/dev/sidekick/Sidekick_arith/module-type-NUM/index.html @@ -0,0 +1,2 @@ + +NUM (sidekick.Sidekick_arith.NUM)

Module type Sidekick_arith.NUM

type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith/module-type-RATIONAL/index.html b/dev/sidekick/Sidekick_arith/module-type-RATIONAL/index.html new file mode 100644 index 00000000..10b14215 --- /dev/null +++ b/dev/sidekick/Sidekick_arith/module-type-RATIONAL/index.html @@ -0,0 +1,2 @@ + +RATIONAL (sidekick.Sidekick_arith.RATIONAL)

Module type Sidekick_arith.RATIONAL

include NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__CCHet/.dune-keep b/dev/sidekick/Sidekick_arith_lra/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_base_term__CCHet/.dune-keep rename to dev/sidekick/Sidekick_arith_lra/.dune-keep diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Comb/Infix/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Comb/Infix/index.html new file mode 100644 index 00000000..4d266be4 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Comb/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra.Linear_expr.Make.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Comb/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Comb/index.html new file mode 100644 index 00000000..35704084 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Comb/index.html @@ -0,0 +1,2 @@ + +Comb (sidekick.Sidekick_arith_lra.Linear_expr.Make.Comb)

Module Make.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Constr/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Constr/index.html new file mode 100644 index 00000000..ee05d4ed --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Constr/index.html @@ -0,0 +1,2 @@ + +Constr (sidekick.Sidekick_arith_lra.Linear_expr.Make.Constr)

Module Make.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Expr/Infix/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Expr/Infix/index.html new file mode 100644 index 00000000..26eb1a0f --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Expr/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra.Linear_expr.Make.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Expr/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Expr/index.html new file mode 100644 index 00000000..ee9dc91d --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/Expr/index.html @@ -0,0 +1,2 @@ + +Expr (sidekick.Sidekick_arith_lra.Linear_expr.Make.Expr)

Module Make.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/argument-1-C/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/argument-1-C/index.html new file mode 100644 index 00000000..1db2e8c2 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/argument-1-C/index.html @@ -0,0 +1,2 @@ + +1-C (sidekick.Sidekick_arith_lra.Linear_expr.Make.1-C)

Parameter Make.1-C

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/argument-2-Var/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/argument-2-Var/index.html new file mode 100644 index 00000000..1f02a29f --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/argument-2-Var/index.html @@ -0,0 +1,2 @@ + +2-Var (sidekick.Sidekick_arith_lra.Linear_expr.Make.2-Var)

Parameter Make.2-Var

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/index.html new file mode 100644 index 00000000..bea3c147 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/Make/index.html @@ -0,0 +1,2 @@ + +Make (sidekick.Sidekick_arith_lra.Linear_expr.Make)

Module Linear_expr.Make

Parameters

Signature

module C = C

Coeficients used. Can be integers as well as rationals.

module Var = Var

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map = CCMap.Make(Var)

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/index.html new file mode 100644 index 00000000..69747d0e --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/index.html @@ -0,0 +1,2 @@ + +Linear_expr (sidekick.Sidekick_arith_lra.Linear_expr)

Module Sidekick_arith_lra.Linear_expr

Arithmetic expressions

type nonrec bool_op = Sidekick_arith_lra__.Linear_expr_intf.bool_op =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
module Make : functor (C : COEFF) -> functor (Var : VAR) -> S with module C = C and module Var = Var and module Var_map = CCMap.Make(Var)
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-COEFF/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-COEFF/index.html new file mode 100644 index 00000000..2cf0cf05 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-COEFF/index.html @@ -0,0 +1,2 @@ + +COEFF (sidekick.Sidekick_arith_lra.Linear_expr.COEFF)

Module type Linear_expr.COEFF

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/C/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/C/index.html new file mode 100644 index 00000000..6b2e3b63 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/C/index.html @@ -0,0 +1,2 @@ + +C (sidekick.Sidekick_arith_lra.Linear_expr.S.C)

Module S.C

Coeficients used. Can be integers as well as rationals.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Comb/Infix/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Comb/Infix/index.html new file mode 100644 index 00000000..d9739e07 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Comb/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra.Linear_expr.S.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Comb/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Comb/index.html new file mode 100644 index 00000000..ae24dd1d --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Comb/index.html @@ -0,0 +1,2 @@ + +Comb (sidekick.Sidekick_arith_lra.Linear_expr.S.Comb)

Module S.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Constr/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Constr/index.html new file mode 100644 index 00000000..b8b78fb8 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Constr/index.html @@ -0,0 +1,2 @@ + +Constr (sidekick.Sidekick_arith_lra.Linear_expr.S.Constr)

Module S.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Expr/Infix/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Expr/Infix/index.html new file mode 100644 index 00000000..1ee29a10 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Expr/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra.Linear_expr.S.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Expr/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Expr/index.html new file mode 100644 index 00000000..d9c12c97 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Expr/index.html @@ -0,0 +1,2 @@ + +Expr (sidekick.Sidekick_arith_lra.Linear_expr.S.Expr)

Module S.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Var/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Var/index.html new file mode 100644 index 00000000..3fdbd878 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/Var/index.html @@ -0,0 +1,2 @@ + +Var (sidekick.Sidekick_arith_lra.Linear_expr.S.Var)

Module S.Var

Variables used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/index.html new file mode 100644 index 00000000..1a4d6718 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra.Linear_expr.S)

Module type Linear_expr.S

module C : Sidekick_arith_lra__.Linear_expr_intf.COEFF

Coeficients used. Can be integers as well as rationals.

module Var : Sidekick_arith_lra__.Linear_expr_intf.VAR

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-VAR/index.html b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-VAR/index.html new file mode 100644 index 00000000..072860bb --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Linear_expr/module-type-VAR/index.html @@ -0,0 +1,2 @@ + +VAR (sidekick.Sidekick_arith_lra.Linear_expr.VAR)

Module type Linear_expr.VAR

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/Gensym/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/Gensym/index.html similarity index 66% rename from dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/Gensym/index.html rename to dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/Gensym/index.html index 118ee03f..65b4c554 100644 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-S/A/Gensym/index.html +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/Gensym/index.html @@ -1,2 +1,2 @@ -Gensym (sidekick-arith.Sidekick_arith_lra.S.A.Gensym)

Module A.Gensym

type t
val create : S.T.Term.state -> t
val tst : t -> S.T.Term.state
val copy : t -> t
val fresh_term : t -> pre:string -> S.T.Ty.t -> term

Make a fresh term of the given type

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

Module 1-A.Gensym

type t
val create : S.T.Term.state -> t
val tst : t -> S.T.Term.state
val copy : t -> t
val fresh_term : t -> pre:string -> S.T.Ty.t -> term

Make a fresh term of the given type

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/Q/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/Q/index.html new file mode 100644 index 00000000..2f89649d --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/Q/index.html @@ -0,0 +1,2 @@ + +Q (sidekick.Sidekick_arith_lra.Make.1-A.Q)

Module 1-A.Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

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

Module S.Atom

Boolean Atoms

Atoms are the SAT solver's version of our boolean literals (they may have a different representation).

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t CCFormat.printer
val neg : t -> t
val formula : t -> lit
val sign : t -> bool
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Lit/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Lit/index.html new file mode 100644 index 00000000..e11ccff9 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Lit/index.html @@ -0,0 +1,2 @@ + +Lit (sidekick.Sidekick_arith_lra.Make.1-A.S.Lit)

Module S.Lit

module T = T

Literals depend on terms

type t

A literal

val term : t -> T.Term.t

Get the (positive) term

val sign : t -> bool

Get the sign. A negated literal has sign false.

val neg : t -> t

Take negation of literal. sign (neg lit) = not (sign lit).

val abs : t -> t

abs lit is like lit but always positive, i.e. sign (abs lit) = true

val signed_term : t -> T.Term.t * bool
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Model/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Model/index.html new file mode 100644 index 00000000..c11b9221 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Model/index.html @@ -0,0 +1,2 @@ + +Model (sidekick.Sidekick_arith_lra.Make.1-A.S.Model)

Module S.Model

Models

A model can be produced when the solver is found to be in a satisfiable state after a call to solve.

type t
val empty : t
val mem : t -> term -> bool
val find : t -> term -> term option
val eval : t -> term -> term option
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/P/Quip/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/P/Quip/index.html new file mode 100644 index 00000000..c5d2fe8a --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/P/Quip/index.html @@ -0,0 +1,2 @@ + +Quip (sidekick.Sidekick_arith_lra.Make.1-A.S.P.Quip)

Module P.Quip

val output : Stdlib.out_channel -> t -> unit

Printer in Quip format (experimental)

\ 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 new file mode 100644 index 00000000..d939d561 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/P/index.html @@ -0,0 +1,2 @@ + +P (sidekick.Sidekick_arith_lra.Make.1-A.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Pre_proof/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Pre_proof/index.html new file mode 100644 index 00000000..618b5c61 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Pre_proof/index.html @@ -0,0 +1,2 @@ + +Pre_proof (sidekick.Sidekick_arith_lra.Make.1-A.S.Pre_proof)

Module S.Pre_proof

Internal representation of proofs

A type or state convertible into P.t

type t
val output : Stdlib.out_channel -> t -> unit

Output onto a channel, efficiently

val pp_debug : t Sidekick_core.Fmt.printer
val pp_dot : t Sidekick_core.Fmt.printer option

Optional printer into DOT/graphviz

val check : t -> unit

Check the proof (to an unspecified level of confidence; this can be a no-op). May fail.

val to_proof : t -> P.t
\ 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 new file mode 100644 index 00000000..adce6008 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Actions/index.html @@ -0,0 +1,2 @@ + +Actions (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
module P = P
type t = actions

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 raise_conflict : t -> Lit.t list -> P.t -> '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 * P.t) -> unit

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

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 new file mode 100644 index 00000000..604fccbb --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/Expl/index.html @@ -0,0 +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_proof : P.t -> t
val mk_theory : t -> t
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/N/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/N/index.html new file mode 100644 index 00000000..c472502c --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/N/index.html @@ -0,0 +1,2 @@ + +N (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC.N)

Module CC.N

An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".

All information pertaining to the whole equivalence class is stored in this representative's node.

When two classes become equal (are "merged"), one of the two representatives is picked as the representative of the new class. The new class contains the union of the two old classes' nodes.

We also allow theories to store additional information in the representative. This information can be used when two classes are merged, to detect conflicts and solve equations à la Shostak.

type t

An equivalent class, containing terms that are proved to be equal.

A value of type t points to a particular term, but see find to get the representative of the class.

val term : t -> term
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
val is_root : t -> bool

Is the node a root (ie the representative of its class)? See find to get the root.

val iter_class : t -> t Iter.t

Traverse the congruence class. Precondition: is_root n (see find below)

val iter_parents : t -> t Iter.t

Traverse the parents of the class. Precondition: is_root n (see find below)

type bitfield

A field in the bitfield of this node. This should only be allocated when a theory is initialized.

All fields are initially 0, are backtracked automatically, and are merged automatically when classes are merged.

val get_field : bitfield -> t -> bool

Access the bit field

\ 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 new file mode 100644 index 00000000..af08f5d1 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/CC/index.html @@ -0,0 +1,2 @@ + +CC (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

module T = T
module P = P
module Lit = Lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and module P = P and type t = actions
type term_state = T.Term.state
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type proof = P.t
type actions = Actions.t
type t

State of the congruence closure

module N : sig ... end

An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".

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_state : t -> term_state
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 * P.t) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See Sidekick_core.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_state -> t

Create a new congruence closure.

parameter term_state

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 bitfield for the nodes. See N.bitfield.

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/Solver_internal/Simplify/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/Simplify/index.html new file mode 100644 index 00000000..3d1238b7 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/Solver_internal/Simplify/index.html @@ -0,0 +1,2 @@ + +Simplify (sidekick.Sidekick_arith_lra.Make.1-A.S.Solver_internal.Simplify)

Module Solver_internal.Simplify

Simplify terms

type t
val tst : t -> term_state
val ty_st : t -> ty_state
val clear : t -> unit

Reset internal cache, etc.

type hook = t -> term -> (term * proof) option

Given a term, try to simplify it. Return None if it didn't change.

A simple example could be a hook that takes a term t, and if t is app "+" (const x) (const y) where x and y are number, returns Some (const (x+y)), and None otherwise.

val normalize : t -> term -> (term * P.t) option

Normalize a term using all the hooks. This performs a fixpoint, i.e. it only stops when no hook applies anywhere inside the term.

val normalize_t : t -> term -> term * P.t

Normalize a term using all the hooks, along with a proof that the simplification is correct. returns t, refl t if no simplification occurred.

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

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/T/Fun/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/T/Fun/index.html new file mode 100644 index 00000000..714f7c43 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/T/Fun/index.html @@ -0,0 +1,2 @@ + +Fun (sidekick.Sidekick_arith_lra.Make.1-A.S.T.Fun)

Module T.Fun

A function symbol, like "f" or "plus" or "is_human" or "socrates"

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/T/Term/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/T/Term/index.html new file mode 100644 index 00000000..004478cb --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/T/Term/index.html @@ -0,0 +1,8 @@ + +Term (sidekick.Sidekick_arith_lra.Make.1-A.S.T.Term)

Module T.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
+let y = f x x in
+let z = g y x in
+z = z

the DAG has the following nodes:

n1: 2
+n2: f n1 n1
+n3: g n2 n1
+n4: = n3 n3
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/T/Ty/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/T/Ty/index.html new file mode 100644 index 00000000..b24cd2f6 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/T/Ty/index.html @@ -0,0 +1,2 @@ + +Ty (sidekick.Sidekick_arith_lra.Make.1-A.S.T.Ty)

Module T.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/T/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/T/index.html new file mode 100644 index 00000000..96c3e263 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/T/index.html @@ -0,0 +1,2 @@ + +T (sidekick.Sidekick_arith_lra.Make.1-A.S.T)

Module S.T

module Fun : sig ... end

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end

Types

module Term : sig ... end

Term structure.

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

Module S.Unknown

type t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/index.html new file mode 100644 index 00000000..22b6d790 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra.Make.1-A.S)

Module 1-A.S

module P : Sidekick_core.PROOF with type term = T.Term.t
module Lit : Sidekick_core.LIT with module T = T
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = Lit

Internal solver, available to theories.

type t

The solver's state.

type solver = t
type term = T.Term.t
type ty = T.Ty.t
type lit = Lit.t
type proof = P.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

type 'a theory_p = (module THEORY with type t = 'a)

A theory that can be used for this particular solver, with state of type 'a.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory.

module Atom : sig ... end
module Model : sig ... end

Models

module Unknown : sig ... end

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> T.Term.state
val ty_st : t -> T.Ty.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> unit -> t

Create a new solver.

It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.

parameter store_proof

if true, proofs from the SAT solver and theories are retained and potentially accessible after solve returns UNSAT.

parameter size

influences the size of initial allocations.

parameter theories

theories to load from the start. Other theories can be added using add_theory.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val add_theory_p : t -> 'a theory_p -> 'a

Add the given theory and obtain its state

val add_theory_l : t -> theory list -> unit
val mk_atom_lit : t -> lit -> Atom.t * P.t

mk_atom_lit _ lit returns atom, pr where atom is an internal atom for the solver, and pr is a proof of |- lit = atom

val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t * P.t

mk_atom_t _ ~sign t returns atom, pr where atom is an internal representation of ± t, and pr is a proof of |- atom = (± t)

val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unit

add_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.

val add_clause_l : t -> Atom.t list -> P.t -> unit

Add a clause to the solver, given as a list.

module Pre_proof : sig ... end
type res =
| Sat of Model.t

Satisfiable

| Unsat of {
proof : Pre_proof.t option lazy_t;

proof of unsat

unsat_core : Atom.t list lazy_t;

subset of assumptions responsible for unsat

}

Unsatisfiable

| Unknown of Unknown.t

Unknown, obtained after a timeout, memory limit, etc.

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> ?⁠on_progress:(t -> unit) -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the clauses added so far to s.

parameter check

if true, the model is checked before returning.

parameter on_progress

called regularly during solving.

parameter assumptions

a set of atoms held to be true. The unsat core, if any, will be a subset of assumptions.

parameter on_exit

functions to be run before this returns

val pp_stats : t CCFormat.printer

Print some statistics. What it prints exactly is unspecified.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/module-type-THEORY/index.html b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/module-type-THEORY/index.html new file mode 100644 index 00000000..f94aab9c --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/argument-1-A/S/module-type-THEORY/index.html @@ -0,0 +1,2 @@ + +THEORY (sidekick.Sidekick_arith_lra.Make.1-A.S.THEORY)

Module type S.THEORY

A theory

Theories are abstracted over the concrete implementation of the solver, so they can work with any implementation.

Typically a theory should be a functor taking an argument containing a SOLVER_INTERNAL or even a full SOLVER, and some additional views on terms, literals, etc. that are specific to the theory (e.g. to map terms to linear expressions). The theory can then be instantiated on any kind of solver for any term representation that also satisfies the additional theory-specific requirements. Instantiated theories (ie values of type Sidekick_core.SOLVER.theory) can be added to the solver.

type t

The theory's state

val name : string

Name of the theory (ideally, unique and short)

val create_and_setup : Solver_internal.t -> t

Instantiate the theory's state for the given (internal) solver, register callbacks, create keys, etc.

Called once for every solver this theory is added to.

val push_level : t -> unit

Push backtracking level. When the corresponding pop is called, the theory's state should be restored to a state equivalent to what it was just before push_level.

it does not have to be exactly the same state, it just needs to be equivalent.

val pop_levels : t -> int -> unit

pop_levels theory n pops n backtracking levels, restoring theory to its state before calling push_level n times.

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

Parameter Make.1-A

module Q : RATIONAL
type term = S.T.Term.t
type ty = S.T.Ty.t
val view_as_lra : term -> (Q.tterm) lra_view

Project the term into the theory view

val mk_bool : S.T.Term.state -> bool -> term
val mk_lra : S.T.Term.state -> (Q.tterm) lra_view -> term

Make a term from the given theory view

val ty_lra : S.T.Term.state -> ty
val mk_eq : S.T.Term.state -> term -> term -> term

syntactic equality

val has_ty_real : term -> bool

Does this term have the type Real

val proof_lra : S.P.lit Iter.t -> S.P.t

TODO: more accurate certificates

val proof_lra_l : S.P.lit list -> S.P.t
module Gensym : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Make/index.html b/dev/sidekick/Sidekick_arith_lra/Make/index.html new file mode 100644 index 00000000..3910f844 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Make/index.html @@ -0,0 +1,2 @@ + +Make (sidekick.Sidekick_arith_lra.Make)

Module Sidekick_arith_lra.Make

Parameters

Signature

module A = A
type state
val create : ?⁠stat:Sidekick_util.Stat.t -> A.S.T.Term.state -> A.S.T.Ty.state -> state
val theory : A.S.theory
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Predicate/index.html b/dev/sidekick/Sidekick_arith_lra/Predicate/index.html new file mode 100644 index 00000000..da62cb8c --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Predicate/index.html @@ -0,0 +1,2 @@ + +Predicate (sidekick.Sidekick_arith_lra.Predicate)

Module Sidekick_arith_lra.Predicate

type t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
val neg : t -> t
val neg_sign : t -> t
val to_string : t -> string
val pp : Sidekick_util.Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/Constraint/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/Constraint/index.html new file mode 100644 index 00000000..cbfff130 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/Constraint/index.html @@ -0,0 +1,2 @@ + +Constraint (sidekick.Sidekick_arith_lra.Simplex2.Make.Constraint)

Module Make.Constraint

type op = Op.t
type t = {
op : op;
lhs : V.t;
rhs : num;
}

A constraint is the comparison of a variable to a constant.

val mk : V.t -> op -> num -> t
val leq : V.t -> num -> t
val lt : V.t -> num -> t
val geq : V.t -> num -> t
val gt : V.t -> num -> t
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/Subst/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/Subst/index.html new file mode 100644 index 00000000..13a15416 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/Subst/index.html @@ -0,0 +1,2 @@ + +Subst (sidekick.Sidekick_arith_lra.Simplex2.Make.Subst)

Module Make.Subst

type t = num V_map.t
val eval : t -> V.t -> Q.t
val pp : t Sidekick_util.Fmt.printer
val to_string : t -> string
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/Unsat_cert/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/Unsat_cert/index.html new file mode 100644 index 00000000..b9a81a45 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/Unsat_cert/index.html @@ -0,0 +1,2 @@ + +Unsat_cert (sidekick.Sidekick_arith_lra.Simplex2.Make.Unsat_cert)

Module Make.Unsat_cert

type t = unsat_cert
val lits : t -> V.lit list
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/argument-1-Q/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/argument-1-Q/index.html new file mode 100644 index 00000000..e75920a6 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/argument-1-Q/index.html @@ -0,0 +1,2 @@ + +1-Q (sidekick.Sidekick_arith_lra.Simplex2.Make.1-Q)

Parameter Make.1-Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/argument-2-Var/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/argument-2-Var/index.html new file mode 100644 index 00000000..2b21e458 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/argument-2-Var/index.html @@ -0,0 +1,2 @@ + +2-Var (sidekick.Sidekick_arith_lra.Simplex2.Make.2-Var)

Parameter Make.2-Var

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/index.html new file mode 100644 index 00000000..136f628d --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/Make/index.html @@ -0,0 +1,2 @@ + +Make (sidekick.Sidekick_arith_lra.Simplex2.Make)

Module Simplex2.Make

Parameters

Signature

module V = Var
module V_map : CCMap.S with type V_map.key = V.t
module Q = Q
type num = Q.t

Numbers

module Constraint : sig ... end
module Subst : sig ... end
type t
val create : ?⁠stat:Sidekick_util.Stat.t -> unit -> t

Create a new simplex.

val push_level : t -> unit
val pop_levels : t -> int -> unit
val define : t -> V.t -> (num * V.t) list -> unit

Define a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t

type unsat_cert
module Unsat_cert : sig ... end
exception E_unsat of Unsat_cert.t
type ev_on_propagate = V.lit -> reason:V.lit list -> unit
val add_var : t -> V.t -> unit

Make sure the variable exists in the simplex.

val add_constraint : on_propagate:ev_on_propagate -> t -> Constraint.t -> V.lit -> unit

Add a constraint to the simplex.

raises Unsat

if it's immediately obvious that this is not satisfiable.

val declare_bound : t -> Constraint.t -> V.lit -> unit

Declare that this constraint exists, so we can possibly propagate it. Unlike add_constraint this does NOT assert that the constraint is true

val check_exn : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> unit

Check the whole simplex for satisfiability.

parameter on_propagate

is called with arguments lit, reason whenever reason => lit is found to be true by the simplex.

raises Unsat

if the constraints are not satisfiable.

type result =
| Sat of Subst.t
| Unsat of Unsat_cert.t
val check : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> result

Call check_exn and return a model or a proof of unsat.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/Op/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/Op/index.html new file mode 100644 index 00000000..3c0c8337 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/Op/index.html @@ -0,0 +1,2 @@ + +Op (sidekick.Sidekick_arith_lra.Simplex2.Op)

Module Simplex2.Op

Basic operator

type t =
| Leq
| Lt
| Geq
| Gt
val neg_sign : t -> t
val not_ : t -> t
val to_string : t -> string
val pp : Sidekick_util.Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/index.html new file mode 100644 index 00000000..7ce39c95 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/index.html @@ -0,0 +1,2 @@ + +Simplex2 (sidekick.Sidekick_arith_lra.Simplex2)

Module Sidekick_arith_lra.Simplex2

Fast Simplex for CDCL(T)

We follow the paper "Integrating Simplex with DPLL(T )" from de Moura and Dutertre.

module Op : sig ... end
module type S = sig ... end
module Make : functor (Q : RATIONAL) -> functor (Var : VAR) -> S with module V = Var and module Q = Q
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-RATIONAL/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-RATIONAL/index.html new file mode 100644 index 00000000..6bce0a95 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-RATIONAL/index.html @@ -0,0 +1,2 @@ + +RATIONAL (sidekick.Sidekick_arith_lra.Simplex2.RATIONAL)

Module type Simplex2.RATIONAL

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/Constraint/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/Constraint/index.html new file mode 100644 index 00000000..0e11a7b9 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/Constraint/index.html @@ -0,0 +1,2 @@ + +Constraint (sidekick.Sidekick_arith_lra.Simplex2.S.Constraint)

Module S.Constraint

type op = Op.t
type t = {
op : op;
lhs : V.t;
rhs : num;
}

A constraint is the comparison of a variable to a constant.

val mk : V.t -> op -> num -> t
val leq : V.t -> num -> t
val lt : V.t -> num -> t
val geq : V.t -> num -> t
val gt : V.t -> num -> t
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/Q/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/Q/index.html new file mode 100644 index 00000000..045c98bc --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/Q/index.html @@ -0,0 +1,2 @@ + +Q (sidekick.Sidekick_arith_lra.Simplex2.S.Q)

Module S.Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/Subst/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/Subst/index.html new file mode 100644 index 00000000..7cbd58c5 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/Subst/index.html @@ -0,0 +1,2 @@ + +Subst (sidekick.Sidekick_arith_lra.Simplex2.S.Subst)

Module S.Subst

type t = num V_map.t
val eval : t -> V.t -> Q.t
val pp : t Sidekick_util.Fmt.printer
val to_string : t -> string
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/Unsat_cert/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/Unsat_cert/index.html new file mode 100644 index 00000000..8340825b --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/Unsat_cert/index.html @@ -0,0 +1,2 @@ + +Unsat_cert (sidekick.Sidekick_arith_lra.Simplex2.S.Unsat_cert)

Module S.Unsat_cert

type t = unsat_cert
val lits : t -> V.lit list
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/V/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/V/index.html new file mode 100644 index 00000000..d37909bc --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/V/index.html @@ -0,0 +1,2 @@ + +V (sidekick.Sidekick_arith_lra.Simplex2.S.V)

Module S.V

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/index.html new file mode 100644 index 00000000..127b9b7f --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra.Simplex2.S)

Module type Simplex2.S

module V : VAR
module V_map : CCMap.S with type V_map.key = V.t
module Q : RATIONAL
type num = Q.t

Numbers

module Constraint : sig ... end
module Subst : sig ... end
type t
val create : ?⁠stat:Sidekick_util.Stat.t -> unit -> t

Create a new simplex.

val push_level : t -> unit
val pop_levels : t -> int -> unit
val define : t -> V.t -> (num * V.t) list -> unit

Define a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t

type unsat_cert
module Unsat_cert : sig ... end
exception E_unsat of Unsat_cert.t
type ev_on_propagate = V.lit -> reason:V.lit list -> unit
val add_var : t -> V.t -> unit

Make sure the variable exists in the simplex.

val add_constraint : on_propagate:ev_on_propagate -> t -> Constraint.t -> V.lit -> unit

Add a constraint to the simplex.

raises Unsat

if it's immediately obvious that this is not satisfiable.

val declare_bound : t -> Constraint.t -> V.lit -> unit

Declare that this constraint exists, so we can possibly propagate it. Unlike add_constraint this does NOT assert that the constraint is true

val check_exn : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> unit

Check the whole simplex for satisfiability.

parameter on_propagate

is called with arguments lit, reason whenever reason => lit is found to be true by the simplex.

raises Unsat

if the constraints are not satisfiable.

type result =
| Sat of Subst.t
| Unsat of Unsat_cert.t
val check : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> result

Call check_exn and return a model or a proof of unsat.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-VAR/index.html b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-VAR/index.html new file mode 100644 index 00000000..1fedd961 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/Simplex2/module-type-VAR/index.html @@ -0,0 +1,2 @@ + +VAR (sidekick.Sidekick_arith_lra.Simplex2.VAR)

Module type Simplex2.VAR

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/index.html b/dev/sidekick/Sidekick_arith_lra/index.html new file mode 100644 index 00000000..cf3cf33f --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/index.html @@ -0,0 +1,2 @@ + +Sidekick_arith_lra (sidekick.Sidekick_arith_lra)

Module Sidekick_arith_lra

Linear Rational Arithmetic

module Simplex2 : sig ... end
module Predicate : sig ... end
module Linear_expr : sig ... end

Arithmetic expressions

module S_op = Simplex2.Op
type pred = Sidekick_arith_lra__.Linear_expr_intf.bool_op =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
type op =
| Plus
| Minus
type ('num, 'a) lra_view =
| LRA_pred of pred * 'a * 'a
| LRA_op of op * 'a * 'a
| LRA_mult of 'num * 'a
| LRA_const of 'num
| LRA_simplex_var of 'a
| LRA_simplex_pred of 'a * S_op.t * 'num
| LRA_other of 'a
val map_view : ('a -> 'b) -> ('c'a) lra_view -> ('c'b) lra_view
module type ARG = sig ... end
module type S = sig ... end
module Make : functor (A : ARG) -> S with module A = A
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/Gensym/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/Gensym/index.html new file mode 100644 index 00000000..09d9fcf1 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/Gensym/index.html @@ -0,0 +1,2 @@ + +Gensym (sidekick.Sidekick_arith_lra.ARG.Gensym)

Module ARG.Gensym

type t
val create : S.T.Term.state -> t
val tst : t -> S.T.Term.state
val copy : t -> t
val fresh_term : t -> pre:string -> S.T.Ty.t -> term

Make a fresh term of the given type

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/Q/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/Q/index.html new file mode 100644 index 00000000..7f08ede9 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/Q/index.html @@ -0,0 +1,2 @@ + +Q (sidekick.Sidekick_arith_lra.ARG.Q)

Module ARG.Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

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

Module S.Atom

Boolean Atoms

Atoms are the SAT solver's version of our boolean literals (they may have a different representation).

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t CCFormat.printer
val neg : t -> t
val formula : t -> lit
val sign : t -> bool
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Lit/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Lit/index.html new file mode 100644 index 00000000..3e538853 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Lit/index.html @@ -0,0 +1,2 @@ + +Lit (sidekick.Sidekick_arith_lra.ARG.S.Lit)

Module S.Lit

module T = T

Literals depend on terms

type t

A literal

val term : t -> T.Term.t

Get the (positive) term

val sign : t -> bool

Get the sign. A negated literal has sign false.

val neg : t -> t

Take negation of literal. sign (neg lit) = not (sign lit).

val abs : t -> t

abs lit is like lit but always positive, i.e. sign (abs lit) = true

val signed_term : t -> T.Term.t * bool
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Model/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Model/index.html new file mode 100644 index 00000000..faed967b --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Model/index.html @@ -0,0 +1,2 @@ + +Model (sidekick.Sidekick_arith_lra.ARG.S.Model)

Module S.Model

Models

A model can be produced when the solver is found to be in a satisfiable state after a call to solve.

type t
val empty : t
val mem : t -> term -> bool
val find : t -> term -> term option
val eval : t -> term -> term option
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/P/Quip/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/P/Quip/index.html new file mode 100644 index 00000000..b97383fa --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/P/Quip/index.html @@ -0,0 +1,2 @@ + +Quip (sidekick.Sidekick_arith_lra.ARG.S.P.Quip)

Module P.Quip

val output : Stdlib.out_channel -> t -> unit

Printer in Quip format (experimental)

\ 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 new file mode 100644 index 00000000..b29f97ac --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/P/index.html @@ -0,0 +1,2 @@ + +P (sidekick.Sidekick_arith_lra.ARG.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Pre_proof/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Pre_proof/index.html new file mode 100644 index 00000000..7fcba505 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Pre_proof/index.html @@ -0,0 +1,2 @@ + +Pre_proof (sidekick.Sidekick_arith_lra.ARG.S.Pre_proof)

Module S.Pre_proof

Internal representation of proofs

A type or state convertible into P.t

type t
val output : Stdlib.out_channel -> t -> unit

Output onto a channel, efficiently

val pp_debug : t Sidekick_core.Fmt.printer
val pp_dot : t Sidekick_core.Fmt.printer option

Optional printer into DOT/graphviz

val check : t -> unit

Check the proof (to an unspecified level of confidence; this can be a no-op). May fail.

val to_proof : t -> P.t
\ 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 new file mode 100644 index 00000000..ff7af603 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Actions/index.html @@ -0,0 +1,2 @@ + +Actions (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
module P = P
type t = actions

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 raise_conflict : t -> Lit.t list -> P.t -> '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 * P.t) -> unit

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

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 new file mode 100644 index 00000000..2151db03 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/Expl/index.html @@ -0,0 +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_proof : P.t -> t
val mk_theory : t -> t
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/N/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/N/index.html new file mode 100644 index 00000000..d94bda0c --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/N/index.html @@ -0,0 +1,2 @@ + +N (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC.N)

Module CC.N

An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".

All information pertaining to the whole equivalence class is stored in this representative's node.

When two classes become equal (are "merged"), one of the two representatives is picked as the representative of the new class. The new class contains the union of the two old classes' nodes.

We also allow theories to store additional information in the representative. This information can be used when two classes are merged, to detect conflicts and solve equations à la Shostak.

type t

An equivalent class, containing terms that are proved to be equal.

A value of type t points to a particular term, but see find to get the representative of the class.

val term : t -> term
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
val is_root : t -> bool

Is the node a root (ie the representative of its class)? See find to get the root.

val iter_class : t -> t Iter.t

Traverse the congruence class. Precondition: is_root n (see find below)

val iter_parents : t -> t Iter.t

Traverse the parents of the class. Precondition: is_root n (see find below)

type bitfield

A field in the bitfield of this node. This should only be allocated when a theory is initialized.

All fields are initially 0, are backtracked automatically, and are merged automatically when classes are merged.

val get_field : bitfield -> t -> bool

Access the bit field

\ 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 new file mode 100644 index 00000000..4002af35 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/CC/index.html @@ -0,0 +1,2 @@ + +CC (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

module T = T
module P = P
module Lit = Lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and module P = P and type t = actions
type term_state = T.Term.state
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type proof = P.t
type actions = Actions.t
type t

State of the congruence closure

module N : sig ... end

An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".

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_state : t -> term_state
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 * P.t) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See Sidekick_core.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_state -> t

Create a new congruence closure.

parameter term_state

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 bitfield for the nodes. See N.bitfield.

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/Solver_internal/Simplify/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/Simplify/index.html new file mode 100644 index 00000000..8f062ac1 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/Simplify/index.html @@ -0,0 +1,2 @@ + +Simplify (sidekick.Sidekick_arith_lra.ARG.S.Solver_internal.Simplify)

Module Solver_internal.Simplify

Simplify terms

type t
val tst : t -> term_state
val ty_st : t -> ty_state
val clear : t -> unit

Reset internal cache, etc.

type hook = t -> term -> (term * proof) option

Given a term, try to simplify it. Return None if it didn't change.

A simple example could be a hook that takes a term t, and if t is app "+" (const x) (const y) where x and y are number, returns Some (const (x+y)), and None otherwise.

val normalize : t -> term -> (term * P.t) option

Normalize a term using all the hooks. This performs a fixpoint, i.e. it only stops when no hook applies anywhere inside the term.

val normalize_t : t -> term -> term * P.t

Normalize a term using all the hooks, along with a proof that the simplification is correct. returns t, refl t if no simplification occurred.

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

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

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

Module T.Fun

A function symbol, like "f" or "plus" or "is_human" or "socrates"

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/T/Term/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/T/Term/index.html new file mode 100644 index 00000000..bafaf489 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/T/Term/index.html @@ -0,0 +1,8 @@ + +Term (sidekick.Sidekick_arith_lra.ARG.S.T.Term)

Module T.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
+let y = f x x in
+let z = g y x in
+z = z

the DAG has the following nodes:

n1: 2
+n2: f n1 n1
+n3: g n2 n1
+n4: = n3 n3
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/T/Ty/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/T/Ty/index.html new file mode 100644 index 00000000..cb5c4a99 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/T/Ty/index.html @@ -0,0 +1,2 @@ + +Ty (sidekick.Sidekick_arith_lra.ARG.S.T.Ty)

Module T.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/T/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/T/index.html new file mode 100644 index 00000000..a0625a3f --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/T/index.html @@ -0,0 +1,2 @@ + +T (sidekick.Sidekick_arith_lra.ARG.S.T)

Module S.T

module Fun : sig ... end

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end

Types

module Term : sig ... end

Term structure.

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

Module S.Unknown

type t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/index.html new file mode 100644 index 00000000..d8f687fb --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-ARG/S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra.ARG.S)

Module ARG.S

module P : Sidekick_core.PROOF with type term = T.Term.t
module Lit : Sidekick_core.LIT with module T = T
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = Lit

Internal solver, available to theories.

type t

The solver's state.

type solver = t
type term = T.Term.t
type ty = T.Ty.t
type lit = Lit.t
type proof = P.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

type 'a theory_p = (module THEORY with type t = 'a)

A theory that can be used for this particular solver, with state of type 'a.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory.

module Atom : sig ... end
module Model : sig ... end

Models

module Unknown : sig ... end

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> T.Term.state
val ty_st : t -> T.Ty.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> unit -> t

Create a new solver.

It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.

parameter store_proof

if true, proofs from the SAT solver and theories are retained and potentially accessible after solve returns UNSAT.

parameter size

influences the size of initial allocations.

parameter theories

theories to load from the start. Other theories can be added using add_theory.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val add_theory_p : t -> 'a theory_p -> 'a

Add the given theory and obtain its state

val add_theory_l : t -> theory list -> unit
val mk_atom_lit : t -> lit -> Atom.t * P.t

mk_atom_lit _ lit returns atom, pr where atom is an internal atom for the solver, and pr is a proof of |- lit = atom

val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t * P.t

mk_atom_t _ ~sign t returns atom, pr where atom is an internal representation of ± t, and pr is a proof of |- atom = (± t)

val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unit

add_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.

val add_clause_l : t -> Atom.t list -> P.t -> unit

Add a clause to the solver, given as a list.

module Pre_proof : sig ... end
type res =
| Sat of Model.t

Satisfiable

| Unsat of {
proof : Pre_proof.t option lazy_t;

proof of unsat

unsat_core : Atom.t list lazy_t;

subset of assumptions responsible for unsat

}

Unsatisfiable

| Unknown of Unknown.t

Unknown, obtained after a timeout, memory limit, etc.

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> ?⁠on_progress:(t -> unit) -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the clauses added so far to s.

parameter check

if true, the model is checked before returning.

parameter on_progress

called regularly during solving.

parameter assumptions

a set of atoms held to be true. The unsat core, if any, will be a subset of assumptions.

parameter on_exit

functions to be run before this returns

val pp_stats : t CCFormat.printer

Print some statistics. What it prints exactly is unspecified.

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

Module type S.THEORY

A theory

Theories are abstracted over the concrete implementation of the solver, so they can work with any implementation.

Typically a theory should be a functor taking an argument containing a SOLVER_INTERNAL or even a full SOLVER, and some additional views on terms, literals, etc. that are specific to the theory (e.g. to map terms to linear expressions). The theory can then be instantiated on any kind of solver for any term representation that also satisfies the additional theory-specific requirements. Instantiated theories (ie values of type Sidekick_core.SOLVER.theory) can be added to the solver.

type t

The theory's state

val name : string

Name of the theory (ideally, unique and short)

val create_and_setup : Solver_internal.t -> t

Instantiate the theory's state for the given (internal) solver, register callbacks, create keys, etc.

Called once for every solver this theory is added to.

val push_level : t -> unit

Push backtracking level. When the corresponding pop is called, the theory's state should be restored to a state equivalent to what it was just before push_level.

it does not have to be exactly the same state, it just needs to be equivalent.

val pop_levels : t -> int -> unit

pop_levels theory n pops n backtracking levels, restoring theory to its state before calling push_level n times.

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

Module type Sidekick_arith_lra.ARG

module Q : RATIONAL
type term = S.T.Term.t
type ty = S.T.Ty.t
val view_as_lra : term -> (Q.tterm) lra_view

Project the term into the theory view

val mk_bool : S.T.Term.state -> bool -> term
val mk_lra : S.T.Term.state -> (Q.tterm) lra_view -> term

Make a term from the given theory view

val ty_lra : S.T.Term.state -> ty
val mk_eq : S.T.Term.state -> term -> term -> term

syntactic equality

val has_ty_real : term -> bool

Does this term have the type Real

val proof_lra : S.P.lit Iter.t -> S.P.t

TODO: more accurate certificates

val proof_lra_l : S.P.lit list -> S.P.t
module Gensym : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-RATIONAL/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-RATIONAL/index.html new file mode 100644 index 00000000..699a7308 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-RATIONAL/index.html @@ -0,0 +1,2 @@ + +RATIONAL (sidekick.Sidekick_arith_lra.RATIONAL)

Module type Sidekick_arith_lra.RATIONAL

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/Gensym/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/Gensym/index.html new file mode 100644 index 00000000..cb8edcbd --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/Gensym/index.html @@ -0,0 +1,2 @@ + +Gensym (sidekick.Sidekick_arith_lra.S.A.Gensym)

Module A.Gensym

type t
val create : S.T.Term.state -> t
val tst : t -> S.T.Term.state
val copy : t -> t
val fresh_term : t -> pre:string -> S.T.Ty.t -> term

Make a fresh term of the given type

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/Q/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/Q/index.html new file mode 100644 index 00000000..b200360f --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/Q/index.html @@ -0,0 +1,2 @@ + +Q (sidekick.Sidekick_arith_lra.S.A.Q)

Module A.Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Atom/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Atom/index.html new file mode 100644 index 00000000..be97fcd7 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Atom/index.html @@ -0,0 +1,2 @@ + +Atom (sidekick.Sidekick_arith_lra.S.A.S.Atom)

Module S.Atom

Boolean Atoms

Atoms are the SAT solver's version of our boolean literals (they may have a different representation).

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t CCFormat.printer
val neg : t -> t
val formula : t -> lit
val sign : t -> bool
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Lit/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Lit/index.html new file mode 100644 index 00000000..44591830 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Lit/index.html @@ -0,0 +1,2 @@ + +Lit (sidekick.Sidekick_arith_lra.S.A.S.Lit)

Module S.Lit

module T = T

Literals depend on terms

type t

A literal

val term : t -> T.Term.t

Get the (positive) term

val sign : t -> bool

Get the sign. A negated literal has sign false.

val neg : t -> t

Take negation of literal. sign (neg lit) = not (sign lit).

val abs : t -> t

abs lit is like lit but always positive, i.e. sign (abs lit) = true

val signed_term : t -> T.Term.t * bool
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Model/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Model/index.html new file mode 100644 index 00000000..f2c2f27c --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Model/index.html @@ -0,0 +1,2 @@ + +Model (sidekick.Sidekick_arith_lra.S.A.S.Model)

Module S.Model

Models

A model can be produced when the solver is found to be in a satisfiable state after a call to solve.

type t
val empty : t
val mem : t -> term -> bool
val find : t -> term -> term option
val eval : t -> term -> term option
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/P/Quip/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/P/Quip/index.html new file mode 100644 index 00000000..581d6ea1 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/P/Quip/index.html @@ -0,0 +1,2 @@ + +Quip (sidekick.Sidekick_arith_lra.S.A.S.P.Quip)

Module P.Quip

val output : Stdlib.out_channel -> t -> unit

Printer in Quip format (experimental)

\ 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 new file mode 100644 index 00000000..614babc1 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/P/index.html @@ -0,0 +1,2 @@ + +P (sidekick.Sidekick_arith_lra.S.A.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Pre_proof/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Pre_proof/index.html new file mode 100644 index 00000000..3fc7c327 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Pre_proof/index.html @@ -0,0 +1,2 @@ + +Pre_proof (sidekick.Sidekick_arith_lra.S.A.S.Pre_proof)

Module S.Pre_proof

Internal representation of proofs

A type or state convertible into P.t

type t
val output : Stdlib.out_channel -> t -> unit

Output onto a channel, efficiently

val pp_debug : t Sidekick_core.Fmt.printer
val pp_dot : t Sidekick_core.Fmt.printer option

Optional printer into DOT/graphviz

val check : t -> unit

Check the proof (to an unspecified level of confidence; this can be a no-op). May fail.

val to_proof : t -> P.t
\ 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 new file mode 100644 index 00000000..cb26de66 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Actions/index.html @@ -0,0 +1,2 @@ + +Actions (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC.Actions)

Module CC.Actions

module T = T
module Lit = Lit
module P = P
type t = actions

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 raise_conflict : t -> Lit.t list -> P.t -> '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 * P.t) -> unit

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

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 new file mode 100644 index 00000000..58e76d75 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/Expl/index.html @@ -0,0 +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_proof : P.t -> t
val mk_theory : t -> t
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/N/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/N/index.html new file mode 100644 index 00000000..80917252 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/N/index.html @@ -0,0 +1,2 @@ + +N (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC.N)

Module CC.N

An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".

All information pertaining to the whole equivalence class is stored in this representative's node.

When two classes become equal (are "merged"), one of the two representatives is picked as the representative of the new class. The new class contains the union of the two old classes' nodes.

We also allow theories to store additional information in the representative. This information can be used when two classes are merged, to detect conflicts and solve equations à la Shostak.

type t

An equivalent class, containing terms that are proved to be equal.

A value of type t points to a particular term, but see find to get the representative of the class.

val term : t -> term
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
val is_root : t -> bool

Is the node a root (ie the representative of its class)? See find to get the root.

val iter_class : t -> t Iter.t

Traverse the congruence class. Precondition: is_root n (see find below)

val iter_parents : t -> t Iter.t

Traverse the parents of the class. Precondition: is_root n (see find below)

type bitfield

A field in the bitfield of this node. This should only be allocated when a theory is initialized.

All fields are initially 0, are backtracked automatically, and are merged automatically when classes are merged.

val get_field : bitfield -> t -> bool

Access the bit field

\ 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 new file mode 100644 index 00000000..fbc865e9 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/CC/index.html @@ -0,0 +1,2 @@ + +CC (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.CC)

Module Solver_internal.CC

Congruence closure instance

module T = T
module P = P
module Lit = Lit
module Actions : Sidekick_core.CC_ACTIONS with module T = T and module Lit = Lit and module P = P and type t = actions
type term_state = T.Term.state
type term = T.Term.t
type fun_ = T.Fun.t
type lit = Lit.t
type proof = P.t
type actions = Actions.t
type t

State of the congruence closure

module N : sig ... end

An equivalence class is a set of terms that are currently equal in the partial model built by the solver. The class is represented by a collection of nodes, one of which is distinguished and is called the "representative".

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_state : t -> term_state
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 * P.t) -> unit

ev_on_propagate cc lit reason is called whenever reason() => lit is a propagated lemma. See Sidekick_core.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_state -> t

Create a new congruence closure.

parameter term_state

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 bitfield for the nodes. See N.bitfield.

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/Solver_internal/Simplify/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/Simplify/index.html new file mode 100644 index 00000000..5cd2790e --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/Simplify/index.html @@ -0,0 +1,2 @@ + +Simplify (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal.Simplify)

Module Solver_internal.Simplify

Simplify terms

type t
val tst : t -> term_state
val ty_st : t -> ty_state
val clear : t -> unit

Reset internal cache, etc.

type hook = t -> term -> (term * proof) option

Given a term, try to simplify it. Return None if it didn't change.

A simple example could be a hook that takes a term t, and if t is app "+" (const x) (const y) where x and y are number, returns Some (const (x+y)), and None otherwise.

val normalize : t -> term -> (term * P.t) option

Normalize a term using all the hooks. This performs a fixpoint, i.e. it only stops when no hook applies anywhere inside the term.

val normalize_t : t -> term -> term * P.t

Normalize a term using all the hooks, along with a proof that the simplification is correct. returns t, refl t if no simplification occurred.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/index.html similarity index 58% rename from dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/index.html rename to dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/index.html index 711d685b..5eb7d392 100644 --- a/dev/sidekick-arith/Sidekick_arith_lra/module-type-ARG/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick-arith.Sidekick_arith_lra.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_arith_lra.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/T/Fun/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/T/Fun/index.html new file mode 100644 index 00000000..f9a3a03a --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/T/Fun/index.html @@ -0,0 +1,2 @@ + +Fun (sidekick.Sidekick_arith_lra.S.A.S.T.Fun)

Module T.Fun

A function symbol, like "f" or "plus" or "is_human" or "socrates"

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/T/Term/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/T/Term/index.html new file mode 100644 index 00000000..04957adc --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/T/Term/index.html @@ -0,0 +1,8 @@ + +Term (sidekick.Sidekick_arith_lra.S.A.S.T.Term)

Module T.Term

Term structure.

Terms should be hashconsed, with perfect sharing. This allows, for example, Term.Tbl and Term.iter_dag to be efficient.

type t
val equal : t -> t -> bool
val compare : t -> t -> int
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state

A state used to create new terms. It is where the hashconsing table should live, along with other all-terms related state.

val ty : t -> Ty.t
val bool : state -> bool -> t

build true/false

val as_bool : t -> bool option

as_bool t is Some true if t is the term true, and similarly for false. For other terms it is None.

val abs : state -> t -> t * bool

abs t returns an "absolute value" for the term, along with the sign of t.

The idea is that we want to turn not a into (a, false), or (a != b) into (a=b, false). For terms without a negation this should return (t, true).

The state is passed in case a new term needs to be created.

val map_shallow : state -> (t -> t) -> t -> t

Map function on immediate subterms. This should not be recursive.

val iter_dag : t -> (t -> unit) -> unit

iter_dag t f calls f once on each subterm of t, t included. It must not traverse t as a tree, but rather as a perfectly shared DAG.

For example, in:

let x = 2 in
+let y = f x x in
+let z = g y x in
+z = z

the DAG has the following nodes:

n1: 2
+n2: f n1 n1
+n3: g n2 n1
+n4: = n3 n3
module Tbl : CCHashtbl.S with type Tbl.key = t
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/T/Ty/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/T/Ty/index.html new file mode 100644 index 00000000..4b0a7de6 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/T/Ty/index.html @@ -0,0 +1,2 @@ + +Ty (sidekick.Sidekick_arith_lra.S.A.S.T.Ty)

Module T.Ty

Types

Types should be comparable (ideally, in O(1)), and have at least a boolean type available.

type t
val equal : t -> t -> bool
val hash : t -> int
val pp : t Sidekick_core.Fmt.printer
type state
val bool : state -> t
val is_bool : t -> bool
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/T/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/T/index.html new file mode 100644 index 00000000..8c053da9 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/T/index.html @@ -0,0 +1,2 @@ + +T (sidekick.Sidekick_arith_lra.S.A.S.T)

Module S.T

module Fun : sig ... end

A function symbol, like "f" or "plus" or "is_human" or "socrates"

module Ty : sig ... end

Types

module Term : sig ... end

Term structure.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Unknown/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Unknown/index.html new file mode 100644 index 00000000..5a7bc5cc --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/Unknown/index.html @@ -0,0 +1,2 @@ + +Unknown (sidekick.Sidekick_arith_lra.S.A.S.Unknown)

Module S.Unknown

type t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/index.html new file mode 100644 index 00000000..8c33e93f --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra.S.A.S)

Module A.S

module P : Sidekick_core.PROOF with type term = T.Term.t
module Lit : Sidekick_core.LIT with module T = T
module Solver_internal : Sidekick_core.SOLVER_INTERNAL with module T = T and module P = P and module Lit = Lit

Internal solver, available to theories.

type t

The solver's state.

type solver = t
type term = T.Term.t
type ty = T.Ty.t
type lit = Lit.t
type proof = P.t
module type THEORY = sig ... end
type theory = (module THEORY)

A theory that can be used for this particular solver.

type 'a theory_p = (module THEORY with type t = 'a)

A theory that can be used for this particular solver, with state of type 'a.

val mk_theory : name:string -> create_and_setup:(Solver_internal.t -> 'th) -> ?⁠push_level:('th -> unit) -> ?⁠pop_levels:('th -> int -> unit) -> unit -> theory

Helper to create a theory.

module Atom : sig ... end
module Model : sig ... end

Models

module Unknown : sig ... end

Main API

val stats : t -> Sidekick_util.Stat.t
val tst : t -> T.Term.state
val ty_st : t -> T.Ty.state
val create : ?⁠stat:Sidekick_util.Stat.t -> ?⁠size:[ `Big | `Tiny | `Small ] -> ?⁠store_proof:bool -> theories:theory list -> T.Term.state -> T.Ty.state -> unit -> t

Create a new solver.

It needs a term state and a type state to manipulate terms and types. All terms and types interacting with this solver will need to come from these exact states.

parameter store_proof

if true, proofs from the SAT solver and theories are retained and potentially accessible after solve returns UNSAT.

parameter size

influences the size of initial allocations.

parameter theories

theories to load from the start. Other theories can be added using add_theory.

val add_theory : t -> theory -> unit

Add a theory to the solver. This should be called before any call to solve or to add_clause and the likes (otherwise the theory will have a partial view of the problem).

val add_theory_p : t -> 'a theory_p -> 'a

Add the given theory and obtain its state

val add_theory_l : t -> theory list -> unit
val mk_atom_lit : t -> lit -> Atom.t * P.t

mk_atom_lit _ lit returns atom, pr where atom is an internal atom for the solver, and pr is a proof of |- lit = atom

val mk_atom_t : t -> ?⁠sign:bool -> term -> Atom.t * P.t

mk_atom_t _ ~sign t returns atom, pr where atom is an internal representation of ± t, and pr is a proof of |- atom = (± t)

val add_clause : t -> Atom.t Sidekick_util.IArray.t -> P.t -> unit

add_clause solver cs adds a boolean clause to the solver. Subsequent calls to solve will need to satisfy this clause.

val add_clause_l : t -> Atom.t list -> P.t -> unit

Add a clause to the solver, given as a list.

module Pre_proof : sig ... end
type res =
| Sat of Model.t

Satisfiable

| Unsat of {
proof : Pre_proof.t option lazy_t;

proof of unsat

unsat_core : Atom.t list lazy_t;

subset of assumptions responsible for unsat

}

Unsatisfiable

| Unknown of Unknown.t

Unknown, obtained after a timeout, memory limit, etc.

Result of solving for the current set of clauses

val solve : ?⁠on_exit:(unit -> unit) list -> ?⁠check:bool -> ?⁠on_progress:(t -> unit) -> assumptions:Atom.t list -> t -> res

solve s checks the satisfiability of the clauses added so far to s.

parameter check

if true, the model is checked before returning.

parameter on_progress

called regularly during solving.

parameter assumptions

a set of atoms held to be true. The unsat core, if any, will be a subset of assumptions.

parameter on_exit

functions to be run before this returns

val pp_stats : t CCFormat.printer

Print some statistics. What it prints exactly is unspecified.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/module-type-THEORY/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/module-type-THEORY/index.html new file mode 100644 index 00000000..7a0698d6 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/A/S/module-type-THEORY/index.html @@ -0,0 +1,2 @@ + +THEORY (sidekick.Sidekick_arith_lra.S.A.S.THEORY)

Module type S.THEORY

A theory

Theories are abstracted over the concrete implementation of the solver, so they can work with any implementation.

Typically a theory should be a functor taking an argument containing a SOLVER_INTERNAL or even a full SOLVER, and some additional views on terms, literals, etc. that are specific to the theory (e.g. to map terms to linear expressions). The theory can then be instantiated on any kind of solver for any term representation that also satisfies the additional theory-specific requirements. Instantiated theories (ie values of type Sidekick_core.SOLVER.theory) can be added to the solver.

type t

The theory's state

val name : string

Name of the theory (ideally, unique and short)

val create_and_setup : Solver_internal.t -> t

Instantiate the theory's state for the given (internal) solver, register callbacks, create keys, etc.

Called once for every solver this theory is added to.

val push_level : t -> unit

Push backtracking level. When the corresponding pop is called, the theory's state should be restored to a state equivalent to what it was just before push_level.

it does not have to be exactly the same state, it just needs to be equivalent.

val pop_levels : t -> int -> unit

pop_levels theory n pops n backtracking levels, restoring theory to its state before calling push_level n times.

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

Module S.A

module Q : RATIONAL
type term = S.T.Term.t
type ty = S.T.Ty.t
val view_as_lra : term -> (Q.tterm) lra_view

Project the term into the theory view

val mk_bool : S.T.Term.state -> bool -> term
val mk_lra : S.T.Term.state -> (Q.tterm) lra_view -> term

Make a term from the given theory view

val ty_lra : S.T.Term.state -> ty
val mk_eq : S.T.Term.state -> term -> term -> term

syntactic equality

val has_ty_real : term -> bool

Does this term have the type Real

val proof_lra : S.P.lit Iter.t -> S.P.t

TODO: more accurate certificates

val proof_lra_l : S.P.lit list -> S.P.t
module Gensym : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra/module-type-S/index.html b/dev/sidekick/Sidekick_arith_lra/module-type-S/index.html new file mode 100644 index 00000000..fb0a59cc --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra.S)

Module type Sidekick_arith_lra.S

module A : ARG
type state
val create : ?⁠stat:Sidekick_util.Stat.t -> A.S.T.Term.state -> A.S.T.Ty.state -> state
val theory : A.S.theory
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Config/.dune-keep b/dev/sidekick/Sidekick_arith_lra__/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_base_term__Config/.dune-keep rename to dev/sidekick/Sidekick_arith_lra__/.dune-keep diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Comb/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Comb/Infix/index.html new file mode 100644 index 00000000..11460af4 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Comb/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__.Linear_expr.Make.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Comb/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Comb/index.html new file mode 100644 index 00000000..bd0b4f52 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Comb/index.html @@ -0,0 +1,2 @@ + +Comb (sidekick.Sidekick_arith_lra__.Linear_expr.Make.Comb)

Module Make.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Constr/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Constr/index.html new file mode 100644 index 00000000..20b39280 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Constr/index.html @@ -0,0 +1,2 @@ + +Constr (sidekick.Sidekick_arith_lra__.Linear_expr.Make.Constr)

Module Make.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Expr/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Expr/Infix/index.html new file mode 100644 index 00000000..c1b9ba26 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Expr/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__.Linear_expr.Make.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Expr/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Expr/index.html new file mode 100644 index 00000000..d370ddee --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/Expr/index.html @@ -0,0 +1,2 @@ + +Expr (sidekick.Sidekick_arith_lra__.Linear_expr.Make.Expr)

Module Make.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/argument-1-C/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/argument-1-C/index.html new file mode 100644 index 00000000..2b325293 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/argument-1-C/index.html @@ -0,0 +1,2 @@ + +1-C (sidekick.Sidekick_arith_lra__.Linear_expr.Make.1-C)

Parameter Make.1-C

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/argument-2-Var/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/argument-2-Var/index.html new file mode 100644 index 00000000..b88f9483 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/argument-2-Var/index.html @@ -0,0 +1,2 @@ + +2-Var (sidekick.Sidekick_arith_lra__.Linear_expr.Make.2-Var)

Parameter Make.2-Var

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/index.html new file mode 100644 index 00000000..8002a63e --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/Make/index.html @@ -0,0 +1,2 @@ + +Make (sidekick.Sidekick_arith_lra__.Linear_expr.Make)

Module Linear_expr.Make

Parameters

Signature

module C = C

Coeficients used. Can be integers as well as rationals.

module Var = Var

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map = CCMap.Make(Var)

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/index.html new file mode 100644 index 00000000..e7ffea1b --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/index.html @@ -0,0 +1,2 @@ + +Linear_expr (sidekick.Sidekick_arith_lra__.Linear_expr)

Module Sidekick_arith_lra__.Linear_expr

type nonrec bool_op = Sidekick_arith_lra__.Linear_expr_intf.bool_op =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
module Make : functor (C : COEFF) -> functor (Var : VAR) -> S with module C = C and module Var = Var and module Var_map = CCMap.Make(Var)
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-COEFF/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-COEFF/index.html new file mode 100644 index 00000000..38e12607 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-COEFF/index.html @@ -0,0 +1,2 @@ + +COEFF (sidekick.Sidekick_arith_lra__.Linear_expr.COEFF)

Module type Linear_expr.COEFF

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/C/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/C/index.html new file mode 100644 index 00000000..0e75e447 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/C/index.html @@ -0,0 +1,2 @@ + +C (sidekick.Sidekick_arith_lra__.Linear_expr.S.C)

Module S.C

Coeficients used. Can be integers as well as rationals.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Comb/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Comb/Infix/index.html new file mode 100644 index 00000000..21301a69 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Comb/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__.Linear_expr.S.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Comb/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Comb/index.html new file mode 100644 index 00000000..6209ce2a --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Comb/index.html @@ -0,0 +1,2 @@ + +Comb (sidekick.Sidekick_arith_lra__.Linear_expr.S.Comb)

Module S.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Constr/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Constr/index.html new file mode 100644 index 00000000..ddb90f16 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Constr/index.html @@ -0,0 +1,2 @@ + +Constr (sidekick.Sidekick_arith_lra__.Linear_expr.S.Constr)

Module S.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Expr/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Expr/Infix/index.html new file mode 100644 index 00000000..1313cf72 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Expr/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__.Linear_expr.S.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Expr/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Expr/index.html new file mode 100644 index 00000000..072cba46 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Expr/index.html @@ -0,0 +1,2 @@ + +Expr (sidekick.Sidekick_arith_lra__.Linear_expr.S.Expr)

Module S.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Var/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Var/index.html new file mode 100644 index 00000000..835c3622 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/Var/index.html @@ -0,0 +1,2 @@ + +Var (sidekick.Sidekick_arith_lra__.Linear_expr.S.Var)

Module S.Var

Variables used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/index.html new file mode 100644 index 00000000..fbef19e4 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra__.Linear_expr.S)

Module type Linear_expr.S

module C : Sidekick_arith_lra__.Linear_expr_intf.COEFF

Coeficients used. Can be integers as well as rationals.

module Var : Sidekick_arith_lra__.Linear_expr_intf.VAR

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-VAR/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-VAR/index.html new file mode 100644 index 00000000..bb876032 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr/module-type-VAR/index.html @@ -0,0 +1,2 @@ + +VAR (sidekick.Sidekick_arith_lra__.Linear_expr.VAR)

Module type Linear_expr.VAR

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/index.html new file mode 100644 index 00000000..e2115566 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/index.html @@ -0,0 +1,2 @@ + +Linear_expr_intf (sidekick.Sidekick_arith_lra__.Linear_expr_intf)

Module Sidekick_arith_lra__.Linear_expr_intf

Linear expressions interface

module type COEFF = sig ... end
module type VAR = sig ... end
type bool_op = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq

Linear expressions & formulas

module type S = sig ... end

Linear expressions & formulas.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-COEFF/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-COEFF/index.html new file mode 100644 index 00000000..645eb006 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-COEFF/index.html @@ -0,0 +1,2 @@ + +COEFF (sidekick.Sidekick_arith_lra__.Linear_expr_intf.COEFF)

Module type Linear_expr_intf.COEFF

Coefficients

Coefficients are used in expressions. They usually are either rationals, or integers.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/C/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/C/index.html new file mode 100644 index 00000000..1805a07f --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/C/index.html @@ -0,0 +1,2 @@ + +C (sidekick.Sidekick_arith_lra__.Linear_expr_intf.S.C)

Module S.C

Coeficients used. Can be integers as well as rationals.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Comb/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Comb/Infix/index.html new file mode 100644 index 00000000..03f829cb --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Comb/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__.Linear_expr_intf.S.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Comb/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Comb/index.html new file mode 100644 index 00000000..bc9f55ca --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Comb/index.html @@ -0,0 +1,2 @@ + +Comb (sidekick.Sidekick_arith_lra__.Linear_expr_intf.S.Comb)

Module S.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Constr/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Constr/index.html new file mode 100644 index 00000000..1c7f3d01 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Constr/index.html @@ -0,0 +1,2 @@ + +Constr (sidekick.Sidekick_arith_lra__.Linear_expr_intf.S.Constr)

Module S.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> bool_op -> t
val make : Comb.t -> bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Expr/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Expr/Infix/index.html new file mode 100644 index 00000000..3b8bb63b --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Expr/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__.Linear_expr_intf.S.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Expr/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Expr/index.html new file mode 100644 index 00000000..df4c15e5 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Expr/index.html @@ -0,0 +1,2 @@ + +Expr (sidekick.Sidekick_arith_lra__.Linear_expr_intf.S.Expr)

Module S.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Var/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Var/index.html new file mode 100644 index 00000000..06103677 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/Var/index.html @@ -0,0 +1,2 @@ + +Var (sidekick.Sidekick_arith_lra__.Linear_expr_intf.S.Var)

Module S.Var

Variables used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/index.html new file mode 100644 index 00000000..1f97e9da --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra__.Linear_expr_intf.S)

Module type Linear_expr_intf.S

Linear expressions & formulas.

This modules defines linear expressions (which are linear combinations of variables), and linear constraints, where the value of a linear expressions is constrained.

module C : COEFF

Coeficients used. Can be integers as well as rationals.

module Var : VAR

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-VAR/index.html b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-VAR/index.html new file mode 100644 index 00000000..71d8eed3 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Linear_expr_intf/module-type-VAR/index.html @@ -0,0 +1,2 @@ + +VAR (sidekick.Sidekick_arith_lra__.Linear_expr_intf.VAR)

Module type Linear_expr_intf.VAR

Variable interface

Standard interface for variables that are meant to be used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Predicate/index.html b/dev/sidekick/Sidekick_arith_lra__/Predicate/index.html new file mode 100644 index 00000000..44d25bd8 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Predicate/index.html @@ -0,0 +1,2 @@ + +Predicate (sidekick.Sidekick_arith_lra__.Predicate)

Module Sidekick_arith_lra__.Predicate

type t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
val neg : t -> t
val neg_sign : t -> t
val to_string : t -> string
val pp : Sidekick_util.Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/Constraint/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/Constraint/index.html new file mode 100644 index 00000000..13cafce1 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/Constraint/index.html @@ -0,0 +1,2 @@ + +Constraint (sidekick.Sidekick_arith_lra__.Simplex2.Make.Constraint)

Module Make.Constraint

type op = Op.t
type t = {
op : op;
lhs : V.t;
rhs : num;
}

A constraint is the comparison of a variable to a constant.

val mk : V.t -> op -> num -> t
val leq : V.t -> num -> t
val lt : V.t -> num -> t
val geq : V.t -> num -> t
val gt : V.t -> num -> t
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/Subst/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/Subst/index.html new file mode 100644 index 00000000..77bc1543 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/Subst/index.html @@ -0,0 +1,2 @@ + +Subst (sidekick.Sidekick_arith_lra__.Simplex2.Make.Subst)

Module Make.Subst

type t = num V_map.t
val eval : t -> V.t -> Q.t
val pp : t Sidekick_util.Fmt.printer
val to_string : t -> string
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/Unsat_cert/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/Unsat_cert/index.html new file mode 100644 index 00000000..ce0a25d4 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/Unsat_cert/index.html @@ -0,0 +1,2 @@ + +Unsat_cert (sidekick.Sidekick_arith_lra__.Simplex2.Make.Unsat_cert)

Module Make.Unsat_cert

type t = unsat_cert
val lits : t -> V.lit list
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/argument-1-Q/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/argument-1-Q/index.html new file mode 100644 index 00000000..50ec397f --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/argument-1-Q/index.html @@ -0,0 +1,2 @@ + +1-Q (sidekick.Sidekick_arith_lra__.Simplex2.Make.1-Q)

Parameter Make.1-Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/argument-2-Var/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/argument-2-Var/index.html new file mode 100644 index 00000000..200ad723 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/argument-2-Var/index.html @@ -0,0 +1,2 @@ + +2-Var (sidekick.Sidekick_arith_lra__.Simplex2.Make.2-Var)

Parameter Make.2-Var

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/index.html new file mode 100644 index 00000000..53a7d11e --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Make/index.html @@ -0,0 +1,2 @@ + +Make (sidekick.Sidekick_arith_lra__.Simplex2.Make)

Module Simplex2.Make

Parameters

Signature

module V = Var
module V_map : CCMap.S with type V_map.key = V.t
module Q = Q
type num = Q.t

Numbers

module Constraint : sig ... end
module Subst : sig ... end
type t
val create : ?⁠stat:Sidekick_util.Stat.t -> unit -> t

Create a new simplex.

val push_level : t -> unit
val pop_levels : t -> int -> unit
val define : t -> V.t -> (num * V.t) list -> unit

Define a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t

type unsat_cert
module Unsat_cert : sig ... end
exception E_unsat of Unsat_cert.t
type ev_on_propagate = V.lit -> reason:V.lit list -> unit
val add_var : t -> V.t -> unit

Make sure the variable exists in the simplex.

val add_constraint : on_propagate:ev_on_propagate -> t -> Constraint.t -> V.lit -> unit

Add a constraint to the simplex.

raises Unsat

if it's immediately obvious that this is not satisfiable.

val declare_bound : t -> Constraint.t -> V.lit -> unit

Declare that this constraint exists, so we can possibly propagate it. Unlike add_constraint this does NOT assert that the constraint is true

val check_exn : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> unit

Check the whole simplex for satisfiability.

parameter on_propagate

is called with arguments lit, reason whenever reason => lit is found to be true by the simplex.

raises Unsat

if the constraints are not satisfiable.

type result =
| Sat of Subst.t
| Unsat of Unsat_cert.t
val check : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> result

Call check_exn and return a model or a proof of unsat.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/Op/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Op/index.html new file mode 100644 index 00000000..08a1feb2 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/Op/index.html @@ -0,0 +1,2 @@ + +Op (sidekick.Sidekick_arith_lra__.Simplex2.Op)

Module Simplex2.Op

Basic operator

type t =
| Leq
| Lt
| Geq
| Gt
val neg_sign : t -> t
val not_ : t -> t
val to_string : t -> string
val pp : Sidekick_util.Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/index.html new file mode 100644 index 00000000..83d46a67 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/index.html @@ -0,0 +1,2 @@ + +Simplex2 (sidekick.Sidekick_arith_lra__.Simplex2)

Module Sidekick_arith_lra__.Simplex2

Fast Simplex for CDCL(T)

We follow the paper "Integrating Simplex with DPLL(T )" from de Moura and Dutertre.

module Op : sig ... end
module type S = sig ... end
module Make : functor (Q : RATIONAL) -> functor (Var : VAR) -> S with module V = Var and module Q = Q
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-RATIONAL/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-RATIONAL/index.html new file mode 100644 index 00000000..da7442ef --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-RATIONAL/index.html @@ -0,0 +1,2 @@ + +RATIONAL (sidekick.Sidekick_arith_lra__.Simplex2.RATIONAL)

Module type Simplex2.RATIONAL

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/Constraint/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/Constraint/index.html new file mode 100644 index 00000000..e1c738e3 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/Constraint/index.html @@ -0,0 +1,2 @@ + +Constraint (sidekick.Sidekick_arith_lra__.Simplex2.S.Constraint)

Module S.Constraint

type op = Op.t
type t = {
op : op;
lhs : V.t;
rhs : num;
}

A constraint is the comparison of a variable to a constant.

val mk : V.t -> op -> num -> t
val leq : V.t -> num -> t
val lt : V.t -> num -> t
val geq : V.t -> num -> t
val gt : V.t -> num -> t
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/Q/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/Q/index.html new file mode 100644 index 00000000..7985acd9 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/Q/index.html @@ -0,0 +1,2 @@ + +Q (sidekick.Sidekick_arith_lra__.Simplex2.S.Q)

Module S.Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/Subst/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/Subst/index.html new file mode 100644 index 00000000..23e68b76 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/Subst/index.html @@ -0,0 +1,2 @@ + +Subst (sidekick.Sidekick_arith_lra__.Simplex2.S.Subst)

Module S.Subst

type t = num V_map.t
val eval : t -> V.t -> Q.t
val pp : t Sidekick_util.Fmt.printer
val to_string : t -> string
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/Unsat_cert/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/Unsat_cert/index.html new file mode 100644 index 00000000..f9ac8653 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/Unsat_cert/index.html @@ -0,0 +1,2 @@ + +Unsat_cert (sidekick.Sidekick_arith_lra__.Simplex2.S.Unsat_cert)

Module S.Unsat_cert

type t = unsat_cert
val lits : t -> V.lit list
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/V/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/V/index.html new file mode 100644 index 00000000..8773da76 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/V/index.html @@ -0,0 +1,2 @@ + +V (sidekick.Sidekick_arith_lra__.Simplex2.S.V)

Module S.V

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/index.html new file mode 100644 index 00000000..bd45622a --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra__.Simplex2.S)

Module type Simplex2.S

module V : VAR
module V_map : CCMap.S with type V_map.key = V.t
module Q : RATIONAL
type num = Q.t

Numbers

module Constraint : sig ... end
module Subst : sig ... end
type t
val create : ?⁠stat:Sidekick_util.Stat.t -> unit -> t

Create a new simplex.

val push_level : t -> unit
val pop_levels : t -> int -> unit
val define : t -> V.t -> (num * V.t) list -> unit

Define a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t

type unsat_cert
module Unsat_cert : sig ... end
exception E_unsat of Unsat_cert.t
type ev_on_propagate = V.lit -> reason:V.lit list -> unit
val add_var : t -> V.t -> unit

Make sure the variable exists in the simplex.

val add_constraint : on_propagate:ev_on_propagate -> t -> Constraint.t -> V.lit -> unit

Add a constraint to the simplex.

raises Unsat

if it's immediately obvious that this is not satisfiable.

val declare_bound : t -> Constraint.t -> V.lit -> unit

Declare that this constraint exists, so we can possibly propagate it. Unlike add_constraint this does NOT assert that the constraint is true

val check_exn : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> unit

Check the whole simplex for satisfiability.

parameter on_propagate

is called with arguments lit, reason whenever reason => lit is found to be true by the simplex.

raises Unsat

if the constraints are not satisfiable.

type result =
| Sat of Subst.t
| Unsat of Unsat_cert.t
val check : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> result

Call check_exn and return a model or a proof of unsat.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-VAR/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-VAR/index.html new file mode 100644 index 00000000..f2744af8 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex2/module-type-VAR/index.html @@ -0,0 +1,2 @@ + +VAR (sidekick.Sidekick_arith_lra__.Simplex2.VAR)

Module type Simplex2.VAR

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/index.html new file mode 100644 index 00000000..9012b9e0 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/index.html @@ -0,0 +1,2 @@ + +Simplex_intf (sidekick.Sidekick_arith_lra__.Simplex_intf)

Module Sidekick_arith_lra__.Simplex_intf

Modular and incremental implementation of the general simplex

module type S = sig ... end
module type S_FULL = sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-RATIONAL/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-RATIONAL/index.html new file mode 100644 index 00000000..405a78f4 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-RATIONAL/index.html @@ -0,0 +1,2 @@ + +RATIONAL (sidekick.Sidekick_arith_lra__.Simplex_intf.RATIONAL)

Module type Simplex_intf.RATIONAL

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S/Q/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S/Q/index.html new file mode 100644 index 00000000..5db67026 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S/Q/index.html @@ -0,0 +1,2 @@ + +Q (sidekick.Sidekick_arith_lra__.Simplex_intf.S.Q)

Module S.Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S/index.html new file mode 100644 index 00000000..e8226a75 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra__.Simplex_intf.S)

Module type Simplex_intf.S

module Q : RATIONAL
type var

The given type of the variables

module Var_map : CCMap.S with type Var_map.key = var

A map on variables

type param

Parameter required at the creation of the simplex

type lit
type t

The type of a (possibly not solved) linear system

type cert = {
cert_var : var;
cert_expr : (Q.t * var) list;
}

An unsatisfiability explanation is a couple (x, expr). If expr is the empty list, then there is a contradiction between two given bounds of x. Else, the explanation is an equality x = expr that is valid (it can be derived from the original equations of the system) from which a bound can be deduced which contradicts an already given bound of the system.

type res =
| Solution of Q.t Var_map.t
| Unsatisfiable of cert

Generic type returned when solving the simplex. A solution is a list of bindings that satisfies all the constraints inside the system. If the system is unsatisfiable, an explanation of type 'cert is returned.

Simplex construction

val create : param -> t

The empty system.

parameter fresh

the state for generating fresh variables on demand.

val add_eq : t -> (var * (Q.t * var) list) -> unit

add_eq s (x, eq) adds the equation x=eq to s

val add_bounds : t -> ?⁠strict_lower:bool -> ?⁠strict_upper:bool -> ?⁠lower_reason:lit -> ?⁠upper_reason:lit -> (var * Q.t * Q.t) -> unit

add_bounds (x, lower, upper) adds to s the bounds lower and upper for the given variable x. If the bound is loose on one side (no upper bounds for instance), the values Q.inf and Q.minus_inf can be used. By default, in a system, all variables have no bounds, i.e have lower bound Q.minus_inf and upper bound Q.inf. Optional parameters allow to make the the bounds strict. Defaults to false, so that bounds are large by default.

val add_lower_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit
val add_upper_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit

Simplex solving

val solve : t -> res

solve s solves the system s and returns a solution, if one exists. This function may change the internal representation of the system to that of an equivalent one (permutation of basic and non basic variables and pivot operation on the tableaux).

val check_cert : t -> cert -> [ `Ok of lit list | `Bad_bounds of string * string | `Diff_not_0 of Q.t Var_map.t ]

checks that the certificat indeed yields to a contradiction in the current state of the simplex.

returns

`Ok unsat_core if the certificate is valid.

val pp_cert : cert CCFormat.printer
val pp_full_state : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/C/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/C/index.html new file mode 100644 index 00000000..6f43d402 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/C/index.html @@ -0,0 +1,2 @@ + +C (sidekick.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.C)

Module L.C

Coeficients used. Can be integers as well as rationals.

type t = Q.t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Comb/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Comb/Infix/index.html new file mode 100644 index 00000000..f035f7a7 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Comb/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Comb/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Comb/index.html new file mode 100644 index 00000000..306848a8 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Comb/index.html @@ -0,0 +1,2 @@ + +Comb (sidekick.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.Comb)

Module L.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Constr/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Constr/index.html new file mode 100644 index 00000000..cd64caaf --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Constr/index.html @@ -0,0 +1,2 @@ + +Constr (sidekick.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.Constr)

Module L.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Expr/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Expr/Infix/index.html new file mode 100644 index 00000000..e00353fd --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Expr/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Expr/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Expr/index.html new file mode 100644 index 00000000..2dac3338 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Expr/index.html @@ -0,0 +1,2 @@ + +Expr (sidekick.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.Expr)

Module L.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Var/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Var/index.html new file mode 100644 index 00000000..af496e99 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/Var/index.html @@ -0,0 +1,2 @@ + +Var (sidekick.Sidekick_arith_lra__.Simplex_intf.S_FULL.L.Var)

Module L.Var

Variables used in expressions.

type t = var

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit = lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/index.html new file mode 100644 index 00000000..585395c7 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/L/index.html @@ -0,0 +1,2 @@ + +L (sidekick.Sidekick_arith_lra__.Simplex_intf.S_FULL.L)

Module S_FULL.L

module C : Sidekick_arith_lra__.Linear_expr_intf.COEFF with type t = Q.t

Coeficients used. Can be integers as well as rationals.

module Var : Sidekick_arith_lra__.Linear_expr_intf.VAR with type t = var and type lit = lit

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/Q/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/Q/index.html new file mode 100644 index 00000000..0d992909 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/Q/index.html @@ -0,0 +1,2 @@ + +Q (sidekick.Sidekick_arith_lra__.Simplex_intf.S_FULL.Q)

Module S_FULL.Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/index.html b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/index.html new file mode 100644 index 00000000..15dcecfe --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__/Simplex_intf/module-type-S_FULL/index.html @@ -0,0 +1,2 @@ + +S_FULL (sidekick.Sidekick_arith_lra__.Simplex_intf.S_FULL)

Module type Simplex_intf.S_FULL

include S
module Q : RATIONAL
type var

The given type of the variables

module Var_map : CCMap.S with type Var_map.key = var

A map on variables

type param

Parameter required at the creation of the simplex

type lit
type t

The type of a (possibly not solved) linear system

type cert = {
cert_var : var;
cert_expr : (Q.t * var) list;
}

An unsatisfiability explanation is a couple (x, expr). If expr is the empty list, then there is a contradiction between two given bounds of x. Else, the explanation is an equality x = expr that is valid (it can be derived from the original equations of the system) from which a bound can be deduced which contradicts an already given bound of the system.

type res =
| Solution of Q.t Var_map.t
| Unsatisfiable of cert

Generic type returned when solving the simplex. A solution is a list of bindings that satisfies all the constraints inside the system. If the system is unsatisfiable, an explanation of type 'cert is returned.

Simplex construction

val create : param -> t

The empty system.

parameter fresh

the state for generating fresh variables on demand.

val add_eq : t -> (var * (Q.t * var) list) -> unit

add_eq s (x, eq) adds the equation x=eq to s

val add_bounds : t -> ?⁠strict_lower:bool -> ?⁠strict_upper:bool -> ?⁠lower_reason:lit -> ?⁠upper_reason:lit -> (var * Q.t * Q.t) -> unit

add_bounds (x, lower, upper) adds to s the bounds lower and upper for the given variable x. If the bound is loose on one side (no upper bounds for instance), the values Q.inf and Q.minus_inf can be used. By default, in a system, all variables have no bounds, i.e have lower bound Q.minus_inf and upper bound Q.inf. Optional parameters allow to make the the bounds strict. Defaults to false, so that bounds are large by default.

val add_lower_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit
val add_upper_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit

Simplex solving

val solve : t -> res

solve s solves the system s and returns a solution, if one exists. This function may change the internal representation of the system to that of an equivalent one (permutation of basic and non basic variables and pivot operation on the tableaux).

val check_cert : t -> cert -> [ `Ok of lit list | `Bad_bounds of string * string | `Diff_not_0 of Q.t Var_map.t ]

checks that the certificat indeed yields to a contradiction in the current state of the simplex.

returns

`Ok unsat_core if the certificate is valid.

val pp_cert : cert CCFormat.printer
val pp_full_state : t CCFormat.printer
module L : Sidekick_arith_lra__.Linear_expr_intf.S with type C.t = Q.t and type Var.t = var and type Var.lit = lit
type op = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
type constr = L.Constr.t
val add_constr : t -> constr -> lit -> unit

Add a constraint to a simplex state.

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

Module Sidekick_arith_lra__

module Linear_expr : sig ... end
module Linear_expr_intf : sig ... end
module Predicate : sig ... end
module Simplex2 : sig ... end
module Simplex_intf : sig ... end
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Hashcons/.dune-keep b/dev/sidekick/Sidekick_arith_lra__Linear_expr/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_base_term__Hashcons/.dune-keep rename to dev/sidekick/Sidekick_arith_lra__Linear_expr/.dune-keep diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Comb/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Comb/Infix/index.html new file mode 100644 index 00000000..5e077f86 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Comb/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__Linear_expr.Make.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Comb/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Comb/index.html new file mode 100644 index 00000000..a449c5ef --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Comb/index.html @@ -0,0 +1,2 @@ + +Comb (sidekick.Sidekick_arith_lra__Linear_expr.Make.Comb)

Module Make.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Constr/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Constr/index.html new file mode 100644 index 00000000..c4eb94c4 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Constr/index.html @@ -0,0 +1,2 @@ + +Constr (sidekick.Sidekick_arith_lra__Linear_expr.Make.Constr)

Module Make.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Expr/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Expr/Infix/index.html new file mode 100644 index 00000000..d32ac444 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Expr/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__Linear_expr.Make.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Expr/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Expr/index.html new file mode 100644 index 00000000..e5988be3 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/Expr/index.html @@ -0,0 +1,2 @@ + +Expr (sidekick.Sidekick_arith_lra__Linear_expr.Make.Expr)

Module Make.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/argument-1-C/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/argument-1-C/index.html new file mode 100644 index 00000000..974d8476 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/argument-1-C/index.html @@ -0,0 +1,2 @@ + +1-C (sidekick.Sidekick_arith_lra__Linear_expr.Make.1-C)

Parameter Make.1-C

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/argument-2-Var/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/argument-2-Var/index.html new file mode 100644 index 00000000..425b5b03 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/argument-2-Var/index.html @@ -0,0 +1,2 @@ + +2-Var (sidekick.Sidekick_arith_lra__Linear_expr.Make.2-Var)

Parameter Make.2-Var

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/index.html new file mode 100644 index 00000000..b537d858 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/Make/index.html @@ -0,0 +1,2 @@ + +Make (sidekick.Sidekick_arith_lra__Linear_expr.Make)

Module Sidekick_arith_lra__Linear_expr.Make

Parameters

Signature

module C = C

Coeficients used. Can be integers as well as rationals.

module Var = Var

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map = CCMap.Make(Var)

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/index.html new file mode 100644 index 00000000..485671c0 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/index.html @@ -0,0 +1,2 @@ + +Sidekick_arith_lra__Linear_expr (sidekick.Sidekick_arith_lra__Linear_expr)

Module Sidekick_arith_lra__Linear_expr

Arithmetic expressions

type nonrec bool_op = Sidekick_arith_lra__.Linear_expr_intf.bool_op =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
module Make : functor (C : COEFF) -> functor (Var : VAR) -> S with module C = C and module Var = Var and module Var_map = CCMap.Make(Var)
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-COEFF/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-COEFF/index.html new file mode 100644 index 00000000..805f0273 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-COEFF/index.html @@ -0,0 +1,2 @@ + +COEFF (sidekick.Sidekick_arith_lra__Linear_expr.COEFF)

Module type Sidekick_arith_lra__Linear_expr.COEFF

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/C/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/C/index.html new file mode 100644 index 00000000..6dae991d --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/C/index.html @@ -0,0 +1,2 @@ + +C (sidekick.Sidekick_arith_lra__Linear_expr.S.C)

Module S.C

Coeficients used. Can be integers as well as rationals.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Comb/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Comb/Infix/index.html new file mode 100644 index 00000000..ccdb55f5 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Comb/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__Linear_expr.S.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Comb/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Comb/index.html new file mode 100644 index 00000000..a2042aaf --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Comb/index.html @@ -0,0 +1,2 @@ + +Comb (sidekick.Sidekick_arith_lra__Linear_expr.S.Comb)

Module S.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Constr/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Constr/index.html new file mode 100644 index 00000000..97bf7ff7 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Constr/index.html @@ -0,0 +1,2 @@ + +Constr (sidekick.Sidekick_arith_lra__Linear_expr.S.Constr)

Module S.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Expr/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Expr/Infix/index.html new file mode 100644 index 00000000..3f9a40c6 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Expr/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__Linear_expr.S.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Expr/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Expr/index.html new file mode 100644 index 00000000..9633625d --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Expr/index.html @@ -0,0 +1,2 @@ + +Expr (sidekick.Sidekick_arith_lra__Linear_expr.S.Expr)

Module S.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Var/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Var/index.html new file mode 100644 index 00000000..051e022b --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/Var/index.html @@ -0,0 +1,2 @@ + +Var (sidekick.Sidekick_arith_lra__Linear_expr.S.Var)

Module S.Var

Variables used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/index.html new file mode 100644 index 00000000..42441278 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra__Linear_expr.S)

Module type Sidekick_arith_lra__Linear_expr.S

module C : Sidekick_arith_lra__.Linear_expr_intf.COEFF

Coeficients used. Can be integers as well as rationals.

module Var : Sidekick_arith_lra__.Linear_expr_intf.VAR

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-VAR/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-VAR/index.html new file mode 100644 index 00000000..d0c01fa0 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr/module-type-VAR/index.html @@ -0,0 +1,2 @@ + +VAR (sidekick.Sidekick_arith_lra__Linear_expr.VAR)

Module type Sidekick_arith_lra__Linear_expr.VAR

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__ID/.dune-keep b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_base_term__ID/.dune-keep rename to dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/.dune-keep diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/index.html new file mode 100644 index 00000000..50222eaa --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/index.html @@ -0,0 +1,2 @@ + +Sidekick_arith_lra__Linear_expr_intf (sidekick.Sidekick_arith_lra__Linear_expr_intf)

Module Sidekick_arith_lra__Linear_expr_intf

Linear expressions interface

module type COEFF = sig ... end
module type VAR = sig ... end
type bool_op = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq

Linear expressions & formulas

module type S = sig ... end

Linear expressions & formulas.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-COEFF/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-COEFF/index.html new file mode 100644 index 00000000..c5872751 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-COEFF/index.html @@ -0,0 +1,2 @@ + +COEFF (sidekick.Sidekick_arith_lra__Linear_expr_intf.COEFF)

Module type Sidekick_arith_lra__Linear_expr_intf.COEFF

Coefficients

Coefficients are used in expressions. They usually are either rationals, or integers.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/C/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/C/index.html new file mode 100644 index 00000000..bde043c3 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/C/index.html @@ -0,0 +1,2 @@ + +C (sidekick.Sidekick_arith_lra__Linear_expr_intf.S.C)

Module S.C

Coeficients used. Can be integers as well as rationals.

type t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Comb/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Comb/Infix/index.html new file mode 100644 index 00000000..097de165 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Comb/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__Linear_expr_intf.S.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Comb/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Comb/index.html new file mode 100644 index 00000000..7ac3c107 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Comb/index.html @@ -0,0 +1,2 @@ + +Comb (sidekick.Sidekick_arith_lra__Linear_expr_intf.S.Comb)

Module S.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Constr/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Constr/index.html new file mode 100644 index 00000000..535e2ae7 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Constr/index.html @@ -0,0 +1,2 @@ + +Constr (sidekick.Sidekick_arith_lra__Linear_expr_intf.S.Constr)

Module S.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> bool_op -> t
val make : Comb.t -> bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Expr/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Expr/Infix/index.html new file mode 100644 index 00000000..a8619efa --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Expr/Infix/index.html @@ -0,0 +1,2 @@ + +Infix (sidekick.Sidekick_arith_lra__Linear_expr_intf.S.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Expr/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Expr/index.html new file mode 100644 index 00000000..eac5e67e --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Expr/index.html @@ -0,0 +1,2 @@ + +Expr (sidekick.Sidekick_arith_lra__Linear_expr_intf.S.Expr)

Module S.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Var/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Var/index.html new file mode 100644 index 00000000..01f57bcc --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/Var/index.html @@ -0,0 +1,2 @@ + +Var (sidekick.Sidekick_arith_lra__Linear_expr_intf.S.Var)

Module S.Var

Variables used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/index.html new file mode 100644 index 00000000..76e0efd7 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra__Linear_expr_intf.S)

Module type Sidekick_arith_lra__Linear_expr_intf.S

Linear expressions & formulas.

This modules defines linear expressions (which are linear combinations of variables), and linear constraints, where the value of a linear expressions is constrained.

module C : COEFF

Coeficients used. Can be integers as well as rationals.

module Var : VAR

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-VAR/index.html b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-VAR/index.html new file mode 100644 index 00000000..6cd4264b --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Linear_expr_intf/module-type-VAR/index.html @@ -0,0 +1,2 @@ + +VAR (sidekick.Sidekick_arith_lra__Linear_expr_intf.VAR)

Module type Sidekick_arith_lra__Linear_expr_intf.VAR

Variable interface

Standard interface for variables that are meant to be used in expressions.

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Model/.dune-keep b/dev/sidekick/Sidekick_arith_lra__Predicate/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_base_term__Model/.dune-keep rename to dev/sidekick/Sidekick_arith_lra__Predicate/.dune-keep diff --git a/dev/sidekick/Sidekick_arith_lra__Predicate/index.html b/dev/sidekick/Sidekick_arith_lra__Predicate/index.html new file mode 100644 index 00000000..b0dedd98 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Predicate/index.html @@ -0,0 +1,2 @@ + +Sidekick_arith_lra__Predicate (sidekick.Sidekick_arith_lra__Predicate)

Module Sidekick_arith_lra__Predicate

type t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
val neg : t -> t
val neg_sign : t -> t
val to_string : t -> string
val pp : Sidekick_util.Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_base_term__Proof/.dune-keep b/dev/sidekick/Sidekick_arith_lra__Simplex2/.dune-keep similarity index 100% rename from dev/sidekick-arith/Sidekick_base_term__Proof/.dune-keep rename to dev/sidekick/Sidekick_arith_lra__Simplex2/.dune-keep diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/Constraint/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/Constraint/index.html new file mode 100644 index 00000000..c6c1071d --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/Constraint/index.html @@ -0,0 +1,2 @@ + +Constraint (sidekick.Sidekick_arith_lra__Simplex2.Make.Constraint)

Module Make.Constraint

type op = Op.t
type t = {
op : op;
lhs : V.t;
rhs : num;
}

A constraint is the comparison of a variable to a constant.

val mk : V.t -> op -> num -> t
val leq : V.t -> num -> t
val lt : V.t -> num -> t
val geq : V.t -> num -> t
val gt : V.t -> num -> t
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/Subst/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/Subst/index.html new file mode 100644 index 00000000..5bdca39b --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/Subst/index.html @@ -0,0 +1,2 @@ + +Subst (sidekick.Sidekick_arith_lra__Simplex2.Make.Subst)

Module Make.Subst

type t = num V_map.t
val eval : t -> V.t -> Q.t
val pp : t Sidekick_util.Fmt.printer
val to_string : t -> string
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/Unsat_cert/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/Unsat_cert/index.html new file mode 100644 index 00000000..9601fe86 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/Unsat_cert/index.html @@ -0,0 +1,2 @@ + +Unsat_cert (sidekick.Sidekick_arith_lra__Simplex2.Make.Unsat_cert)

Module Make.Unsat_cert

type t = unsat_cert
val lits : t -> V.lit list
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/argument-1-Q/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/argument-1-Q/index.html new file mode 100644 index 00000000..9934eb8e --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/argument-1-Q/index.html @@ -0,0 +1,2 @@ + +1-Q (sidekick.Sidekick_arith_lra__Simplex2.Make.1-Q)

Parameter Make.1-Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/argument-2-Var/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/argument-2-Var/index.html new file mode 100644 index 00000000..3a9094b2 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/argument-2-Var/index.html @@ -0,0 +1,2 @@ + +2-Var (sidekick.Sidekick_arith_lra__Simplex2.Make.2-Var)

Parameter Make.2-Var

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/index.html new file mode 100644 index 00000000..c47bdaba --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/Make/index.html @@ -0,0 +1,2 @@ + +Make (sidekick.Sidekick_arith_lra__Simplex2.Make)

Module Sidekick_arith_lra__Simplex2.Make

Parameters

Signature

module V = Var
module V_map : CCMap.S with type V_map.key = V.t
module Q = Q
type num = Q.t

Numbers

module Constraint : sig ... end
module Subst : sig ... end
type t
val create : ?⁠stat:Sidekick_util.Stat.t -> unit -> t

Create a new simplex.

val push_level : t -> unit
val pop_levels : t -> int -> unit
val define : t -> V.t -> (num * V.t) list -> unit

Define a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t

type unsat_cert
module Unsat_cert : sig ... end
exception E_unsat of Unsat_cert.t
type ev_on_propagate = V.lit -> reason:V.lit list -> unit
val add_var : t -> V.t -> unit

Make sure the variable exists in the simplex.

val add_constraint : on_propagate:ev_on_propagate -> t -> Constraint.t -> V.lit -> unit

Add a constraint to the simplex.

raises Unsat

if it's immediately obvious that this is not satisfiable.

val declare_bound : t -> Constraint.t -> V.lit -> unit

Declare that this constraint exists, so we can possibly propagate it. Unlike add_constraint this does NOT assert that the constraint is true

val check_exn : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> unit

Check the whole simplex for satisfiability.

parameter on_propagate

is called with arguments lit, reason whenever reason => lit is found to be true by the simplex.

raises Unsat

if the constraints are not satisfiable.

type result =
| Sat of Subst.t
| Unsat of Unsat_cert.t
val check : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> result

Call check_exn and return a model or a proof of unsat.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/Op/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/Op/index.html new file mode 100644 index 00000000..51c0b503 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/Op/index.html @@ -0,0 +1,2 @@ + +Op (sidekick.Sidekick_arith_lra__Simplex2.Op)

Module Sidekick_arith_lra__Simplex2.Op

Basic operator

type t =
| Leq
| Lt
| Geq
| Gt
val neg_sign : t -> t
val not_ : t -> t
val to_string : t -> string
val pp : Sidekick_util.Fmt.t -> t -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/index.html new file mode 100644 index 00000000..6bfe9e5b --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/index.html @@ -0,0 +1,2 @@ + +Sidekick_arith_lra__Simplex2 (sidekick.Sidekick_arith_lra__Simplex2)

Module Sidekick_arith_lra__Simplex2

Fast Simplex for CDCL(T)

We follow the paper "Integrating Simplex with DPLL(T )" from de Moura and Dutertre.

module Op : sig ... end
module type S = sig ... end
module Make : functor (Q : RATIONAL) -> functor (Var : VAR) -> S with module V = Var and module Q = Q
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-RATIONAL/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-RATIONAL/index.html new file mode 100644 index 00000000..b335accc --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-RATIONAL/index.html @@ -0,0 +1,2 @@ + +RATIONAL (sidekick.Sidekick_arith_lra__Simplex2.RATIONAL)

Module type Sidekick_arith_lra__Simplex2.RATIONAL

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/Constraint/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/Constraint/index.html new file mode 100644 index 00000000..4297af4a --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/Constraint/index.html @@ -0,0 +1,2 @@ + +Constraint (sidekick.Sidekick_arith_lra__Simplex2.S.Constraint)

Module S.Constraint

type op = Op.t
type t = {
op : op;
lhs : V.t;
rhs : num;
}

A constraint is the comparison of a variable to a constant.

val mk : V.t -> op -> num -> t
val leq : V.t -> num -> t
val lt : V.t -> num -> t
val geq : V.t -> num -> t
val gt : V.t -> num -> t
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/Q/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/Q/index.html new file mode 100644 index 00000000..4886b75a --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/Q/index.html @@ -0,0 +1,2 @@ + +Q (sidekick.Sidekick_arith_lra__Simplex2.S.Q)

Module S.Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/Subst/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/Subst/index.html new file mode 100644 index 00000000..79a4c631 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/Subst/index.html @@ -0,0 +1,2 @@ + +Subst (sidekick.Sidekick_arith_lra__Simplex2.S.Subst)

Module S.Subst

type t = num V_map.t
val eval : t -> V.t -> Q.t
val pp : t Sidekick_util.Fmt.printer
val to_string : t -> string
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/Unsat_cert/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/Unsat_cert/index.html new file mode 100644 index 00000000..8d68da2e --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/Unsat_cert/index.html @@ -0,0 +1,2 @@ + +Unsat_cert (sidekick.Sidekick_arith_lra__Simplex2.S.Unsat_cert)

Module S.Unsat_cert

type t = unsat_cert
val lits : t -> V.lit list
val pp : t Sidekick_util.Fmt.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/V/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/V/index.html new file mode 100644 index 00000000..634350eb --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/V/index.html @@ -0,0 +1,2 @@ + +V (sidekick.Sidekick_arith_lra__Simplex2.S.V)

Module S.V

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/index.html new file mode 100644 index 00000000..1289698c --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra__Simplex2.S)

Module type Sidekick_arith_lra__Simplex2.S

module V : VAR
module V_map : CCMap.S with type V_map.key = V.t
module Q : RATIONAL
type num = Q.t

Numbers

module Constraint : sig ... end
module Subst : sig ... end
type t
val create : ?⁠stat:Sidekick_util.Stat.t -> unit -> t

Create a new simplex.

val push_level : t -> unit
val pop_levels : t -> int -> unit
val define : t -> V.t -> (num * V.t) list -> unit

Define a basic variable in terms of other variables. This is useful to "name" a linear expression and get back a variable that can be used in a Constraint.t

type unsat_cert
module Unsat_cert : sig ... end
exception E_unsat of Unsat_cert.t
type ev_on_propagate = V.lit -> reason:V.lit list -> unit
val add_var : t -> V.t -> unit

Make sure the variable exists in the simplex.

val add_constraint : on_propagate:ev_on_propagate -> t -> Constraint.t -> V.lit -> unit

Add a constraint to the simplex.

raises Unsat

if it's immediately obvious that this is not satisfiable.

val declare_bound : t -> Constraint.t -> V.lit -> unit

Declare that this constraint exists, so we can possibly propagate it. Unlike add_constraint this does NOT assert that the constraint is true

val check_exn : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> unit

Check the whole simplex for satisfiability.

parameter on_propagate

is called with arguments lit, reason whenever reason => lit is found to be true by the simplex.

raises Unsat

if the constraints are not satisfiable.

type result =
| Sat of Subst.t
| Unsat of Unsat_cert.t
val check : on_propagate:(V.lit -> reason:V.lit list -> unit) -> t -> result

Call check_exn and return a model or a proof of unsat.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-VAR/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-VAR/index.html new file mode 100644 index 00000000..3270e002 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex2/module-type-VAR/index.html @@ -0,0 +1,2 @@ + +VAR (sidekick.Sidekick_arith_lra__Simplex2.VAR)

Module type Sidekick_arith_lra__Simplex2.VAR

type t

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__Intf/.dune-keep b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/.dune-keep similarity index 100% rename from dev/sidekick/Sidekick_util__Intf/.dune-keep rename to dev/sidekick/Sidekick_arith_lra__Simplex_intf/.dune-keep diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex_intf/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/index.html new file mode 100644 index 00000000..b979eacd --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/index.html @@ -0,0 +1,2 @@ + +Sidekick_arith_lra__Simplex_intf (sidekick.Sidekick_arith_lra__Simplex_intf)

Module Sidekick_arith_lra__Simplex_intf

Modular and incremental implementation of the general simplex

module type S = sig ... end
module type S_FULL = sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-RATIONAL/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-RATIONAL/index.html new file mode 100644 index 00000000..a6cfd01c --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-RATIONAL/index.html @@ -0,0 +1,2 @@ + +RATIONAL (sidekick.Sidekick_arith_lra__Simplex_intf.RATIONAL)

Module type Sidekick_arith_lra__Simplex_intf.RATIONAL

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S/Q/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S/Q/index.html new file mode 100644 index 00000000..5e45a941 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S/Q/index.html @@ -0,0 +1,2 @@ + +Q (sidekick.Sidekick_arith_lra__Simplex_intf.S.Q)

Module S.Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S/index.html new file mode 100644 index 00000000..3f912192 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S/index.html @@ -0,0 +1,2 @@ + +S (sidekick.Sidekick_arith_lra__Simplex_intf.S)

Module type Sidekick_arith_lra__Simplex_intf.S

module Q : RATIONAL
type var

The given type of the variables

module Var_map : CCMap.S with type Var_map.key = var

A map on variables

type param

Parameter required at the creation of the simplex

type lit
type t

The type of a (possibly not solved) linear system

type cert = {
cert_var : var;
cert_expr : (Q.t * var) list;
}

An unsatisfiability explanation is a couple (x, expr). If expr is the empty list, then there is a contradiction between two given bounds of x. Else, the explanation is an equality x = expr that is valid (it can be derived from the original equations of the system) from which a bound can be deduced which contradicts an already given bound of the system.

type res =
| Solution of Q.t Var_map.t
| Unsatisfiable of cert

Generic type returned when solving the simplex. A solution is a list of bindings that satisfies all the constraints inside the system. If the system is unsatisfiable, an explanation of type 'cert is returned.

Simplex construction

val create : param -> t

The empty system.

parameter fresh

the state for generating fresh variables on demand.

val add_eq : t -> (var * (Q.t * var) list) -> unit

add_eq s (x, eq) adds the equation x=eq to s

val add_bounds : t -> ?⁠strict_lower:bool -> ?⁠strict_upper:bool -> ?⁠lower_reason:lit -> ?⁠upper_reason:lit -> (var * Q.t * Q.t) -> unit

add_bounds (x, lower, upper) adds to s the bounds lower and upper for the given variable x. If the bound is loose on one side (no upper bounds for instance), the values Q.inf and Q.minus_inf can be used. By default, in a system, all variables have no bounds, i.e have lower bound Q.minus_inf and upper bound Q.inf. Optional parameters allow to make the the bounds strict. Defaults to false, so that bounds are large by default.

val add_lower_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit
val add_upper_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit

Simplex solving

val solve : t -> res

solve s solves the system s and returns a solution, if one exists. This function may change the internal representation of the system to that of an equivalent one (permutation of basic and non basic variables and pivot operation on the tableaux).

val check_cert : t -> cert -> [ `Ok of lit list | `Bad_bounds of string * string | `Diff_not_0 of Q.t Var_map.t ]

checks that the certificat indeed yields to a contradiction in the current state of the simplex.

returns

`Ok unsat_core if the certificate is valid.

val pp_cert : cert CCFormat.printer
val pp_full_state : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/C/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/C/index.html new file mode 100644 index 00000000..b105601c --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/C/index.html @@ -0,0 +1,2 @@ + +C (sidekick.Sidekick_arith_lra__Simplex_intf.S_FULL.L.C)

Module L.C

Coeficients used. Can be integers as well as rationals.

type t = Q.t
val equal : t -> t -> bool

Equality on coefficients.

val compare : t -> t -> int

Comparison on coefficients.

val pp : t Sidekick_util.Fmt.printer

Printer for coefficients.

val zero : t

The zero coefficient.

val one : t

The one coefficient (to rule them all, :p).

val neg : t -> t

Unary negation

val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t

Standard operations on coefficients.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Comb/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Comb/Infix/index.html similarity index 84% rename from dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Comb/Infix/index.html rename to dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Comb/Infix/index.html index 0454fafa..620b0fa9 100644 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Comb/Infix/index.html +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Comb/Infix/index.html @@ -1,2 +1,2 @@ -Infix (sidekick-arith.Sidekick_arith_lra.Linear_expr.Make.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file +Infix (sidekick.Sidekick_arith_lra__Simplex_intf.S_FULL.L.Comb.Infix)

Module Comb.Infix

Infix operations on combinations

This module defines usual operations on linear combinations, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Comb/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Comb/index.html new file mode 100644 index 00000000..7c209d38 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Comb/index.html @@ -0,0 +1,2 @@ + +Comb (sidekick.Sidekick_arith_lra__Simplex_intf.S_FULL.L.Comb)

Module L.Comb

Combinations.

This module defines linear combnations as mapping from variables to coefficients. This allows for very fast computations.

type t

The type of linear combinations.

val compare : t -> t -> int

Comparisons on linear combinations.

val pp : t Sidekick_util.Fmt.printer

Printer for linear combinations.

val is_empty : t -> bool

Is the given expression empty ?

Creation
val empty : t

The empty linear combination.

val monomial : C.t -> var -> t

monome n v creates the linear combination n * v

val monomial1 : var -> t

monome1 v creates the linear combination 1 * v

val as_singleton : t -> (C.t * var) option

as_singleton l returns Some (c,x) if l = c * x, None otherwise

val add : C.t -> var -> t -> t

add n v t adds the monome n * v to the combination t.

module Infix : sig ... end

Infix operations on combinations

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between combinations.

val (-) : t -> t -> t

Substraction between combinations.

val (*) : C.t -> t -> t

Multiplication by a constant.

val iter : (var -> C.t -> unit) -> t -> unit
val of_list : (C.t * var) list -> t
val to_list : t -> (C.t * var) list

Converters to and from lists of monomes.

val of_map : C.t Var_map.t -> t
val to_map : t -> C.t Var_map.t
Semantics
val eval : subst -> t -> C.t

Evaluate a linear combination given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Constr/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Constr/index.html new file mode 100644 index 00000000..404d0f73 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Constr/index.html @@ -0,0 +1,2 @@ + +Constr (sidekick.Sidekick_arith_lra__Simplex_intf.S_FULL.L.Constr)

Module L.Constr

Linear constraints.

Represents constraints on linear expressions.

type op = Sidekick_arith_lra__.Linear_expr_intf.bool_op

Arithmetic comparison operators.

type t = {
expr : Expr.t;
op : op;
}

Linear constraints. Expressions are implicitly compared to zero.

val compare : t -> t -> int

Standard comparison function.

val pp : t Sidekick_util.Fmt.printer

Standard printing function.

val of_expr : Expr.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> t
val make : Comb.t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op -> C.t -> t

Create a constraint from a linear expression/combination and a constant.

val geq : Comb.t -> C.t -> t
val leq : Comb.t -> C.t -> t
val gt : Comb.t -> C.t -> t
val lt : Comb.t -> C.t -> t
val eq : Comb.t -> C.t -> t
val neq : Comb.t -> C.t -> t
val geq0 : Expr.t -> t
val leq0 : Expr.t -> t
val gt0 : Expr.t -> t
val lt0 : Expr.t -> t
val eq0 : Expr.t -> t
val neq0 : Expr.t -> t
val op : t -> Sidekick_arith_lra__.Linear_expr_intf.bool_op
val expr : t -> Expr.t

Extract the given part from a constraint.

val split : t -> Comb.t * Sidekick_arith_lra__.Linear_expr_intf.bool_op * C.t

Split the linear combinations from the constant

val eval : subst -> t -> bool

Evaluate the given constraint under a substitution.

\ No newline at end of file diff --git a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Expr/Infix/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Expr/Infix/index.html similarity index 84% rename from dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Expr/Infix/index.html rename to dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Expr/Infix/index.html index 5f23c6e4..a372193c 100644 --- a/dev/sidekick-arith/Sidekick_arith_lra/Linear_expr/Make/Expr/Infix/index.html +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Expr/Infix/index.html @@ -1,2 +1,2 @@ -Infix (sidekick-arith.Sidekick_arith_lra.Linear_expr.Make.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file +Infix (sidekick.Sidekick_arith_lra__Simplex_intf.S_FULL.L.Expr.Infix)

Module Expr.Infix

Infix operations on expressions

This module defines usual operations on linear expressions, as infix operators to ease reading of complex computations.

val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Expr/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Expr/index.html new file mode 100644 index 00000000..260c092c --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Expr/index.html @@ -0,0 +1,2 @@ + +Expr (sidekick.Sidekick_arith_lra__Simplex_intf.S_FULL.L.Expr)

Module L.Expr

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

type t

The type of linear expressions.

val comb : t -> Comb.t
val const : t -> C.t
val is_zero : t -> bool
val is_const : t -> bool
val compare : t -> t -> int

Standard comparison function on expressions.

val pp : t Sidekick_util.Fmt.printer

Standard printing function on expressions.

val zero : t

The expression 2.

val of_const : C.t -> t

The constant expression.

val of_comb : Comb.t -> t

Combination without constant

val of_list : C.t -> (C.t * Var.t) list -> t
val make : Comb.t -> C.t -> t

make c n makes the linear expression c + n.

val monomial : C.t -> var -> t
val monomial1 : var -> t
module Infix : sig ... end

Infix operations on expressions

Include the previous module.

include module type of Infix
val (+) : t -> t -> t

Addition between expressions.

val (-) : t -> t -> t

Substraction between expressions.

val (*) : C.t -> t -> t

Multiplication by a constant.

Semantics
val eval : subst -> t -> C.t

Evaluate a linear expression given a substitution for its variables. TODO: document potential exceptions raised ?

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Var/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Var/index.html new file mode 100644 index 00000000..51b0e8ea --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/Var/index.html @@ -0,0 +1,2 @@ + +Var (sidekick.Sidekick_arith_lra__Simplex_intf.S_FULL.L.Var)

Module L.Var

Variables used in expressions.

type t = var

Variable type.

val compare : t -> t -> int

Standard comparison function on variables.

val pp : t Sidekick_util.Fmt.printer

Printer for variables.

type lit = lit
val pp_lit : lit Sidekick_util.Fmt.printer
val not_lit : lit -> lit option
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/index.html new file mode 100644 index 00000000..c97a6d08 --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/L/index.html @@ -0,0 +1,2 @@ + +L (sidekick.Sidekick_arith_lra__Simplex_intf.S_FULL.L)

Module S_FULL.L

module C : Sidekick_arith_lra__.Linear_expr_intf.COEFF with type t = Q.t

Coeficients used. Can be integers as well as rationals.

module Var : Sidekick_arith_lra__.Linear_expr_intf.VAR with type t = var and type lit = lit

Variables used in expressions.

type var = Var.t

The type of variables appearing in expressions.

module Var_map : CCMap.S with type Var_map.key = var

Maps from variables, used for expressions as well as substitutions.

type subst = C.t Var_map.t

Type for substitutions.

module Comb : sig ... end

Combinations.

Linear expressions.

module Expr : sig ... end

Linear expressions represent linear arithmetic expressions as a linear combination and a constant.

module Constr : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/Q/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/Q/index.html new file mode 100644 index 00000000..0bf4fcde --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/Q/index.html @@ -0,0 +1,2 @@ + +Q (sidekick.Sidekick_arith_lra__Simplex_intf.S_FULL.Q)

Module S_FULL.Q

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/index.html b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/index.html new file mode 100644 index 00000000..c5ef85bf --- /dev/null +++ b/dev/sidekick/Sidekick_arith_lra__Simplex_intf/module-type-S_FULL/index.html @@ -0,0 +1,2 @@ + +S_FULL (sidekick.Sidekick_arith_lra__Simplex_intf.S_FULL)

Module type Sidekick_arith_lra__Simplex_intf.S_FULL

include S
module Q : RATIONAL
type var

The given type of the variables

module Var_map : CCMap.S with type Var_map.key = var

A map on variables

type param

Parameter required at the creation of the simplex

type lit
type t

The type of a (possibly not solved) linear system

type cert = {
cert_var : var;
cert_expr : (Q.t * var) list;
}

An unsatisfiability explanation is a couple (x, expr). If expr is the empty list, then there is a contradiction between two given bounds of x. Else, the explanation is an equality x = expr that is valid (it can be derived from the original equations of the system) from which a bound can be deduced which contradicts an already given bound of the system.

type res =
| Solution of Q.t Var_map.t
| Unsatisfiable of cert

Generic type returned when solving the simplex. A solution is a list of bindings that satisfies all the constraints inside the system. If the system is unsatisfiable, an explanation of type 'cert is returned.

Simplex construction

val create : param -> t

The empty system.

parameter fresh

the state for generating fresh variables on demand.

val add_eq : t -> (var * (Q.t * var) list) -> unit

add_eq s (x, eq) adds the equation x=eq to s

val add_bounds : t -> ?⁠strict_lower:bool -> ?⁠strict_upper:bool -> ?⁠lower_reason:lit -> ?⁠upper_reason:lit -> (var * Q.t * Q.t) -> unit

add_bounds (x, lower, upper) adds to s the bounds lower and upper for the given variable x. If the bound is loose on one side (no upper bounds for instance), the values Q.inf and Q.minus_inf can be used. By default, in a system, all variables have no bounds, i.e have lower bound Q.minus_inf and upper bound Q.inf. Optional parameters allow to make the the bounds strict. Defaults to false, so that bounds are large by default.

val add_lower_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit
val add_upper_bound : t -> ?⁠strict:bool -> reason:lit -> var -> Q.t -> unit

Simplex solving

val solve : t -> res

solve s solves the system s and returns a solution, if one exists. This function may change the internal representation of the system to that of an equivalent one (permutation of basic and non basic variables and pivot operation on the tableaux).

val check_cert : t -> cert -> [ `Ok of lit list | `Bad_bounds of string * string | `Diff_not_0 of Q.t Var_map.t ]

checks that the certificat indeed yields to a contradiction in the current state of the simplex.

returns

`Ok unsat_core if the certificate is valid.

val pp_cert : cert CCFormat.printer
val pp_full_state : t CCFormat.printer
module L : Sidekick_arith_lra__.Linear_expr_intf.S with type C.t = Q.t and type Var.t = var and type Var.lit = lit
type op = Sidekick_arith_lra.Predicate.t =
| Leq
| Geq
| Lt
| Gt
| Eq
| Neq
type constr = L.Constr.t
val add_constr : t -> constr -> lit -> unit

Add a constraint to a simplex state.

\ 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 5c5ad5d1..4feead72 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_cc.Make.1-A.P)

Module 1-A.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_cc/module-type-S/P/index.html b/dev/sidekick/Sidekick_cc/module-type-S/P/index.html index f7f90f93..6070c51e 100644 --- a/dev/sidekick/Sidekick_cc/module-type-S/P/index.html +++ b/dev/sidekick/Sidekick_cc/module-type-S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_cc.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_cc.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ 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 615c1659..ac77577e 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

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI.P)

Module SI.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/index.html b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/index.html index 69a60957..6c8af844 100644 --- a/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/index.html +++ b/dev/sidekick/Sidekick_core/Monoid_of_repr/argument-1-M/SI/index.html @@ -1,2 +1,2 @@ -SI (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI)

Module 1-M.SI

module T : TERM
module P : PROOF with type term = T.Term.t
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit : LIT with module T = T
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +SI (sidekick.Sidekick_core.Monoid_of_repr.1-M.SI)

Module 1-M.SI

module T : TERM
module P : PROOF with type term = T.Term.t
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit : LIT with module T = T
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ 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 2a8e97cd..5a7a6d5c 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_core.CC_ACTIONS.P)

Module CC_ACTIONS.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ 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 1c228b53..9441160f 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_core.CC_ARG.P)

Module CC_ARG.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ 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 a421a6c1..1b168762 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_core.CC_S.P)

Module CC_S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ 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 de9dda24..9f69e926 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

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_core.MONOID_ARG.SI.P)

Module SI.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/index.html b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/index.html index 25a4a068..5d56df47 100644 --- a/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/index.html +++ b/dev/sidekick/Sidekick_core/module-type-MONOID_ARG/SI/index.html @@ -1,2 +1,2 @@ -SI (sidekick.Sidekick_core.MONOID_ARG.SI)

Module MONOID_ARG.SI

module T : TERM
module P : PROOF with type term = T.Term.t
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit : LIT with module T = T
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +SI (sidekick.Sidekick_core.MONOID_ARG.SI)

Module MONOID_ARG.SI

module T : TERM
module P : PROOF with type term = T.Term.t
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit : LIT with module T = T
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ 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 c5a73b97..bca500ec 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

type term
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer
module Quip : sig ... end
\ No newline at end of file +PROOF (sidekick.Sidekick_core.PROOF)

Module type Sidekick_core.PROOF

type term
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ 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 19c1a0e6..76298c7e 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_core.SOLVER.P)

Module SOLVER.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/index.html index 8259c2a9..78206eec 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_core.SOLVER.Solver_internal)

Module SOLVER.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_core.SOLVER.Solver_internal)

Module SOLVER.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ 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 bc5fba09..51dd2084 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

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_core.SOLVER_INTERNAL.P)

Module SOLVER_INTERNAL.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/index.html b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/index.html index 1efe1816..f90b57b8 100644 --- a/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/index.html +++ b/dev/sidekick/Sidekick_core/module-type-SOLVER_INTERNAL/index.html @@ -1,2 +1,2 @@ -SOLVER_INTERNAL (sidekick.Sidekick_core.SOLVER_INTERNAL)

Module type Sidekick_core.SOLVER_INTERNAL

A view of the solver from a theory's point of view.

Theories should interact with the solver via this module, to assert new lemmas, propagate literals, access the congruence closure, etc.

module T : TERM
module P : PROOF with type term = T.Term.t
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit : LIT with module T = T
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +SOLVER_INTERNAL (sidekick.Sidekick_core.SOLVER_INTERNAL)

Module type Sidekick_core.SOLVER_INTERNAL

A view of the solver from a theory's point of view.

Theories should interact with the solver via this module, to assert new lemmas, propagate literals, access the congruence closure, etc.

module T : TERM
module P : PROOF with type term = T.Term.t
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit : LIT with module T = T
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_msat_solver/Make/Solver_internal/index.html b/dev/sidekick/Sidekick_msat_solver/Make/Solver_internal/index.html index 9bd88b9a..2948f6bb 100644 --- a/dev/sidekick/Sidekick_msat_solver/Make/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_msat_solver/Make/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_msat_solver.Make.Solver_internal)

Module Make.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_msat_solver.Make.Solver_internal)

Module Make.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_msat_solver/Make/argument-1-A/P/index.html b/dev/sidekick/Sidekick_msat_solver/Make/argument-1-A/P/index.html index 54610786..94c174fc 100644 --- a/dev/sidekick/Sidekick_msat_solver/Make/argument-1-A/P/index.html +++ b/dev/sidekick/Sidekick_msat_solver/Make/argument-1-A/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_msat_solver.Make.1-A.P)

Module 1-A.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_msat_solver.Make.1-A.P)

Module 1-A.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_msat_solver/module-type-ARG/P/index.html b/dev/sidekick/Sidekick_msat_solver/module-type-ARG/P/index.html index 39339b69..247949f5 100644 --- a/dev/sidekick/Sidekick_msat_solver/module-type-ARG/P/index.html +++ b/dev/sidekick/Sidekick_msat_solver/module-type-ARG/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_msat_solver.ARG.P)

Module ARG.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_msat_solver.ARG.P)

Module ARG.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_msat_solver/module-type-S/P/index.html b/dev/sidekick/Sidekick_msat_solver/module-type-S/P/index.html index 58190425..7c3a03cf 100644 --- a/dev/sidekick/Sidekick_msat_solver/module-type-S/P/index.html +++ b/dev/sidekick/Sidekick_msat_solver/module-type-S/P/index.html @@ -1,2 +1,2 @@ -P (sidekick.Sidekick_msat_solver.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_msat_solver.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_msat_solver/module-type-S/Solver_internal/index.html b/dev/sidekick/Sidekick_msat_solver/module-type-S/Solver_internal/index.html index cc61feba..40dd02c3 100644 --- a/dev/sidekick/Sidekick_msat_solver/module-type-S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_msat_solver/module-type-S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_msat_solver.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_msat_solver.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sigs/.dune-keep b/dev/sidekick/Sidekick_sigs/.dune-keep new file mode 100644 index 00000000..e69de29b diff --git a/dev/sidekick/Sidekick_sigs/index.html b/dev/sidekick/Sidekick_sigs/index.html new file mode 100644 index 00000000..ec86b598 --- /dev/null +++ b/dev/sidekick/Sidekick_sigs/index.html @@ -0,0 +1,2 @@ + +Sidekick_sigs (sidekick.Sidekick_sigs)

Module Sidekick_sigs

module type EQ = sig ... end
module type ORD = sig ... end
module type HASH = sig ... end
module type PRINT = sig ... end
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sigs/module-type-EQ/index.html b/dev/sidekick/Sidekick_sigs/module-type-EQ/index.html new file mode 100644 index 00000000..072070f5 --- /dev/null +++ b/dev/sidekick/Sidekick_sigs/module-type-EQ/index.html @@ -0,0 +1,2 @@ + +EQ (sidekick.Sidekick_sigs.EQ)

Module type Sidekick_sigs.EQ

type t
val equal : t -> t -> bool
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sigs/module-type-HASH/index.html b/dev/sidekick/Sidekick_sigs/module-type-HASH/index.html new file mode 100644 index 00000000..2a85ad98 --- /dev/null +++ b/dev/sidekick/Sidekick_sigs/module-type-HASH/index.html @@ -0,0 +1,2 @@ + +HASH (sidekick.Sidekick_sigs.HASH)

Module type Sidekick_sigs.HASH

type t
val hash : t -> int
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sigs/module-type-ORD/index.html b/dev/sidekick/Sidekick_sigs/module-type-ORD/index.html new file mode 100644 index 00000000..62a48f27 --- /dev/null +++ b/dev/sidekick/Sidekick_sigs/module-type-ORD/index.html @@ -0,0 +1,2 @@ + +ORD (sidekick.Sidekick_sigs.ORD)

Module type Sidekick_sigs.ORD

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_sigs/module-type-PRINT/index.html b/dev/sidekick/Sidekick_sigs/module-type-PRINT/index.html new file mode 100644 index 00000000..d7f2031b --- /dev/null +++ b/dev/sidekick/Sidekick_sigs/module-type-PRINT/index.html @@ -0,0 +1,2 @@ + +PRINT (sidekick.Sidekick_sigs.PRINT)

Module type Sidekick_sigs.PRINT

type t
val pp : t CCFormat.printer
\ 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 eeb2adee..a336ce10 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_th_bool_static.Make.1-A.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/index.html index 02e9a4fd..20f84c72 100644 --- a/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/Make/argument-1-A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_bool_static.Make.1-A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

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

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ 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 e10264fc..a985113b 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_th_bool_static.ARG.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/index.html index 27367bc0..1464915f 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-ARG/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_bool_static.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ 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 5634dedf..40962730 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_th_bool_static.S.A.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/index.html index 7bf40e42..aec52a35 100644 --- a/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_bool_static/module-type-S/A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_bool_static.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ 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 a142ccab..73c6bc18 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_th_cstor.Make.1-A.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/index.html index ae2f44a1..c5647246 100644 --- a/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_cstor/Make/argument-1-A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_cstor.Make.1-A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

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

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ 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 78e340ec..81f512da 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_th_cstor.ARG.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/index.html index 6eedb1bf..96b30247 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-ARG/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_cstor.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ 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 662698d3..cc99f7a5 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_th_cstor.S.A.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/index.html index d29c05ed..eedd8242 100644 --- a/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_cstor/module-type-S/A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_cstor.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ 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 a7938655..81376a72 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_th_data.Make.1-A.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/index.html index ff32004d..ed122cfa 100644 --- a/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_data/Make/argument-1-A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_data.Make.1-A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

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

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ 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 0fa28d34..50f824ed 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_th_data.ARG.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/index.html index 7684c3ac..d6def99f 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-ARG/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_data.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_data.ARG.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ 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 0e2d206a..9b8c0f37 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 term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer
module Quip : sig ... end
\ No newline at end of file +P (sidekick.Sidekick_th_data.S.A.S.P)

Module S.P

type term = T.Term.t
type ty
type t
type hres_step

hyper-resolution steps: resolution, unit resolution; bool paramodulation, unit bool paramodulation

val r : t -> pivot:term -> hres_step

Resolution step on given pivot term

val r1 : t -> hres_step

Unit resolution; pivot is obvious

val p : t -> lhs:term -> rhs:term -> hres_step

Paramodulation using proof whose conclusion has a literal lhs=rhs

val p1 : t -> hres_step

Unit paramodulation

type lit

Proof representation of literals

val pp_lit : lit Sidekick_core.Fmt.printer
val lit_a : term -> lit
val lit_na : term -> lit
val lit_mk : bool -> term -> lit
val lit_eq : term -> term -> lit
val lit_neq : term -> term -> lit
val lit_not : lit -> lit
val lit_sign : lit -> bool
type composite_step
val stepc : name:string -> lit list -> t -> composite_step
val deft : term -> term -> composite_step

define a (new) atomic term

val is_trivial_refl : t -> bool

is this a proof of |- t=t? This can be used to remove some trivial steps that would build on the proof (e.g. rewriting using refl t is useless).

val assertion : term -> t
val assertion_c : lit Iter.t -> t
val ref_by_name : string -> t
val assertion_c_l : lit list -> t
val hres_iter : t -> hres_step Iter.t -> t
val hres_l : t -> hres_step list -> t
val res : pivot:term -> t -> t -> t
val res1 : t -> t -> t
val refl : term -> t
val true_is_true : t
val true_neq_false : t
val nn : t -> t
val cc_lemma : lit list -> t
val cc_imply2 : t -> t -> term -> term -> t
val cc_imply_l : t list -> term -> term -> t
val composite_iter : ?⁠assms:(string * lit) list -> composite_step Iter.t -> t
val composite_l : ?⁠assms:(string * lit) list -> composite_step list -> t
val sorry : t
val sorry_c : lit Iter.t -> t
val sorry_c_l : lit list -> t
val default : t
val pp_debug : sharing:bool -> t Sidekick_core.Fmt.printer

Pretty print a proof.

parameter sharing

if true, try to compact the proof by introducing definitions for common terms, clauses, and steps as needed. Safe to ignore.

module Quip : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/index.html b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/index.html index e16cbe58..83c0640f 100644 --- a/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/index.html +++ b/dev/sidekick/Sidekick_th_data/module-type-S/A/S/Solver_internal/index.html @@ -1,2 +1,2 @@ -Solver_internal (sidekick.Sidekick_th_data.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a literal for a reason. This is similar to asserting the clause reason => lit, but more lightweight, and in a way that is backtrackable.

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> (unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file +Solver_internal (sidekick.Sidekick_th_data.S.A.S.Solver_internal)

Module S.Solver_internal

Internal solver, available to theories.

module T = T
module P = P
type ty = T.Ty.t
type term = T.Term.t
type term_state = T.Term.state
type ty_state = T.Ty.state
type proof = P.t
type t

Main type for a solver

type solver = t
val tst : t -> term_state
val ty_st : t -> ty_state
val stats : t -> Sidekick_util.Stat.t

Actions for the theories

type actions

Handle that the theories can use to perform actions.

module Lit = Lit
type lit = Lit.t

Proof helpers

val define_const : t -> const:term -> rhs:term -> unit

define_const si ~const ~rhs adds the definition const := rhs to the (future) proof. const should be a fresh constant that occurs nowhere else, and rhs a term defined without const.

Congruence Closure

module CC : Sidekick_core.CC_S with module T = T and module P = P and module Lit = Lit and type Actions.t = actions

Congruence closure instance

val cc : t -> CC.t

Congruence closure for this solver

Simplifiers

module Simplify : sig ... end

Simplify terms

type simplify_hook = Simplify.hook
val add_simplifier : t -> Simplify.hook -> unit

Add a simplifier hook for preprocessing.

val simplifier : t -> Simplify.t
val simplify_t : t -> term -> (term * proof) option

Simplify input term, returns Some (u, |- t=u) if some simplification occurred.

val simp_t : t -> term -> term * proof

simp_t si t returns u, |- t=u even if no simplification occurred (in which case t == u syntactically). (see simplifier)

hooks for the theory

val raise_conflict : t -> actions -> lit list -> proof -> 'a

Give a conflict clause to the solver

val push_decision : t -> actions -> lit -> unit

Ask the SAT solver to decide the given literal in an extension of the current trail. This is useful for theory combination. If the SAT solver backtracks, this (potential) decision is removed and forgotten.

val propagate : t -> actions -> lit -> reason:(unit -> lit list * proof) -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val propagate_l : t -> actions -> lit -> lit list -> proof -> unit

Propagate a boolean using a unit clause. expl => lit must be a theory lemma, that is, a T-tautology

val add_clause_temp : t -> actions -> lit list -> proof -> unit

Add local clause to the SAT solver. This clause will be removed when the solver backtracks.

val add_clause_permanent : t -> actions -> lit list -> proof -> unit

Add toplevel clause to the SAT solver. This clause will not be backtracked.

val mk_lit : t -> actions -> ?⁠sign:bool -> term -> lit

Create a literal. This automatically preprocesses the term.

val preprocess_term : t -> add_clause:(Lit.t list -> proof -> unit) -> term -> term * proof

Preprocess a term.

val add_lit : t -> actions -> lit -> unit

Add the given literal to the SAT solver, so it gets assigned a boolean value

val add_lit_t : t -> actions -> ?⁠sign:bool -> term -> unit

Add the given (signed) bool term to the SAT solver, so it gets assigned a boolean value

val cc_raise_conflict_expl : t -> actions -> CC.Expl.t -> 'a

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

val cc_find : t -> CC.N.t -> CC.N.t

Find representative of the node

val cc_are_equal : t -> term -> term -> bool

Are these two terms equal in the congruence closure?

val cc_merge : t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit

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

val cc_merge_t : t -> actions -> term -> term -> CC.Expl.t -> unit

Merge these two terms in the congruence closure, given this explanation. See cc_merge

val cc_add_term : t -> term -> CC.N.t

Add/retrieve congruence closure node for this term. To be used in theories

val cc_mem_term : t -> term -> bool

Return true if the term is explicitly in the congruence closure. To be used in theories

val on_cc_pre_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> CC.Expl.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called before)

val on_cc_post_merge : t -> (CC.t -> actions -> CC.N.t -> CC.N.t -> unit) -> unit

Callback for when two classes containing data for this key are merged (called after)

val on_cc_new_term : t -> (CC.t -> CC.N.t -> term -> unit) -> unit

Callback to add data on terms when they are added to the congruence closure

val on_cc_is_subterm : t -> (CC.N.t -> term -> unit) -> unit

Callback for when a term is a subterm of another term in the congruence closure

val on_cc_conflict : t -> (CC.t -> th:bool -> lit list -> unit) -> unit

Callback called on every CC conflict

val on_cc_propagate : t -> (CC.t -> lit -> (unit -> lit list * proof) -> unit) -> unit

Callback called on every CC propagation

val on_partial_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callbacked to be called with the slice of literals newly added on the trail.

This is called very often and should be efficient. It doesn't have to be complete, only correct. It's given only the slice of the trail consisting in new literals.

val on_final_check : t -> (t -> actions -> lit Iter.t -> unit) -> unit

Register callback to be called during the final check.

Must be complete (i.e. must raise a conflict if the set of literals is not satisfiable) and can be expensive. The function is given the whole trail.

Preprocessors

These preprocessors turn mixed, raw literals (possibly simplified) into literals suitable for reasoning. Typically some clauses are also added to the solver.

type preprocess_hook = t -> mk_lit:(term -> lit) -> add_clause:(lit list -> proof -> unit) -> term -> (term * proof) option

Given a term, try to preprocess it. Return None if it didn't change, or Some (u,p) if t=u and p is a proof of t=u. Can also add clauses to define new terms.

Preprocessing might transform terms to make them more amenable to reasoning, e.g. by removing boolean formulas via Tseitin encoding, adding clauses that encode their meaning in the same move.

parameter mk_lit

creates a new literal for a boolean term.

parameter add_clause

pushes a new clause into the SAT solver.

val on_preprocess : t -> preprocess_hook -> unit

Add a hook that will be called when terms are preprocessed

Model production

type model_hook = recurse:(t -> CC.N.t -> term) -> t -> CC.N.t -> term option

A model-production hook. It takes the solver, a class, and returns a term for this class. For example, an arithmetic theory might detect that a class contains a numeric constant, and return this constant as a model value.

If no hook assigns a value to a class, a fake value is created for it.

val on_model_gen : t -> model_hook -> unit

Add a hook that will be called when a model is being produced

\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util/Intf/index.html b/dev/sidekick/Sidekick_util/Intf/index.html deleted file mode 100644 index 5c87342c..00000000 --- a/dev/sidekick/Sidekick_util/Intf/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Intf (sidekick.Sidekick_util.Intf)

Module Sidekick_util.Intf

module type EQ = sig ... end
module type ORD = sig ... end
module type HASH = sig ... end
module type PRINT = sig ... end
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util/Intf/module-type-EQ/index.html b/dev/sidekick/Sidekick_util/Intf/module-type-EQ/index.html deleted file mode 100644 index e0d2c0af..00000000 --- a/dev/sidekick/Sidekick_util/Intf/module-type-EQ/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -EQ (sidekick.Sidekick_util.Intf.EQ)

Module type Intf.EQ

type t
val equal : t -> t -> bool
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util/Intf/module-type-HASH/index.html b/dev/sidekick/Sidekick_util/Intf/module-type-HASH/index.html deleted file mode 100644 index e02c7a85..00000000 --- a/dev/sidekick/Sidekick_util/Intf/module-type-HASH/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -HASH (sidekick.Sidekick_util.Intf.HASH)

Module type Intf.HASH

type t
val hash : t -> int
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util/Intf/module-type-ORD/index.html b/dev/sidekick/Sidekick_util/Intf/module-type-ORD/index.html deleted file mode 100644 index 85c00473..00000000 --- a/dev/sidekick/Sidekick_util/Intf/module-type-ORD/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ORD (sidekick.Sidekick_util.Intf.ORD)

Module type Intf.ORD

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util/Intf/module-type-PRINT/index.html b/dev/sidekick/Sidekick_util/Intf/module-type-PRINT/index.html deleted file mode 100644 index b4689b06..00000000 --- a/dev/sidekick/Sidekick_util/Intf/module-type-PRINT/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -PRINT (sidekick.Sidekick_util.Intf.PRINT)

Module type Intf.PRINT

type t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util/index.html b/dev/sidekick/Sidekick_util/index.html index a56f9b7d..e40efc1d 100644 --- a/dev/sidekick/Sidekick_util/index.html +++ b/dev/sidekick/Sidekick_util/index.html @@ -1,2 +1,2 @@ -Sidekick_util (sidekick.Sidekick_util)

Module Sidekick_util

module Fmt = CCFormat
module Vec = Msat.Vec
module Log = Msat.Log
module Util : sig ... end
module Backtrack_stack : sig ... end
module Backtrackable_tbl : sig ... end
module Error : sig ... end
module IArray : sig ... end
module Intf : sig ... end
module Bag : sig ... end
module Stat : sig ... end
module Hash : sig ... end
module Profile : sig ... end
\ No newline at end of file +Sidekick_util (sidekick.Sidekick_util)

Module Sidekick_util

module Fmt = CCFormat
module Vec = Msat.Vec
module Log = Msat.Log
module Util : sig ... end
module Backtrack_stack : sig ... end
module Backtrackable_tbl : sig ... end
module Error : sig ... end
module IArray : sig ... end
module Bag : sig ... end
module Stat : sig ... end
module Hash : sig ... end
module Profile : sig ... end
module Intf = Sidekick_sigs
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__/Intf/index.html b/dev/sidekick/Sidekick_util__/Intf/index.html deleted file mode 100644 index 768959d7..00000000 --- a/dev/sidekick/Sidekick_util__/Intf/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Intf (sidekick.Sidekick_util__.Intf)

Module Sidekick_util__.Intf

module type EQ = sig ... end
module type ORD = sig ... end
module type HASH = sig ... end
module type PRINT = sig ... end
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__/Intf/module-type-EQ/index.html b/dev/sidekick/Sidekick_util__/Intf/module-type-EQ/index.html deleted file mode 100644 index 14f7cee7..00000000 --- a/dev/sidekick/Sidekick_util__/Intf/module-type-EQ/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -EQ (sidekick.Sidekick_util__.Intf.EQ)

Module type Intf.EQ

type t
val equal : t -> t -> bool
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__/Intf/module-type-HASH/index.html b/dev/sidekick/Sidekick_util__/Intf/module-type-HASH/index.html deleted file mode 100644 index 593c5fe2..00000000 --- a/dev/sidekick/Sidekick_util__/Intf/module-type-HASH/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -HASH (sidekick.Sidekick_util__.Intf.HASH)

Module type Intf.HASH

type t
val hash : t -> int
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__/Intf/module-type-ORD/index.html b/dev/sidekick/Sidekick_util__/Intf/module-type-ORD/index.html deleted file mode 100644 index 46b50d48..00000000 --- a/dev/sidekick/Sidekick_util__/Intf/module-type-ORD/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ORD (sidekick.Sidekick_util__.Intf.ORD)

Module type Intf.ORD

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__/Intf/module-type-PRINT/index.html b/dev/sidekick/Sidekick_util__/Intf/module-type-PRINT/index.html deleted file mode 100644 index 6acad00d..00000000 --- a/dev/sidekick/Sidekick_util__/Intf/module-type-PRINT/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -PRINT (sidekick.Sidekick_util__.Intf.PRINT)

Module type Intf.PRINT

type t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__/index.html b/dev/sidekick/Sidekick_util__/index.html index be767bfd..7fec0673 100644 --- a/dev/sidekick/Sidekick_util__/index.html +++ b/dev/sidekick/Sidekick_util__/index.html @@ -1,2 +1,2 @@ -Sidekick_util__ (sidekick.Sidekick_util__)

Module Sidekick_util__

module Backtrack_stack : sig ... end
module Backtrackable_tbl : sig ... end
module Bag : sig ... end
module Error : sig ... end
module Hash : sig ... end
module IArray : sig ... end
module Intf : sig ... end
module Profile : sig ... end
module Stat : sig ... end
module Util : sig ... end
\ No newline at end of file +Sidekick_util__ (sidekick.Sidekick_util__)

Module Sidekick_util__

module Backtrack_stack : sig ... end
module Backtrackable_tbl : sig ... end
module Bag : sig ... end
module Error : sig ... end
module Hash : sig ... end
module IArray : sig ... end
module Profile : sig ... end
module Stat : sig ... end
module Util : sig ... end
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__Intf/index.html b/dev/sidekick/Sidekick_util__Intf/index.html deleted file mode 100644 index 1bd71cdf..00000000 --- a/dev/sidekick/Sidekick_util__Intf/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sidekick_util__Intf (sidekick.Sidekick_util__Intf)

Module Sidekick_util__Intf

module type EQ = sig ... end
module type ORD = sig ... end
module type HASH = sig ... end
module type PRINT = sig ... end
type 'a printer = Stdlib.Format.formatter -> 'a -> unit
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__Intf/module-type-EQ/index.html b/dev/sidekick/Sidekick_util__Intf/module-type-EQ/index.html deleted file mode 100644 index 252dd8fd..00000000 --- a/dev/sidekick/Sidekick_util__Intf/module-type-EQ/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -EQ (sidekick.Sidekick_util__Intf.EQ)

Module type Sidekick_util__Intf.EQ

type t
val equal : t -> t -> bool
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__Intf/module-type-HASH/index.html b/dev/sidekick/Sidekick_util__Intf/module-type-HASH/index.html deleted file mode 100644 index 0cedb4ec..00000000 --- a/dev/sidekick/Sidekick_util__Intf/module-type-HASH/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -HASH (sidekick.Sidekick_util__Intf.HASH)

Module type Sidekick_util__Intf.HASH

type t
val hash : t -> int
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__Intf/module-type-ORD/index.html b/dev/sidekick/Sidekick_util__Intf/module-type-ORD/index.html deleted file mode 100644 index b76308ec..00000000 --- a/dev/sidekick/Sidekick_util__Intf/module-type-ORD/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ORD (sidekick.Sidekick_util__Intf.ORD)

Module type Sidekick_util__Intf.ORD

type t
val compare : t -> t -> int
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_util__Intf/module-type-PRINT/index.html b/dev/sidekick/Sidekick_util__Intf/module-type-PRINT/index.html deleted file mode 100644 index 9bca654b..00000000 --- a/dev/sidekick/Sidekick_util__Intf/module-type-PRINT/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -PRINT (sidekick.Sidekick_util__Intf.PRINT)

Module type Sidekick_util__Intf.PRINT

type t
val pp : t CCFormat.printer
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_zarith/.dune-keep b/dev/sidekick/Sidekick_zarith/.dune-keep new file mode 100644 index 00000000..e69de29b diff --git a/dev/sidekick/Sidekick_zarith/Int/index.html b/dev/sidekick/Sidekick_zarith/Int/index.html new file mode 100644 index 00000000..39b6038c --- /dev/null +++ b/dev/sidekick/Sidekick_zarith/Int/index.html @@ -0,0 +1,2 @@ + +Int (sidekick.Sidekick_zarith.Int)

Module Sidekick_zarith.Int

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val succ : t -> t
\ No newline at end of file diff --git a/dev/sidekick/Sidekick_zarith/Rational/index.html b/dev/sidekick/Sidekick_zarith/Rational/index.html new file mode 100644 index 00000000..cbcf46b3 --- /dev/null +++ b/dev/sidekick/Sidekick_zarith/Rational/index.html @@ -0,0 +1,2 @@ + +Rational (sidekick.Sidekick_zarith.Rational)

Module Sidekick_zarith.Rational

include Sidekick_arith.NUM
type t
val zero : t
val one : t
val minus_one : t
val sign : t -> int
val of_int : int -> t
include Sidekick_sigs.EQ with type t := t
type t
val equal : t -> t -> bool
include Sidekick_sigs.ORD with type t := t
type t
val compare : t -> t -> int
include Sidekick_sigs.HASH with type t := t
type t
val hash : t -> int
include Sidekick_sigs.PRINT with type t := t
type t
val pp : t CCFormat.printer
val (+) : t -> t -> t
val (-) : t -> t -> t
val (*) : t -> t -> t
val (~-) : t -> t
val neg : t -> t
val min : t -> t -> t
val max : t -> t -> t
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
type bigint = Z.t
val (/) : t -> t -> t
val num : t -> bigint
val denum : t -> bigint
val pp_approx : int -> Stdlib.Format.formatter -> t -> unit

Pretty print rational with given amount of precision (for example as a floating point number)

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

Module Sidekick_zarith

module Int : Sidekick_arith.INT with type t = Z.t
module Rational : Sidekick_arith.RATIONAL with type t = Q.t and type bigint = Z.t
\ No newline at end of file diff --git a/dev/sidekick/index.html b/dev/sidekick/index.html index d4b40352..0c7b7547 100644 --- a/dev/sidekick/index.html +++ b/dev/sidekick/index.html @@ -1,2 +1,2 @@ -index (sidekick.index)

sidekick index

Library sidekick.cc

The entry point of this library is the module: Sidekick_cc.

Library sidekick.core

The entry point of this library is the module: Sidekick_core.

Library sidekick.mini-cc

The entry point of this library is the module: Sidekick_mini_cc.

Library sidekick.msat-solver

The entry point of this library is the module: Sidekick_msat_solver.

Library sidekick.tef

The entry point of this library is the module: Sidekick_tef.

Library sidekick.th-bool-static

The entry point of this library is the module: Sidekick_th_bool_static.

Library sidekick.th-cstor

The entry point of this library is the module: Sidekick_th_cstor.

Library sidekick.th-data

The entry point of this library is the module: Sidekick_th_data.

Library sidekick.util

The entry point of this library is the module: Sidekick_util.

\ No newline at end of file +index (sidekick.index)

sidekick index

Library sidekick.arith

The entry point of this library is the module: Sidekick_arith.

Library sidekick.arith-lra

The entry point of this library is the module: Sidekick_arith_lra.

Library sidekick.cc

The entry point of this library is the module: Sidekick_cc.

Library sidekick.core

The entry point of this library is the module: Sidekick_core.

Library sidekick.mini-cc

The entry point of this library is the module: Sidekick_mini_cc.

Library sidekick.msat-solver

The entry point of this library is the module: Sidekick_msat_solver.

Library sidekick.sigs

The entry point of this library is the module: Sidekick_sigs.

Library sidekick.tef

The entry point of this library is the module: Sidekick_tef.

Library sidekick.th-bool-static

The entry point of this library is the module: Sidekick_th_bool_static.

Library sidekick.th-cstor

The entry point of this library is the module: Sidekick_th_cstor.

Library sidekick.th-data

The entry point of this library is the module: Sidekick_th_data.

Library sidekick.util

The entry point of this library is the module: Sidekick_util.

Library sidekick.zarith

The entry point of this library is the module: Sidekick_zarith.

\ No newline at end of file