Used simplifier rules: hex-empty: ⊦ hex("") = 0;%hexchar5: ⊦ hexchar('5') = 5;% ⊦ # "" = 0;%str ≠ "" ⊦ # (* str) = # str.rstring + 1;