# szabta89/inca architecture

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

- Interactive diagram: https://gitdiagram.com/szabta89/inca
- Repository: https://github.com/szabta89/inca

## Overview

1. This repository is an MPS-based language workbench project for IncA, a DSL and runtime for incremental program analysis. The architecture splits into two big areas: `code/` for the product itself and `benchmark/` for performance experiments and sample analyses.

2. The heart of the system is under `code/languages/`. Each `org.inca.*` directory is an MPS language definition with the usual MPS layers: structure, editor, constraints, behavior, typesystem, and generator templates. These languages define the analysis DSL, its supporting expression/data abstractions, and auxiliary language features.

3. `org.inca.core` is the central language layer. It appears to define the core analysis model plus generator logic and editor/type system rules. It is the main conceptual boundary for the analysis DSL itself.

4. `org.inca.data` extends the core with data-flow and data-centric analysis constructs. Its presence of `dataFlow.mps`, `actions.mps`, `intentions.mps`, and migration support suggests it owns the abstractions for modeling analysis data and transformations over it.

5. `org.inca.fun`, `org.inca.gp`, `org.inca.extensions`, and `org.inca.styles` are additional DSL layers or feature modules. They likely add specialized analysis forms, extensibility hooks, graph-pattern-related constructs, and presentation/style support rather than being standalone applications.

6. Runtime and integration code lives under `code/solutions/`. These are MPS solutions that package generated code, plugins, and runtime libraries. Important runtime boundaries include `org.inca.core.runtime`, `org.inca.data.runtime`, `org.inca.fun.runtime`, and `org.inca.gp.runtime`, each corresponding to one or more language families.

7. `org.inca.core.runtime` is the main execution stack for incremental evaluation. Its bundled third-party JARs show the runtime depends heavily on Eclipse/EMF, Eclipse Collections, Xtext, and especially VIATRA query/transformation libraries. That tells you the execution model is graph-pattern-based and incremental rather than hand-rolled.

8. UI-facing integration is separate from the analysis engine. `org.inca.ui` and `org.inca.analysis.ui` are plugin-style solutions, and the benchmark side also has `org.inca.benchmark.ui` and `org.inca.benchmark.itc`, indicating the project exposes editor/UI hooks around analyses and measurements instead of only batch execution.

9. The benchmark workspace is its own MPS project under `benchmark/`. It contains benchmark-specific languages (`org.inca.benchmark.ext`) and benchmark solutions (`org.inca.benchmark`, `org.inca.analyses`, `org.inca.benchmark.ui`, `org.inca.benchmark.itc`) with demo models like interval and points-to examples. This is where example analyses and workloads are organized for evaluation.

10. Tests are also first-class MPS solutions under `code/tests/`. There are test languages, test models, and test suites for the core, data, fun, gp, meta-analysis, and interprocedural/static-analysis paths. The test tree includes both small DSL models and larger fixtures, showing the repository validates both language behavior and analysis semantics.

11. `code/solutions/modelchecker` and `org.inca.meta.analysis` suggest a secondary analysis layer used to analyze or validate analysis models themselves. That means the repo has a meta-level boundary: IncA not only defines analyses, but also contains tooling to reason about analysis definitions.

12. Build orchestration is handled by Gradle at the repository root. The build downloads MPS, generates the MPS project library configuration from `libraries.properties`, and prepares the `code/` project for opening in MPS. The root also contains `souffle/`, which likely supports experiments or backend tooling, but the core architecture is still centered on MPS + generated runtime solutions + VIATRA-based incremental execution.

13. For an architecture diagram, the key data flow is: analysis language definitions in `code/languages/` are authored in MPS, generators produce runnable artifacts into `code/solutions/`, those runtimes execute analyses incrementally over modeled programs, and benchmark/test solutions feed sample programs and measurement harnesses back into the runtime for validation and performance evaluation.

Main entry points: [`code/solutions/org.inca.core.runtime`](https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.core.runtime) (Core runtime), [`code/languages/org.inca.core`](https://github.com/szabta89/inca/blob/master/code/languages/org.inca.core) (Core DSL), [`benchmark/solutions/org.inca.benchmark`](https://github.com/szabta89/inca/blob/master/benchmark/solutions/org.inca.benchmark) (Bench suite), [`build.gradle`](https://github.com/szabta89/inca/blob/master/build.gradle) (Gradle build)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_build["Build"]
  node_n_build["Gradle build<br/>build orchestration<br/>[build.gradle]"]
  node_n_libs["Libraries<br/>build config"]
  node_n_souffle["Souffle<br/>aux tooling"]
end

subgraph group_grp_languages["Languages"]
  node_n_core_lang["Core DSL<br/>MPS language<br/>[org.inca.core]"]
  node_n_data_lang["Data DSL<br/>MPS language<br/>[org.inca.data]"]
  node_n_fun_lang["Fun DSL<br/>MPS language<br/>[org.inca.fun]"]
  node_n_gp_lang["GP DSL<br/>MPS language<br/>[org.inca.gp]"]
  node_n_ext_lang["Extensions<br/>MPS language"]
  node_n_styles_lang["Styles<br/>MPS language<br/>[org.inca.styles]"]
end

subgraph group_grp_solutions["Solutions"]
  node_n_runtime_core["Core runtime<br/>runtime plugin"]
  node_n_runtime_data["Data runtime<br/>runtime plugin"]
  node_n_runtime_fun["Fun runtime<br/>runtime plugin"]
  node_n_runtime_gp["GP runtime<br/>runtime plugin"]
  node_n_ui["UI plugins<br/>integration plugins<br/>[org.inca.ui]"]
  node_n_analysis_ui["Analysis UI<br/>integration plugin"]
  node_n_meta["Meta analysis<br/>meta-analysis"]
  node_n_modelchecker["Model checker<br/>analysis tool"]
end

subgraph group_grp_benchmark["Benchmark"]
  node_n_bench_lang["Bench ext<br/>MPS language"]
  node_n_bench["Bench suite<br/>benchmark solution<br/>[org.inca.benchmark]"]
  node_n_bench_analyses["Bench analyses<br/>benchmark solution<br/>[org.inca.analyses]"]
  node_n_bench_ui["Bench UI<br/>benchmark plugin"]
  node_n_bench_itc["ITC plugin<br/>benchmark plugin"]
end

subgraph group_grp_tests["Tests"]
  node_n_test_data["Data tests<br/>test suite<br/>[org.inca.data.test]"]
  node_n_test_fun["Fun tests<br/>test suite<br/>[org.inca.fun.test]"]
  node_n_test_gp["GP tests<br/>test suite<br/>[org.inca.gp.test]"]
  node_n_test_meta["Meta tests<br/>test suite"]
  node_n_test_sa["SA tests<br/>test suite<br/>[org.inca.sa.test]"]
end

node_n_build -->|"reads"| node_n_libs
node_n_build -.->|"orchestrates"| node_n_souffle
node_n_build -->|"prepares"| node_n_core_lang
node_n_core_lang -->|"extends"| node_n_data_lang
node_n_core_lang -->|"extends"| node_n_fun_lang
node_n_core_lang -->|"extends"| node_n_gp_lang
node_n_core_lang -->|"supports"| node_n_ext_lang
node_n_core_lang -.->|"formats"| node_n_styles_lang
node_n_core_lang -->|"generates"| node_n_runtime_core
node_n_data_lang -->|"generates"| node_n_runtime_data
node_n_fun_lang -->|"generates"| node_n_runtime_fun
node_n_gp_lang -->|"generates"| node_n_runtime_gp
node_n_runtime_core -->|"exposes"| node_n_ui
node_n_runtime_core -->|"integrates"| node_n_analysis_ui
node_n_runtime_core -.->|"validated by"| node_n_meta
node_n_runtime_core -.->|"checked by"| node_n_modelchecker
node_n_bench_lang -->|"drives"| node_n_bench
node_n_bench -->|"uses"| node_n_bench_analyses
node_n_bench -->|"packages"| node_n_bench_ui
node_n_bench -->|"packages"| node_n_bench_itc
node_n_bench -->|"executes on"| node_n_runtime_core
node_n_bench_analyses -.->|"exercises"| node_n_runtime_core
node_n_test_data -->|"tests"| node_n_runtime_data
node_n_test_fun -->|"tests"| node_n_runtime_fun
node_n_test_gp -->|"tests"| node_n_runtime_gp
node_n_test_meta -->|"tests"| node_n_meta
node_n_test_sa -->|"tests"| node_n_runtime_core

click node_n_build "https://github.com/szabta89/inca/blob/master/build.gradle"
click node_n_libs "https://github.com/szabta89/inca/blob/master/libraries.properties"
click node_n_souffle "https://github.com/szabta89/inca/tree/master/souffle"
click node_n_core_lang "https://github.com/szabta89/inca/blob/master/code/languages/org.inca.core"
click node_n_data_lang "https://github.com/szabta89/inca/blob/master/code/languages/org.inca.data"
click node_n_fun_lang "https://github.com/szabta89/inca/blob/master/code/languages/org.inca.fun"
click node_n_gp_lang "https://github.com/szabta89/inca/blob/master/code/languages/org.inca.gp"
click node_n_ext_lang "https://github.com/szabta89/inca/blob/master/code/languages/org.inca.extensions"
click node_n_styles_lang "https://github.com/szabta89/inca/blob/master/code/languages/org.inca.styles"
click node_n_runtime_core "https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.core.runtime"
click node_n_runtime_data "https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.data.runtime"
click node_n_runtime_fun "https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.fun.runtime"
click node_n_runtime_gp "https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.gp.runtime"
click node_n_ui "https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.ui"
click node_n_analysis_ui "https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.analysis.ui"
click node_n_meta "https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.meta.analysis"
click node_n_modelchecker "https://github.com/szabta89/inca/tree/master/code/solutions/modelchecker"
click node_n_bench_lang "https://github.com/szabta89/inca/blob/master/benchmark/languages/org.inca.benchmark.ext"
click node_n_bench "https://github.com/szabta89/inca/blob/master/benchmark/solutions/org.inca.benchmark"
click node_n_bench_analyses "https://github.com/szabta89/inca/blob/master/benchmark/solutions/org.inca.analyses"
click node_n_bench_ui "https://github.com/szabta89/inca/blob/master/benchmark/solutions/org.inca.benchmark.ui"
click node_n_bench_itc "https://github.com/szabta89/inca/blob/master/benchmark/solutions/org.inca.benchmark.itc"
click node_n_test_data "https://github.com/szabta89/inca/blob/master/code/tests/org.inca.data.test"
click node_n_test_fun "https://github.com/szabta89/inca/blob/master/code/tests/org.inca.fun.test"
click node_n_test_gp "https://github.com/szabta89/inca/blob/master/code/tests/org.inca.gp.test"
click node_n_test_meta "https://github.com/szabta89/inca/blob/master/code/tests/org.inca.meta.analysis.test"
click node_n_test_sa "https://github.com/szabta89/inca/blob/master/code/tests/org.inca.sa.test"

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_n_build,node_n_libs,node_n_souffle toneBlue
class node_n_core_lang,node_n_data_lang,node_n_fun_lang,node_n_gp_lang,node_n_ext_lang,node_n_styles_lang toneAmber
class node_n_runtime_core,node_n_runtime_data,node_n_runtime_fun,node_n_runtime_gp,node_n_ui,node_n_analysis_ui,node_n_meta,node_n_modelchecker toneMint
class node_n_bench_lang,node_n_bench,node_n_bench_analyses,node_n_bench_ui,node_n_bench_itc toneRose
class node_n_test_data,node_n_test_fun,node_n_test_gp,node_n_test_meta,node_n_test_sa toneIndigo
```

## Components

### Build

Repository-level build and tooling

- [Gradle build](https://github.com/szabta89/inca/blob/master/build.gradle): build orchestration · Root build that prepares the MPS projects and library config · `build.gradle`
- [Libraries](https://github.com/szabta89/inca/blob/master/libraries.properties): build config · Shared library definitions used by the MPS projects · `libraries.properties`
- [Souffle](https://github.com/szabta89/inca/tree/master/souffle): aux tooling · Supplementary backend or experiment tooling · `souffle`

### Languages

MPS language definitions

- [Core DSL](https://github.com/szabta89/inca/blob/master/code/languages/org.inca.core): MPS language · Central analysis model and generator boundary · `code/languages/org.inca.core`
- [Data DSL](https://github.com/szabta89/inca/blob/master/code/languages/org.inca.data): MPS language · Data-flow and data-centric analysis extensions · `code/languages/org.inca.data`
- [Fun DSL](https://github.com/szabta89/inca/blob/master/code/languages/org.inca.fun): MPS language · Functional or specialized analysis layer · `code/languages/org.inca.fun`
- [GP DSL](https://github.com/szabta89/inca/blob/master/code/languages/org.inca.gp): MPS language · Graph-pattern related analysis language layer · `code/languages/org.inca.gp`
- [Extensions](https://github.com/szabta89/inca/blob/master/code/languages/org.inca.extensions): MPS language · Extensibility hooks and shared language features · `code/languages/org.inca.extensions`
- [Styles](https://github.com/szabta89/inca/blob/master/code/languages/org.inca.styles): MPS language · Presentation and styling support for language models · `code/languages/org.inca.styles`

### Solutions

Generated runtimes, plugins, and integration packages

- [Core runtime](https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.core.runtime): runtime plugin · Incremental execution stack with VIATRA and EMF dependencies · `code/solutions/org.inca.core.runtime`
- [Data runtime](https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.data.runtime): runtime plugin · Runtime support for data language features · `code/solutions/org.inca.data.runtime`
- [Fun runtime](https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.fun.runtime): runtime plugin · Runtime support for the fun language layer · `code/solutions/org.inca.fun.runtime`
- [GP runtime](https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.gp.runtime): runtime plugin · Runtime support for graph-pattern analysis features · `code/solutions/org.inca.gp.runtime`
- [UI plugins](https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.ui): integration plugins · User-facing Eclipse/MPS integration for analyses · `code/solutions/org.inca.ui`
- [Analysis UI](https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.analysis.ui): integration plugin · Analysis-specific UI integration and plugin packaging · `code/solutions/org.inca.analysis.ui`
- [Meta analysis](https://github.com/szabta89/inca/blob/master/code/solutions/org.inca.meta.analysis): meta-analysis · Tooling that reasons about analysis definitions · `code/solutions/org.inca.meta.analysis`
- [Model checker](https://github.com/szabta89/inca/tree/master/code/solutions/modelchecker): analysis tool · Secondary analysis or validation tooling for models · `code/solutions/modelchecker`

### Benchmark

Benchmark workspace, analyses, and sample workloads

- [Bench ext](https://github.com/szabta89/inca/blob/master/benchmark/languages/org.inca.benchmark.ext): MPS language · Benchmark-specific language extensions · `benchmark/languages/org.inca.benchmark.ext`
- [Bench suite](https://github.com/szabta89/inca/blob/master/benchmark/solutions/org.inca.benchmark): benchmark solution · Benchmark workspace with demo workloads and analyses · `benchmark/solutions/org.inca.benchmark`
- [Bench analyses](https://github.com/szabta89/inca/blob/master/benchmark/solutions/org.inca.analyses): benchmark solution · Shared benchmark analysis models and demos · `benchmark/solutions/org.inca.analyses`
- [Bench UI](https://github.com/szabta89/inca/blob/master/benchmark/solutions/org.inca.benchmark.ui): benchmark plugin · Benchmark UI integration package · `benchmark/solutions/org.inca.benchmark.ui`
- [ITC plugin](https://github.com/szabta89/inca/blob/master/benchmark/solutions/org.inca.benchmark.itc): benchmark plugin · Benchmark integration plugin for interprocedural test flows · `benchmark/solutions/org.inca.benchmark.itc`

### Tests

MPS test languages, models, and suites

- [Data tests](https://github.com/szabta89/inca/blob/master/code/tests/org.inca.data.test): test suite · Tests for data language behavior and semantics · `code/tests/org.inca.data.test`
- [Fun tests](https://github.com/szabta89/inca/blob/master/code/tests/org.inca.fun.test): test suite · Tests for fun language behavior · `code/tests/org.inca.fun.test`
- [GP tests](https://github.com/szabta89/inca/blob/master/code/tests/org.inca.gp.test): test suite · Tests for graph-pattern language behavior · `code/tests/org.inca.gp.test`
- [Meta tests](https://github.com/szabta89/inca/blob/master/code/tests/org.inca.meta.analysis.test): test suite · Tests for meta-analysis tooling · `code/tests/org.inca.meta.analysis.test`
- [SA tests](https://github.com/szabta89/inca/blob/master/code/tests/org.inca.sa.test): test suite · Interprocedural and static-analysis test harnesses · `code/tests/org.inca.sa.test`

## Connections

- Gradle build → Libraries: reads · Build uses shared library definitions
- Gradle build → Souffle: orchestrates · Build includes auxiliary tooling
- Gradle build → Core DSL: prepares · Build sets up the main language project
- Core DSL → Data DSL: extends · Data language builds on core abstractions
- Core DSL → Fun DSL: extends · Fun language builds on core abstractions
- Core DSL → GP DSL: extends · GP language builds on core abstractions
- Core DSL → Extensions: supports · Extension language augments the core DSL
- Core DSL → Styles: formats · Styles language supports presentation concerns
- Core DSL → Core runtime: generates · Core language is compiled into its runtime
- Data DSL → Data runtime: generates · Data language is compiled into its runtime
- Fun DSL → Fun runtime: generates · Fun language is compiled into its runtime
- GP DSL → GP runtime: generates · GP language is compiled into its runtime
- Core runtime → UI plugins: exposes · Core runtime is surfaced through UI plugins
- Core runtime → Analysis UI: integrates · Analysis UI connects to the core execution stack
- Core runtime → Meta analysis: validated by · Meta-analysis inspects or validates analysis models
- Core runtime → Model checker: checked by · Model checker acts as a secondary validation layer
- Bench ext → Bench suite: drives · Benchmark language defines benchmark models and actions
- Bench suite → Bench analyses: uses · Benchmark solution references shared analysis models
- Bench suite → Bench UI: packages · Benchmark workspace includes UI integration
- Bench suite → ITC plugin: packages · Benchmark workspace includes interprocedural integration
- Bench suite → Core runtime: executes on · Benchmarks run against the core incremental runtime
- Bench analyses → Core runtime: exercises · Benchmark analyses feed the core runtime
- Data tests → Data runtime: tests · Data tests validate the data runtime and language
- Fun tests → Fun runtime: tests · Fun tests validate the fun runtime and language
- GP tests → GP runtime: tests · GP tests validate the GP runtime and language
- Meta tests → Meta analysis: tests · Meta tests validate meta-analysis behavior
- SA tests → Core runtime: tests · Static-analysis tests exercise the core execution stack
