-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #416 from AeneasVerif/son/fix2
Fix minor issues and add definitions to the standard library
- Loading branch information
Showing
10 changed files
with
223 additions
and
6 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
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
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
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
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
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
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,51 @@ | ||
-- THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS | ||
-- [scalars] | ||
import Base | ||
open Primitives | ||
set_option linter.dupNamespace false | ||
set_option linter.hashCommand false | ||
set_option linter.unusedVariables false | ||
|
||
namespace scalars | ||
|
||
/- [scalars::u32_use_wrapping_add]: | ||
Source: 'tests/src/scalars.rs', lines 3:0-5:1 -/ | ||
def u32_use_wrapping_add (x : U32) (y : U32) : Result U32 := | ||
Result.ok (core.num.u32.wrapping_add x y) | ||
|
||
/- [scalars::i32_use_wrapping_add]: | ||
Source: 'tests/src/scalars.rs', lines 7:0-9:1 -/ | ||
def i32_use_wrapping_add (x : I32) (y : I32) : Result I32 := | ||
Result.ok (core.num.i32.wrapping_add x y) | ||
|
||
/- [scalars::u32_use_wrapping_sub]: | ||
Source: 'tests/src/scalars.rs', lines 11:0-13:1 -/ | ||
def u32_use_wrapping_sub (x : U32) (y : U32) : Result U32 := | ||
Result.ok (core.num.u32.wrapping_sub x y) | ||
|
||
/- [scalars::i32_use_wrapping_sub]: | ||
Source: 'tests/src/scalars.rs', lines 15:0-17:1 -/ | ||
def i32_use_wrapping_sub (x : I32) (y : I32) : Result I32 := | ||
Result.ok (core.num.i32.wrapping_sub x y) | ||
|
||
/- [scalars::u32_use_shift_right]: | ||
Source: 'tests/src/scalars.rs', lines 19:0-21:1 -/ | ||
def u32_use_shift_right (x : U32) : Result U32 := | ||
x >>> 2#i32 | ||
|
||
/- [scalars::i32_use_shift_right]: | ||
Source: 'tests/src/scalars.rs', lines 23:0-25:1 -/ | ||
def i32_use_shift_right (x : I32) : Result I32 := | ||
x >>> 2#i32 | ||
|
||
/- [scalars::u32_use_shift_left]: | ||
Source: 'tests/src/scalars.rs', lines 27:0-29:1 -/ | ||
def u32_use_shift_left (x : U32) : Result U32 := | ||
x <<< 2#i32 | ||
|
||
/- [scalars::i32_use_shift_left]: | ||
Source: 'tests/src/scalars.rs', lines 31:0-33:1 -/ | ||
def i32_use_shift_left (x : I32) : Result I32 := | ||
x <<< 2#i32 | ||
|
||
end scalars |
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,26 @@ | ||
-- THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS | ||
-- [vec] | ||
import Base | ||
open Primitives | ||
set_option linter.dupNamespace false | ||
set_option linter.hashCommand false | ||
set_option linter.unusedVariables false | ||
|
||
namespace vec | ||
|
||
/- [vec::use_extend_from_slice]: | ||
Source: 'tests/src/vec.rs', lines 5:0-7:1 -/ | ||
def use_extend_from_slice | ||
{T : Type} (corecloneCloneInst : core.clone.Clone T) (v : alloc.vec.Vec T) | ||
(s : Slice T) : | ||
Result (alloc.vec.Vec T) | ||
:= | ||
alloc.vec.Vec.extend_from_slice corecloneCloneInst v s | ||
|
||
/- [vec::use_alloc_with_capacity]: | ||
Source: 'tests/src/vec.rs', lines 9:0-11:1 -/ | ||
def use_alloc_with_capacity | ||
(T : Type) (n : Usize) : Result (alloc.vec.Vec T) := | ||
Result.ok (alloc.vec.Vec.with_capacity T n) | ||
|
||
end vec |
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,33 @@ | ||
//@ [coq,fstar,borrow-check] skip | ||
|
||
fn u32_use_wrapping_add(x : u32, y : u32) -> u32 { | ||
x.wrapping_add(y) | ||
} | ||
|
||
fn i32_use_wrapping_add(x : i32, y : i32) -> i32 { | ||
x.wrapping_add(y) | ||
} | ||
|
||
fn u32_use_wrapping_sub(x : u32, y : u32) -> u32 { | ||
x.wrapping_sub(y) | ||
} | ||
|
||
fn i32_use_wrapping_sub(x : i32, y : i32) -> i32 { | ||
x.wrapping_sub(y) | ||
} | ||
|
||
fn u32_use_shift_right(x : u32) -> u32 { | ||
x >> 2 | ||
} | ||
|
||
fn i32_use_shift_right(x : i32) -> i32 { | ||
x >> 2 | ||
} | ||
|
||
fn u32_use_shift_left(x : u32) -> u32 { | ||
x << 2 | ||
} | ||
|
||
fn i32_use_shift_left(x : i32) -> i32 { | ||
x << 2 | ||
} |
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,11 @@ | ||
//@ [coq,fstar,borrow-check] skip | ||
|
||
use std::vec::Vec; | ||
|
||
fn use_extend_from_slice<T: Clone>(v: &mut Vec<T>, s: &[T]) { | ||
v.extend_from_slice(s) | ||
} | ||
|
||
fn use_alloc_with_capacity<T>(n: usize) -> Vec<T> { | ||
Vec::with_capacity(n) | ||
} |