Skip to content

Commit 861ede0

Browse files
authored
Merge pull request #149 from engboris/fix
Revert interact back to exec
2 parents 0396d29 + e52f58b commit 861ede0

37 files changed

+236
-236
lines changed

BASICS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ You can focus all stars of a constellation with `@`:
208208
(:= x [(+f X) X])
209209
(:= y (-f a))
210210
211-
(:= res1 (interact @#x #y)) ' normal execution
211+
(:= res1 (exec @#x #y)) ' normal execution
212212
(show #res1)
213213
214214
(:= res2 (fire @#x #y)) ' actions are used exactly once
@@ -226,7 +226,7 @@ Add constraints with `[ some star || (!= X1 Y1) ... (!= Xn Yn)]`:
226226
[(+f a)]
227227
[(+f b)]
228228
@[(-f X) (-f Y) (r X Y) || (!= X Y)]})
229-
(show (interact #ineq))
229+
(show (exec #ineq))
230230
```
231231

232232
where several equality constraints can be chained after `||`.
@@ -275,7 +275,7 @@ Constellations can act like logic programs (à la Prolog).
275275
(:= rules { (-childOf X Y) (-childOf Y Z) (+grandParentOf Z X) })
276276
277277
(:= query [(-childOf X b) (res X)])
278-
(show (interact { #facts #rules @#query }))
278+
(show (exec { #facts #rules @#query }))
279279
```
280280

281281
This asks: *Who are the children of `b`?*
@@ -313,7 +313,7 @@ A constellation must pass **all tests** to be considered of type `nat`.
313313
We then define the behavior of type assertions with a macro:
314314

315315
```stellogen
316-
(macro (:: Tested Test) (== @(interact @#Tested #Test) ok))
316+
(macro (:: Tested Test) (== @(exec @#Tested #Test) ok))
317317
```
318318

319319
It says that a `Tested` is of type `Test` when their interaction with focus on

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ dune exec sgen run -- <inputfile>
167167
(:= query [(-add <s s 0> <s s 0> R) R])
168168
169169
' Execute interaction
170-
(show (interact #add @#query))
170+
(show (exec #add @#query))
171171
```
172172

173173
## Example: Type Definition
@@ -178,7 +178,7 @@ dune exec sgen run -- <inputfile>
178178
179179
' Macro for type assertion
180180
(macro (:: Tested Test)
181-
(== @(interact @#Tested #Test) ok))
181+
(== @(exec @#Tested #Test) ok))
182182
183183
' Define nat type as interactive tests
184184
(spec nat {

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Stellogen's constellation-based model supports multiple programming paradigms:
7272
' Make x and y interact along (+f a) and (-f X)
7373
' The conflict is resolved and propagated to the other term X
7474
' It results in [a]
75-
(:= result (interact #x @#y))
75+
(:= result (exec #x @#y))
7676
7777
' Display result [a] on screen
7878
(show #result)

docs/compilation_and_abstract_machines.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ HALT:
645645
[(-add X Y Z) (+add (s X) Y (s Z))]})
646646
647647
(:= query [(-add <s s 0> <s s 0> R) R])
648-
(interact #add @#query)
648+
(exec #add @#query)
649649
```
650650

651651
**Step 1: Compile constellation definitions**
@@ -868,7 +868,7 @@ unify result X
868868
**Evaluate interactions at compile-time when possible:**
869869

870870
```stellogen
871-
(:= constant (interact #add @#two @#three))
871+
(:= constant (exec #add @#two @#three))
872872
```
873873

874874
If `add`, `two`, and `three` are all known at compile-time, evaluate now and store the result.
@@ -1895,7 +1895,7 @@ Term: (+add (s 0) (s 0) R)
18951895
```
18961896
[Debugger] Starting type check for 'bad'
18971897
[Step 1] Evaluating: (:: bad nat)
1898-
[Step 2] Expanding macro: (== @(interact @#bad #nat) ok)
1898+
[Step 2] Expanding macro: (== @(exec @#bad #nat) ok)
18991899
[Step 3] Focusing @#bad → (+nat [])
19001900
[Step 4] Loading #nat → { [(-nat 0) ok], [(-nat (s N)) (+nat N)] }
19011901
[Step 5] Scheduling interaction: (+nat []) with #nat
@@ -1922,7 +1922,7 @@ Term: (+add (s 0) (s 0) R)
19221922
(:= loop {
19231923
[(-loop X) (+loop X)]}) ' Bug: infinite loop
19241924
1925-
(interact #loop @#start)
1925+
(exec #loop @#start)
19261926
```
19271927

19281928
**Debug session:**
@@ -1968,7 +1968,7 @@ Term: (+add (s 0) (s 0) R)
19681968
[(-add X Y Z) (+add (s X) Y (s Z))]})
19691969
19701970
(:= query [(-add <s s 0> <s s 0> R) R])
1971-
(show (interact #add @#query))
1971+
(show (exec #add @#query))
19721972
```
19731973

19741974
**Debug session with visualization:**
@@ -2089,7 +2089,7 @@ sgen debug --trace program.sg
20892089
stellogen> :debug on
20902090
[Debugger enabled]
20912091
2092-
stellogen> (interact #add @#query)
2092+
stellogen> (exec #add @#query)
20932093
[Breakpoint] Entering constellation 'add'
20942094
20952095
(debug) :step

docs/cut_and_control_flow.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ Prolog maintains a **choice point** at each clause. Backtracking explores altern
362362
[(-member X [_|T]) (+member X T)]})
363363
364364
(:= query [(-member X [1 2 3]) X])
365-
(show (interact #member @#query))
365+
(show (exec #member @#query))
366366
' Result: [1, 2, 3] (all at once, or depends on implementation)
367367
```
368368

@@ -427,7 +427,7 @@ R = 5. % Deterministic
427427
[(-max X Y Y)]})
428428
429429
(:= query [(-max 5 3 R) R])
430-
(show (interact #max @#query))
430+
(show (exec #max @#query))
431431
```
432432

433433
**Problem:** Both stars might match (or neither, depending on constraint handling). There's no way to say "if the first matches, don't try the second."
@@ -479,7 +479,7 @@ While Stellogen can't reproduce Prolog's cut, it has **different mechanisms** fo
479479
480480
(:= query [(-f X) (-f Y) (result X Y)])
481481
482-
(interact #facts @#query)
482+
(exec #facts @#query)
483483
' All combinations: (result 1 1), (result 1 2), (result 2 1), (result 2 2)
484484
```
485485

@@ -710,7 +710,7 @@ Or with syntactic sugar:
710710

711711
```stellogen
712712
(macro (not Test)
713-
(interact @#Test #failure-check))
713+
(exec @#Test #failure-check))
714714
715715
(:= failure-check {
716716
[(+anything) fail]})
@@ -937,7 +937,7 @@ Or more directly, introduce `|` separator for alternatives:
937937
938938
''' Deterministic if-then-else '''
939939
(macro (if Cond Then Else)
940-
(interact
940+
(exec
941941
{ [(+cond) @#Then]
942942
[(-cond) @#Else] }
943943
@#Cond))

docs/interaction_nets_and_combinators.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,10 @@ This encodes the identity agent in multiplicative linear logic (MLL):
421421
[+cuts [
422422
[(-7 X) (-8 X)]]]})
423423
424-
(:= vehicle (eval (interact #ps1 @[-vehicle])))
425-
(:= cuts (eval (interact #ps1 @[-cuts])))
424+
(:= vehicle (eval (exec #ps1 @[-vehicle])))
425+
(:= cuts (eval (exec #ps1 @[-cuts])))
426426
427-
(show (interact #vehicle #cuts))
427+
(show (exec #vehicle #cuts))
428428
```
429429

430430
**Analysis:**
@@ -466,7 +466,7 @@ This is the classic **cut elimination** from linear logic proof theory:
466466
[(-id X) (-arg X)]
467467
@[(+arg [r|X]) (out X)]])
468468
469-
(show (interact #id #id_arg #linker))
469+
(show (exec #id #id_arg #linker))
470470
```
471471

472472
**Analysis:**

docs/language_comparisons.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Z = ann.
104104
[(-grandparent X Z) (-parent X Y) (+parent Y Z)]})
105105
106106
(:= query [(-grandparent tom Z) Z])
107-
(show (interact #grandparent @(process #query #family)))
107+
(show (exec #grandparent @(process #query #family)))
108108
' Result: [ann, jim]
109109
```
110110

@@ -128,7 +128,7 @@ R = s(s(s(s(0)))).
128128
[(-add X Y Z) (+add (s X) Y (s Z))]})
129129
130130
(:= query1 [(-add <s s 0> <s s 0> R) R])
131-
(show (interact #add @#query1))
131+
(show (exec #add @#query1))
132132
' Result: (s (s (s (s 0))))
133133
```
134134

@@ -198,7 +198,7 @@ X = 3. % backtrack
198198
(:= x (+f a))
199199
#x ' Just the identifier
200200
@#x ' Focused/evaluated
201-
(interact @#x #y) ' Explicit interaction
201+
(exec @#x #y) ' Explicit interaction
202202
```
203203

204204
#### 5. Type Systems
@@ -257,7 +257,7 @@ Both use S-expressions as the primary syntactic form.
257257
**Stellogen:**
258258
```stellogen
259259
(:= add { ... })
260-
(show (interact #add @#query))
260+
(show (exec #add @#query))
261261
```
262262

263263
Both are homoiconic—code is data represented as lists/trees.
@@ -281,7 +281,7 @@ Both support powerful macro systems for syntactic extension.
281281
```stellogen
282282
(macro (spec X Y) (:= X Y))
283283
(macro (:: Tested Test)
284-
(== @(interact @#Tested #Test) ok))
284+
(== @(exec @#Tested #Test) ok))
285285
286286
(spec nat { ... })
287287
(:: zero nat)
@@ -438,7 +438,7 @@ Both use unification to relate terms.
438438
```stellogen
439439
(:= fact [(+hello q)])
440440
(:= query [(-hello X) X])
441-
(show (interact #fact @#query))
441+
(show (exec #fact @#query))
442442
```
443443

444444
#### 2. Relational Queries
@@ -474,11 +474,11 @@ Both can express relations that work in multiple directions.
474474
475475
' Forward
476476
(:= q1 [(-append [1 2] [3 4] R) R])
477-
(show (interact #appendo @#q1))
477+
(show (exec #appendo @#q1))
478478
479479
' Backward (if properly defined)
480480
(:= q2 [(-append X [3 4] [1 2 3 4]) X])
481-
(show (interact #appendo @#q2))
481+
(show (exec #appendo @#q2))
482482
```
483483

484484
#### 3. Logic Variables
@@ -997,7 +997,7 @@ map f xs
997997
**Stellogen:** Interaction-based.
998998

999999
```stellogen
1000-
(interact #map @#f @#xs)
1000+
(exec #map @#f @#xs)
10011001
```
10021002

10031003
#### 3. Narrowing
@@ -1128,7 +1128,7 @@ Both track resources and control their use.
11281128

11291129
```stellogen
11301130
(fire #a #b) ' Linear
1131-
(interact #a #b) ' Non-linear
1131+
(exec #a #b) ' Non-linear
11321132
```
11331133

11341134
### Differences from Stellogen
@@ -1451,7 +1451,7 @@ Most languages evaluate automatically. Stellogen gives **fine-grained control**:
14511451
```stellogen
14521452
#x ' Reference (no evaluation)
14531453
@#x ' Focus (evaluate)
1454-
(interact #x #y) ' Non-linear interaction
1454+
(exec #x #y) ' Non-linear interaction
14551455
(fire #x #y) ' Linear interaction
14561456
(process #a #b #c) ' Chained interaction
14571457
(eval #x) ' Meta-level evaluation
@@ -1468,7 +1468,7 @@ Most languages evaluate automatically. Stellogen gives **fine-grained control**:
14681468
14691469
(:= zero (+nat 0))
14701470
(:: zero nat)
1471-
' Type check ≡ (== @(interact @#zero #nat) ok)
1471+
' Type check ≡ (== @(exec @#zero #nat) ok)
14721472
```
14731473

14741474
This is a radically different approach from all other languages.

docs/natural_scripting_syntax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ For more flexibility, allow system scoping within a file:
500500
)
501501
502502
' Back to regular Stellogen
503-
(show (interact @#e #automaton))
503+
(show (exec @#e #automaton))
504504
505505
' Another system in the same file
506506
(within-system state-machine
@@ -1303,7 +1303,7 @@ type nat = zero | succ of nat
13031303
13041304
' File 5: Core Stellogen (no system)
13051305
(:= x 42)
1306-
(show (interact @#a @#b))
1306+
(show (exec @#a @#b))
13071307
```
13081308

13091309
**All files** compile to the same core Stellogen, interact seamlessly, but each has the **natural syntax** for its domain.

0 commit comments

Comments
 (0)