gdp-wired 0.33.0 → 0.33.1
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/dist/kernel/kernel.js +9 -5
- package/package.json +1 -1
package/dist/kernel/kernel.js
CHANGED
|
@@ -790,9 +790,10 @@ function inScope(what, ts, vars, maps = [], flags = []) {
|
|
|
790
790
|
}
|
|
791
791
|
}
|
|
792
792
|
// A name the kernel's linear forms would read as something else: '1' is the constant, and '*', '[', ']', ',' and ':'
|
|
793
|
-
// build monomials and cells
|
|
794
|
-
|
|
795
|
-
|
|
793
|
+
// build monomials and cells; '#' marks the fresh name a law is proven at (k#, its key's), which a name of the machine or
|
|
794
|
+
// another key of the law would capture. Such a name could never be proven about; refused instead, with its name.
|
|
795
|
+
const plainName = (what, name) => { if (name === '1' || /[*[\],:#]/.test(name))
|
|
796
|
+
throw new Error(`${what}: the name ${name} is reserved (1, or * [ ] , : #)`); };
|
|
796
797
|
const distinct = (what, names) => { const seen = new Set(); for (const name of names) {
|
|
797
798
|
if (seen.has(name))
|
|
798
799
|
throw new Error(`${what} declares ${name} twice`);
|
|
@@ -869,8 +870,11 @@ export function scope(m, laws = []) {
|
|
|
869
870
|
for (const law of [...laws, ...facts]) {
|
|
870
871
|
const what = facts.includes(law) ? `fact ${law.name}` : `law ${law.name}`;
|
|
871
872
|
for (const key of [law.forall, ...(law.keys ?? [])])
|
|
872
|
-
if (key
|
|
873
|
-
|
|
873
|
+
if (key) {
|
|
874
|
+
plainName(what, key);
|
|
875
|
+
if ([...names, ...maps, ...carried, ...fns].includes(key))
|
|
876
|
+
throw new Error(`${what}'s key ${key} is already a name of ${m.name}`);
|
|
877
|
+
}
|
|
874
878
|
if (law.keys?.length && (!law.forall || new Set([law.forall, ...law.keys]).size !== law.keys.length + 1))
|
|
875
879
|
throw new Error(`${what}: further keys come with a first, each a different name`);
|
|
876
880
|
if (law.name.startsWith('?'))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gdp-wired",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.1",
|
|
4
4
|
"description": "An automatic prover for stateful rules (budgets, caps, windows, workflows, policies): laws proven with no proof to write, checked again in Lean, counterexamples found on the GPU, the rule shipped as code",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"verification",
|