/** * Wrapper for running one-shot commands using the Rust evaluator. * Handles both simulation (quint run) and testing (quint test). * * @author Gabriela Moreira * * @module */ import { QuintEx, QuintModule } from '../ir/quintIr'; import { Outcome } from '../simulation'; import { TraceHook } from '../cliReporting'; import { LookupDefinition, LookupTable } from '../names/base'; import { ItfState, ItfValue } from '../itf'; import { QuintError } from '../quintError'; import { TestResult } from '../runtime/testing'; import { Either } from '@sweet-monads/either'; export type ParsedQuint = { modules: QuintModule[]; table: LookupTable; main: string; init: QuintEx; step: QuintEx; invariants: QuintEx[]; witnesses: QuintEx[]; }; export declare class CommandWrapper { private verbosityLevel; /** * Constructor for CommandWrapper. * @param {number} verbosityLevel - The level of verbosity for logging. */ constructor(verbosityLevel: number); /** * Simulate the parsed Quint model using the Rust evaluator * * @param {ParsedQuint} parsed - The parsed Quint model. * @param {string} source - The source code of the Quint model. * @param {QuintEx[]} witnesses - The witnesses for the simulation. * @param {number} nruns - The number of runs for the simulation. * @param {number} nsteps - The number of steps per run. * @param {number} ntraces - The number of traces to store. * @param {number} nthreads - The number of threads to use. * @param {bigint} [seed] - Optional seed for reproducibility. * @param {boolean} [mbt] - Whether to produce metadata for model-based testing. * @param {TraceHook} onTrace - A callback function to be called with trace information for each simulation run. * * @returns {Outcome} The outcome of the simulation. * @throws Will throw an error if the Rust evaluator fails to launch or returns an error. */ simulate(parsed: ParsedQuint, source: string, nruns: number, nsteps: number, ntraces: number, nthreads: number, seed?: bigint, mbt?: boolean, onTrace?: TraceHook): Promise; /** * Execute a single test using the Rust evaluator * * @param {LookupDefinition} testDef - The test definition to execute * @param {LookupTable} table - The lookup table for name resolution * @param {bigint} [seed] - Optional random seed for reproducibility. * @param {number} maxSamples - The maximum number of samples to run * @param {number} index - The index of the test in the run order * @param {TraceHook} onTrace - A callback function to be called with trace information for ITF output * * @returns {TestResult} The result of the test execution * @throws Will throw an error if the Rust evaluator fails to launch or returns an error */ test(testDef: LookupDefinition, table: LookupTable, seed: bigint | undefined, maxSamples: number, index: number, onTrace?: TraceHook): Promise; /** * Evaluate expressions at a given state using the Rust evaluator. * * @param {ItfState} state - The state as a raw ITF value (record mapping variable names to ITF values). * @param {LookupTable} table - The lookup table for name resolution. * @param {QuintEx[]} exprs - The expressions to evaluate at the given state. * * @returns Either an error or the list of evaluated ITF values (one per expression). */ evaluateAtState(state: ItfState, table: LookupTable, exprs: QuintEx[]): Promise>; /** * Run the Rust evaluator with the given command and input. * Optionally displays a progress bar driven by stderr JSON events. */ private runRustEvaluator; }