# joaosreis/tezcheck architecture

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

- Interactive diagram: https://gitdiagram.com/joaosreis/tezcheck
- Repository: https://github.com/joaosreis/tezcheck

## Overview

Tezcheck is a static analyzer for Michelson smart contracts that uses Tezla’s intermediate representation. The tree shows analysis, dataflow, abstract interpretation, and domain modules, but no source excerpts were provided. Accordingly, the graph identifies those runtime areas without guessing how they call one another; the only relationships shown are documented in the README.

Main entry points: [`src/lib/tezcheck.ml`](https://github.com/joaosreis/tezcheck/blob/main/src/lib/tezcheck.ml) (Tezcheck analyzer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Analysis"]
  node_tezcheck["Tezcheck analyzer<br/>[tezcheck.ml]"]
end

subgraph group_flow["Dataflow"]
  node_cfg["Control-flow graph<br/>[cfg.ml]"]
  node_forward["Forward analysis<br/>[forward.ml]"]
  node_backward["Backward analysis<br/>[backward.ml]"]
  node_inter_transfer["Inter transfer<br/>[inter_transfer.ml]"]
  node_transfer["Transfer functions<br/>[transfer.ml]"]
  node_solvers["Dataflow solvers<br/>[solvers.ml]"]
end

subgraph group_abstract["Abstract interpretation"]
  node_absinterp["Abstract interpreter<br/>[absinterp.ml]"]
end

subgraph group_domains["Analysis domains"]
  node_domain["Domain interface<br/>[domain.ml]"]
  node_interval["Intervals<br/>[interval.ml]"]
  node_interval_domain["Interval domain<br/>[interval_domain.ml]"]
  node_interval_ext["Extended interval domain"]
  node_lambda["Lambda domain<br/>[lambda.ml]"]
  node_lambda_ext["Extended lambda domain<br/>[lambda_ext.ml]"]
  node_non_relational["Non-relational domain"]
  node_value_domain["Value domain<br/>[value_domain.ml]"]
end

node_contracts["Michelson contracts"]
node_tezla["Tezla IR"]

node_contracts -->|"analyzes"| node_tezcheck
node_tezcheck -->|"uses IR"| node_tezla

click node_tezcheck "https://github.com/joaosreis/tezcheck/blob/main/src/lib/tezcheck.ml"
click node_absinterp "https://github.com/joaosreis/tezcheck/blob/main/src/lib/absinterp/absinterp.ml"
click node_cfg "https://github.com/joaosreis/tezcheck/blob/main/src/lib/dataflow/cfg.ml"
click node_forward "https://github.com/joaosreis/tezcheck/blob/main/src/lib/dataflow/forward.ml"
click node_backward "https://github.com/joaosreis/tezcheck/blob/main/src/lib/dataflow/backward.ml"
click node_inter_transfer "https://github.com/joaosreis/tezcheck/blob/main/src/lib/dataflow/inter_transfer.ml"
click node_transfer "https://github.com/joaosreis/tezcheck/blob/main/src/lib/dataflow/transfer.ml"
click node_solvers "https://github.com/joaosreis/tezcheck/blob/main/src/lib/dataflow/solvers.ml"
click node_domain "https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/domain.ml"
click node_interval "https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/interval.ml"
click node_interval_domain "https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/interval_domain.ml"
click node_interval_ext "https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/interval_ext_domain.ml"
click node_lambda "https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/lambda.ml"
click node_lambda_ext "https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/lambda_ext.ml"
click node_non_relational "https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/non_relational_domain.ml"
click node_value_domain "https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/value_domain.ml"

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_tezcheck toneBlue
class node_cfg,node_forward,node_backward,node_inter_transfer,node_transfer,node_solvers toneAmber
class node_absinterp toneMint
class node_domain,node_interval,node_interval_domain,node_interval_ext,node_lambda,node_lambda_ext,node_non_relational,node_value_domain toneRose
class node_contracts,node_tezla toneIndigo
```

## Components

### Analysis

- [Tezcheck analyzer](https://github.com/joaosreis/tezcheck/blob/main/src/lib/tezcheck.ml): `src/lib/tezcheck.ml`

### Dataflow

- [Control-flow graph](https://github.com/joaosreis/tezcheck/blob/main/src/lib/dataflow/cfg.ml): `src/lib/dataflow/cfg.ml`
- [Forward analysis](https://github.com/joaosreis/tezcheck/blob/main/src/lib/dataflow/forward.ml): `src/lib/dataflow/forward.ml`
- [Backward analysis](https://github.com/joaosreis/tezcheck/blob/main/src/lib/dataflow/backward.ml): `src/lib/dataflow/backward.ml`
- [Inter transfer](https://github.com/joaosreis/tezcheck/blob/main/src/lib/dataflow/inter_transfer.ml): `src/lib/dataflow/inter_transfer.ml`
- [Transfer functions](https://github.com/joaosreis/tezcheck/blob/main/src/lib/dataflow/transfer.ml): `src/lib/dataflow/transfer.ml`
- [Dataflow solvers](https://github.com/joaosreis/tezcheck/blob/main/src/lib/dataflow/solvers.ml): `src/lib/dataflow/solvers.ml`

### Abstract interpretation

- [Abstract interpreter](https://github.com/joaosreis/tezcheck/blob/main/src/lib/absinterp/absinterp.ml): `src/lib/absinterp/absinterp.ml`

### Analysis domains

- [Domain interface](https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/domain.ml): `src/lib/domains/domain.ml`
- [Intervals](https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/interval.ml): `src/lib/domains/interval.ml`
- [Interval domain](https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/interval_domain.ml): `src/lib/domains/interval_domain.ml`
- [Extended interval domain](https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/interval_ext_domain.ml): `src/lib/domains/interval_ext_domain.ml`
- [Lambda domain](https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/lambda.ml): `src/lib/domains/lambda.ml`
- [Extended lambda domain](https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/lambda_ext.ml): `src/lib/domains/lambda_ext.ml`
- [Non-relational domain](https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/non_relational_domain.ml): `src/lib/domains/non_relational_domain.ml`
- [Value domain](https://github.com/joaosreis/tezcheck/blob/main/src/lib/domains/value_domain.ml): `src/lib/domains/value_domain.ml`

### Other components

- **Michelson contracts**
- **Tezla IR**

## Connections

- Michelson contracts → Tezcheck analyzer: analyzes (evidence: `README.md`)
- Tezcheck analyzer → Tezla IR: uses IR (evidence: `README.md`)
