# mietek/research architecture

> Architecture diagram of the GitHub repository mietek/research, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mietek/research
- Repository: https://github.com/mietek/research

## Overview

##### Main Components and Structure

The system should be organized into these primary components:

a) Core Theoretical Frameworks:
- Simply Typed Lambda Calculus (STLC)
- Modal Logic Systems (S4, IS4)
- Intuitionistic Logic (IPC)
- Normalization by Evaluation (NBE)

b) Implementation Layers:
- Syntax Definitions
- Semantics
- Proof Systems
- Normalization Algorithms
- Type Checking

**[Core Theoretical Components]**
- ↓
**[Implementation Modules]**
- ↓
**[Verification Layer]**

##### Specific Components

a) Top Level (Theoretical):

b) Middle Level (Implementation):
- Create modules for:
- Syntax definitions
- Semantic rules
- Proof systems
- Normalization procedures

c) Bottom Level (Verification):
- Proof checking components
- Type system verification
- Normalization proofs

##### Important Details

- The relationship between different logical systems
- How normalization procedures interact with type systems
- The flow of proof checking and verification
- The connection between theoretical foundations and their implementations

##### Additional Elements

Annotations for:
- Version information (A201602, A201605, etc.)
- Key theoretical foundations referenced in the README
- Major algorithms implemented (NBE, hereditary substitution)

##### Specific Implementation Notes

Relationship between:
- STLC implementations and their normalizations
- Modal logic systems and their proof theories
- Different versions of the same concepts (e.g., various STLC implementations)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef theory fill:#b3d9ff,stroke:#333
    classDef implementation fill:#90EE90,stroke:#333
    classDef verification fill:#FFB366,stroke:#333
    classDef syntax fill:#E6E6FA,stroke:#333
    classDef semantics fill:#FFE4B5,stroke:#333
    classDef proof fill:#98FB98,stroke:#333
    classDef normalization fill:#DDA0DD,stroke:#333

    %% Core Theoretical Components
    subgraph TheoreticalLayer
        STLC["Simply Typed Lambda Calculus"]:::theory
        Modal["Modal Logic Systems"]:::theory
        IPC["Intuitionistic Logic"]:::theory
    end

    %% Implementation Layer
    subgraph ImplementationLayer
        %% Syntax Components
        STLCSyntax["STLC Syntax"]:::syntax
        IS4Syntax["IS4 Syntax"]:::syntax
        IPCSyntax["IPC Syntax"]:::syntax

        %% Semantics Components
        IS4Semantics["IS4 Semantics"]:::semantics
        IPCSemantics["IPC Semantics"]:::semantics

        %% Proof Systems
        IS4Proof["IS4 Proof Theory"]:::proof
        IPCProof["IPC Proof Theory"]:::proof
    end

    %% Normalization Layer
    subgraph NormalizationLayer
        NBE["Normalization by Evaluation"]:::normalization
        CoinductiveNBE["Coinductive NBE"]:::normalization
        WNF["Weak Normal Forms"]:::normalization
    end

    %% Relationships
    STLC --> STLCSyntax
    Modal --> IS4Syntax
    Modal --> IS4Semantics
    IPC --> IPCSyntax
    IPC --> IPCSemantics

    STLCSyntax --> NBE
    STLCSyntax --> CoinductiveNBE
    STLCSyntax --> WNF

    IS4Syntax --> IS4Proof
    IS4Semantics --> IS4Proof

    IPCSyntax --> IPCProof
    IPCSemantics --> IPCProof

    %% Click Events
    click STLC "https://github.com/mietek/research/tree/main/src/A201606/STLC/"
    click Modal "https://github.com/mietek/research/tree/main/src/A201607/BasicIS4/"
    click IPC "https://github.com/mietek/research/tree/main/src/A201607/BasicIPC/"
    click STLCSyntax "https://github.com/mietek/research/blob/main/src/A201606/STLC/Syntax.agda"
    click IS4Syntax "https://github.com/mietek/research/tree/main/src/A201607/BasicIS4/Syntax/"
    click IPCSyntax "https://github.com/mietek/research/tree/main/src/A201607/BasicIPC/Syntax/"
    click IS4Semantics "https://github.com/mietek/research/tree/main/src/A201607/BasicIS4/Semantics/"
    click IPCSemantics "https://github.com/mietek/research/tree/main/src/A201607/BasicIPC/Semantics/"
    click IS4Proof "https://github.com/mietek/research/tree/main/src/A201607/BasicIS4/Metatheory/"
    click IPCProof "https://github.com/mietek/research/tree/main/src/A201607/BasicIPC/Metatheory/"
    click NBE "https://github.com/mietek/research/blob/main/src/A202401/STLC-Base-WNF-NBE.agda"
    click CoinductiveNBE "https://github.com/mietek/research/blob/main/src/A201606/STLC/CoinductiveNormalisationByEvaluation.agda"
    click WNF "https://github.com/mietek/research/blob/main/src/A202401/STLC-Base-WNF-NBE2.agda"

    %% Legend
    subgraph Legend
        L1["Theory"]:::theory
        L2["Implementation"]:::implementation
        L3["Verification"]:::verification
        L4["Syntax"]:::syntax
        L5["Semantics"]:::semantics
        L6["Proof Systems"]:::proof
        L7["Normalization"]:::normalization
    end
```
