AbsApplyReturn | type | apply 可返回裸 Abs(无 throws)或带 throws 通道的 AbsApplyResult | AbsApplyReturn = Abs | AbsApplyResult |
AbsAssignRecord | type | Abs 域赋值记录(eval 通道 $assignRecord 的同形投影) | AbsAssignRecord = { name: string; prev?: Abs; next: Abs; line?: number; column?: number; conditional?: boolean; paramBinding?: boolean; } |
AbsCallRecord | type | Abs 域调用记录(eval 通道 EvalCallRecord 的同形投影) | AbsCallRecord = { fnName: string; args: Abs[]; result: Abs; callLoc?: { line: number; column: number }; threw?: boolean; } |
AbsFnImpl | type | — | AbsFnImpl = { params: string[]; body?: Node; async?: boolean; env?: AstEnv; kind?: string; fnKind?: "function" | "async" | "generator" | ... |
absFunction | fn | 造一个带实现的 Abs 函数值 | absFunction( params: string[], impl: Omit<AbsFnImpl, "params">, opts?: { name?: string; paramTypes?: Abs[]; returnType?: Abs; slots?: Record<string, { value: Abs; optional?: boolean; readonly?: boolean }>; conf?: Confidence; ctor?: boolean; length?: number; }, ): Abs |
AbsModuleExports | type | — | AbsModuleExports = { named: Record<string, Abs>; default?: Abs; evaluated?: boolean; cjsMain?: boolean; interopDefault?: boolean; } |
absShapeKey | fn | 结构键的最小面(join 去重 / 槽相等 / env 声明去重共用)。 | absShapeKey(a: Abs, seen: Set<object> = new Set()): string |
AbsSigImpl | type | Abs 原生 env/builtin 实现(evaluator 优先) | AbsSigImpl = (args: Abs[], thisVal?: Abs) => Abs | undefined |
absToConstraint | fn | Abs → 契约;不可表达 → undefined。 | absToConstraint( a: Abs, budget: ProjectionBudget = new ProjectionBudget(), ): NudoConstraint | undefined |
absToString | fn | — | absToString(a: Abs): string |
actionsForIssue | fn | 诊断码 → 结构化动作(AI1);未知码给 info 提示 | actionsForIssue(i: { code: string; expected?: string; suggestion?: string; fn?: string; reason?: string; }): CheckAction[] |
add | fn | — | add(a: Abs, b: Abs, phi: Phi = pTrue): Abs |
applyCallbackAbs | fn | — | applyCallbackAbs( cb: Abs | { type: string }, args: Abs[], env: unknown, phi: unknown, budget: unknown, thisVal?: Abs, ): Abs |
applyCallbackValue | fn | 通用回调实参调用(exec/class invokeArrMethod 与 builtins Array.from 共用): 原始 JS 函数直调(展开实参);Abs fn 走 applyCallbackAbs(sum 分发/宿主)。 | applyCallbackValue( fn: unknown, args: Abs[], env: unknown, phi: unknown, budget: unknown, thisVal?: Abs, ): Abs |
asAbs | fn | 从 map/filter/reduce 回调实参里取出 Abs(Identifier 已绑定或直接 Abs) | asAbs(v: unknown): Abs | undefined |
assignSourceSlots | fn | — | assignSourceSlots(src: Abs): Record<string, { value: Abs }> | undefined |
assumeFinite | const | 显式有限证据:t 为有限数(非 NaN/±Inf),开启线性环化简 | const assumeFinite |
AstEnv | type | — | — |
attachFnImpl | fn | — | attachFnImpl(a: Abs, impl: AbsFnImpl): void |
beginCollectionFork | fn | — | beginCollectionFork(): void |
bindImports | fn | 把 import 说明符绑定进 env(宿主已求值依赖) | bindImports( node: ImportDeclaration, env: AstEnv, modules: Record<string, AbsModuleExports>, ): void |
bindingsOf | fn | run 表的顶层绑定表: - 顶层 const/let($recordBinding 通道,Abs 值); - 私有顶层函数声明(宿主 JS 函数;与 ANALYSIS_SLOTS 同源,导出面同名 可枚举键不重复登记——导出函数只走导出表)。 | bindingsOf(run: Record<string, unknown>): Map<string, unknown> | undefined |
bitandAbs | fn | & —— ToInt32 两侧后按位与 | bitandAbs(a: Abs, b: Abs): Abs |
bitnotAbs | fn | ~ —— ToInt32 后按位取反(bigint 无符号截断) | bitnotAbs(a: Abs): Abs |
bitorAbs | fn | | —— ToInt32 两侧后按位或 | bitorAbs(a: Abs, b: Abs): Abs |
bitxorAbs | fn | ^ —— ToInt32 两侧后按位异或 | bitxorAbs(a: Abs, b: Abs): Abs |
buildArgsFromAssume | fn | 按 assume 集合构造实参:被 assume 的参数给带约束的符号,其余 any (design-cli-semantics §2:入口无约束 = any,不是 unknown)。 | buildArgsFromAssume( source: string, fnName: string, assumeIds: Set<string>, bounds?: ReadonlyMap<string, Pred>, ): Abs[] |
builtinCtorAbs | fn | — | builtinCtorAbs(name: string): Abs |
builtinCtorNameOf | fn | Abs 侧内建构造器身份(与宿主构造器名对齐) | builtinCtorNameOf(v: unknown): string | undefined |
callAbsMethod | fn | 调用 Abs 方法。返回 undefined = 未接管(调用方走其它路径)。 | callAbsMethod( recv: Abs, name: string, args: Abs[], ): Abs | undefined |
callAtFunctionBoundary | fn | 函数调用边界:callee 的 loop/early-return 不得冒泡成 caller 结果。 | callAtFunctionBoundary<T>(body: () => T): T |
canonicalArrayIndex | fn | ES 规范数组下标(无前导零、< 2^32-1);非规范键返回 undefined | canonicalArrayIndex(v: unknown): number | undefined |
CheckAction | type | 结构化修复动作(AI1;稳定枚举,只增不改语义) | CheckAction = { kind: "draft" | "relax" | "callsite" | "assume" | "mock" | "emit" | "ignore-throws" | "info"; command?: string; label: st... |
CheckIssue | type | — | CheckIssue = Diagnostic & { fn?: string; line?: number; column?: number; actual?: string; expected?: string; reason?: "cycle" | "depth" |... |
CheckJsonMulti | type | 多文件 check --json 信封(CI / monorepo)。单文件仍输出裸 CheckJson。 | CheckJsonMulti = { version: 1; kind: "multi"; ok: boolean; summary: CheckReport["summary"] & { files: number; budgetTruncated?: boolean }... |
clearBClasses | fn | — | clearBClasses(): void |
clearCollectionTables | fn | — | clearCollectionTables(): void |
clearStaleTermPred | fn | 调用方已直接改 shape 时的 term/pred 清理 | clearStaleTermPred(v: Abs): void |
cmp | fn | 比较:返回 boolean Abs;若双字面量则 exact | cmp( op: "lt" | "le" | "gt" | "ge" | "eq" | "ne", a: Abs, b: Abs, phi: Phi = pTrue, ): Abs |
collectAbsExports | fn | 从已求值 env + AST 收集 ESM 导出。 | collectAbsExports( file: File, env: AstEnv, modules?: Record<string, AbsModuleExports>, ): AbsModuleExports |
collectAbsFreeVars | fn | 公开:收集 Abs 自由 term 变元(dts 泛型投影 / α 作用域判定复用 L2 基建)。 | collectAbsFreeVars(a: Abs): Set<string> |
collectionElementJoin | fn | 元素联合(for-of / Array.from);无表 → unknown。 | collectionElementJoin(c: Abs): Abs |
collectionExactLen | fn | 确切条目数:Set 无 maybeAbsent / Map 无 shadow+maybeAbsent 时返回长度; 否则 undefined(for-of 不得假装有界)。 | collectionExactLen(c: Abs): number | undefined |
CONSTRAINT_BUILDER_NAMES | const | 构建器表面名(供文法正则 / 测试枚举;顺序即表定义顺序) | const CONSTRAINT_BUILDER_NAMES |
CONSTRAINT_BUILDERS | const | 约束构建器表面名表(单一真源):case 实参文法、mock 类型表达式识别与 侧车注入共用的名字 → 实现映射。键名是 *.nudo.js / 指令里的用户写法 (lit/and 而非内部的 litC/andC)。 | const CONSTRAINT_BUILDERS |
CONSTRAINT_CHAIN_METHOD_NAMES | const | 链式方法名表(单一真源):builder(...).method(...) 链上允许的方法。 | const CONSTRAINT_CHAIN_METHOD_NAMES |
CONSTRAINT_EXPR_RE | const | 约束表达式头:name( 形态。由 CONSTRAINT_BUILDER_NAMES 生成—— 名单只在 CONSTRAINT_BUILDERS 一处维护。 | const CONSTRAINT_EXPR_RE |
constraintAdmitsNullish | fn | 契约域是否包含 nullish(null / undefined)。 | constraintAdmitsNullish( c: NudoConstraint, seen?: Set<object>, ): boolean |
constraintToEntryAbs | fn | 契约 → 函数入口 param Abs(infer/hover 用)。 | constraintToEntryAbs( c: NudoConstraint, paramName: string, depth: number = LAZY_TEMPLATE_DEPTH, binders?: BinderTable, ): Abs |
CONTRACT_SOURCE_ABBR | const | 档位源缩写:handwritten=hw / generated=gen / implicit=imp | const CONTRACT_SOURCE_ABBR |
ContractDiag | type | contract 推导诊断(severity 由消费方按 code 定档,形状对齐 Issue 子集) | ContractDiag = { code: string; message: string; file?: string; line?: number; column?: number; } |
contractDiagCount | fn | 当前诊断累计序号(since 锚:工具面只排干自身探测产生的增量) | contractDiagCount(): number |
contractParamNameSet | fn | 侧车契约可绑定的参数名全集 | contractParamNameSet(formals: FormalParam[]): Set<string> |
ContractSource | type | 有效契约来源:手写(源码 refine ∪ 侧车手写绑定)> 生成段 > 隐式 | ContractSource = "handwritten" | "generated" | "implicit" |
contractSourceOf | fn | contractTierOf 的来源投影;非导出 → undefined | contractSourceOf( source: string, fnName: string, fromFile: string, opts: ContractTierOpts = {}, ): ContractSource | undefined |
ContractTierOpts | type | — | ContractTierOpts = EffectiveContractOpts |
ctorArgDefinitelyInvalid | fn | 构造器实参确定非法(原生 TypeError 域): - 非可迭代字面量(number/boolean/symbol/bigint、闭对象字面量、symbol 字面量)→ 四个集合构造器都抛 - Map/WeakMap 条目必须是对象(IsObject):prim 条目(含字符串实参的 每个字符、tuple/Set 元素)与 nullish 字面量条目 → TypeError (Bug 8:null/undefined/symbol 字面量挂 shape unknown + lit term, 旧 primEntry 只查 prim 形态 → 漏抛) - WeakMap 键 = Get(entry, "0") 须可弱持有(classifyCanBeHeldWeakly 同 口径):零/一元组、闭对象/fn/无 0 槽 brand 条目键 undefined、prim/ nullish 键 → TypeError(Bug 8:旧口径只查 ≥2 元组首元素 prim) - WeakSet 元素须可弱持有:prim/nullish 字面量元素(含字符串字符)→ TypeError;symbol 元素合法(node 实测 new WeakSet([Symbol()]) 不抛) - Bug 8 gate 面:抽象外层 iterable(any/unknown/开放 obj/fn/其它 brand) 可能非可迭代、抽象元素(含抽象字符串实参的字符臂)可能非 entry/ 非弱键 → recordMayThrow(三个分派点共用本判定,集中记录) | ctorArgDefinitelyInvalid( name: "Map" | "Set" | "WeakMap" | "WeakSet", iterable: Abs | undefined, ): boolean |
ctorNameOfRecv | fn | 接收者 → 原型链 constructor 名(.constructor 折叠)。 | ctorNameOfRecv(recv: Abs): string | undefined |
currentExecPhi | fn | — | currentExecPhi(): Phi |
DEFAULT_MAX_LOOP_ITERS | const | 循环展开上限(leaf)—— 从 control.ts 拆出,打断 control ↔ containers 环。 | const DEFAULT_MAX_LOOP_ITERS |
definitelyNotNullishShape | fn | 该 shape 在 JS 上一定不是 null/undefined | definitelyNotNullishShape(s: Shape): boolean |
derefConstraint | fn | 解一层 lazy:调用 thunk 一次、校验产物是约束、toPlainConstraint 归一化, 并按 thunk 记忆化(重复 deref 同一闭包 → 同一对象)。 | derefConstraint(c: NudoConstraint): NudoConstraint |
Diagnostic | type | — | Diagnostic = { severity: "error" | "warning" | "info"; code: string; message: string; suggestion?: string; fn?: string; argIndex?: number; } |
div | fn | 除法:字面量折叠;除以正/负常数时按单调性推界。 | div(a: Abs, b: Abs, phi: Phi = pTrue, assume?: Phi): Abs |
drainPromiseMicros | fn | — | drainPromiseMicros(): void |
EffectiveContractOpts | type | — | EffectiveContractOpts = RefineResolveOpts & { autoBind?: boolean | ((sidecarPath: string) => boolean); projectDir?: string; } |
emptyEnv | fn | 空求值环境(分析宿主用:不带任何绑定) | emptyEnv(): AstEnv |
emptyPhi | const | — | const emptyPhi |
endCollectionFork | fn | — | endCollectionFork(arms: Array<ArmOverlay | undefined | null>): void |
enterPromiseExecutorScope | fn | — | enterPromiseExecutorScope(): void |
eq | const | — | const eq |
errorBrandAbs | fn | Error brand:shape 带 name/message(字面量 message 保精确)。 | errorBrandAbs(name: string, args: Abs[]): Abs |
EvalAbsAssignRecord | type | B 赋值记录(与 ast-records.ts AbsAssignRecord 同形;structuralAssignIssues 消费) | EvalAbsAssignRecord = { name: string; prev: Abs | undefined; next: Abs; line?: number; column?: number; conditional?: boolean; paramBindi... |
evalArrayStatic | fn | Array.isArray / Array.from / Array.of | evalArrayStatic(name: string, args: Abs[]): Abs | undefined |
evalBuiltinInstanceMethod | fn | brand 实例方法(Date/RegExp/Map/Set/Error 家族/装箱拆箱后的 prim 面在外层) | evalBuiltinInstanceMethod( brandName: string, method: string, recv: Abs, args: Abs[], ): Abs | undefined |
evalBuiltinNew | fn | new X(...) | evalBuiltinNew(className: string, args: Abs[]): Abs | undefined |
EvalClassSpec | type | — | — |
evalDateCtor | fn | — | evalDateCtor(args: Abs[]): Abs |
evalDateMethod | fn | — | evalDateMethod(name: string, recv: Abs, args: Abs[]): Abs | undefined |
evalDateStatic | fn | — | evalDateStatic(name: string, args: Abs[]): Abs | undefined |
EvalFallback | type | evaluator 回落事件(观测单一埋点)。 | EvalFallback = { reason: string; message: string; loc?: { line: number; column: number }; origin?: "module" | "host" | "engine"; gateFata... |
evalGlobalFn | fn | — | evalGlobalFn(name: string, args: Abs[]): Abs | undefined |
evalJsonMethod | fn | JSON.parse / stringify:字面量实参真执行折叠;失败硬抛(catch 可吸收) | evalJsonMethod(name: string, args: Abs[]): Abs | undefined |
evalMathMethod | fn | — | evalMathMethod(name: string, args: Abs[]): Abs | undefined |
evalNamespaceCall | fn | 命名空间静态分派。Bug 311:thisVal = 静态方法值的 this 绑定(成员读出的 静态方法被单独调用时的接收者,如 Promise.resolve.call(null, 1)); 缺席 = 直接命名空间调用(this ≡ 命名空间构造器,合法)。 | evalNamespaceCall( ns: string, method: string, args: Abs[], thisVal?: Abs, ): Abs | undefined |
evalNumberStatic | fn | Number.isInteger / isNaN / parseFloat 等 | evalNumberStatic(name: string, args: Abs[]): Abs | undefined |
evalObjectMethod | fn | — | evalObjectMethod(name: string, args: Abs[]): Abs | undefined |
evalObjectProtoMethod | fn | Object.prototype 方法语义(evaluator $invoke 与 Object.prototype.X.call 共用)。 | evalObjectProtoMethod( name: string, thisVal: Abs, args: Abs[], ): Abs | undefined |
EvalPosRecord | type | 位置级 Abs 记录(hover 重放插桩 $nodoPos 消费): (1-based 行, 0-based 列) → 该位置表达式求值态 Abs | EvalPosRecord = { line: number; column: number; abs: Abs; } |
evalPromiseCtor | fn | new Promise(executor):调用 executor(resolve, reject),收集 resolve 实参作为 promise inner。原生只认第一次 settle——顺序双 resolve 取第一次;执行器内 $fork 分叉时各臂 settle 值 join(路径敏感,不得 first-wins 假精确)。 | evalPromiseCtor(args: Abs[]): Abs |
evalPromiseMethod | fn | then/catch/finally:可映射回调 → 新 inner;做不到诚实 promise<unknown> | evalPromiseMethod( name: string, recv: Abs, args: Abs[], ): Abs | undefined |
evalPromiseStatic | fn | Bug 311:Promise 静态派发。thisVal = 静态方法值的 this 绑定(成员读出 的静态方法被单独调用时的接收者);缺席 = 直接命名空间调用(this ≡ Promise 构造器,合法)。非构造器接收者按原生抛 TypeError。 | evalPromiseStatic( name: string, args: Abs[], thisVal?: Abs, ): Abs | undefined |
evalRegExpCtor | fn | — | evalRegExpCtor(args: Abs[]): Abs |
evalRegExpMethod | fn | — | evalRegExpMethod(name: string, recv: Abs, args: Abs[]): Abs | undefined |
evalStringStatic | fn | String.fromCharCode / String.fromCodePoint: - fromCharCode:全部字面量 → 按 ToUint16 折成精确字符串(含越界/非整数/ 数字字符串);symbol 字面量 → TypeError(ToNumber 抛);任一抽象实参 → 抽象 string(不假精确) - fromCodePoint(Bug 38):字面量过 ToNumber 后 IsValidCodePoint 校验 (node v26 实测:非整数/NaN/±∞/<0/>0x10FFFF → RangeError "Invalid code point";null/""/false → 0 合法;"65" → 65;surrogate 0xD800 合法); symbol/bigint 的 ToNumber → TypeError(fromCodePoint(1n) 原生抛,区别 于 fromCharCode 的 ToUint16 面——bigint ToString 合法但 ToNumber 抛); 抽象实参 → may RangeError(+ symbol 载体 may TypeError)+ str("path") | evalStringStatic(name: string, args: Abs[]): Abs | undefined |
evalSymbolCtor | fn | 全局 Symbol([desc])($callNamed 身份校验后派发) | evalSymbolCtor(args: Abs[]): Abs |
evictCheckSourceMemoForPaths | fn | *.nudo.js 变更后定向逐出依赖它的整文件 check 缓存。查找与索引同走 stablePathKey | evictCheckSourceMemoForPaths(paths: string[]): number |
evictGeneralizeMemoForPaths | fn | LSP/宿主:*.nudo.js 变更后按路径定向逐出依赖它的 L0 条目。 | evictGeneralizeMemoForPaths(paths: string[]): number |
execNudoModule | fn | 执行 *.nudo.js(真实 JS + 我们的构建器)。import/export 由 Babel 语句级 改写:多行 named import、注释/字符串里的同形文本不误伤;相对 .nudo 递归 求值;环 → throw NudoSidecarError。结果进 exec 缓存(依赖闭包内容指纹键)。 | execNudoModule(src: string, opts?: RefineResolveOpts): Record<string, unknown> |
ExplainInput | type | 结构化输入(只取观察面已有字段;结构性类型避免与 check 模块成环) | ExplainInput = { signatures: ReadonlyArray<{ name: string; paramTypes?: readonly string[]; display?: string; detail?: string; conf?: stri... |
extractBalancedParens | fn | 平衡括号摘取(字符串感知;\ 不是转义——与 case 实参原样 slice 一致)。 | extractBalancedParens(text: string, startIdx: number): string | null |
extractDeclaredThrows | fn | 申报式抛错(declare throws — L2 豁免): 与 refine 同扫函数前注释块(D6=G2 同一 scope 绑定)。 | extractDeclaredThrows( source: string, fnName: string, ): string[] |
extractFn | fn | — | extractFn( source: string, fnName: string, fileAst?: ReturnType<typeof babelParse>, ) |
extractFnBudget | fn | 函数级预算旋钮(#64 P4): 与 @nudo:throws 同路径扫函数前注释块(D6=G2 同一 scope 绑定)。 | extractFnBudget( source: string, fnName: string, ) |
extractNudoImports | fn | @nudo:import 命名/namespace 导入(D5=F1:文法在 directive-scan 单源)。 | extractNudoImports(source: string, filename?: string): NamedImport[] |
extractRefineReturnFromSource | fn | 解析 @nudo:contract return positive → 返回契约。 | extractRefineReturnFromSource( source: string, fnName: string, opts: RefineResolveOpts = {}, ) |
ExtState | type | — | ExtState = "nonext" | "sealed" | "frozen" |
extStateOf | fn | — | extStateOf(o: Abs): ExtState | undefined |
falseConstraint | fn | — | falseConstraint(c: Abs): Pred | undefined |
FnAbs | type | — | FnAbs = Abs & { shape: { k: "fn"; params: string[]; name?: string; paramTypes?: Abs[]; returnType?: Abs; }; } |
fnConstraintToEntryReqs | fn | fn 约束 → 逐参约束表(contract 推导 / 入口签名消费)。 | fnConstraintToEntryReqs( c: NudoConstraint, ): Array<{ param: string; constraint: NudoConstraint }> |
FormalParam | type | C4.1:函数形参表面(contract surface)—— 侧车 fn({…}) / @nudo:contract 参数名与求值形参的对齐基线。 | FormalParam = | { kind: "id"; name: string; index: number; tsType?: string; optional?: boolean; } | { kind: "default"; name: string; inde... |
formalParamDisplayNames | fn | 求值/签名用形参名(与 analyzer extractParamNames / dts 对齐) | formalParamDisplayNames(formals: FormalParam[]): string[] |
formalParamsFromNodes | fn | — | formalParamsFromNodes( params: AstParam[] | undefined | null, source?: string, ): FormalParam[] |
formalParamSignatureNames | fn | 签名展示名(C4.1 #64):解构形参渲染为 { grade, findings }, 不落回求值占位 _p0——否则读签名的人以为没有契约。 | formalParamSignatureNames(formals: FormalParam[]): string[] |
formatAbsMultiline | fn | 多行展示,CLI 用 | formatAbsMultiline(a: Abs, label?: string): string |
formatContractTierLine | fn | CodeLens / hover 首行标题(design-refine-derivation §8):● contract / hw|gen|imp。 | formatContractTierLine(source: ContractSource, active = true): string |
formatDiagnostics | fn | — | formatDiagnostics(diags: Diagnostic[]): string |
formatEffectiveContractDisplay | fn | EffectiveContract → 契约展示串(与 CLI contract 打印同口径,不含函数名) | formatEffectiveContractDisplay(eff: EffectiveContract): string |
formatGithubAnnotations | fn | GitHub Actions 行内注解(PR Files changed 红/黄标)。 | formatGithubAnnotations( r: CheckReport, opts: { workspaceRoot?: string } = {}, ): string |
formatGitlabCodeQuality | fn | GitLab Code Quality 报告数组(--gitlab;可写 gl-code-quality-report.json) | formatGitlabCodeQuality( r: CheckReport, opts: { workspaceRoot?: string } = {}, ): GitlabCodeQualityIssue[] |
FormatOptions | type | — | FormatOptions = { showTerm?: boolean; showPred?: boolean; indent?: string; } |
formatShapeSlot | fn | fn/arr 槽位:shape + 非 lit term(禁止在 format 里内联复制 term 逻辑) | formatShapeSlot(a: Abs): string |
ge | const | — | const ge |
generatedExportNames | fn | 侧车源码的生成段导出名:export 之前(跳过紧邻的 import 链与被 export 引用的 const 链)的注释行是 nudo 自己的 @generated 标记 → 该名为 generated。组合式下行段(§5.3)形态为 import + @generated 头 + prelude + export;callsite 段则是头紧贴 export。隔了其他代码行 / 无标记 / re-export 列表均不算。 | generatedExportNames(sidecarSrc: string): Set<string> |
geNum | fn | — | geNum(term: Term, n: number): Pred |
getAbsProperty | fn | 属性读取:template/string.length 等 | getAbsProperty(recv: Abs, name: string): Abs | undefined |
getEvalCallCollector | fn | — | getEvalCallCollector() |
getEvalClass | fn | — | getEvalClass(name: string): EvalClassSpec | undefined |
getFnImpl | fn | — | getFnImpl(a: Abs): AbsFnImpl | undefined |
getGeneralizeMemoSize | fn | — | getGeneralizeMemoSize(): number |
getImplicationOracle | fn | — | getImplicationOracle(): ImplicationOracle | undefined |
getPropFlags | fn | — | getPropFlags(o: Abs): Map<string, PropFlags> | undefined |
getSlot | fn | 自有槽位读取。slots 是普通对象,直接 slots[key] 会让 __proto__ / toString / valueOf 等键命中 Object.prototype 原型链,得到既非 slot 又 truthy 的原生值(历史 bug 模式,已两次复发)。所有跨来源 key 的槽位 读取必须走这里。 | getSlot<S extends { value: Abs }>( slots: Record<string, S>, key: string, ): S | undefined |
getTerm | fn | 字段访问项:u.id | getTerm(obj: Term, key: string): Term |
GitlabCodeQualityIssue | type | — | GitlabCodeQualityIssue = { description: string; check_name: string; fingerprint: string; severity: "major" | "minor" | "info" | "blocker"... |
gt | const | — | const gt |
gtNum | fn | 便捷:数字下界 | gtNum(term: Term, n: number): Pred |
HofSite | type | — | — |
hostBuiltinCtorName | fn | 宿主全局构造器身份(Number === (42).constructor 折叠用) | hostBuiltinCtorName(v: unknown): string | undefined |
hostFnCtorFacet | fn | 宿主 JS 函数的可构造性(Bug 9):generator/async/async-generator 声明、 箭头、内建方法不可 new;bind 产物取决于目标(未知)。 | hostFnCtorFacet(v: Function): boolean | undefined |
ImplicationOracle | type | 外部蕴含 oracle(可选 SMT 等)。内建判定证不出时调用。 | ImplicationOracle = (phi: Phi, pred: Pred) => boolean | undefined |
implies | fn | 简单蕴含:在区间/线性/字面量/typeof 可判定范围内判断 Φ ⊢ pred | implies(phi: Phi, pred: Pred): boolean |
instantiateReturn | fn | relation-only / isRelFn 的应用:按 paramTypes 做 α 替换得到 returnType。 | instantiateReturn(fn: Abs, args: Abs[]): Abs |
isAbsVal | fn | — | isAbsVal(v: unknown): v |
isBigPrim | fn | — | isBigPrim(a: Abs): boolean |
isCjsMainRun | fn | run 表是否来自 CJS module.exports = X 重赋值形态(供桥接层标 cjsMain)。 | isCjsMainRun(run: Record<string, unknown>): boolean |
isDefinitelyFalse | fn | — | isDefinitelyFalse(a: Abs): boolean |
isDefinitelyTrue | fn | — | isDefinitelyTrue(a: Abs): boolean |
isErrorCtorName | fn | — | isErrorCtorName(name: string | undefined): boolean |
isIntFlag | fn | builder 与纯数据形态统一的 int 标志读取:纯数据看 int === true, builder(int 是链式方法)查 WeakSet。toPlainConstraint 归一化后只剩前者。 | isIntFlag(c: NudoConstraint): boolean |
isMapAbs | fn | — | isMapAbs(a: Abs | undefined): boolean |
isNodeModulesPath | const | — | — |
isNudoBreak | fn | — | isNudoBreak(e: unknown, label?: string): e |
isNudoConstraint | fn | — | isNudoConstraint(x: unknown): x |
isNudoContinue | fn | — | isNudoContinue(e: unknown, label?: string): e |
isNudoReturn | fn | — | isNudoReturn(e: unknown): e |
isNudoThrow | const | — | — |
isNullishLitAbs | fn | 仅当 term 确为 lit null/undefined 时为 true;非 lit 的 litValue===undefined 不得当 nullish | isNullishLitAbs(a: Abs): boolean |
isNullProtoObj | fn | — | isNullProtoObj(o: Abs): boolean |
isNumPrim | fn | — | isNumPrim(a: Abs): boolean |
isObj | fn | — | isObj(a: Abs): a |
isObjectProtoBrand | fn | — | isObjectProtoBrand(a: Abs | undefined): boolean |
isRelFn | fn | 「有可用外延签名」判定:唯一权威定义。 | isRelFn(a: Abs | undefined | null): boolean |
isSetAbs | fn | — | isSetAbs(a: Abs | undefined): boolean |
isStrPrim | fn | — | isStrPrim(a: Abs): boolean |
isSymbolAbs | const | — | const isSymbolAbs |
joinFunctions | fn | 函数 join:签名并(重载),禁止 (A|C)→(B|D)。 | joinFunctions(a: Abs, b: Abs): Abs |
joinObjects | fn | 对象 join:默认积之和(sum),不自动折 optional。 | joinObjects(a: Abs, b: Abs): Abs |
joinThenProject | fn | 工件聚合投影(设计 §4.2:先 Abs join 折叠再投影)。 | joinThenProject(absList: Abs[]): NudoConstraint | undefined |
lazy | fn | lazy(() => constraint):自引用约束模板(issue #120)。 | lazy( thunk: () => NudoConstraint | ConstraintBuilder, ): ConstraintBuilder |
le | const | — | const le |
leavePromiseExecutorScope | fn | — | leavePromiseExecutorScope(settledArms: number[]): boolean |
lenTerm | fn | 长度项:length(u) | lenTerm(t: Term): Term |
leNum | fn | — | leNum(term: Term, n: number): Pred |
LeqResult | type | — | LeqResult = { ok: boolean; reason?: string; } |
listFunctionNames | fn | 列出源码中的顶层入口名。 | listFunctionNames(source: string): string[] |
literalMeetsConstraint | fn | 字面量 lv 是否落在约束 c 表达的域内(保守:判不了 → false)。 | literalMeetsConstraint( lv: LiteralValue, c: NudoConstraint, seen?: Set<object>, ): boolean |
litTruth | fn | JS 真值:字面量按 Boolean(v);对象形恒真;不可判 → undefined | litTruth(a: Abs): boolean | undefined |
localNamedExports | fn | 源文件本地导出名表(侧车自动绑定边界): - ESM:export function/const/let/var/class 与本地 export { x } / export { local as exported }(按导出名绑定); - export default function add / const add = …; export default add: 按本地名 add 绑定(侧车可 export const add = fn(…)); 同时登记 "default",供侧车 export default fn(…) 对齐; - CJS(C4.3):module.exports = { a, b }、module.exports.a = …、 exports.a = …、module.exports = localFn(登记 localFn 名)。 | localNamedExports(source: string, filename?: string): Set<string> |
locateContractParam | fn | 契约参数名 → 形参定位。 | locateContractParam( formals: FormalParam[], contractName: string, ) |
lookupObjAccessor | fn | 对象字面量访问器查询(供 $get/$set/$spread/Object.assign 共用) | lookupObjAccessor( o: Abs, key: string, ) |
looseEqAbs | fn | 宽松相等 ==(C2.3):双 lit 走 Abstract Equality;否则回落严格相等判定。 | looseEqAbs(a: Abs, b: Abs): boolean | undefined |
lt | const | — | const lt |
ltNum | fn | — | ltNum(term: Term, n: number): Pred |
makeArrayCtorAbs | fn | — | makeArrayCtorAbs(args: Abs[]): Abs |
makeMapAbs | fn | — | makeMapAbs(iterable?: Abs): Abs |
makeSetAbs | fn | — | makeSetAbs(iterable?: Abs): Abs |
makeSymbolAbs | fn | Symbol([description]):非具体 unique symbol(prim type=symbol,无 term)。 | makeSymbolAbs(descArg?: Abs): Abs |
mapClearEntries | fn | Map#clear:清空条目;fork 下仍走 overlay | mapClearEntries(mapAbs: Abs): Abs |
mapDeleteEntry | fn | Map#delete:fork overlay 内移除字面量键;未知 key 仅标 shadow 不确定。 | mapDeleteEntry(mapAbs: Abs, key: Abs | undefined): Abs |
mapElementFallback | fn | map 元素投影:body 在符号实参上跑出 unknown 时, 用 shape.returnType 槽,conf 由调用方按 path/partial 处理。 | mapElementFallback( cbAbs: Abs | undefined, elem: Abs, out: Abs, ): Abs |
mapEntriesAbs | fn | Map 迭代条目:JS for (const [k,v] of map) / Array.from(map) 产出 [key, value] 元组 Abs。字面量 key 精确;shadow 写入 key 为 unknown。 | mapEntriesAbs(mapAbs: Abs): Abs[] |
mapGetEntry | fn | Map#get:命中字面量/身份 key → 精确;miss / 未知 key / maybeAbsent / shadow 并 undefined | mapGetEntry(mapAbs: Abs, key: Abs | undefined): Abs |
mapHasEntry | fn | Map#has:字面量 miss 折 exact false 时,get 必须是 undefined(不可再并 value) | mapHasEntry(mapAbs: Abs, key: Abs | undefined): Abs |
mapSetEntry | fn | Map#set:fork 内写 overlay;否则原地。返回同一 Abs(JS 可变语义) | mapSetEntry(mapAbs: Abs, key: Abs | undefined, value: Abs): Abs |
mapSizeAbs | fn | — | mapSizeAbs(mapAbs: Abs): Abs |
mapValuesAbs | fn | Map#values:宿主按插入序产出(BUG-260);shadow 写入键未知 → 末尾 | mapValuesAbs(mapAbs: Abs): Abs[] |
markExtState | fn | — | markExtState(o: Abs, s: ExtState): Abs |
markNullProtoObj | fn | — | markNullProtoObj(o: Abs): Abs |
markPureFn | fn | 标记纯函数(@nudo:pure):调用结果可按实参记忆化 | markPureFn(target: object, name: string): void |
matchRelIdentLit | fn | 从 Identifier 在比较中的位置解析「对哪个变量、用哪个关系」。 | matchRelIdentLit( test: unknown, ) |
MAX_EVAL_CALL_DEPTH | const | B 命名调用深度上限——与 A 路径同值(@nudo:budget 可逐函数抬高) | const MAX_EVAL_CALL_DEPTH |
MAX_EVAL_TOTAL_CALLS | const | B 命名调用总调用上限——与 A 路径同值(递归×循环×分支展开的规模阀) | const MAX_EVAL_TOTAL_CALLS |
mergeCollectionArms | fn | 合并 fork 各臂 overlay → 全局表(由 endCollectionFork 实现)。 | mergeCollectionArms(arms: Array<ArmOverlay | undefined | null>): void |
migrateInvariants | fn | 写路径产生新副本时迁移不变性侧表(同 migrateAccessors 模式)。 | migrateInvariants(from: Abs, to: Abs): void |
migrateNullProto | fn | 同一对象的不可变更新($set/$del)迁移 nullProto 标记 | migrateNullProto(from: Abs, to: Abs): Abs |
mod | fn | 取模:字面量折叠;x % k(k 为有限非零字面量)仅当被除数有限时 结果界在 (−|k|, |k|)。整数模可收紧到 [0, k),此处先做保守实数界。 | mod(a: Abs, b: Abs, phi: Phi = pTrue): Abs |
mul | fn | 乘法:字面量直接求值;×正数同向缩放;×负数翻转不等式;×0 归零 | mul(a: Abs, b: Abs, phi: Phi = pTrue): Abs |
NamedImport | type | /// @nudo:import { delay, percent } from "./delay.nudo.js" | NamedImport = { names: string[]; spec: string } |
namespaceAbsOf | fn | 命名空间 Abs(import * as ns / export * as ns / CJS require 绑定): open + path——导出收集可能不全(CJS 收集失败等),缺失成员是分析 视图不完整,不得按「运行时缺失」判定(不可调用判定会假抛 TypeError)。 | namespaceAbsOf(mod: AbsModuleExports): Abs |
namespaceNameOf | fn | — | namespaceNameOf(v: unknown): string | undefined |
ne | const | — | const ne |
negAbs | fn | 一元负号:字面量折叠(含 ToNumber 强制);符号数翻转不等式 | negAbs(a: Abs, _phi: Phi = pTrue): Abs |
negatePred | fn | 逻辑否定(De Morgan):¬(A∧B)=¬A∨¬B;¬(A∨B)=¬A∧¬B;双重否定消去。 | negatePred(p: Pred): Pred |
not | fn | — | not(p: Pred): Pred |
notAbs | fn | 逻辑非 | notAbs(a: Abs): Abs |
noteCollectionWrite | fn | — | noteCollectionWrite(id: object): void |
noteEvalCallRecord | fn | 成员/方法调用点打点($invoke 等;无收集器时 no-op)。不进 $callNamed 预算。 | noteEvalCallRecord(r: EvalCallRecord): void |
noteEvalFallback | fn | 记录一次 B 回落(body-fn / tryRunTranspiled / call 边界兜底共用)。 | noteEvalFallback( e: unknown, origin: EvalFallbackOrigin = "module", opts?: { loadFailure?: boolean }, ): void |
notePromiseExecutorFork | fn | $fork 在 executor 内发生时打点(多臂 resolve 需 join,不得 first-wins 假精确) | notePromiseExecutorFork(): void |
NudoField | type | — | NudoField = { constraint: NudoConstraint; optional?: boolean; } |
NudoFnConstraint | type | fn(params, returns?, { throws? | NudoFnConstraint = { params: Record<string, NudoConstraint>; returns?: NudoConstraint; throws?: NudoConstraint; } |
NudoSidecarError | fn | 侧车模块错误:code ∈ nudo:contract-cycle | nudo:contract-load | NudoSidecarError extends Error { readonly code: string; constructor(code: string, message: string) { super(message); this.name = "NudoSid... |
NudoSig | type | 无损函数签名(类型即计算) | NudoSig = { name: string; params: string[]; paramTypes?: string[]; abs: Abs; display: string; detail: string; conf: Confidence; throws?: ... |
NudoUnsupportedError | fn | 转译器无法正确 lowering 的构造:抛此错误(替代静默降级注释)。 | NudoUnsupportedError extends Error { readonly reason: string; readonly loc?: { line: number; column: number }; constructor( reason: strin... |
nullable | fn | nullable(c):允许 null / undefined 的约束(nullish 显式化)。 | nullable( c: NudoConstraint | ConstraintBuilder | number | string | boolean, ): ConstraintBuilder |
numVar | fn | 带项的符号数,例如参数 x | numVar(id: string, pred?: Pred, conf: Confidence = "path"): Abs |
OBJECT_PROTO_METHOD_NAMES | const | — | const OBJECT_PROTO_METHOD_NAMES |
objectProtoBrand | fn | Object.prototype 单例($get(Object, "prototype") 与 host Object.prototype 共用)。 | objectProtoBrand(): Abs |
objectProtoMethodAbs | fn | Object.prototype.X 一等函数(bindThis:call/apply 把 receiver 注入首参) | objectProtoMethodAbs(name: string): Abs |
objOf | fn | — | objOf( slots: Record<string, Slot>, opts?: { index?: { key: Abs; value: Abs }; open?: boolean }, ): Abs |
omit | fn | omit(c, keys):shape 去字段;非 shape throw(lazy 包装先解一层)。 | omit( c: NudoConstraint | ConstraintBuilder, keys: string[], ): ConstraintBuilder |
or | fn | — | or(...preds: Pred[]): Pred |
partial | fn | partial(c):shape 全字段变可选;非 shape throw(lazy 包装先解一层)。 | partial(c: NudoConstraint | ConstraintBuilder): ConstraintBuilder |
pFalse | const | — | const pFalse |
phiAnd | const | — | const phiAnd |
pick | fn | pick(c, keys):shape 子形状(不存在的 key 忽略);非 shape throw(lazy 包装先解一层)。 | pick( c: NudoConstraint | ConstraintBuilder, keys: string[], ): ConstraintBuilder |
PolyFn | type | — | PolyFn = { name: string; params: string[]; typeParams: TypeParam[]; instantiate: (args: Abs[], phi?: Phi) => Abs; symbolic: Abs; display:... |
popCollectionArm | fn | — | popCollectionArm(): ArmOverlay | undefined |
powAbs | fn | —— 幂(右结合由 AST 保证);负指数 bigint 原生 RangeError → 不可折叠 | powAbs(a: Abs, b: Abs): Abs |
predEquals | fn | — | predEquals(a: Pred, b: Pred): boolean |
predToString | fn | — | predToString(p: Pred): string |
predVars | fn | 收集 pred 中出现的自由变量 | predVars(p: Pred): Set<string> |
PrimName | type | — | PrimName = "number" | "string" | "boolean" | "bigint" | "symbol" |
primToTypeof | fn | abs prim 标签 → typeof 标签(恒等嵌入)。abs prim 仍是 PrimName 子集。 | primToTypeof(p: PrimName): TypeofName |
projectFlatMapResult | fn | flatMap 统一结果:展开后的元素 join 成 arr(γ)。 | projectFlatMapResult( arrConf: Confidence, mapped: Abs[], ): Abs |
propertyKeyOf | fn | ES ToPropertyKey 的折叠:null→"null"、undefined→"undefined"、 true/false→"true"/"false"、number/bigint/string → String(v)(ToString)。 | propertyKeyOf(a: Abs | undefined): string | undefined |
PropFlags | type | — | PropFlags = { writable?: boolean; enumerable?: boolean; configurable?: boolean; } |
protoBrandAbs | fn | — | protoBrandAbs(ctorName: string): Abs |
protoOfRecv | fn | Object.getPrototypeOf 的具体原型投影(constructor 链可解)。 | protoOfRecv(a: Abs): Abs |
pTrue | const | — | const pTrue |
ptypeof | const | — | const ptypeof |
pureFnNameOf | fn | 读纯函数标记(Abs impl 或对象属性 _memoize) | pureFnNameOf(fn: unknown): string | undefined |
pushCollectionArm | fn | — | pushCollectionArm(): void |
pushLoopExit | fn | — | pushLoopExit(v: Abs): void |
pushThrowExit | fn | — | pushThrowExit(v: Abs): void |
queuePromiseMicro | fn | — | queuePromiseMicro(task: () => void): void |
RefineDiag | type | refine 侧车加载诊断(severity 由消费方按 code 定档,形状对齐 Issue 子集) | RefineDiag = { code: string; message: string; file?: string; line?: number; column?: number; } |
refineDiagCount | fn | 当前诊断累计序号(since 锚) | refineDiagCount(): number |
RefineEntry | type | 同时保留原始 NudoConstraint(shape 字段检查用)。 | RefineEntry = { param: string; pred: Pred; constraint: NudoConstraint; name?: string; } |
RefineResolveOpts | type | — | RefineResolveOpts = { loadModule?: (spec: string, fromFile: string) => string | undefined; fromFile?: string; } |
refineToIndexedFull | fn | refine 参数 → 带约束模板的下标表(shape 检查用) | refineToIndexedFull( source: string, fnName: string, paramNames: string[], opts: RefineResolveOpts = {}, ): Array<[number, RefineEntry]> |
regexBrandAbsFrom | fn | RegExp brand:source/flags/lastIndex + 7 标志 getter 进 slots (evaluator evalRegExpCtor / $regex 共用;槽构造收敛于 regexpBrandSlots) | regexBrandAbsFrom(pattern: string, flags: string): Abs |
registerEvalClass | fn | 注册类规格(裸名主键 + epoch 碰撞记录——BUG-026/172 注释群)。 | registerEvalClass(spec: EvalClassSpec): void |
relationFingerprint | fn | relationFn 稳定 fingerprint(同签名共享,见 §3.3 已知限制)。 | relationFingerprint( paramTypes: Abs[], returnType: Abs, ): string |
relationFn | fn | 无 body、纯关系的 fn Abs。params 仅记 arity。 | relationFn( paramTypes: Abs[], returnType: Abs, opts?: { params?: string[]; conf?: Confidence; fingerprint?: string; inferFrom?: { fromVar: string; via: "arr" | "promise"; inferVar: string }; condFallback?: Abs; throws?: Abs; }, ): Abs |
RelSource | type | — | — |
requiredFnArity | fn | Required arity from fn param labels — skips rest (...) and optional (?). | requiredFnArity(params: readonly string[] | undefined): number |
resetCheckSourceMemo | fn | — | resetCheckSourceMemo(): void |
resetEvalCallBudget | fn | 宿主入口前强制清零(测试 / 显式 API)。执行入口请用 enterEvalCallBudgetSession。 | resetEvalCallBudget(): void |
resetGeneralizeMemo | fn | — | resetGeneralizeMemo(): void |
resetNudoModuleExecCache | fn | — | resetNudoModuleExecCache(): void |
resetSidecarLoadFailureCache | fn | 与 resetNudoModuleExecCache 同口径:分析会话/测试间清空失败去重表 | resetSidecarLoadFailureCache(): void |
RUNTIME_IMPORT_RE | const | — | — |
RunTranspiledOptions | type | — | RunTranspiledOptions = { modules?: Record<string, AbsModuleExports | Record<string, unknown>>; maxLoopIters?: number; mode?: "exec" | "an... |
runTranspiledOptionsMemoKey | fn | inject/modules 内容指纹(memo 键)。对象身份对「每次新建同内容」 的 CLI 注入不稳——同一语义的 inject 跨 checkSource 调用会 miss 缓存。 | runTranspiledOptionsMemoKey( opts: RunTranspiledOptions | undefined, ): string |
runWithLoopExits | fn | 函数求值作用域:收集抽象分支上的 early-return / throw 值;try 标记栈同边界 | runWithLoopExits<T>(body: () => T): T |
scanCaseArgSpans | fn | case 实参区间(供其它标签做遮罩) | scanCaseArgSpans(text: string) |
SELF | const | 模板占位项;instantiate 时换成真实参数名 | const SELF |
setAddEntry | fn | Set#add:fork 内写 overlay;返回同一 Abs | setAddEntry(setAbs: Abs, value: Abs): Abs |
setApplyCallbackHost | fn | evaluator 宿主 exec/call.ts 加载时注册(副作用)。 | setApplyCallbackHost(fn: ApplyCallbackHost): void |
setClearEntries | fn | Set#clear | setClearEntries(setAbs: Abs): Abs |
setContractDiagCollector | fn | 设置诊断观察者(null 清除);缓冲照常累积,takeContractDiags 取走 | setContractDiagCollector( fn: ((d: ContractDiag) => void) | null, ): void |
setDeleteEntry | fn | Set#delete:按字面量/身份元素移除;fork overlay 内生效。 | setDeleteEntry(setAbs: Abs, value: Abs): Abs |
setElementsAbs | fn | — | setElementsAbs(setAbs: Abs): Abs[] |
setEvalAssignCollector | fn | 返回先前 collector,便于嵌套调用 save/restore(禁止 finally 置 null 砸外层) | setEvalAssignCollector( collector: ((r: EvalAbsAssignRecord) => void) | null, ) |
setEvalBindingSink | fn | — | setEvalBindingSink(sink: Map<string, unknown> | null): void |
setEvalFallbackCollector | fn | — | setEvalFallbackCollector( collector: ((f: EvalFallback) => void) | null, ): void |
setHasEntry | fn | — | setHasEntry(setAbs: Abs, value: Abs): Abs |
setImplicationOracle | fn | — | setImplicationOracle(fn: ImplicationOracle | undefined): void |
setPosCollector | fn | 返回先前 collector,便于嵌套调用 save/restore(禁止 finally 置 null 砸外层) | setPosCollector( collector: ((r: EvalPosRecord) => void) | null, ) |
setPropFlags | fn | — | setPropFlags(o: Abs, key: string, f: PropFlags): void |
setRefineDiagCollector | fn | 设置诊断观察者(null 清除);缓冲照常累积,takeRefineDiags 取走 | setRefineDiagCollector(fn: ((d: RefineDiag) => void) | null): void |
setSizeAbs | fn | — | setSizeAbs(setAbs: Abs): Abs |
shapeOfTerm | fn | 从 term 反推 prim shape | shapeOfTerm(t: Term): Shape |
shapeOnlyFn | fn | 仅写 shape 槽(E 路径 / §5.2 提升产物);禁止 attachFnImpl | shapeOnlyFn( paramTypes: Abs[], returnType: Abs, opts?: { params?: string[]; conf?: Confidence }, ): Abs |
shapeToString | fn | — | shapeToString(s: Shape): string |
shlAbs | fn | << —— 左移(rhs ToUint32 & 31;bigint 不限位宽) | shlAbs(a: Abs, b: Abs): Abs |
shrAbs | fn | >> —— 算术右移(rhs ToUint32 & 31;bigint 不限位宽) | shrAbs(a: Abs, b: Abs): Abs |
sidecarClosureFingerprint | fn | 侧车及递归 .nudo 依赖闭包的内容指纹:${hashSource(侧车)}|路径=hash,…。 | sidecarClosureFingerprint( fromFile: string, opts: EffectiveContractOpts, ): string | undefined |
sidecarPathOf | const | — | — |
simplifyTerm | fn | 常量折叠 + 简单代数化简 | simplifyTerm(t: Term): Term |
snapshotAbs | fn | deep-ish copy for snapshot(新对象,不是 env.vars 同一引用) | snapshotAbs(a: Abs): Abs |
spread | fn | spread:base ⊕ over(右侧覆盖,不是 join) 未出现在 over 的 key 保留 base;over 的 key 覆盖。 | spread(base: Abs, over: Abs): Abs |
strictEqAbs | fn | 严格相等(Abs):双字面量折叠;nullish 与 definitely-not-nullish → false。 | strictEqAbs(a: Abs, b: Abs): boolean | undefined |
stringOfSymbol | fn | String(sym) → SymbolDescriptiveString(原生不抛;隐式 ToString 才抛) | stringOfSymbol(a: Abs): Abs |
sub | fn | 减法:a - b = a + (-b),数值上做单调性 | sub(a: Abs, b: Abs, phi: Phi = pTrue, assume?: Phi): Abs |
substAbs | fn | α 替换:map 的 key 是 term var id,value 是替换 Abs。 | substAbs(a: Abs, map: ReadonlyMap<string, Abs>): Abs |
substPred | fn | 把 pred 里的 Term 用 subst 替换(用于 bound 变量重命名等) | substPred(p: Pred, subst: (t: Term) => Term): Pred |
substPredAbs | fn | pred 三条规则: 1. | substPredAbs( p: Pred, map: ReadonlyMap<string, Abs>, ) |
symbolDescriptionAbs | const | — | — |
symbolIdOf | const | — | — |
takeContractDiags | fn | 取走已收集的诊断(收集即清空) | takeContractDiags(): ContractDiag[] |
takeContractDiagsSince | fn | 只取走 seq > since 的诊断(清空仅限增量)——LSP 长驻进程里 lens/打印/ emit 工具用它排干自身探测产生的诊断,不窃取在途 validateText 待消费 的契约诊断(全量 take 曾在 await 窗口偷走 checkSource 的待收诊断)。 | takeContractDiagsSince(since: number): ContractDiag[] |
takeLoopExits | fn | — | takeLoopExits(): Abs[] |
takeRefineDiags | fn | 取走已收集的诊断(收集即清空) | takeRefineDiags(): RefineDiag[] |
takeRefineDiagsSince | fn | 只取走 seq > since 的增量(工具面防窃取在途诊断;全量 take 的 since 版) | takeRefineDiagsSince(since: number): RefineDiag[] |
takeThrowExits | fn | — | takeThrowExits(): Abs[] |
termEquals | fn | — | termEquals(a: Term, b: Term): boolean |
termToString | fn | — | termToString(t: Term): string |
throwConstraintToKinds | fn | fn(..., { throws }) / throws 约束 → 申报的 throws 类型名。 | throwConstraintToKinds( c: NudoConstraint | undefined, ): string[] |
toNumberAbs | fn | 一元 + —— ToNumber 折叠;bigint(含抽象 prim)原生恒抛 TypeError → 硬抛 | toNumberAbs(a: Abs): Abs |
trueConstraint | fn | 从比较结果 Abs 提取「若为真」的额外约束(供 if 使用) | trueConstraint(c: Abs): Pred | undefined |
tryMakeRegexAbs | fn | new RegExp(pattern, flags) 字面量真构造验证($new 与 evalRegExpCtor 共用): - 无参 → /(?:)/(原生 source 归一) - symbol pattern/flags → 确定 TypeError(ToString 抛;shape 判定——Symbol() 无 lit 项,原先的 lit 分支内检查是死代码,Bug 29/52) - 非法 pattern / 非法 flags(含 number/null/boolean flags 的 ToString) → SyntaxError;合法 → 精确 brand(source/flags 取真构造结果) - 抽象 pattern/flags → undefined(调用方保守)+ 档位打点(见各分支): obj/fn/brand/sum/any → may TypeError(自定义 coercer 可能产 Symbol); 抽象 prim string pattern → ToString total(非法 pattern 的 SyntaxError 面不计);抽象 prim string flags → may SyntaxError;抽象 prim number/bool/bigint flags → ToString 恒非法 flags → 确定 SyntaxError (node 实测 new RegExp('a', 1n) → SyntaxError) | tryMakeRegexAbs(args: Abs[]): Abs | undefined |
tryRunTranspiled | fn | — | tryRunTranspiled( source: string, opts: RunTranspiledOptions = {}, ): Record<string, unknown> | undefined |
TYPEOF_NAMES | const | typeof 标签全集(否定展开用;顺序稳定) | const TYPEOF_NAMES |
typeofAbs | fn | JS typeof:结果域永远是 string | typeofAbs(a: Abs): Abs |
TypeofName | type | JS typeof 完整结果域(8 标签)。Pred 的 typeof 节点用此域。 | TypeofName = | "undefined" | "object" | "boolean" | "number" | "bigint" | "string" | "symbol" | "function" |
TypeParam | type | — | TypeParam = { id: string; value: Abs; bounds?: readonly import("./pred.ts").Pred[]; } |
undefAbs | fn | undefined 值的统一 Abs 表示(forEach/find 等) | undefAbs(): Abs |
ushrAbs | fn | >>> —— 逻辑右移(rhs ToUint32 & 31;bigint 无此运算符 → 不可折叠) | ushrAbs(a: Abs, b: Abs): Abs |
withExecPhi | fn | — | withExecPhi<T>(p: Phi, body: () => T): T |
withVar | fn | — | withVar(env: AstEnv, name: string, value: Abs): AstEnv |