/** * The commands for the quint CLI * * See the description at: * https://github.com/informalsystems/quint/blob/main/doc/quint.md * * @author Igor Konnov, Gabriela Moreira, Shon Feder, Informal Systems, 2021-2025 */ import { SourceMap } from './parsing/quintParserFrontend'; import { ErrorMessage } from './ErrorMessage'; import { Either } from '@sweet-monads/either'; import { EffectScheme } from './effects/base'; import { LookupTable } from './names/base'; import { OpQualifier, QuintEx, QuintModule } from './ir/quintIr'; import { TypeScheme } from './types/base'; import { DocumentationEntry } from './docs'; import { IdGenerator } from './idGenerator'; import { AnalysisOutput } from './quintAnalyzer'; import { Maybe } from '@sweet-monads/maybe'; import { NameResolver } from './names/resolver'; export type stage = 'loading' | 'parsing' | 'typechecking' | 'testing' | 'running' | 'compiling' | 'outputting target' | 'documentation'; /** The data from a ProcedureStage that may be output to --out */ interface OutputStage { stage: stage; modules?: QuintModule[]; table?: LookupTable; types?: Map; effects?: Map; modes?: Map; passed?: string[]; failed?: string[]; ignored?: string[]; status?: 'ok' | 'violation' | 'failure' | 'error'; trace?: QuintEx[]; seed?: bigint; documentation?: Map>; errors?: ErrorMessage[]; warnings?: any[]; sourceCode?: Map; main?: string; } export interface ProcedureStage extends OutputStage { args: any; } export interface LoadedStage extends ProcedureStage { path: string; sourceCode: Map; } export interface ParsedStage extends LoadedStage { modules: QuintModule[]; defaultModuleName: Maybe; sourceMap: SourceMap; table: LookupTable; resolver: NameResolver; idGen: IdGenerator; } export interface TypecheckedStage extends ParsedStage { types: Map; effects: Map; modes: Map; } export interface CompiledStage extends TypecheckedStage, AnalysisOutput { mainModule: QuintModule; } export interface TestedStage extends LoadedStage { passed: string[]; failed: string[]; ignored: string[]; } export interface TracingStage extends LoadedStage { trace?: QuintEx[]; } export interface DocumentationStage extends LoadedStage { documentation?: Map>; } export interface ErrorData extends ProcedureStage { errors: ErrorMessage[]; sourceCode: Map; } export type ErrResult = { msg: string; stage: ErrorData; }; export type CLIProcedure = Either; /** Load a file into a string * * @param args the CLI arguments parsed by yargs */ export declare function load(args: any): Promise>; /** * Parse a Quint specification. * * @param loaded the procedure stage produced by `load` */ export declare function parse(loaded: LoadedStage): Promise>; /** * Check types and effects of a Quint specification. * * @param parsed the procedure stage produced by `parse` */ export declare function typecheck(parsed: ParsedStage): Promise>; /** * Run REPL. * * @param argv parameters as provided by yargs */ export declare function runRepl(argv: any): Promise; /** * Run the tests. We imitate the output of mocha. * * @param typedStage the procedure stage produced by `typecheck` */ /** * Main function to run tests. */ export declare function runTests(prev: TypecheckedStage): Promise>; /** * Run the simulator. * * @param prev the procedure stage produced by `typecheck` */ export declare function runSimulator(prev: TypecheckedStage): Promise>; /** Compile to a flattened module, that includes the special q::* declarations * * @param typechecked the output of a preceding type checking stage */ export declare function compile(typechecked: TypecheckedStage): Promise>; /** * Verify a spec via a model checker(Apalache or TLC). * * @param prev the procedure stage produced by `typecheck` */ export declare function verifySpec(prev: CompiledStage): Promise>; /** output a compiled spec in the format specified in the `compiled.args.target` to stdout * * @param compiled The result of a preceding compile stage */ export declare function outputCompilationTarget(compiled: CompiledStage): Promise>; /** Write the OutputStage of the procedureStage as JSON, if --out is set * Otherwise, report any stage errors to STDOUT */ export declare function outputResult(result: CLIProcedure): void; /** * Produces documentation from docstrings in a Quint specification. * * @param loaded the procedure stage produced by `load` */ export declare function docs(loaded: LoadedStage): Promise>; export {};