chase-mcp

v0.7.0
chase-mcp Checked 2 days ago Published 1 month ago

MCP server exposing the contract operations of CHASE as agent-callable tools

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

compose

Parallel composition of two or more contracts (the contract of the system made of the components). Variables with the same name are connected; no variable can be an output of two contracts. By default the closed form ((A1 & A2) | !(G1 & G2), G1 & G2). With discharge, the result keeps the terms of the contracts: an assumption of a component implied by the component that drives its inputs is dropped, then the redundant terms; each test is one model-checking call. That result is an abstraction of the composition: a refinement proved on it holds for the composition…

ParameterTypeDescription
contracts *array
backendstring
dischargeboolean
name
timeoutnumber

conjoin

Conjunction (greatest lower bound) of two or more contracts: a contract that refines all of them, (A1 | A2, G1 & G2). With discharge, the result keeps the terms (the same contract): each guarantee under the assumptions of its contract that the others do not imply; with the same assumptions, (A, G1 & G2). Each test is one model-checking call.

ParameterTypeDescription
contracts *array
backendstring
dischargeboolean
name
timeoutnumber

disjoin

Disjunction (least upper bound) of two or more contracts: a contract refined by all of them, (A1 & A2, G1 | G2).

ParameterTypeDescription
contracts *array
name

merge

Merging of two or more viewpoints of the same component (e.g. function and timing): (A1 & A2, (G1 & G2) | !(A1 & A2)). With discharge, the result keeps the terms of the contracts, (A1 & A2, G1 & G2), which is the same contract, then drops the redundant terms; each test is one model-checking call. Use it before is_realizable or synthesize, which need the terms.

ParameterTypeDescription
contracts *array
backendstring
dischargeboolean
name
timeoutnumber

divide

The contract of the missing component: the largest contract C such that part composed with C refines system. (A & G', (G & A') | !(A & G')). With discharge, the result keeps the terms: it assumes the assumptions of system and the guarantees of part (under the assumptions of part that system does not give), and guarantees the guarantees of system and the assumptions of part. It is the same contract, then the redundant terms are dropped; each test is one model-checking call.

ParameterTypeDescription
part *
system *
backendstring
dischargeboolean
name
timeoutnumber

separate

Separation, the adjoint of merging: the smallest contract C such that system refines the merging of part and C. ((A & G') | !(G & A'), G & A').

ParameterTypeDescription
part *
system *
name

imply

Implication, the adjoint of conjunction: the largest contract C such that the conjunction of C and premise refines conclusion. ((A2 & !A1) | (G1 & !G2), G2 | !G1), with premise = (A1, G1).

ParameterTypeDescription
conclusion *
premise *
name

coimply

Coimplication, the adjoint of disjunction: the smallest contract C such that second refines the disjunction of C and first. (A2 | !A1, (G2 & !G1) | (A1 & !A2)), with first = (A1, G1).

ParameterTypeDescription
first *
second *
name

invert

Reciprocal (G, A): the contract seen from its environment. Inputs become outputs and outputs inputs.

ParameterTypeDescription
contract *
name

assume

Add an assumption b to the contract: (b & A, b -> G). The result is an abstraction of the contract (it is refined by it).

ParameterTypeDescription
contract *
formula *string
name

ensure

Add a guarantee b to the contract: (b -> A, b & G). The result refines the contract.

ParameterTypeDescription
contract *
formula *string
name

saturate

Saturation: the equivalent contract (A, A -> G). The other operations saturate their operands themselves.

ParameterTypeDescription
contract *
name

simplify

Simplify the formulas of the contract, as the simplify command of logics_tool: negations are moved towards the atoms, and temporal operators are grouped (G f & G g becomes G (f & g)). The result is equivalent; no model checker is needed.

ParameterTypeDescription
contract *
name

refines

Does `refined` refine `abstract` (can it replace it)? Checks that the assumptions of `abstract` imply those of `refined`, and that the guarantees of `refined` imply those of `abstract`. status is valid, invalid (with `failed` and a counterexample trace), or unknown. `context`: formulas that every behavior satisfies (e.g. an axiom of an encoding, a physical law); the behaviors that violate them are left out. Continuous time: when a step is a sample taken every `period` seconds and each variable changes at most `lipschitz` per second (one number, or {variable: num…

ParameterTypeDescription
abstract *
refined *
backendstring
context
lipschitz
period
timeoutnumber

verify

Can the assumptions and the guarantees hold together (A & G satisfiable, the verify command of logics_tool)? status is that of feasible: sat with a witness trace, which also shows compatibility (A satisfiable) and consistency (A -> G satisfiable); unsat when the guarantees cannot hold when the assumptions do, and then compatible and consistent say whether the assumptions alone cannot hold. With core, an unsat result carries the terms that conflict (in feasible.core). `context`: formulas that every behavior satisfies (e.g. an axiom of an encoding, a physical law)…

ParameterTypeDescription
contract *
backendstring
context
coreboolean
timeoutnumber

is_consistent

Consistency: is there a behavior allowed by the contract (A -> G satisfiable)? sat with a witness trace, or unsat when the guarantees contradict each other; with core, the guarantees that contradict each other. `context`: formulas that every behavior satisfies (e.g. an axiom of an encoding, a physical law); the behaviors that violate them are left out.

ParameterTypeDescription
contract *
backendstring
context
coreboolean
timeoutnumber

is_compatible

Compatibility: is there an environment that satisfies the assumptions? sat with a witness trace, or unsat when the assumptions contradict each other; with core, the assumptions that contradict each other. `context`: formulas that every behavior satisfies (e.g. an axiom of an encoding, a physical law); the behaviors that violate them are left out.

ParameterTypeDescription
contract *
backendstring
context
coreboolean
timeoutnumber

is_implementation

Is the implementation an implementation of the contract (M |=_M C)? The implementation is an LTL formula (`implementation`): implementation & A -> G must be valid; or a state machine, every behavior of which must satisfy A -> G. A machine that refuses inputs can implement a contract only because of that: check it with is_receptive. valid, or invalid with a trace and, in details.violated, the guarantees that this trace breaks (others may fail on other behaviors: check a term alone to know). `context`: formulas that every behavior satisfies (e.g. an axiom of an…

ParameterTypeDescription
contract *
backendstring
context
controller
implementation
machine
rtl
smv
synthesized_from
timeoutnumber

is_environment

Is the environment an environment of the contract (E |=_E C)? The environment is an LTL formula over the variables of the contract (`environment`): environment -> A must be valid; or a state machine (`smv`, `machine`, or `rtl`, as for is_implementation) every behavior of which must satisfy A. `context`: formulas that every behavior satisfies (e.g. an axiom of an encoding, a physical law); the behaviors that violate them are left out.

ParameterTypeDescription
contract *
backendstring
context
environment
machine
rtl
smv
timeoutnumber

repair

The values of named constants, within their ranges, that make a check pass, at the least change from their present values (the sum of |new - present|), or at the least `minimize` / the greatest `maximize` (a term over the constants). `parameters`: the constants that may change, {name: {low, high, integer}}; they are among the `constants` of the contracts. The check: refines (`refined`, `abstract`), impl or env (`contract` and `implementation` / `environment` as a formula, or `smv`, `machine`, `rtl`), verify, compat, consist (`contract`). status: holds (the prese…

ParameterTypeDescription
check *string
parameters *object
abstract
backend
contract
environment
implementation
machine
maximize
methodstring
minimize
refined
rounds
rtl
smv
time_limit
timeoutnumber

is_receptive

Does the state machine accept every input that the assumptions of the contract allow? A machine that refuses an input has no behavior with it, so is_implementation may hold only because it blocks the inputs. receptive, or not_receptive with the trace to the state after which it refuses an input (details: state and input). Uses the initial and safety assumptions; the inputs must be Boolean or integer ranges. The state machine is given as one of: `smv`, a program in SMV (the input language of nuXmv: MODULE main with VAR/IVAR, INIT, TRANS..., no specification) that…

ParameterTypeDescription
contract *
backendstring
controller
machine
rtl
smv
synthesized_from
timeoutnumber

remove_redundant

Drop the assumptions implied by the other assumptions, and the guarantees implied by the assumptions and the other guarantees. Returns the contract and the terms removed (`removed`: each term with its part, and with core the terms that imply it); terms whose check did not finish are kept and listed in `unknown`. Choose `synth` by what the contract is for next. false (the default) keeps A -> G: before the algebra and the checks (compose, refines, verify, ...). true keeps realizability and the controllers: before synthesis (is_realizable, synthesize, is_well_separ…

ParameterTypeDescription
contract *
backendstring
context
coreboolean
synthboolean
timeoutnumber

implies

On formulas: validity. Is the LTL formula phi -> psi valid, i.e. true for every behavior? Returns valid, or invalid with a counterexample trace satisfying phi and violating psi. `context`: formulas that every behavior satisfies (e.g. an axiom of an encoding, a physical law); the behaviors that violate them are left out.

ParameterTypeDescription
phi *string
psi *string
variables *object
backendstring
context
timeoutnumber

is_satisfiable

On formulas: satisfiability. Does some behavior satisfy the LTL formula? sat with a witness trace, or unsat; with core, the conjuncts of the formula that cannot hold together. This is not the satisfaction of a contract by a component, which is is_implementation. `context`: formulas that every behavior satisfies (e.g. an axiom of an encoding, a physical law); the behaviors that violate them are left out.

ParameterTypeDescription
formula *string
variables *object
backendstring
context
coreboolean
timeoutnumber

unsat_core

On formulas: a minimal set of terms that cannot hold together. Give a contract (its assumptions and guarantees, A & G, are searched: the core says whether the assumptions contradict each other, the guarantees do, or the guarantees cannot hold when the assumptions do), or formulas with their variables. status is found with core, none when they can hold together, or unknown with the reason. `context`: formulas that every behavior satisfies (e.g. an axiom of an encoding, a physical law); the behaviors that violate them are left out.

ParameterTypeDescription
backendstring
context
contract
formulas
timeoutnumber
variables

is_realizable

GR(1) synthesis (slugs): realizability. Can a component choose its outputs so that the guarantees hold for every environment satisfying the assumptions? realizable, or unrealizable with the counter-strategy of the environment; with core, also the unrealizable core (see unrealizable_core). Needs slugs; the formulas must be in the GR(1) fragment.

ParameterTypeDescription
contract *
coreboolean
timeoutnumber

synthesize

GR(1) synthesis (slugs): the controller (an explicit strategy) when the contract is realizable, or the counter-strategy of the environment. Needs slugs; the formulas must be in the GR(1) fragment.

ParameterTypeDescription
contract *
timeoutnumber

unrealizable_core

GR(1) synthesis (slugs): a minimal set of guarantees that is unrealizable under all the assumptions: removing any of them makes the contract realizable. status is found with core (the contract with those guarantees), none when the contract is realizable, or unknown with the reason. Needs slugs.

ParameterTypeDescription
contract *
timeoutnumber

is_well_separated

GR(1) synthesis (slugs): well-separation. Can the component win by forcing the environment to violate its assumptions? separated when it cannot; not_separated with the controller that forces the violation, which means the assumptions are too weak or depend on the outputs; with core, a minimal set of assumptions that causes it. The component must keep its initial and safety guarantees while it forces the violation (with with_guarantees false, the guarantees are left out). Only violations forced from every initial state are detected.

ParameterTypeDescription
contract *
coreboolean
timeoutnumber
with_guaranteesboolean

is_vacuous

GR(1) synthesis (slugs): vacuity. Can the component win without an output that a liveness guarantee asks for (Bloem et al., FMSD 2021)? vacuous lists each such output with its mode, never (a winning strategy never sets it: the guarantee that names it is discharged by the assumptions) or eventually (a winning strategy stops setting it), and the strategy; with core, a minimal set of assumptions that lets it. not_vacuous; unrealizable when the contract itself is; unknown. The outputs checked are `outputs`, by default those that occur only positively in a liveness g…

ParameterTypeDescription
contract *
coreboolean
outputs
timeoutnumber

parse_spec

Read the contracts of a specification in the logics language of CHASE (the .ltl files of logics_tool), given as text or as a file path.

ParameterTypeDescription
path
text

to_spec

Write contracts as a specification in the logics language of CHASE, which logics_tool and the other CHASE tools read.

ParameterTypeDescription
contracts *array
namestring

rtl_ports

The ports of a Verilog or SystemVerilog module read as a state machine: the inputs and the outputs with their types ("bool", "word[n]"), as the variables of a contract checked against it, the reset (not an input when given), and `start`, the step from which the contracts are checked.

ParameterTypeDescription
rtl *

parse_c

Read the contracts written in a C file (text or a file path), one per function: the clauses of ESBMC (__ESBMC_requires, __ESBMC_ensures in the body), of CBMC (__CPROVER_requires, __CPROVER_ensures after the signature), or of ACSL (/*@ requires ...; ensures ...; */). The inputs are the parameters, the outputs FUNCTION_out (the return value) and the pointers written (*p is p). A function with no clause has a contract with no terms: check_c checks it for overflow, division by zero, and the like.

ParameterTypeDescription
path
text

check_c

Check each function of a C file (text or a file path) against the contract written in its clauses (see parse_c), one call at a time, with ESBMC or CBMC (whichever is installed): valid, or invalid with the values of a failing call. A function with no clause is checked as code alone (safe: no overflow, division by zero, or bad pointer). `functions`: the ones to check (default: all).

ParameterTypeDescription
functions
path
text
timeoutnumber

parse_smv

Read an SMV model with its specifications (LTLSPEC, INVARSPEC; text or a file path) as a contract: the IVAR are its inputs, the VAR its outputs (a VAR with no ASSIGN is still an output: write an input as IVAR), the specifications its guarantees. is_implementation with `smv` set to the model (its specifications are left out) checks it. An enumerated type is read as the integers 0, 1, ... in the order written (in the traces too), a DEFINE in a specification as its definition. Not read: CTL, past operators, and a DEFINE written with case ... esac; the error says which.

ParameterTypeDescription
path
text

parse_sva

Read the assume property and assert property statements of SystemVerilog (a module, a bind file, or the statements alone; text or a file path) as a contract: assumptions and guarantees, with the widths of Verilog, $past, bounded sequences, and disable iff. The directions come from the module ports, or from `inputs` or `outputs` (the other signals are of the other kind). Returns the contract, the properties read (label, kind, formula, from_cycle: the cycle from which a property with $past is checked), `skipped` (statements not read, with the reason), `covers`, th…

ParameterTypeDescription
clock
inputs
name
outputs
parameters
path
text

to_sva

Write a contract as a SystemVerilog checker module: assumptions as assume property, guarantees as assert property, clocked by @(edge clock); a formula G p is checked at every cycle, any other once (initial). `reset` (e.g. "rst" or "!rst_n") disables the properties while it holds; `bind`, the name of a design module, adds a bind statement (ports connected by name; `names`, from parse_sva, connects the hierarchical names). Any tool that reads SVA can check the module. Real variables cannot be written.

ParameterTypeDescription
contract *
bind
clockstring
edgestring
module
names
reset

visualize

Draw contracts as a web page: the contracts given as JSON, or the contracts of a specification in the logics language of CHASE (text, or the path of a file). Without `draw` and `refines`, the contracts are put together by their ports: an output and an input of the same name are wired; contracts with the same ports are versions of one part, and the first one is wired; a contract whose outputs several parts drive, and which gives them what they read from outside, has the parts drawn inside it. `draw` names the contracts to draw instead; NAME+NAME draws their compo…

ParameterTypeDescription
checkboolean
contracts
draw
environments
open
output
path
realizableboolean
refines
text
timeoutnumber
verifyboolean