12 releases

0.3.7 May 20, 2026
0.3.6 Jan 15, 2026
0.3.5 Oct 2, 2025
0.3.2 Jul 24, 2025
0.1.0-alpha.1 Oct 7, 2024

#181 in Algorithms

Download history 60872/week @ 2026-04-21 66995/week @ 2026-04-28 84484/week @ 2026-05-05 91851/week @ 2026-05-12 84041/week @ 2026-05-19 70568/week @ 2026-05-26 70791/week @ 2026-06-02 80022/week @ 2026-06-09 85115/week @ 2026-06-16 74515/week @ 2026-06-23 57409/week @ 2026-06-30 87569/week @ 2026-07-07 93357/week @ 2026-07-14 91910/week @ 2026-07-21 113363/week @ 2026-07-28 137736/week @ 2026-08-04

450,653 downloads per month
Used in 255 crates (21 directly)

Apache-2.0

2MB
35K SLoC

Coq 16K SLoC // 0.1% comments F* 12K SLoC // 0.2% comments Lean 7K SLoC // 0.1% comments Rust 668 SLoC // 0.0% comments

Hax-specific helpers for Rust programs. Those helpers are usually no-ops when compiled normally but meaningful when compiled under hax.

Example:

use hax_lib::*;
fn sum(x: Vec<u32>, y: Vec<u32>) -> Vec<u32> {
  hax_lib::assume!(x.len() == y.len());
  hax_lib::assert!(x.len() >= 0);
  hax_lib::assert_prop!(forall(|i: usize| implies(i < x.len(), x[i] < 4242)));
  hax_lib::debug_assert!(exists(|i: usize| implies(i < x.len(), x[i] > 123)));
  x.into_iter().zip(y.into_iter()).map(|(x, y)| x + y).collect()
}

hax library

This crate contains helpers that can be used when writing Rust code that is proven through the hax toolchain.

⚠️ The code in this crate has no effect when compiled without the --cfg hax.

Examples:

fn sum(x: Vec<u32>, y: Vec<u32>) -> Vec<u32> {
  hax_lib::assume!(x.len() == y.len());
  hax_lib::assert!(hax_lib::forall(|i: usize| hax_lib::implies(i < x.len(), || x[i] < 4242)));
  hax_lib::debug_assert!(hax_lib::exists(|i: usize| hax_lib::implies(i < x.len(), || x[i] > 123)));
  x.into_iter().zip(y.into_iter()).map(|(x, y)| x + y).collect()
}

Dependencies