Dimitri Bohlender
https://bohlender.github.io/blog/
Thoughts on formal methods, computer science, art & society
Hugo  gohugo.io
engb
© Dimitri Bohlender
Wed, 21 Aug 2019 17:23:49 +0200

Solving a Logic Synthesis Puzzle via SAT/SMT
https://bohlender.github.io/blog/solvingalogicsynthesispuzzleviasatsmt/
Thu, 12 Dec 2019 00:00:00 +0000
Dimitri Bohlender
sat
smt
logic synthesis
puzzle
https://bohlender.github.io/blog/solvingalogicsynthesispuzzleviasatsmt/
<p>A few weeks ago, I was asked the following riddle:
<q>Design a <a href="https://en.wikipedia.org/wiki/Logic_gate">logic circuit</a> with three inputs and three outputs, such that the outputs are the inverted inputs. You may use arbitrary many AND and OR gates, but at most two NOT gates</q>.
Although the characterisation of this problem as an <a href="https://en.wikipedia.org/wiki/Satisfiability_modulo_theories">SMT</a> instance is straightforward, I found it necessary to reduce it to <a href="https://en.wikipedia.org/wiki/Satisfiability">SAT</a> and incorporate further assumptions to achieve reasonable performance.
This post illustrates said process, ranging from the original idea to a standard formulation of SATbased logic synthesis to a problemspecific and more constrained instance.</p>

SMTbased Reasoning About the Fast Inverse Square Root
https://bohlender.github.io/blog/smtbasedoptimisationoffastinversesquareroot/
Thu, 26 Sep 2019 00:00:00 +0000
Dimitri Bohlender
smt
smtlib
software verification
https://bohlender.github.io/blog/smtbasedoptimisationoffastinversesquareroot/
<p>While there is a <a href="https://web.archive.org/web/20160308091758/http://www.daxia.com/bibis/upload/406Fast_Inverse_Square_Root.pdf">mathematical explanation</a> for the choice of <code>0x5F3759DF</code> in the <a href="https://en.wikipedia.org/wiki/Fast_inverse_square_root">famous bitlevel hack</a> for approximating the multiplicative inverse of the square root of a 32bit floatingpoint number, it is not immediately clear to what extent the reasoning is really applicable in the context of machine data types and their peculiarities.
This post illustrates how this, and related aspects, can be investigated with <a href="https://en.wikipedia.org/wiki/Satisfiability_modulo_theories">SMT</a>based reasoning about the actual implementation.</p>