How imitator-model-checker/imitator works
1. This repository is the IMITATOR model-checker: a command-line OCaml tool that reads a parametric timed automaton model plus a property, runs one of several synthesis/model-checking algorithms, and emits results such as parameter sets, witnesses, counterexamples, or exported artifacts.
2. The main execution path starts in src/bin/IMITATOR.ml, which pulls together option parsing, input loading, model/property parsing, algorithm selection, execution, and result printing. The build is managed with Dune, with legacy OASIS generation scripts still present for packaging variants.
3. The core domain model lives in src/lib. It is organized around typed structures for automata, states, values, expressions, constraints, and properties. These modules form the shared in-memory representation used by all algorithms, exporters, and tests.
4. Parsing is a distinct front-end layer. ModelLexer.mll / ModelParser.mly handle .imi model files, while PropertyLexer.mll / PropertyParser.mly handle .imiprop property files. Parsed syntax is then converted through model/property converter modules into typed structures and normalized expressions.
5. A substantial preprocessing/analysis layer sits between parsing and search. Modules such as TypeConstraintResolver, ExpressionReducer, ClocksElimination, ModelConverter, ParsedValue, and the discrete-expression utilities handle typing, simplification, parameter/clock handling, and structural normalization before any synthesis algorithm runs.
6. The algorithm layer is the largest subsystem and is split into many dedicated modules under src/lib: reachability and temporal-property checks (AlgoEF, AlgoAG, AlgoEU, AlgoDeadlockFree, AlgoValid, AlgoNDFS), synthesis variants (AlgoIM, AlgoIMK, AlgoIMunion, AlgoBCCover, AlgoPRP, AlgoPTG), optimization variants (AlgoEFmin, AlgoEFmax, AlgoEFtminQueue), and cycle/non-Zeno variants (AlgoNZCUB, AlgoLoopSynth, AlgoAccLoopSynth). Each algorithm works over the shared core model and returns a structured result.
7. Result handling is centralized through Result, ResultProcessor, Statistics, Logger, and formatter/export modules. The tool can render outcomes as text, JSON, LaTeX, GraphViz/dot, TikZ, and translations to external model formats such as Uppaal, Jani, and HyTech, which means the architecture has a clear “analysis engine → presentation/export” boundary.
8. There is a separate distributed execution stack in src/lib_distr, focused on PRPC/behavioral-cartography-style workloads. It introduces master/worker and collaborator/coordinator modules for load splitting and distributed search, plus RunPaTATOR and DistributedUtilities as the orchestration layer. This part depends on the core model and algorithm layers but adds cluster communication and work partitioning as an explicit boundary.
9. The repository also contains tool-support code outside the main engine: comparator/ provides Python scripts and a small web UI for comparing results, and scripts/ contains helper automation for queries and JSON processing. These are adjuncts for benchmarking and result analysis rather than part of the verification core.
10. benchmarks/ is a large corpus of real models and properties used to exercise the engine across domains such as protocols, hardware, scheduling, security, and synthesis. File extensions indicate different roles: .imi for models, .imiprop for properties, .pi0/.v0 for some legacy benchmark formats, and .tsv for source data used by generated models.
11. tests/ is organized as a regression suite with focused cases for syntax, typing, expression semantics, updates, reachability, deadlock, cycle detection, timed properties, inclusions, and translation/export behavior. This suite mirrors the architecture of the engine: parser/type-checker tests, preprocessing tests, then algorithm-specific correctness cases.
12. The project has meaningful external-library boundaries: the presence of GMP, PPL, and MPI-related metadata and build patches indicates dependence on arbitrary-precision arithmetic/polyhedral reasoning and optional distributed execution support. That affects architecture because numerical domains and distributed PRPC execution are not incidental features; they are first-class execution modes.
13. Documentation and CI are treated as part of the product surface. doc/ contains the user/developer manuals and generated diagrams, while .github/workflows, Docker support, and build scripts define reproducible builds and automated validation. The repository is therefore structured as a research-grade toolchain with a core verifier, exporters, distributed mode, benchmark corpus, and extensive regression infrastructure.
Main entry points: IMITATOR.ml IMITATOR · AbstractAlgorithm.ml Algo core · Result.mli Results · TypedStructure.mli Typed model
Components 26
Entry points
Command-line launch and build orchestration
- IMITATOR · Main command-line executable and orchestration flow
src/bin/IMITATOR.ml - Dune build · Primary build definition for the OCaml project
dune-project - Packaging · Legacy OASIS and generation scripts for packaging variants
gen_oasis.py
Front-end
Input parsing and syntax conversion
- Model parse · Lexer and parser for .imi model files
src/lib/ModelParser.mly - Property parse · Lexer and parser for .imiprop property files
src/lib/PropertyParser.mly - Converters · Conversion from parsed syntax to typed and normalized structures
src/lib/ModelConverter.ml
Core model
Shared typed representation
- Typed model · Automata, states, values, expressions, constraints, and properties
src/lib/TypedStructure.mli - State space · State and state-space abstractions shared by algorithms
src/lib/StateSpace.ml - Expressions · Expression, constraint, and discrete-domain semantics
src/lib/DiscreteExpressions.ml
Normalization
Typing, simplification, and structural preprocessing
Algorithms
Main verification and synthesis engines
- Algo core · Shared algorithm interfaces and generic execution helpers
src/lib/AbstractAlgorithm.ml - Reachability · EF, AG, EU, deadlock, validity, and NDFS-style checks
src/lib/AlgoEF.ml - Synthesis · IM, IMK, IMunion, BCcover, PRP, PTG-style synthesis
src/lib/AlgoIM.ml - Optimization · Min/max and timed optimization variants
src/lib/AlgoEFmin.ml - Cycle search · Non-Zeno, loop synthesis, and accepting-cycle variants
src/lib/AlgoNZCUB.ml
Results
Result handling, statistics, and exports
- Results · Structured outcomes returned by algorithms
src/lib/Result.mli - Presenters · Formatting, logging, statistics, and export processing
src/lib/ResultProcessor.ml - Exporters · Text, JSON, LaTeX, dot, TikZ, Uppaal, Jani, and HyTech export
src/lib/PTA2JaniSpec.ml
Distributed
Cluster execution and partitioned search
- Distributed run · Distributed PRPC / behavioral-cartography execution orchestration
src/lib_distr/RunPaTATOR.ml - Workers · Master/worker and collaborator/coordinator search roles
src/lib_distr/AlgoBCCoverDistributedMSSeqMaster.ml
Support
Benchmarks, tests, docs, and tooling
- Benchmarks · Large suite of benchmark models, properties, and generated inputs
benchmarks/README.md - Regression tests · Parser, typing, preprocessing, algorithm, and translation regressions
tests/test.py - Docs · User/developer manuals, diagrams, and examples
doc/IMITATOR-developer-manual.md - Tooling · Comparator UI and helper scripts for experiments and data processing
comparator/comparator.py
Connections 33
- IMITATOR → Model parse: loads model · Entry point invokes model parsing
- IMITATOR → Property parse: loads property · Entry point invokes property parsing
- IMITATOR → Converters: prepares input · CLI hands parsed input to conversion pipeline
- IMITATOR → Algo core: selects algo · Command-line options determine algorithm selection and execution mode
- IMITATOR → Results: prints outcome · Main program formats and emits final results
- Model parse → Converters: syntax tree · Parsed models are converted into typed structures
- Property parse → Converters: property tree · Parsed properties are converted into typed structures
- Converters → Typed model: builds · Front-end conversion constructs the shared in-memory model
- Typed model → State space: contains · Model includes state and state-space abstractions
- Typed model → Expressions: uses · Typed model depends on expression and constraint semantics
- Typed model → Typing: validated by · Typed structure is checked and resolved during preprocessing
- Expressions → Reduce: simplified by · Expression layer is normalized before search
- Typing → Reduce: feeds · Typing produces cleaned inputs for reduction
- Reduce → Eliminate: normalizes · Reduction feeds elimination and structural cleanup
- Eliminate → Algo core: prepares · Preprocessing produces algorithm-ready models
- Algo core → Reachability: dispatches · Generic framework runs reachability and property-checking variants
- Algo core → Synthesis: dispatches · Generic framework runs synthesis variants
- Algo core → Optimization: dispatches · Generic framework runs optimization variants
- Algo core → Cycle search: dispatches · Generic framework runs cycle and non-Zeno variants
- Reachability → Results: returns · Reachability algorithms produce structured results
- Synthesis → Results: returns · Synthesis algorithms produce witnesses or parameter sets
- Optimization → Results: returns · Optimization algorithms produce extremal results
- Cycle search → Results: returns · Cycle algorithms produce loop and acceptance evidence
- Results → Presenters: processed by · Result objects flow into logging and formatting
- Presenters → Exporters: renders · Presentation layer emits text and export artifacts
- IMITATOR → Distributed run: distributed mode · CLI can invoke distributed execution stack
- Distributed run → Workers: coordinates · Distributed runtime splits work across roles
- Distributed run → Typed model: shares model · Distributed execution reuses the core typed model
- Distributed run → Algo core: uses algorithms · Distributed runtime delegates to core algorithms
- Benchmarks → IMITATOR: drives runs · Benchmark corpus is used to exercise the executable
- Regression tests → IMITATOR: regresses · Test suite validates parser, analysis, algorithms, and exports
- Docs → IMITATOR: documents · Manuals and examples describe the public tool surface
- Tooling → Results: analyzes · Auxiliary scripts compare and process verification outputs