Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file mappings_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026(* SPDX-License-Identifier: MIT *)(* Copyright (C) 2023-2025 formalsec *)(* Written by the Smtml programmers *)(** Mappings Module. This module defines interfaces for interacting with SMT
solvers, including term construction, type handling, solver interaction, and
optimization. It provides a generic interface for working with different SMT
solvers and their functionalities. *)(** {1 Module Types} *)(** The [M] module type defines the core interface for interacting with SMT
solvers, including term construction, type handling, and solver interaction.
*)moduletypeM=sig(** The type of SMT sorts (types). *)typety(** The type of SMT terms. *)typeterm(** The type of interpretations (evaluated values). *)typeinterp(** The type of SMT models. *)typemodel(** The type of SMT solvers. *)typesolver(** The type of optimization handles. *)typehandle(** The type of SMT optimizers. *)typeoptimizer(** The type of function declarations. *)typefunc_decl(** [true_] represents the Boolean constant [true]. *)valtrue_:term(** [false_] represents the Boolean constant [false]. *)valfalse_:term(** [int n] constructs an integer term from the given integer [n]. *)valint:int->term(** [real f] constructs a real number term from the given float [f]. *)valreal:float->term(** [const name ty] constructs a constant term with the given name and type.
*)valconst:string->ty->term(** [not_ t] constructs the logical negation of the term [t]. *)valnot_:term->term(** [and_ t1 t2] constructs the logical AND of the terms [t1] and [t2]. *)valand_:term->term->term(** [or_ t1 t2] constructs the logical OR of the terms [t1] and [t2]. *)valor_:term->term->term(** [logand ts] constructs the logical AND of a list of terms [ts]. *)vallogand:termlist->term(** [logor ts] constructs the logical OR of a list of terms [ts]. *)vallogor:termlist->term(** [xor t1 t2] constructs the logical XOR of the terms [t1] and [t2]. *)valxor:term->term->term(** [implies t1 t2] constructs the logical implication of the terms [t1] and
[t2]. *)valimplies:term->term->term(** [eq t1 t2] constructs the equality of the terms [t1] and [t2]. *)valeq:term->term->term(** [distinct ts] constructs the distinctness of a list of terms [ts]. *)valdistinct:termlist->term(** [ite cond then_ else_] constructs an if-then-else term. *)valite:term->term->term->term(** [forall vars body] constructs a universal quantification term. *)valforall:termlist->term->term(** [exists vars body] constructs an existential quantification term. *)valexists:termlist->term->termmoduleInternals:sig(** [name] indicates the name of the solver for query logging and debugging
purposes. *)valname:string(** [is_available] indicates whether the module is available for use. *)valis_available:bool(** [caches_consts] indicates whether the solver caches constants. *)valcaches_consts:boolend(** {2 Type Handling} *)moduleTypes:sig(** [int] represents the integer type. *)valint:ty(** [real] represents the real number type. *)valreal:ty(** [bool] represents the Boolean type. *)valbool:ty(** [string] represents the string type. *)valstring:ty(** [bitv n] represents a bitvector type of width [n]. *)valbitv:int->ty(** [float e s] represents a floating-point type with exponent width [e] and
significand width [s]. *)valfloat:int->int->tyvalroundingMode:ty(** [regexp] represents the regular expression type. *)valregexp:ty(** [ty t] retrieves the type of the term [t]. *)valty:term->ty(** [to_ety ty] converts the type [ty] to an smtml type representation. *)valto_ety:ty->Ty.tend(** {2 Interpretation Handling} *)moduleInterp:sig(** [to_int interp] converts an interpretation to an integer. *)valto_int:interp->int(** [to_real interp] converts an interpretation to a real number. *)valto_real:interp->float(** [to_bool interp] converts an interpretation to a Boolean. *)valto_bool:interp->bool(** [to_string interp] converts an interpretation to a string. *)valto_string:interp->string(** [to_bitv interp n] converts an interpretation to a bitvector of width
[n]. *)valto_bitv:interp->int->Z.t(** [to_float interp e s] converts an interpretation to a floating-point
number with exponent width [e] and significand width [s]. *)valto_float:interp->int->int->floatend(** {2 Integer Operations} *)moduleInt:sig(** [neg t] constructs the negation of the integer term [t]. *)valneg:term->term(** [to_real t] converts the integer term [t] to a real number term. *)valto_real:term->term(** [to_bv m t] convertes integer [t] term into a bitvector of size [m]. *)valto_bv:int->term->term(** [add t1 t2] constructs the sum of the integer terms [t1] and [t2]. *)valadd:term->term->term(** [sub t1 t2] constructs the difference of the integer terms [t1] and
[t2]. *)valsub:term->term->term(** [mul t1 t2] constructs the product of the integer terms [t1] and [t2].
*)valmul:term->term->term(** [div t1 t2] constructs the quotient of the integer terms [t1] and [t2].
*)valdiv:term->term->term(** [rem t1 t2] constructs the remainder of the integer terms [t1] and [t2].
*)valrem:term->term->term(** [mod t1 t2] constructs the modules operator *)valmod_:term->term->term(** [pow t1 t2] constructs the power of the integer terms [t1] and [t2]. *)valpow:term->term->term(** [lt t1 t2] constructs the less-than relation between [t1] and [t2]. *)vallt:term->term->term(** [le t1 t2] constructs the less-than-or-equal relation between [t1] and
[t2]. *)valle:term->term->term(** [gt t1 t2] constructs the greater-than relation between [t1] and [t2].
*)valgt:term->term->term(** [ge t1 t2] constructs the greater-than-or-equal relation between [t1]
and [t2]. *)valge:term->term->termend(** {2 Real Number Operations} *)moduleReal:sig(** [neg t] constructs the negation of the real number term [t]. *)valneg:term->term(** [to_int t] converts the real number term [t] to an integer term. *)valto_int:term->term(** [add t1 t2] constructs the sum of the real number terms [t1] and [t2].
*)valadd:term->term->term(** [sub t1 t2] constructs the difference of the real number terms [t1] and
[t2]. *)valsub:term->term->term(** [mul t1 t2] constructs the product of the real number terms [t1] and
[t2]. *)valmul:term->term->term(** [div t1 t2] constructs the quotient of the real number terms [t1] and
[t2]. *)valdiv:term->term->term(** [pow t1 t2] constructs the power of the real number terms [t1] and [t2].
*)valpow:term->term->term(** [lt t1 t2] constructs the less-than relation between [t1] and [t2]. *)vallt:term->term->term(** [le t1 t2] constructs the less-than-or-equal relation between [t1] and
[t2]. *)valle:term->term->term(** [gt t1 t2] constructs the greater-than relation between [t1] and [t2].
*)valgt:term->term->term(** [ge t1 t2] constructs the greater-than-or-equal relation between [t1]
and [t2]. *)valge:term->term->termend(** {2 String Operations} *)moduleString:sig(** [v s] constructs a string term from the string [s]. *)valv:string->term(** [length t] constructs the length of the string term [t]. *)vallength:term->term(** [to_code t] constructs the Unicode code point of the first character in
the string term [t]. *)valto_code:term->term(** [of_code t] constructs a string term from the Unicode code point [t]. *)valof_code:term->term(** [to_int t] converts the string term [t] to an integer term. *)valto_int:term->term(** [of_int t] converts the integer term [t] to a string term. *)valof_int:term->term(** [to_re t] converts the string term [t] to a regular expression term. *)valto_re:term->term(** [at t ~pos] constructs the character at position [pos] in the string
term [t]. *)valat:term->pos:term->term(** [concat ts] constructs the concatenation of a list of string terms [ts].
*)valconcat:termlist->term(** [contains t ~sub] checks if the string term [t] contains the substring
[sub]. *)valcontains:term->sub:term->term(** [is_prefix t ~prefix] checks if the string term [t] starts with the
prefix [prefix]. *)valis_prefix:term->prefix:term->term(** [is_suffix t ~suffix] checks if the string term [t] ends with the suffix
[suffix]. *)valis_suffix:term->suffix:term->term(** [in_re t re] checks if the string term [t] matches the regular
expression [re]. *)valin_re:term->term->term(** [lt t1 t2] constructs the less-than relation between string terms [t1]
and [t2]. *)vallt:term->term->term(** [le t1 t2] constructs the less-than-or-equal relation between string
terms [t1] and [t2]. *)valle:term->term->term(** [sub t ~pos ~len] constructs the substring of [t] starting at [pos] with
length [len]. *)valsub:term->pos:term->len:term->term(** [index_of t ~sub ~pos] constructs the index of the first occurrence of
[sub] in [t] starting at [pos]. *)valindex_of:term->sub:term->pos:term->term(** [replace t ~pattern ~with_] constructs the string term resulting from
replacing [pattern] with [with_] in [t]. *)valreplace:term->pattern:term->with_:term->term(** [replace_all t ~pattern ~with_] constructs the string term resulting
from replacing all occurrences of [pattern] with [with_] in [t]. *)valreplace_all:term->pattern:term->with_:term->term(** [replace_re t ~pattern ~with_] constructs the string term resulting from
replacing the first occurrence of the regular expression [pattern] with
[with_] in [t]. *)valreplace_re:term->pattern:term->with_:term->term(** [replace_re_all t ~pattern ~with_] constructs the string term resulting
from replacing all occurrences of the regular expression [pattern] with
[with_] in [t]. *)valreplace_re_all:term->pattern:term->with_:term->termend(** {2 Regular Expression Operations} *)moduleRe:sig(** [all] constructs the regular expression that matches all. *)valall:unit->term(** [allchar] constructs the regular expression that matches any character.
*)valallchar:unit->term(** [empty] constructs the empty regular expression. *)valnone:unit->term(** [star t] constructs the Kleene star of the regular expression term [t].
*)valstar:term->term(** [plus t] constructs the Kleene plus of the regular expression term [t].
*)valplus:term->term(** [opt t] constructs the optional regular expression term [t]. *)valopt:term->term(** [comp t] constructs the complement of the regular expression term [t].
*)valcomp:term->term(** [range t1 t2] constructs a regular expression term matching characters
in the range from [t1] to [t2]. *)valrange:term->term->term(** [diff t1 t2] constructs the difference of the regular expression terms
[t1] and [t2]. *)valdiff:term->term->term(** [inter t1 t2] constructs the intersection of the regular expression
terms [t1] and [t2]. *)valinter:term->term->term(** [loop t min max] constructs a regular expression term matching [t]
repeated between [min] and [max] times. *)valloop:term->int->int->term(** [union ts] constructs the union of a list of regular expression terms
[ts]. *)valunion:termlist->term(** [concat ts] constructs the concatenation of a list of regular expression
terms [ts]. *)valconcat:termlist->termend(** {2 Bitvector Operations} *)moduleBitv:sig(** [v s n] constructs a bitvector term from the string [s] of width [n]. *)valv:string->int->term(** [neg t] constructs the negation of the bitvector term [t]. *)valneg:term->term(** [lognot t] constructs the bitwise NOT of the bitvector term [t]. *)vallognot:term->term(** [to_int ~signed t] convertes the bitvector term [t] into an integer. *)valto_int:signed:bool->term->term(** [add t1 t2] constructs the sum of the bitvector terms [t1] and [t2]. *)valadd:term->term->term(** [sub t1 t2] constructs the difference of the bitvector terms [t1] and
[t2]. *)valsub:term->term->term(** [mul t1 t2] constructs the product of the bitvector terms [t1] and [t2].
*)valmul:term->term->term(** [div t1 t2] constructs the quotient of the bitvector terms [t1] and
[t2]. *)valdiv:term->term->term(** [div_u t1 t2] constructs the unsigned quotient of the bitvector terms
[t1] and [t2]. *)valdiv_u:term->term->term(** [logor t1 t2] constructs the bitwise OR of the bitvector terms [t1] and
[t2]. *)vallogor:term->term->term(** [logand t1 t2] constructs the bitwise AND of the bitvector terms [t1]
and [t2]. *)vallogand:term->term->term(** [logxor t1 t2] constructs the bitwise XOR of the bitvector terms [t1]
and [t2]. *)vallogxor:term->term->term(** [shl t1 t2] constructs the left shift of [t1] by [t2]. *)valshl:term->term->term(** [ashr t1 t2] constructs the arithmetic right shift of [t1] by [t2]. *)valashr:term->term->term(** [lshr t1 t2] constructs the logical right shift of [t1] by [t2]. *)vallshr:term->term->term(** [smod t1 t2] two's complement signed remainder (sign follows divisor).
*)valsmod:term->term->term(** [rem t1 t2] constructs the remainder of the bitvector terms [t1] and
[t2]. *)valrem:term->term->term(** [rem_u t1 t2] constructs the unsigned remainder of the bitvector terms
[t1] and [t2]. *)valrem_u:term->term->term(** [rotate_left t1 t2] constructs the left rotation of [t1] by [t2]. *)valrotate_left:term->term->term(** [rotate_right t1 t2] constructs the right rotation of [t1] by [t2]. *)valrotate_right:term->term->term(** [nego t] constructs a predicate that checks that whether the bit-wise
negation of [t] does not overflow. *)valnego:term->term(** [addo ~signed t1 t2] constructs a predicate that checks whether the
bitwise addition of [t1] and [t2] does not overflow.
The [signed] argument is a boolean:
- [true] -> for signed addition
- [false] -> for unsigned addition *)valaddo:signed:bool->term->term->term(** [subo ~signed t1 t2] constructs a predicate that checks whether the
bitwise subtraction of [t1] and [t2] does not overflow.
The [signed] argument is a boolean:
- [true] -> for signed subtraction
- [false] -> for unsigned subtraction *)valsubo:signed:bool->term->term->term(** [mulo ~signed t1 t2] constructs a predicate that checks whether the
bitwise multiplication of [t1] and [t2] does not overflow.
The [signed] argument is a boolean:
- [true] -> for signed multiplication
- [false] -> for unsigned multiplication *)valmulo:signed:bool->term->term->term(** [divo t1 t2] constructs a predicate that checks whether the bitwise
division of [t1] and [t2] does not overflow. *)valdivo:term->term->term(** [lt t1 t2] constructs the less-than relation between bitvector terms
[t1] and [t2]. *)vallt:term->term->term(** [lt_u t1 t2] constructs the unsigned less-than relation between
bitvector terms [t1] and [t2]. *)vallt_u:term->term->term(** [le t1 t2] constructs the less-than-or-equal relation between bitvector
terms [t1] and [t2]. *)valle:term->term->term(** [le_u t1 t2] constructs the unsigned less-than-or-equal relation between
bitvector terms [t1] and [t2]. *)valle_u:term->term->term(** [gt t1 t2] constructs the greater-than relation between bitvector terms
[t1] and [t2]. *)valgt:term->term->term(** [gt_u t1 t2] constructs the unsigned greater-than relation between
bitvector terms [t1] and [t2]. *)valgt_u:term->term->term(** [ge t1 t2] constructs the greater-than-or-equal relation between
bitvector terms [t1] and [t2]. *)valge:term->term->term(** [ge_u t1 t2] constructs the unsigned greater-than-or-equal relation
between bitvector terms [t1] and [t2]. *)valge_u:term->term->term(** [concat t1 t2] constructs the concatenation of the bitvector terms [t1]
and [t2]. *)valconcat:term->term->term(** [extract t ~high ~low] extracts a bit range from [t] between [high] and
[low]. *)valextract:term->high:int->low:int->term(** [zero_extend n t] zero-extends the bitvector term [t] by [n] bits. *)valzero_extend:int->term->term(** [sign_extend n t] sign-extends the bitvector term [t] by [n] bits. *)valsign_extend:int->term->termend(** {2 Floating-Point Operations} *)moduleFloat:sig(** Rounding modes for floating-point operations. *)moduleRounding_mode:sig(** [rne] represents the "round nearest ties to even" rounding mode. *)valrne:term(** [rna] represents the "round nearest ties to away" rounding mode. *)valrna:term(** [rtp] represents the "round toward positive" rounding mode. *)valrtp:term(** [rtn] represents the "round toward negative" rounding mode. *)valrtn:term(** [rtz] represents the "round toward zero" rounding mode. *)valrtz:termend(** [v f e s] constructs a floating-point term from the float [f] with
exponent width [e] and significand width [s]. *)valv:float->int->int->term(** [neg t] constructs the negation of the floating-point term [t]. *)valneg:term->term(** [abs t] constructs the absolute value of the floating-point term [t]. *)valabs:term->term(** [sqrt ~rm t] constructs the square root of the floating-point term [t]
using the rounding mode [rm]. *)valsqrt:rm:term->term->termvalis_normal:term->termvalis_subnormal:term->termvalis_negative:term->termvalis_positive:term->termvalis_infinite:term->termvalis_zero:term->term(** [is_nan t] checks if the floating-point term [t] is NaN. *)valis_nan:term->term(** [round_to_integral ~rm t] rounds the floating-point term [t] to an
integral value using the rounding mode [rm]. *)valround_to_integral:rm:term->term->term(** [add ~rm t1 t2] constructs the sum of the floating-point terms [t1] and
[t2] using the rounding mode [rm]. *)valadd:rm:term->term->term->term(** [sub ~rm t1 t2] constructs the difference of the floating-point terms
[t1] and [t2] using the rounding mode [rm]. *)valsub:rm:term->term->term->term(** [mul ~rm t1 t2] constructs the product of the floating-point terms [t1]
and [t2] using the rounding mode [rm]. *)valmul:rm:term->term->term->term(** [div ~rm t1 t2] constructs the quotient of the floating-point terms [t1]
and [t2] using the rounding mode [rm]. *)valdiv:rm:term->term->term->term(** [min t1 t2] constructs the minimum of the floating-point terms [t1] and
[t2]. *)valmin:term->term->term(** [max t1 t2] constructs the maximum of the floating-point terms [t1] and
[t2]. *)valmax:term->term->term(** [fma ~rm a b c] *)valfma:rm:term->term->term->term->term(** [rem t1 t2] constructs the remainder of the floating-point terms [t1]
and [t2]. *)valrem:term->term->term(** [eq t1 t2] constructs the equality of the floating-point terms [t1] and
[t2]. *)valeq:term->term->term(** [lt t1 t2] constructs the less-than relation between floating-point
terms [t1] and [t2]. *)vallt:term->term->term(** [le t1 t2] constructs the less-than-or-equal relation between
floating-point terms [t1] and [t2]. *)valle:term->term->term(** [gt t1 t2] constructs the greater-than relation between floating-point
terms [t1] and [t2]. *)valgt:term->term->term(** [ge t1 t2] constructs the greater-than-or-equal relation between
floating-point terms [t1] and [t2]. *)valge:term->term->term(** [to_fp e s ~rm t] converts the term [t] to a floating-point term with
exponent width [e] and significand width [s] using the rounding mode
[rm]. *)valto_fp:int->int->rm:term->term->term(** [sbv_to_fp e s ~rm t] converts the signed bitvector term [t] to a
floating-point term with exponent width [e] and significand width [s]
using the rounding mode [rm]. *)valsbv_to_fp:int->int->rm:term->term->term(** [ubv_to_fp e s ~rm t] converts the unsigned bitvector term [t] to a
floating-point term with exponent width [e] and significand width [s]
using the rounding mode [rm]. *)valubv_to_fp:int->int->rm:term->term->term(** [to_ubv n ~rm t] converts the floating-point term [t] to an unsigned
bitvector term of width [n] using the rounding mode [rm]. *)valto_ubv:int->rm:term->term->term(** [to_sbv n ~rm t] converts the floating-point term [t] to a signed
bitvector term of width [n] using the rounding mode [rm]. *)valto_sbv:int->rm:term->term->term(** [of_ieee_bv e s t] constructs a floating-point term from the IEEE
bitvector term [t] with exponent width [e] and significand width [s]. *)valof_ieee_bv:int->int->term->term(** [to_ieee_bv t] converts the floating-point term [t] to an IEEE bitvector
term. *)valto_ieee_bv:(term->term)optionend(** {2 Function Handling} *)moduleFunc:sig(** [make name arg_tys ret_ty] constructs a function declaration with the
given name, argument types [arg_tys], and return type [ret_ty]. *)valmake:string->tylist->ty->func_decl(** [apply f args] applies the function declaration [f] to the arguments
[args]. *)valapply:func_decl->termlist->termend(** {2 Algebraic Data Type Handling} *)moduleAdt:sig(** {3 Constructor Definition} *)(** This module defines the interface for creating ADT constructors. *)moduleCons:sig(** The abstract type for an ADT constructor definition. *)typet(** [make name ~fields] constructs an ADT constructor definition with the
given [name] and a list of [fields]. Each field in the list is a tuple
of its name (string) and its type ([ty option]). A [None] type for a
field indicates a recursive reference to the ADT being defined. *)valmake:string->fields:(string*tyoption)list->tend(** The abstract type representing a defined Algebraic Data Type,
encapsulating its sort and associated functions (constructors,
selectors, and testers). *)typet(** [make name constructors] defines a new ADT with the given [name] and a
list of [constructors] (of type [Cons.t]). This returns the ADT
definition [t]. *)valmake:string->Cons.tlist->t(** [ty adt] retrieves the SMT sort ([ty]) of the defined ADT [adt]. *)valty:t->ty(** [constructor name adt] retrieves the constructor function declaration
(e.g., [Cons]) with the given [name] from the ADT [adt], if it exists.
*)valconstructor:string->t->func_decloption(** [selector name adt] retrieves the selector function declaration (e.g.,
[field_a]) with the given [name] from the ADT [adt], if it exists. *)valselector:string->t->func_decloption(** [tester name adt] retrieves the tester function declaration (e.g.,
["is-Cons"]) with the given [name] from the ADT [adt], if it exists. *)valtester:string->t->func_decloptionend(** {2 Model Handling} *)moduleModel:sig(** [get_symbols model] retrieves the list of symbols in the model. *)valget_symbols:model->Symbol.tlist(** [eval ?completion model t] evaluates the term [t] in the given [model].
If [completion] is true, missing values are completed. *)valeval:?ctx:termSymbol.Map.t->?completion:bool->model->term->interpoptionend(** {2 Solver Handling} *)moduleSolver:sig(** [make ?params ?logic ()] creates a new solver with optional parameters
[params] and logic [logic]. *)valmake:?params:Params.t->?logic:Logic.t->unit->solver(** [clone solver] creates a copy of the solver [solver]. *)valclone:solver->solver(** [push solver] pushes a new context level onto the solver [solver]. *)valpush:solver->unit(** [pop solver n] pops [n] context levels from the solver [solver]. *)valpop:solver->int->unit(** [reset solver] resets the solver [solver] to its initial state. *)valreset:solver->unit(** [add solver ts] adds the terms [ts] to the solver [solver]. *)valadd:?ctx:termSymbol.Map.t->solver->termlist->unit(** [check solver ~assumptions] checks the satisfiability of the solver
[solver] with the given [assumptions]. Returns [`Sat], [`Unsat], or
[`Unknown]. *)valcheck:?ctx:termSymbol.Map.t->solver->assumptions:termlist->[`Sat|`Unsat|`Unknown](** [model solver] retrieves the model from the solver [solver], if one
exists. *)valmodel:solver->modeloption(** [add_simplifier solver] adds a simplifier to the solver [solver]. *)valadd_simplifier:solver->solver(** [interrupt ()] interrupts the current solver operation. *)valinterrupt:unit->unit(** [get_statistics solver] retrieves statistics from the solver [solver].
*)valget_statistics:solver->Statistics.t(** [pp_statistics fmt solver] pretty-prints the statistics of the solver
[solver] using the formatter [fmt]. *)valpp_statistics:solverFmt.tend(** {2 Optimizer Handling} *)moduleOptimizer:sig(** [make ()] creates a new optimizer. *)valmake:unit->optimizer(** [push optimizer] pushes a new context level onto the optimizer
[optimizer]. *)valpush:optimizer->unit(** [pop optimizer] pops a context level from the optimizer [optimizer]. *)valpop:optimizer->unit(** [add optimizer ts] adds the terms [ts] to the optimizer [optimizer]. *)valadd:optimizer->termlist->unit(** [check optimizer] checks the satisfiability of the optimizer
[optimizer]. Returns [`Sat], [`Unsat], or [`Unknown]. *)valcheck:optimizer->[`Sat|`Unsat|`Unknown](** [model optimizer] retrieves the model from the optimizer [optimizer], if
one exists. *)valmodel:optimizer->modeloption(** [maximize optimizer t] maximizes the term [t] in the optimizer
[optimizer]. *)valmaximize:optimizer->term->handle(** [minimize optimizer t] minimizes the term [t] in the optimizer
[optimizer]. *)valminimize:optimizer->term->handle(** [interrupt ()] interrupts the current optimizer operation. *)valinterrupt:unit->unit(** [get_statistics optimizer] retrieves statistics from the optimizer
[optimizer]. *)valget_statistics:optimizer->Statistics.t(** [pp_statistics fmt optimizer] pretty-prints the statistics of the
optimizer [optimizer] using the formatter [fmt]. *)valpp_statistics:optimizerFmt.tend(** {2 SMT-LIB Pretty Printing} *)moduleSmtlib:sig(** [pp ?name ?logic ?status fmt ts] pretty-prints the terms [ts] in SMT-LIB
format using the formatter [fmt]. Optional parameters include [name] for
the script name, [logic] for the logic, and [status] for the script
status. *)valpp:?name:string->?logic:Logic.t->?status:[`Sat|`Unsat|`Unknown]->termlistFmt.tendend(** The [M_with_make] module type extends [M] with a functor for creating
instances of [M] and a flag indicating availability. *)moduletypeM_with_make=sig(** [Make ()] creates a new instance of the [M] module type. *)moduleMake():M(** [is_available] indicates whether the module is available for use.
Will be deprecated in the future, please use Internals.is_available
instead. *)valis_available:bool(** Include the [M] module type. *)includeMend(** The [S] module type defines a simplified interface for interacting with SMT
solvers, focusing on model evaluation, solver interaction, and optimization.
*)moduletypeS=sig(** The type of SMT models. *)typemodel(** The type of SMT solvers. *)typesolver(** The type of optimizers. *)typeoptimize(** The type of optimization handles. *)typehandle(** [value model expr] evaluates the expression [expr] in the given [model].
*)valvalue:model->Expr.t->Value.t(** [values_of_model ?symbols model] retrieves the values of the given
[symbols] (or all symbols if not provided) from the [model]. *)valvalues_of_model:?symbols:Symbol.tlist->model->Model.t(** [set_debug flag] enables or disables debug mode based on [flag]. *)valset_debug:bool->unit(** {2 SMT-LIB Pretty Printing} *)moduleSmtlib:sig(** [pp ?name ?logic ?status fmt ts] pretty-prints the terms [ts] in SMT-LIB
format using the formatter [fmt]. Optional parameters include [name] for
the script name, [logic] for the logic, and [status] for the script
status. *)valpp:?name:string->?logic:Logic.t->?status:[`Sat|`Unsat|`Unknown]->Expr.tlistFmt.tend(** {2 Solver Handling} *)moduleSolver:sig(** [make ?params ?logic ()] creates a new solver with optional parameters
[params] and logic [logic]. *)valmake:?params:Params.t->?logic:Logic.t->unit->solver(** [add_simplifier solver] adds a simplifier to the solver [solver]. *)valadd_simplifier:solver->solver(** [clone solver] creates a copy of the solver [solver]. *)valclone:solver->solver(** [push solver] pushes a new context level onto the solver [solver]. *)valpush:solver->unit(** [pop solver n] pops [n] context levels from the solver [solver]. *)valpop:solver->int->unit(** [reset solver] resets the solver [solver] to its initial state. *)valreset:solver->unit(** [add solver exprs] adds the expressions [exprs] to the solver [solver].
*)valadd:solver->Expr.tlist->unit(** [check solver ~assumptions] checks the satisfiability of the solver
[solver] with the given [assumptions]. Returns [`Sat], [`Unsat], or
[`Unknown]. *)valcheck:solver->assumptions:Expr.tlist->[`Sat|`Unsat|`Unknown](** [model solver] retrieves the model from the solver [solver], if one
exists. *)valmodel:solver->modeloption(** [interrupt solver] interrupts the current solver operation. *)valinterrupt:solver->unit(** [get_statistics solver] retrieves statistics from the solver [solver].
*)valget_statistics:solver->Statistics.tend(** {2 Optimizer Handling} *)moduleOptimizer:sig(** [make ()] creates a new optimizer. *)valmake:unit->optimize(** [push optimizer] pushes a new context level onto the optimizer
[optimizer]. *)valpush:optimize->unit(** [pop optimizer] pops a context level from the optimizer [optimizer]. *)valpop:optimize->unit(** [add optimizer exprs] adds the expressions [exprs] to the optimizer
[optimizer]. *)valadd:optimize->Expr.tlist->unit(** [check optimizer] checks the satisfiability of the optimizer
[optimizer]. Returns [`Sat], [`Unsat], or [`Unknown]. *)valcheck:optimize->[`Sat|`Unsat|`Unknown](** [model optimizer] retrieves the model from the optimizer [optimizer], if
one exists. *)valmodel:optimize->modeloption(** [maximize optimizer expr] maximizes the expression [expr] in the
optimizer [optimizer]. *)valmaximize:optimize->Expr.t->handle(** [minimize optimizer expr] minimizes the expression [expr] in the
optimizer [optimizer]. *)valminimize:optimize->Expr.t->handle(** [interrupt optimizer] interrupts the current optimizer operation. *)valinterrupt:optimize->unit(** [get_statistics optimizer] retrieves statistics from the optimizer
[optimizer]. *)valget_statistics:optimize->Statistics.tendend(** The [S_with_fresh] module type extends [S] with a functor for creating fresh
instances of [S] and a flag indicating availability of the mappings. *)moduletypeS_with_fresh=sigmoduleMappings:M_with_make(** [Fresh.Make ()] creates a new instance of the [S] module type. *)moduleFresh:sigmoduleMake():Send(** [is_available] indicates whether the module is available for use. *)valis_available:bool(** Include the [S] module type. *)includeSend