@aleph-ai/tinyaleph 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +219 -0
- package/core/index.js +83 -1
- package/core/lambda.js +845 -0
- package/core/reduction.js +741 -0
- package/core/types.js +913 -0
- package/docs/README.md +84 -0
- package/docs/design/ALEPH_CHAT_ARCHITECTURE.md +1 -1
- package/docs/design/AUTONOMOUS_LEARNING_DESIGN.md +1492 -0
- package/docs/design/WHITEPAPER_GAP_ANALYSIS.md +171 -4
- package/docs/reference/README.md +277 -1
- package/docs/theory/03-phase-synchronization.md +196 -0
- package/docs/theory/README.md +47 -0
- package/package.json +2 -2
- package/physics/index.js +30 -10
- package/physics/sync-models.js +770 -0
package/docs/README.md
CHANGED
|
@@ -14,6 +14,10 @@ Deep exploration of the theoretical foundations:
|
|
|
14
14
|
- **Entropy Minimization** - Reasoning as entropy reduction
|
|
15
15
|
- **Non-Commutativity** - Why word order matters
|
|
16
16
|
- **Two-Layer Meaning** - Prime substrate vs. surface vocabulary
|
|
17
|
+
- **Formal Type System** - Typed term calculus with N(p)/A(p)/S types
|
|
18
|
+
- **Reduction Semantics** - Strong normalization and confluence
|
|
19
|
+
- **Lambda Translation** - Model-theoretic semantics via λ-calculus
|
|
20
|
+
- **Enochian Language** - The 21-letter angelic alphabet
|
|
17
21
|
|
|
18
22
|
### [Part II: Guide](./guide/README.md)
|
|
19
23
|
Practical application of Aleph:
|
|
@@ -74,6 +78,10 @@ So too can concepts be:
|
|
|
74
78
|
| **Entropy Minimization** | Reasoning as entropy reduction |
|
|
75
79
|
| **Multiple Backends** | Semantic, Cryptographic, Scientific |
|
|
76
80
|
| **LLM Integration** | Couple with language models |
|
|
81
|
+
| **Formal Type System** | N(p)/A(p)/S types with ordering constraints |
|
|
82
|
+
| **Reduction Semantics** | Strong normalization with ⊕ operators |
|
|
83
|
+
| **Lambda Translation** | τ: Terms → λ-expressions |
|
|
84
|
+
| **Enochian Vocabulary** | 21-letter alphabet, prime basis, sedenions |
|
|
77
85
|
|
|
78
86
|
---
|
|
79
87
|
|
|
@@ -143,6 +151,19 @@ console.log({
|
|
|
143
151
|
│
|
|
144
152
|
▼
|
|
145
153
|
┌─────────────────────────────────────────────────────────────┐
|
|
154
|
+
│ FORMAL SEMANTICS LAYER │
|
|
155
|
+
│ │
|
|
156
|
+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
|
|
157
|
+
│ │ Type System │ │ Reduction │ │ Lambda Translation │ │
|
|
158
|
+
│ │ │ │ │ │ │ │
|
|
159
|
+
│ │ N(p), A(p) │ │ →-steps │ │ τ: Terms → λ-expr │ │
|
|
160
|
+
│ │ FUSE(p,q,r) │ │ ⊕ operators│ │ β-reduction │ │
|
|
161
|
+
│ │ ◦, ⇒ │ │ Normal form│ │ Model semantics │ │
|
|
162
|
+
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
|
|
163
|
+
└─────────────────────────────────────────────────────────────┘
|
|
164
|
+
│
|
|
165
|
+
▼
|
|
166
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
146
167
|
│ OUTPUT │
|
|
147
168
|
│ { result, primes, entropy, coherence, collapsed } │
|
|
148
169
|
└─────────────────────────────────────────────────────────────┘
|
|
@@ -150,6 +171,69 @@ console.log({
|
|
|
150
171
|
|
|
151
172
|
---
|
|
152
173
|
|
|
174
|
+
## Formal Semantics
|
|
175
|
+
|
|
176
|
+
The library implements a rigorous formal semantics layer based on model-theoretic foundations:
|
|
177
|
+
|
|
178
|
+
### Type System
|
|
179
|
+
|
|
180
|
+
Three primitive types with prime indexing:
|
|
181
|
+
|
|
182
|
+
| Type | Notation | Semantics |
|
|
183
|
+
|------|----------|-----------|
|
|
184
|
+
| **Noun** | N(p) | Denotes prime p directly: ⟦N(p)⟧ = p |
|
|
185
|
+
| **Adjective** | A(p) | Partial function: f_p : D ⇀ D where dom(f_p) ⊆ {q : p < q} |
|
|
186
|
+
| **Sentence** | S | Discourse state: sequence in D* |
|
|
187
|
+
|
|
188
|
+
### Key Constructs
|
|
189
|
+
|
|
190
|
+
```javascript
|
|
191
|
+
const { N, A, FUSE, CHAIN, SENTENCE, SEQ, IMPL, TypeChecker } = require('@aleph-ai/tinyaleph');
|
|
192
|
+
|
|
193
|
+
// Typed terms with prime indexing
|
|
194
|
+
const n7 = N(7); // Noun term
|
|
195
|
+
const a3 = A(3); // Adjective term
|
|
196
|
+
|
|
197
|
+
// Application with ordering constraint (p < q)
|
|
198
|
+
const chain = a3.apply(n7); // A(3)N(7) valid since 3 < 7
|
|
199
|
+
|
|
200
|
+
// Triadic fusion where sum is prime
|
|
201
|
+
const fused = FUSE(3, 5, 11); // 3+5+11=19 ✓
|
|
202
|
+
|
|
203
|
+
// Sentence composition
|
|
204
|
+
const s1 = SENTENCE(7);
|
|
205
|
+
const s2 = SENTENCE(11);
|
|
206
|
+
const compound = SEQ(s1, s2); // s₁ ◦ s₂
|
|
207
|
+
const implies = IMPL(s1, s2); // s₁ ⇒ s₂
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Reduction Semantics
|
|
211
|
+
|
|
212
|
+
Strong normalization guaranteed by strictly decreasing size measure:
|
|
213
|
+
|
|
214
|
+
```javascript
|
|
215
|
+
const { ReductionSystem, NextPrimeOperator, demonstrateStrongNormalization } = require('@aleph-ai/tinyaleph');
|
|
216
|
+
|
|
217
|
+
const system = new ReductionSystem();
|
|
218
|
+
system.addOperator(new NextPrimeOperator());
|
|
219
|
+
|
|
220
|
+
const proof = demonstrateStrongNormalization([3, 5, 7], system);
|
|
221
|
+
console.log(proof.terminates); // Always true!
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Enochian Language
|
|
225
|
+
|
|
226
|
+
The 21-letter angelic alphabet with prime basis:
|
|
227
|
+
|
|
228
|
+
```javascript
|
|
229
|
+
const { EnochianEngine, CORE_VOCABULARY } = require('@aleph-ai/tinyaleph/apps/sentient/lib/enochian-vocabulary');
|
|
230
|
+
|
|
231
|
+
const engine = new EnochianEngine();
|
|
232
|
+
const parsed = engine.parseWord('MADRIAX'); // "O ye heavens"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
153
237
|
## License
|
|
154
238
|
|
|
155
239
|
MIT License
|
|
@@ -122,7 +122,7 @@ class LMStudioClient {
|
|
|
122
122
|
this.baseUrl = options.baseUrl || 'http://localhost:1234/v1';
|
|
123
123
|
this.model = options.model || 'local-model';
|
|
124
124
|
this.temperature = options.temperature || 0.7;
|
|
125
|
-
this.maxTokens = options.maxTokens ||
|
|
125
|
+
this.maxTokens = options.maxTokens || 32768;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
async chat(messages, options) { /* ... */ }
|