lemmascript 0.6.14 → 0.6.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/package.json +1 -1
- package/tools/dist/alias-check-pass.js +2 -1
- package/tools/dist/builtins.js +19 -19
- package/tools/dist/checked-reads.js +74 -9
- package/tools/dist/condition-facts.js +49 -5
- package/tools/dist/config.js +42 -6
- package/tools/dist/dafny-commands.js +22 -6
- package/tools/dist/dafny-emit.js +1 -1
- package/tools/dist/dafny-proof-additions.js +1 -1
- package/tools/dist/lean-emit.js +64 -13
- package/tools/dist/lsc.js +10 -5
- package/tools/dist/narrow.js +24 -31
- package/tools/dist/place-lowering.js +22 -63
- package/tools/dist/resolve.js +470 -116
- package/tools/dist/run-log.js +15 -1
- package/tools/dist/transform.js +529 -443
- package/tools/dist/typedecls.js +7 -0
package/tools/dist/typedecls.js
CHANGED
|
@@ -51,6 +51,13 @@ export function unionDeclOfTy(decls, ty) {
|
|
|
51
51
|
export function discriminantOf(decls, ty) {
|
|
52
52
|
return unionDeclOfTy(decls, ty)?.discriminant;
|
|
53
53
|
}
|
|
54
|
+
/** The only union variant not covered by the given labels, if exactly one remains. */
|
|
55
|
+
export function remainingVariant(decl, matched) {
|
|
56
|
+
if (decl?.kind !== "discriminated-union" || !decl.variants)
|
|
57
|
+
return undefined;
|
|
58
|
+
const remaining = decl.variants.filter(v => !matched.includes(v.name));
|
|
59
|
+
return remaining.length === 1 ? remaining[0] : undefined;
|
|
60
|
+
}
|
|
54
61
|
/** Reverse lookup: the union declaration owning a variant (discriminated
|
|
55
62
|
* union) or literal value (string union) of this name. */
|
|
56
63
|
export function declWithVariant(decls, ctorOrValue) {
|