From 24e5e531134fbb8757151a68438d0b8426c91c4c Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Tue, 3 Mar 2026 00:09:46 -0300 Subject: 2OP Constraints and manipulation --- include/operations.hrl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include/operations.hrl') diff --git a/include/operations.hrl b/include/operations.hrl index 2afb27b..f6fa4c0 100644 --- a/include/operations.hrl +++ b/include/operations.hrl @@ -30,15 +30,21 @@ %% Attribute constraint (1OP - 1st Order Property) %% Constrains values of a specific attribute in a relation -record(attribute_constraint, { + name :: atom(), % Stable identifier for lifecycle ops attribute :: atom(), % Attribute name (e.g., salary) domain :: atom() | #relation{}, % Domain or relation this attribute draws from constraints :: [term()] % Additional relational constraints beyond domain membership }). +-record(tuple_constraint, { + name :: atom(), % Stable identifier for lifecycle ops + constraints :: [term()] +}). + %% Relation constraints - holds all types of constraints for a relation -record(relation_constraints, { - attribute_constraints :: #{atom() => #attribute_constraint{}}, % 1OPs - attribute constraints - tuple_constraints :: [term()], % 2OPs - inter-attribute constraints (future) + attribute_constraints :: #{atom() => [#attribute_constraint{}]}, % 1OPs - per-attribute named constraints + tuple_constraints :: [#tuple_constraint{}], % 2OPs - inter-attribute constraints multi_tuple_constraints :: [term()] % 3OPs - multi-tuple constraints (future) }). @@ -101,4 +107,3 @@ | {sort, fun(), lineage_op()} % Sort operation | {take, pos_integer(), lineage_op()} % Limit operation | {aggregate, atom(), atom(), lineage_op()}. % Aggregation (future) - -- cgit v1.2.3