A Python implementation of a Computation Tree Logic (CTL) model checker that represents state sets symbolically using Binary Decision Diagrams (BDDs). A reference explicit-state checker is included for comparison and benchmarking.
The project requires Python 3.10+. Source code lives in src/, and unit
tests are in tests/.
git clone <repo-url>
cd cs6840finalProject
python3 -m venv venv
source venv/bin/activate # On Windows: .\venv\Scripts\activate
pip install -r requirements.txtExecute the test suite from the repository root:
pytestA standalone C11 port of the explicit CTL model checker lives in c_src/.
Build the CLI binary with make and provide a text file describing the
transition system and formula:
make -C c_src
./c_src/ctl_checker path/to/input.txtThe input format is line-oriented:
states <num_states>
init <k> <s0> ... <sk-1>
transitions <m>
u0 v0
...
u(m-1) v(m-1)
labels <l>
state count label0 ... label(count-1)
...
<formula>
For example:
states 2
init 1 0
transitions 2
0 1
1 1
labels 2
0 1 q
1 1 p
EF p
The program prints true when all initial states satisfy the formula and
exits with a zero status code; otherwise it prints false and exits non-zero.
A minimal demonstration is provided in example_usage.py:
python example_usage.pyThe script prints a label and result for each CTL formula, e.g.:
BDD EF p: True
BDD AG p: False
...
Explicit A[q U p]: False
Two benchmarking scripts live in the benchmarks/ directory:
run_benchmarks.pycompares runtime and peak memory usage of the BDD and explicit checkers on a ring topology.variable_order.pymeasures the effect of reversing the BDD variable order on a simple chain.
Run them from the repository root:
python benchmarks/run_benchmarks.py
python benchmarks/variable_order.pySample results are available in BENCHMARK_RESULTS.md.
For an overview of project goals, module layout, and example workflows, see PROJECT_DOCUMENTATION.md.