aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2025-11-11 00:00:43 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2025-11-11 00:00:43 -0300
commit3063608df6ff1668f683d9d22c57fea29d728d0d (patch)
tree36be7f6c6d901c5984c045d4ce823bd24c37e9af /docs
parentb5dbdaa989a86477669aac0bf342029e1d2b6028 (diff)
downloadSakura-3063608df6ff1668f683d9d22c57fea29d728d0d.tar.gz
Sakura-3063608df6ff1668f683d9d22c57fea29d728d0d.zip
migrating to erlang to attach to mnesia
Diffstat (limited to 'docs')
-rw-r--r--docs/architecture.plantuml72
-rw-r--r--docs/features.org96
2 files changed, 96 insertions, 72 deletions
diff --git a/docs/architecture.plantuml b/docs/architecture.plantuml
deleted file mode 100644
index 90985ba..0000000
--- a/docs/architecture.plantuml
+++ /dev/null
@@ -1,72 +0,0 @@
-@startuml
-allowmixing
-
-package Client {
- object "Query Interface" as query_interface
-}
-
-package Algebra {
- object "Unifier" as unifier
- object "Bytecode Builder" as bytecode_builder
- object "Parser" as parser
- object "Lexer" as lexer
-}
-
-query_interface --> lexer
-lexer --> parser
-parser --> unifier
-unifier --> bytecode_builder
-
-package Query {
- object "Schema Builder" as schema_builder
- object "Facts Builder" as facts_builder
- object "Optimizer" as optimizer
- object "Commands Generator" as commands_generator
- object "B+ Tree" as b_plus_tree
-}
-
-bytecode_builder --> optimizer
-optimizer --> commands_generator
-facts_builder --> commands_generator
-schema_builder --> commands_generator
-commands_generator --> b_plus_tree
-b_plus_tree --> query_interface
-
-package Coordinator {
- object "File Historical Hashes" as file_historical_hashes
- object "Location Hashes" as location_hashes
- object "Command Parser" as command_parser
- object "Curator" as curator
-}
-
-commands_generator <-- command_parser
-
-package Disk {
- object "Merkle Tree Root Generator" as merkle_tree
- object "WAL Reader" as wal_reader
- object "WAL Writer" as wal_writer
- object "ARIES" as aries
- object "SHA256 Hasher" as sha
- object "Executor" as executor
- map storage {
- write => +λ
- read => +λ
- }
- object "Courier" as courier
- database Wal
-}
-
-executor *--> merkle_tree
-executor *--> sha
-curator --> command_parser
-command_parser --> executor
-location_hashes *--> curator
-file_historical_hashes *--> curator
-executor --> aries
-aries --> wal_reader
-aries --> wal_writer
-wal_writer --> Wal
-wal_reader --> Wal
-courier <-- wal_reader
-courier --> storage
-@enduml \ No newline at end of file
diff --git a/docs/features.org b/docs/features.org
new file mode 100644
index 0000000..a6e592e
--- /dev/null
+++ b/docs/features.org
@@ -0,0 +1,96 @@
+* Relational Algebra Engine
+ :PROPERTIES:
+ :CATEGORY: relational-algebra
+ :END:
+ A pure Erlang implementation of E. F. Codd’s relational algebra.
+ Relations are treated as mathematical sets of tuples; operations are defined exactly
+ as in relational theory, with optional aleph₀ (infinite) relations.
+
+** Core Specification
+ The theoretical backbone of the system.
+
+*** TODO Define relation as a strict mathematical set
+ - [ ] Each tuple is a set of attributes (no duplicates, no ordering)
+ - [ ] Each attribute = (name, value) pair
+ - [ ] Attribute domains are strongly typed
+
+*** TODO Enforce "Codd's axioms" in implementation
+ - [ ] No duplicate tuples in any relation
+ - [ ] No implicit ordering of tuples or attributes
+ - [ ] All operations closed over the relation type
+ - [ ] Proper domain checking in all operations
+
+** Data Model Layer (`relation.erl`)
+ Fundamental constructs of the relational model.
+
+*** TODO Implement attributes, tuples, relations, and schemas
+*** TODO Add schema validation for domain and arity
+*** TODO Add conversion helpers:
+ - [ ] tuple <-> map
+ - [ ] schema validation checks
+
+** Algebraic Operations (`operations.erl`)
+ The complete set of classical relational algebra operators.
+
+*** TODO Selection (σ)
+*** TODO Projection (π)
+*** TODO Cartesian Product (×)
+*** TODO Natural Join (⋈)
+*** TODO Theta Join (⋈θ)
+*** TODO Union (∪)
+*** TODO Intersection (∩)
+*** TODO Difference (−)
+*** TODO Rename (ρ)
+*** TODO Set semantics enforcement (remove duplicates after each op)
+
+** Infinite Relations (`aleph0.erl`)
+ Representation of aleph₀-relations (countably infinite generators).
+
+*** TODO Implement integer() generator
+*** TODO Implement plus(), minus(), multiply(), neg() relations
+*** TODO Add constraints and modes for partially bound arguments
+*** TODO Implement lazy generation using streams or coroutines
+*** TODO Support user-defined infinite relations
+
+** Unified Relation Abstraction (`unified_relation.erl`)
+ A bridge between finite and infinite relations.
+
+*** TODO Implement unified type for finite and aleph₀
+*** TODO Implement unified select, project, join, union, etc.
+*** TODO Support type checking between finite and infinite relations
+*** TODO Add automatic materialization with configurable limits
+*** TODO Implement caching/memoization for aleph₀ evaluations
+
+** Backend Integration (Mnesia)
+ Persistent storage and retrieval of finite relations.
+
+*** TODO Map finite relations to Mnesia tables
+*** TODO Support schema registration and domain enforcement
+*** TODO Add persistence for partially materialized aleph₀ relations
+*** TODO Add atomic transactional updates
+*** TODO Add indexing support for joins
+
+** Correctness and Validation
+ Ensuring theoretical fidelity.
+
+*** TODO Implement relational algebra test suite
+*** TODO Verify closure and idempotence of all operations
+*** TODO Add property-based tests with PropEr or QuickCheck
+*** TODO Compare semantics with formal definitions (e.g., Date & Darwen)
+
+** Developer Tools
+ Optional but desirable tools for exploration and testing.
+
+*** TODO Add REPL-like console for interactive relational queries
+*** TODO Add pretty-printer for relations and schemas
+*** TODO Add visualization of join graphs and operation pipelines
+*** TODO Add Org Babel integration for relational queries
+
+** Documentation
+ Literate and theoretical exposition.
+
+*** TODO Write README with theoretical introduction
+*** TODO Add module-level comments summarizing relational definitions
+*** TODO Include examples of finite and aleph₀ joins
+*** TODO Provide link to E. F. Codd’s original papers
+