Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file optimizer_intf.ml
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667(* SPDX-License-Identifier: MIT *)(* Copyright (C) 2023-2024 formalsec *)(* Written by the Smtml programmers *)(** Optimizer Module. This module defines interfaces for interacting with
optimization solvers, including constraint management, optimization
objectives, and result retrieval. It provides a generic interface for
working with different optimization backends. *)(** {1 Module Types} *)(** The [S] module type defines the core interface for interacting with
optimization solvers. *)moduletypeS=sig(** The type of optimization solvers. *)typet(** [create ()] creates a new optimization solver. *)valcreate:unit->t(** [push solver] pushes a new context level onto the solver [solver]. *)valpush:t->unit(** [pop solver] pops a context level from the solver [solver]. *)valpop:t->unit(** [add solver exprs] adds the expressions [exprs] to the solver [solver]. *)valadd:t->Expr.tlist->unit(** [protect solver f] executes the function [f] within a protected context,
ensuring that the solver state is restored after execution. *)valprotect:t->(unit->'a)->'a(** [check solver] checks the satisfiability of the solver [solver]. Returns
[`Sat], [`Unsat], or [`Unknown]. *)valcheck:t->[`Sat|`Unsat|`Unknown](** [model solver] retrieves the model from the solver [solver], if one
exists. *)valmodel:t->Model.toption(** [maximize solver expr] maximizes the expression [expr] in the solver
[solver]. Returns the optimal value if found. *)valmaximize:t->Expr.t->Value.toption(** [minimize solver expr] minimizes the expression [expr] in the solver
[solver]. Returns the optimal value if found. *)valminimize:t->Expr.t->Value.toption(** [get_statistics solver] retrieves statistics from the solver [solver]. *)valget_statistics:t->Statistics.tend(** The [Intf] module type defines the interface for creating and working with
optimization solvers, including a functor for instantiating solvers and a
predefined Z3 solver implementation. *)moduletypeIntf=sig(** The [S] module type, which defines the core optimizer interface. *)moduletypeS=S(** [Make] is a functor that creates an optimizer instance from a given
mappings module. *)moduleMake(_:Mappings_intf.S):S(** [Z3] is a predefined optimizer implementation using the Z3 solver. *)moduleZ3:Send