Completeness proof

The graphs we consider in this paper are finite edge-labelled, node labelled graphs where the incoming and outgoing edges to each node are ordered. We also impose a type discipline to ensure that the edge and node labels match.

A generator for such a graph is:

This is the usual notion of a generator for a term algebra, except that we are allowing constructors to have multiple result sorts, since we will be generating syntax graphs rather than syntax trees.

A flow graph G for a given generator is:

A morphism F between flow graphs G and G' is:

Acyclic flow graphs over a given generator form a category where:

(If we wanted to be completely formal here, we would define this to be a bicategory, and make the use of isomorphisms explicit, however we leave such a construction to the interested reader.)

We have already seen how such graphs form a symmetric monoidal category. We shall now show that this is the free symmetric monoidal category over a set of generators, by showing that the smc axioms are sound and complete for acyclic flow graphs.

We can construct the term algebra for the free smc over a generator as having vectors of sorts for objects, and morphisms given by the grammar (together with the familiar graphical interpretation):

f,g ::= idX
| f ; g
| f g
| symmX Y
| c

together with the obvious typings. We shall write f = g if f and g are provably equal using the smc axioms. We shall write [[f]] for the interpretation of f as an acyclic flow graph.

We can now show that acyclic flow graphs are the free smc over a generator, by showing that the smc axioms are sound and complete for the graph semantics of a term. As usual, soundness is routine, but completeness requires a normal form result.

Proposition (Soundness). If f = g then [[f]] = [[g]].

Proof. Inspection of each of the smc axioms shows that they are all graph isomorphisms.

We can now lead up to the definition of the normal form. We shall first show completeness for terms without constructors, which we shall call permutations, ranged over by p.

Proposition (Normalization of permutations). For any permutation p : X1,X,X2 Y we can find Y1,X,Y2 = Y and q : X1,X2 Y1,Y2 such that:

=

Proof.

From this we can show completeness of the proof system for permutations.

Proposition (Completeness for permutations). If [[p]] = [[q]] then p = q.

Proof. An induction on the type of p and q.

Proposition (Cancellation of permutations). For any term f such that [[f]] = [[p ; g]] we can find f' such that f = p ; f' and [[f']] = [[g]].

Proof.

A vine is a term of the form:

Proposition. For any term f there is a vine g such that f = g.

Proof. An induction on f.

Proposition (Cancellation of nodes). For any term f such that [[f]] = [[c id ; g]] we can find f' such that f = c id ; f' and [[f']] = [[g]].

Proof.

Proposition (Completeness). If [[f]] = [[g]] then f = g.

Proof. Find the vine equal to g, and then cancel permutations and nodes iteratively to prove f = g.

Previous | Next