@informalsystems/quint
Version:
Core tool for the Quint specification language
22 lines (21 loc) • 1.14 kB
TypeScript
import { EvalFunction } from './builder';
import { CachedValue } from './Context';
/**
* Evaluates a nondet + oneOf() + body expression, which picks a value from a
* set and evaluates the body with that value. If the body evaluates to false,
* it retries with the next position in the set until it finds a true value or
* exhausts all positions.
*
* - If the set is empty, it returns false.
* - If the set is infinite, it picks a random value from the range
* [-2^255, 2^255) for each position.
* - If the set is to big (bigger than QUINT_RETRY_NONDET_SMALLER_THAN), it
* does not retry and returns the first value picked from the set.
*
* @param name - The name of the nondeterministic expression.
* @param cache - A cached value to store the picked value.
* @param setEval - The evaluation function for the set from which to pick a value.
* @param bodyEval - The evaluation function for the body of the let-in.
* @returns An evaluation function for the nondet let-in expression.
*/
export declare function evalNondet(name: string, cache: CachedValue, setEval: EvalFunction, bodyEval: EvalFunction): EvalFunction;