gdp-wired 0.53.1 → 0.53.2

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.
@@ -617,7 +617,7 @@ export declare class Rule<P extends Obj = {}, I extends Obj = {}, S extends Obj
617
617
  lists: [string, Kind<unknown>, Record<string, ListFold<unknown>>, Record<string, ListLemma>][];
618
618
  };
619
619
  withParts(fns: Record<string, FnDef>, listLemmas?: Record<string, Record<string, ListLemma>>): this;
620
- withMapSums(): this | undefined;
620
+ withMapSums(checkCovers?: boolean): this | undefined;
621
621
  params<K extends Kinds>(kinds: K): Rule<P & ValuesOf<K>, I, S, M, F, R, Su, Q>;
622
622
  inputs<K extends Kinds>(kinds: K): Rule<P, I & ValuesOf<K>, S, M, F, R, Su, Q>;
623
623
  state<T extends Record<string, number | ((p: P) => TermLike) | Init<unknown>>>(init: T): Rule<P, I, S & {
package/dist/core/dsl.js CHANGED
@@ -1935,11 +1935,11 @@ export class Rule {
1935
1935
  // The same rule with the sum of every map its step writes (each a map of the state starting at 0 everywhere, whose sum
1936
1936
  // the kernel keeps exact: kernel.ts's sumMachine), beside the sums it reads: what the search proposes laws over where
1937
1937
  // a law is about the cells of a map against a total (a balance at most the supply). Undefined where there is none.
1938
- withMapSums() {
1938
+ withMapSums(checkCovers = true) {
1939
1939
  const m = this.machine;
1940
1940
  if (m.history)
1941
1941
  return undefined;
1942
- const have = new Set(Object.keys(m.sums ?? {})), more = new Set(this.spec.sumsRead ?? []), arity = mapArities(m), kinds = this.kindLaws();
1942
+ const have = new Set(Object.keys(m.sums ?? {})), more = new Set(this.spec.sumsRead ?? []), arity = mapArities(m), kinds = checkCovers ? this.kindLaws() : [];
1943
1943
  for (const [map, init] of Object.entries(m.maps ?? {})) {
1944
1944
  // (a map keyed by tuples has no sum read at one key: a sum's term reads its maps at the key alone)
1945
1945
  if (init !== 0 || !m.step.maps?.[map] || (m.inputMaps ?? []).includes(map) || (arity[map] ?? 1) > 1)
@@ -1950,7 +1950,7 @@ export class Rule {
1950
1950
  try {
1951
1951
  const cand = { ...m, sums: { ...m.sums, ...sumsIn([], [name]) } };
1952
1952
  const { goals } = sumMachine(cand, undefined, kinds);
1953
- if (goals.length && refusedSumCover(cand, kinds))
1953
+ if (checkCovers && goals.length && refusedSumCover(cand, kinds))
1954
1954
  continue;
1955
1955
  more.add(name);
1956
1956
  }
@@ -4088,7 +4088,7 @@ function inferLawsSearchIn(target, laws, stepLaws, opts, observed) {
4088
4088
  opts.progress?.('join engine', { wall: Math.round(vnow()), eUntil: Math.round(eUntil) });
4089
4089
  opts.progress?.('join meters', { at: 'engine', ...meters() });
4090
4090
  // (a sums pass's reserve where one follows: 10 s, or a quarter of what is left where less is)
4091
- const v0 = views.length, reserve = rule?.withMapSums() ? Math.min(10_000, (eUntil - vnow()) / 4) : 0;
4091
+ const v0 = views.length, reserve = rule?.withMapSums(false) ? Math.min(10_000, (eUntil - vnow()) / 4) : 0;
4092
4092
  const implied = (f) => {
4093
4093
  const v = views[f.view], sk = { vars: Object.fromEntries([...v.vars.filter((_, i) => !v.defs?.[i]), ...freeOf(f, v)].map(k => [k, x(`${k}#`)])), maps: {}, flags: {} }, hyps = [substC(substC(v.frame, defsOf(v)), sk), not(substC(substC(condOf(f), defsOf(v)), sk))];
4094
4094
  for (const l of given) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdp-wired",
3
- "version": "0.53.1",
3
+ "version": "0.53.2",
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",