FStarLang/AlgoStar

Auto formalization of the CLRS text book

40

stars

1,129

commits

F*

primary language

Jul 8, 2026

updated

README

AlgoStar

This repository contains verified implementations of algorithms and data structures in Pulse, a separation-logic language embedded in F*.

All the code has been produced by agents driven by prompts and feedback on specifications from humans.

AutoCLRS

This is an agent-generated implementation of algorithms and data structures from Cormen, Leiserson, Rivest, and Stein's Introduction to Algorithms (CLRS) textbook, available from MIT press.

Prerequisites

  • OCaml (>= 4.14) with opam
  • Z3 (>= 4.8.5) — install via opam: opam install z3 or your system package manager
  • GNU Make, Git

Getting Started

1. Clone the repository with submodules

git clone --recurse-submodules git@github.com:FStarLang/AutoCLRS.git
cd AutoCLRS

If you already cloned without --recurse-submodules:

git submodule update --init --recursive

2. Build F* and Pulse

./setup.sh

This builds F* and Pulse from the pinned submodule versions. It takes 10–20 minutes on first run. You can also build them individually:

./setup.sh fstar   # build only F*
./setup.sh pulse   # build only Pulse (requires F* already built)

3. Verify all chapters

make        # verify all chapters
make -j8    # parallel build (recommended)
make clean  # clean build artifacts

Each chapter can also be verified independently:

cd autoclrs/ch02-getting-started && make

Repository Structure

DirectoryCLRS ChaptersTopics
autoclrs/ch02-getting-started/Ch 2Insertion Sort, Merge Sort
autoclrs/ch04-divide-conquer/Ch 4Maximum Subarray
autoclrs/ch06-heapsort/Ch 6Binary Heaps, Heapsort
autoclrs/ch07-quicksort/Ch 7Quicksort, Lomuto/Hoare partition
autoclrs/ch08-linear-sorting/Ch 8Counting Sort, Radix Sort
autoclrs/ch09-order-statistics/Ch 9Randomized/Deterministic Select
autoclrs/ch10-elementary-ds/Ch 10Stacks, Queues, Linked Lists
autoclrs/ch11-hash-tables/Ch 11Chained Hash Tables
autoclrs/ch12-bst/Ch 12Binary Search Trees
autoclrs/ch13-rbtree/Ch 13Red-Black Trees
autoclrs/ch15-dynamic-programming/Ch 15Rod Cutting, Matrix Chain, LCS, Knapsack
autoclrs/ch16-greedy/Ch 16Activity Selection, Huffman Coding
autoclrs/ch21-disjoint-sets/Ch 21Union-Find with union by rank + path compression
autoclrs/ch22-elementary-graph/Ch 22BFS, DFS, Topological Sort
autoclrs/ch23-mst/Ch 23Kruskal's MST
autoclrs/ch24-sssp/Ch 24Bellman-Ford, Dijkstra, DAG Shortest Paths
autoclrs/ch25-apsp/Ch 25Floyd-Warshall
autoclrs/ch26-max-flow/Ch 26Edmonds-Karp Max Flow
autoclrs/ch31-number-theory/Ch 31GCD, Modular Exponentiation, Miller-Rabin
autoclrs/ch32-string-matching/Ch 32Naive, Rabin-Karp, KMP
autoclrs/ch33-comp-geometry/Ch 33Convex Hull (Graham Scan)
autoclrs/ch35-approximation/Ch 35Vertex Cover (2-approximation)
autoclrs/common/Shared utilities

Documentation

Detailed per-algorithm documentation (specification reviews, correctness properties, complexity results, and known gaps) is available in:

  • Per-algorithm reviews: autoclrs/<chapter>/<Module>.Review.md files
  • Chapter READMEs: autoclrs/<chapter>/README.md

Contributors

nikswamy

1,127 commits

gebner

2 commits

FStarLang/AlgoStar

Auto formalization of the CLRS text book

40

stars

1,129

commits

F*

primary language

Jul 8, 2026

updated

README

AlgoStar

This repository contains verified implementations of algorithms and data structures in Pulse, a separation-logic language embedded in F*.

All the code has been produced by agents driven by prompts and feedback on specifications from humans.

AutoCLRS

This is an agent-generated implementation of algorithms and data structures from Cormen, Leiserson, Rivest, and Stein's Introduction to Algorithms (CLRS) textbook, available from MIT press.

Prerequisites

  • OCaml (>= 4.14) with opam
  • Z3 (>= 4.8.5) — install via opam: opam install z3 or your system package manager
  • GNU Make, Git

Getting Started

1. Clone the repository with submodules

git clone --recurse-submodules git@github.com:FStarLang/AutoCLRS.git
cd AutoCLRS

If you already cloned without --recurse-submodules:

git submodule update --init --recursive

2. Build F* and Pulse

./setup.sh

This builds F* and Pulse from the pinned submodule versions. It takes 10–20 minutes on first run. You can also build them individually:

./setup.sh fstar   # build only F*
./setup.sh pulse   # build only Pulse (requires F* already built)

3. Verify all chapters

make        # verify all chapters
make -j8    # parallel build (recommended)
make clean  # clean build artifacts

Each chapter can also be verified independently:

cd autoclrs/ch02-getting-started && make

Repository Structure

DirectoryCLRS ChaptersTopics
autoclrs/ch02-getting-started/Ch 2Insertion Sort, Merge Sort
autoclrs/ch04-divide-conquer/Ch 4Maximum Subarray
autoclrs/ch06-heapsort/Ch 6Binary Heaps, Heapsort
autoclrs/ch07-quicksort/Ch 7Quicksort, Lomuto/Hoare partition
autoclrs/ch08-linear-sorting/Ch 8Counting Sort, Radix Sort
autoclrs/ch09-order-statistics/Ch 9Randomized/Deterministic Select
autoclrs/ch10-elementary-ds/Ch 10Stacks, Queues, Linked Lists
autoclrs/ch11-hash-tables/Ch 11Chained Hash Tables
autoclrs/ch12-bst/Ch 12Binary Search Trees
autoclrs/ch13-rbtree/Ch 13Red-Black Trees
autoclrs/ch15-dynamic-programming/Ch 15Rod Cutting, Matrix Chain, LCS, Knapsack
autoclrs/ch16-greedy/Ch 16Activity Selection, Huffman Coding
autoclrs/ch21-disjoint-sets/Ch 21Union-Find with union by rank + path compression
autoclrs/ch22-elementary-graph/Ch 22BFS, DFS, Topological Sort
autoclrs/ch23-mst/Ch 23Kruskal's MST
autoclrs/ch24-sssp/Ch 24Bellman-Ford, Dijkstra, DAG Shortest Paths
autoclrs/ch25-apsp/Ch 25Floyd-Warshall
autoclrs/ch26-max-flow/Ch 26Edmonds-Karp Max Flow
autoclrs/ch31-number-theory/Ch 31GCD, Modular Exponentiation, Miller-Rabin
autoclrs/ch32-string-matching/Ch 32Naive, Rabin-Karp, KMP
autoclrs/ch33-comp-geometry/Ch 33Convex Hull (Graham Scan)
autoclrs/ch35-approximation/Ch 35Vertex Cover (2-approximation)
autoclrs/common/Shared utilities

Documentation

Detailed per-algorithm documentation (specification reviews, correctness properties, complexity results, and known gaps) is available in:

  • Per-algorithm reviews: autoclrs/<chapter>/<Module>.Review.md files
  • Chapter READMEs: autoclrs/<chapter>/README.md

Contributors

nikswamy

1,127 commits

gebner

2 commits

Languages

F*

71.6%

C

20.0%

C++

3.9%

SMT

2.4%

Makefile

1.8%