@aleph-ai/tinyaleph 1.4.4 → 1.5.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/backends/bioinformatics/binding.js +44 -52
- package/backends/bioinformatics/dna-computing.js +14 -23
- package/backends/bioinformatics/encoding.js +22 -30
- package/backends/bioinformatics/folding.js +24 -32
- package/backends/bioinformatics/genetic-code.js +17 -21
- package/backends/bioinformatics/index.js +12 -12
- package/backends/bioinformatics/transcription.js +5 -3
- package/backends/bioinformatics/translation.js +6 -4
- package/backends/cryptographic/index.js +10 -9
- package/backends/index.js +7 -6
- package/backends/interface.js +4 -1
- package/backends/scientific/index.js +7 -4
- package/backends/semantic/index.js +7 -4
- package/backends/semantic/surface.js +2 -1
- package/backends/semantic/two-layer.js +5 -3
- package/core/beacon.js +10 -9
- package/core/compound.js +4 -4
- package/core/crt-homology.js +40 -13
- package/core/enochian-vocabulary.js +5 -17
- package/core/enochian.js +3 -2
- package/core/entanglement.js +7 -7
- package/core/errors.js +2 -10
- package/core/events.js +7 -6
- package/core/fano.js +7 -6
- package/core/hilbert.js +40 -34
- package/core/hypercomplex.js +4 -2
- package/core/index.js +42 -80
- package/core/inference.js +6 -6
- package/core/lambda.js +5 -18
- package/core/llm.js +1 -1
- package/core/logger.js +3 -4
- package/core/prime.js +26 -1
- package/core/quaternion-semantics.js +3 -3
- package/core/reduction.js +5 -21
- package/core/resonance.js +20 -6
- package/core/rformer-crt.js +15 -29
- package/core/rformer-layers.js +12 -14
- package/core/rformer-tf.js +34 -43
- package/core/rformer.js +17 -32
- package/core/sieve.js +8 -3
- package/core/symbols/archetypes.js +3 -3
- package/core/symbols/base.js +4 -4
- package/core/symbols/elements.js +6 -3
- package/core/symbols/hieroglyphs.js +3 -3
- package/core/symbols/iching.js +3 -3
- package/core/symbols/index.js +32 -18
- package/core/symbols/tarot.js +6 -3
- package/core/symbols.js +26 -4
- package/core/topology.js +3 -14
- package/core/types.js +3 -14
- package/engine/aleph.js +8 -6
- package/engine/index.js +4 -2
- package/index.js +3 -2
- package/modular.js +18 -41
- package/package.json +4 -2
- package/physics/collapse.js +10 -11
- package/physics/entropy.js +8 -8
- package/physics/index.js +70 -102
- package/physics/kuramoto-coupled-ladder.js +10 -14
- package/physics/kuramoto.js +5 -2
- package/physics/lyapunov.js +7 -7
- package/physics/oscillator.js +5 -1
- package/physics/primeon_z_ladder_multi.js +7 -9
- package/physics/primeon_z_ladder_u.js +8 -9
- package/physics/stochastic-kuramoto.js +7 -7
- package/physics/sync-models.js +11 -14
- package/telemetry/index.js +1 -1
- package/telemetry/metrics.js +3 -8
package/core/crt-homology.js
CHANGED
|
@@ -21,10 +21,6 @@
|
|
|
21
21
|
|
|
22
22
|
'use strict';
|
|
23
23
|
|
|
24
|
-
const { firstNPrimes, isPrime, factorize } = require('./prime');
|
|
25
|
-
const { Complex, PrimeState } = require('./hilbert');
|
|
26
|
-
const { SparsePrimeState, resonanceScore, Quaternion } = require('./rformer');
|
|
27
|
-
|
|
28
24
|
// ============================================================================
|
|
29
25
|
// MODULAR ARITHMETIC UTILITIES
|
|
30
26
|
// ============================================================================
|
|
@@ -36,6 +32,10 @@ const { SparsePrimeState, resonanceScore, Quaternion } = require('./rformer');
|
|
|
36
32
|
* @param {number} b - Second number
|
|
37
33
|
* @returns {Object} { gcd, x, y }
|
|
38
34
|
*/
|
|
35
|
+
import { firstNPrimes, isPrime, factorize } from './prime.js';
|
|
36
|
+
import { Complex, PrimeState } from './hilbert.js';
|
|
37
|
+
import { SparsePrimeState, resonanceScore, Quaternion } from './rformer.js';
|
|
38
|
+
|
|
39
39
|
function extendedGCD(a, b) {
|
|
40
40
|
if (b === 0) {
|
|
41
41
|
return { gcd: a, x: 1, y: 0 };
|
|
@@ -974,7 +974,37 @@ class CoprimeSelector {
|
|
|
974
974
|
// EXPORTS
|
|
975
975
|
// ============================================================================
|
|
976
976
|
|
|
977
|
-
|
|
977
|
+
// Named exports for ESM compatibility
|
|
978
|
+
export {
|
|
979
|
+
// Modular arithmetic utilities
|
|
980
|
+
extendedGCD,
|
|
981
|
+
modInverse,
|
|
982
|
+
areCoprime,
|
|
983
|
+
softmax,
|
|
984
|
+
|
|
985
|
+
// Core classes
|
|
986
|
+
ResidueEncoder,
|
|
987
|
+
CRTReconstructor,
|
|
988
|
+
BirkhoffProjector,
|
|
989
|
+
HomologyLoss,
|
|
990
|
+
CRTModularLayer,
|
|
991
|
+
CRTFusedAttention,
|
|
992
|
+
CoprimeSelector
|
|
993
|
+
};
|
|
994
|
+
|
|
995
|
+
// Factory functions as named exports
|
|
996
|
+
export const createCRTLayer = (primes, hiddenDim, options = {}) =>
|
|
997
|
+
new CRTModularLayer(primes, hiddenDim, options);
|
|
998
|
+
|
|
999
|
+
export const createFusedAttention = (primes, hiddenDim, headDim, options = {}) =>
|
|
1000
|
+
new CRTFusedAttention(primes, hiddenDim, headDim, options);
|
|
1001
|
+
|
|
1002
|
+
// Default configurations
|
|
1003
|
+
export const DEFAULT_PRIMES_SMALL = [2, 3, 5, 7];
|
|
1004
|
+
export const DEFAULT_PRIMES_MEDIUM = [5, 7, 11, 13];
|
|
1005
|
+
export const DEFAULT_PRIMES_SEMANTIC = [2, 3, 5, 7, 11];
|
|
1006
|
+
|
|
1007
|
+
export default {
|
|
978
1008
|
// Modular arithmetic utilities
|
|
979
1009
|
extendedGCD,
|
|
980
1010
|
modInverse,
|
|
@@ -991,14 +1021,11 @@ module.exports = {
|
|
|
991
1021
|
CoprimeSelector,
|
|
992
1022
|
|
|
993
1023
|
// Factory functions
|
|
994
|
-
createCRTLayer
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
createFusedAttention: (primes, hiddenDim, headDim, options = {}) =>
|
|
998
|
-
new CRTFusedAttention(primes, hiddenDim, headDim, options),
|
|
1024
|
+
createCRTLayer,
|
|
1025
|
+
createFusedAttention,
|
|
999
1026
|
|
|
1000
1027
|
// Default configurations
|
|
1001
|
-
DEFAULT_PRIMES_SMALL
|
|
1002
|
-
DEFAULT_PRIMES_MEDIUM
|
|
1003
|
-
DEFAULT_PRIMES_SEMANTIC
|
|
1028
|
+
DEFAULT_PRIMES_SMALL,
|
|
1029
|
+
DEFAULT_PRIMES_MEDIUM,
|
|
1030
|
+
DEFAULT_PRIMES_SEMANTIC
|
|
1004
1031
|
};
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
* for robust symbolic packets with geometric validity gates.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
const { isPrime, nthPrime, firstNPrimes } = require('./prime');
|
|
19
|
-
|
|
20
18
|
// ============================================================================
|
|
21
19
|
// ENOCHIAN ALPHABET (21 Letters)
|
|
22
20
|
// ============================================================================
|
|
@@ -25,6 +23,8 @@ const { isPrime, nthPrime, firstNPrimes } = require('./prime');
|
|
|
25
23
|
* The Enochian alphabet consists of 21 letters, each mapped to a prime number.
|
|
26
24
|
* The mapping follows the original Dee/Kelley system with prime assignments.
|
|
27
25
|
*/
|
|
26
|
+
import { isPrime, nthPrime, firstNPrimes } from './prime.js';
|
|
27
|
+
|
|
28
28
|
const ENOCHIAN_ALPHABET = [
|
|
29
29
|
{ letter: 'A', name: 'Un', prime: 2, meaning: 'Beginning', phonetic: 'ah' },
|
|
30
30
|
{ letter: 'B', name: 'Pa', prime: 3, meaning: 'Father', phonetic: 'beh' },
|
|
@@ -874,37 +874,25 @@ class EnochianEngine {
|
|
|
874
874
|
// EXPORTS
|
|
875
875
|
// ============================================================================
|
|
876
876
|
|
|
877
|
-
|
|
878
|
-
// Alphabet
|
|
877
|
+
export {
|
|
879
878
|
ENOCHIAN_ALPHABET,
|
|
880
879
|
letterToPrime,
|
|
881
880
|
primeToLetter,
|
|
882
881
|
letterToData,
|
|
883
|
-
|
|
884
|
-
// Prime Basis
|
|
885
882
|
PRIME_BASIS,
|
|
886
883
|
BASIS_MEANINGS,
|
|
887
|
-
|
|
888
|
-
// Twist Operations
|
|
889
884
|
TWIST_MODES,
|
|
890
885
|
twistAngle,
|
|
891
886
|
twistRadians,
|
|
892
887
|
TwistOperator,
|
|
893
888
|
validateTwistClosure,
|
|
894
|
-
|
|
895
|
-
// Words
|
|
896
889
|
EnochianWord,
|
|
897
890
|
CORE_VOCABULARY,
|
|
898
891
|
wordLookup,
|
|
899
|
-
|
|
900
|
-
// Calls
|
|
901
892
|
EnochianCall,
|
|
902
893
|
THE_NINETEEN_CALLS,
|
|
903
|
-
|
|
904
|
-
// Sedenions
|
|
905
894
|
SedenionElement,
|
|
906
895
|
sedenionMultTable,
|
|
907
|
-
|
|
908
|
-
// Engine
|
|
909
896
|
EnochianEngine
|
|
910
|
-
};
|
|
897
|
+
};
|
|
898
|
+
export default { ENOCHIAN_ALPHABET, letterToPrime, primeToLetter, letterToData, PRIME_BASIS, BASIS_MEANINGS, TWIST_MODES, twistAngle, twistRadians, TwistOperator, validateTwistClosure, EnochianWord, CORE_VOCABULARY, wordLookup, EnochianCall, THE_NINETEEN_CALLS, SedenionElement, sedenionMultTable, EnochianEngine };
|
package/core/enochian.js
CHANGED
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
// Import the comprehensive Enochian vocabulary system
|
|
24
|
-
|
|
24
|
+
|
|
25
|
+
import EnochianVocabulary from './enochian-vocabulary.js';
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* Enochian prime alphabet (Section 7.4)
|
|
@@ -703,7 +704,7 @@ class EnhancedEnochianDecoder extends EnochianDecoder {
|
|
|
703
704
|
}
|
|
704
705
|
}
|
|
705
706
|
|
|
706
|
-
|
|
707
|
+
export default {
|
|
707
708
|
// Constants
|
|
708
709
|
ENOCHIAN_PRIMES,
|
|
709
710
|
MODES,
|
package/core/entanglement.js
CHANGED
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
|
|
19
19
|
'use strict';
|
|
20
20
|
|
|
21
|
-
const { isPrime, firstNPrimes } = require('./prime');
|
|
22
|
-
|
|
23
21
|
/**
|
|
24
22
|
* Edge data for entanglement between two primes
|
|
25
23
|
*/
|
|
24
|
+
import { NetworkKuramoto } from '../physics/sync-models.js';
|
|
25
|
+
import { isPrime, firstNPrimes } from './prime.js';
|
|
26
|
+
|
|
26
27
|
class EntanglementEdge {
|
|
27
28
|
constructor(source, target) {
|
|
28
29
|
this.source = source;
|
|
@@ -506,7 +507,6 @@ class PrimeEntanglementGraph {
|
|
|
506
507
|
*/
|
|
507
508
|
toNetworkKuramoto(frequencies, coupling = 0.3) {
|
|
508
509
|
// Import dynamically to avoid circular dependency
|
|
509
|
-
const { NetworkKuramoto } = require('../physics/sync-models');
|
|
510
510
|
|
|
511
511
|
const primeOrder = Array.from(this.primes).sort((a, b) => a - b);
|
|
512
512
|
const adjacency = this.toAdjacencyMatrix(primeOrder);
|
|
@@ -705,8 +705,8 @@ function createEntanglementGraph(config = {}) {
|
|
|
705
705
|
});
|
|
706
706
|
}
|
|
707
707
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
708
|
+
export {
|
|
709
|
+
EntanglementEdge,
|
|
710
|
+
PrimeEntanglementGraph,
|
|
711
|
+
createEntanglementGraph
|
|
712
712
|
};
|
package/core/errors.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
// Simple EventEmitter that works in both browser and Node.js
|
|
16
|
+
|
|
16
17
|
class SimpleEventEmitter {
|
|
17
18
|
constructor() {
|
|
18
19
|
this._events = new Map();
|
|
@@ -561,26 +562,17 @@ function withTimeout(promise, timeout, operation = 'operation') {
|
|
|
561
562
|
// EXPORTS
|
|
562
563
|
// ============================================================================
|
|
563
564
|
|
|
564
|
-
|
|
565
|
-
// Levels and categories
|
|
565
|
+
export {
|
|
566
566
|
LogLevel,
|
|
567
567
|
LogLevelNames,
|
|
568
568
|
ErrorCategory,
|
|
569
|
-
|
|
570
|
-
// Error classes
|
|
571
569
|
AlephError,
|
|
572
570
|
NetworkError,
|
|
573
571
|
LLMError,
|
|
574
572
|
ValidationError,
|
|
575
573
|
TimeoutError,
|
|
576
|
-
|
|
577
|
-
// Event emitter (browser-compatible)
|
|
578
574
|
SimpleEventEmitter,
|
|
579
|
-
|
|
580
|
-
// Error handler
|
|
581
575
|
ErrorHandler,
|
|
582
|
-
|
|
583
|
-
// Utilities
|
|
584
576
|
withErrorHandling,
|
|
585
577
|
errorBoundary,
|
|
586
578
|
withTimeout
|
package/core/events.js
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
*
|
|
27
27
|
* Compatible with Node.js EventEmitter pattern but standalone.
|
|
28
28
|
*/
|
|
29
|
+
|
|
29
30
|
class AlephEventEmitter {
|
|
30
31
|
constructor(options = {}) {
|
|
31
32
|
this._listeners = new Map();
|
|
@@ -898,10 +899,10 @@ function createMonitor(engine, options = {}) {
|
|
|
898
899
|
return new AlephMonitor(engine, options);
|
|
899
900
|
}
|
|
900
901
|
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
902
|
+
export {
|
|
903
|
+
AlephEventEmitter,
|
|
904
|
+
AlephMonitor,
|
|
905
|
+
EvolutionStream,
|
|
906
|
+
createEvolutionStream,
|
|
907
|
+
createMonitor
|
|
907
908
|
};
|
package/core/fano.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
// Standard Fano plane lines (7 lines of 3 points each)
|
|
6
|
+
|
|
6
7
|
const FANO_LINES = [
|
|
7
8
|
[1, 2, 3],
|
|
8
9
|
[1, 4, 5],
|
|
@@ -118,10 +119,10 @@ function buildMultiplicationTable(dim) {
|
|
|
118
119
|
return table;
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
export {
|
|
123
|
+
FANO_LINES,
|
|
124
|
+
octonionMultiplyIndex,
|
|
125
|
+
sedenionMultiplyIndex,
|
|
126
|
+
multiplyIndices,
|
|
127
|
+
buildMultiplicationTable
|
|
127
128
|
};
|
package/core/hilbert.js
CHANGED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
* - Resonance operators (P̂, F̂, R̂, Ĉ)
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
const { isPrime, firstNPrimes, factorize } = require('./prime');
|
|
17
|
-
|
|
18
16
|
/**
|
|
19
17
|
* Complex number class for amplitudes
|
|
20
18
|
*/
|
|
19
|
+
import { factorize, isPrime, firstNPrimes } from './prime.js';
|
|
20
|
+
|
|
21
21
|
class Complex {
|
|
22
22
|
constructor(re = 0, im = 0) {
|
|
23
23
|
this.re = re;
|
|
@@ -995,26 +995,7 @@ class ResonantFragment {
|
|
|
995
995
|
}
|
|
996
996
|
}
|
|
997
997
|
|
|
998
|
-
|
|
999
|
-
Complex,
|
|
1000
|
-
PrimeState,
|
|
1001
|
-
ResonanceOperators,
|
|
1002
|
-
EntropyDrivenEvolution,
|
|
1003
|
-
encodeMemory,
|
|
1004
|
-
symbolicCompute,
|
|
1005
|
-
|
|
1006
|
-
// New classes
|
|
1007
|
-
QuaternionPrime,
|
|
1008
|
-
PrimeResonanceIdentity,
|
|
1009
|
-
PhaseLockedRing,
|
|
1010
|
-
HolographicField,
|
|
1011
|
-
EntangledNode,
|
|
1012
|
-
ResonantFragment,
|
|
1013
|
-
|
|
1014
|
-
// Constants
|
|
1015
|
-
PHI,
|
|
1016
|
-
DELTA_S
|
|
1017
|
-
};
|
|
998
|
+
// Legacy CommonJS export removed - ESM exports at end of file
|
|
1018
999
|
|
|
1019
1000
|
// ============================================================================
|
|
1020
1001
|
// P-ADIC COHERENCE (from Quantum_Semantics paper)
|
|
@@ -1132,7 +1113,6 @@ function pAdicCoherence(state1, state2, primes = [2, 3, 5]) {
|
|
|
1132
1113
|
function mobiusFunction(n) {
|
|
1133
1114
|
if (n === 1) return 1;
|
|
1134
1115
|
|
|
1135
|
-
const { factorize } = require('./prime');
|
|
1136
1116
|
const factors = factorize(n);
|
|
1137
1117
|
|
|
1138
1118
|
// Check for squared factors
|
|
@@ -1157,7 +1137,6 @@ function mobiusFunction(n) {
|
|
|
1157
1137
|
function eulerTotient(n) {
|
|
1158
1138
|
if (n === 1) return 1;
|
|
1159
1139
|
|
|
1160
|
-
const { factorize } = require('./prime');
|
|
1161
1140
|
const factors = factorize(n);
|
|
1162
1141
|
|
|
1163
1142
|
let result = n;
|
|
@@ -1655,13 +1634,40 @@ class SemanticPatternDetector {
|
|
|
1655
1634
|
}
|
|
1656
1635
|
}
|
|
1657
1636
|
|
|
1658
|
-
// Export
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1637
|
+
// Export all classes and functions
|
|
1638
|
+
export {
|
|
1639
|
+
// Core classes
|
|
1640
|
+
Complex,
|
|
1641
|
+
PrimeState,
|
|
1642
|
+
ResonanceOperators,
|
|
1643
|
+
EntropyDrivenEvolution,
|
|
1644
|
+
encodeMemory,
|
|
1645
|
+
symbolicCompute,
|
|
1646
|
+
|
|
1647
|
+
// Extended classes
|
|
1648
|
+
QuaternionPrime,
|
|
1649
|
+
PrimeResonanceIdentity,
|
|
1650
|
+
PhaseLockedRing,
|
|
1651
|
+
HolographicField,
|
|
1652
|
+
EntangledNode,
|
|
1653
|
+
ResonantFragment,
|
|
1654
|
+
|
|
1655
|
+
// Constants
|
|
1656
|
+
PHI,
|
|
1657
|
+
DELTA_S,
|
|
1658
|
+
|
|
1659
|
+
// P-adic functions
|
|
1660
|
+
pAdicNorm,
|
|
1661
|
+
pAdicValuation,
|
|
1662
|
+
pAdicCoherence,
|
|
1663
|
+
|
|
1664
|
+
// Number theory functions
|
|
1665
|
+
mobiusFunction,
|
|
1666
|
+
eulerTotient,
|
|
1667
|
+
|
|
1668
|
+
// Extended operators and calculators
|
|
1669
|
+
ExtendedOperators,
|
|
1670
|
+
KnowledgeResonanceCalculator,
|
|
1671
|
+
FibonacciWaveletBank,
|
|
1672
|
+
SemanticPatternDetector
|
|
1673
|
+
};
|
package/core/hypercomplex.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Dimension 32: Pathions (further structure loss)
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
import { multiplyIndices } from './fano.js';
|
|
13
13
|
|
|
14
14
|
class Hypercomplex {
|
|
15
15
|
constructor(dim, components = null) {
|
|
@@ -638,4 +638,6 @@ class Hypercomplex {
|
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
640
|
|
|
641
|
-
|
|
641
|
+
export {
|
|
642
|
+
Hypercomplex
|
|
643
|
+
};
|
package/core/index.js
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
* Core mathematical foundation - exports all core modules
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
const { Hypercomplex } = require('./hypercomplex');
|
|
6
|
-
|
|
7
5
|
// CRT-Homology Module (Chinese Remainder Theorem + Birkhoff Attention + Homology Loss)
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { Hypercomplex } from './hypercomplex.js';
|
|
7
|
+
|
|
8
|
+
import { extendedGCD,
|
|
10
9
|
modInverse,
|
|
11
10
|
areCoprime,
|
|
12
11
|
softmax,
|
|
@@ -21,59 +20,47 @@ const {
|
|
|
21
20
|
createFusedAttention,
|
|
22
21
|
DEFAULT_PRIMES_SMALL,
|
|
23
22
|
DEFAULT_PRIMES_MEDIUM,
|
|
24
|
-
DEFAULT_PRIMES_SEMANTIC
|
|
25
|
-
} = require('./crt-homology');
|
|
23
|
+
DEFAULT_PRIMES_SEMANTIC } from './crt-homology.js';
|
|
26
24
|
|
|
27
25
|
// Formal Type System (mtspbc.pdf implementation)
|
|
28
|
-
|
|
29
|
-
NounType, AdjType, SentenceType,
|
|
26
|
+
import { NounType, AdjType, SentenceType,
|
|
30
27
|
NounTerm, AdjTerm, ChainTerm, FusionTerm,
|
|
31
28
|
NounSentence, SeqSentence, ImplSentence,
|
|
32
29
|
TypingContext, TypingJudgment, TypeChecker,
|
|
33
|
-
N, A, FUSE, CHAIN, SENTENCE, SEQ, IMPL
|
|
34
|
-
} = require('./types');
|
|
30
|
+
N, A, FUSE, CHAIN, SENTENCE, SEQ, IMPL } from './types.js';
|
|
35
31
|
|
|
36
32
|
// Reduction Semantics (ncpsc.pdf implementation)
|
|
37
|
-
|
|
38
|
-
PrimeOperator, NextPrimeOperator, ModularPrimeOperator,
|
|
33
|
+
import { PrimeOperator, NextPrimeOperator, ModularPrimeOperator,
|
|
39
34
|
ResonancePrimeOperator, IdentityPrimeOperator, DEFAULT_OPERATOR,
|
|
40
35
|
ReductionStep, ReductionTrace, ReductionSystem,
|
|
41
36
|
isNormalForm, isReducible, termSize,
|
|
42
37
|
FusionCanonicalizer, NormalFormVerifier,
|
|
43
|
-
demonstrateStrongNormalization, testLocalConfluence
|
|
44
|
-
} = require('./reduction');
|
|
38
|
+
demonstrateStrongNormalization, testLocalConfluence } from './reduction.js';
|
|
45
39
|
|
|
46
40
|
// Lambda Calculus Translation (Section 4 from mtspbc.pdf)
|
|
47
|
-
|
|
48
|
-
LambdaExpr, VarExpr, ConstExpr, LamExpr, AppExpr,
|
|
41
|
+
import { LambdaExpr, VarExpr, ConstExpr, LamExpr, AppExpr,
|
|
49
42
|
PairExpr, ImplExpr, PrimOpExpr,
|
|
50
43
|
Translator, TypeDirectedTranslator,
|
|
51
|
-
LambdaEvaluator, Semantics, ConceptInterpreter
|
|
52
|
-
} = require('./lambda');
|
|
44
|
+
LambdaEvaluator, Semantics, ConceptInterpreter } from './lambda.js';
|
|
53
45
|
|
|
54
46
|
// Enochian Packet Layer (Section 7.4)
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
import enochian from './enochian.js';
|
|
48
|
+
import enochianVocabulary from './enochian-vocabulary.js';
|
|
57
49
|
|
|
58
|
-
|
|
59
|
-
FANO_LINES,
|
|
50
|
+
import { FANO_LINES,
|
|
60
51
|
octonionMultiplyIndex,
|
|
61
52
|
sedenionMultiplyIndex,
|
|
62
53
|
multiplyIndices,
|
|
63
|
-
buildMultiplicationTable
|
|
64
|
-
|
|
65
|
-
const {
|
|
66
|
-
primeGenerator, nthPrime, primesUpTo, isPrime,
|
|
54
|
+
buildMultiplicationTable } from './fano.js';
|
|
55
|
+
import { primeGenerator, nthPrime, primesUpTo, isPrime,
|
|
67
56
|
factorize, primeSignature, firstNPrimes,
|
|
68
57
|
GaussianInteger, EisensteinInteger,
|
|
69
58
|
primeToFrequency, primeToAngle, sumOfTwoSquares,
|
|
70
|
-
DEFAULT_PRIMES
|
|
71
|
-
|
|
72
|
-
const LLM = require('./llm');
|
|
59
|
+
DEFAULT_PRIMES } from './prime.js';
|
|
60
|
+
import LLM from './llm.js';
|
|
73
61
|
|
|
74
62
|
// Prime Hilbert Space (complex amplitudes, quantum-like)
|
|
75
|
-
|
|
76
|
-
Complex,
|
|
63
|
+
import { Complex,
|
|
77
64
|
PrimeState,
|
|
78
65
|
ResonanceOperators,
|
|
79
66
|
EntropyDrivenEvolution,
|
|
@@ -85,12 +72,10 @@ const {
|
|
|
85
72
|
HolographicField,
|
|
86
73
|
EntangledNode,
|
|
87
74
|
ResonantFragment,
|
|
88
|
-
DELTA_S
|
|
89
|
-
} = require('./hilbert');
|
|
75
|
+
DELTA_S } from './hilbert.js';
|
|
90
76
|
|
|
91
77
|
// Golden Ratio Resonance (from symprime symbolic AI)
|
|
92
|
-
|
|
93
|
-
ResonanceCalculator,
|
|
78
|
+
import { ResonanceCalculator,
|
|
94
79
|
resonanceSignature,
|
|
95
80
|
findFibonacciSequences,
|
|
96
81
|
PHI,
|
|
@@ -98,25 +83,21 @@ const {
|
|
|
98
83
|
PHI_BONUS,
|
|
99
84
|
calculateResonance,
|
|
100
85
|
findGoldenPairs,
|
|
101
|
-
findMostResonant
|
|
102
|
-
} = require('./resonance');
|
|
86
|
+
findMostResonant } from './resonance.js';
|
|
103
87
|
|
|
104
88
|
// Symbol Database (200+ emoji symbols from symprime)
|
|
105
|
-
|
|
106
|
-
SymbolDatabase,
|
|
89
|
+
import { SymbolDatabase,
|
|
107
90
|
SymbolCategory,
|
|
108
91
|
PrimeGenerator,
|
|
109
92
|
symbolDatabase,
|
|
110
93
|
getSymbol,
|
|
111
94
|
getSymbolByPrime,
|
|
112
|
-
search
|
|
113
|
-
encode
|
|
114
|
-
decode
|
|
115
|
-
} = require('./symbols');
|
|
95
|
+
search as searchSymbols,
|
|
96
|
+
encode as encodeSymbols,
|
|
97
|
+
decode as decodeSymbols } from './symbols/index.js';
|
|
116
98
|
|
|
117
99
|
// Semantic Inference Engine (from symprime)
|
|
118
|
-
|
|
119
|
-
SemanticInference,
|
|
100
|
+
import { SemanticInference,
|
|
120
101
|
EntityExtractor,
|
|
121
102
|
InferenceMethod,
|
|
122
103
|
semanticInference,
|
|
@@ -126,12 +107,10 @@ const {
|
|
|
126
107
|
extractEntities,
|
|
127
108
|
extractAndInfer,
|
|
128
109
|
inferWithResonance,
|
|
129
|
-
inferMostResonant
|
|
130
|
-
} = require('./inference');
|
|
110
|
+
inferMostResonant } from './inference.js';
|
|
131
111
|
|
|
132
112
|
// Compound Builder (multi-symbol concepts from symprime)
|
|
133
|
-
|
|
134
|
-
CompoundBuilder,
|
|
113
|
+
import { CompoundBuilder,
|
|
135
114
|
CompoundSymbol,
|
|
136
115
|
SymbolSequence,
|
|
137
116
|
compoundBuilder,
|
|
@@ -139,12 +118,10 @@ const {
|
|
|
139
118
|
getCompound,
|
|
140
119
|
createSequence,
|
|
141
120
|
getSequence,
|
|
142
|
-
findCompoundsContaining
|
|
143
|
-
} = require('./compound');
|
|
121
|
+
findCompoundsContaining } from './compound.js';
|
|
144
122
|
|
|
145
123
|
// ResoFormer ML primitives
|
|
146
|
-
|
|
147
|
-
Quaternion,
|
|
124
|
+
import { Quaternion,
|
|
148
125
|
SparsePrimeState,
|
|
149
126
|
resonanceScore,
|
|
150
127
|
resonantAttention,
|
|
@@ -156,52 +133,40 @@ const {
|
|
|
156
133
|
EntropyCollapseHead,
|
|
157
134
|
generateAttractorCodebook,
|
|
158
135
|
PRGraphMemory,
|
|
159
|
-
applyResonanceOperator
|
|
160
|
-
} = require('./rformer');
|
|
136
|
+
applyResonanceOperator } from './rformer.js';
|
|
161
137
|
|
|
162
138
|
// ResoFormer complete layers
|
|
163
|
-
|
|
164
|
-
ResonantMultiHeadAttention,
|
|
139
|
+
import { ResonantMultiHeadAttention,
|
|
165
140
|
PrimeFFN,
|
|
166
141
|
PrimeLayerNorm,
|
|
167
142
|
PositionalPrimeEncoding,
|
|
168
143
|
ResoFormerBlock,
|
|
169
|
-
ResoFormer
|
|
170
|
-
} = require('./rformer-layers');
|
|
144
|
+
ResoFormer } from './rformer-layers.js';
|
|
171
145
|
|
|
172
146
|
// CRT-enhanced ResoFormer layers
|
|
173
|
-
|
|
174
|
-
CRTResonantAttention,
|
|
147
|
+
import { CRTResonantAttention,
|
|
175
148
|
HomologyRegularizedBlock,
|
|
176
149
|
CRTResoFormer,
|
|
177
|
-
createCRTResoFormer
|
|
178
|
-
} = require('./rformer-crt');
|
|
150
|
+
createCRTResoFormer } from './rformer-crt.js';
|
|
179
151
|
|
|
180
152
|
// Prime Entanglement Graph
|
|
181
|
-
|
|
182
|
-
EntanglementEdge,
|
|
153
|
+
import { EntanglementEdge,
|
|
183
154
|
PrimeEntanglementGraph,
|
|
184
|
-
createEntanglementGraph
|
|
185
|
-
} = require('./entanglement');
|
|
155
|
+
createEntanglementGraph } from './entanglement.js';
|
|
186
156
|
|
|
187
157
|
// Event system and streaming
|
|
188
|
-
|
|
189
|
-
AlephEventEmitter,
|
|
158
|
+
import { AlephEventEmitter,
|
|
190
159
|
AlephMonitor,
|
|
191
160
|
EvolutionStream,
|
|
192
161
|
createEvolutionStream,
|
|
193
|
-
createMonitor
|
|
194
|
-
} = require('./events');
|
|
162
|
+
createMonitor } from './events.js';
|
|
195
163
|
|
|
196
164
|
// TensorFlow.js layers (lazy load - may not be available)
|
|
197
165
|
let rformerTF = null;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
} catch (e) {
|
|
201
|
-
// TensorFlow.js not available, skip
|
|
202
|
-
}
|
|
166
|
+
// Dynamic import for optional TensorFlow.js support
|
|
167
|
+
// Use: const tf = await import('./rformer-tf.js') when needed
|
|
203
168
|
|
|
204
|
-
|
|
169
|
+
export default {
|
|
205
170
|
// Hypercomplex algebra
|
|
206
171
|
Hypercomplex,
|
|
207
172
|
|
|
@@ -328,9 +293,6 @@ module.exports = {
|
|
|
328
293
|
createEvolutionStream,
|
|
329
294
|
createMonitor,
|
|
330
295
|
|
|
331
|
-
// TensorFlow.js ResoFormer layers (if available)
|
|
332
|
-
...(rformerTF || {}),
|
|
333
|
-
|
|
334
296
|
// Formal Type System (mtspbc.pdf)
|
|
335
297
|
NounType,
|
|
336
298
|
AdjType,
|
package/core/inference.js
CHANGED
|
@@ -13,14 +13,15 @@
|
|
|
13
13
|
* Enhanced with resonance attention from tinyaleph's rformer.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
const { symbolDatabase, SymbolCategory } = require('./symbols');
|
|
17
|
-
const { SparsePrimeState, resonanceScore, resonantAttention } = require('./rformer');
|
|
18
|
-
const { ResonanceCalculator } = require('./resonance');
|
|
19
|
-
|
|
20
16
|
// ═══════════════════════════════════════════════════════════════════
|
|
21
17
|
// Inference Result Types
|
|
22
18
|
// ═══════════════════════════════════════════════════════════════════
|
|
23
19
|
|
|
20
|
+
import { Complex } from './hilbert.js';
|
|
21
|
+
import { symbolDatabase, SymbolCategory } from './symbols.js';
|
|
22
|
+
import { SparsePrimeState, resonanceScore, resonantAttention } from './rformer.js';
|
|
23
|
+
import { ResonanceCalculator } from './resonance.js';
|
|
24
|
+
|
|
24
25
|
const InferenceMethod = {
|
|
25
26
|
DIRECT: 'direct', // Exact match in database
|
|
26
27
|
REGEX: 'regex', // Pattern rule match
|
|
@@ -315,7 +316,6 @@ class SemanticInference {
|
|
|
315
316
|
* Convert a symbol to SparsePrimeState for resonance calculations
|
|
316
317
|
*/
|
|
317
318
|
symbolToState(symbol) {
|
|
318
|
-
const { Complex } = require('./hilbert');
|
|
319
319
|
const state = new SparsePrimeState(4096, 8);
|
|
320
320
|
|
|
321
321
|
// Primary prime activation
|
|
@@ -584,7 +584,7 @@ class EntityExtractor {
|
|
|
584
584
|
const defaultInference = new SemanticInference();
|
|
585
585
|
const defaultExtractor = new EntityExtractor();
|
|
586
586
|
|
|
587
|
-
|
|
587
|
+
export default {
|
|
588
588
|
SemanticInference,
|
|
589
589
|
EntityExtractor,
|
|
590
590
|
InferenceMethod,
|