Stream: Mirror: Isabelle Development Mailing List

Topic: Kernel soundness patches


view this post on Zulip Email Gateway (Nov 25 2026 at 19:02):

From: Lawrence Paulson via isabelle-dev <isabelle-dev@proof.cit.tum.de>

Dear colleagues,

Many of you may have heard rumours about soundness bugs in Isabelle. Today I’m sharing a comprehensive patch for four issues (three of which concern soundness), and just as important, a deeper knowledge of what the issues actually are.

Two of the soundness bugs concern a small chunk of code whose purpose is to present the user with familiar variable names. That is, when new Bound and Var (unifiable) variables are created, their names are generated from names already present in your subgoal. The names of Bound variables are stored in their binder and have no significance, but Vars must be renamed consistently. The existing code was already correct in all normal circumstances, but not if the “rule” applied to the “proof state” was non-standard in either of two ways:

You cannot actually store a rule with either of those characteristics, but nevertheless they can be created by a bad person. The fix in each case takes a single line of code. These patches were shared to this list by Qiyuan XU on 4 November and are included in the attached patch file.

An error, though not a soundness issue, could occur if a type variable became instantiated by a function type during unification. The fix to enforce eta-expansion even in recursive calls to HOU. These three issues were introduced around 1991.

The final issue concerns soundness and has been present probably from the very beginning, i.e. 1986. My aggressive implementation of HOU tried to do the job in a single pass rather than using the layer‑by‑layer approach published by Gérard Huet. Unfortunately, in rare cases, it could create a circular environment and then admit a false unification. The fix is to revert to Huet’s approach. Unfortunately, this fix can affect existing proofs if they are brittle enough to refer to the “indexes” of Vars. I'm attaching two additional patches to cover situations where that happens (once in Isabelle/ZF/UNITY and ones in the AutoCorres2 AFP entry).

Obviously, these problems need to be fixed and will be in the next release. Given how difficult these are to trigger, people should not feel obliged to patch their current release. But, in case you want to, here is the patch. Set $SRC to point to the src directory of your copy of Isabelle and type

patch -d $SRC -p2 < isabelle2026-soundness-04-05-07-08.patch

My particular thanks to Dmitriy Traytel and others for investigating these issues. He has even proved the correctness of the patched code. But we will not be resting on our laurels and will probably be adopting a proposal by Simon Wimmer to pull HOU out of the kernel altogether. That would remove nearly 700 lines of particularly fiendish code.

Larry

isabelle2026-soundness-04-05-07-08.patch
06-zf-unity-indices.patch
AutoCorres2-maxidx.patch

view this post on Zulip Email Gateway (Nov 25 2026 at 20:05):

From: Lawrence Paulson via isabelle-dev <isabelle-dev@proof.cit.tum.de>

Dear colleagues,

Many of you may have heard rumours about soundness bugs in Isabelle. Today I’m sharing a comprehensive patch for four issues (three of which concern soundness), and just as important, a deeper knowledge of what the issues actually are.

Two of the soundness bugs concern a small chunk of code whose purpose is to present the user with familiar variable names. That is, when new Bound and Var (unifiable) variables are created, their names are generated from names already present in your subgoal. The names of Bound variables are stored in their binder and have no significance, but Vars must be renamed consistently. The existing code was already correct in all normal circumstances, but not if the “rule” applied to the “proof state” was non-standard in either of two ways:

You cannot actually store a rule with either of those characteristics, but nevertheless they can be created by a bad person. The fix in each case takes a single line of code. These patches were shared to this list by Qiyuan XU on 4 November and are included in the attached patch file.

An error, though not a soundness issue, could occur if a type variable became instantiated by a function type during unification. The fix to enforce eta-expansion even in recursive calls to HOU. These three issues were introduced around 1991.

The final issue concerns soundness and has been present probably from the very beginning, i.e. 1986. My aggressive implementation of HOU tried to do the job in a single pass rather than using the layer‑by‑layer approach published by Gérard Huet. Unfortunately, in rare cases, it could create a circular environment and then admit a false unification. The fix is to revert to Huet’s approach. Unfortunately, this fix can affect existing proofs if they are brittle enough to refer to the “indexes” of Vars. I'm attaching two additional patches to cover situations where that happens (once in Isabelle/ZF/UNITY and ones in the AutoCorres2 AFP entry).

Obviously, these problems need to be fixed and will be in the next release. Given how difficult these are to trigger, people should not feel obliged to patch their current release. But, in case you want to, here is the patch. Set $SRC to point to the src directory of your copy of Isabelle and type

patch -d $SRC -p2 < isabelle2026-soundness-04-05-07-08.patch

My particular thanks to Dmitriy Traytel and others for investigating these issues. He has even proved the correctness of the patched code. But we will not be resting on our laurels and will probably be adopting a proposal by Simon Wimmer to pull HOU out of the kernel altogether. That would remove nearly 700 lines of particularly fiendish code.

Larry

isabelle2026-soundness-04-05-07-08.patch
06-zf-unity-indices.patch
AutoCorres2-maxidx.patch


Last updated: Dec 02 2026 at 13:38 UTC