logic-atlas 0.25.0 → 0.26.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 (81) hide show
  1. package/CITATION.cff +2 -2
  2. package/README.md +8 -4
  3. package/dist/case.js +1 -1
  4. package/dist/chunks/{CasePage-R2k_0lls.js → CasePage-CbCDu1FO.js} +3 -3
  5. package/dist/chunks/{CasePage-R2k_0lls.js.map → CasePage-CbCDu1FO.js.map} +1 -1
  6. package/dist/chunks/{CausalPlayground-Cd7Sok3F.js → CausalPlayground-D93D0ceE.js} +5 -5
  7. package/dist/chunks/{CausalPlayground-Cd7Sok3F.js.map → CausalPlayground-D93D0ceE.js.map} +1 -1
  8. package/dist/chunks/{CiteBlock-irdT1sjg.js → CiteBlock-DMFqM7ZM.js} +2 -2
  9. package/dist/chunks/{CiteBlock-irdT1sjg.js.map → CiteBlock-DMFqM7ZM.js.map} +1 -1
  10. package/dist/chunks/{ConservativeExtension-BX4EtG16.js → ConservativeExtension-Cofe92ak.js} +2 -2
  11. package/dist/chunks/{ConservativeExtension-BX4EtG16.js.map → ConservativeExtension-Cofe92ak.js.map} +1 -1
  12. package/dist/chunks/{ExportMenu-B5HoqaQl.js → ExportMenu-DaLZ5rBJ.js} +3 -3
  13. package/dist/chunks/{ExportMenu-B5HoqaQl.js.map → ExportMenu-DaLZ5rBJ.js.map} +1 -1
  14. package/dist/chunks/{GraphBox-Tg3kDWNT.js → GraphBox-DjjoWUU0.js} +3 -3
  15. package/dist/chunks/{GraphBox-Tg3kDWNT.js.map → GraphBox-DjjoWUU0.js.map} +1 -1
  16. package/dist/chunks/{IdentifyPanel-BVmZsWGN.js → IdentifyPanel-CoPC-Okk.js} +3 -3
  17. package/dist/chunks/{IdentifyPanel-BVmZsWGN.js.map → IdentifyPanel-CoPC-Okk.js.map} +1 -1
  18. package/dist/chunks/{ModelEditor-oAvvVqX5.js → ModelEditor-A6kk6Si5.js} +2 -2
  19. package/dist/chunks/{ModelEditor-oAvvVqX5.js.map → ModelEditor-A6kk6Si5.js.map} +1 -1
  20. package/dist/chunks/{ProbabilityPanel-8-cC68rq.js → ProbabilityPanel-DKTFYU-j.js} +5 -5
  21. package/dist/chunks/{ProbabilityPanel-8-cC68rq.js.map → ProbabilityPanel-DKTFYU-j.js.map} +1 -1
  22. package/dist/chunks/{RulesPanel-Cr6R9xCK.js → RulesPanel-B6X9O0he.js} +3 -3
  23. package/dist/chunks/{RulesPanel-Cr6R9xCK.js.map → RulesPanel-B6X9O0he.js.map} +1 -1
  24. package/dist/chunks/SignalGraph-CWPf_sG8.js +1412 -0
  25. package/dist/chunks/SignalGraph-CWPf_sG8.js.map +1 -0
  26. package/dist/chunks/{SliderList-BrILQCA4.js → SliderList-DmDURTeF.js} +2 -2
  27. package/dist/chunks/{SliderList-BrILQCA4.js.map → SliderList-DmDURTeF.js.map} +1 -1
  28. package/dist/chunks/{WorldLanes-kxYTRnB5.js → WorldLanes-DDtJZqcA.js} +2 -2
  29. package/dist/chunks/{WorldLanes-kxYTRnB5.js.map → WorldLanes-DDtJZqcA.js.map} +1 -1
  30. package/dist/chunks/{cite-B6emUIEW.js → cite-QzNc24r2.js} +2 -2
  31. package/dist/chunks/{cite-B6emUIEW.js.map → cite-QzNc24r2.js.map} +1 -1
  32. package/dist/chunks/{export-image-IsI6PVd9.js → export-image-BBHOXOis.js} +3 -3
  33. package/dist/chunks/{export-image-IsI6PVd9.js.map → export-image-BBHOXOis.js.map} +1 -1
  34. package/dist/cite.js +1 -1
  35. package/dist/editor.js +1 -1
  36. package/dist/extension.js +1 -1
  37. package/dist/ground-cases.js +767 -0
  38. package/dist/ground-cases.js.map +1 -0
  39. package/dist/ground.css +2 -0
  40. package/dist/ground.js +3829 -0
  41. package/dist/ground.js.map +1 -0
  42. package/dist/identify.js +1 -1
  43. package/dist/index.js +8 -8
  44. package/dist/lanes.js +1 -1
  45. package/dist/playground.js +1 -1
  46. package/dist/probability.js +1 -1
  47. package/dist/style.css +1 -1
  48. package/dist/types/ground/cases/index.d.ts +7 -0
  49. package/dist/types/ground/components/DiscernibilityPanel.d.ts +35 -0
  50. package/dist/types/ground/components/GroundChecker.d.ts +16 -0
  51. package/dist/types/ground/components/ProposalTable.d.ts +20 -0
  52. package/dist/types/ground/components/StructureView.d.ts +21 -0
  53. package/dist/types/ground/components/case-text.d.ts +32 -0
  54. package/dist/types/ground/components/parts.d.ts +59 -0
  55. package/dist/types/ground/components/structure-layout.d.ts +59 -0
  56. package/dist/types/ground/components/use-premises.d.ts +21 -0
  57. package/dist/types/ground/data/analyze.d.ts +41 -0
  58. package/dist/types/ground/data/case.d.ts +52 -0
  59. package/dist/types/ground/data/load.d.ts +30 -0
  60. package/dist/types/ground/data/presets.d.ts +32 -0
  61. package/dist/types/ground/data/schema.d.ts +303 -0
  62. package/dist/types/ground/engine/closure.d.ts +34 -0
  63. package/dist/types/ground/engine/discern.d.ts +84 -0
  64. package/dist/types/ground/engine/errors.d.ts +142 -0
  65. package/dist/types/ground/engine/evaluate.d.ts +25 -0
  66. package/dist/types/ground/engine/facts.d.ts +61 -0
  67. package/dist/types/ground/engine/formula.d.ts +100 -0
  68. package/dist/types/ground/engine/index.d.ts +26 -0
  69. package/dist/types/ground/engine/premises.d.ts +58 -0
  70. package/dist/types/ground/engine/print.d.ts +29 -0
  71. package/dist/types/ground/engine/proposals.d.ts +56 -0
  72. package/dist/types/ground/engine/resolve.d.ts +46 -0
  73. package/dist/types/ground/engine/syntax.d.ts +55 -0
  74. package/dist/types/ground/i18n/en.d.ts +2 -0
  75. package/dist/types/ground/i18n/messages.d.ts +14 -0
  76. package/dist/types/ground/i18n/zh.d.ts +95 -0
  77. package/dist/types/ground/index.d.ts +22 -0
  78. package/dist/types/logic/structure.d.ts +72 -0
  79. package/package.json +12 -3
  80. package/dist/chunks/SignalGraph-yoGcj7jf.js +0 -1405
  81. package/dist/chunks/SignalGraph-yoGcj7jf.js.map +0 -1
@@ -0,0 +1,95 @@
1
+ import type { Locale } from '../../engine/types.js';
2
+ import type { GroundProblemWording } from '../engine/errors.js';
3
+ import type { Printed } from '../engine/print.js';
4
+ import type { ProposalVerdict } from '../engine/proposals.js';
5
+ export declare const GROUND_ZH: {
6
+ locale: Locale;
7
+ problems: GroundProblemWording;
8
+ docInvalid: string;
9
+ yes: string;
10
+ no: string;
11
+ structure: (n: number) => string;
12
+ individual: (name: string, props: readonly string[]) => string;
13
+ selectIndividual: (name: string) => string;
14
+ relationLabel: (symbol: string, label: string) => string;
15
+ relationLegend: string;
16
+ nonQualitative: string;
17
+ holdsFacts: string;
18
+ pairHeading: (a: string, b: string) => string;
19
+ sameIndividual: string;
20
+ distinctIndividuals: string;
21
+ pickPair: string;
22
+ propertiesHeading: string;
23
+ propertyColumn: string;
24
+ kindColumn: string;
25
+ qualitative: string;
26
+ haecceity: string;
27
+ sharesAll: string;
28
+ sharesNotAll: string;
29
+ discernHeading: string;
30
+ discernKinds: {
31
+ property: string;
32
+ absolute: string;
33
+ relative: string;
34
+ weak: string;
35
+ };
36
+ witnessProperty: (p: string, who: string) => string;
37
+ witnessProfile: (r: string, out: boolean, p: string | undefined, who: string) => string;
38
+ witnessStructure: (depth: number) => string;
39
+ witnessRelation: (r: string) => string;
40
+ relationsHeading: string;
41
+ relationColumn: string;
42
+ woerner: string;
43
+ irreflexiveCheck: string;
44
+ reflexiveCheck: string;
45
+ checkHolds: string;
46
+ checkFails: (who: string) => string;
47
+ checkFailsReflexive: (who: string) => string;
48
+ irreflexiveWitness: (r: string) => string;
49
+ noIrreflexiveWitness: string;
50
+ proposalsHeading: string;
51
+ proposalColumn: string;
52
+ verdictColumn: string;
53
+ identityClause: string;
54
+ distinctnessClause: string;
55
+ clauseHolds: string;
56
+ clauseFails: string;
57
+ proposalNames: Readonly<Record<string, string>>;
58
+ verdict: Readonly<Record<ProposalVerdict, string>>;
59
+ verdictReason: (v: ProposalVerdict, same: boolean, necessitationOff: boolean) => string;
60
+ scopeNote: string;
61
+ premisesHeading: string;
62
+ premiseNames: Readonly<Record<string, string>>;
63
+ defNoun: (name: string) => string;
64
+ defPremise: (name: string) => string;
65
+ claimPremise: (label: string) => string;
66
+ premiseValues: Readonly<Record<string, string>>;
67
+ defLabels: Readonly<Record<string, (args: readonly Printed[]) => Printed>>;
68
+ targetHeading: string;
69
+ selfGrounds: string;
70
+ otherSelfGrounds: (fact: string) => string;
71
+ noSelfGround: string;
72
+ chainHeading: string;
73
+ rules: Readonly<Record<string, string>>;
74
+ mergedSteps: (n: number) => string;
75
+ claimRule: (label: string) => string;
76
+ clauseClaim: (proposal: string, clause: 'identity' | 'distinctness') => string;
77
+ directGrounds: string;
78
+ zeroGround: string;
79
+ partialHeading: (n: number) => string;
80
+ noPartial: string;
81
+ claimFailure: (claim: string, fact: string) => string;
82
+ variantsAgree: (noun: string) => string;
83
+ variantsDiffer: (noun: string) => string;
84
+ showGrounds: (fact: string) => string;
85
+ presetsHeading: string;
86
+ presetCheck: (test: string, expected: boolean, actual: boolean) => string;
87
+ presetMatches: string;
88
+ presetDiffers: string;
89
+ presetResult: (test: string, ok: boolean) => string;
90
+ finiteNote: string;
91
+ tableCaption: string;
92
+ caseColumn: string;
93
+ expand: (row: string, proposal: string) => string;
94
+ };
95
+ export type GroundMessages = typeof GROUND_ZH;
@@ -0,0 +1,22 @@
1
+ export type { StructureViewProps } from './components/StructureView.js';
2
+ export { StructureView } from './components/StructureView.js';
3
+ export type { DiscernibilityPanelProps } from './components/DiscernibilityPanel.js';
4
+ export { DiscernibilityPanel } from './components/DiscernibilityPanel.js';
5
+ export type { ProposalTableProps, ProposalTableRow } from './components/ProposalTable.js';
6
+ export { ProposalTable } from './components/ProposalTable.js';
7
+ export type { GroundCheckerProps } from './components/GroundChecker.js';
8
+ export { GroundChecker } from './components/GroundChecker.js';
9
+ export type { GroundCommonProps, GroundDocInput, GroundPresetsProp } from './components/parts.js';
10
+ export type { Locale } from '../components/i18n/messages.js';
11
+ export { DEFAULT_LOCALE, LANGUAGE_NAMES, LocaleProvider } from '../components/i18n/messages.js';
12
+ export type { GroundImportResult } from './data/load.js';
13
+ export { MAX_GROUND_DOC_CHARS, checkGroundDoc, closedFormula, groundText, parseGroundJson } from './data/load.js';
14
+ export type { CaseProposal, ClaimSpec, GroundCase } from './data/case.js';
15
+ export { MAX_SYMBOLS, compileCase, premisesFor } from './data/case.js';
16
+ export type { GroundAnalysis, PairAnalysis, VariantNote } from './data/analyze.js';
17
+ export { analyzeGround, analyzePair } from './data/analyze.js';
18
+ export type { PresetMismatch } from './data/presets.js';
19
+ export { checkPreset, checkPresets, runPreset } from './data/presets.js';
20
+ export type { GroundCaseDoc, GroundCaseInput, GroundExpect, GroundPreset, GroundPresetInput, GroundQuery, GroundText, PairExpect } from './data/schema.js';
21
+ export { groundCaseSchema, presetSchema } from './data/schema.js';
22
+ export * from './engine/index.js';
@@ -0,0 +1,72 @@
1
+ import type { FiniteRelation } from './relations.js';
2
+ /**
3
+ * A finite many-sorted structure: individuals, names that refer to them, one-place properties and
4
+ * two-place relations given by their extensions, each marked qualitative or not. Shared by the ground
5
+ * figures (discernibility, grounding derivations) and, later, by worlds that each carry a structure.
6
+ * Pure: no formulas here; a caller that defines a property by a formula computes its extension first.
7
+ */
8
+ /** The sorts a structure's symbols belong to. */
9
+ export type StructureSort = 'individual' | 'property' | 'relation';
10
+ export interface StructureProperty {
11
+ readonly id: string;
12
+ /** Qualitative properties mention no particular individual ("is blue"); others do ("two miles from Castor"). */
13
+ readonly qualitative: boolean;
14
+ /** The individuals that have it. */
15
+ readonly extension: readonly string[];
16
+ /** For a haecceity λx.(x = o), the individual o; such a property is never qualitative. */
17
+ readonly haecceityOf?: string;
18
+ }
19
+ export interface StructureRelation {
20
+ readonly id: string;
21
+ readonly qualitative: boolean;
22
+ /** The pairs (a, b) with a R b. */
23
+ readonly pairs: readonly (readonly [string, string])[];
24
+ }
25
+ export interface FiniteStructure {
26
+ /** The domain, in a fixed order. */
27
+ readonly individuals: readonly string[];
28
+ /** Name → the individual it refers to; every individual's own id is also a name for it. */
29
+ readonly names: Readonly<Record<string, string>>;
30
+ readonly properties: readonly StructureProperty[];
31
+ readonly relations: readonly StructureRelation[];
32
+ }
33
+ /** The most individuals whose automorphisms are enumerated (8! = 40320 permutations). */
34
+ export declare const MAX_AUTOMORPHISM_INDIVIDUALS = 8;
35
+ /** What `checkStructure` finds wrong, by code; `name` is the offending id. */
36
+ export type StructureIssue = {
37
+ readonly code: 'duplicate-id';
38
+ readonly sort: StructureSort;
39
+ readonly name: string;
40
+ } | {
41
+ readonly code: 'unknown-individual';
42
+ readonly sort: StructureSort;
43
+ readonly name: string;
44
+ readonly individual: string;
45
+ } | {
46
+ readonly code: 'name-clash';
47
+ readonly name: string;
48
+ };
49
+ /** Ids that repeat, names or extensions that point at no individual, names that reuse a property or relation id. */
50
+ export declare function checkStructure(s: FiniteStructure): StructureIssue[];
51
+ /** The individual `name` refers to, or undefined. An individual's id refers to itself. */
52
+ export declare function referent(s: FiniteStructure, name: string): string | undefined;
53
+ /** Every name, the individuals' own ids first, then the extra names in their order. */
54
+ export declare function namesOf(s: FiniteStructure): string[];
55
+ export declare function propertyById(s: FiniteStructure, id: string): StructureProperty | undefined;
56
+ export declare function relationById(s: FiniteStructure, id: string): StructureRelation | undefined;
57
+ export declare function hasProperty(p: StructureProperty, o: string): boolean;
58
+ export declare function relates(r: StructureRelation, a: string, b: string): boolean;
59
+ /** A relation as the carrier and pairs `checkRelation` reads. */
60
+ export declare function finiteRelation(s: FiniteStructure, r: StructureRelation): FiniteRelation;
61
+ /** λx.(x = o) for every individual o, named `=o`: non-qualitative properties that hold of o alone. */
62
+ export declare function haecceities(s: FiniteStructure): StructureProperty[];
63
+ /** A permutation of the domain, as individual → image. */
64
+ export type Automorphism = Readonly<Record<string, string>>;
65
+ /**
66
+ * The permutations of the domain that preserve every qualitative property and relation (with
67
+ * `qualitativeOnly` false, every property and relation). The identity comes first. Throws past
68
+ * {@link MAX_AUTOMORPHISM_INDIVIDUALS} individuals.
69
+ */
70
+ export declare function automorphisms(s: FiniteStructure, qualitativeOnly?: boolean): Automorphism[];
71
+ /** Whether some automorphism (qualitative vocabulary) sends `a` to `b`: on a finite structure, exactly when no qualitative formula with one free variable tells them apart. */
72
+ export declare function sameOrbit(s: FiniteStructure, a: string, b: string, auts?: readonly Automorphism[]): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "logic-atlas",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "Interactive structural causal models and a dataset of philosophical causation and decision cases.",
5
5
  "license": "MIT AND CC-BY-4.0",
6
6
  "author": "洪偉 (Wei Hung)",
@@ -63,6 +63,14 @@
63
63
  "types": "./dist/types/modal/index.d.ts",
64
64
  "import": "./dist/modal.js"
65
65
  },
66
+ "./ground": {
67
+ "types": "./dist/types/ground/index.d.ts",
68
+ "import": "./dist/ground.js"
69
+ },
70
+ "./ground/cases": {
71
+ "types": "./dist/types/ground/cases/index.d.ts",
72
+ "import": "./dist/ground-cases.js"
73
+ },
66
74
  "./causal/engine": {
67
75
  "types": "./dist/types/engine/index.d.ts",
68
76
  "import": "./dist/engine.js"
@@ -72,7 +80,8 @@
72
80
  "import": "./dist/data.js"
73
81
  },
74
82
  "./causal/style.css": "./dist/style.css",
75
- "./modal/style.css": "./dist/modal.css"
83
+ "./modal/style.css": "./dist/modal.css",
84
+ "./ground/style.css": "./dist/ground.css"
76
85
  },
77
86
  "imports": {
78
87
  "#case-preload": {
@@ -85,7 +94,7 @@
85
94
  "typecheck": "tsc -b",
86
95
  "test": "vitest run",
87
96
  "build": "tsc -b && vite build",
88
- "build:lib": "vite build -c vite.lib.config.ts && vite build -c vite.lib.modal.config.ts && tsc -p tsconfig.lib.json && node scripts/fix-dts.mjs dist/types && pnpm check:dist",
97
+ "build:lib": "vite build -c vite.lib.config.ts && vite build -c vite.lib.modal.config.ts && vite build -c vite.lib.ground.config.ts && tsc -p tsconfig.lib.json && node scripts/fix-dts.mjs dist/types && pnpm check:dist",
89
98
  "check:dist": "node scripts/check-size.mjs && node scripts/check-dist-ssr.mjs",
90
99
  "lint": "oxlint",
91
100
  "preview": "vite preview",