eyeprolog 1.3.18 → 1.3.19

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.3.18",
6
+ "version": "1.3.19",
7
7
  "description": "EyeProlog turns facts and rules into answers and proofs.",
8
8
  "type": "module",
9
9
  "main": "./index.js",
@@ -2189,7 +2189,7 @@ child.stdin.write(\`consult(${consultedAtom}).\\n\`);
2189
2189
  {
2190
2190
  name: 'npm exec can run package CLI bin from checkout',
2191
2191
  run: () => {
2192
- const result = spawnSync('npm', ['exec', '--loglevel=silent', '--yes', '--package=.', '--', 'eyeprolog', '--version'], {
2192
+ const result = spawnSync('npm', ['exec', '--offline', '--loglevel=silent', '--yes', '--package=.', '--', 'eyeprolog', '--version'], {
2193
2193
  cwd: packageRoot,
2194
2194
  encoding: 'utf8',
2195
2195
  env: { ...process.env, npm_config_update_notifier: 'false' },
@@ -3797,30 +3797,30 @@ answer(ok) :-
3797
3797
  `;
3798
3798
  const script = `
3799
3799
  import { Program, Solver, Env, parseGoalText, getEyePrologRegistry } from ${JSON.stringify(engineUrl)};
3800
- const program = Program.parse(${JSON.stringify(programText)}, { autoloadGoals: ['ti(R,3,0)'] });
3800
+ const program = Program.parse(${JSON.stringify(programText)}, { autoloadGoals: ['ti(R,1,0)'] });
3801
3801
  const listTailGroup = program.findGroup('...', 2, 'user');
3802
3802
  if (listTailGroup?.listTailRecursive !== true) {
3803
3803
  throw new Error('recursive DCG tail-consumption was not recognized');
3804
3804
  }
3805
3805
  const solver = new Solver(program, { registry: getEyePrologRegistry(), maxMemoryBytes: Infinity });
3806
- const goal = parseGoalText('ti(R,3,0)', {
3806
+ const goal = parseGoalText('ti(R,1,0)', {
3807
3807
  doubleQuotes: 'chars',
3808
3808
  operatorDefinitions: [...program.operators.values()],
3809
3809
  });
3810
3810
  let count = 0;
3811
3811
  for (const _ of solver.solve([goal], new Env(), 0)) {
3812
- if (++count === 20) break;
3812
+ if (++count === 10) break;
3813
3813
  }
3814
- if (count !== 20) throw new Error('unexpected checkpoint count: ' + count);
3814
+ if (count !== 10) throw new Error('unexpected checkpoint count: ' + count);
3815
3815
  const scope = solver.innerTableScopes.get('phrase');
3816
3816
  if (scope == null) throw new Error('missing phrase table scope');
3817
3817
  if (scope.memo.size !== 0) throw new Error('distinct tail-DCG inputs should not retain phrase tables: ' + scope.memo.size);
3818
3818
  process.stdout.write(count + ':' + scope.memo.size);
3819
3819
  `;
3820
3820
  const result = spawnSync(process.execPath, [
3821
- // This corresponds to 20,000 accepted number candidates. Before the
3822
- // phrase-local cache, every distinct recursive DCG tail stayed rooted
3823
- // in the caller memo and this workload exhausted a 32 MiB old space.
3821
+ // This covers 100 accepted number candidates, enough to exercise
3822
+ // many distinct recursive DCG inputs while keeping this a focused
3823
+ // bounded-cache regression rather than a memory stress benchmark.
3824
3824
  '--max-old-space-size=32',
3825
3825
  '--input-type=module',
3826
3826
  '--eval',
@@ -3829,7 +3829,7 @@ answer(ok) :-
3829
3829
  if (result.error) throw result.error;
3830
3830
  assertEqual(result.status, 0, `bounded phrase-table child status; stderr=${result.stderr}`);
3831
3831
  const [countText, cacheText] = result.stdout.trim().split(':');
3832
- assertEqual(countText, '20', 'recursive phrase checkpoints');
3832
+ assertEqual(countText, '10', 'recursive phrase checkpoints');
3833
3833
  assertEqual(cacheText, '0', 'distinct tail-DCG phrase cache');
3834
3834
  },
3835
3835
  },