@bramas/simulant-engine 0.1.1 → 0.2.0

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.
Files changed (2) hide show
  1. package/README.md +49 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # @bramas/simulant-engine
2
+
3
+ Interpreter and state-graph explorer for compiled Simulant experiments. The
4
+ engine generates initial configurations and successors, evaluates task
5
+ verdicts, explores executions, and produces replayable counterexamples.
6
+
7
+ For most projects, create a simulator project and use `npx simulant check-all`:
8
+
9
+ ```sh
10
+ npm create @bramas/simulant@latest my-project
11
+ ```
12
+
13
+ ## Programmatic checks
14
+
15
+ ```sh
16
+ npm install @bramas/simulant-engine @bramas/simulant-lang
17
+ ```
18
+
19
+ ```ts
20
+ import { loadProgram } from '@bramas/simulant-lang/elab/node';
21
+ import { compile } from '@bramas/simulant-lang/elab/elaborate';
22
+ import { checkSetting } from '@bramas/simulant-engine/check';
23
+
24
+ const compiled = compile(loadProgram('src/main.sim'));
25
+ const experiment = compiled.experiments.cautiousPair?.experiment;
26
+ if (!experiment) throw new Error('Check the compiler diagnostics');
27
+
28
+ const result = await checkSetting(experiment, { N: 6, site: 2 });
29
+ console.log(result.status, result.reason);
30
+ ```
31
+
32
+ `System` from `@bramas/simulant-engine/system` provides `initial()`,
33
+ `successors(config)`, `verdict(config)` and step explanations. `parameterValues`
34
+ enumerates declared settings; `parameterDomainViolations` checks domain
35
+ membership for a concrete setting without enumerating their Cartesian product.
36
+ `checkSettings` can share state graphs among settings of the same ring size.
37
+
38
+ Checks return `success`, `failure`, or `incomplete` when an exploration limit
39
+ prevents a conclusion. Successful bounded checks do not prove correctness for
40
+ all sizes. SSYNC and sequential exploration account for activation fairness;
41
+ FSYNC considers every permitted execution.
42
+
43
+ This package uses subpath exports; it has no root import.
44
+
45
+ [Semantics](https://github.com/Bramas/simulant/blob/main/docs/ir.md)
46
+ · [Architecture](https://github.com/Bramas/simulant/blob/main/docs/architecture.md)
47
+ · [Source](https://github.com/Bramas/simulant/tree/main/packages/engine)
48
+
49
+ Licensed under CeCILL-B; see `LICENCE.txt`.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@bramas/simulant-engine",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "private": false,
5
5
  "license": "CECILL-B",
6
6
  "type": "module",
7
7
  "dependencies": {
8
- "@bramas/simulant-lang": "0.1.1"
8
+ "@bramas/simulant-lang": "0.2.0"
9
9
  },
10
10
  "exports": {
11
11
  "./*": {