<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Formal-Methods on Jérôme Vouillon</title><link>https://vouillon.github.io/blog/tags/formal-methods/</link><description>Recent content in Formal-Methods on Jérôme Vouillon</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 21 Jul 2026 12:00:00 +0200</lastBuildDate><atom:link href="https://vouillon.github.io/blog/tags/formal-methods/index.xml" rel="self" type="application/rss+xml"/><item><title>Teaching Booleans About Versions: A Theory-Augmented BDD Library in OCaml</title><link>https://vouillon.github.io/blog/posts/theo/</link><pubDate>Tue, 21 Jul 2026 12:00:00 +0200</pubDate><guid>https://vouillon.github.io/blog/posts/theo/</guid><description>&lt;p&gt;What if checking whether two formulas with a million nodes are logically
equivalent took exactly one machine instruction? Binary Decision Diagrams (BDDs)
make this possible. They give you a &lt;strong&gt;canonical&lt;/strong&gt; representation of boolean
functions (two logically equivalent formulas always produce the exact same
structure), which turns equivalence checking into a pointer comparison.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/vouillon/theo" target="_blank" rel="noreferrer"&gt;Theo&lt;/a&gt; is an OCaml library that implements
BDDs with two key extensions: &lt;strong&gt;complement edges&lt;/strong&gt; for compact representation,
and &lt;strong&gt;theory support&lt;/strong&gt; for reasoning about linear orders and equality. Consider
a package manager checking whether &lt;code&gt;(ocaml &amp;gt;= 4.14 AND dune &amp;gt;= 3.0) OR (ocaml &amp;gt;= 5.0)&lt;/code&gt; is compatible with &lt;code&gt;ocaml &amp;lt; 5.0&lt;/code&gt;. With Theo, you write this
directly using version constraints as atoms, and the engine automatically
simplifies: it knows &lt;code&gt;ocaml &amp;gt;= 4.14&lt;/code&gt; is redundant when &lt;code&gt;ocaml &amp;gt;= 5.0&lt;/code&gt; holds,
detects that the second disjunct contradicts &lt;code&gt;ocaml &amp;lt; 5.0&lt;/code&gt;, and can find the
simplest satisfying assignment (&lt;code&gt;ocaml &amp;gt;= 4.14, ocaml &amp;lt; 5.0, dune &amp;gt;= 3.0&lt;/code&gt;).&lt;/p&gt;</description></item></channel></rss>