Skip to content

Commit 3566660

Browse files
committed
Minor changes
1 parent fdfc7f8 commit 3566660

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed

engine/backends/coq/coq/coq_backend.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ struct
623623
^^ break 1))
624624
^^ break 1
625625
^^ CoqNotation.arguments (!^"Build_" ^^ name#p)
626-
arguments_explicity_with_ty
626+
arguments_explicity_without_ty (* arguments_explicity_with_ty *)
627627
^^ concat_map_with ~pre:(break 1)
628628
(fun (ident, typ, attr) ->
629629
CoqNotation.arguments ident#p arguments_explicity_without_ty)
@@ -991,8 +991,10 @@ struct
991991
| "ge" -> "PartialOrd_f_ge"
992992
| "rem" -> "Rem_f_rem"
993993
| "add" -> "Add_f_add"
994+
| "sub" -> "Sub_f_sub"
994995
| "mul" -> "Mul_f_mul"
995996
| "div" -> "Div_f_div"
997+
| "index" -> "Index_f_index"
996998
| x -> x)
997999
end
9981000

examples/Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/coverage/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ mod test_functions;
1111
mod test_instance;
1212

1313
mod test_trait;
14+
15+
mod test_arrays;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
// // This function borrows a slice.
3+
// fn analyze_slice(slice: &[i32]) {
4+
// let _ = slice[0];
5+
// let _ = slice.len();
6+
// }
7+
8+
// fn test(){
9+
// // Fixed-size array (type signature is superfluous).
10+
// let xs: [i32; 5] = [1, 2, 3, 4, 5];
11+
12+
// // All elements can be initialized to the same value.
13+
// let ys: [i32; 500] = [0; 500];
14+
15+
// // Indexing starts at 0.
16+
// let _ = xs[0];
17+
// let _ = xs[1];
18+
19+
// // `len` returns the count of elements in the array.
20+
// let _ = xs.len();
21+
22+
// // Arrays can be automatically borrowed as slices.
23+
// analyze_slice(&xs);
24+
25+
// // Slices can point to a section of an array.
26+
// // They are of the form [starting_index..ending_index].
27+
// // `starting_index` is the first position in the slice.
28+
// // `ending_index` is one more than the last position in the slice.
29+
// analyze_slice(&ys[1 .. 4]);
30+
31+
// // Example of empty slice `&[]`:
32+
// let empty_array: [u32; 0] = [];
33+
// assert_eq!(&empty_array, &[]);
34+
// assert_eq!(&empty_array, &[][..]); // Same but more verbose
35+
// }

0 commit comments

Comments
 (0)