@rsconcept/domain 3.0.0 → 3.0.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/dist/{analyzer-fNhkwO-6.d.ts → analyzer-CzFaWR7w.d.ts} +4 -4
- package/dist/{api-Bf0f_uiI.d.ts → api-DgecYHjR.d.ts} +5 -3
- package/dist/{arguments-extractor-ngatANBI.d.ts → arguments-extractor-CXWRT5Ou.d.ts} +4 -4
- package/dist/{ast-C8sIpKdL.d.ts → ast-D-D6Rq3T.d.ts} +2 -3
- package/dist/{ast-annotations-CiIx8qBM.d.ts → ast-annotations-x4PJ_Lhc.d.ts} +4 -4
- package/dist/{calculator-DE89LtIM.d.ts → calculator-uPaTV3hc.d.ts} +5 -5
- package/dist/cctext/language-api.d.ts +0 -1
- package/dist/{diagnostics-ndGYbvgh.js → diagnostics-D1Cp21nP.js} +16 -3
- package/dist/{diagnostics-ndGYbvgh.js.map → diagnostics-D1Cp21nP.js.map} +1 -1
- package/dist/{diagnostics-DsEhmFh0.d.ts → diagnostics-DKyMf6q-.d.ts} +20 -6
- package/dist/{expression-generator-CoucLIkE.d.ts → expression-generator-CADzBw-C.d.ts} +3 -2
- package/dist/graph/index.d.ts +1 -0
- package/dist/index-CnuO4w8e.d.ts +13 -0
- package/dist/index-D5RahF1K.d.ts +2 -0
- package/dist/{index-DpiTybDB.d.ts → index-DCO4mxiO.d.ts} +9 -7
- package/dist/index-DntDUXW1.d.ts +1 -0
- package/dist/index-x0_Y5uPV.d.ts +2 -0
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/{lezer-tree-iS7LpLBJ.d.ts → lezer-tree-BQZqBT5A.d.ts} +1 -2
- package/dist/library/diagnostics.d.ts +1 -1
- package/dist/library/diagnostics.js +1 -1
- package/dist/library/index.d.ts +2 -3
- package/dist/library/index.js +1 -1
- package/dist/library/oss-api.d.ts +11 -3
- package/dist/library/oss-api.js +45 -4
- package/dist/library/oss-api.js.map +1 -1
- package/dist/library/oss-layout-api.d.ts +0 -1
- package/dist/library/oss.d.ts +21 -16
- package/dist/library/oss.js +19 -13
- package/dist/library/oss.js.map +1 -1
- package/dist/library/rsengine.d.ts +6 -5
- package/dist/library/rsengine.js +1 -1
- package/dist/library/rsform-api/index.d.ts +1 -1
- package/dist/library/rsform-api/index.js +1 -1
- package/dist/library/rsform.d.ts +1 -1
- package/dist/library/rsmodel-api.d.ts +5 -5
- package/dist/library/rsmodel-api.js +3 -3
- package/dist/library/rsmodel-api.js.map +1 -1
- package/dist/library/rsmodel.d.ts +1 -1
- package/dist/library/structure-planner.d.ts +3 -3
- package/dist/library/structure-planner.js +1 -1
- package/dist/{parser-Bwd8LxJ1.d.ts → parser-DkejtiOR.d.ts} +1 -2
- package/dist/parsing/ast.d.ts +1 -1
- package/dist/parsing/index.d.ts +3 -2
- package/dist/parsing/lezer-tree.d.ts +1 -1
- package/dist/rslang/api.d.ts +2 -2
- package/dist/rslang/ast-annotations.d.ts +1 -1
- package/dist/rslang/eval/calculator.d.ts +1 -1
- package/dist/rslang/eval/evaluation-cache.d.ts +3 -3
- package/dist/rslang/eval/evaluator.d.ts +3 -3
- package/dist/rslang/eval/value-api.d.ts +1 -1
- package/dist/rslang/eval/value.d.ts +1 -1
- package/dist/rslang/index.d.ts +11 -10
- package/dist/rslang/labels.d.ts +3 -3
- package/dist/rslang/parser/expression-generator.d.ts +1 -1
- package/dist/rslang/parser/normalize.d.ts +2 -1
- package/dist/rslang/parser/parser.d.ts +1 -1
- package/dist/rslang/parser/parser.terms.d.ts +1 -40
- package/dist/rslang/parser/syntax-errors/index.d.ts +3 -3
- package/dist/rslang/semantic/analyzer.d.ts +1 -1
- package/dist/rslang/semantic/arguments-extractor.d.ts +1 -1
- package/dist/rslang/semantic/type-auditor.d.ts +3 -3
- package/dist/rslang/semantic/typification-api.d.ts +1 -2
- package/dist/rslang/semantic/typification-parser.d.ts +1 -1
- package/dist/rslang/semantic/typification.d.ts +1 -1
- package/dist/rslang/semantic/value-auditor.d.ts +2 -2
- package/dist/rslang/typification-graph.d.ts +1 -1
- package/dist/shared/index.d.ts +1 -0
- package/dist/{typification-graph-BY_oGT82.d.ts → typification-graph-CSxDt18X.d.ts} +2 -3
- package/dist/{typification-9lNu9R4k.d.ts → typification-hWUoWCba.d.ts} +2 -1
- package/dist/{typification-parser-Dytsv9CI.d.ts → typification-parser-DFxj4JiQ.d.ts} +2 -3
- package/dist/{value-BduA_ZGp.d.ts → value-XpJOVzMP.d.ts} +2 -1
- package/dist/{value-api-CXLl_zg0.d.ts → value-api-Dw8UkwCD.d.ts} +3 -4
- package/package.json +20 -21
- package/src/library/diagnostics.ts +16 -2
- package/src/library/oss-api.test.ts +100 -5
- package/src/library/oss-api.ts +71 -5
- package/src/library/oss.ts +22 -16
- package/src/library/rsmodel-api.test.ts +79 -0
- package/src/library/rsmodel-api.ts +3 -2
- package/dist/index-BKZ67WMa.d.ts +0 -1
- package/dist/index-BVVgDSdq.d.ts +0 -1
- package/dist/index-DmtQKWjk.d.ts +0 -1
- package/dist/index-_6s0AX1B.d.ts +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { t as AstNode } from "../ast-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { t as AstNode } from "../ast-D-D6Rq3T.js";
|
|
2
|
+
import "../index-D5RahF1K.js";
|
|
3
|
+
import { l as Value } from "../value-XpJOVzMP.js";
|
|
4
|
+
import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "../calculator-uPaTV3hc.js";
|
|
5
|
+
import "../index-CnuO4w8e.js";
|
|
6
|
+
import { S as RSForm, f as EvalStatus, l as BasicBinding, p as RSModel, u as BasicsContext, x as CstType } from "../diagnostics-DKyMf6q-.js";
|
|
6
7
|
//#region src/library/rsengine.d.ts
|
|
7
8
|
/** Services for {@link RSEngine}. */
|
|
8
9
|
interface RSEngineServices {
|
package/dist/library/rsengine.js
CHANGED
|
@@ -4,7 +4,7 @@ import { CstType } from "./rsform.js";
|
|
|
4
4
|
import { l as compare } from "../value-COprb2Je.js";
|
|
5
5
|
import { RSCalculator } from "../rslang/eval/calculator.js";
|
|
6
6
|
import "../rslang/index.js";
|
|
7
|
-
import { $ as isFunctional, P as getAnalysisFor, Q as isBasicConcept, Z as isBaseSet } from "../diagnostics-
|
|
7
|
+
import { $ as isFunctional, P as getAnalysisFor, Q as isBasicConcept, Z as isBaseSet } from "../diagnostics-D1Cp21nP.js";
|
|
8
8
|
import { TYPE_BASIC } from "./rsmodel.js";
|
|
9
9
|
import { inferEvalStatus, isInferrable, tryFixValue } from "./rsmodel-api.js";
|
|
10
10
|
//#region src/library/rsengine.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as removeAliasReference, A as canProduceStructure, B as filterAttributions, C as restoreConstituentOrder, D as inferTemplatedType, E as inferTemplate, F as isBasicConcept, G as MappableFields, H as remapAttributionsUnderSubstitution, I as isFunctional, J as applyMappingToConstituents, K as addAliasReference, L as isLogical, M as guessCstType, N as inferClass, O as normalizeExpression, P as isBaseSet, Q as maxAliasIndex, R as isTemplateCst, S as buildFormalDependencyGraph, T as inferStatus, U as getAnalysisFor, V as importAttributions, W as refineAnalysisForDependencyCycles, X as buildSequentialAliasMapping, Y as argumentValuesToMapping, Z as generateAlias, _ as findCstByStructure, a as buildDefinitionReferenceGraph, at as DiagnosticSourceFields, b as calculateSchemaStats, c as resolveConstituentTextChange, ct as SchemaIssueFields, d as SynthesizableFields, dt as SpawnPathFields, et as validateAliasFormat, f as inlineSynthesis, ft as StructureCapableFields, g as remapSubstitutionsAfterImport, h as applyConstituentSubstitutions, ht as TextResolvableFields, i as TextChangeOptions, it as DescribableFields, j as getCstTypePrefix, k as canHaveManualTypification, l as InlineSynthesisInput, lt as SearchableFields, m as SubstitutionResult, mt as TemplateSourceFields, n as moveIdsInOrder, nt as AliasTypedFields, o as buildTermReferenceGraph, ot as FormalOrderFields, p as sortItemsForInlineSynthesis, pt as TemplateParamSourceFields, q as allocateImportAliases, r as reorderItemsByIds, rt as BasicTextCheckFields, s as resolveAllConstituentTexts, st as ModelEvalFields, t as insertItemAfter, tt as validateNewAlias, u as InlineSynthesisResult, ut as SemanticRelations, v as getStructureName, w as applyFilterCategory, x as isSchemaIssue, y as inferNewSpawnPosition, z as typeClassForCstType } from "../../index-
|
|
1
|
+
import { $ as removeAliasReference, A as canProduceStructure, B as filterAttributions, C as restoreConstituentOrder, D as inferTemplatedType, E as inferTemplate, F as isBasicConcept, G as MappableFields, H as remapAttributionsUnderSubstitution, I as isFunctional, J as applyMappingToConstituents, K as addAliasReference, L as isLogical, M as guessCstType, N as inferClass, O as normalizeExpression, P as isBaseSet, Q as maxAliasIndex, R as isTemplateCst, S as buildFormalDependencyGraph, T as inferStatus, U as getAnalysisFor, V as importAttributions, W as refineAnalysisForDependencyCycles, X as buildSequentialAliasMapping, Y as argumentValuesToMapping, Z as generateAlias, _ as findCstByStructure, a as buildDefinitionReferenceGraph, at as DiagnosticSourceFields, b as calculateSchemaStats, c as resolveConstituentTextChange, ct as SchemaIssueFields, d as SynthesizableFields, dt as SpawnPathFields, et as validateAliasFormat, f as inlineSynthesis, ft as StructureCapableFields, g as remapSubstitutionsAfterImport, h as applyConstituentSubstitutions, ht as TextResolvableFields, i as TextChangeOptions, it as DescribableFields, j as getCstTypePrefix, k as canHaveManualTypification, l as InlineSynthesisInput, lt as SearchableFields, m as SubstitutionResult, mt as TemplateSourceFields, n as moveIdsInOrder, nt as AliasTypedFields, o as buildTermReferenceGraph, ot as FormalOrderFields, p as sortItemsForInlineSynthesis, pt as TemplateParamSourceFields, q as allocateImportAliases, r as reorderItemsByIds, rt as BasicTextCheckFields, s as resolveAllConstituentTexts, st as ModelEvalFields, t as insertItemAfter, tt as validateNewAlias, u as InlineSynthesisResult, ut as SemanticRelations, v as getStructureName, w as applyFilterCategory, x as isSchemaIssue, y as inferNewSpawnPosition, z as typeClassForCstType } from "../../index-DCO4mxiO.js";
|
|
2
2
|
export { type AliasTypedFields, type BasicTextCheckFields, type DescribableFields, type DiagnosticSourceFields, type FormalOrderFields, type InlineSynthesisInput, type InlineSynthesisResult, type MappableFields, type ModelEvalFields, type SchemaIssueFields, type SearchableFields, type SemanticRelations, type SpawnPathFields, type StructureCapableFields, type SubstitutionResult, type SynthesizableFields, type TemplateParamSourceFields, type TemplateSourceFields, type TextChangeOptions, type TextResolvableFields, addAliasReference, allocateImportAliases, applyConstituentSubstitutions, applyFilterCategory, applyMappingToConstituents, argumentValuesToMapping, buildDefinitionReferenceGraph, buildFormalDependencyGraph, buildSequentialAliasMapping, buildTermReferenceGraph, calculateSchemaStats, canHaveManualTypification, canProduceStructure, filterAttributions, findCstByStructure, generateAlias, getAnalysisFor, getCstTypePrefix, getStructureName, guessCstType, importAttributions, inferClass, inferNewSpawnPosition, inferStatus, inferTemplate, inferTemplatedType, inlineSynthesis, insertItemAfter, isBaseSet, isBasicConcept, isFunctional, isLogical, isSchemaIssue, isTemplateCst, maxAliasIndex, moveIdsInOrder, normalizeExpression, refineAnalysisForDependencyCycles, remapAttributionsUnderSubstitution, remapSubstitutionsAfterImport, removeAliasReference, reorderItemsByIds, resolveAllConstituentTexts, resolveConstituentTextChange, restoreConstituentOrder, sortItemsForInlineSynthesis, typeClassForCstType, validateAliasFormat, validateNewAlias };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as isFunctional, A as normalizeExpression, B as buildSequentialAliasMapping, C as isSchemaIssue, D as inferStatus, E as applyFilterCategory, F as refineAnalysisForDependencyCycles, G as validateNewAlias, H as maxAliasIndex, I as addAliasReference, J as getCstTypePrefix, K as canHaveManualTypification, L as allocateImportAliases, M as importAttributions, N as remapAttributionsUnderSubstitution, O as inferTemplate, P as getAnalysisFor, Q as isBasicConcept, R as applyMappingToConstituents, S as calculateSchemaStats, T as restoreConstituentOrder, U as removeAliasReference, V as generateAlias, W as validateAliasFormat, X as inferClass, Y as guessCstType, Z as isBaseSet, _ as applyConstituentSubstitutions, b as getStructureName, c as insertItemAfter, d as inlineSynthesis, et as isLogical, f as sortItemsForInlineSynthesis, g as resolveConstituentTextChange, h as resolveAllConstituentTexts, j as filterAttributions, k as inferTemplatedType, l as moveIdsInOrder, m as buildTermReferenceGraph, nt as typeClassForCstType, p as buildDefinitionReferenceGraph, q as canProduceStructure, tt as isTemplateCst, u as reorderItemsByIds, v as remapSubstitutionsAfterImport, w as buildFormalDependencyGraph, x as inferNewSpawnPosition, y as findCstByStructure, z as argumentValuesToMapping } from "../../diagnostics-
|
|
1
|
+
import { $ as isFunctional, A as normalizeExpression, B as buildSequentialAliasMapping, C as isSchemaIssue, D as inferStatus, E as applyFilterCategory, F as refineAnalysisForDependencyCycles, G as validateNewAlias, H as maxAliasIndex, I as addAliasReference, J as getCstTypePrefix, K as canHaveManualTypification, L as allocateImportAliases, M as importAttributions, N as remapAttributionsUnderSubstitution, O as inferTemplate, P as getAnalysisFor, Q as isBasicConcept, R as applyMappingToConstituents, S as calculateSchemaStats, T as restoreConstituentOrder, U as removeAliasReference, V as generateAlias, W as validateAliasFormat, X as inferClass, Y as guessCstType, Z as isBaseSet, _ as applyConstituentSubstitutions, b as getStructureName, c as insertItemAfter, d as inlineSynthesis, et as isLogical, f as sortItemsForInlineSynthesis, g as resolveConstituentTextChange, h as resolveAllConstituentTexts, j as filterAttributions, k as inferTemplatedType, l as moveIdsInOrder, m as buildTermReferenceGraph, nt as typeClassForCstType, p as buildDefinitionReferenceGraph, q as canProduceStructure, tt as isTemplateCst, u as reorderItemsByIds, v as remapSubstitutionsAfterImport, w as buildFormalDependencyGraph, x as inferNewSpawnPosition, y as findCstByStructure, z as argumentValuesToMapping } from "../../diagnostics-D1Cp21nP.js";
|
|
2
2
|
export { addAliasReference, allocateImportAliases, applyConstituentSubstitutions, applyFilterCategory, applyMappingToConstituents, argumentValuesToMapping, buildDefinitionReferenceGraph, buildFormalDependencyGraph, buildSequentialAliasMapping, buildTermReferenceGraph, calculateSchemaStats, canHaveManualTypification, canProduceStructure, filterAttributions, findCstByStructure, generateAlias, getAnalysisFor, getCstTypePrefix, getStructureName, guessCstType, importAttributions, inferClass, inferNewSpawnPosition, inferStatus, inferTemplate, inferTemplatedType, inlineSynthesis, insertItemAfter, isBaseSet, isBasicConcept, isFunctional, isLogical, isSchemaIssue, isTemplateCst, maxAliasIndex, moveIdsInOrder, normalizeExpression, refineAnalysisForDependencyCycles, remapAttributionsUnderSubstitution, remapSubstitutionsAfterImport, removeAliasReference, reorderItemsByIds, resolveAllConstituentTexts, resolveConstituentTextChange, restoreConstituentOrder, sortItemsForInlineSynthesis, typeClassForCstType, validateAliasFormat, validateNewAlias };
|
package/dist/library/rsform.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as RSFormStats, E as TypeInfo, S as RSForm, T as TermForm, _ as Attribution, b as CstStatus, g as ArgumentValue, v as Constituenta, w as Substitution, x as CstType, y as CstClass } from "../diagnostics-
|
|
1
|
+
import { C as RSFormStats, E as TypeInfo, S as RSForm, T as TermForm, _ as Attribution, b as CstStatus, g as ArgumentValue, v as Constituenta, w as Substitution, x as CstType, y as CstClass } from "../diagnostics-DKyMf6q-.js";
|
|
2
2
|
export { ArgumentValue, Attribution, Constituenta, CstClass, CstStatus, CstType, RSForm, RSFormStats, Substitution, TermForm, TypeInfo };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { b as Typification, f as ExpressionType } from "../typification-
|
|
2
|
-
import { d as ValuePath, l as Value } from "../value-
|
|
3
|
-
import
|
|
1
|
+
import { b as Typification, f as ExpressionType } from "../typification-hWUoWCba.js";
|
|
2
|
+
import { d as ValuePath, l as Value } from "../value-XpJOVzMP.js";
|
|
3
|
+
import "../index-CnuO4w8e.js";
|
|
4
|
+
import { S as RSForm, f as EvalStatus, l as BasicBinding, m as RSModelStats, x as CstType } from "../diagnostics-DKyMf6q-.js";
|
|
4
5
|
import { RSEngine } from "./rsengine.js";
|
|
5
|
-
import { st as ModelEvalFields } from "../index-
|
|
6
|
-
|
|
6
|
+
import { st as ModelEvalFields } from "../index-DCO4mxiO.js";
|
|
7
7
|
//#region src/library/rsmodel-api.d.ts
|
|
8
8
|
/** Evaluate if parsed data is a basic binding data. */
|
|
9
9
|
declare function validateBasicBindingData(data: unknown): data is Record<string, string>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TypeID } from "../rslang/semantic/typification.js";
|
|
2
2
|
import { CstType } from "./rsform.js";
|
|
3
|
-
import { O as setNestedValue, _ as extractValue, b as isTupleValue, f as tuple, l as compare, x as makeDefaultValue } from "../value-COprb2Je.js";
|
|
3
|
+
import { O as setNestedValue, _ as extractValue, b as isTupleValue, d as set, f as tuple, l as compare, x as makeDefaultValue } from "../value-COprb2Je.js";
|
|
4
4
|
import "../rslang/index.js";
|
|
5
|
-
import { Q as isBasicConcept, S as calculateSchemaStats, Z as isBaseSet, s as modelStatusCstDiagnostic } from "../diagnostics-
|
|
5
|
+
import { Q as isBasicConcept, S as calculateSchemaStats, Z as isBaseSet, s as modelStatusCstDiagnostic } from "../diagnostics-D1Cp21nP.js";
|
|
6
6
|
import { EvalStatus } from "./rsmodel.js";
|
|
7
7
|
//#region src/library/rsmodel-api.ts
|
|
8
8
|
const RANDOM_INTEGER_MIN = -100;
|
|
@@ -51,7 +51,7 @@ function generateRandomValue(type, basics, cstByAlias, setElementsCount = DEFAUL
|
|
|
51
51
|
if (sample === null) return null;
|
|
52
52
|
result.push(sample);
|
|
53
53
|
}
|
|
54
|
-
return result;
|
|
54
|
+
return set(result);
|
|
55
55
|
}
|
|
56
56
|
case TypeID.anyTypification: return null;
|
|
57
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsmodel-api.js","names":[],"sources":["../../src/library/rsmodel-api.ts"],"sourcesContent":["import { type ExpressionType, TypeID, type Typification, type Value } from '../rslang';\nimport { compare, tuple, TUPLE_ID, VALUE_TRUE, type ValuePath } from '../rslang/eval/value';\nimport { extractValue, isTupleValue, makeDefaultValue, setNestedValue } from '../rslang/eval/value-api';\nimport { type EchelonCollection } from '../rslang/semantic/typification';\n\nimport { modelStatusCstDiagnostic } from './diagnostics';\nimport { type RSEngine } from './rsengine';\nimport { CstType, type RSForm } from './rsform';\nimport { calculateSchemaStats, isBaseSet, isBasicConcept, type ModelEvalFields } from './rsform-api';\nimport { type BasicBinding, EvalStatus, type RSModelStats } from './rsmodel';\n\nconst RANDOM_INTEGER_MIN = -100;\nconst RANDOM_INTEGER_MAX = 100;\nconst DEFAULT_RANDOM_SET_ELEMENTS_COUNT = 5;\n\n/** Evaluate if parsed data is a basic binding data. */\nexport function validateBasicBindingData(data: unknown): data is Record<string, string> {\n if (!data || typeof data !== 'object' || Array.isArray(data)) {\n return false;\n }\n return Object.entries(data).every(([key, value]) => typeof value === 'string' && Number.isInteger(Number(key)));\n}\n\n/** Convert parsed data to a basic binding. */\nexport function toBasicBinding(data: Record<string | number, string>): BasicBinding {\n const result: BasicBinding = {};\n for (const [k, v] of Object.entries(data)) {\n result[Number(k)] = v;\n }\n return result;\n}\n\n/** Evaluate if parsed data is a {@link Value} data. */\nexport function validateValueData(data: unknown): data is Value {\n if (typeof data === 'number') {\n return Number.isFinite(data);\n }\n if (!Array.isArray(data)) {\n return false;\n }\n return data.every(item => validateValueData(item));\n}\n\nexport function generateRandomValue(\n type: Typification,\n basics: Map<number, BasicBinding>,\n cstByAlias: Map<string, { id: number }>,\n setElementsCount: number = DEFAULT_RANDOM_SET_ELEMENTS_COUNT\n): Value | null {\n switch (type.typeID) {\n case TypeID.integer:\n return Math.floor(Math.random() * (RANDOM_INTEGER_MAX - RANDOM_INTEGER_MIN + 1)) + RANDOM_INTEGER_MIN;\n case TypeID.basic: {\n const cst = cstByAlias.get(type.baseID);\n const binding = cst ? basics.get(cst.id) : undefined;\n const ids = Object.keys(binding ?? {}).map(Number);\n if (ids.length === 0) {\n return null;\n }\n return ids[Math.floor(Math.random() * ids.length)];\n }\n case TypeID.tuple: {\n const factors: Value[] = [];\n for (const factor of type.factors) {\n const sample = generateRandomValue(factor, basics, cstByAlias, setElementsCount);\n if (sample === null) {\n return null;\n }\n factors.push(sample);\n }\n return tuple(factors);\n }\n case TypeID.collection: {\n const result: Value[] = [];\n const randomElementsCount = Math.floor(Math.random() * (setElementsCount + 1));\n for (let i = 0; i < randomElementsCount; i++) {\n const sample = generateRandomValue(type.base, basics, cstByAlias, setElementsCount);\n if (sample === null) {\n return null;\n }\n result.push(sample);\n }\n return result;\n }\n case TypeID.anyTypification:\n return null;\n }\n}\n\n/** Calculate statistics for {@link RSModel}. */\nexport function calculateModelStats(schema: RSForm, engine: RSEngine, _engineGeneration?: number): RSModelStats {\n const items = schema.items;\n const statusByID = new Map<number, EvalStatus>();\n for (const cst of items) {\n statusByID.set(cst.id, engine.getCstStatus(cst.id));\n }\n return {\n ...calculateSchemaStats(schema),\n base_elements: items.reduce((sum, cst) => sum + countBaseElements(cst, engine), 0),\n count_missing_base: items.reduce(\n (sum, cst) => sum + (statusByID.get(cst.id) === EvalStatus.EMPTY && isBasicConcept(cst.cst_type) ? 1 : 0),\n 0\n ),\n count_false_axioms: items.reduce(\n (sum, cst) => sum + (statusByID.get(cst.id) === EvalStatus.AXIOM_FALSE ? 1 : 0),\n 0\n ),\n count_invalid_data: items.reduce(\n (sum, cst) => sum + (statusByID.get(cst.id) === EvalStatus.INVALID_DATA ? 1 : 0),\n 0\n ),\n count_invalid_calculations: items.reduce(\n (sum, cst) =>\n sum +\n (statusByID.get(cst.id) === EvalStatus.EVAL_FAIL || statusByID.get(cst.id) === EvalStatus.NOT_PROCESSED\n ? 1\n : 0),\n 0\n ),\n count_empty_terms: items.reduce(\n (sum, cst) => sum + (statusByID.get(cst.id) === EvalStatus.EMPTY && cst.cst_type === CstType.TERM ? 1 : 0),\n 0\n )\n };\n}\n\n/** Checks whether evaluation status contributes to model status issues. */\nexport function isModelIssue(engine: RSEngine, cst: ModelEvalFields): boolean {\n return modelStatusCstDiagnostic(engine.getCstStatus(cst.id), cst.cst_type) !== null;\n}\n\n/** Filters items whose evaluation status contributes to model issues. */\nexport function getEvalIssueItems(items: readonly ModelEvalFields[], engine: RSEngine): ModelEvalFields[] {\n return items.filter(cst => isModelIssue(engine, cst));\n}\n\n/** Evaluate if {@link CstType} is interpretable. */\nexport function isInterpretable(type: CstType): boolean {\n switch (type) {\n case CstType.BASE:\n case CstType.CONSTANT:\n case CstType.STRUCTURED:\n case CstType.AXIOM:\n case CstType.TERM:\n case CstType.STATEMENT:\n return true;\n\n case CstType.NOMINAL:\n case CstType.FUNCTION:\n case CstType.PREDICATE:\n return false;\n }\n}\n\n/** Evaluate if {@link CstType} is inferrable. */\nexport function isInferrable(type: CstType): boolean {\n switch (type) {\n case CstType.AXIOM:\n case CstType.STATEMENT:\n case CstType.TERM:\n return true;\n\n case CstType.NOMINAL:\n case CstType.BASE:\n case CstType.CONSTANT:\n case CstType.STRUCTURED:\n case CstType.FUNCTION:\n case CstType.PREDICATE:\n return false;\n }\n}\n\n/** Infers status of a given {@link Value} and {@link CstType}. */\nexport function inferEvalStatus(\n value: Value | null,\n cstType: CstType,\n wasCalculated: boolean = true,\n isInvalid: boolean = false\n): EvalStatus {\n if (isBaseSet(cstType) || cstType === CstType.STRUCTURED) {\n if (isInvalid) {\n return EvalStatus.INVALID_DATA;\n }\n if (value === null || (Array.isArray(value) && value.length === 0)) {\n return EvalStatus.EMPTY;\n }\n return EvalStatus.HAS_DATA;\n }\n if (!isInferrable(cstType)) {\n return EvalStatus.NO_EVAL;\n }\n if (!wasCalculated) {\n return EvalStatus.NOT_PROCESSED;\n }\n if (value === null) {\n return EvalStatus.EVAL_FAIL;\n }\n if (cstType === CstType.AXIOM && value !== VALUE_TRUE) {\n return EvalStatus.AXIOM_FALSE;\n }\n if (Array.isArray(value) && value.length === 0) {\n return EvalStatus.EMPTY;\n }\n return EvalStatus.HAS_DATA;\n}\n\n/** Tries to fix value removing invalid base elements not present in the target value.\n * returns null if no fixing is possible.\n * returns true if fixing was successful.\n * returns false if fixing was not needed.\n */\nexport function tryFixValue(\n value: Value,\n type: ExpressionType,\n targetAlias: string,\n targetValue: Value[]\n): boolean | null {\n switch (type.typeID) {\n case TypeID.integer:\n return false;\n case TypeID.basic:\n if (type.baseID !== targetAlias) {\n return false;\n }\n if (typeof value !== 'number') {\n return null;\n }\n if (!targetValue.includes(value)) {\n return null;\n }\n return false;\n case TypeID.tuple: {\n if (!isTupleValue(value)) {\n return null;\n }\n let wasChanged = false;\n for (let i = 0; i < type.factors.length; i++) {\n const componentChanged = tryFixValue(value[i + 1], type.factors[i], targetAlias, targetValue);\n if (componentChanged === null) {\n return null;\n }\n if (componentChanged) {\n wasChanged = true;\n }\n }\n return wasChanged;\n }\n case TypeID.collection:\n if (!Array.isArray(value) || (value.length > 1 && value[0] === TUPLE_ID)) {\n return null;\n }\n let wasChanged = false;\n const removeElements: Value[] = [];\n for (const item of value) {\n const elementChanged = tryFixValue(item, type.base, targetAlias, targetValue);\n if (elementChanged === null || elementChanged === true) {\n wasChanged = true;\n if (elementChanged === null) {\n removeElements.push(item);\n }\n }\n }\n for (const item of removeElements) {\n const index = value.indexOf(item);\n if (index !== -1) {\n value.splice(index, 1);\n }\n }\n if (wasChanged) {\n value.sort((a, b) => compare(a, b));\n let i = 1;\n while (i < value.length) {\n if (compare(value[i], value[i - 1]) === 0) {\n value.splice(i, 1);\n } else {\n i++;\n }\n }\n }\n return wasChanged;\n\n case TypeID.logic:\n case TypeID.anyTypification:\n case TypeID.predicate:\n case TypeID.function:\n return null;\n }\n}\n\nexport function updateValueElement(value: Value | null, path: ValuePath, newValue: number): Value | null {\n return setNestedValue(value, path, newValue);\n}\n\nexport function deleteValueElement(\n value: Value | null,\n path: ValuePath,\n type: Typification,\n target: number\n): Value | null {\n if (value === null) {\n return null;\n }\n if (path.length === 0 && type.typeID !== TypeID.collection) {\n return null;\n }\n\n const arrayValue = extractValue(value, path);\n if (!Array.isArray(arrayValue)) {\n return null;\n }\n const updatedArray = [...arrayValue.slice(0, target), ...arrayValue.slice(target + 1)];\n return setNestedValue(value, path, updatedArray);\n}\n\nexport function addValueElement(\n value: Value | null,\n path: ValuePath,\n type: Typification,\n currentType: Typification\n): Value | null {\n if (path.length === 0 && type.typeID !== TypeID.collection) {\n return makeDefaultValue(type);\n }\n\n const newElem = makeDefaultValue((currentType as EchelonCollection).base);\n const arrayValue = (extractValue(value!, path) as Value[] | null) ?? [];\n const updatedArray = [newElem, ...arrayValue];\n return setNestedValue(value, path, updatedArray);\n}\n\n// ========= Internal functions ==========\n\nfunction countBaseElements(cst: ModelEvalFields, engine: RSEngine): number {\n if (!isBasicConcept(cst.cst_type)) {\n return 0;\n }\n const value = engine.getCstValue(cst.id);\n if (value === null) {\n return 0;\n }\n if (!Array.isArray(value) || value[0] === TUPLE_ID) {\n return 1;\n }\n return value.length;\n}\n"],"mappings":";;;;;;;AAWA,MAAM,qBAAqB;AAE3B,MAAM,oCAAoC;;AAG1C,SAAgB,yBAAyB,MAA+C;CACtF,IAAI,CAAC,QAAQ,OAAO,SAAS,YAAY,MAAM,QAAQ,IAAI,GACzD,OAAO;CAET,OAAO,OAAO,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,WAAW,OAAO,UAAU,YAAY,OAAO,UAAU,OAAO,GAAG,CAAC,CAAC;AAChH;;AAGA,SAAgB,eAAe,MAAqD;CAClF,MAAM,SAAuB,CAAC;CAC9B,KAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,IAAI,GACtC,OAAO,OAAO,CAAC,KAAK;CAEtB,OAAO;AACT;;AAGA,SAAgB,kBAAkB,MAA8B;CAC9D,IAAI,OAAO,SAAS,UAClB,OAAO,OAAO,SAAS,IAAI;CAE7B,IAAI,CAAC,MAAM,QAAQ,IAAI,GACrB,OAAO;CAET,OAAO,KAAK,OAAM,SAAQ,kBAAkB,IAAI,CAAC;AACnD;AAEA,SAAgB,oBACd,MACA,QACA,YACA,mBAA2B,m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AO,YAC9C,OAAO,iBAAiB,IAAI;CAM9B,OAAO,eAAe,OAAO,MAAM,CAHnB,iBAAkB,YAAkC,IAE9C,GAAS,GADX,aAAa,OAAQ,IAAI,KAAwB,CAAC,CAEnC,CAAY;AACjD;AAIA,SAAS,kBAAkB,KAAsB,QAA0B;CACzE,IAAI,CAAC,eAAe,IAAI,QAAQ,GAC9B,OAAO;CAET,MAAM,QAAQ,OAAO,YAAY,IAAI,EAAE;CACvC,IAAI,UAAU,MACZ,OAAO;CAET,IAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAA,MACjC,OAAO;CAET,OAAO,MAAM;AACf"}
|
|
1
|
+
{"version":3,"file":"rsmodel-api.js","names":[],"sources":["../../src/library/rsmodel-api.ts"],"sourcesContent":["import { type ExpressionType, TypeID, type Typification, type Value } from '../rslang';\nimport { compare, set, tuple, TUPLE_ID, VALUE_TRUE, type ValuePath } from '../rslang/eval/value';\nimport { extractValue, isTupleValue, makeDefaultValue, setNestedValue } from '../rslang/eval/value-api';\nimport { type EchelonCollection } from '../rslang/semantic/typification';\n\nimport { modelStatusCstDiagnostic } from './diagnostics';\nimport { type RSEngine } from './rsengine';\nimport { CstType, type RSForm } from './rsform';\nimport { calculateSchemaStats, isBaseSet, isBasicConcept, type ModelEvalFields } from './rsform-api';\nimport { type BasicBinding, EvalStatus, type RSModelStats } from './rsmodel';\n\nconst RANDOM_INTEGER_MIN = -100;\nconst RANDOM_INTEGER_MAX = 100;\nconst DEFAULT_RANDOM_SET_ELEMENTS_COUNT = 5;\n\n/** Evaluate if parsed data is a basic binding data. */\nexport function validateBasicBindingData(data: unknown): data is Record<string, string> {\n if (!data || typeof data !== 'object' || Array.isArray(data)) {\n return false;\n }\n return Object.entries(data).every(([key, value]) => typeof value === 'string' && Number.isInteger(Number(key)));\n}\n\n/** Convert parsed data to a basic binding. */\nexport function toBasicBinding(data: Record<string | number, string>): BasicBinding {\n const result: BasicBinding = {};\n for (const [k, v] of Object.entries(data)) {\n result[Number(k)] = v;\n }\n return result;\n}\n\n/** Evaluate if parsed data is a {@link Value} data. */\nexport function validateValueData(data: unknown): data is Value {\n if (typeof data === 'number') {\n return Number.isFinite(data);\n }\n if (!Array.isArray(data)) {\n return false;\n }\n return data.every(item => validateValueData(item));\n}\n\nexport function generateRandomValue(\n type: Typification,\n basics: Map<number, BasicBinding>,\n cstByAlias: Map<string, { id: number }>,\n setElementsCount: number = DEFAULT_RANDOM_SET_ELEMENTS_COUNT\n): Value | null {\n switch (type.typeID) {\n case TypeID.integer:\n return Math.floor(Math.random() * (RANDOM_INTEGER_MAX - RANDOM_INTEGER_MIN + 1)) + RANDOM_INTEGER_MIN;\n case TypeID.basic: {\n const cst = cstByAlias.get(type.baseID);\n const binding = cst ? basics.get(cst.id) : undefined;\n const ids = Object.keys(binding ?? {}).map(Number);\n if (ids.length === 0) {\n return null;\n }\n return ids[Math.floor(Math.random() * ids.length)];\n }\n case TypeID.tuple: {\n const factors: Value[] = [];\n for (const factor of type.factors) {\n const sample = generateRandomValue(factor, basics, cstByAlias, setElementsCount);\n if (sample === null) {\n return null;\n }\n factors.push(sample);\n }\n return tuple(factors);\n }\n case TypeID.collection: {\n const result: Value[] = [];\n const randomElementsCount = Math.floor(Math.random() * (setElementsCount + 1));\n for (let i = 0; i < randomElementsCount; i++) {\n const sample = generateRandomValue(type.base, basics, cstByAlias, setElementsCount);\n if (sample === null) {\n return null;\n }\n result.push(sample);\n }\n // Sets must be unique; sampling with replacement can produce duplicates.\n return set(result);\n }\n case TypeID.anyTypification:\n return null;\n }\n}\n\n/** Calculate statistics for {@link RSModel}. */\nexport function calculateModelStats(schema: RSForm, engine: RSEngine, _engineGeneration?: number): RSModelStats {\n const items = schema.items;\n const statusByID = new Map<number, EvalStatus>();\n for (const cst of items) {\n statusByID.set(cst.id, engine.getCstStatus(cst.id));\n }\n return {\n ...calculateSchemaStats(schema),\n base_elements: items.reduce((sum, cst) => sum + countBaseElements(cst, engine), 0),\n count_missing_base: items.reduce(\n (sum, cst) => sum + (statusByID.get(cst.id) === EvalStatus.EMPTY && isBasicConcept(cst.cst_type) ? 1 : 0),\n 0\n ),\n count_false_axioms: items.reduce(\n (sum, cst) => sum + (statusByID.get(cst.id) === EvalStatus.AXIOM_FALSE ? 1 : 0),\n 0\n ),\n count_invalid_data: items.reduce(\n (sum, cst) => sum + (statusByID.get(cst.id) === EvalStatus.INVALID_DATA ? 1 : 0),\n 0\n ),\n count_invalid_calculations: items.reduce(\n (sum, cst) =>\n sum +\n (statusByID.get(cst.id) === EvalStatus.EVAL_FAIL || statusByID.get(cst.id) === EvalStatus.NOT_PROCESSED\n ? 1\n : 0),\n 0\n ),\n count_empty_terms: items.reduce(\n (sum, cst) => sum + (statusByID.get(cst.id) === EvalStatus.EMPTY && cst.cst_type === CstType.TERM ? 1 : 0),\n 0\n )\n };\n}\n\n/** Checks whether evaluation status contributes to model status issues. */\nexport function isModelIssue(engine: RSEngine, cst: ModelEvalFields): boolean {\n return modelStatusCstDiagnostic(engine.getCstStatus(cst.id), cst.cst_type) !== null;\n}\n\n/** Filters items whose evaluation status contributes to model issues. */\nexport function getEvalIssueItems(items: readonly ModelEvalFields[], engine: RSEngine): ModelEvalFields[] {\n return items.filter(cst => isModelIssue(engine, cst));\n}\n\n/** Evaluate if {@link CstType} is interpretable. */\nexport function isInterpretable(type: CstType): boolean {\n switch (type) {\n case CstType.BASE:\n case CstType.CONSTANT:\n case CstType.STRUCTURED:\n case CstType.AXIOM:\n case CstType.TERM:\n case CstType.STATEMENT:\n return true;\n\n case CstType.NOMINAL:\n case CstType.FUNCTION:\n case CstType.PREDICATE:\n return false;\n }\n}\n\n/** Evaluate if {@link CstType} is inferrable. */\nexport function isInferrable(type: CstType): boolean {\n switch (type) {\n case CstType.AXIOM:\n case CstType.STATEMENT:\n case CstType.TERM:\n return true;\n\n case CstType.NOMINAL:\n case CstType.BASE:\n case CstType.CONSTANT:\n case CstType.STRUCTURED:\n case CstType.FUNCTION:\n case CstType.PREDICATE:\n return false;\n }\n}\n\n/** Infers status of a given {@link Value} and {@link CstType}. */\nexport function inferEvalStatus(\n value: Value | null,\n cstType: CstType,\n wasCalculated: boolean = true,\n isInvalid: boolean = false\n): EvalStatus {\n if (isBaseSet(cstType) || cstType === CstType.STRUCTURED) {\n if (isInvalid) {\n return EvalStatus.INVALID_DATA;\n }\n if (value === null || (Array.isArray(value) && value.length === 0)) {\n return EvalStatus.EMPTY;\n }\n return EvalStatus.HAS_DATA;\n }\n if (!isInferrable(cstType)) {\n return EvalStatus.NO_EVAL;\n }\n if (!wasCalculated) {\n return EvalStatus.NOT_PROCESSED;\n }\n if (value === null) {\n return EvalStatus.EVAL_FAIL;\n }\n if (cstType === CstType.AXIOM && value !== VALUE_TRUE) {\n return EvalStatus.AXIOM_FALSE;\n }\n if (Array.isArray(value) && value.length === 0) {\n return EvalStatus.EMPTY;\n }\n return EvalStatus.HAS_DATA;\n}\n\n/** Tries to fix value removing invalid base elements not present in the target value.\n * returns null if no fixing is possible.\n * returns true if fixing was successful.\n * returns false if fixing was not needed.\n */\nexport function tryFixValue(\n value: Value,\n type: ExpressionType,\n targetAlias: string,\n targetValue: Value[]\n): boolean | null {\n switch (type.typeID) {\n case TypeID.integer:\n return false;\n case TypeID.basic:\n if (type.baseID !== targetAlias) {\n return false;\n }\n if (typeof value !== 'number') {\n return null;\n }\n if (!targetValue.includes(value)) {\n return null;\n }\n return false;\n case TypeID.tuple: {\n if (!isTupleValue(value)) {\n return null;\n }\n let wasChanged = false;\n for (let i = 0; i < type.factors.length; i++) {\n const componentChanged = tryFixValue(value[i + 1], type.factors[i], targetAlias, targetValue);\n if (componentChanged === null) {\n return null;\n }\n if (componentChanged) {\n wasChanged = true;\n }\n }\n return wasChanged;\n }\n case TypeID.collection:\n if (!Array.isArray(value) || (value.length > 1 && value[0] === TUPLE_ID)) {\n return null;\n }\n let wasChanged = false;\n const removeElements: Value[] = [];\n for (const item of value) {\n const elementChanged = tryFixValue(item, type.base, targetAlias, targetValue);\n if (elementChanged === null || elementChanged === true) {\n wasChanged = true;\n if (elementChanged === null) {\n removeElements.push(item);\n }\n }\n }\n for (const item of removeElements) {\n const index = value.indexOf(item);\n if (index !== -1) {\n value.splice(index, 1);\n }\n }\n if (wasChanged) {\n value.sort((a, b) => compare(a, b));\n let i = 1;\n while (i < value.length) {\n if (compare(value[i], value[i - 1]) === 0) {\n value.splice(i, 1);\n } else {\n i++;\n }\n }\n }\n return wasChanged;\n\n case TypeID.logic:\n case TypeID.anyTypification:\n case TypeID.predicate:\n case TypeID.function:\n return null;\n }\n}\n\nexport function updateValueElement(value: Value | null, path: ValuePath, newValue: number): Value | null {\n return setNestedValue(value, path, newValue);\n}\n\nexport function deleteValueElement(\n value: Value | null,\n path: ValuePath,\n type: Typification,\n target: number\n): Value | null {\n if (value === null) {\n return null;\n }\n if (path.length === 0 && type.typeID !== TypeID.collection) {\n return null;\n }\n\n const arrayValue = extractValue(value, path);\n if (!Array.isArray(arrayValue)) {\n return null;\n }\n const updatedArray = [...arrayValue.slice(0, target), ...arrayValue.slice(target + 1)];\n return setNestedValue(value, path, updatedArray);\n}\n\nexport function addValueElement(\n value: Value | null,\n path: ValuePath,\n type: Typification,\n currentType: Typification\n): Value | null {\n if (path.length === 0 && type.typeID !== TypeID.collection) {\n return makeDefaultValue(type);\n }\n\n const newElem = makeDefaultValue((currentType as EchelonCollection).base);\n const arrayValue = (extractValue(value!, path) as Value[] | null) ?? [];\n const updatedArray = [newElem, ...arrayValue];\n return setNestedValue(value, path, updatedArray);\n}\n\n// ========= Internal functions ==========\n\nfunction countBaseElements(cst: ModelEvalFields, engine: RSEngine): number {\n if (!isBasicConcept(cst.cst_type)) {\n return 0;\n }\n const value = engine.getCstValue(cst.id);\n if (value === null) {\n return 0;\n }\n if (!Array.isArray(value) || value[0] === TUPLE_ID) {\n return 1;\n }\n return value.length;\n}\n"],"mappings":";;;;;;;AAWA,MAAM,qBAAqB;AAE3B,MAAM,oCAAoC;;AAG1C,SAAgB,y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AC;SAEjB;GAGN;GACA,OAAO;EAET,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,OAAO,UACV,OAAO;CACX;AACF;AAEA,SAAgB,mBAAmB,OAAqB,MAAiB,UAAgC;CACvG,OAAO,eAAe,OAAO,MAAM,QAAQ;AAC7C;AAEA,SAAgB,mBACd,OACA,MACA,MACA,QACc;CACd,IAAI,UAAU,MACZ,OAAO;CAET,IAAI,KAAK,WAAW,KAAK,KAAK,WAAW,OAAO,YAC9C,OAAO;CAGT,MAAM,aAAa,aAAa,OAAO,IAAI;CAC3C,IAAI,CAAC,MAAM,QAAQ,UAAU,GAC3B,OAAO;CAGT,OAAO,eAAe,OAAO,MAAM,CADb,GAAG,WAAW,MAAM,GAAG,MAAM,GAAG,GAAG,WAAW,MAAM,SAAS,CAAC,CACjD,CAAY;AACjD;AAEA,SAAgB,gBACd,OACA,MACA,MACA,aACc;CACd,IAAI,KAAK,WAAW,KAAK,KAAK,WAAW,OAAO,YAC9C,OAAO,iBAAiB,IAAI;CAM9B,OAAO,eAAe,OAAO,MAAM,CAHnB,iBAAkB,YAAkC,IAE9C,GAAS,GADX,aAAa,OAAQ,IAAI,KAAwB,CAAC,CAEnC,CAAY;AACjD;AAIA,SAAS,kBAAkB,KAAsB,QAA0B;CACzE,IAAI,CAAC,eAAe,IAAI,QAAQ,GAC9B,OAAO;CAET,MAAM,QAAQ,OAAO,YAAY,IAAI,EAAE;CACvC,IAAI,UAAU,MACZ,OAAO;CAET,IAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAA,MACjC,OAAO;CAET,OAAO,MAAM;AACf"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { d as DEFAULT_VALUE_TEXT, f as EvalStatus, h as TYPE_BASIC, l as BasicBinding, m as RSModelStats, p as RSModel, u as BasicsContext } from "../diagnostics-
|
|
1
|
+
import { d as DEFAULT_VALUE_TEXT, f as EvalStatus, h as TYPE_BASIC, l as BasicBinding, m as RSModelStats, p as RSModel, u as BasicsContext } from "../diagnostics-DKyMf6q-.js";
|
|
2
2
|
export { BasicBinding, BasicsContext, DEFAULT_VALUE_TEXT, EvalStatus, RSModel, RSModelStats, TYPE_BASIC };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as Typification, y as TypePath } from "../typification-
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { b as Typification, y as TypePath } from "../typification-hWUoWCba.js";
|
|
2
|
+
import "../index-CnuO4w8e.js";
|
|
3
|
+
import { S as RSForm, v as Constituenta } from "../diagnostics-DKyMf6q-.js";
|
|
4
4
|
//#region src/library/structure-planner.d.ts
|
|
5
5
|
/** Represents a node in the structure planner. */
|
|
6
6
|
interface SPNode {
|
|
@@ -3,7 +3,7 @@ import { labelType } from "../rslang/labels.js";
|
|
|
3
3
|
import { splitTemplateDefinition } from "../rslang/api.js";
|
|
4
4
|
import { CstType } from "./rsform.js";
|
|
5
5
|
import "../rslang/index.js";
|
|
6
|
-
import { y as findCstByStructure } from "../diagnostics-
|
|
6
|
+
import { y as findCstByStructure } from "../diagnostics-D1Cp21nP.js";
|
|
7
7
|
//#region src/library/structure-planner.ts
|
|
8
8
|
/** Structure planner for {@link Constituenta}. */
|
|
9
9
|
var StructurePlanner = class {
|
package/dist/parsing/ast.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TOKEN_ERROR, c as flattenAst, d as printAst, f as visitAstDFS, i as FlatAstNode, l as getNodeIndices, n as AstNodeBase, o as buildTree, r as FlatAST, s as findByUid, t as AstNode, u as getNodeText } from "../ast-
|
|
1
|
+
import { a as TOKEN_ERROR, c as flattenAst, d as printAst, f as visitAstDFS, i as FlatAstNode, l as getNodeIndices, n as AstNodeBase, o as buildTree, r as FlatAST, s as findByUid, t as AstNode, u as getNodeText } from "../ast-D-D6Rq3T.js";
|
|
2
2
|
export { AstNode, AstNodeBase, FlatAST, FlatAstNode, TOKEN_ERROR, buildTree, findByUid, flattenAst, getNodeIndices, getNodeText, printAst, visitAstDFS };
|
package/dist/parsing/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { r as printTree, t as CMSyntaxNode } from "../lezer-tree-
|
|
2
|
-
import { a as TOKEN_ERROR, c as flattenAst, d as printAst, f as visitAstDFS, i as FlatAstNode, l as getNodeIndices, n as AstNodeBase, o as buildTree, r as FlatAST, s as findByUid, t as AstNode, u as getNodeText } from "../ast-
|
|
1
|
+
import { r as printTree, t as CMSyntaxNode } from "../lezer-tree-BQZqBT5A.js";
|
|
2
|
+
import { a as TOKEN_ERROR, c as flattenAst, d as printAst, f as visitAstDFS, i as FlatAstNode, l as getNodeIndices, n as AstNodeBase, o as buildTree, r as FlatAST, s as findByUid, t as AstNode, u as getNodeText } from "../ast-D-D6Rq3T.js";
|
|
3
|
+
import "../index-D5RahF1K.js";
|
|
3
4
|
export { type AstNode, type AstNodeBase, type CMSyntaxNode, type FlatAST, type FlatAstNode, TOKEN_ERROR, buildTree, findByUid, flattenAst, getNodeIndices, getNodeText, printAst, printTree, visitAstDFS };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TreeCursor, r as printTree, t as CMSyntaxNode } from "../lezer-tree-
|
|
1
|
+
import { n as TreeCursor, r as printTree, t as CMSyntaxNode } from "../lezer-tree-BQZqBT5A.js";
|
|
2
2
|
export { CMSyntaxNode, type TreeCursor, printTree };
|
package/dist/rslang/api.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as generateExpressionFromAst } from "../expression-generator-
|
|
2
|
-
import { a as extractGlobals, c as isSimpleExpression, d as substituteLocalAliases, f as substituteTemplateArgs, i as extractArguments, l as parseRSLangExpression, n as applyAliasMapping, o as isGlobalAlias, r as applyTypificationMapping, s as isSetTypification, t as AliasMapping, u as splitTemplateDefinition } from "../api-
|
|
1
|
+
import { t as generateExpressionFromAst } from "../expression-generator-CADzBw-C.js";
|
|
2
|
+
import { a as extractGlobals, c as isSimpleExpression, d as substituteLocalAliases, f as substituteTemplateArgs, i as extractArguments, l as parseRSLangExpression, n as applyAliasMapping, o as isGlobalAlias, r as applyTypificationMapping, s as isSetTypification, t as AliasMapping, u as splitTemplateDefinition } from "../api-DgecYHjR.js";
|
|
3
3
|
export { AliasMapping, applyAliasMapping, applyTypificationMapping, extractArguments, extractGlobals, generateExpressionFromAst, isGlobalAlias, isSetTypification, isSimpleExpression, parseRSLangExpression, splitTemplateDefinition, substituteLocalAliases, substituteTemplateArgs };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as readTypeAnnotation, n as annotateType, r as readErrorAnnotation, t as annotateError } from "../ast-annotations-
|
|
1
|
+
import { i as readTypeAnnotation, n as annotateType, r as readErrorAnnotation, t as annotateError } from "../ast-annotations-x4PJ_Lhc.js";
|
|
2
2
|
export { annotateError, annotateType, readErrorAnnotation, readTypeAnnotation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "../../calculator-
|
|
1
|
+
import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "../../calculator-uPaTV3hc.js";
|
|
2
2
|
export { CalculatorEvaluateOptions, CalculatorResult, RSCalculator };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as AstNode } from "../../ast-
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { t as AstNode } from "../../ast-D-D6Rq3T.js";
|
|
2
|
+
import "../../index-D5RahF1K.js";
|
|
3
|
+
import { l as Value } from "../../value-XpJOVzMP.js";
|
|
4
4
|
//#region src/rslang/eval/evaluation-cache.d.ts
|
|
5
5
|
/** Static metadata for one AST node. */
|
|
6
6
|
interface EvalNodeInfo {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as AstNode } from "../../ast-
|
|
1
|
+
import { t as AstNode } from "../../ast-D-D6Rq3T.js";
|
|
2
|
+
import "../../index-D5RahF1K.js";
|
|
2
3
|
import { t as ErrorReporter } from "../../error-B0EkIx4K.js";
|
|
3
|
-
import { l as Value, u as ValueContext } from "../../value-
|
|
4
|
-
|
|
4
|
+
import { l as Value, u as ValueContext } from "../../value-XpJOVzMP.js";
|
|
5
5
|
//#region src/rslang/eval/evaluator.d.ts
|
|
6
6
|
/** AST context. */
|
|
7
7
|
type ASTContext = Map<string, AstNode>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as setSymDiff, a as extractValue, b as validateValue, c as isTupleValue, d as printValue, f as projection, g as setNestedValue, h as setIntersection, i as convertPathToType, l as makeDefaultValue, m as setDiff, n as cartesianProduct, o as isSetValue, p as reduce, r as contains, s as isSubsetOrEq, t as boolean, u as normalizeValue, v as setUnion, x as valueStub, y as testInvalid } from "../../value-api-
|
|
1
|
+
import { _ as setSymDiff, a as extractValue, b as validateValue, c as isTupleValue, d as printValue, f as projection, g as setNestedValue, h as setIntersection, i as convertPathToType, l as makeDefaultValue, m as setDiff, n as cartesianProduct, o as isSetValue, p as reduce, r as contains, s as isSubsetOrEq, t as boolean, u as normalizeValue, v as setUnion, x as valueStub, y as testInvalid } from "../../value-api-Dw8UkwCD.js";
|
|
2
2
|
export { boolean, cartesianProduct, contains, convertPathToType, extractValue, isSetValue, isSubsetOrEq, isTupleValue, makeDefaultValue, normalizeValue, printValue, projection, reduce, setDiff, setIntersection, setNestedValue, setSymDiff, setUnion, testInvalid, validateValue, valueStub };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SET_INFINITY, c as VALUE_TRUE, d as ValuePath, f as compare, h as tuple, i as INVALID_ELEMENT, l as Value, m as set, n as CalcInvalidDataError, o as TUPLE_ID, p as makeValuePath, r as EmptySetV, s as VALUE_FALSE, t as BOOL_INFINITY, u as ValueContext } from "../../value-
|
|
1
|
+
import { a as SET_INFINITY, c as VALUE_TRUE, d as ValuePath, f as compare, h as tuple, i as INVALID_ELEMENT, l as Value, m as set, n as CalcInvalidDataError, o as TUPLE_ID, p as makeValuePath, r as EmptySetV, s as VALUE_FALSE, t as BOOL_INFINITY, u as ValueContext } from "../../value-XpJOVzMP.js";
|
|
2
2
|
export { BOOL_INFINITY, CalcInvalidDataError, EmptySetV, INVALID_ELEMENT, SET_INFINITY, TUPLE_ID, VALUE_FALSE, VALUE_TRUE, Value, ValueContext, ValuePath, compare, makeValuePath, set, tuple };
|
package/dist/rslang/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { A as makeTypePath, b as Typification, d as EmptySetT, f as ExpressionType, g as TypeClass, m as LogicT, t as AnyTypificationT, v as TypeID, y as TypePath } from "../typification-
|
|
1
|
+
import { A as makeTypePath, b as Typification, d as EmptySetT, f as ExpressionType, g as TypeClass, m as LogicT, t as AnyTypificationT, v as TypeID, y as TypePath } from "../typification-hWUoWCba.js";
|
|
2
2
|
import { i as RSErrorDescription, r as RSErrorCode } from "../error-B0EkIx4K.js";
|
|
3
|
-
import { i as readTypeAnnotation, r as readErrorAnnotation } from "../ast-annotations-
|
|
4
|
-
import { d as ValuePath, l as Value, p as makeValuePath } from "../value-
|
|
5
|
-
import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "../calculator-
|
|
6
|
-
import { d as printValue } from "../value-api-
|
|
7
|
-
import { t as parser } from "../parser-
|
|
3
|
+
import { i as readTypeAnnotation, r as readErrorAnnotation } from "../ast-annotations-x4PJ_Lhc.js";
|
|
4
|
+
import { d as ValuePath, l as Value, p as makeValuePath } from "../value-XpJOVzMP.js";
|
|
5
|
+
import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "../calculator-uPaTV3hc.js";
|
|
6
|
+
import { d as printValue } from "../value-api-Dw8UkwCD.js";
|
|
7
|
+
import { t as parser } from "../parser-DkejtiOR.js";
|
|
8
8
|
import { t as TokenID } from "../token-DeXAmzwr.js";
|
|
9
9
|
import { t as ValueClass } from "../value-class-CNI-lqXJ.js";
|
|
10
|
-
import { a as RSLangAnalyzer, n as AnalysisFast, r as AnalysisFull, t as AnalysisBase } from "../analyzer-
|
|
11
|
-
import { n as ArgumentsType } from "../arguments-extractor-
|
|
12
|
-
import { n as applyAsciiTypeSubstitutions, r as parseTypeText } from "../typification-parser-
|
|
13
|
-
import { n as TypificationNodeData, t as TypificationGraph } from "../typification-graph-
|
|
10
|
+
import { a as RSLangAnalyzer, n as AnalysisFast, r as AnalysisFull, t as AnalysisBase } from "../analyzer-CzFaWR7w.js";
|
|
11
|
+
import { n as ArgumentsType } from "../arguments-extractor-CXWRT5Ou.js";
|
|
12
|
+
import { n as applyAsciiTypeSubstitutions, r as parseTypeText } from "../typification-parser-DFxj4JiQ.js";
|
|
13
|
+
import { n as TypificationNodeData, t as TypificationGraph } from "../typification-graph-CSxDt18X.js";
|
|
14
|
+
import "../index-CnuO4w8e.js";
|
|
14
15
|
export { type AnalysisBase, type AnalysisFast, type AnalysisFull, AnyTypificationT, type ArgumentsType, type CalculatorEvaluateOptions, type CalculatorResult, EmptySetT, type ExpressionType, LogicT, RSCalculator, RSErrorCode, type RSErrorDescription, RSLangAnalyzer, TokenID, TypeClass, TypeID, type TypePath, type Typification, TypificationGraph, type TypificationNodeData, type Value, ValueClass, type ValuePath, applyAsciiTypeSubstitutions, makeTypePath, makeValuePath, parseTypeText, printValue, readErrorAnnotation, readTypeAnnotation, parser as rslangParser };
|
package/dist/rslang/labels.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as AstNodeBase } from "../ast-
|
|
2
|
-
import
|
|
1
|
+
import { n as AstNodeBase } from "../ast-D-D6Rq3T.js";
|
|
2
|
+
import "../index-D5RahF1K.js";
|
|
3
|
+
import { f as ExpressionType } from "../typification-hWUoWCba.js";
|
|
3
4
|
import { t as TokenID } from "../token-DeXAmzwr.js";
|
|
4
|
-
|
|
5
5
|
//#region src/rslang/labels.d.ts
|
|
6
6
|
/** Retrieves label for {@link TokenID}. */
|
|
7
7
|
declare function labelToken(id: TokenID): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as generateExpressionFromAst } from "../../expression-generator-
|
|
1
|
+
import { t as generateExpressionFromAst } from "../../expression-generator-CADzBw-C.js";
|
|
2
2
|
export { generateExpressionFromAst };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { t as AstNode } from "../../ast-
|
|
1
|
+
import { t as AstNode } from "../../ast-D-D6Rq3T.js";
|
|
2
|
+
import "../../index-D5RahF1K.js";
|
|
2
3
|
//#region src/rslang/parser/normalize.d.ts
|
|
3
4
|
/** Normalizes AST to a simple form. */
|
|
4
5
|
declare function normalizeAST(ast: AstNode, input: string): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as parser } from "../../parser-
|
|
1
|
+
import { t as parser } from "../../parser-DkejtiOR.js";
|
|
2
2
|
export { parser };
|
|
@@ -1,44 +1,5 @@
|
|
|
1
1
|
//#region src/rslang/parser/parser.terms.d.ts
|
|
2
|
-
declare const Expression = 1,
|
|
3
|
-
Logic = 2,
|
|
4
|
-
Logic_predicates = 3,
|
|
5
|
-
Variable = 4,
|
|
6
|
-
Local = 5,
|
|
7
|
-
Tuple = 8,
|
|
8
|
-
Expr_enum_min2 = 9,
|
|
9
|
-
Logic_unary = 24,
|
|
10
|
-
Predicate = 26,
|
|
11
|
-
Logic_quantor = 29,
|
|
12
|
-
Variable_pack = 31,
|
|
13
|
-
Logic_binary = 33,
|
|
14
|
-
Setexpr = 38,
|
|
15
|
-
Integer = 39,
|
|
16
|
-
EmptySet = 40,
|
|
17
|
-
IntegerSet = 41,
|
|
18
|
-
Global = 42,
|
|
19
|
-
Radical = 43,
|
|
20
|
-
Setexpr_binary = 44,
|
|
21
|
-
Enumeration = 55,
|
|
22
|
-
Boolean = 56,
|
|
23
|
-
Filter_expression = 58,
|
|
24
|
-
Filter = 59,
|
|
25
|
-
Declarative = 60,
|
|
26
|
-
PrefixD = 62,
|
|
27
|
-
PrefixI = 63,
|
|
28
|
-
Imperative = 64,
|
|
29
|
-
Imp_blocks = 65,
|
|
30
|
-
PrefixR = 67,
|
|
31
|
-
Recursion = 68,
|
|
32
|
-
Function = 69,
|
|
33
|
-
BigPr = 70,
|
|
34
|
-
SmallPr = 71,
|
|
35
|
-
Card = 72,
|
|
36
|
-
Bool = 73,
|
|
37
|
-
Debool = 74,
|
|
38
|
-
Red = 75,
|
|
39
|
-
Function_decl = 76,
|
|
40
|
-
Arguments = 77,
|
|
41
|
-
Declaration = 78;
|
|
2
|
+
declare const Expression = 1, Logic = 2, Logic_predicates = 3, Variable = 4, Local = 5, Tuple = 8, Expr_enum_min2 = 9, Logic_unary = 24, Predicate = 26, Logic_quantor = 29, Variable_pack = 31, Logic_binary = 33, Setexpr = 38, Integer = 39, EmptySet = 40, IntegerSet = 41, Global = 42, Radical = 43, Setexpr_binary = 44, Enumeration = 55, Boolean = 56, Filter_expression = 58, Filter = 59, Declarative = 60, PrefixD = 62, PrefixI = 63, Imperative = 64, Imp_blocks = 65, PrefixR = 67, Recursion = 68, Function = 69, BigPr = 70, SmallPr = 71, Card = 72, Bool = 73, Debool = 74, Red = 75, Function_decl = 76, Arguments = 77, Declaration = 78;
|
|
42
3
|
//#endregion
|
|
43
4
|
export { Arguments, BigPr, Bool, Boolean, Card, Debool, Declaration, Declarative, EmptySet, Enumeration, Expr_enum_min2, Expression, Filter, Filter_expression, Function, Function_decl, Global, Imp_blocks, Imperative, Integer, IntegerSet, Local, Logic, Logic_binary, Logic_predicates, Logic_quantor, Logic_unary, Predicate, PrefixD, PrefixI, PrefixR, Radical, Recursion, Red, Setexpr, Setexpr_binary, SmallPr, Tuple, Variable, Variable_pack };
|
|
44
5
|
//# sourceMappingURL=parser.terms.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as AstNode } from "../../../ast-
|
|
2
|
-
import
|
|
1
|
+
import { t as AstNode } from "../../../ast-D-D6Rq3T.js";
|
|
2
|
+
import "../../../index-D5RahF1K.js";
|
|
3
|
+
import { g as TypeClass } from "../../../typification-hWUoWCba.js";
|
|
3
4
|
import { t as ErrorReporter } from "../../../error-B0EkIx4K.js";
|
|
4
|
-
|
|
5
5
|
//#region src/rslang/parser/syntax-errors/index.d.ts
|
|
6
6
|
/** When set, refines incomplete formal headers (`[α∈…]`, quantifiers). */
|
|
7
7
|
interface SyntaxErrorOptions {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RSLangAnalyzer, i as AnalysisOptions, n as AnalysisFast, r as AnalysisFull, t as AnalysisBase } from "../../analyzer-
|
|
1
|
+
import { a as RSLangAnalyzer, i as AnalysisOptions, n as AnalysisFast, r as AnalysisFull, t as AnalysisBase } from "../../analyzer-CzFaWR7w.js";
|
|
2
2
|
export { AnalysisBase, AnalysisFast, AnalysisFull, AnalysisOptions, RSLangAnalyzer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ArgumentsType, t as ArgumentsExtractor } from "../../arguments-extractor-
|
|
1
|
+
import { n as ArgumentsType, t as ArgumentsExtractor } from "../../arguments-extractor-CXWRT5Ou.js";
|
|
2
2
|
export { ArgumentsExtractor, ArgumentsType };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as AstNode } from "../../ast-
|
|
2
|
-
import
|
|
1
|
+
import { t as AstNode } from "../../ast-D-D6Rq3T.js";
|
|
2
|
+
import "../../index-D5RahF1K.js";
|
|
3
|
+
import { _ as TypeContext, f as ExpressionType } from "../../typification-hWUoWCba.js";
|
|
3
4
|
import { t as ErrorReporter } from "../../error-B0EkIx4K.js";
|
|
4
|
-
|
|
5
5
|
//#region src/rslang/semantic/type-auditor.d.ts
|
|
6
6
|
/** Type auditor for AST type checking. */
|
|
7
7
|
declare class TypeAuditor {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { b as Typification, f as ExpressionType, g as TypeClass, v as TypeID, y as TypePath } from "../../typification-
|
|
2
|
-
|
|
1
|
+
import { b as Typification, f as ExpressionType, g as TypeClass, v as TypeID, y as TypePath } from "../../typification-hWUoWCba.js";
|
|
3
2
|
//#region src/rslang/semantic/typification-api.d.ts
|
|
4
3
|
/** Returns the TypeClass associated with the given TypeID. */
|
|
5
4
|
declare function getTypeClass(typeID: TypeID): TypeClass;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as applyAsciiTypeSubstitutions, r as parseTypeText, t as TypificationParseResult } from "../../typification-parser-
|
|
1
|
+
import { n as applyAsciiTypeSubstitutions, r as parseTypeText, t as TypificationParseResult } from "../../typification-parser-DFxj4JiQ.js";
|
|
2
2
|
export { TypificationParseResult, applyAsciiTypeSubstitutions, parseTypeText };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as makeTypePath, C as component, D as isRadical, E as isMangledRadical, M as mangleRadicalId, N as tuple, O as isTemplateRadical, S as bool, T as debool, _ as TypeContext, a as EchelonCollection, b as Typification, c as EchelonLogic, d as EmptySetT, f as ExpressionType, g as TypeClass, h as Parametrized, i as EchelonBase, j as mangleParamAlias, k as isTypification, l as EchelonPredicate, m as LogicT, n as Argument, o as EchelonFunctional, p as IntegerT, r as EchelonAnyTyped, s as EchelonInteger, t as AnyTypificationT, u as EchelonTuple, v as TypeID, w as constant, x as basic, y as TypePath } from "../../typification-
|
|
1
|
+
import { A as makeTypePath, C as component, D as isRadical, E as isMangledRadical, M as mangleRadicalId, N as tuple, O as isTemplateRadical, S as bool, T as debool, _ as TypeContext, a as EchelonCollection, b as Typification, c as EchelonLogic, d as EmptySetT, f as ExpressionType, g as TypeClass, h as Parametrized, i as EchelonBase, j as mangleParamAlias, k as isTypification, l as EchelonPredicate, m as LogicT, n as Argument, o as EchelonFunctional, p as IntegerT, r as EchelonAnyTyped, s as EchelonInteger, t as AnyTypificationT, u as EchelonTuple, v as TypeID, w as constant, x as basic, y as TypePath } from "../../typification-hWUoWCba.js";
|
|
2
2
|
export { AnyTypificationT, Argument, EchelonAnyTyped, EchelonBase, EchelonCollection, EchelonFunctional, EchelonInteger, EchelonLogic, EchelonPredicate, EchelonTuple, EmptySetT, ExpressionType, IntegerT, LogicT, Parametrized, TypeClass, TypeContext, TypeID, TypePath, Typification, basic, bool, component, constant, debool, isMangledRadical, isRadical, isTemplateRadical, isTypification, makeTypePath, mangleParamAlias, mangleRadicalId, tuple };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as AstNode } from "../../ast-
|
|
1
|
+
import { t as AstNode } from "../../ast-D-D6Rq3T.js";
|
|
2
|
+
import "../../index-D5RahF1K.js";
|
|
2
3
|
import { t as ErrorReporter } from "../../error-B0EkIx4K.js";
|
|
3
4
|
import { n as ValueClassContext, t as ValueClass } from "../../value-class-CNI-lqXJ.js";
|
|
4
|
-
|
|
5
5
|
//#region src/rslang/semantic/value-auditor.d.ts
|
|
6
6
|
/** Value auditor for AST value class checking. */
|
|
7
7
|
declare class ValueAuditor {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TypificationNodeData, t as TypificationGraph } from "../typification-graph-
|
|
1
|
+
import { n as TypificationNodeData, t as TypificationGraph } from "../typification-graph-CSxDt18X.js";
|
|
2
2
|
export { TypificationGraph, TypificationNodeData };
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { f as ExpressionType } from "./typification-
|
|
2
|
-
|
|
1
|
+
import { f as ExpressionType } from "./typification-hWUoWCba.js";
|
|
3
2
|
//#region src/rslang/typification-graph.d.ts
|
|
4
3
|
/** Represents a single node of a {@link TypificationGraph}. */
|
|
5
4
|
interface TypificationNodeData extends Record<string, unknown> {
|
|
@@ -27,4 +26,4 @@ declare class TypificationGraph {
|
|
|
27
26
|
}
|
|
28
27
|
//#endregion
|
|
29
28
|
export { TypificationNodeData as n, TypificationGraph as t };
|
|
30
|
-
//# sourceMappingURL=typification-graph-
|
|
29
|
+
//# sourceMappingURL=typification-graph-CSxDt18X.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as Branded } from "./branded-ZlzIcxzu.js";
|
|
2
|
+
import "./index-x0_Y5uPV.js";
|
|
2
3
|
//#region src/rslang/semantic/typification.d.ts
|
|
3
4
|
/** Typification structure enumeration. */
|
|
4
5
|
declare const TypeID: {
|
|
@@ -125,4 +126,4 @@ declare function mangleRadicalId(radical: string, funcName: string): string;
|
|
|
125
126
|
declare function mangleParamAlias(alias: string, funcName: string): string;
|
|
126
127
|
//#endregion
|
|
127
128
|
export { makeTypePath as A, component as C, isRadical as D, isMangledRadical as E, mangleRadicalId as M, tuple as N, isTemplateRadical as O, bool as S, debool as T, TypeContext as _, EchelonCollection as a, Typification as b, EchelonLogic as c, EmptySetT as d, ExpressionType as f, TypeClass as g, Parametrized as h, EchelonBase as i, mangleParamAlias as j, isTypification as k, EchelonPredicate as l, LogicT as m, Argument as n, EchelonFunctional as o, IntegerT as p, EchelonAnyTyped as r, EchelonInteger as s, AnyTypificationT as t, EchelonTuple as u, TypeID as v, constant as w, basic as x, TypePath as y };
|
|
128
|
-
//# sourceMappingURL=typification-
|
|
129
|
+
//# sourceMappingURL=typification-hWUoWCba.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { f as ExpressionType } from "./typification-
|
|
2
|
-
|
|
1
|
+
import { f as ExpressionType } from "./typification-hWUoWCba.js";
|
|
3
2
|
//#region src/rslang/semantic/typification-parser.d.ts
|
|
4
3
|
interface TypificationParseResult {
|
|
5
4
|
type: ExpressionType | null;
|
|
@@ -10,4 +9,4 @@ declare function parseTypeText(input: string): TypificationParseResult;
|
|
|
10
9
|
declare function applyAsciiTypeSubstitutions(raw: string): string;
|
|
11
10
|
//#endregion
|
|
12
11
|
export { applyAsciiTypeSubstitutions as n, parseTypeText as r, TypificationParseResult as t };
|
|
13
|
-
//# sourceMappingURL=typification-parser-
|
|
12
|
+
//# sourceMappingURL=typification-parser-DFxj4JiQ.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as Branded } from "./branded-ZlzIcxzu.js";
|
|
2
|
+
import "./index-x0_Y5uPV.js";
|
|
2
3
|
//#region src/rslang/eval/value.d.ts
|
|
3
4
|
/** Tuple ID for array distinction. */
|
|
4
5
|
declare const TUPLE_ID = -111;
|
|
@@ -36,4 +37,4 @@ declare function tuple(components: Value[]): Value;
|
|
|
36
37
|
declare function set(elements: Value[]): Value[];
|
|
37
38
|
//#endregion
|
|
38
39
|
export { SET_INFINITY as a, VALUE_TRUE as c, ValuePath as d, compare as f, tuple as h, INVALID_ELEMENT as i, Value as l, set as m, CalcInvalidDataError as n, TUPLE_ID as o, makeValuePath as p, EmptySetV as r, VALUE_FALSE as s, BOOL_INFINITY as t, ValueContext as u };
|
|
39
|
-
//# sourceMappingURL=value-
|
|
40
|
+
//# sourceMappingURL=value-XpJOVzMP.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { b as Typification, f as ExpressionType, y as TypePath } from "./typification-
|
|
2
|
-
import { d as ValuePath, l as Value, u as ValueContext } from "./value-
|
|
3
|
-
|
|
1
|
+
import { b as Typification, f as ExpressionType, y as TypePath } from "./typification-hWUoWCba.js";
|
|
2
|
+
import { d as ValuePath, l as Value, u as ValueContext } from "./value-XpJOVzMP.js";
|
|
4
3
|
//#region src/rslang/eval/value-api.d.ts
|
|
5
4
|
/** Cartesian product of factor sets. */
|
|
6
5
|
declare function cartesianProduct(factors: Value[][]): Value[] | null;
|
|
@@ -46,4 +45,4 @@ declare function setNestedValue(target: Value | null, path: ValuePath, newVal: V
|
|
|
46
45
|
declare function testInvalid(value: Value): boolean;
|
|
47
46
|
//#endregion
|
|
48
47
|
export { setSymDiff as _, extractValue as a, validateValue as b, isTupleValue as c, printValue as d, projection as f, setNestedValue as g, setIntersection as h, convertPathToType as i, makeDefaultValue as l, setDiff as m, cartesianProduct as n, isSetValue as o, reduce as p, contains as r, isSubsetOrEq as s, boolean as t, normalizeValue as u, setUnion as v, valueStub as x, testInvalid as y };
|
|
49
|
-
//# sourceMappingURL=value-api-
|
|
48
|
+
//# sourceMappingURL=value-api-Dw8UkwCD.d.ts.map
|