library smtlib-low-level-theory.theory — module DSeqBoolImplmodule DSeqBoolImpl : DSeqBool356use Zbit357use DSeq358use int.MinMax359use int.Int360use ref.Ref361362function int_to_seq (v:int) (len:int): seq bool =363from_array len false (fun i -> bittest v i)364
Zero–extension: the bits past length s are always false, the default of s is ignored, following get_seq_to_int.
No proof
368 let ghost function seq_to_int (s:seq bool) : int
369 ensures { forall j. 0 <= j ->
370 bittest result j = if j < length s then get s j else false }
371 =
372 let ref r = 0 in
373 for i=s.length-1 downto 0 do
374 invariant { forall j. 0 <= j ->
375 bittest r j = if j+i+1 < length s then get s (j+i+1) else false }
376 r := if get s i then 2*r+1 else 2*r
377 done;
378 r
379
380end