UNPKG

@informalsystems/quint

Version:

Core tool for the Quint specification language

72 lines (71 loc) 3.5 kB
import { QuintEx, QuintModule } from './ir/quintIr'; import { ExecutionFrame } from './runtime/trace'; import { Outcome } from './simulation'; import { CLIProcedure, ErrResult, ErrorData, ParsedStage, ProcedureStage, TestedStage, TracingStage } from './cliCommands'; import { Either } from '@sweet-monads/either'; import { ApalacheResult } from './apalache'; import { TestResult } from './runtime/testing'; export type TraceHook = (index: number, status: string, vars: string[], states: QuintEx[], name?: string) => void; /** * Print a counterexample if the appropriate verbosity is set. * * @param verbosityLevel The verbosity level. * @param states The states of the counterexample. * @param frames The execution frames (optional). * @param hideVars Variables to hide in the output (optional). */ export declare function maybePrintCounterExample(verbosityLevel: number, states: QuintEx[], frames?: ExecutionFrame[], hideVars?: string[]): void; /** * Print witnesses if the appropriate verbosity is set. * * @param verbosityLevel The verbosity level. * @param outcome The simulation outcome. * @param witnesses The list of witnesses. */ export declare function maybePrintWitnesses(verbosityLevel: number, outcome: Outcome, witnesses: string[]): void; /** * Print violated invariants in the final state. * * @param state The final state. * @param invariants The list of invariants. * @param prev The previous stage context. */ export declare function printViolatedInvariants(state: QuintEx, invariants: string[], prev: any): void; /** * Process the result of a verification call. * * @param res The result of the verification. * @param startMs The start time in milliseconds. * @param verbosityLevel The verbosity level. * @param verifying The current tracing stage. * @param invariantsList The list of invariants. * @param prev The previous stage context. * @returns The processed result. */ export declare function processVerifyResult(res: ApalacheResult<void>, startMs: number, verbosityLevel: number, stage: TracingStage, invariantsList: string[]): CLIProcedure<TracingStage>; export declare function outputJson(stage: ProcedureStage): string; export declare function writeOutputToJson(filename: string, stage: ProcedureStage): void; export declare function jsonStringOfOutputStage(json: any): string; /** * Write json to a file. * * @param filename name of the file to write to * @param json is an object tree to write */ export declare function writeToJson(filename: string, json: any): void; export declare function cliErr<Stage>(msg: string, stage: ErrorData): Either<ErrResult, Stage>; /** * Find the main module by name. */ export declare function findMainModule(prev: ParsedStage, mainName: string): QuintModule | undefined; /** * Handle errors when the main module is not found. */ export declare function handleMainModuleError(prev: ParsedStage, mainName: string): CLIProcedure<TestedStage>; export declare function prepareOnTrace(source: string, outputTemplate: string | undefined, nTraces: number, metadata: boolean): TraceHook; /** * Output test results. */ export declare function outputTestResults(results: TestResult[], verbosityLevel: number, elapsedMs: number): void; export declare function outputTestErrors(prev: ParsedStage, verbosityLevel: number, failed: TestResult[]): void; export declare function printInductiveInvariantProgress(verbosityLevel: number, args: any, phase: number, nPhases: number, invariantsString?: string): void;