This repository has been archived by the owner on Sep 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
config.toml
98 lines (88 loc) · 3.49 KB
/
config.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
rustc_args = "$RUST_SRC_PATH/libcore/lib.rs"
targets = [
'core.«\[T\] as core.slice.SliceExt».(binary_search|get)',
#fixedbitset
"core.marker.PhantomData", "core.marker.Copy", "core.iter.iterator.Iterator",
"core.«&'a u32 as core.ops.BitAnd<u32>»",
"core.«u32 as core.clone.Clone»",
#ref
"core.«i32 as core.default.Default»",
'core.ops.Range\w*',
]
# items axiomatized in pre.lean
ignore = [
# items axiomatized in pre.lean
"core.ops.FnOnce", "core.ops.FnMut", "core.ops.Fn",
'core.option.Option',
'core.intrinsics.(.*_with_overflow|overflowing_.*)',
"core.mem.swap",
'core.«\[T\] as core.slice.SliceExt».len',
'core.[iu]size.(min_value|overflowing_sh.)',
'core.num.wrapping.shift_max.platform.[iu]size',
]
fail = [
# marker traits that influence static semantics
"core.marker.Unsize", "core.ops.CoerceUnsized",
# big caches, won't work anyway without floats
"core.num.flt2dec.strategy.grisu.CACHED_POW10", "core.num.dec2flt.table.POWERS",
# way too big with naive if compilation
'core.«\(A, B, C, D, E.*',
'core.«.* as core.iter.range.Step».steps_between',
'core.«core.iter.range.StepBy<A, core.ops.Range<A>> as core.iter.iterator.Iterator».next',
'core.«core.num.flt2dec.decoder.Decoded as core.cmp.PartialEq».*',
'core.num.dec2flt.parse.eat_digits',
'core.str.next_code_point(_reverse)?',
'core.str.pattern.TwoWaySearcher.(reverse_)?maximal_suffix',
'core.«core.hash.sip.Sip..Rounds as core.hash.sip.Sip».[cd]_rounds',
'core.num.diy_float.Fp.normalize',
# broken recursion detection -- would fail anyway
'core.ops.Carrier',
# field/method name clash
'core.str.Utf8Error.valid_up_to'
]
# unsafe functions that rely on other definitions and thus have to be replaced inline
[replace]
"core.«[T] as core.ops.Index<core.ops.Range<usize>>».index" = """
section
open core.ops
/-
/// Implements slicing with syntax `&self[begin .. end]`.
///
/// Returns a slice of self for the index range [`begin`..`end`).
///
/// This operation is `O(1)`.
///
/// # Panics
///
/// Requires that `begin <= end` and `end <= self.len()`,
/// otherwise slicing will panic.
-/
definition core.«[T] as core.ops.Index<core.ops.Range<usize>>».index {T : Type₁} (self : slice T) (index : Range usize) : sem (slice T) :=
sem.guard (Range.start index ≤ Range.«end» index ∧ Range.«end» index ≤ list.length self)
$ return (list.firstn (Range.«end» index - Range.start index) (list.dropn (Range.start index) self))
end"""
"core.«[T] as core.ops.IndexMut<core.ops.Range<usize>>».index_mut" = """
section
open core.ops
/-
/// Implements mutable slicing with syntax `&mut self[begin .. end]`.
///
/// Returns a slice of self for the index range [`begin`..`end`).
///
/// This operation is `O(1)`.
///
/// # Panics
///
/// Requires that `begin <= end` and `end <= self.len()`,
/// otherwise slicing will panic.
-/
definition core.«[T] as core.ops.IndexMut<core.ops.Range<usize>>».index_mut {T : Type₁} (self : slice T) (index : Range usize) : sem (lens (slice T) (slice T) × slice T) :=
sem.guard (Range.start index ≤ Range.«end» index ∧ Range.«end» index ≤ list.length self)
$ return (lens.mk
(λ self, return $ list.firstn (Range.«end» index - Range.start index) (list.dropn (Range.start index) self))
(λ self new, return $ list.firstn (Range.start index) self ++ new ++ list.dropn (Range.end index) self),
self)
end"""
[traits."core.slice.SliceExt"]
# only method called from default methods (`is_empty`), everything else should be static calls
only = ["len"]