Algorithm Search⌘K

Definitionadvanced

Composition table

Also called transitivity table, weak composition table.

The m by m table that gives, for base relations a and b of a qualitative calculus, every base relation that can hold between x and z when x a y and y b z.

A composition table is the finite multiplication table of a qualitative constraint calculus: for two base relations aa and bb, the entry a⋄ba \diamond b lists every base relation that can hold between xx and zz when xayx \mathrel{a} y and ybzy \mathrel{b} z. It is what lets a program reason about infinite domains with finite symbols, and every propagation method, from algebraic closure to Allen's constraint propagation, is a loop around it. The page Allen's interval algebra shows sample entries of the 13×1313 \times 13 interval table; this page is about tables in general: their definition, the laws they obey, how to compute one, and the shape of the interval table as a whole.

Definition

Let the calculus have domain DD and base relations B0,…,Bm−1B_0, \ldots, B_{m-1}. Its composition table is the m×mm \times m array

T[a][b]={c:∃x,y,z∈D, (x,y)∈Ba, (y,z)∈Bb, (x,z)∈Bc}.T[a][b] = \{c : \exists x, y, z \in D,\ (x, y) \in B_a,\ (y, z) \in B_b,\ (x, z) \in B_c\}.

For relations R,S⊆{B0,…,Bm−1}R, S \subseteq \{B_0, \ldots, B_{m-1}\}, the (weak) composition is the union R⋄S=⋃a∈R, b∈ST[a][b]R \diamond S = \bigcup_{a \in R,\ b \in S} T[a][b]. A program that stores relations as mm-bit masks computes it with at most ∣R∣⋅∣S∣|R| \cdot |S| table look-ups, or once for all pairs of masks.

The table is strong (or extensional) when Ba∘Bb=⋃c∈T[a][b]BcB_a \circ B_b = \bigcup_{c \in T[a][b]} B_c as sets of pairs, that is, when for every c∈T[a][b]c \in T[a][b] and every pair (x,z)∈Bc(x, z) \in B_c there is a yy with xBayx \mathrel{B_a} y and yBbzy \mathrel{B_b} z. Otherwise the table is only weak: it is still the smallest union of base relations that contains Ba∘BbB_a \circ B_b.

Laws. For every calculus, with ⌣\smile the converse and id\mathrm{id} the identity:

  1. identity: T[id][b]=T[b][id]={b}T[\mathrm{id}][b] = T[b][\mathrm{id}] = \{b\};
  2. converse: c∈T[a][b]c \in T[a][b] exactly when c⌣∈T[b⌣][a⌣]c^{\smile} \in T[b^{\smile}][a^{\smile}];
  3. cycle law: c∈T[a][b]c \in T[a][b] exactly when a∈T[c][b⌣]a \in T[c][b^{\smile}], exactly when b∈T[a⌣][c]b \in T[a^{\smile}][c].

Proof of the cycle law. c∈T[a][b]c \in T[a][b] means that there are x,y,zx, y, z with xayx \mathrel{a} y, ybzy \mathrel{b} z and xczx \mathrel{c} z. The same three points have xczx \mathrel{c} z, zb⌣yz \mathrel{b^{\smile}} y and xayx \mathrel{a} y, which says a∈T[c][b⌣]a \in T[c][b^{\smile}]; the other case is the same with xx and zz in the roles of the middle point. The converse law is the same argument read from zz to xx. □\square

If the table is strong, then composition is associative, (R⋄S)⋄U=R⋄(S⋄U)(R \diamond S) \diamond U = R \diamond (S \diamond U), and the relations form a relation algebra. For a weak table, associativity can fail (Ligozat and Renz 2004).

Computing a table. When a finite set of values realizes every configuration of three objects, the table is the set of triples of base relations seen on that set. For the point algebra, the values {0,1,2}\{0, 1, 2\} suffice. For intervals, three intervals have 6 endpoints, so every order type of them appears among the 1515 intervals with endpoints in {0,…,5}\{0, \ldots, 5\}, and the 153=337515^3 = 3375 triples give all 169 entries. The implementations on the algebraic closure page compute both tables this way, and check the converse law and associativity, instead of typing the table in.

Examples and non-examples

Point algebra. The base relations <<, == and >> on R\mathbb{R} give this table, where "all" is {<,=,>}\{<, =, >\}:

⋄\diamond << == >>
<< << << all
== << == >>
>> all >> >>

The entry <⋄>< \diamond > is "all" because x<yx < y and y>zy > z say nothing about xx and zz. The table is strong over R\mathbb{R} and Q\mathbb{Q}, which are dense, and only weak over Z\mathbb{Z}, where x<y<zx < y < z needs z≥x+2z \ge x + 2.

Allen's interval algebra. The 13×13=16913 \times 13 = 169 entries hold 409 base relations in total. 97 entries are single relations, 42 have 3, 24 have 5, 3 have 9 and 3 are universal (b⋄bib \diamond bi, bi⋄bbi \diamond b and d⋄did \diamond di). Every entry has an odd size. The table is strong and associative. A few entries that the interval page does not list:

aa bb a⋄ba \diamond b
b d {b,m,o,s,d}\{b, m, o, s, d\}
o oi {o,s,d,f,eq,fi,di,si,oi}\{o, s, d, f, eq, fi, di, si, oi\}
s si {s,eq,si}\{s, eq, si\}
f fi {f,eq,fi}\{f, eq, fi\}

For example, xsyx \mathrel{s} y and ysizy \mathrel{si} z say that xx and zz both start with yy; then xx and zz start together, and either can end first, which gives s, eq or si.

Region calculi. The 64 entries of the RCC8 table come from the topology of regions. For the standard models of regions, the RCC8 table is weak (Renz and Ligozat 2005).

Product calculi. For the rectangle algebra, T[(a1,a2)][(b1,b2)]=TIA[a1][b1]×TIA[a2][b2]T[(a_1, a_2)][(b_1, b_2)] = T_{\mathrm{IA}}[a_1][b_1] \times T_{\mathrm{IA}}[a_2][b_2], so the 169×169169 \times 169 table is never stored; it is read off two interval tables.

Non-example: a table of rules. "If xx is before yy and yy is before zz then xx is before zz" is one entry, not a table. A table must cover every pair of base relations, so that the composition of any two relations is defined.

Non-example: unions as input. The entry for the relations {b,m}\{b, m\} and {b}\{b\} is not a separate row of the table. It is the union of T[b][b]T[b][b] and T[m][b]T[m][b], so the table has only m2m^2 entries even though there are 2m2^m relations.

Common errors

  • Reading the table in the wrong order. T[a][b]T[a][b] assumes xayx \mathrel{a} y and ybzy \mathrel{b} z; swapping aa and bb gives a different entry, for example b⋄d={b,m,o,s,d}b \diamond d = \{b, m, o, s, d\} while d⋄b={b}d \diamond b = \{b\}.
  • Typing a 169-entry table by hand. Small errors survive for a long time. Generate the table from concrete values and check the converse and cycle laws.
  • Assuming that a table that is used for propagation is strong. A weak table still gives sound propagation, but algebraic closure may then say less about consistency.

References

  1. James F. Allen, Maintaining knowledge about temporal intervals, Communications of the ACM 26(11), 1983, pages 832 to 843 (the transitivity table of the 13 interval relations)
  2. Gérard Ligozat and Jochen Renz, What is a qualitative calculus? A general framework, PRICAI 2004, Lecture Notes in Computer Science 3157, Springer, 2004, pages 53 to 64 (weak composition and the laws it obeys)
  3. Jochen Renz and Gérard Ligozat, Weak composition for qualitative spatial and temporal reasoning, CP 2005, Lecture Notes in Computer Science 3709, Springer, 2005, pages 534 to 548 (weak and strong composition tables)
  4. Peter B. Ladkin and Roger D. Maddux, On binary constraint problems, Journal of the ACM 41(3), 1994, pages 435 to 469 (composition tables as the atom structures of relation algebras)
  5. Frank Dylla and others, A survey of qualitative spatial and temporal calculi, algebraic and computational properties, ACM Computing Surveys 50(1), 2017, pages 1 to 39 (which calculi have associative and strong composition)

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/9B01H6/text.yaml