-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
(** THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS *) | ||
(** [bitwise] *) | ||
Require Import Primitives. | ||
Import Primitives. | ||
Require Import Coq.ZArith.ZArith. | ||
Require Import List. | ||
Import ListNotations. | ||
Local Open Scope Primitives_scope. | ||
Module Bitwise. | ||
|
||
(** [bitwise::shift_u32]: forward function | ||
Source: 'src/bitwise.rs', lines 3:0-3:31 *) | ||
Definition shift_u32 (a : u32) : result u32 := | ||
t <- u32_shr a 16%usize; u32_shl t 16%usize | ||
. | ||
|
||
(** [bitwise::shift_i32]: forward function | ||
Source: 'src/bitwise.rs', lines 10:0-10:31 *) | ||
Definition shift_i32 (a : i32) : result i32 := | ||
t <- i32_shr a 16%isize; i32_shl t 16%isize | ||
. | ||
|
||
(** [bitwise::xor_u32]: forward function | ||
Source: 'src/bitwise.rs', lines 17:0-17:37 *) | ||
Definition xor_u32 (a : u32) (b : u32) : result u32 := | ||
Return (u32_xor a b). | ||
|
||
(** [bitwise::or_u32]: forward function | ||
Source: 'src/bitwise.rs', lines 21:0-21:36 *) | ||
Definition or_u32 (a : u32) (b : u32) : result u32 := | ||
Return (u32_or a b). | ||
|
||
(** [bitwise::and_u32]: forward function | ||
Source: 'src/bitwise.rs', lines 25:0-25:37 *) | ||
Definition and_u32 (a : u32) (b : u32) : result u32 := | ||
Return (u32_and a b). | ||
|
||
End Bitwise. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
(** THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS *) | ||
(** [bitwise] *) | ||
module Bitwise | ||
open Primitives | ||
|
||
#set-options "--z3rlimit 50 --fuel 1 --ifuel 1" | ||
|
||
(** [bitwise::shift_u32]: forward function | ||
Source: 'src/bitwise.rs', lines 3:0-3:31 *) | ||
let shift_u32 (a : u32) : result u32 = | ||
let* t = u32_shr #Usize a 16 in u32_shl #Usize t 16 | ||
|
||
(** [bitwise::shift_i32]: forward function | ||
Source: 'src/bitwise.rs', lines 10:0-10:31 *) | ||
let shift_i32 (a : i32) : result i32 = | ||
let* t = i32_shr #Isize a 16 in i32_shl #Isize t 16 | ||
|
||
(** [bitwise::xor_u32]: forward function | ||
Source: 'src/bitwise.rs', lines 17:0-17:37 *) | ||
let xor_u32 (a : u32) (b : u32) : result u32 = | ||
Return (u32_xor a b) | ||
|
||
(** [bitwise::or_u32]: forward function | ||
Source: 'src/bitwise.rs', lines 21:0-21:36 *) | ||
let or_u32 (a : u32) (b : u32) : result u32 = | ||
Return (u32_or a b) | ||
|
||
(** [bitwise::and_u32]: forward function | ||
Source: 'src/bitwise.rs', lines 25:0-25:37 *) | ||
let and_u32 (a : u32) (b : u32) : result u32 = | ||
Return (u32_and a b) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
-- THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS | ||
-- [bitwise] | ||
import Base | ||
open Primitives | ||
|
||
namespace bitwise | ||
|
||
/- [bitwise::shift_u32]: forward function | ||
Source: 'src/bitwise.rs', lines 3:0-3:31 -/ | ||
def shift_u32 (a : U32) : Result U32 := | ||
do | ||
let t ← a >>> 16#usize | ||
t <<< 16#usize | ||
|
||
/- [bitwise::shift_i32]: forward function | ||
Source: 'src/bitwise.rs', lines 10:0-10:31 -/ | ||
def shift_i32 (a : I32) : Result I32 := | ||
do | ||
let t ← a >>> 16#isize | ||
t <<< 16#isize | ||
|
||
/- [bitwise::xor_u32]: forward function | ||
Source: 'src/bitwise.rs', lines 17:0-17:37 -/ | ||
def xor_u32 (a : U32) (b : U32) : Result U32 := | ||
Result.ret (a ^^^ b) | ||
|
||
/- [bitwise::or_u32]: forward function | ||
Source: 'src/bitwise.rs', lines 21:0-21:36 -/ | ||
def or_u32 (a : U32) (b : U32) : Result U32 := | ||
Result.ret (a ||| b) | ||
|
||
/- [bitwise::and_u32]: forward function | ||
Source: 'src/bitwise.rs', lines 25:0-25:37 -/ | ||
def and_u32 (a : U32) (b : U32) : Result U32 := | ||
Result.ret (a &&& b) | ||
|
||
end bitwise |