UNPKG

@informalsystems/quint

Version:

Core tool for the Quint specification language

87 lines (86 loc) 2.87 kB
/** * Pretty printing for IR components. * * @author Gabriela Moreira * * @module */ import { OpQualifier, QuintDeclaration, QuintDef, QuintEx, QuintModule } from './quintIr'; import { QuintSumType, QuintType, Row } from './quintTypes'; import { TypeScheme } from '../types/base'; /** * Pretty prints a module * * @param quintModule the Quint module to be formatted * * @returns a string with the pretty printed definition */ export declare function moduleToString(quintModule: QuintModule): string; /** * Pretty prints a declaration. Includes a type annotation if the definition is * annotated, or if a type is provided. A type annotation, if present, takes * precedence over a type provided as argument to this function. * * @param decl the Quint declaration to be formatted * @param includeBody optional, whether to include the body of the declaration, * defaults to true * @param type optional, the type scheme of the declaration, defaults to * undefined * * @returns a string with the pretty printed declaration. */ export declare function declarationToString(decl: QuintDeclaration, includeBody?: boolean, type?: TypeScheme): string; /** * Pretty prints a definition. Includes a type annotation if the definition is * annotated, or if a type is provided. The annotation is preferred over the * type. * * @param def the Quint expression to be formatted * @param includeBody optional, whether to include the body of the definition, * defaults to true * @param type optional, the type scheme of the definition, defaults to * undefined * * @returns a string with the pretty printed definition. */ export declare function definitionToString(def: QuintDef, includeBody?: boolean, type?: TypeScheme): string; /** * Pretty prints an expression * * @param expr the Quint expression to be formatted * * @returns a string with the pretty printed expression */ export declare function expressionToString(expr: QuintEx): string; /** * Pretty prints a type * * @param type the Quint type to be formatted * * @returns a string with the pretty printed type */ export declare function typeToString(type: QuintType): string; /** * Pretty prints a row type. Standard row printing used in error reporting * * @param r the row type to be formatted * * @returns a string with the pretty printed row */ export declare function rowToString(r: Row): string; /** * Pretty prints a sum type. Standard sum printing used in error reporting * * @param r the sum type to be formatted * * @returns a string with the pretty printed sum */ export declare function sumToString(s: QuintSumType): string; /** * Pretty prints an operator qualifier. * * @param qualifier the qualidier to be formatted * * @returns a string with the pretty printed qualifier */ export declare function qualifierToString(qualifier: OpQualifier): string;