UNPKG

@informalsystems/quint

Version:

Core tool for the Quint specification language

45 lines (44 loc) 1.51 kB
/** * Substitutions for effects and its entities, including composition and application * * @author Gabriela Moreira * * @module */ import { Either } from '@sweet-monads/either'; import { ErrorTree } from '../errorTree'; import { Effect, Entity } from './base'; export type Substitutions = Substitution[]; type Substitution = { kind: 'entity'; name: string; value: Entity; } | { kind: 'effect'; name: string; value: Effect; }; export declare function compose(s1: Substitutions, s2: Substitutions): Either<ErrorTree, Substitutions>; /** * Applies substitutions to an effect, replacing all variable names with their * substitution values when they are defined. * * @param subs the substitutions to be applied * @param e the effect to be transformed * * @returns the effect resulting from the substitutions' application on the given * effect, when successful. Otherwise, an error tree with an error message and its trace. */ export declare function applySubstitution(subs: Substitutions, e: Effect): Either<ErrorTree, Effect>; /** * Applies substitutions to an entity, replacing all variable names with their * substitution values when they are defined. * * @param subs the substitutions to be applied * @param entity the entity to be transformed * * @returns the entity resulting from the substitutions' application on the * given entity */ export declare function applySubstitutionToEntity(subs: Substitutions, entity: Entity): Entity; export {};