Table of Contents
Fetching ...

A Principled Solution to the Disjunction Problem of Diagrammatic Query Representations

Wolfgang Gatterbauer

TL;DR

This work tackles the long-standing disjunction problem in diagrammatic query representations by introducing RepresentationB, a principled, pattern-complete diagrammatic formalism for well-formed Tuple Relational Calculus (TRC) queries. It first replaces join and selection predicates with built-in anchors and uses DeMorgan-based transformation to manage nested disjunctions, then substitutes anchors with existing visual formalisms to recover TRC safety. A key innovation is the DeMorgan-fuse box, a visual shortcut for disjunction that preserves nesting and semantics while enabling safety checks directly in the diagram. The approach unifies and generalizes prior diagrammatic strategies (edge-based, box-based, DeMorgan-based) and proves pattern-completeness for TRC, achieving 100% textbook benchmark coverage and exponential size advantages over Relational Diagrams. Practically, RepresentationB enables principled, scalable, and verifiable visual representations of complex queries without changing the underlying relational signatures.

Abstract

Finding unambiguous diagrammatic representations for first-order logical formulas and relational queries with arbitrarily nested disjunctions has been a surprisingly long-standing unsolved problem. We refer to this problem as the disjunction problem (of diagrammatic query representations). This work solves the disjunction problem. Our solution unifies, generalizes, and overcomes the shortcomings of prior approaches for disjunctions. It extends the recently proposed Relational Diagrams and is identical for disjunction-free queries. However, it can preserve the relational patterns and the safety for all well-formed Tuple Relational Calculus (TRC) queries, even with arbitrary disjunctions. Additionally, its size is proportional to the original TRC query and can thus be exponentially more succinct than Relational Diagrams.

A Principled Solution to the Disjunction Problem of Diagrammatic Query Representations

TL;DR

This work tackles the long-standing disjunction problem in diagrammatic query representations by introducing RepresentationB, a principled, pattern-complete diagrammatic formalism for well-formed Tuple Relational Calculus (TRC) queries. It first replaces join and selection predicates with built-in anchors and uses DeMorgan-based transformation to manage nested disjunctions, then substitutes anchors with existing visual formalisms to recover TRC safety. A key innovation is the DeMorgan-fuse box, a visual shortcut for disjunction that preserves nesting and semantics while enabling safety checks directly in the diagram. The approach unifies and generalizes prior diagrammatic strategies (edge-based, box-based, DeMorgan-based) and proves pattern-completeness for TRC, achieving 100% textbook benchmark coverage and exponential size advantages over Relational Diagrams. Practically, RepresentationB enables principled, scalable, and verifiable visual representations of complex queries without changing the underlying relational signatures.

Abstract

Finding unambiguous diagrammatic representations for first-order logical formulas and relational queries with arbitrarily nested disjunctions has been a surprisingly long-standing unsolved problem. We refer to this problem as the disjunction problem (of diagrammatic query representations). This work solves the disjunction problem. Our solution unifies, generalizes, and overcomes the shortcomings of prior approaches for disjunctions. It extends the recently proposed Relational Diagrams and is identical for disjunction-free queries. However, it can preserve the relational patterns and the safety for all well-formed Tuple Relational Calculus (TRC) queries, even with arbitrary disjunctions. Additionally, its size is proportional to the original TRC query and can thus be exponentially more succinct than Relational Diagrams.

Paper Structure

This paper contains 76 sections, 5 theorems, 43 equations, 27 figures.

Key Result

lemma 1

Given a $\textsf{TRC}$ formula $\varphi$ with universal quantification, implication, or disjunction. Then there exists a logically equivalent $\textsf{TRC}$ formula $\varphi'$ that ($i$) is pattern equivalent to $\varphi$, ($ii$) does not use universal quantifiers, implications, or disjunction, ($ii

Figures (27)

  • Figure 1: (a, b): Two previously proposed approaches for representing disjunctions via edges (see text). The approaches are incomplete as they leave details of quantification ambiguous and require symbolic annotations to determine precedence of operators. (c,d): Our solution $\textsf{RepresentationB}$ has precise semantics and can pattern-represent any well-formed $\textsf{TRC}$ query (their interpretation is given in \ref{['sec:RDconclusions']}).
  • Figure 2: \ref{['sec:intro_disjunctions']}: This summary shows 5 conceptual approaches for representing disjunctions applied to the deceptively simple problem of representing $R.A \!=\! 1 \vee R.A \!=\! 2$: text-based (a), form-based (b), edge-based (c-e), box-based (f-h), and DeMorgan-based (i,j).
  • Figure 3: \ref{['ex:safety']}: AST for $\textsf{TRC}$ query with nested disjunctions.
  • Figure 4: \ref{['sec:built-in:constants', 'sec:built-in:joins']}: (a) Unary (blue) and (b) binary (orange) "anchor relations" are added to the visual vocabulary of $\textrm{Relational Diagrams}$ in order to give the resulting diagrammatic representation system the same pattern expressiveness as TRC. \ref{['sec:correct-placement']} (c), (d): the placement of operator labels does not matter for $\textrm{Relational Diagrams}$. However, it does make a difference when replacing the labels with new relations.
  • Figure 5: \ref{['ex:simplifying builtin']}(a-b): $\textsf{RepresentationB}$ are at both the middle and bottom rows, $\textrm{Relational Diagrams}$ at the bottom row, $\textrm{Relational Diagrams}$ with built-in relations at the top row. \ref{['ex:disjunction']} (c-g): $\exists r \!\in\! R [r.A \!=\! 1 \vee r.A \!=\! 2]$: (c): Relational Diagrams. (d): $\textrm{Relational Diagrams}$ with built-in relations. (e-g): $\textsf{RepresentationB}$. (f-g) show our visual shortcut for disjunctions, formally justified with what we refer to as "DeMorgan-fuse boxes".
  • ...and 22 more figures

Theorems & Definitions (22)

  • definition 1: Logical Diagram
  • definition 2: Relational pattern DBLP:journals/pacmmod/GatterbauerD24
  • definition 3: Disjunction problem
  • Example 1: Union of queries
  • definition 4: Safety problem
  • lemma 1
  • Example 3
  • Example 4: \ref{['ex:builtin relations']} continued
  • Theorem 1: Full pattern expressiveness
  • Example 5: Substituting built-in relations
  • ...and 12 more