# mbuit82/sponge architecture

> Architecture diagram of the GitHub repository mbuit82/sponge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mbuit82/sponge
- Repository: https://github.com/mbuit82/sponge

## Overview

Sponge is a modular checker for paper-like propositional proofs. Users write proof files, select a logic, and check the proof; the documented design compiles abstract proof steps into Datalog for axiomatic checking. Logic specifications and derived rules provide the main abstraction layers. The README also documents logic inspection. Source excerpts were unavailable, so the graph limits relationships to those explicitly described in the README; implementation details and unverified calls are omitted.

Main entry points: [`Core.hs`](https://github.com/mbuit82/sponge/blob/main/Core.hs) (Checker core), [`Defs/Specs.hs`](https://github.com/mbuit82/sponge/blob/main/Defs/Specs.hs) (Logic specs), [`ToDatalog`](https://github.com/mbuit82/sponge/tree/main/ToDatalog) (Datalog conversion), [`user_proofs`](https://github.com/mbuit82/sponge/tree/main/user_proofs) (Proof files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_proof_workflow["Proof workflow"]
  node_proof_files["Proof files"]
  node_proof_parsing["Proof parsing"]
  node_checker_core["Checker core<br/>[Core.hs]"]
end

subgraph group_logic_model["Logic model"]
  node_logic_specs["Logic specs<br/>[Specs.hs]"]
  node_logic_components["Logic components"]
  node_logic_display["Logic display<br/>[ShowLogic.hs]"]
end

subgraph group_abstraction["Proof abstraction"]
  node_derived_rules["Derived rules"]
end

subgraph group_checking["Datalog checking"]
  node_proof_compilation["Datalog conversion"]
  node_datalog_engines["Logic engines"]
  node_check_result["Check result"]
end

node_proof_author(("Proof author"))
node_souffle["Souffle"]

node_proof_author -->|"writes proofs"| node_proof_files
node_proof_files -.->|"provides input"| node_proof_parsing
node_proof_parsing -.->|"parses proofs"| node_checker_core
node_checker_core -->|"compiles proofs"| node_proof_compilation
node_logic_specs -->|"specifies logics"| node_logic_components
node_checker_core -.->|"selects logic"| node_logic_specs
node_derived_rules -->|"abstracts steps"| node_proof_compilation
node_proof_compilation -->|"emits Datalog"| node_datalog_engines
node_datalog_engines -->|"checked by"| node_souffle
node_souffle -.->|"produces output"| node_check_result
node_logic_specs -.->|"displayed by"| node_logic_display

click node_proof_files "https://github.com/mbuit82/sponge/tree/main/user_proofs"
click node_proof_parsing "https://github.com/mbuit82/sponge/tree/main/Parse"
click node_checker_core "https://github.com/mbuit82/sponge/blob/main/Core.hs"
click node_logic_specs "https://github.com/mbuit82/sponge/blob/main/Defs/Specs.hs"
click node_logic_components "https://github.com/mbuit82/sponge/tree/main/Defs"
click node_derived_rules "https://github.com/mbuit82/sponge/tree/main/DerivedRules"
click node_proof_compilation "https://github.com/mbuit82/sponge/tree/main/ToDatalog"
click node_datalog_engines "https://github.com/mbuit82/sponge/tree/main/datalog/datalog_engines"
click node_check_result "https://github.com/mbuit82/sponge/blob/main/Commands/CheckDatalogOutput.hs"
click node_logic_display "https://github.com/mbuit82/sponge/blob/main/Commands/ShowLogic.hs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_proof_files,node_proof_parsing,node_checker_core toneBlue
class node_logic_specs,node_logic_components,node_logic_display toneAmber
class node_derived_rules toneMint
class node_proof_compilation,node_datalog_engines,node_check_result toneRose
class node_proof_author,node_souffle toneIndigo
```

## Components

### Proof workflow

- [Proof files](https://github.com/mbuit82/sponge/tree/main/user_proofs): `user_proofs`
- [Proof parsing](https://github.com/mbuit82/sponge/tree/main/Parse): `Parse`
- [Checker core](https://github.com/mbuit82/sponge/blob/main/Core.hs): `Core.hs`

### Logic model

- [Logic specs](https://github.com/mbuit82/sponge/blob/main/Defs/Specs.hs): `Defs/Specs.hs`
- [Logic components](https://github.com/mbuit82/sponge/tree/main/Defs): `Defs`
- [Logic display](https://github.com/mbuit82/sponge/blob/main/Commands/ShowLogic.hs): `Commands/ShowLogic.hs`

### Proof abstraction

- [Derived rules](https://github.com/mbuit82/sponge/tree/main/DerivedRules): `DerivedRules`

### Datalog checking

- [Datalog conversion](https://github.com/mbuit82/sponge/tree/main/ToDatalog): `ToDatalog`
- [Logic engines](https://github.com/mbuit82/sponge/tree/main/datalog/datalog_engines): `datalog/datalog_engines`
- [Check result](https://github.com/mbuit82/sponge/blob/main/Commands/CheckDatalogOutput.hs): `Commands/CheckDatalogOutput.hs`

### Other components

- **Proof author**
- **Souffle**

## Connections

- Proof author → Proof files: writes proofs (evidence: `README.md`)
- Proof files → Proof parsing: provides input
- Proof parsing → Checker core: parses proofs
- Checker core → Datalog conversion: compiles proofs (evidence: `README.md`)
- Logic specs → Logic components: specifies logics (evidence: `README.md`)
- Checker core → Logic specs: selects logic
- Derived rules → Datalog conversion: abstracts steps (evidence: `README.md`)
- Datalog conversion → Logic engines: emits Datalog (evidence: `README.md`)
- Logic engines → Souffle: checked by (evidence: `README.md`)
- Souffle → Check result: produces output
- Logic specs → Logic display: displayed by
