228 lines
8.2 KiB
Plaintext
228 lines
8.2 KiB
Plaintext
|
|
digraph GeologArchitecture {
|
||
|
|
rankdir=TB;
|
||
|
|
compound=true;
|
||
|
|
fontname="Helvetica";
|
||
|
|
node [fontname="Helvetica", shape=box, style="rounded,filled", fillcolor="#f0f0f0"];
|
||
|
|
edge [fontname="Helvetica"];
|
||
|
|
|
||
|
|
label="Geolog Architecture";
|
||
|
|
labelloc="t";
|
||
|
|
fontsize=24;
|
||
|
|
|
||
|
|
// User Interface Layer
|
||
|
|
subgraph cluster_ui {
|
||
|
|
label="User Interface";
|
||
|
|
style="rounded,filled";
|
||
|
|
fillcolor="#e3f2fd";
|
||
|
|
|
||
|
|
cli [label="CLI\n(bin/geolog.rs)", fillcolor="#bbdefb"];
|
||
|
|
repl [label="REPL\n(repl.rs)", fillcolor="#bbdefb"];
|
||
|
|
batch [label="Batch Loading\n(.geolog files)", fillcolor="#bbdefb"];
|
||
|
|
}
|
||
|
|
|
||
|
|
// Parsing Layer
|
||
|
|
subgraph cluster_parsing {
|
||
|
|
label="Parsing Layer";
|
||
|
|
style="rounded,filled";
|
||
|
|
fillcolor="#e8f5e9";
|
||
|
|
|
||
|
|
lexer [label="Lexer\n(lexer.rs)", fillcolor="#c8e6c9"];
|
||
|
|
parser [label="Parser\n(parser.rs)", fillcolor="#c8e6c9"];
|
||
|
|
ast [label="AST\n(ast.rs)", fillcolor="#c8e6c9"];
|
||
|
|
error [label="Error Reporting\n(error.rs)\nariadne", fillcolor="#c8e6c9"];
|
||
|
|
pretty [label="Pretty Printer\n(pretty.rs)", fillcolor="#c8e6c9"];
|
||
|
|
}
|
||
|
|
|
||
|
|
// Elaboration Layer
|
||
|
|
subgraph cluster_elaboration {
|
||
|
|
label="Elaboration Layer";
|
||
|
|
style="rounded,filled";
|
||
|
|
fillcolor="#fff3e0";
|
||
|
|
|
||
|
|
elab_theory [label="Theory Elaboration\n(elaborate/theory.rs)", fillcolor="#ffe0b2"];
|
||
|
|
elab_instance [label="Instance Elaboration\n(elaborate/instance.rs)", fillcolor="#ffe0b2"];
|
||
|
|
elab_env [label="Environment\n(elaborate/env.rs)", fillcolor="#ffe0b2"];
|
||
|
|
elab_types [label="Type Evaluation\n(elaborate/types.rs)", fillcolor="#ffe0b2"];
|
||
|
|
elab_error [label="Type Errors\n(elaborate/error.rs)", fillcolor="#ffe0b2"];
|
||
|
|
}
|
||
|
|
|
||
|
|
// Core Layer
|
||
|
|
subgraph cluster_core {
|
||
|
|
label="Core Layer";
|
||
|
|
style="rounded,filled";
|
||
|
|
fillcolor="#fce4ec";
|
||
|
|
|
||
|
|
core [label="Core IR\n(core.rs)\nSignature, Term,\nFormula, Structure", fillcolor="#f8bbd9"];
|
||
|
|
id [label="Identity System\n(id.rs)\nLuid, Slid", fillcolor="#f8bbd9"];
|
||
|
|
universe [label="Universe\n(universe.rs)\nUUID <-> Luid", fillcolor="#f8bbd9"];
|
||
|
|
naming [label="Naming\n(naming.rs)\nName <-> Luid", fillcolor="#f8bbd9"];
|
||
|
|
cc [label="Congruence Closure\n(cc.rs)\nUnion-Find", fillcolor="#f8bbd9"];
|
||
|
|
}
|
||
|
|
|
||
|
|
// Storage Layer
|
||
|
|
subgraph cluster_storage {
|
||
|
|
label="Storage Layer";
|
||
|
|
style="rounded,filled";
|
||
|
|
fillcolor="#e1f5fe";
|
||
|
|
|
||
|
|
store [label="Store\n(store/mod.rs)", fillcolor="#b3e5fc"];
|
||
|
|
store_schema [label="Schema Cache\n(store/schema.rs)", fillcolor="#b3e5fc"];
|
||
|
|
store_append [label="Append Operations\n(store/append.rs)", fillcolor="#b3e5fc"];
|
||
|
|
store_theory [label="Theory CRUD\n(store/theory.rs)", fillcolor="#b3e5fc"];
|
||
|
|
store_instance [label="Instance CRUD\n(store/instance.rs)", fillcolor="#b3e5fc"];
|
||
|
|
store_commit [label="Version Control\n(store/commit.rs)", fillcolor="#b3e5fc"];
|
||
|
|
store_materialize [label="Materialized Views\n(store/materialize.rs)", fillcolor="#b3e5fc"];
|
||
|
|
geologmeta [label="GeologMeta\n(Homoiconic Store)", fillcolor="#81d4fa", style="rounded,filled,bold"];
|
||
|
|
}
|
||
|
|
|
||
|
|
// Query Layer
|
||
|
|
subgraph cluster_query {
|
||
|
|
label="Query & Compilation Layer";
|
||
|
|
style="rounded,filled";
|
||
|
|
fillcolor="#f3e5f5";
|
||
|
|
|
||
|
|
query_compile [label="Query Compiler\n(query/compile.rs)", fillcolor="#e1bee7"];
|
||
|
|
query_relalg [label="Relational Algebra IR\n(query/to_relalg.rs)\n(query/from_relalg.rs)", fillcolor="#e1bee7"];
|
||
|
|
query_chase [label="Chase Algorithm\n(query/chase.rs)\nFixpoint + CC", fillcolor="#ce93d8", style="rounded,filled,bold"];
|
||
|
|
query_backend [label="Query Backend\n(query/backend.rs)", fillcolor="#e1bee7"];
|
||
|
|
query_optimize [label="Optimizer\n(query/optimize.rs)", fillcolor="#e1bee7"];
|
||
|
|
}
|
||
|
|
|
||
|
|
// Solver Layer
|
||
|
|
subgraph cluster_solver {
|
||
|
|
label="Solver Layer";
|
||
|
|
style="rounded,filled";
|
||
|
|
fillcolor="#e0f2f1";
|
||
|
|
|
||
|
|
solver [label="Model Enumeration\n(solver/mod.rs)", fillcolor="#b2dfdb"];
|
||
|
|
solver_tree [label="Search Tree\n(solver/tree.rs)", fillcolor="#b2dfdb"];
|
||
|
|
solver_tactics [label="Tactics\n(solver/tactics.rs)\nCheck, Forward,\nPropagate, Auto", fillcolor="#80cbc4", style="rounded,filled,bold"];
|
||
|
|
solver_types [label="Solver Types\n(solver/types.rs)", fillcolor="#b2dfdb"];
|
||
|
|
}
|
||
|
|
|
||
|
|
// Tensor Layer
|
||
|
|
subgraph cluster_tensor {
|
||
|
|
label="Tensor Algebra Layer";
|
||
|
|
style="rounded,filled";
|
||
|
|
fillcolor="#fff8e1";
|
||
|
|
|
||
|
|
tensor_expr [label="Tensor Expressions\n(tensor/expr.rs)", fillcolor="#ffecb3"];
|
||
|
|
tensor_sparse [label="Sparse Storage\n(tensor/sparse.rs)\nRoaringBitmap", fillcolor="#ffe082", style="rounded,filled,bold"];
|
||
|
|
tensor_builder [label="Expression Builder\n(tensor/builder.rs)", fillcolor="#ffecb3"];
|
||
|
|
tensor_compile [label="Formula Compiler\n(tensor/compile.rs)", fillcolor="#ffecb3"];
|
||
|
|
tensor_check [label="Axiom Checker\n(tensor/check.rs)", fillcolor="#ffecb3"];
|
||
|
|
}
|
||
|
|
|
||
|
|
// External Dependencies (simplified)
|
||
|
|
subgraph cluster_deps {
|
||
|
|
label="Key Dependencies";
|
||
|
|
style="rounded,dashed";
|
||
|
|
fillcolor="#fafafa";
|
||
|
|
|
||
|
|
chumsky [label="chumsky\n(parser combinators)", shape=ellipse, fillcolor="#e0e0e0"];
|
||
|
|
rkyv [label="rkyv\n(zero-copy serde)", shape=ellipse, fillcolor="#e0e0e0"];
|
||
|
|
roaring [label="roaring\n(bitmaps)", shape=ellipse, fillcolor="#e0e0e0"];
|
||
|
|
unionfind [label="egglog-union-find", shape=ellipse, fillcolor="#e0e0e0"];
|
||
|
|
}
|
||
|
|
|
||
|
|
// Data Flow Edges
|
||
|
|
|
||
|
|
// UI to Parsing
|
||
|
|
cli -> repl;
|
||
|
|
batch -> repl;
|
||
|
|
repl -> lexer [lhead=cluster_parsing];
|
||
|
|
|
||
|
|
// Parsing flow
|
||
|
|
lexer -> parser;
|
||
|
|
parser -> ast;
|
||
|
|
ast -> error [style=dashed, label="errors"];
|
||
|
|
ast -> pretty [style=dashed, label="roundtrip"];
|
||
|
|
|
||
|
|
// Parsing to Elaboration
|
||
|
|
ast -> elab_theory;
|
||
|
|
ast -> elab_instance;
|
||
|
|
|
||
|
|
// Elaboration internal
|
||
|
|
elab_theory -> elab_env;
|
||
|
|
elab_instance -> elab_env;
|
||
|
|
elab_env -> elab_types;
|
||
|
|
elab_types -> elab_error [style=dashed];
|
||
|
|
|
||
|
|
// Elaboration to Core
|
||
|
|
elab_theory -> core;
|
||
|
|
elab_instance -> core;
|
||
|
|
|
||
|
|
// Core internal
|
||
|
|
core -> id;
|
||
|
|
id -> universe;
|
||
|
|
id -> naming;
|
||
|
|
core -> cc;
|
||
|
|
|
||
|
|
// Core to Storage
|
||
|
|
core -> store [lhead=cluster_storage];
|
||
|
|
|
||
|
|
// Storage internal
|
||
|
|
store -> store_schema;
|
||
|
|
store -> store_append;
|
||
|
|
store -> store_theory;
|
||
|
|
store -> store_instance;
|
||
|
|
store -> store_commit;
|
||
|
|
store -> store_materialize;
|
||
|
|
store_append -> geologmeta;
|
||
|
|
store_theory -> geologmeta;
|
||
|
|
store_instance -> geologmeta;
|
||
|
|
store_commit -> geologmeta;
|
||
|
|
store_materialize -> geologmeta;
|
||
|
|
|
||
|
|
// Query layer connections
|
||
|
|
repl -> query_compile [label="queries"];
|
||
|
|
query_compile -> query_relalg;
|
||
|
|
query_relalg -> query_optimize;
|
||
|
|
query_optimize -> query_backend;
|
||
|
|
query_backend -> store [label="execute"];
|
||
|
|
|
||
|
|
// Chase
|
||
|
|
repl -> query_chase [label=":chase"];
|
||
|
|
query_chase -> cc [label="equality\nsaturation"];
|
||
|
|
query_chase -> store;
|
||
|
|
query_chase -> tensor_check [label="axiom\nchecking"];
|
||
|
|
|
||
|
|
// Solver connections
|
||
|
|
repl -> solver [label=":solve\n:query"];
|
||
|
|
solver -> solver_tree;
|
||
|
|
solver_tree -> solver_tactics;
|
||
|
|
solver_tactics -> solver_types;
|
||
|
|
solver_tactics -> query_chase [label="forward\nchaining"];
|
||
|
|
solver_tactics -> cc [label="propagate\nequations"];
|
||
|
|
solver_tactics -> tensor_check [label="check\naxioms"];
|
||
|
|
solver -> store;
|
||
|
|
|
||
|
|
// Tensor internal
|
||
|
|
tensor_compile -> tensor_expr;
|
||
|
|
tensor_expr -> tensor_builder;
|
||
|
|
tensor_builder -> tensor_sparse;
|
||
|
|
tensor_check -> tensor_compile;
|
||
|
|
tensor_sparse -> core [label="read\nstructure"];
|
||
|
|
|
||
|
|
// Dependencies
|
||
|
|
lexer -> chumsky [style=dotted];
|
||
|
|
parser -> chumsky [style=dotted];
|
||
|
|
store -> rkyv [style=dotted];
|
||
|
|
tensor_sparse -> roaring [style=dotted];
|
||
|
|
cc -> unionfind [style=dotted];
|
||
|
|
|
||
|
|
// Legend
|
||
|
|
subgraph cluster_legend {
|
||
|
|
label="Legend";
|
||
|
|
style="rounded";
|
||
|
|
fillcolor="white";
|
||
|
|
|
||
|
|
legend_data [label="Data Flow", shape=plaintext];
|
||
|
|
legend_dep [label="Dependency", shape=plaintext];
|
||
|
|
legend_key [label="Key Component", fillcolor="#80cbc4", style="rounded,filled,bold"];
|
||
|
|
|
||
|
|
legend_data -> legend_dep [style=invis];
|
||
|
|
legend_dep -> legend_key [style=invis];
|
||
|
|
}
|
||
|
|
}
|