In[]:=

Clear[g]

FixedPoint[Replace[XXXX]]

NestList[ReplaceList[XXXX]]

In[]:=

SubsetReplace[{f[a],g[b],f[c],g[d],g[c]},{g[x_],g[y_]}->Splice[{f[x],g[x+y]}]]

Out[]=

{f[a],f[b],g[b+d],f[c],g[c]}

#### How to represent an evaluation path?

How to represent an evaluation path?

What to with its “tentacles”?

FindEquationalProof

In[]:=

x=x+1

Out[]=

Hold[1+x]

In[]:=

x=.

#### cf. Monte Carlo sampling / probabilistic programming

cf. Monte Carlo sampling / probabilistic programming

#### Basic logic programming operation:

Basic logic programming operation:

FindReplacePath[{a->b,c->d},x,y]

FindReplacePath[{a->b,c->d},x,pattern]

#### ? SPARQL query

? SPARQL query

Find an intermediate on a path

RDF triple : tagged edge

Relation vs. event

x->relation->y

Triplestore is a hypergraph with ternary hyperedges {x, relation, y}

Can be a schema for the triples

A query finds a path (or several); or a subgraph

#### Proof representation

Proof representation

In[]:=

ProofObject["Properties"]

Out[]=

{Axioms,Logic,ProofDataset,ProofFunction,ProofGraph,ProofGraphWeighted,ProofLength,ProofNotebook,Theorem}

In[]:=

ProofObject["ProofGraph"]

Out[]=

In[]:=

ProofObject["ProofDataset"]

Out[]=

The proof shows how we instantiate laws of inference

Unify[lhs->f(X,Y,Z),rhs->f(g(Z),j(W),h(Y,a))]->[Z->h(Y,a),Y->j(W),X->g(Z)]

#### Other examples of potential proofs

Other examples of potential proofs

Simplify

#### Chemical reactions

Chemical reactions

States: chemical graphs

Tokens: bonds ??

Tokens: bonds ??

https://www.name-reaction.com/diels-alder-reaction

#### Game graphs

Game graphs

#### Tiling

Tiling

#### Recursion

Recursion

Evaluating Fibonacci : you want to collect all the leaves

Search analog: you want to pick a single leaf

In[]:=

NestGraph[x|->If[x<2,{1},{x-1,x-2}],6,10,VertexLabelsAutomatic]

Out[]=

#### Puzzle solving

Puzzle solving

https://static1.squarespace.com/static/5a1b43dbf9a61edc99dd61a1/t/5a3721b3f9619a424b7857e1/1513562556079/rushHour.pdf

#### State graphs

State graphs

[ Modelica standard ]

[ similar to Petri nets ]

Hanging differential equations off the discrete graph

[Acausal modeling]

(Represents system of equations as a graph)

https://reference.wolfram.com/system-modeler/libraries/Modelica/Modelica.StateGraph.html

#### DFAs etc.

DFAs etc.

Products of machines / wreath products etc.

#### Category theory

Category theory

Monoidal category : [n-ary functions]

## Elements

Elements

#### Tokens

States

Events

Reference frames / goals

Tokens

States

Events

Reference frames / goals

States

Events

Reference frames / goals

Strings: linked lists [could have a reconnection event]

Expressions: require backfilling events to reknit the results into a superexpression

#### Tokens could contain patterns: then one has do pattern unification to apply an event

Tokens could contain patterns: then one has do pattern unification to apply an event

### NestGraph deterministic or not

NestGraph deterministic or not

(Same as token deduplication?)

#### Deduplication is the equivalent of pre-caching everything, whether or the thing occurred to memoize

Deduplication is the equivalent of pre-caching everything, whether or the thing occurred to memoize

### Are tokens always knitted into states through atoms

Are tokens always knitted into states through atoms

## Possible Outputs

Possible Outputs

#### Add up every leaf ( e.g. recursive function evaluation)

Add up every leaf ( e.g. recursive function evaluation)

#### Find a winning path (search; logic programming; etc.)

Find a winning path (search; logic programming; etc.)

#### Find a probability distribution over paths (~ Monte Carlo ; probabilistic programming )

Find a probability distribution over paths (~ Monte Carlo ; probabilistic programming )

#### Proof assistant [ human assisted path finding ]

Proof assistant [ human assisted path finding ]

## Language Design

Language Design

#### We have expressions, but we do not have a way of representing the process of transformation

We have expressions, but we do not have a way of representing the process of transformation

Where does a pattern apply? [ AKA how does a state decompose into tokens? ]