@polintpro/proposit-core 0.1.1 → 0.1.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.
- package/README.md +182 -8
- package/dist/cli/commands/analysis.d.ts +3 -0
- package/dist/cli/commands/analysis.d.ts.map +1 -0
- package/dist/cli/commands/analysis.js +324 -0
- package/dist/cli/commands/analysis.js.map +1 -0
- package/dist/cli/commands/arguments.d.ts +3 -0
- package/dist/cli/commands/arguments.d.ts.map +1 -0
- package/dist/cli/commands/arguments.js +118 -0
- package/dist/cli/commands/arguments.js.map +1 -0
- package/dist/cli/commands/expressions.d.ts +3 -0
- package/dist/cli/commands/expressions.d.ts.map +1 -0
- package/dist/cli/commands/expressions.js +240 -0
- package/dist/cli/commands/expressions.js.map +1 -0
- package/dist/cli/commands/meta.d.ts +3 -0
- package/dist/cli/commands/meta.d.ts.map +1 -0
- package/dist/cli/commands/meta.js +14 -0
- package/dist/cli/commands/meta.js.map +1 -0
- package/dist/cli/commands/premises.d.ts +3 -0
- package/dist/cli/commands/premises.d.ts.map +1 -0
- package/dist/cli/commands/premises.js +214 -0
- package/dist/cli/commands/premises.js.map +1 -0
- package/dist/cli/commands/render.d.ts +3 -0
- package/dist/cli/commands/render.d.ts.map +1 -0
- package/dist/cli/commands/render.js +25 -0
- package/dist/cli/commands/render.js.map +1 -0
- package/dist/cli/commands/roles.d.ts +3 -0
- package/dist/cli/commands/roles.d.ts.map +1 -0
- package/dist/cli/commands/roles.js +94 -0
- package/dist/cli/commands/roles.js.map +1 -0
- package/dist/cli/commands/variables.d.ts +3 -0
- package/dist/cli/commands/variables.d.ts.map +1 -0
- package/dist/cli/commands/variables.js +173 -0
- package/dist/cli/commands/variables.js.map +1 -0
- package/dist/cli/commands/versionShow.d.ts +3 -0
- package/dist/cli/commands/versionShow.d.ts.map +1 -0
- package/dist/cli/commands/versionShow.js +31 -0
- package/dist/cli/commands/versionShow.js.map +1 -0
- package/dist/cli/config.d.ts +7 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +21 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/engine.d.ts +13 -0
- package/dist/cli/engine.d.ts.map +1 -0
- package/dist/cli/engine.js +71 -0
- package/dist/cli/engine.js.map +1 -0
- package/dist/cli/output.d.ts +5 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +34 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/cli/router.d.ts +14 -0
- package/dist/cli/router.d.ts.map +1 -0
- package/dist/cli/router.js +56 -0
- package/dist/cli/router.js.map +1 -0
- package/dist/cli/storage/analysis.d.ts +8 -0
- package/dist/cli/storage/analysis.d.ts.map +1 -0
- package/dist/cli/storage/analysis.js +70 -0
- package/dist/cli/storage/analysis.js.map +1 -0
- package/dist/cli/storage/arguments.d.ts +12 -0
- package/dist/cli/storage/arguments.d.ts.map +1 -0
- package/dist/cli/storage/arguments.js +80 -0
- package/dist/cli/storage/arguments.js.map +1 -0
- package/dist/cli/storage/premises.d.ts +9 -0
- package/dist/cli/storage/premises.d.ts.map +1 -0
- package/dist/cli/storage/premises.js +67 -0
- package/dist/cli/storage/premises.js.map +1 -0
- package/dist/cli/storage/roles.d.ts +4 -0
- package/dist/cli/storage/roles.d.ts.map +1 -0
- package/dist/cli/storage/roles.js +26 -0
- package/dist/cli/storage/roles.js.map +1 -0
- package/dist/cli/storage/variables.d.ts +4 -0
- package/dist/cli/storage/variables.d.ts.map +1 -0
- package/dist/cli/storage/variables.js +28 -0
- package/dist/cli/storage/variables.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +51 -0
- package/dist/cli.js.map +1 -0
- package/dist/lib/core/ArgumentEngine.d.ts +4 -3
- package/dist/lib/core/ArgumentEngine.d.ts.map +1 -1
- package/dist/lib/core/ArgumentEngine.js +11 -3
- package/dist/lib/core/ArgumentEngine.js.map +1 -1
- package/dist/lib/core/ExpressionManager.d.ts +1 -1
- package/dist/lib/core/ExpressionManager.d.ts.map +1 -1
- package/dist/lib/core/ExpressionManager.js +1 -1
- package/dist/lib/core/ExpressionManager.js.map +1 -1
- package/dist/lib/core/PremiseManager.d.ts +3 -2
- package/dist/lib/core/PremiseManager.d.ts.map +1 -1
- package/dist/lib/core/PremiseManager.js +9 -10
- package/dist/lib/core/PremiseManager.js.map +1 -1
- package/dist/lib/core/VariableManager.d.ts +3 -2
- package/dist/lib/core/VariableManager.d.ts.map +1 -1
- package/dist/lib/core/VariableManager.js +13 -0
- package/dist/lib/core/VariableManager.js.map +1 -1
- package/dist/lib/core/evaluation/shared.d.ts +1 -1
- package/dist/lib/core/evaluation/shared.d.ts.map +1 -1
- package/dist/lib/index.d.ts +3 -3
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +3 -3
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/schemata/analysis.d.ts +8 -0
- package/dist/lib/schemata/analysis.d.ts.map +1 -0
- package/dist/lib/schemata/analysis.js +10 -0
- package/dist/lib/schemata/analysis.js.map +1 -0
- package/dist/lib/schemata/argument.d.ts +36 -2
- package/dist/lib/schemata/argument.d.ts.map +1 -1
- package/dist/lib/schemata/argument.js +34 -3
- package/dist/lib/schemata/argument.js.map +1 -1
- package/dist/lib/schemata/index.d.ts +4 -3
- package/dist/lib/schemata/index.d.ts.map +1 -1
- package/dist/lib/schemata/index.js +4 -3
- package/dist/lib/schemata/index.js.map +1 -1
- package/dist/lib/schemata/propositional.d.ts +37 -6
- package/dist/lib/schemata/propositional.d.ts.map +1 -1
- package/dist/lib/schemata/propositional.js +13 -7
- package/dist/lib/schemata/propositional.js.map +1 -1
- package/dist/lib/types/evaluation.d.ts +2 -5
- package/dist/lib/types/evaluation.d.ts.map +1 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -2,15 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Core engine for building, evaluating, and checking the logical validity of propositional-logic arguments. Manages typed trees of variables and expressions across one or more **premises**, with strict structural invariants, automatic operator collapse, a display renderer, and a truth-table validity checker.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
This package is hosted on GitHub Packages. Add the following to your project's `.npmrc` (replace `polintpro` with your GitHub org):
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
@polintpro:registry=https://npm.pkg.github.com
|
|
11
|
-
```
|
|
5
|
+
Also ships a **CLI** (`core`) for managing arguments, premises, variables, expressions, and analyses stored on disk.
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
## Installation
|
|
14
8
|
|
|
15
9
|
```bash
|
|
16
10
|
pnpm add @polintpro/proposit-core
|
|
@@ -501,6 +495,185 @@ Returns a serialisable snapshot of this premise (`{ id, title, type, rootExpress
|
|
|
501
495
|
|
|
502
496
|
---
|
|
503
497
|
|
|
498
|
+
## CLI
|
|
499
|
+
|
|
500
|
+
The package ships a command-line interface for managing arguments stored on disk.
|
|
501
|
+
|
|
502
|
+
### Running the CLI
|
|
503
|
+
|
|
504
|
+
```bash
|
|
505
|
+
# From the repo, using node directly:
|
|
506
|
+
node dist/cli.js --help
|
|
507
|
+
|
|
508
|
+
# Using the npm script:
|
|
509
|
+
pnpm cli -- --help
|
|
510
|
+
|
|
511
|
+
# Link globally to get the `core` command on your PATH:
|
|
512
|
+
pnpm link --global
|
|
513
|
+
core --help
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
### State storage
|
|
517
|
+
|
|
518
|
+
All data is stored under `~/.proposit-core` by default. Override with the `PROPOSIT_HOME` environment variable:
|
|
519
|
+
|
|
520
|
+
```bash
|
|
521
|
+
PROPOSIT_HOME=/path/to/data core arguments list
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
The on-disk layout is:
|
|
525
|
+
|
|
526
|
+
```
|
|
527
|
+
$PROPOSIT_HOME/
|
|
528
|
+
arguments/
|
|
529
|
+
<argument-id>/
|
|
530
|
+
meta.json # id, title, description
|
|
531
|
+
<version>/ # one directory per version (0, 1, 2, …)
|
|
532
|
+
meta.json # version, createdAt, published, publishedAt?
|
|
533
|
+
variables.json # array of TPropositionalVariable
|
|
534
|
+
roles.json # { conclusionPremiseId?, supportingPremiseIds }
|
|
535
|
+
premises/
|
|
536
|
+
<premise-id>/
|
|
537
|
+
meta.json # id, title?
|
|
538
|
+
data.json # type, rootExpressionId?, variables[], expressions[]
|
|
539
|
+
<analysis>.json # named analysis files (default: analysis.json)
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
### Versioning
|
|
543
|
+
|
|
544
|
+
Arguments start at version `0`. Publishing marks the current version as immutable and copies its state to a new draft version. All mutating commands reject published versions.
|
|
545
|
+
|
|
546
|
+
Version selectors accepted anywhere a `<version>` is required:
|
|
547
|
+
|
|
548
|
+
| Selector | Resolves to |
|
|
549
|
+
| ---------------- | -------------------------------------- |
|
|
550
|
+
| `0`, `1`, … | Exact version number |
|
|
551
|
+
| `latest` | Highest version number |
|
|
552
|
+
| `last-published` | Highest version with `published: true` |
|
|
553
|
+
|
|
554
|
+
### Top-level commands
|
|
555
|
+
|
|
556
|
+
```
|
|
557
|
+
core version Print the package version
|
|
558
|
+
core arguments create <title> <desc> Create a new argument (prints UUID)
|
|
559
|
+
core arguments list [--json] List all arguments
|
|
560
|
+
core arguments delete [--all] [--confirm] <id> Delete an argument or its latest version
|
|
561
|
+
core arguments publish <id> Publish latest version, prepare new draft
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
By default `delete` removes only the latest version. Pass `--all` to remove the argument entirely. Both `delete` and `delete-unused` prompt for confirmation unless `--confirm` is supplied.
|
|
565
|
+
|
|
566
|
+
### Version-scoped commands
|
|
567
|
+
|
|
568
|
+
All commands below are scoped to a specific argument version:
|
|
569
|
+
|
|
570
|
+
```
|
|
571
|
+
core <argument_id> <version> <group> <subcommand> [args] [options]
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
#### show
|
|
575
|
+
|
|
576
|
+
```
|
|
577
|
+
core <id> <ver> show [--json]
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
Displays argument metadata (id, title, description, version, createdAt, published, publishedAt).
|
|
581
|
+
|
|
582
|
+
#### render
|
|
583
|
+
|
|
584
|
+
```
|
|
585
|
+
core <id> <ver> render
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
Prints every premise in the argument, one per line, in the format `<premise_id>: <display_string>`. The premise designated as the conclusion is marked with an asterisk (`<premise_id>*: <display_string>`). Display strings use standard logical notation (¬ ∧ ∨ → ↔).
|
|
589
|
+
|
|
590
|
+
#### roles
|
|
591
|
+
|
|
592
|
+
```
|
|
593
|
+
core <id> <ver> roles show [--json]
|
|
594
|
+
core <id> <ver> roles set-conclusion <premise_id>
|
|
595
|
+
core <id> <ver> roles clear-conclusion
|
|
596
|
+
core <id> <ver> roles add-support <premise_id>
|
|
597
|
+
core <id> <ver> roles remove-support <premise_id>
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
#### variables
|
|
601
|
+
|
|
602
|
+
```
|
|
603
|
+
core <id> <ver> variables create <symbol> [--id <variable_id>]
|
|
604
|
+
core <id> <ver> variables list [--json]
|
|
605
|
+
core <id> <ver> variables show <variable_id> [--json]
|
|
606
|
+
core <id> <ver> variables update <variable_id> --symbol <new_symbol>
|
|
607
|
+
core <id> <ver> variables delete <variable_id>
|
|
608
|
+
core <id> <ver> variables list-unused [--json]
|
|
609
|
+
core <id> <ver> variables delete-unused [--confirm] [--json]
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
`create` prints the new variable's UUID. `delete` fails if any expression references the variable. `delete-unused` removes variables not referenced by any expression in any premise.
|
|
613
|
+
|
|
614
|
+
#### premises
|
|
615
|
+
|
|
616
|
+
```
|
|
617
|
+
core <id> <ver> premises create [--title <title>]
|
|
618
|
+
core <id> <ver> premises list [--json]
|
|
619
|
+
core <id> <ver> premises show <premise_id> [--json]
|
|
620
|
+
core <id> <ver> premises update <premise_id> --title <title>
|
|
621
|
+
core <id> <ver> premises delete [--confirm] <premise_id>
|
|
622
|
+
core <id> <ver> premises render <premise_id>
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
`create` prints the new premise's UUID. `render` outputs the expression tree as a display string (e.g. `(P → Q)`).
|
|
626
|
+
|
|
627
|
+
#### expressions
|
|
628
|
+
|
|
629
|
+
```
|
|
630
|
+
core <id> <ver> expressions create <premise_id> --type <type> [options]
|
|
631
|
+
core <id> <ver> expressions insert <premise_id> --type <type> [options]
|
|
632
|
+
core <id> <ver> expressions delete <premise_id> <expression_id>
|
|
633
|
+
core <id> <ver> expressions list <premise_id> [--json]
|
|
634
|
+
core <id> <ver> expressions show <premise_id> <expression_id> [--json]
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
Common options for `create` and `insert`:
|
|
638
|
+
|
|
639
|
+
| Option | Description |
|
|
640
|
+
| -------------------- | ---------------------------------------------------------------------- |
|
|
641
|
+
| `--type <type>` | `variable`, `operator`, or `formula` (required) |
|
|
642
|
+
| `--id <id>` | Explicit expression ID (default: generated UUID) |
|
|
643
|
+
| `--parent-id <id>` | Parent expression ID (omit for root) |
|
|
644
|
+
| `--position <n>` | Position among siblings |
|
|
645
|
+
| `--variable-id <id>` | Variable ID (required for `type=variable`) |
|
|
646
|
+
| `--operator <op>` | `not`, `and`, `or`, `implies`, or `iff` (required for `type=operator`) |
|
|
647
|
+
|
|
648
|
+
`insert` additionally accepts `--left-node-id` and `--right-node-id` to splice the new expression between existing nodes.
|
|
649
|
+
|
|
650
|
+
#### analysis
|
|
651
|
+
|
|
652
|
+
An **analysis file** stores a variable assignment (symbol → boolean) for a specific argument version.
|
|
653
|
+
|
|
654
|
+
```
|
|
655
|
+
core <id> <ver> analysis create [filename] [--default <true|false>]
|
|
656
|
+
core <id> <ver> analysis list [--json]
|
|
657
|
+
core <id> <ver> analysis show [--file <filename>] [--json]
|
|
658
|
+
core <id> <ver> analysis set <symbol> <true|false> [--file <filename>]
|
|
659
|
+
core <id> <ver> analysis reset [--file <filename>] [--value <true|false>]
|
|
660
|
+
core <id> <ver> analysis validate-assignments [--file <filename>] [--json]
|
|
661
|
+
core <id> <ver> analysis delete [--file <filename>] [--confirm]
|
|
662
|
+
core <id> <ver> analysis evaluate [--file <filename>] [options]
|
|
663
|
+
core <id> <ver> analysis check-validity [options]
|
|
664
|
+
core <id> <ver> analysis validate-argument [--json]
|
|
665
|
+
core <id> <ver> analysis refs [--json]
|
|
666
|
+
core <id> <ver> analysis export [--json]
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
`--file` defaults to `analysis.json` throughout. Key subcommands:
|
|
670
|
+
|
|
671
|
+
- **`evaluate`** — resolves symbol→ID, evaluates the argument, reports admissibility, counterexample status, and whether the conclusion is true.
|
|
672
|
+
- **`check-validity`** — runs the full truth-table search (`--mode first-counterexample|exhaustive`).
|
|
673
|
+
- **`validate-argument`** — checks structural readiness (conclusion set, inference premises, etc.).
|
|
674
|
+
- **`refs`** — lists every variable referenced across all premises.
|
|
675
|
+
- **`export`** — dumps the full `ArgumentEngine` state snapshot as JSON.
|
|
676
|
+
|
|
504
677
|
## Development
|
|
505
678
|
|
|
506
679
|
```bash
|
|
@@ -510,6 +683,7 @@ pnpm run lint # Prettier + ESLint
|
|
|
510
683
|
pnpm run test # Vitest
|
|
511
684
|
pnpm run build # compile to dist/
|
|
512
685
|
pnpm run check # all of the above in sequence
|
|
686
|
+
pnpm cli -- --help # run the CLI from the local build
|
|
513
687
|
```
|
|
514
688
|
|
|
515
689
|
## Publishing
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/analysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAkBnC,wBAAgB,wBAAwB,CACpC,YAAY,EAAE,OAAO,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GAChB,IAAI,CA8cN"}
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { hydrateEngine } from "../engine.js";
|
|
3
|
+
import { errorExit, printJson, printLine, requireConfirmation, } from "../output.js";
|
|
4
|
+
import { analysisFileExists, deleteAnalysisFile, listAnalysisFiles, readAnalysis, resolveAnalysisFilename, writeAnalysis, } from "../storage/analysis.js";
|
|
5
|
+
import { readVariables } from "../storage/variables.js";
|
|
6
|
+
export function registerAnalysisCommands(versionedCmd, argumentId, version) {
|
|
7
|
+
const analysis = versionedCmd
|
|
8
|
+
.command("analysis")
|
|
9
|
+
.description("Manage and run analyses");
|
|
10
|
+
analysis
|
|
11
|
+
.command("create [analysis_filename]")
|
|
12
|
+
.description("Create a new analysis file initialised with all variables")
|
|
13
|
+
.option("--default <value>", "Default boolean value for all assignments (true or false)", "true")
|
|
14
|
+
.action(async (filenameArg, opts) => {
|
|
15
|
+
const filename = resolveAnalysisFilename(filenameArg);
|
|
16
|
+
if (await analysisFileExists(argumentId, version, filename)) {
|
|
17
|
+
errorExit(`Analysis file "${filename}" already exists.`);
|
|
18
|
+
}
|
|
19
|
+
const defaultValue = opts.default !== "false";
|
|
20
|
+
const variables = await readVariables(argumentId, version);
|
|
21
|
+
const assignments = {};
|
|
22
|
+
for (const v of variables) {
|
|
23
|
+
assignments[v.symbol] = defaultValue;
|
|
24
|
+
}
|
|
25
|
+
await writeAnalysis(argumentId, version, filename, {
|
|
26
|
+
argumentId,
|
|
27
|
+
argumentVersion: version,
|
|
28
|
+
assignments,
|
|
29
|
+
});
|
|
30
|
+
printLine(filename);
|
|
31
|
+
});
|
|
32
|
+
analysis
|
|
33
|
+
.command("list")
|
|
34
|
+
.description("List analysis files in this argument version")
|
|
35
|
+
.option("--json", "Output as JSON")
|
|
36
|
+
.action(async (opts) => {
|
|
37
|
+
const files = await listAnalysisFiles(argumentId, version);
|
|
38
|
+
if (opts.json) {
|
|
39
|
+
printJson(files);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
for (const f of files)
|
|
43
|
+
printLine(f);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
analysis
|
|
47
|
+
.command("show")
|
|
48
|
+
.description("Show variable assignments in an analysis file")
|
|
49
|
+
.option("--file <filename>", "Analysis filename (default: analysis.json)")
|
|
50
|
+
.option("--json", "Output as JSON")
|
|
51
|
+
.action(async (opts) => {
|
|
52
|
+
const filename = resolveAnalysisFilename(opts.file);
|
|
53
|
+
const data = await readAnalysis(argumentId, version, filename);
|
|
54
|
+
if (opts.json) {
|
|
55
|
+
printJson(data);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const sorted = Object.entries(data.assignments).sort(([a], [b]) => a.localeCompare(b));
|
|
59
|
+
for (const [symbol, value] of sorted) {
|
|
60
|
+
printLine(`${symbol} = ${value}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
analysis
|
|
65
|
+
.command("set <variable_symbol> <value>")
|
|
66
|
+
.description("Update a single variable assignment (value: true or false)")
|
|
67
|
+
.option("--file <filename>", "Analysis filename (default: analysis.json)")
|
|
68
|
+
.action(async (symbol, valueArg, opts) => {
|
|
69
|
+
const filename = resolveAnalysisFilename(opts.file);
|
|
70
|
+
if (!(await analysisFileExists(argumentId, version, filename))) {
|
|
71
|
+
errorExit(`Analysis file "${filename}" does not exist.`);
|
|
72
|
+
}
|
|
73
|
+
const variables = await readVariables(argumentId, version);
|
|
74
|
+
if (!variables.some((v) => v.symbol === symbol)) {
|
|
75
|
+
errorExit(`Variable symbol "${symbol}" is not defined in this argument version.`);
|
|
76
|
+
}
|
|
77
|
+
const boolValue = valueArg === "true"
|
|
78
|
+
? true
|
|
79
|
+
: valueArg === "false"
|
|
80
|
+
? false
|
|
81
|
+
: errorExit(`Value must be "true" or "false", got "${valueArg}".`);
|
|
82
|
+
const data = await readAnalysis(argumentId, version, filename);
|
|
83
|
+
data.assignments[symbol] = boolValue;
|
|
84
|
+
await writeAnalysis(argumentId, version, filename, data);
|
|
85
|
+
printLine("success");
|
|
86
|
+
});
|
|
87
|
+
analysis
|
|
88
|
+
.command("reset")
|
|
89
|
+
.description("Reset all assignments in an analysis file to one value")
|
|
90
|
+
.option("--file <filename>", "Analysis filename (default: analysis.json)")
|
|
91
|
+
.option("--value <value>", "Value to reset to (default: true)", "true")
|
|
92
|
+
.action(async (opts) => {
|
|
93
|
+
const filename = resolveAnalysisFilename(opts.file);
|
|
94
|
+
const boolValue = opts.value !== "false";
|
|
95
|
+
const data = await readAnalysis(argumentId, version, filename);
|
|
96
|
+
for (const symbol of Object.keys(data.assignments)) {
|
|
97
|
+
data.assignments[symbol] = boolValue;
|
|
98
|
+
}
|
|
99
|
+
await writeAnalysis(argumentId, version, filename, data);
|
|
100
|
+
printLine("success");
|
|
101
|
+
});
|
|
102
|
+
analysis
|
|
103
|
+
.command("validate-assignments")
|
|
104
|
+
.description("Validate an analysis file against the argument version")
|
|
105
|
+
.option("--file <filename>", "Analysis filename (default: analysis.json)")
|
|
106
|
+
.option("--json", "Output as JSON")
|
|
107
|
+
.action(async (opts) => {
|
|
108
|
+
const filename = resolveAnalysisFilename(opts.file);
|
|
109
|
+
const [data, variables] = await Promise.all([
|
|
110
|
+
readAnalysis(argumentId, version, filename),
|
|
111
|
+
readVariables(argumentId, version),
|
|
112
|
+
]);
|
|
113
|
+
const issues = [];
|
|
114
|
+
if (data.argumentId !== argumentId) {
|
|
115
|
+
issues.push({
|
|
116
|
+
code: "ARGUMENT_ID_MISMATCH",
|
|
117
|
+
message: `File argumentId "${data.argumentId}" does not match "${argumentId}".`,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (data.argumentVersion !== version) {
|
|
121
|
+
issues.push({
|
|
122
|
+
code: "ARGUMENT_VERSION_MISMATCH",
|
|
123
|
+
message: `File argumentVersion ${data.argumentVersion} does not match ${version}.`,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
const knownSymbols = new Set(variables.map((v) => v.symbol));
|
|
127
|
+
const fileSymbols = new Set(Object.keys(data.assignments));
|
|
128
|
+
for (const sym of knownSymbols) {
|
|
129
|
+
if (!fileSymbols.has(sym)) {
|
|
130
|
+
issues.push({
|
|
131
|
+
code: "MISSING_SYMBOL",
|
|
132
|
+
message: `Variable symbol "${sym}" is missing from assignments.`,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
for (const sym of fileSymbols) {
|
|
137
|
+
if (!knownSymbols.has(sym)) {
|
|
138
|
+
issues.push({
|
|
139
|
+
code: "UNKNOWN_SYMBOL",
|
|
140
|
+
message: `Assignment symbol "${sym}" is not defined in this argument version.`,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const ok = issues.length === 0;
|
|
145
|
+
if (opts.json) {
|
|
146
|
+
printJson({ ok, issues });
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
printLine(ok ? "ok" : "invalid");
|
|
150
|
+
for (const issue of issues) {
|
|
151
|
+
printLine(`${issue.code}: ${issue.message}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
analysis
|
|
156
|
+
.command("delete")
|
|
157
|
+
.description("Delete an analysis file")
|
|
158
|
+
.option("--file <filename>", "Analysis filename (default: analysis.json)")
|
|
159
|
+
.option("--confirm", "Skip confirmation prompt")
|
|
160
|
+
.action(async (opts) => {
|
|
161
|
+
const filename = resolveAnalysisFilename(opts.file);
|
|
162
|
+
if (!(await analysisFileExists(argumentId, version, filename))) {
|
|
163
|
+
errorExit(`Analysis file "${filename}" does not exist.`);
|
|
164
|
+
}
|
|
165
|
+
if (!opts.confirm) {
|
|
166
|
+
await requireConfirmation(`Delete analysis file "${filename}"?`);
|
|
167
|
+
}
|
|
168
|
+
await deleteAnalysisFile(argumentId, version, filename);
|
|
169
|
+
printLine("success");
|
|
170
|
+
});
|
|
171
|
+
analysis
|
|
172
|
+
.command("evaluate")
|
|
173
|
+
.description("Evaluate the argument using assignments from an analysis file")
|
|
174
|
+
.option("--file <filename>", "Analysis filename (default: analysis.json)")
|
|
175
|
+
.option("--strict-unknown-assignment-keys", "Reject extra assignment keys")
|
|
176
|
+
.option("--no-expression-values", "Omit per-expression truth values")
|
|
177
|
+
.option("--no-diagnostics", "Omit inference diagnostics")
|
|
178
|
+
.option("--no-validate-first", "Skip evaluability validation")
|
|
179
|
+
.option("--skip-analysis-file-validation", "Skip analysis file validation")
|
|
180
|
+
.option("--json", "Output as JSON")
|
|
181
|
+
.action(async (opts) => {
|
|
182
|
+
const filename = resolveAnalysisFilename(opts.file);
|
|
183
|
+
const [analysisData, variables] = await Promise.all([
|
|
184
|
+
readAnalysis(argumentId, version, filename),
|
|
185
|
+
readVariables(argumentId, version),
|
|
186
|
+
]);
|
|
187
|
+
// Validate analysis file unless skipped
|
|
188
|
+
if (!opts.skipAnalysisFileValidation) {
|
|
189
|
+
const knownSymbols = new Set(variables.map((v) => v.symbol));
|
|
190
|
+
const fileSymbols = Object.keys(analysisData.assignments);
|
|
191
|
+
const missing = fileSymbols.filter((s) => !knownSymbols.has(s));
|
|
192
|
+
const extra = Array.from(knownSymbols).filter((s) => !analysisData.assignments.hasOwnProperty(s));
|
|
193
|
+
if (analysisData.argumentId !== argumentId ||
|
|
194
|
+
analysisData.argumentVersion !== version ||
|
|
195
|
+
missing.length > 0 ||
|
|
196
|
+
extra.length > 0) {
|
|
197
|
+
errorExit("Analysis file validation failed. Use --skip-analysis-file-validation to bypass or run validate-assignments for details.");
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// Build symbol-to-ID map and resolve assignment
|
|
201
|
+
const symbolToId = new Map(variables.map((v) => [v.symbol, v.id]));
|
|
202
|
+
const assignment = {};
|
|
203
|
+
for (const [sym, val] of Object.entries(analysisData.assignments)) {
|
|
204
|
+
const id = symbolToId.get(sym);
|
|
205
|
+
if (id !== undefined)
|
|
206
|
+
assignment[id] = val;
|
|
207
|
+
}
|
|
208
|
+
const engine = await hydrateEngine(argumentId, version);
|
|
209
|
+
const result = engine.evaluate(assignment, {
|
|
210
|
+
strictUnknownAssignmentKeys: opts.strictUnknownAssignmentKeys ?? false,
|
|
211
|
+
includeExpressionValues: !opts.noExpressionValues,
|
|
212
|
+
includeDiagnostics: !opts.noDiagnostics,
|
|
213
|
+
validateFirst: !opts.noValidateFirst,
|
|
214
|
+
});
|
|
215
|
+
if (opts.json) {
|
|
216
|
+
printJson(result);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (!result.ok) {
|
|
220
|
+
printLine("Evaluation failed:");
|
|
221
|
+
for (const issue of result.validation?.issues ?? []) {
|
|
222
|
+
printLine(` ${issue.severity} ${issue.code}: ${issue.message}`);
|
|
223
|
+
}
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
printLine(`admissible: ${result.isAdmissibleAssignment}`);
|
|
227
|
+
printLine(`all supporting: ${result.allSupportingPremisesTrue}`);
|
|
228
|
+
printLine(`conclusion true: ${result.conclusionTrue}`);
|
|
229
|
+
printLine(`counterexample: ${result.isCounterexample}`);
|
|
230
|
+
});
|
|
231
|
+
analysis
|
|
232
|
+
.command("check-validity")
|
|
233
|
+
.description("Run truth-table validity checking")
|
|
234
|
+
.option("--mode <mode>", "first-counterexample or exhaustive", "first-counterexample")
|
|
235
|
+
.option("--max-variables <n>", "Maximum number of variables")
|
|
236
|
+
.option("--max-assignments-checked <n>", "Maximum assignments to check")
|
|
237
|
+
.option("--include-counterexample-evaluations", "Include full evaluation payloads for counterexamples")
|
|
238
|
+
.option("--no-validate-first", "Skip evaluability validation")
|
|
239
|
+
.option("--json", "Output as JSON")
|
|
240
|
+
.action(async (opts) => {
|
|
241
|
+
const engine = await hydrateEngine(argumentId, version);
|
|
242
|
+
const result = engine.checkValidity({
|
|
243
|
+
mode: opts.mode === "exhaustive"
|
|
244
|
+
? "exhaustive"
|
|
245
|
+
: "firstCounterexample",
|
|
246
|
+
maxVariables: opts.maxVariables !== undefined
|
|
247
|
+
? Number(opts.maxVariables)
|
|
248
|
+
: undefined,
|
|
249
|
+
maxAssignmentsChecked: opts.maxAssignmentsChecked !== undefined
|
|
250
|
+
? Number(opts.maxAssignmentsChecked)
|
|
251
|
+
: undefined,
|
|
252
|
+
includeCounterexampleEvaluations: opts.includeCounterexampleEvaluations ?? false,
|
|
253
|
+
validateFirst: !opts.noValidateFirst,
|
|
254
|
+
});
|
|
255
|
+
if (opts.json) {
|
|
256
|
+
printJson(result);
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (!result.ok) {
|
|
260
|
+
printLine("Validity check failed:");
|
|
261
|
+
for (const issue of result.validation?.issues ?? []) {
|
|
262
|
+
printLine(` ${issue.severity} ${issue.code}: ${issue.message}`);
|
|
263
|
+
}
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
const validity = result.isValid === true
|
|
267
|
+
? "valid"
|
|
268
|
+
: result.isValid === false
|
|
269
|
+
? "invalid"
|
|
270
|
+
: "unknown (truncated)";
|
|
271
|
+
printLine(`isValid: ${validity}`);
|
|
272
|
+
printLine(`truncated: ${result.truncated}`);
|
|
273
|
+
printLine(`assignments checked: ${result.numAssignmentsChecked}`);
|
|
274
|
+
printLine(`admissible: ${result.numAdmissibleAssignments}`);
|
|
275
|
+
printLine(`counterexamples: ${result.counterexamples?.length ?? 0}`);
|
|
276
|
+
if ((result.counterexamples?.length ?? 0) > 0) {
|
|
277
|
+
printLine("counterexample assignments:");
|
|
278
|
+
for (const ce of result.counterexamples) {
|
|
279
|
+
printLine(" " + JSON.stringify(ce.assignment));
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
analysis
|
|
284
|
+
.command("validate-argument")
|
|
285
|
+
.description("Validate the argument structure for evaluability")
|
|
286
|
+
.option("--json", "Output as JSON")
|
|
287
|
+
.action(async (opts) => {
|
|
288
|
+
const engine = await hydrateEngine(argumentId, version);
|
|
289
|
+
const result = engine.validateEvaluability();
|
|
290
|
+
if (opts.json) {
|
|
291
|
+
printJson(result);
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
printLine(result.ok ? "ok" : "invalid");
|
|
295
|
+
for (const issue of result.issues) {
|
|
296
|
+
printLine(`${issue.severity} ${issue.code}: ${issue.message}`);
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
analysis
|
|
300
|
+
.command("refs")
|
|
301
|
+
.description("Show variables referenced across all premises")
|
|
302
|
+
.option("--json", "Output as JSON")
|
|
303
|
+
.action(async (opts) => {
|
|
304
|
+
const engine = await hydrateEngine(argumentId, version);
|
|
305
|
+
const refs = engine.collectReferencedVariables();
|
|
306
|
+
if (opts.json) {
|
|
307
|
+
printJson(refs);
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
for (const variableId of refs.variableIds) {
|
|
311
|
+
const info = refs.byId[variableId];
|
|
312
|
+
printLine(`${variableId} | ${info.symbol} | premises: [${info.premiseIds.join(", ")}]`);
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
analysis
|
|
316
|
+
.command("export")
|
|
317
|
+
.description("Export the full argument engine state snapshot")
|
|
318
|
+
.option("--json", "Output as JSON")
|
|
319
|
+
.action(async (_opts) => {
|
|
320
|
+
const engine = await hydrateEngine(argumentId, version);
|
|
321
|
+
printJson(engine.exportState());
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
//# sourceMappingURL=analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../../src/cli/commands/analysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EACH,SAAS,EACT,SAAS,EACT,SAAS,EACT,mBAAmB,GACtB,MAAM,cAAc,CAAA;AACrB,OAAO,EACH,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,uBAAuB,EACvB,aAAa,GAChB,M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