Skip to content

Commit

Permalink
Add explicit heads
Browse files Browse the repository at this point in the history
  • Loading branch information
maxitg committed Feb 9, 2025
1 parent b5c3f8f commit ca75830
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 22 deletions.
4 changes: 3 additions & 1 deletion Documentation/Generators/GenerateMultihistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &

<img src="/Documentation/Images/GenerateMultihistoryExample.png"
width="478.2"
alt="Out[] = ... {1, 2} -> {3 (* token 5 *)}, {2, 1} -> {3 (* token 6 *)}, {1, 3 (* init *)} -> {4}, <<7>> ...">
alt="Out[] = Graph[...
{1, 2} -> {3 (* token 5 *)}, {2, 1} -> {3 (* token 6 *)}, {1, 3 (* init *)} -> {4}, <<7>>
...]">
4 changes: 2 additions & 2 deletions Documentation/Generators/GenerateSingleHistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &

<img src="/Documentation/Images/GenerateSingleHistoryExample.png"
width="478.2"
alt="Out[] = ...
alt="Out[] = Graph[...
token-event graph where all tokens have out degrees less or equal than 1:
{1, 2 (* init *)} -> {3, -1, 2 (* gen 1 *)},
{3, -1} -> {2 (* gen 2 *), 4 (* gen 2 *), -3},
{2 (* gen 1 *), 2 (* gen 2 *)} -> {4 (* gen 3 sum *), 0, 4 (* gen 3 product *)},
<<7>>
...">
...]">

Note that there is a distinction between single-history and single-path systems. Single-path systems are defined as ones
where there is only one event possible from every state. A Turing machine would be an example of a single-path system.
Expand Down
6 changes: 3 additions & 3 deletions Documentation/Generators/MaxDestroyerEvents.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &

<img src="/Documentation/Images/MaxDestroyerEvents1.png"
width="322.2"
alt="Out[] = ... {1, 2} -> {3 (* gen 1 *)}, {3 (* init *), 3 (* gen 1 *)} -> 6 ...">
alt="Out[] = Graph[... {1, 2} -> {3 (* gen 1 *)}, {3 (* init *), 3 (* gen 1 *)} -> 6 ...]">

If unset (which defaults to [`Infinity`](https://reference.wolfram.com/language/ref/Infinity.html)), it will generate a
full multihistory object subject to other selection and stopping parameters:
Expand All @@ -26,7 +26,7 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &

<img src="/Documentation/Images/MaxDestroyerEventsInfinity.png"
width="478.2"
alt="Out[] = ... {1, 2} -> {3 (* 1 + 2 *)}, {2, 1} -> {3 (* 2 + 1 *)}, {1, 3 (* init *)} -> {4}, <<3>> ...">
alt="Out[] = Graph[... {1, 2} -> {3 (* 1 + 2 *)}, {2, 1} -> {3 (* 2 + 1 *)}, {1, 3 (* init *)} -> {4}, <<3>> ...]">

If set to a finite number, it will generate a partial multihistory:

Expand All @@ -38,6 +38,6 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &

<img src="/Documentation/Images/MaxDestroyerEvents5.png"
width="478.2"
alt="Out[] = ... token-event graph containing tokens with out degrees up to 5 ...">
alt="Out[] = Graph[... token-event graph containing tokens with out degrees up to 5 ...]">

Note that results generally depend on the event order in this case, similar to single histories.
2 changes: 1 addition & 1 deletion Documentation/Generators/MaxEvents.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ In[] := #["ExpressionsEventsGraph"] & @

<img src="/Documentation/Images/MaxEventsExample.png"
width="478.2"
alt="Out[] = ... token-event graph with 9 events ...">
alt="Out[] = Graph[... token-event graph with 9 events ...]">

Compare to [`MaxGeneration`](MaxGeneration.md), which controls the depth of the evaluation instead.
6 changes: 4 additions & 2 deletions Documentation/Generators/MaxGeneration.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ In[] := #["ExpressionsEventsGraph",

<img src="/Documentation/Images/TokenEventGraphGenerations.png"
width="444.6"
alt="Out[] = ... token-event graph with 9 tokens arranged in 3 layers, and 3 events in 2 layers in between ...">
alt="Out[] = Graph[...
token-event graph with 9 tokens arranged in 3 layers, and 3 events in 2 layers in between
...]">

Restricting the number of generations to one will prevent the last two events from occurring. Note, however, that
another event is created instead:
Expand All @@ -34,7 +36,7 @@ In[] := #["ExpressionsEventsGraph"] & @ SetReplaceTypeConvert[WolframModelEvolut

<img src="/Documentation/Images/MaxGeneration.png"
width="478.2"
alt="Out[] = ... token-event graph with 2 layers of tokens and a single layer of events ...">
alt="Out[] = Graph[... token-event graph with 2 layers of tokens and a single layer of events ...]">

`MaxGeneration` is an event selection parameter, not a stopping condition. That is, the evolution of the system won't
stop if a match (tentative event) with a generation greater than the constraint is encountered. Instead, it will ignore
Expand Down
6 changes: 4 additions & 2 deletions Documentation/Generators/MinEventInputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &

<img src="/Documentation/Images/MinEventInputs0.png"
width="367.8"
alt="Out[] = ... {} -> {0}, {1 (* init *)} -> {1 (* gen 1 *)}, {2 (* init *)} -> {2 (* gen 1 *)}, <<7>> ...">
alt="Out[] = Graph[...
{} -> {0}, {1 (* init *)} -> {1 (* gen 1 *)}, {2 (* init *)} -> {2 (* gen 1 *)}, <<7>>
...]">

and `MinEventInputs -> 2`:

Expand All @@ -27,4 +29,4 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &

<img src="/Documentation/Images/MinEventInputs2.png"
width="478.2"
alt="Out[] = ... {1, 2} -> {3 (* 1 + 2 *)}, {2, 1} -> {3 (* 2 + 1 *)}, {1, 3 (* init *)} -> {4}, <<7>> ...">
alt="Out[] = Graph[... {1, 2} -> {3 (* 1 + 2 *)}, {2, 1} -> {3 (* 2 + 1 *)}, {1, 3 (* init *)} -> {4}, <<7>> ...]">
6 changes: 3 additions & 3 deletions Documentation/Generators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &

<img src="/Documentation/Images/MultisetSubstitutionSystemExample.png"
width="444.6"
alt="Out[] = ... {1, 2} -> {3 (* gen 1 *)}, {3 (* init *), 4} -> {7}, {3 (* gen 1 *), 7} -> {10} ...">
alt="Out[] = Graph[... {1, 2} -> {3 (* gen 1 *)}, {3 (* init *), 4} -> {7}, {3 (* gen 1 *), 7} -> {10} ...]">

We can also use a more general [`GenerateMultihistory`](GenerateMultihistory.md) and specify
[`MaxDestroyerEvents`](MaxDestroyerEvents.md) manually.
Expand All @@ -42,13 +42,13 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &

<img src="/Documentation/Images/MultisetSubstitutionSystemPartialMultihistory.png"
width="478.2"
alt="Out[] = ...
alt="Out[] = Graph[...
{1, 2} -> {3 (* gen 1 *)},
{1, 3 (* init *)} -> {4 (* gen 1 *)},
{2, 3 (* init *)} -> {5},
{3 (* gen 1 *), 4 (* init *)} -> {7},
{4 (* init *), 5} -> {9}
...">
...]">

The same generators support multiple systems. In addition to
[`MultisetSubstitutionSystem`](/Documentation/Systems/MultisetSubstitutionSystem.md), other examples include
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Systems/AtomicStateSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &

<img src="/Documentation/Images/AtomicStateSystemExample.png"
width="858.6"
alt="Out[] = ... 0 -> Rule 1 -> 1, 0 -> Rule 2 -> -1, 1 -> Rule 1 -> 2, <<26>>, -3 -> Rule 2 -> -4 ...">
alt="Out[] = Graph[... 0 -> Rule 1 -> 1, 0 -> Rule 2 -> -1, 1 -> Rule 1 -> 2, <<26>>, -3 -> Rule 2 -> -4 ...]">

Note that spacelike separation is not possible in the `AtomicStateSystem`. As a result, branching due to overlaps of
different subsets of input tokens cannot occur. And, since events cannot produce branchlike-separated outputs and there
Expand Down
6 changes: 3 additions & 3 deletions Documentation/Systems/MultisetSubstitutionSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &

<img src="/Documentation/Images/MultisetSubstitutionSystemExample.png"
width="444.6"
alt="Out[] = ... {1, 2} -> {3 (* gen 1 *)}, {3 (* init *), 4} -> {7}, {3 (* gen 1 *), 7} -> {10} ...">
alt="Out[] = Graph[... {1, 2} -> {3 (* gen 1 *)}, {3 (* init *), 4} -> {7}, {3 (* gen 1 *), 7} -> {10} ...]">

Arbitrary Wolfram Language patterns are supported including
[conditions](https://reference.wolfram.com/language/ref/Condition.html) such as `{a_ /; a > 0, b_}` and
Expand All @@ -42,10 +42,10 @@ In[] := #["ExpressionsEventsGraph", VertexLabels -> Placed[Automatic, After]] &

<img src="/Documentation/Images/MultisetSubstitutionSystemConditionsAndSequences.png"
width="478.2"
alt="Out[] = ...
alt="Out[] = Graph[...
generation 1: {1, 2} -> {3}, {1, 4} -> {5}, {2, 3} -> {5}, {3, 4} -> {7}, {1, 2, 4} -> {7},
generation 2: {2, 5} -> {7}, {3 (* gen 1 *), 4} -> {7}
...">
...]">

Note, however, that the system cannot recognize if the code on the right-hand side is nondeterministic, so only the
first output will be used for each assignment of pattern variables.
Expand Down
4 changes: 2 additions & 2 deletions Documentation/TypeSystem/$SetReplaceTypeGraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ In[] := $SetReplaceTypeGraph

<img src="/Documentation/Images/$SetReplaceTypeGraph.png"
width="787.8"
alt="Out[] = ...
alt="Out[] = Graph[...
AtomicStateSystem v0 -> MultisetSubstitutionSystem v0,
MultisetSubstitutionSystem v0 -> WolframModelEvolutionObject v2
...">
...]">

It is a [`Graph`](https://reference.wolfram.com/language/ref/Graph.html) representation of a directed hypergraph with
types and properties as vertices and implementations of translations and properties as edges.
Expand Down
4 changes: 3 additions & 1 deletion Documentation/TypeSystem/$SetReplaceTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ In[] := $SetReplaceTypes
<img src="/Documentation/Images/$SetReplaceTypes.png"
width="791.4"
alt="Out[] = {
[... AtomicStateSystem v0 ...], [... MultisetSubstitutionSystem v0 ...], [... WolframModelEvolutionObject v2 ...]
SetReplaceType[... AtomicStateSystem v0 ...],
SetReplaceType[... MultisetSubstitutionSystem v0 ...],
SetReplaceType[... WolframModelEvolutionObject v2 ...]
}">
2 changes: 1 addition & 1 deletion Documentation/TypeSystem/SetReplaceObjectType.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ specification usually contains its version:
width="628.2"
alt="
In[] := SetReplaceObjectType @ Multihistory[... MultisetSubstitutionSystem v0 ...]
Out[] = [... MultisetSubstitutionSystem v0 ...]
Out[] = SetReplaceType[... MultisetSubstitutionSystem v0 ...]
">

0 comments on commit ca75830

Please sign in to comment.