@informalsystems/quint
Version:
Core tool for the Quint specification language
30 lines (29 loc) • 1.25 kB
TypeScript
/**
* Flattening for modules, replacing imports and exports with definitions referred by the module.
*
* @author Gabriela Moreira
*
* @module
*/
import { LookupDefinition, LookupTable } from '../names/base';
import { QuintDef, QuintEx, QuintModule } from '../ir/quintIr';
/**
* Flatten a module, replacing instances, imports and exports with definitions referred by the module.
*
* @param quintModule - The module to be flattened
* @param modulesByName - A map of referred modules by name
* @param lookupTable - The lookup table for the module and all its references
*
* @returns The flattened module
*/
export declare function flattenModule(quintModule: QuintModule, modulesByName: Map<string, QuintModule>, lookupTable: LookupTable): QuintModule;
/**
* Find definitions used by a given expression, by flattening that expression.
*
* @param expr - The expression for which to find definitions
* @param lookupTable - The lookup table with all related references
*
* @returns The definitions used by the expression and their dependencies
*/
export declare function dependentDefinitions(expr: QuintEx, lookupTable: LookupTable): QuintDef[];
export declare function getNamespaceForDef(def: LookupDefinition): string | undefined;