TRIGON: Triangle-Based Affine Query Language
- TRIGON is a triangle-based first-order query language that uses triangles as the fundamental entities for affine-invariant querying.
- It leverages geometric properties of triangles to ensure consistent spatial representation and querying through permutation-closed relations.
- The language extends to spatio-temporal databases by modeling moving triangles, enabling dynamic querying with integrated temporal predicates.
Searching arXiv for the specified paper and closely related TRIGON material. TRIGON is a triangle-based first-order query language for spatial and spatio-temporal databases in which triangles, rather than points or coordinates, are the basic logical objects. Its defining objective is affine-invariant querying: the meaning of a query should not depend on arbitrary choices of origin, orientation, or unit of measurement. The framework is motivated by the practical fact that spatial data is often represented as a finite union of triangles, while spatio-temporal data is often represented as moving triangles; it therefore treats triangles as the natural atomic units for affine-generic database reasoning (0810.5725).
1. Conceptual basis and motivation
TRIGON begins from three observations. First, affine invariance matters in spatial databases because incompatibilities arise when the same geometric configuration is encoded in different coordinate systems or units. Second, triangles are the standard practical representation of planar spatial data in meshes, triangulated irregular networks, and geometric approximations. Third, any two non-degenerate triangles in the plane are equal up to a unique affinity, which makes triangles especially well suited to affine-generic querying (0810.5725).
This combination of database pragmatics and affine geometry distinguishes TRIGON from point-based spatial logics. Instead of representing a region indirectly as a set of points and phrasing queries in coordinate form, TRIGON speaks directly about triangle objects and triangle relations. The key geometric observation is that under an affine transformation, the drawing of a triangle transforms to the drawing of another triangle by applying the same affinity to its corner points. In that sense, triangles are not merely a storage convenience; they are the logical carriers of affine-invariant content.
A common misunderstanding is to treat TRIGON as a notation for triangulated data only. In fact, the framework is a first-order logic with formally defined triangle variables, triangle predicates, and translation procedures to and from point-based affine-generic logic. Its contribution is therefore logical and semantic, not merely representational.
2. Triangle databases, consistency, and primitive predicates
A triangle in TRIGON is modeled as a triple of points in . A triangle database relation is subject to a consistency requirement: it must be closed under permutation of the three corner points, so that the same geometric triangle is stored in all six possible orderings. This ensures that the geometry of a triangle is independent of how its corners are listed (0810.5725).
The central primitive predicate is
which means that the drawing of is contained in the drawing of . Because triangles are convex, this is a natural object-level relation. For spatial TRIGON, the essential predicate set is
Triangle equality is not syntactic equality of ordered triples but equality of drawings. For spatial triangles,
The same idea appears in the point encoding of triangle equality as a disjunction over the six permutations of the corner variables. This makes explicit that the semantics are geometric rather than tuple-ordered.
Several auxiliary formulas play a structural role. A point lying in a triangle is expressed using betweenness: A degenerate triangle representing a single point is characterized by
These formulas are crucial in the completeness proofs, because they allow point variables to be simulated by degenerate triangle variables.
3. Formal language and expressive power
For a set of triangle predicates, is standard first-order logic in which variables range over triangles, atomic formulas include triangle equality, predicates from 0, and relation symbols from the database schema, and formulas are built with 1. In the spatial case, the main theorem states that TRIGON has exactly the expressive power of the affine-generic fragment of first-order logic over the reals on triangle databases (0810.5725).
The proof proceeds by a two-way translation between triangle formulas using 2 and point formulas using 3. Soundness translates triangle formulas into point formulas: triangle equality becomes a permutation disjunction, 4 becomes the condition that each corner of 5 lies in 6, and database relations are mapped to their point encodings. Completeness runs in the opposite direction: point variables are represented by degenerate triangles satisfying 7, point equality is rendered as triangle equality up to permutation, and betweenness is reconstructed using 8 and convexity.
The result is summarized in the paper as the statement that 9 on triangle databases is sound and complete for the affine-generic 0 queries on triangle databases. Equivalently, TRIGON captures exactly the affine-generic fragment of first-order logic over the reals on the corresponding point encodings. The paper also states that adding a while-loop yields a language complete for computable affine-generic queries.
This expressive equivalence clarifies the status of triangles in the formalism. The completeness proof relies only on the fact that triangles are convex objects with three corners; it does not exploit special metric properties. That is why the language can be both geometrically natural and logically complete.
4. Extension to moving triangles and spatio-temporal genericity
A major extension of TRIGON addresses spatio-temporal databases by replacing static triangles with moving triangles, defined as triples of co-temporal moving points. The intended semantics are snapshot-based: a moving triangle is considered through triangle snapshots whose three points share the same time coordinate (0810.5725).
The spatio-temporal language retains 1 for co-temporal triangles and adds predicates that encode temporal order and motion constraints. The basic temporal predicate is
2
meaning that all points in each triangle are co-temporal and the time coordinate of the first is less than or equal to that of the second.
The more distinctive spatio-temporal predicates are 3 and 4. 5, a 6-ary predicate, encodes constant average speed by requiring that the barycenters of three co-temporal triangles are collinear and that their cross-ratio matches the cross-ratio of three time instants. 6, or linear expansion, is designed as an alternative that is more intuitive when triangles change shape; it compares triangle areas rather than barycenters and uses a geometric construction to convert area ratios into cross-ratio statements. The paper also introduces 7 for same average speed and 8 for no speed.
The corresponding expressiveness results parallel the spatial case. The paper proves that 9 is sound and complete for 0-generic queries, and that 1 is equally expressive and often more intuitive. Languages obtained by adding 2 and 3 capture other physics-inspired genericity classes. The significance of these results is that affine-invariant reasoning is preserved when time and motion are incorporated, while the basic entities remain triangles rather than points.
5. Query patterns, examples, and finite representation
The paper emphasizes that TRIGON is intended to be usable, not only complete. One example concerns a unary triangle relation consisting of all triangles with one corner on the 4-axis, one on the 5-axis, and one on the diagonal 6. This example illustrates both the use of geometric conditions and the consistency requirement that all six orderings of each triangle must be stored (0810.5725).
Another example shows that similarity of triangles can be expressed by first defining collinear segments and parallel segments and then a similarity relation based on matching side directions. This is important because it demonstrates that classical geometric notions can be formulated directly in the triangle language rather than reconstructed indirectly from coordinates.
The paper also presents application-style examples involving regions occupied by a butterfly, a plant, and rural areas. Queries ask whether all butterfly regions lie within plant regions, where to search for a butterfly, and how to compute the convex hull of search regions. These examples are meant to show that triangle-based querying can encode meaningful spatial reasoning in a form that is both direct and affine-generic.
A technically important issue is safety. Some triangle queries produce infinitely many triangles even when the input is finite; a canonical example is the query returning all subtriangles of a given triangle. TRIGON does not eliminate this phenomenon, but it shifts attention to the drawing of the output. The paper states that if the drawing of the result can be represented by finitely many triangles, then this is decidable and can be computed. This is a notable distinction between tuple-level infinitude and geometric finite representability.
6. Scope, significance, and homonymous later uses
The significance of TRIGON lies in its combination of geometric naturalness and logical completeness. It replaces point-based reasoning by triangle-based reasoning, preserves affine genericity, proves equivalence with the affine-generic fragment of first-order logic over the reals, and extends naturally from spatial to spatio-temporal data (0810.5725). Within database theory, its central claim is that triangles are not just convenient approximation primitives but a principled basis for affine-invariant query languages.
This also clarifies what TRIGON is not. It is not merely a triangle storage model, not a mesh-processing heuristic, and not a special-purpose geometric algorithm for a fixed task. It is a first-order logical framework with a precise semantics, a proof-theoretic relation to point-based affine-generic logic, and an explicit path to computable extensions.
The label “TRIGON” has later been reused for unrelated systems. In graph representation learning, TRIGON denotes a graph rewiring framework for GNNs that constructs enriched, non-planar triangulations by learning to select relevant triangles from multiple graph views (Attali et al., 26 Aug 2025). In grid security, “TRIGON” denotes a dual authentication protocol that uses trigon-derived parameters to split interpreted password information across an Authentication Server and a Backend Server (Ruckmani et al., 2010). These later usages are terminologically similar but conceptually independent of the triangle-based database logic introduced in 2008.