## Not signed in

Want to take part in these discussions? Sign in if you have an account, or apply for one below

## Discussion Tag Cloud

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

• CommentRowNumber1.
• CommentAuthorKeithEPeterson
• CommentTimeNov 24th 2016
• (edited Nov 30th 2016)

In programming, legal contract drafting, making jokes and filling in madlibs, students cheating on essays, and large scale substitution in math, (even closure operations?), aren’t all these things are instances of applying template, but how does templating work from an n-POV?

My instincts tell me it’s an Operad of some sort, given how composition of templates ought to behave. Is there a Linguistic Operad of sorts that handles instances of templating?

Edit: In linguistics language, I’m asking about ’phrasal templating’ and it’s categorical semantics.

• CommentRowNumber2.
• CommentAuthorDavidRoberts
• CommentTimeNov 24th 2016

Going out on a limb, it might relate to Spivak’s ologs.

• CommentRowNumber3.
• CommentAuthorRodMcGuire
• CommentTimeNov 25th 2016

Start with a $setAct$ - the action of a set $P$ on a set $V$ - act: $P \times V \to V$.

For a fixed set of property names these form the category $setActs(P)$ with the obvious $P$ preserving concrete morphisms (whose structure may be uninteresting).

Enhance a setAct $A$ with a distinguished point of its objects $V$ called $root$ giving the structure $\langle \, r A\rangle$, and say that $\langle r \, A\rangle$ has the property of being rooted if every object is accessible from the root using a path from the free monoid $P^*$.

Rooted setActs form the category $rSetActs(P)$ which is the quotient object lattice of $\bot(P)$ the free rooted setAction of $P$ - an infinite tree with edges labeled from $P$. $\top(P)$ is the one object “rose” with $P$ arcs - its free category $\top(P)^*$ is just the one object free monoid $P^*$.

This category contains some objects that can be displayed as similar to simple JavaScript objects, e.g. in $rSetActs(\{name,\, first,\, last,\, a,\, b\})$

$\{name: \{first: John, last: Smith\}\}$

The join in this lattice can give such as:

$\{name: \{first: John\}\} \vee \{name: \{last: Smith\}\} = \{name: \{first: John, last: Smith\}\}$

(The join here might be more specifically called rootJoin because it equates the roots of its arguments. An “atomic” object such as $John$ actually corresponds to a coAtom of the lattice and the lattice has an infinite number of them. In JavaScript trying to access a property that is not present returns the distinguished value $unknown$. In this variation unknown properties correspond to $\bot$)

For an object (act) in both $SetActs(P)$ and $rSetActs(P)$, $hom(v,w)$ is the set of all paths from $v$ to $w$. This set can be empty or encoded as a regular expression / Kleene algebra. $hom(v,w)$ is biRooted containing both the root $v$ and a coRoot $w$. A biRooted act will be displayed as $\langle r\, A\, cr\rangle$,

The set of all homs internal to the objects, $allHoms(setAct(P))$, is obviously a Heyting lattice (biHeyting?, Boolean?) which enriches every variety of setAct.

By adding biRoot structure to any setAct we can form the category $biSetActs(P)$ where the objects are restricted to being rooted. This is at least a Heyting lattice that contains $allHoms(setActs(P))$ as a sub lattice.

$biSetAct(P)$ has an additional monoid? structure: the operator $+$ called conJoin (with unit the empty path $\langle e \bot e\rangle$) which vaguely behaves as:

$\langle a A b\rangle + \langle b B c\rangle = \langle a C c\rangle$

This conJoining essentially gives A with its coRoot joined to B’s root and its coRoot changed to correspond to B’s.

For a JavaScript like example we have

$\{name: \{first: *, last: Smith\}\} + *John = \{name: \{first: *John, last: Smith\}\}$

where the * in an object is used to indicate its coRoot.

I believe I have this all worked out for when setActions are restricted to being quasi-finite which means that an act has a finite number of objects not isomorpic to $\bot$. In particular $hom(v,w)$ in an act $A$ contains all objects found on paths from $v$ to $w$ - those off any such path are become $\bot$s. A $hom(v,w)$ has the property that all of its non-$\bot$ objects drain to $w$ via some path. General biRooted objects don’t have this property.

In the above discussion I am somewhat conflating an act $A$ which is an edge labeled quiver with its free category $A^*$ in which the morphisms are paths. A more precise discussion would distinguish these.

• CommentRowNumber4.
• CommentAuthorKeithEPeterson
• CommentTimeNov 29th 2016
• (edited Nov 29th 2016)
Actually, now that I think about it, a template can be viewed as a diagram with some internal elements being global sections/generalized elements, which upholds typing.
• CommentRowNumber5.
• CommentAuthorKeithEPeterson
• CommentTimeNov 30th 2016
• (edited Nov 30th 2016)

Scrap what I said above. The thing I was looking for is called a “Generic Zipper”, it’s a sort of “derivative” of data-types.

• CommentRowNumber6.
• CommentAuthorTodd_Trimble
• CommentTimeNov 30th 2016
• (edited Nov 30th 2016)

Keith, if you set the formatting to Markdown+Itex, then you can create a link like so: Scrap Your Zippers. See the Source for the syntax.

• CommentRowNumber7.
• CommentAuthorRodMcGuire
• CommentTimeNov 30th 2016

A zipper appears to be a data structure implementing some of the rooted bi-pointed acts I discussed above.

The Wikipedia article talks about a path to a hole. Above I talked about all paths to a hole which turns out to be a bi-rooted act itself (and a regular expression / Kleene algebra). I’m not familiar enough with zippers to know if they can handle my potentially cyclic data structures or if anybody has given them lattice ordering.

Complementary to conJoin defined above there is the conMeet “$-$” monoidial operator with $\top$ as its unit. Replacing the coPoint in an act requires two steps: “removing” it by conMeeting with $\bot$ followed by conJoining in the replacement value .

$\{first: *John, last: Smith\} - *\bot + *Mary = \{first: *Mary, last: Smith\}$

And just for another example here is appending linked lists analogous to the use of difference lists in Prolog.

$[John\, likes | *] + [to \,eat | *] + [pie | *] = [John\, likes\, to\, eat\, pie | *]$ $\{h:John t:\{h:likes t:*\}\} + \{h:to t:\{h:eat t:*\}\} + \{h: pie t:*\}$ $= \{h:John t:\{h:likes t:\{h:to t:\{h:eat t:\{h: pie t:*\}\}\}\}\}$
• CommentRowNumber8.
• CommentAuthorKeithEPeterson
• CommentTimeNov 30th 2016
Yeah, your post made me dive deeper into the net to understand what you were meaning. The Haskell community has done everything already it seems... >_>
• CommentRowNumber9.
• CommentAuthorKeithEPeterson
• CommentTimeDec 25th 2016

Is there a notion of $\mathcal{E}$-acts, for an arbitrary topos $\mathcal{E}$, or is this confined to just bi-heyting topoi?

• CommentRowNumber10.
• CommentAuthorRodMcGuire
• CommentTimeDec 25th 2016

you should ignore what I said about the category Kleene(P) (as what enriches various act categories) as being obviously Heyting - I was getting levels confused.

There are several different ways to define Kleene algebras. I haven’t worked out which one I’m talking about.

I came across this paper a while back: Pippenger - Regular languages and Stone Duality, where he says:

it is well known that the regular languages over a fixed alphabet form a Boolean algebra and that the “implicit operations” with a fixed number of operands form a Stone space.

I should work on understanding this paper or the work derived from it.