-
Notifications
You must be signed in to change notification settings - Fork 16
/
lib.fs
8659 lines (8396 loc) · 199 KB
/
lib.fs
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ========================================================================= //
// Copyright (c) 2003-2007, John Harrison. //
// Copyright (c) 2012 Eric Taucher, Jack Pappas, Anh-Dung Phan //
// (See "LICENSE.txt" for details.) //
// ========================================================================= //
module FSharpx.Books.AutomatedReasoning.Tests.lib
open FSharpx.Books.AutomatedReasoning.lib
open FSharp.Compatibility.OCaml.Num
open NUnit.Framework
open FsUnit
// ===========================================================================
// NOTE: In porting the OCaml to F#, if there was a corresponding built-in F# routine
// that was functionally equivelent, then the F# equivelent was used.
// Following is the list of F# equivelent routines.
// OCaml F#
// do_list List.iter
// end_itlist List.reduceBack
// el List.nth
// exists List.exists
// filter List.filter
// find List.find
// forall List.forall
// forall2 List.forall2
// hd List.head
// index List.findIndex
// itlist List.foldBack
// itlist2 List.foldBack2
// length List.length
// map List.map
// map2 List.map2
// minimize List.minBy
// maximize List.maxBy
// partition List.partition
// replicate List.replicate not replaced. See below.
// rev List.rev
// tl List.tail
// unzip List.unzip
// zip List.zip
//
// To ensure that each F# routine is equivelent,
// both the OCaml and F# routine are run against the
// same test cases and test results in the same test.
// If the results are equivelent, then the F# equivelent
// is used in the code.
//
// The noteable difference which still allowed the use
// of an F# routine are:
// 1. Different exception type and/or message.
// 2. Different index result when multiple valid answers. i.e. minBy and maxBy
//
// The once case where the differences were signifigant
// is F# List.replicate.
// When the replicate count is negative
// F# List.replicate will return exception and
// OCaml replicate will return [].
//
// NOTE: replicate is not used in code, so no need to replace replicate with List.replicate.
// replicate is in the original OCaml code but not used. It was ported with the lib module;
// upon further investigation it was found to be dead code.
//
// In order to be able to test against the OCaml version of the code
// that was replaced by an F# equivelent, the F# port of the code
// is placed here for access by the test functions.
let rec do_list f l =
match l with
| [] -> ()
| h::t -> f(h); do_list f t
let rec end_itlist f l =
match l with
| [] -> failwith "end_itlist"
| [x] -> x
| (h::t) -> f h (end_itlist f t)
let rec el n l =
if n = 0 then List.head l
else el (n - 1) (List.tail l)
let rec exists p l =
match l with
| [] -> false
| h::t -> p(h) || exists p t
let rec find p l =
match l with
| [] -> failwith "find"
| (h::t) -> if p(h) then h else find p t
let rec forall p l =
match l with
| [] -> true
| h::t -> p(h) && forall p t
let rec forall2 p l1 l2 =
match (l1,l2) with
| [],[] -> true
| (h1::t1,h2::t2) -> p h1 h2 && forall2 p t1 t2
| _ -> false
let hd l =
match l with
| h::t -> h
| _ -> failwith "hd"
let index_orig x =
let rec ind n l =
match l with
| [] -> failwith "index"
| (h::t) ->
if compare x h = 0 then n
else ind (n + 1) t
ind 0
let rec itlist f l b =
match l with
| [] -> b
| (h::t) -> f h (itlist f t b)
let rec itlist2 f l1 l2 b =
match (l1,l2) with
| ([],[]) -> b
| (h1::t1,h2::t2) -> f h1 h2 (itlist2 f t1 t2 b)
| _ -> failwith "itlist2"
let length =
let rec len k l =
if l = [] then k else len (k + 1) (List.tail l)
fun l -> len 0 l
let map f =
let rec mapf l =
match l with
| [] -> []
| (x::t) -> let y = f x in y::(mapf t)
mapf
let rec map2 f l1 l2 =
match (l1,l2) with
| [],[] -> []
| (h1::t1),(h2::t2) -> let h = f h1 h2 in h::(map2 f t1 t2)
| _ -> failwith "map2: length mismatch"
let partition p l =
itlist (fun a (yes,no) -> if p a then a::yes,no else yes,a::no) l ([],[])
let replicate n a = List.map (fun x -> a) (1--n)
let rev =
let rec rev_append acc l =
match l with
| [] -> acc
| h::t -> rev_append (h::acc) t
fun l -> rev_append [] l
let tl l =
match l with
| h::t -> t
| _ -> failwith "tl"
let rec unzip l =
match l with
| [] -> [],[]
| (x,y)::t ->
let xs,ys = unzip t in x::xs,y::ys
let rec zip l1 l2 =
match (l1,l2) with
| ([],[]) -> []
| (h1::t1,h2::t2) -> (h1,h2)::(zip t1 t2)
| _ -> failwith "zip"
let filter p l = fst(partition p l)
// ===========================================================================
// NOTE: In the F# optimzed version the
// following lib functions are replaced with
// equivalent F# functions or operators.
//
// To add evidence that the replacements are sound,
// the original results are tested against the
// F# replacement results. If the results are different
// the test will fail.
//
// OCaml F# Optimized
// insert Set.add
// intersect Set.intersect
// image Set.map
// mem Set.contains
// psubset Set.isProperSubset
// set_eq =
// subset Set.isSubset
// subtract Set.diference
// union Set.union
// unions Set.unionMany
// OCaml F# Optimized
// ('a, 'b) func Map<'a, 'b>
// undefined Map.empty
// is_undefined Map.isEmpty
// mapf Map.map
// foldl Map.fold
// foldr Map.foldBack
// graph Map.toList
// dom new function based on Map.fold
// ran new function based on Map.fold
// applyd new function based on Map.tryFind
// apply new function based on Map.tryFind
// tryapplyd new function based on Map.tryFind
// tryapplyl based on tryapplyd
// defined Map.containsKey
// undefine Map.remove
// |-> Map.add
// |=> Map.add initialized wtih Map.Empty
// fpf new function based on List.zip and Map.ofList
//
// In order to be able to test against the F# version of the code
// that was replaced by an F# optimized equivelent, the F# optimized version of the code
// is placed here for access by the test functions.
type func_opt<'a, 'b when 'a : comparison> = Map<'a, 'b>
let undefined_opt : func_opt<_,_> =
Map.empty
let inline is_undefined_opt (f : func_opt<_,_>) =
Map.isEmpty f
let inline mapf_opt mapping (f : func_opt<_,_>) : func_opt<_,_> =
Map.map (fun _ v -> mapping v) f
let inline foldl_opt folder state (f : func_opt<_,_>) =
Map.fold folder state f
let inline foldr_opt folder (f : func_opt<_,_>) state =
Map.foldBack folder f state
let inline graph_opt (f : func_opt<_,_>) =
Map.toList f
let dom_opt (f : func_opt<_,_>) =
(Set.empty, f)
||> Map.fold (fun dom x _ ->
Set.add x dom)
|> Set.toList
let ran_opt (f : func_opt<_,_>) =
(Set.empty, f)
||> Map.fold (fun range _ y ->
Set.add y range)
|> Set.toList
let applyd_opt (f : func_opt<_,_>) defaultValueGenerator value : 'b =
match Map.tryFind value f with
| Some x -> x
| None ->
defaultValueGenerator value
let apply_opt (f : func_opt<_,_>) a =
match Map.tryFind a f with
| Some x -> x
| None ->
failwith "apply"
let tryapplyd_opt (f : func_opt<_,_>) a d =
match Map.tryFind a f with
| Some x -> x
| None -> d
let inline tryapplyl_opt (f : func_opt<_,_>) x =
tryapplyd_opt f x []
let inline defined_opt (f : func_opt<_,_>) a =
Map.containsKey a f
let inline undefine_opt x (f : func_opt<_,_>) : func_opt<_,_> =
Map.remove x f
let inline (|->+) x y (f : func_opt<_,_>) : func_opt<_,_> =
Map.add x y f
let inline (|=>+) x y : func_opt<_,_> =
Map.add x y undefined_opt
let inline fpf_opt keys values : func_opt<_,_> =
List.zip keys values
|> Map.ofList
// ===========================================================================
// Tests for library functions derived from
// the results shown on Pg. 619-621.
let private butLastValues : (int list * int list)[] = [|
(
// idx 0
// lib.butLast.01
// System.Exception - butlast
[],
[] // Dummy value used as place holder
);
(
// idx 1
// lib.butLast.02
[1],
[]
);
(
// idx 2
// lib.butLast.03
[1; 2],
[1]
);
(
// idx 3
// lib.butLast.04
[1; 2; 3],
[1; 2]
);
|]
[<Test>]
[<TestCase(0, TestName = "lib.butLast.01", ExpectedException=typeof<System.Exception>, ExpectedMessage="butlast")>]
[<TestCase(1, TestName = "lib.butLast.02")>]
[<TestCase(2, TestName = "lib.butLast.03")>]
[<TestCase(3, TestName = "lib.butLast.04")>]
let ``List butlast`` idx =
let (list, _) = butLastValues.[idx]
let (_, result) = butLastValues.[idx]
butlast list
|> should equal result
let private chopListValues : (int * int list * (int list * int list))[] = [|
(
// idx 0
// lib.chopList.01
0, [],
( [], [] )
);
(
// idx 1
// lib.chopList.02
// System.Exception - chop_list
1, [],
( [], [] ) // Dummy value used as place holder
);
(
// idx 2
// lib.chopList.03
0, [1],
( [], [1] )
);
(
// idx 3
// lib.chopList.04
1, [1],
( [1], [] )
);
(
// idx 4
// lib.chopList.05
// System.Exception - chop_list
2, [1],
( [], [] ) // Dummy value used as place holder
);
(
// idx 5
// lib.chopList.06
0, [1; 2],
( [], [1; 2] )
);
(
// idx 6
// lib.chopList.07
1, [1; 2],
( [1], [2] )
);
(
// idx 7
// lib.chopList.08
2, [1; 2],
( [1; 2], [] )
);
(
// idx 8
// lib.chopList.09
// System.Exception - chop_list
3, [1; 2],
( [], [] ) // Dummy value used as place holder
);
(
// idx 9
// lib.chopList.10
0, [1; 2; 3],
( [], [1; 2; 3] )
);
(
// idx 10
// lib.chopList.11
1, [1; 2; 3],
( [1], [2; 3] )
);
(
// idx 11
// lib.chopList.12
2, [1; 2; 3],
( [1; 2], [3] )
);
(
// idx 12
// lib.chopList.13
3, [1; 2; 3],
( [1; 2; 3], [] )
);
(
// idx 13
// lib.chopList.14
// System.Exception - chop_list
4, [1; 2; 3],
( [], [] ) // Dummy value used as place holder
);
(
// idx 14
// lib.chopList.15
// System.Exception - chop_list
-1, [],
( [], [] ) // Dummy value used as place holder
);
(
// idx 15
// lib.chopList.16
// System.Exception - chop_list
-1, [1],
( [], [] ) // Dummy value used as place holder
);
(
// idx 16
// lib.chopList.17
// System.Exception - chop_list
-1, [1; 2],
( [], [] ) // Dummy value used as place holder
);
|]
[<Test>]
[<TestCase(0, TestName = "lib.chopList.01")>]
[<TestCase(1, TestName = "lib.chopList.02", ExpectedException=typeof<System.Exception>, ExpectedMessage="chop_list")>]
[<TestCase(2, TestName = "lib.chopList.03")>]
[<TestCase(3, TestName = "lib.chopList.04")>]
[<TestCase(4, TestName = "lib.chopList.05", ExpectedException=typeof<System.Exception>, ExpectedMessage="chop_list")>]
[<TestCase(5, TestName = "lib.chopList.06")>]
[<TestCase(6, TestName = "lib.chopList.07")>]
[<TestCase(7, TestName = "lib.chopList.08")>]
[<TestCase(8, TestName = "lib.chopList.09", ExpectedException=typeof<System.Exception>, ExpectedMessage="chop_list")>]
[<TestCase(9, TestName = "lib.chopList.10")>]
[<TestCase(10, TestName = "lib.chopList.11")>]
[<TestCase(11, TestName = "lib.chopList.12")>]
[<TestCase(12, TestName = "lib.chopList.13")>]
[<TestCase(13, TestName = "lib.chopList.14", ExpectedException=typeof<System.Exception>, ExpectedMessage="chop_list")>]
[<TestCase(14, TestName = "lib.chopList.15", ExpectedException=typeof<System.Exception>, ExpectedMessage="chop_list")>]
[<TestCase(15, TestName = "lib.chopList.16", ExpectedException=typeof<System.Exception>, ExpectedMessage="chop_list")>]
[<TestCase(16, TestName = "lib.chopList.17", ExpectedException=typeof<System.Exception>, ExpectedMessage="chop_list")>]
let ``List chop_list`` idx =
let (n, _, _) = chopListValues.[idx]
let (_, list, _) = chopListValues.[idx]
let (_, _, result) = chopListValues.[idx]
chop_list n list
|> should equal result
let private distinctpairsValues : (int list * (int * int) list )[] = [|
(
// idx 0
// lib.distinctpairs.01
[],
[]
);
(
// idx 1
// lib.distinctpairs.02
[1],
[]
);
(
// idx 2
// lib.distinctpairs.03
[1; 2],
[(1, 2)]
);
(
// idx 3
// lib.distinctpairs.04
[1; 2; 3],
[(1, 2); (1, 3); (2, 3); ]
);
(
// idx 4
// lib.distinctpairs.05
[1; 2; 3; 4],
[(1, 2); (1, 3); (1, 4); (2, 3); (2, 4); (3, 4)]
);
|]
[<Test>]
[<TestCase(0, TestName = "lib.distinctpairs.01")>]
[<TestCase(1, TestName = "lib.distinctpairs.02")>]
[<TestCase(2, TestName = "lib.distinctpairs.03")>]
[<TestCase(3, TestName = "lib.distinctpairs.04")>]
[<TestCase(4, TestName = "lib.distinctpairs.05")>]
let ``List distinctpairs`` idx =
let (list, _) = distinctpairsValues.[idx]
let (_, result) = distinctpairsValues.[idx]
distinctpairs list
|> should equal result
let private earlierValues : (int list * int * int * bool)[] = [|
(
// idx 0
// lib.earlier.001
[], -1, -1,
false
);
(
// idx 1
// lib.earlier.002
[], -1, 0,
false
);
(
// idx 2
// lib.earlier.003
[], -1, 1,
false
);
(
// idx 3
// lib.earlier.004
[], 0, -1,
false
);
(
// idx 4
// lib.earlier.005
[], 0, 0,
false
);
(
// idx 5
// lib.earlier.006
[], 0, 1,
false
);
(
// idx 6
// lib.earlier.007
[], 1, -1,
false
);
(
// idx 7
// lib.earlier.008
[], 1, 0,
false
);
(
// idx 8
// lib.earlier.009
[], 1, 1,
false
);
(
// idx 9
// lib.earlier.010
[1], -1, -1,
false
);
(
// idx 10
// lib.earlier.011
[1], -1, 0,
false
);
(
// idx 11
// lib.earlier.012
[1], -1, 1,
false
);
(
// idx 12
// lib.earlier.013
[1], 0, -1,
false
);
(
// idx 13
// lib.earlier.014
[1], 0, 0,
false
);
(
// idx 14
// lib.earlier.015
[1], 0, 1,
false
);
(
// idx 15
// lib.earlier.016
[1], 1, -1,
true
);
(
// idx 16
// lib.earlier.017
[1], 1, 0,
true
);
(
// idx 17
// lib.earlier.018
[1], 1, 1,
false
);
(
// idx 18
// lib.earlier.019
[1; 2], -1, -1,
false
);
(
// idx 19
// lib.earlier.020
[1; 2], -1, 0,
false
);
(
// idx 20
// lib.earlier.021
[1; 2], -1, 1,
false
);
(
// idx 21
// lib.earlier.022
[1; 2], -1, 2,
false
);
(
// idx 22
// lib.earlier.023
[1; 2], -1, 3,
false
);
(
// idx 23
// lib.earlier.024
[1; 2], 0, -1,
false
);
(
// idx 24
// lib.earlier.025
[1; 2], 0, 0,
false
);
(
// idx 25
// lib.earlier.026
[1; 2], 0, 1,
false
);
(
// idx 26
// lib.earlier.027
[1; 2], 0, 2,
false
);
(
// idx 27
// lib.earlier.028
[1; 2], 0, 3,
false
);
(
// idx 28
// lib.earlier.029
[1; 2], 1, -1,
true
);
(
// idx 29
// lib.earlier.030
[1; 2], 1, 0,
true
);
(
// idx 30
// lib.earlier.031
[1; 2], 1, 1,
false
);
(
// idx 31
// lib.earlier.032
[1; 2], 1, 2,
true
);
(
// idx 32
// lib.earlier.033
[1; 2], 1, 3,
true
);
(
// idx 33
// lib.earlier.034
[1; 2], 2, -1,
true
);
(
// idx 34
// lib.earlier.035
[1; 2], 2, 0,
true
);
(
// idx 35
// lib.earlier.036
[1; 2], 2, 1,
false
);
(
// idx 36
// lib.earlier.037
[1; 2], 2, 2,
false
);
(
// idx 37
// lib.earlier.038
[1; 2], 2, 3,
true
);
(
// idx 38
// lib.earlier.039
[1; 2], 3, -1,
false
);
(
// idx 39
// lib.earlier.040
[1; 2], 3, 0,
false
);
(
// idx 40
// lib.earlier.041
[1; 2], 3, 1,
false
);
(
// idx 41
// lib.earlier.042
[1; 2], 3, 2,
false
);
(
// idx 42
// lib.earlier.043
[1; 2], 3, 3,
false
);
(
// idx 43
// lib.earlier.044
[1; 2; 3], -1, -1,
false
);
(
// idx 44
// lib.earlier.045
[1; 2; 3], -1, 0,
false
);
(
// idx 45
// lib.earlier.046
[1; 2; 3], -1, 1,
false
);
(
// idx 46
// lib.earlier.047
[1; 2; 3], -1, 2,
false
);
(
// idx 47
// lib.earlier.048
[1; 2; 3], -1, 3,
false
);
(
// idx 48
// lib.earlier.049
[1; 2; 3], 0, -1,
false
);
(
// idx 49
// lib.earlier.050
[1; 2; 3], 0, 0,
false
);
(
// idx 50
// lib.earlier.051
[1; 2; 3], 0, 1,
false
);
(
// idx 51
// lib.earlier.052
[1; 2; 3], 0, 2,
false
);
(
// idx 52
// lib.earlier.053
[1; 2; 3], 0, 3,
false
);
(
// idx 53
// lib.earlier.054
[1; 2; 3], 1, -1,
true
);
(
// idx 54
// lib.earlier.055
[1; 2; 3], 1, 0,
true
);
(
// idx 55
// lib.earlier.056
[1; 2; 3], 1, 1,
false
);
(
// idx 56
// lib.earlier.057
[1; 2; 3], 1, 2,
true
);
(
// idx 57
// lib.earlier.058
[1; 2; 3], 1, 3,
true
);
(
// idx 58
// lib.earlier.059
[1; 2; 3], 2, -1,
true
);
(
// idx 59
// lib.earlier.060
[1; 2; 3], 2, 0,
true
);
(
// idx 60
// lib.earlier.061
[1; 2; 3], 2, 1,
false
);
(
// idx 61
// lib.earlier.062
[1; 2; 3], 2, 2,
false
);
(
// idx 62
// lib.earlier.063
[1; 2; 3], 2, 3,
true
);
(
// idx 63
// lib.earlier.064
[1; 2; 3], 3, -1,
true
);
(
// idx 64
// lib.earlier.065
[1; 2; 3], 3, 0,
true
);
(
// idx 65
// lib.earlier.066
[1; 2; 3], 3, 1,
false
);
(
// idx 66
// lib.earlier.067
[1; 2; 3], 3, 2,
false
);
(
// idx 67
// lib.earlier.068
[1; 2; 3], 3, 3,
false
);
(
// idx 68
// lib.earlier.069
[1; 2; 3; 4], -1, -1,
false
);
(
// idx 69
// lib.earlier.070
[1; 2; 3; 4], -1, 0,
false
);
(
// idx 70
// lib.earlier.071
[1; 2; 3; 4], -1, 1,
false
);
(
// idx 71
// lib.earlier.072
[1; 2; 3; 4], -1, 2,
false
);
(
// idx 72
// lib.earlier.073
[1; 2; 3; 4], -1, 3,
false
);
(
// idx 73
// lib.earlier.074
[1; 2; 3; 4], -1, 4,
false
);
(
// idx 74
// lib.earlier.075
[1; 2; 3; 4], 0, -1,
false
);
(
// idx 75
// lib.earlier.076
[1; 2; 3; 4], 0, 0,
false
);
(
// idx 76
// lib.earlier.077
[1; 2; 3; 4], 0, 1,
false
);
(
// idx 77
// lib.earlier.078
[1; 2; 3; 4], 0, 2,
false
);
(
// idx 78
// lib.earlier.079
[1; 2; 3; 4], 0, 3,
false
);
(