Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file utils.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384moduleB=Kernel.BasicmoduleM=Api.Meta(** This module declares all the types and signatures needed to implement an smt solver. *)(** Qfuf is a logic with non-interpreted symbols, can be slow.
Lra is linear arithmetic. Fast, but it requires an interpretation of CTS specification into linear arithmetic.
*)typelogic=[`Qfuf|`Lra](** Any SMT Logic *)moduletypeLOGIC=sig(** Type for formulas *)typet(** Model returns by the solver *)typesmt_model(** Meta informations needed by the solver *)typectx(** Specify the logic implemented *)vallogic:logic(** [mk_name n] returns a SMT string from a Dedukti name [n] *)valmk_name:B.name->string(** [mk_var ctx s] returns a variable expression as to the name [s] *)valmk_var:ctx->string->t(** [mk_univ ctx u] returns an expression associated to the universe [u] *)valmk_univ:ctx->Common.Universes.univ->t(** [mk_axiom ctx s s'] returns an expression encoding the predicate A(s,s') *)valmk_axiom:ctx->t->t->t(** [mk_cumul ctx s s'] returns an expression encoding the predicate C(s,s') *)valmk_cumul:ctx->t->t->t(** [mk_rule ctx s s' s''] returns an expression encoding the predicate R(s,s',s'') *)valmk_rule:ctx->t->t->t->t(** [mk_bound ctx s i] returns an expression encoding that a variable cannot be higher that the ith universe *)valmk_bounds:ctx->string->int->t(** [solution_of_var ctx i model s] returns the universe found by the SMT solver *)valsolution_of_var:ctx->int->smt_model->string->Common.Universes.univend(** configures the SMT solver *)typeenv={mk_theory:int->Common.Oracle.theory;(** Compute a theory related to the target CTS specification. *)min:int;(** minimum number of universes to check *)max:int;(** maximum number of universes to check *)print:bool;(** print the problem in a file *)}(** [model] is a function that associate to each fresh universe a concrete universe. *)typemodel=B.name->Common.Universes.univ(** An SMT solver is a solver specific to one SMT such as Z3 *)moduletypeSMTSOLVER=sig(** [add pred] add the predicate [cstr] to the solver *)valadd:Common.Universes.cstr->unit(** [solve mk_theory] call the solver and returns the mimimum number of universes needed to solve the constraints as long as the model. The theory used by solver depends on the number of universes needed. Hence one needs to provide a function [mk_theory] that builds a theory when at most [i] are used.*)valsolve:env->int*modelend(** Generic solver for Universo *)moduletypeSOLVER=sig(** [parse file] parses the constraint associated to [file] *)valparse:Common.Files.path->unit(** [print_model meta model file] prints the model into the solution file associated to [file]. Universes are translated to terms via the [meta] rules. *)valprint_model:M.cfg->model->Common.Files.pathlist->unit(** [solve env] solves all the files parsed and returns a model as long as [i], the number of universes needed. As postconditions, [i >= env.minimum && i <= maximum]. Moreover forall [j < i], the solver did not found a solution. *)valsolve:env->int*modelendexceptionNoSolution