Papers
Topics
Authors
Recent
Search
2000 character limit reached

TRIGON: Triangle-Based Affine Query Language

Updated 9 July 2026
  • 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 (R2)3(\mathbb{R}^2)^3. 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

PartOf(1,2),PartOf(\triangle_1,\triangle_2),

which means that the drawing of 1\triangle_1 is contained in the drawing of 2\triangle_2. Because triangles are convex, this is a natural object-level relation. For spatial TRIGON, the essential predicate set is

Δ={PartOf}.\Delta=\{PartOf\}.

Triangle equality is not syntactic equality of ordered triples but equality of drawings. For spatial triangles,

1=2iffPartOf(1,2) and PartOf(2,1).\triangle_1 =_{\vartriangle} \triangle_2 \quad\text{iff}\quad PartOf(\triangle_1,\triangle_2)\ \text{and}\ PartOf(\triangle_2,\triangle_1).

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: InTriangle(x,x1,x2,x3):=x4(Between(x1,x4,x2)Between(x4,x,x3)).InTriangle(x, x_1, x_2, x_3) := \exists x_4 \big( Between(x_1,x_4,x_2)\wedge Between(x_4,x,x_3)\big). A degenerate triangle representing a single point is characterized by

Point():=(PartOf(,)=).Point(\triangle) := \forall \triangle'\,\big(PartOf(\triangle',\triangle)\rightarrow \triangle =_{\vartriangle} \triangle'\big).

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 Δ\Delta of triangle predicates, FO(Δ)\mathrm{FO}(\Delta) is standard first-order logic in which variables range over triangles, atomic formulas include triangle equality, predicates from PartOf(1,2),PartOf(\triangle_1,\triangle_2),0, and relation symbols from the database schema, and formulas are built with PartOf(1,2),PartOf(\triangle_1,\triangle_2),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 PartOf(1,2),PartOf(\triangle_1,\triangle_2),2 and point formulas using PartOf(1,2),PartOf(\triangle_1,\triangle_2),3. Soundness translates triangle formulas into point formulas: triangle equality becomes a permutation disjunction, PartOf(1,2),PartOf(\triangle_1,\triangle_2),4 becomes the condition that each corner of PartOf(1,2),PartOf(\triangle_1,\triangle_2),5 lies in PartOf(1,2),PartOf(\triangle_1,\triangle_2),6, and database relations are mapped to their point encodings. Completeness runs in the opposite direction: point variables are represented by degenerate triangles satisfying PartOf(1,2),PartOf(\triangle_1,\triangle_2),7, point equality is rendered as triangle equality up to permutation, and betweenness is reconstructed using PartOf(1,2),PartOf(\triangle_1,\triangle_2),8 and convexity.

The result is summarized in the paper as the statement that PartOf(1,2),PartOf(\triangle_1,\triangle_2),9 on triangle databases is sound and complete for the affine-generic 1\triangle_10 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\triangle_11 for co-temporal triangles and adds predicates that encode temporal order and motion constraints. The basic temporal predicate is

1\triangle_12

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 1\triangle_13 and 1\triangle_14. 1\triangle_15, 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. 1\triangle_16, 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 1\triangle_17 for same average speed and 1\triangle_18 for no speed.

The corresponding expressiveness results parallel the spatial case. The paper proves that 1\triangle_19 is sound and complete for 2\triangle_20-generic queries, and that 2\triangle_21 is equally expressive and often more intuitive. Languages obtained by adding 2\triangle_22 and 2\triangle_23 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 2\triangle_24-axis, one on the 2\triangle_25-axis, and one on the diagonal 2\triangle_26. 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.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to TRIGON.