You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(*map (fun f -> Find_index f) (fun1 Observable.char QCheck.bool).gen;*)
52
73
return Sort;
74
+
return Stable_sort;
75
+
return Fast_sort;
53
76
return To_seq;
54
77
])
55
78
@@ -70,8 +93,14 @@ struct
70
93
List.mapi (funjc' -> if i <= j && j <= i+l-1then c else c') s
71
94
else s
72
95
|To_list -> s
96
+
|For_all_ -> s
97
+
|Exists_ -> s
73
98
|Mem_ -> s
99
+
|Find_opt_ -> s
100
+
(*| Find_index _ -> s*)
74
101
|Sort -> List.sort Char.compare s
102
+
|Stable_sort -> List.stable_sort Char.compare s
103
+
|Fast_sort -> List.fast_sort Char.compare s
75
104
|To_seq -> s
76
105
77
106
letinit_sut()=Array.make array_size 'a'
@@ -88,8 +117,14 @@ struct
88
117
|Copy -> Res (arraychar, Array.copy a)
89
118
|Fill (i,l,c) -> Res (result unitexn, protect (Array.fill a i l) c)
90
119
|To_list -> Res (listchar, Array.to_list a)
120
+
|For_all (Fun (_,f)) -> Res (bool, Array.for_all f a)
121
+
|Exists (Fun (_,f)) -> Res (bool, Array.exists f a)
91
122
|Memc -> Res (bool, Array.mem c a)
123
+
|Find_opt (Fun (_,f)) -> Res (optionchar, Array.find_opt f a)
124
+
(*| Find_index (Fun (_,f)) -> Res (option int, Array.find_index f a)*)
92
125
|Sort -> Res (unit, Array.sort Char.compare a)
126
+
|Stable_sort -> Res (unit, Array.stable_sort Char.compare a)
127
+
|Fast_sort -> Res (unit, Array.fast_sort Char.compare a)
93
128
|To_seq -> Res (seq char, List.to_seq (List.of_seq (Array.to_seq a))) (* workaround: Array.to_seq is lazy and will otherwise see and report later Array.set state changes... *)
94
129
95
130
letpostcondc (s:char list) res=match c, res with
@@ -112,8 +147,14 @@ struct
112
147
then r =Error (Invalid_argument"Array.fill")
113
148
else r =Ok()
114
149
|To_list, Res ((List Char,_),cs) -> cs = s
150
+
|For_all (Fun (_,f)), Res ((Bool,_),r) -> r =List.for_all f s
151
+
|Exists (Fun (_,f)), Res ((Bool,_),r) -> r =List.exists f s
115
152
|Memc, Res ((Bool,_),r) -> r =List.mem c s
153
+
|Find_opt (Fun (_,f)), Res ((Option Char,_),r) -> r =List.find_opt f s
154
+
(*| Find_index (Fun (_,f)), Res ((Option Int,_),r) -> r = List.find_index f s*)
116
155
|Sort, Res ((Unit,_),r) -> r =()
156
+
|Stable_sort, Res ((Unit,_),r) -> r =()
157
+
|Fast_sort, Res ((Unit,_),r) -> r =()
117
158
|To_seq, Res ((Seq Char,_),r) -> Seq.equal (=) r (List.to_seq s)
0 commit comments