Skip to content

Commit

Permalink
Merge pull request #3751 from mtzguido/int_fits
Browse files Browse the repository at this point in the history
IntN: add a `fits` for every module
  • Loading branch information
mtzguido authored Feb 14, 2025
2 parents f46939e + bbd64d5 commit 3fe597b
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .scripts/FStar.IntN.fstip
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ new val t : eqtype

val v (x:t) : Tot (int_t n)

let fits (x:int) : prop = Int.fits x n

val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
Expand Down
2 changes: 2 additions & 0 deletions .scripts/FStar.UIntN.fstip
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ new val t : eqtype
machine integer *)
val v (x:t) : Tot (uint_t n)

let fits (x:int) : prop = UInt.fits x n

(** A coercion that injects a bounded mathematical integers into a
machine integer *)
val uint_to_t (x:uint_t n) : Pure t
Expand Down
2 changes: 2 additions & 0 deletions ulib/FStar.Int128.fsti
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ new val t : eqtype

val v (x:t) : Tot (int_t n)

let fits (x:int) : prop = Int.fits x n

val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
Expand Down
2 changes: 2 additions & 0 deletions ulib/FStar.Int16.fsti
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ new val t : eqtype

val v (x:t) : Tot (int_t n)

let fits (x:int) : prop = Int.fits x n

val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
Expand Down
2 changes: 2 additions & 0 deletions ulib/FStar.Int32.fsti
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ new val t : eqtype

val v (x:t) : Tot (int_t n)

let fits (x:int) : prop = Int.fits x n

val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
Expand Down
2 changes: 2 additions & 0 deletions ulib/FStar.Int64.fsti
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ new val t : eqtype

val v (x:t) : Tot (int_t n)

let fits (x:int) : prop = Int.fits x n

val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
Expand Down
2 changes: 2 additions & 0 deletions ulib/FStar.Int8.fsti
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ new val t : eqtype

val v (x:t) : Tot (int_t n)

let fits (x:int) : prop = Int.fits x n

val int_to_t: x:int_t n -> Pure t
(requires True)
(ensures (fun y -> v y = x))
Expand Down
2 changes: 2 additions & 0 deletions ulib/FStar.UInt16.fsti
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ new val t : eqtype
machine integer *)
val v (x:t) : Tot (uint_t n)

let fits (x:int) : prop = UInt.fits x n

(** A coercion that injects a bounded mathematical integers into a
machine integer *)
val uint_to_t (x:uint_t n) : Pure t
Expand Down
2 changes: 2 additions & 0 deletions ulib/FStar.UInt32.fsti
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ new val t : eqtype
machine integer *)
val v (x:t) : Tot (uint_t n)

let fits (x:int) : prop = UInt.fits x n

(** A coercion that injects a bounded mathematical integers into a
machine integer *)
val uint_to_t (x:uint_t n) : Pure t
Expand Down
2 changes: 2 additions & 0 deletions ulib/FStar.UInt64.fsti
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ new val t : eqtype
machine integer *)
val v (x:t) : Tot (uint_t n)

let fits (x:int) : prop = UInt.fits x n

(** A coercion that injects a bounded mathematical integers into a
machine integer *)
val uint_to_t (x:uint_t n) : Pure t
Expand Down
2 changes: 2 additions & 0 deletions ulib/FStar.UInt8.fsti
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ new val t : eqtype
machine integer *)
val v (x:t) : Tot (uint_t n)

let fits (x:int) : prop = UInt.fits x n

(** A coercion that injects a bounded mathematical integers into a
machine integer *)
val uint_to_t (x:uint_t n) : Pure t
Expand Down

0 comments on commit 3fe597b

Please sign in to comment.