18 Design Principles and Features
This chapter summarises some of the design principles behind Predica and the language features that follow from them.
Design Principles
Predica is shaped by several design principles. The principles listed here are central examples: they keep the model logical, compositional, and independent of physical representation choices.
Logical denotation
Logic defines the semantics of Predica constructs. This specifies what they mean, not how they operate or are implemented. The main example is the denotation of path expressions into logic frames.
This gives another corollary.
- Physical independence. Storage layout, indexing, chunking, and physical identifiers do not determine the meaning of a Predica model.
Additional principles
- Schema supplies the context. The schema declares attribute names, types, cardinalities, and constraints. Query denotations are checked and interpreted against that context.
- Cardinality is local to attributes. Optionality and multiplicity are properties of individual predicates. Changing the cardinality of one attribute is a local schema change; it does not by itself turn the surrounding domain into a different n-ary relation.
- Recursive decomposition and atomic domains. Types decompose into simpler types until reaching atomic domains. This provides a principled interpretation of Codd’s atomicity and naturally leads to schemas equivalent to 6NF.
- Subtyping is subset. Subtypes represent subsets of a domain. This gives constrained types, classifications, variant refinements, and comparable types a common set-theoretic interpretation.
- Path-based navigation. Path expressions provide a concise, readable way to traverse relationships without exposing physical implementation details. They replace foreign-key navigation with a logical, compositional mechanism.
- Isomorphisms and updatable views. Bijections between types are first-class constructs. They allow alternative representations of the same information and support principled, updatable views.
Together, these principles explain why Predica's type, query, and constraint constructs share the same predicate-based interpretation.
Features
Predica offers:
- A foundation in predicate logic, giving clear semantics for information representation, integrity constraints, and query behaviour.
- Modelling capabilities that subsume the Relational Model, including the use of Relational Algebra for integrity constraints and queries.
- Greater decomposition than the RM, down to unary predicates.
- Strong modularity: complex domains are recursively decomposed into subdomains.
- Uniform application of predicate logic to both physical and mathematical domains.
- A logical level of discourse designed to achieve physical independence.
- Independence from foreign-key choices. When multiple candidate keys exist, the logical layer remains unaffected; the choice is purely physical.
- Avoidance of surrogate keys in cases where the RM would normally require them.
- Attribute cardinality defined independently for each attribute, making changes trivial. In the RM, such changes often require structural alterations to relvars.
- Natural support for large, wide-scope databases through compositional modelling.
- A principled treatment of atomicity, addressing Codd’s concerns.
- A modelling discipline that naturally avoids denormalised designs. Practitioners tend to produce schemas equivalent to 6NF.
- Excellent support for schema evolution, far beyond what the RM offers.
-
A rich type system, including:
- quotient types defined via equivalence relations
- value types for mathematical structures
- powerful constraint mechanisms
- subtyping interpreted as subset
- closed and open variant types
- enumerated types
- entity types for modelling things that exist in time and space
- precise control over cardinality
- isomorphisms between types, enabling updatable views