Speculative grammar in reflexive graphs
May 21, 2023 — Brad Venner
using Catlab.Graphs, Catlab.CategoricalAlgebra
using Catlab.Graphics
using DataFrames
draw(g; kw...) = to_graphviz(g; node_labels=true, edge_labels=true, kw...)
g = path_graph(ReflexiveGraph,3)
add_edge!(g, 1,3)
draw(g)
h = path_graph(ReflexiveGraph,3)
add_edge!(h, 1,3)
draw(h)
αs = homomorphisms(g, h)
df = rename!(DataFrame(Tuple(α[:V]) for α in αs), ["v$i" for i in 1:nv(g)])
df
p2 = ob(product(g,h))
draw(p2)
# βs = homomorphisms(p2, h)
# df2 = rename!(DataFrame(Tuple(β[:V]) for β in βs), ["v$i" for i in 1:nv(p2)])
# df2