ProofWord.wdiff: def of lawful-words@0.1.0.0 Import: import lawful-words@0.1.0.0/proof_word.bend as ProofWord Lines 918-932 of lawful-words@0.1.0.0/proof_word.bend: https://jend.leeeet.dev/read.txt?path=lawful-words@0.1.0.0/proof_word.bend&start_line=918&end_line=932 import Base # The lowest bit where two words differ (0 if they are equal). def wdiff(n: Nat, a: Word(n), b: Word(n)) -> Nat: match n: case 0n: 0n case 1n+p: match a b: case WCon{False{}, at} WCon{False{}, bt}: 1n+wdiff(p, at, bt) case WCon{False{}, at} WCon{True{}, bt}: 0n case WCon{True{}, at} WCon{False{}, bt}: 0n case WCon{True{}, at} WCon{True{}, bt}: 1n+wdiff(p, at, bt) Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Con