-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPCM20210730_SICP_1.1.8_ProceduresAsBlackBoxAbstractions
1994 lines (1662 loc) · 73.7 KB
/
PCM20210730_SICP_1.1.8_ProceduresAsBlackBoxAbstractions
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
### A Pluto.jl notebook ###
# v0.20.0
using Markdown
using InteractiveUtils
# ╔═╡ fbfebc79-802e-47dd-a831-2cd99c6e0b40
begin
using Pluto
using Plots
using LaTeXStrings
using Statistics
using GraphRecipes
#----------------------------------------------------------------
println("pkgversion(Pluto) = ", pkgversion(Pluto))
println("pkgversion(Plots) = ", pkgversion(Plots))
println("pkgversion(LaTeXStrings) = ", pkgversion(LaTeXStrings))
println("pkgversion(Statistics) = ", pkgversion(Statistics))
println("pkgversion(GraphRecipes) = ", pkgversion(GraphRecipes))
end # begin
# ╔═╡ 247b3f72-f140-11eb-1cc0-65305255e94d
md"
====================================================================================
#### SICP: [1.1.8 Procedures as BlackBox Abstractions](https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/full-text/book/book-Z-H-10.html#%_sec_1.1.8)
##### file: PCM20210730\_SICP\_1.1.8\_ProceduresAsBlackBoxAbstractions
##### Julia/pluto-code (1.11.2/0.20.3) by PCM *** 2025/01/06 ***
====================================================================================
"
# ╔═╡ 7ed65b1c-da66-495a-863e-c8bc93b1762c
md"
##### 0. Introduction
"
# ╔═╡ c4c51aa1-bd39-423c-8364-f235e7726cd2
md"
---
##### 1. Topics
- functional *abstraction*
- problem *decomposition*, *integration* of subresults
- internal definitions, block structure
- local scope
- *infix* operators
- type *hierarchy*
- *abstract* types $AbstractFloat, Signed, Real$
- removing of *tail-recursion* by *while* loop
- *library* function $mean$
- *slurping* parameter $xs...$ to construct $xs$ as as an *iterable* tuple $(.,.)$
- *base* function $sqrt(.), √(.), √., isapprox, convert$
- *keyword* parameters
"
# ╔═╡ 2846657c-3caf-4591-aa5c-17e497e1cf80
md"
---
##### 2. Libraries
"
# ╔═╡ 63de4724-4ea2-4f4a-9466-9f6cccfcc41b
md"
#### 3. SICP-Scheme like *functional* Julia
"
# ╔═╡ 4dc5d5d4-2b79-4a03-a99c-253a75bf92dd
# 1st implementation of function square(x)
# square(x) = x -> *(x, x)
# ╔═╡ a07e17ab-c15c-4928-a359-cc8fe507b49e
square(x) = *(x, x)
# ╔═╡ 05aa4e47-701d-413b-bc07-22494a0b7a8a
md"
###### 3.1 Functional *Abstraction* and Problem *Decomposition*
What SICP calls *procedural* abstraction is here *functional* abstraction, because we try to code in a *pure* functional style. This means that we decompose a problem into subproblems. The solution of each subproblem is coded as a *pure* function. Subresults are assembled into a comprehensive solution.
As an example we can implement the function $square(x)$ in several ways. So $square(x) is the *abstraction* of its various *implementations*.
"
# ╔═╡ 8db19333-ba11-4591-a9f0-30da76591df7
# 2nd implementation of function square(x)
# double(x) = +(x, x)
# square(x) = exp10( double( log(10, x)))
# ╔═╡ 4232d2b1-b576-4645-ace5-8fc03c84f2c1
let
#------------------------------------------------------------------------------
function plotUnaryTree!(markOfLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; heightOfTree=2, fontSize=9)
plot!([ # plot of middle vertical arm '|'
(coordinateXOfRootMark, coordinateYOfRootMark+heightOfTree/8),
(coordinateXOfRootMark, coordinateYOfRootMark+heightOfTree-heightOfTree/8)],
lw=1, linecolor=:black)
annotate!( # mark of leaf 'x'
(coordinateXOfRootMark, coordinateYOfRootMark+heightOfTree, text(markOfLeaf, fontSize, :blue)))
annotate!( # mark of root 'x'
(coordinateXOfRootMark, coordinateYOfRootMark, text(markOfRoot, fontSize, :blue)))
end # function plotUnaryTree!
#------------------------------------------------------------------------------
function plotBinaryTree!(markOfLeftLeaf, markOfRightLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; widthOfTree=1.5, heightOfTree=2, fontSize=9)
annotate!( # mark of left leaf 'x'
(coordinateXOfRootMark-widthOfTree/2,
coordinateYOfRootMark+heightOfTree,
text(markOfLeftLeaf, fontSize, :blue)))
plot!([ # plot of left vertical arm '|'
(coordinateXOfRootMark-widthOfTree/2,
coordinateYOfRootMark + heightOfTree-heightOfTree/8),
(coordinateXOfRootMark-widthOfTree/2, coordinateYOfRootMark+heightOfTree/2)],
lw=1, linecolor=:black)
annotate!( # mark of right leaf 'x'
(coordinateXOfRootMark+widthOfTree/2,
coordinateYOfRootMark+heightOfTree,
text(markOfRightLeaf, fontSize, :blue)))
plot!([ # plot of right vertical arm '|'
(coordinateXOfRootMark+widthOfTree/2,
coordinateYOfRootMark+heightOfTree-heightOfTree/8),
(coordinateXOfRootMark+widthOfTree/2, coordinateYOfRootMark+heightOfTree/2)],
lw=1, linecolor=:black)
plot!([ # plot of horizontal bar '-'
(coordinateXOfRootMark-widthOfTree/2, coordinateYOfRootMark+heightOfTree/2),
(coordinateXOfRootMark+widthOfTree/2, coordinateYOfRootMark+heightOfTree/2)],
lw=1, linecolor=:black)
plot!([ # plot of middle vertical arm '|'
(coordinateXOfRootMark, coordinateYOfRootMark+heightOfTree/2),
(coordinateXOfRootMark, coordinateYOfRootMark+heightOfTree/8)],
lw=1, linecolor=:black)
annotate!( # mark of root 'x'
(coordinateXOfRootMark, coordinateYOfRootMark, text(markOfRoot, fontSize, :blue)))
end # function plotBinaryTree!
#------------------------------------------------------------------------------
function plotTernaryTree!(markOfLeftLeaf, markOfMiddleLeaf, markOfRightLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; widthOfTree=3.0,
heightOfTree=2, fontSize=9)
#---------------------------------------------------------
plotBinaryTree!(markOfLeftLeaf, markOfRightLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; widthOfTree=widthOfTree, heightOfTree=heightOfTree, fontSize=fontSize)
#---------------------------------------------------------
plotUnaryTree!(markOfMiddleLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; heightOfTree=heightOfTree, fontSize=fontSize)
end # function plotTernaryTree!
#------------------------------------------------------------------------------
function plotQuaternyTree!(markOfLeftMostLeaf, markOfLeftLeaf, markOfRightLeaf, markOfRightMostLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; widthOfTree=4.0, heightOfTree=2, fontSize=9)
#---------------------------------------------------------
plotBinaryTree!(markOfLeftMostLeaf, markOfRightMostLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; widthOfTree=widthOfTree, heightOfTree=heightOfTree, fontSize=fontSize)
#---------------------------------------------------------
plotBinaryTree!(markOfLeftLeaf, markOfRightLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; widthOfTree=widthOfTree/3, heightOfTree=heightOfTree, fontSize=fontSize)
end # function plotQuaternyTree!
#------------------------------------------------------------------------------
plot(xlim=(-2, 10), ylim=(3, 11), legend=:false, ticks=:none, title=L"Problem Decomposition and Solution Delegation in $sqrt$", titlefontsize=12)
plotBinaryTree!("square", "abs", "goodEnough", 2.0, 8.0; widthOfTree=4.0)
plotUnaryTree!("average", "improve", 8.0, 8.0)
plotBinaryTree!("goodEnough", "improve", "sqrtIter", 5.0, 6.0; widthOfTree=6.0)
plotUnaryTree!("sqrtIter", "sqrt", 5.0, 4.0; heightOfTree=2)
#------------------------------------------------------------------------------
end # let
# ╔═╡ 818616a0-87a4-489f-8459-c699b9fa3137
md"
**Fig. 1.1.8.1** Problem *Decomposition* and Solution *Delegation* in $sqrt$ (cf. Fig.1.2, SICP, 1996, 2/e, p.27)
---
"
# ╔═╡ bc6c7b05-15ad-4bfd-8f73-58301ec900c4
md"
###### 3.2 1st *generic* (*polymorphic*) method of function $sqrtSICP$
"
# ╔═╡ cb4b3323-c734-4ac5-9279-df1c501c31eb
goodEnough(guess, x) =
<( abs( -( square( guess), x)), 0.001) # eps = 0.001 is taken from SICP
# ╔═╡ 646d8856-b315-444b-a014-26da6eee1115
average(x, y) = /(+(x, y), 2)
# ╔═╡ 483f6b61-1d25-4a53-a2d1-640ea0165e7e
improve(guess, x) =
average(guess, /(x, guess))
# ╔═╡ 64b11119-0b26-403c-9d03-70f1e17f13ae
function sqrtIter(guess, x)
if goodEnough(guess, x)
guess
else sqrtIter(improve(guess, x), x)
end # if
end # function sqrtIter
# ╔═╡ 1789e69a-0688-4eb5-b316-0d1377c7a1f3
sqrtSICP(x) = sqrtIter(1.0, x)
# ╔═╡ ccd9afea-0368-4876-89c8-f04d2f479c3a
sqrtSICP(2) # ==> 1.41421... --> :)
# ╔═╡ ae4b3037-df39-41fa-82c9-3aefa2619c2c
abs(sqrtSICP(2) - Base.sqrt(2)) # ==> 2.123901414519125e-6 --> :)
# ╔═╡ aabe51ab-64b3-4bb3-8a56-da10740ea003
sqrtSICP(9) # ==> should be 3
# ╔═╡ 96d4fd55-c0e4-465a-86e1-fe6ba1e41949
abs(sqrtSICP(9) - Base.sqrt(9)) # deviation from Julia's sqrt --> :)
# ╔═╡ ab9f5330-b100-4e1d-944c-2ffb99172547
sqrtSICP(9.0)
# ╔═╡ 868fcc2b-9639-45d4-bb79-d6a2029f7959
abs(sqrtSICP(9.0) - Base.sqrt(9.0)) # deviation from Julia's sqrt --> :)
# ╔═╡ 0fab7f8c-c6c9-41cd-9c1c-e671375c03d8
md"
###### 3.3 *Internal* Definitions and *Block* Structure
"
# ╔═╡ cf1b0ca4-b67d-40da-8cec-64678193cf19
function sqrtSICP2(x)
#-----------------------------------------------------
square(x) = *(x, x)
#-----------------------------------------------------
goodEnough(guess, x) =
<(abs(-(square(guess), x)), 0.001)
#-----------------------------------------------------
improve(guess, x) = average(guess, /(x, guess))
#-----------------------------------------------------
average(x, y) = /(+(x, y), 2)
#-----------------------------------------------------
sqrtIter(guess, x) =
if goodEnough(guess, x)
guess
else
sqrtIter(improve(guess, x), x)
end # if
#-----------------------------------------------------
sqrtIter(1.0, x)
end
# ╔═╡ 201ff6ca-6b4b-48ee-8394-d0269c3c0db1
sqrtSICP2(2) # ==> 1.41421... --> :)
# ╔═╡ 753fa458-9806-4f00-b542-1ff0b4b94fe5
abs(sqrtSICP2(2) - Base.sqrt(2)) # deviation from Julia's sqrt --> :)
# ╔═╡ 65bd3a2d-31a9-448e-8253-7f235dabe1e1
sqrtSICP2(9) # input output types differ --> :(
# ╔═╡ 53a191fd-6392-46cb-9aa6-996d10bd922b
abs(sqrtSICP2(9) - Base.sqrt(9)) # deviation from Julia's sqrt --> :)
# ╔═╡ 8f2a4ee9-da69-4edd-bf8a-0b2c79d62b52
md"
###### 3.4 *Lexical Scoping*: Suppression of Parameter $x$
"
# ╔═╡ 7bb2c6d0-bf3c-4b8c-b6c1-8e1cf1d558a1
function sqrtSICP3(x)
eps = 0.001 # local definition
#------------------------------------------------------------------
square(guess) = *(guess, guess) # renamed from x to guess
#------------------------------------------------------------------
goodEnough(guess) =
<(abs(-(square(guess), x)), eps)
#------------------------------------------------------------------
improve(guess) = average(guess, /(x, guess))
#------------------------------------------------------------------
average(x, y) = /(+(x, y), 2)
#------------------------------------------------------------------
sqrtIter(guess) =
if goodEnough(guess)
guess
else
sqrtIter(improve(guess))
end # if
#------------------------------------------------------------------
sqrtIter(1.0)
end
# ╔═╡ b82566e8-388d-4d17-a6f1-fbec78cb4f0c
sqrtSICP3(2) # ==> 1.41421... --> :)
# ╔═╡ 2cd9cde4-da5a-43e3-8164-8265240d712b
abs(sqrtSICP3(2) - Base.sqrt(2)) # deviation from Julia's sqrt --> :)
# ╔═╡ 389ee6d2-c125-4ea7-84c6-dca3e1ff8c56
sqrtSICP3(9) # input Integer but output Float --> :(
# ╔═╡ d4e412fb-3e51-4119-bb33-f7694a1ba2b5
abs(sqrtSICP3(9) - Base.sqrt(9)) # deviation from Julia's sqrt --> :)
# ╔═╡ e19e7261-4b1f-468f-b1b8-630fe9705b50
md"
#### 4. Idiomatic *functional* Julia ...
... with *infix* operators, abstract type AbstractFloat, abstract type Signed, abstract type Real, 'while' instead of *tail-recursive* sqrt_iter, $(.,.)$ as *iterable*, base function $isapprox$
"
# ╔═╡ 48106fde-99b9-48c1-9b37-efaff628ee65
md"
###### 4.1 Excerpt of Julia's *Type* Hierarchy
"
# ╔═╡ 17337326-ea9c-4047-9ebd-44fd95a4e232
let
yMax = 11
#------------------------------------------------------------------------------
function plotInvUnaryTree!(markOfLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; heightOfTree=2, fontSize=9)
plot!([ # plot of middle vertical arm '|'
(coordinateXOfRootMark, coordinateYOfRootMark-heightOfTree/8), # root
(coordinateXOfRootMark, coordinateYOfRootMark-heightOfTree+heightOfTree/8)], # leaf
lw=1, linecolor=:black)
annotate!( # mark of leaf 'x'
(coordinateXOfRootMark, coordinateYOfRootMark-heightOfTree, text(markOfLeaf, fontSize, :blue)))
annotate!( # mark of root 'x'
(coordinateXOfRootMark, coordinateYOfRootMark, text(markOfRoot, fontSize, :blue)))
end # function plotUnaryTree!
#------------------------------------------------------------------------------
function plotInvBinaryTree!(markOfLeftLeaf, markOfRightLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; widthOfTree=1.5, heightOfTree=2, fontSize=9)
annotate!( # mark of left leaf 'x'
(coordinateXOfRootMark-widthOfTree/2,
coordinateYOfRootMark-heightOfTree,
text(markOfLeftLeaf, fontSize, :blue)))
plot!([ # plot of left vertical arm '|'
(coordinateXOfRootMark-widthOfTree/2,
coordinateYOfRootMark-heightOfTree+heightOfTree/8),
(coordinateXOfRootMark-widthOfTree/2, coordinateYOfRootMark-heightOfTree/2)],
lw=1, linecolor=:black)
annotate!( # mark of right leaf 'x'
(coordinateXOfRootMark+widthOfTree/2,
coordinateYOfRootMark-heightOfTree,
text(markOfRightLeaf, fontSize, :blue)))
plot!([ # plot of right vertical arm '|'
(coordinateXOfRootMark+widthOfTree/2,
coordinateYOfRootMark-heightOfTree+heightOfTree/8),
(coordinateXOfRootMark+widthOfTree/2, coordinateYOfRootMark-heightOfTree/2)],
lw=1, linecolor=:black)
plot!([ # plot of horizontal bar '-'
(coordinateXOfRootMark-widthOfTree/2, coordinateYOfRootMark-heightOfTree/2),
(coordinateXOfRootMark+widthOfTree/2, coordinateYOfRootMark-heightOfTree/2)],
lw=1, linecolor=:black)
plot!([ # plot of middle vertical arm '|'
(coordinateXOfRootMark, coordinateYOfRootMark-heightOfTree/2),
(coordinateXOfRootMark, coordinateYOfRootMark-heightOfTree/8)],
lw=1, linecolor=:black)
annotate!( # mark of root leaf 'x'
(coordinateXOfRootMark, coordinateYOfRootMark, text(markOfRoot, fontSize, :blue)))
end # function plotBinaryTree!
#------------------------------------------------------------------------------
function plotInvTernaryTree!(markOfLeftLeaf, markOfMiddleLeaf, markOfRightLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; widthOfTree=3.0,
heightOfTree=2, fontSize=9)
#---------------------------------------------------------
plotInvBinaryTree!(markOfLeftLeaf, markOfRightLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; widthOfTree=widthOfTree, heightOfTree=heightOfTree, fontSize=fontSize)
#---------------------------------------------------------
plotInvUnaryTree!(markOfMiddleLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; heightOfTree=heightOfTree, fontSize=fontSize)
end # function plotTernaryTree!
#------------------------------------------------------------------------------
function plotInvQuaternyTree!(markOfLeftMostLeaf, markOfLeftLeaf, markOfRightLeaf, markOfRightMostLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; widthOfTree=4.0, heightOfTree=2, fontSize=9)
#---------------------------------------------------------
plotInvBinaryTree!(markOfLeftMostLeaf, markOfRightMostLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; widthOfTree=widthOfTree, heightOfTree=heightOfTree, fontSize=fontSize)
#---------------------------------------------------------
plotInvBinaryTree!(markOfLeftLeaf, markOfRightLeaf, markOfRoot, coordinateXOfRootMark, coordinateYOfRootMark; widthOfTree=widthOfTree/3, heightOfTree=heightOfTree, fontSize=fontSize)
end # function plotQuaternyTree!
#------------------------------------------------------------------------------
plot(xlim=(-1.5, 18.0), ylim=(0, yMax), legend=:false, ticks=:none, title="Excerpt from Julia's Type Hierarchy", titlefontsize=12)
plotInvUnaryTree!("Irrational", "AbstractIrrational", 16.0, yMax-6.0; fontSize=8)
plotInvTernaryTree!("Int64", "Int32", "Int16", "Signed", 5.25, yMax-8.0; fontSize=8)
plotInvBinaryTree!("Complex", "Real", "Number", 4.5, yMax-2.0; widthOfTree=9.0, fontSize=8)
plotInvTernaryTree!("", "Bool", "Unsigned", "Integer", 6.7, yMax-6.0; fontSize=8)
plotInvTernaryTree!("Float64", "Float32", "Float16", "AbstractFloat", 2.0, yMax-6.0; widthOfTree=3.2, fontSize=8)
plotInvQuaternyTree!("", "", "Rational", "AbstractIrrational", "Real", 9.0, yMax-4.0; widthOfTree=14.0, fontSize=8)
#------------------------------------------------------------------------------
end # let
# ╔═╡ 3dcd5d03-1e20-4d02-aeb8-ee7b96900871
md"
**Fig. 1.1.8.2** Excerpt from Julia's *type hierarchy* (a more complete excerpt can be found in Nazarathy & Klok, 2021, p.11, or [here](https://en.wikibooks.org/wiki/Introducing_Julia/Types#/media/File:Julia-number-type-hierarchy.svg).
"
# ╔═╡ eadd5d72-c839-4bd1-9329-0f6d2e7a785f
typejoin(Float64, Float32)
# ╔═╡ 7559bd88-91e1-44c4-98e8-f2dcf7010054
typejoin(Int64, Int32)
# ╔═╡ f11fb6f2-c1c5-4b6e-b917-57efa1c52427
typejoin(AbstractFloat, Signed)
# ╔═╡ e631ccc7-21e1-4022-afd9-d09679ff8a6c
typejoin(Float64, Float32, Int64, Int32)
# ╔═╡ 81990868-f302-426d-8822-d38e052db1ca
md"
###### 4.2 2nd (specialized) *typed* method of function 'sqrtSICP'
"
# ╔═╡ 139c478d-cc8a-4042-bfca-764ed2b5a436
# idiomatic JULIA with 'while' instead of tail-recursive sqrt_iter
# Supressing local variable *x* from *good_enough*, *improve*, and *sqrt_iter*
# function $mean$ instead of self defined $average$
# function $average$ with slurping xs...
# $xs$ is then an iterable tuple with two numbers, which can be an argument of
# Statistics.mean
#
#--------------------------------------------------------------------------
function sqrtSICP4(x::Real)::Real
eps = 1.0E-3
guess = 1.0
#----------------------------------------------------------------------
goodEnough(guess) = isapprox(guess^2, x, atol=eps)
# abs(guess^2 - x) < 0.001
#----------------------------------------------------------------------
average(xs...) = mean(xs) # slurping parameter xs
# /(+(x, y), 2) # xs = (...,...)
#----------------------------------------------------------------------
# arguments get slurped into parameter xs... and packed into a tuple,
# which is an iterable
improve(guess) = average(guess, x/guess)
#----------------------------------------------------------------------
while !goodEnough(guess)
guess = improve(guess)
end
guess
#-----------------------------------------------------------------------
end
# ╔═╡ 5c61ef64-cb8b-40e5-8c86-ea158b203c61
sqrtSICP4(2) # ==> 1.41421... --> :)
# ╔═╡ ade1b792-f0b8-4df0-80b0-126fb57fad94
abs(sqrtSICP4(2) - Base.sqrt(2)) # deviation from Julia's sqrt --> :)
# ╔═╡ c568d137-72b0-4732-a14b-0ad0e6c01780
abs(sqrtSICP4(2) - √(2)) # deviation from Julia's sqrt --> :)
# ╔═╡ 3dce6b87-cff4-48fd-b598-f3f6099c9e3e
abs(sqrtSICP4(2) - √2) # deviation from Julia's sqrt --> :)
# ╔═╡ 6dc9e10f-7fab-4c46-97b9-e8ad754a5793
md"
###### 4.3 3rd (more specialized and abstracted) *typed* method of function 'sqrtSICP'
"
# ╔═╡ 93907e76-f350-4871-a199-bfed96d6a96f
# replacement of goodEnough by isapprox
# keyword parameters
function sqrtSICP5(x::AbstractFloat; guess=1.0, eps=1.0E-3)::AbstractFloat
#----------------------------------------------------------------------
improve(guess, x) = mean((guess, x / guess))
#----------------------------------------------------------------------
while !isapprox(guess^2, x, atol=eps)
guess = improve(guess, x)
end
guess
end
# ╔═╡ 28f64ee8-b195-46a5-8f2a-968307b66a69
sqrtSICP5(convert(Float64, 2), eps=1.0E-6)
# ╔═╡ e97c95c3-2547-423c-9b9b-1bed7e4020df
abs(sqrtSICP5(convert(Float64, 2), eps=1.0E-6) - √2)
# ╔═╡ 8d2bc5e7-b062-42df-ac32-da8cc5acd734
md"
---
##### 5. Summary
*We will use block structure extensively to help us break up large programs into tractable pieces. The idea of block structure originated with the programming language Algol 60. It appears in most advanced programming languages and is an important tool for helping to organize the construction of large programs.* (SICP, 1996, 2016, p.39)
"
# ╔═╡ 71382b83-641c-4767-9823-0c2d8d64aec4
md"
---
##### 6. References
- **Abelson, H., Sussman, G.J. & Sussman, J.**, [*Structure and Interpretation of Computer Programs*](https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/full-text/book/book-Z-H-10.html#%_sec_1.1.8), Cambridge, Mass.: MIT Press, (2/e), 1996; last visit 2025/01/04
- **Abelson, H., Sussman, G.J. & Sussman, J.**, [*Structure and Interpretation of Computer Programs*](https://web.mit.edu/6.001/6.037/sicp.pdf), 2016, (2/e); last visit 2025/01/05
- **Wikibooks**, [*Introducing Julia/Types*](https://en.wikibooks.org/wiki/Introducing_Julia/Types#/media/File:Julia-number-type-hierarchy.svg); last visit 2025/01/05
"
# ╔═╡ 2eae5547-9f09-43ac-a406-81740f900efc
md"
===================================================================================
This is a **draft** under the Attribution-NonCommercial-ShareAlike 4.0 International **(CC BY-NC-SA 4.0)** license. Comments, suggestions for improvement and bug reports are welcome: **claus.moebus(@)uol.de**
===================================================================================
"
# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
GraphRecipes = "bd48cda9-67a9-57be-86fa-5b3c104eda73"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Pluto = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[compat]
GraphRecipes = "~0.5.13"
LaTeXStrings = "~1.4.0"
Plots = "~1.40.8"
Pluto = "~0.20.3"
Statistics = "~1.11.1"
"""
# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised
julia_version = "1.11.2"
manifest_format = "2.0"
project_hash = "c0c25cf800f102cd639d74d1f015b8d2cd203a42"
[[deps.AbstractTrees]]
git-tree-sha1 = "2d9c9a55f9c93e8887ad391fbae72f8ef55e1177"
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
version = "0.4.5"
[[deps.Adapt]]
deps = ["LinearAlgebra", "Requires"]
git-tree-sha1 = "50c3c56a52972d78e8be9fd135bfb91c9574c140"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "4.1.1"
weakdeps = ["StaticArrays"]
[deps.Adapt.extensions]
AdaptStaticArraysExt = "StaticArrays"
[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
version = "1.1.2"
[[deps.ArnoldiMethod]]
deps = ["LinearAlgebra", "Random", "StaticArrays"]
git-tree-sha1 = "d57bd3762d308bded22c3b82d033bff85f6195c6"
uuid = "ec485272-7323-5ecc-a04f-4719b315124d"
version = "0.4.0"
[[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
version = "1.11.0"
[[deps.AxisAlgorithms]]
deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"]
git-tree-sha1 = "01b8ccb13d68535d73d2b0c23e39bd23155fb712"
uuid = "13072b0f-2c55-5437-9ae7-d433b7a33950"
version = "1.1.0"
[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
version = "1.11.0"
[[deps.BitFlags]]
git-tree-sha1 = "0691e34b3bb8be9307330f88d1a3c3f25466c24d"
uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35"
version = "0.1.9"
[[deps.Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "8873e196c2eb87962a2048b3b8e08946535864a1"
uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
version = "1.0.8+2"
[[deps.Cairo_jll]]
deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"]
git-tree-sha1 = "009060c9a6168704143100f36ab08f06c2af4642"
uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a"
version = "1.18.2+1"
[[deps.ChainRulesCore]]
deps = ["Compat", "LinearAlgebra"]
git-tree-sha1 = "3e4b134270b372f2ed4d4d0e936aabaefc1802bc"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "1.25.0"
weakdeps = ["SparseArrays"]
[deps.ChainRulesCore.extensions]
ChainRulesCoreSparseArraysExt = "SparseArrays"
[[deps.CodecZlib]]
deps = ["TranscodingStreams", "Zlib_jll"]
git-tree-sha1 = "bce6804e5e6044c6daab27bb533d1295e4a2e759"
uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
version = "0.7.6"
[[deps.ColorSchemes]]
deps = ["ColorTypes", "ColorVectorSpace", "Colors", "FixedPointNumbers", "PrecompileTools", "Random"]
git-tree-sha1 = "c785dfb1b3bfddd1da557e861b919819b82bbe5b"
uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
version = "3.27.1"
[[deps.ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "b10d0b65641d57b8b4d5e234446582de5047050d"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.11.5"
[[deps.ColorVectorSpace]]
deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "Requires", "Statistics", "TensorCore"]
git-tree-sha1 = "a1f44953f2382ebb937d60dafbe2deea4bd23249"
uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4"
version = "0.10.0"
[deps.ColorVectorSpace.extensions]
SpecialFunctionsExt = "SpecialFunctions"
[deps.ColorVectorSpace.weakdeps]
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
[[deps.Colors]]
deps = ["ColorTypes", "FixedPointNumbers", "Reexport"]
git-tree-sha1 = "64e15186f0aa277e174aa81798f7eb8598e0157e"
uuid = "5ae59095-9a9b-59fe-a467-6f913c188581"
version = "0.13.0"
[[deps.Compat]]
deps = ["TOML", "UUIDs"]
git-tree-sha1 = "8ae8d32e09f0dcf42a36b90d4e17f5dd2e4c4215"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "4.16.0"
weakdeps = ["Dates", "LinearAlgebra"]
[deps.Compat.extensions]
CompatLinearAlgebraExt = "LinearAlgebra"
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.1.1+0"
[[deps.ConcurrentUtilities]]
deps = ["Serialization", "Sockets"]
git-tree-sha1 = "ea32b83ca4fefa1768dc84e504cc0a94fb1ab8d1"
uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb"
version = "2.4.2"
[[deps.Configurations]]
deps = ["ExproniconLite", "OrderedCollections", "TOML"]
git-tree-sha1 = "4358750bb58a3caefd5f37a4a0c5bfdbbf075252"
uuid = "5218b696-f38b-4ac9-8b61-a12ec717816d"
version = "0.17.6"
[[deps.ConstructionBase]]
git-tree-sha1 = "76219f1ed5771adbb096743bff43fb5fdd4c1157"
uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
version = "1.5.8"
[deps.ConstructionBase.extensions]
ConstructionBaseIntervalSetsExt = "IntervalSets"
ConstructionBaseLinearAlgebraExt = "LinearAlgebra"
ConstructionBaseStaticArraysExt = "StaticArrays"
[deps.ConstructionBase.weakdeps]
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
[[deps.Contour]]
git-tree-sha1 = "439e35b0b36e2e5881738abc8857bd92ad6ff9a8"
uuid = "d38c429a-6771-53c6-b99e-75d170b6e991"
version = "0.6.3"
[[deps.DataAPI]]
git-tree-sha1 = "abe83f3a2f1b857aac70ef8b269080af17764bbe"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.16.0"
[[deps.DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "1d0a14036acb104d9e89698bd408f63ab58cdc82"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.18.20"
[[deps.DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"
[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
version = "1.11.0"
[[deps.Dbus_jll]]
deps = ["Artifacts", "Expat_jll", "JLLWrappers", "Libdl"]
git-tree-sha1 = "fc173b380865f70627d7dd1190dc2fce6cc105af"
uuid = "ee1fde0b-3d02-5ea6-8484-8dfef6360eab"
version = "1.14.10+0"
[[deps.DelimitedFiles]]
deps = ["Mmap"]
git-tree-sha1 = "9e2f36d3c96a820c678f2f1f1782582fcf685bae"
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
version = "1.9.1"
[[deps.Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
version = "1.11.0"
[[deps.DocStringExtensions]]
deps = ["LibGit2"]
git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.9.3"
[[deps.Downloads]]
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
version = "1.6.0"
[[deps.EarCut_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "e3290f2d49e661fbd94046d7e3726ffcb2d41053"
uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5"
version = "2.2.4+0"
[[deps.EpollShim_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "8a4be429317c42cfae6a7fc03c31bad1970c310d"
uuid = "2702e6a9-849d-5ed8-8c21-79e8b8f9ee43"
version = "0.0.20230411+1"
[[deps.ExceptionUnwrapping]]
deps = ["Test"]
git-tree-sha1 = "d36f682e590a83d63d1c7dbd287573764682d12a"
uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4"
version = "0.1.11"
[[deps.Expat_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "e51db81749b0777b2147fbe7b783ee79045b8e99"
uuid = "2e619515-83b5-522b-bb60-26c02a35a201"
version = "2.6.4+1"
[[deps.ExpressionExplorer]]
git-tree-sha1 = "7005f1493c18afb2fa3bdf06e02b16a9fde5d16d"
uuid = "21656369-7473-754a-2065-74616d696c43"
version = "1.1.0"
[[deps.ExproniconLite]]
git-tree-sha1 = "4c9ed87a6b3cd90acf24c556f2119533435ded38"
uuid = "55351af7-c7e9-48d6-89ff-24e801d99491"
version = "0.10.13"
[[deps.Extents]]
git-tree-sha1 = "81023caa0021a41712685887db1fc03db26f41f5"
uuid = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
version = "0.1.4"
[[deps.FFMPEG]]
deps = ["FFMPEG_jll"]
git-tree-sha1 = "53ebe7511fa11d33bec688a9178fac4e49eeee00"
uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"
version = "0.4.2"
[[deps.FFMPEG_jll]]
deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "PCRE2_jll", "Zlib_jll", "libaom_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"]
git-tree-sha1 = "466d45dc38e15794ec7d5d63ec03d776a9aff36e"
uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5"
version = "4.4.4+1"
[[deps.FileWatching]]
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
version = "1.11.0"
[[deps.FixedPointNumbers]]
deps = ["Statistics"]
git-tree-sha1 = "05882d6995ae5c12bb5f36dd2ed3f61c98cbb172"
uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
version = "0.8.5"
[[deps.Fontconfig_jll]]
deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Zlib_jll"]
git-tree-sha1 = "21fac3c77d7b5a9fc03b0ec503aa1a6392c34d2b"
uuid = "a3f928ae-7b40-5064-980b-68af3947d34b"
version = "2.15.0+0"
[[deps.Format]]
git-tree-sha1 = "9c68794ef81b08086aeb32eeaf33531668d5f5fc"
uuid = "1fa38f19-a742-5d3f-a2b9-30dd87b9d5f8"
version = "1.3.7"
[[deps.FreeType2_jll]]
deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Zlib_jll"]
git-tree-sha1 = "786e968a8d2fb167f2e4880baba62e0e26bd8e4e"
uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7"
version = "2.13.3+1"
[[deps.FriBidi_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "1ed150b39aebcc805c26b93a8d0122c940f64ce2"
uuid = "559328eb-81f9-559d-9380-de523a88c83c"
version = "1.0.14+0"
[[deps.FuzzyCompletions]]
deps = ["REPL"]
git-tree-sha1 = "be713866335f48cfb1285bff2d0cbb8304c1701c"
uuid = "fb4132e2-a121-4a70-b8a1-d5b831dcdcc2"
version = "0.5.5"
[[deps.GLFW_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll", "libdecor_jll", "xkbcommon_jll"]
git-tree-sha1 = "532f9126ad901533af1d4f5c198867227a7bb077"
uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89"
version = "3.4.0+1"
[[deps.GR]]
deps = ["Artifacts", "Base64", "DelimitedFiles", "Downloads", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Preferences", "Printf", "Qt6Wayland_jll", "Random", "Serialization", "Sockets", "TOML", "Tar", "Test", "p7zip_jll"]
git-tree-sha1 = "ee28ddcd5517d54e417182fec3886e7412d3926f"
uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
version = "0.73.8"
[[deps.GR_jll]]
deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "FreeType2_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Qt6Base_jll", "Zlib_jll", "libpng_jll"]
git-tree-sha1 = "f31929b9e67066bee48eec8b03c0df47d31a74b3"
uuid = "d2c73de3-f751-5644-a686-071e5b155ba9"
version = "0.73.8+0"
[[deps.GeoFormatTypes]]
git-tree-sha1 = "59107c179a586f0fe667024c5eb7033e81333271"
uuid = "68eda718-8dee-11e9-39e7-89f7f65f511f"
version = "0.4.2"
[[deps.GeoInterface]]
deps = ["Extents", "GeoFormatTypes"]
git-tree-sha1 = "826b4fd69438d9ce4d2b19de6bc2f970f45f0f88"
uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
version = "1.3.8"
[[deps.GeometryBasics]]
deps = ["EarCut_jll", "Extents", "GeoInterface", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"]
git-tree-sha1 = "b62f2b2d76cee0d61a2ef2b3118cd2a3215d3134"
uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
version = "0.4.11"
[[deps.GeometryTypes]]
deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "StaticArrays"]
git-tree-sha1 = "d796f7be0383b5416cd403420ce0af083b0f9b28"
uuid = "4d00f742-c7ba-57c2-abde-4428a4b178cb"
version = "0.8.5"
[[deps.Gettext_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"]
git-tree-sha1 = "9b02998aba7bf074d14de89f9d37ca24a1a0b046"
uuid = "78b55507-aeef-58d4-861c-77aaff3498b1"
version = "0.21.0+0"
[[deps.Glib_jll]]
deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE2_jll", "Zlib_jll"]
git-tree-sha1 = "48b5d4c75b2c9078ead62e345966fa51a25c05ad"
uuid = "7746bdde-850d-59dc-9ae8-88ece973131d"
version = "2.82.2+1"
[[deps.GraphRecipes]]
deps = ["AbstractTrees", "GeometryTypes", "Graphs", "InteractiveUtils", "Interpolations", "LinearAlgebra", "NaNMath", "NetworkLayout", "PlotUtils", "RecipesBase", "SparseArrays", "Statistics"]
git-tree-sha1 = "10920601dc51d2231bb3d2111122045efed8def0"
uuid = "bd48cda9-67a9-57be-86fa-5b3c104eda73"
version = "0.5.13"
[[deps.Graphite2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "01979f9b37367603e2848ea225918a3b3861b606"
uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472"
version = "1.3.14+1"
[[deps.Graphs]]
deps = ["ArnoldiMethod", "Compat", "DataStructures", "Distributed", "Inflate", "LinearAlgebra", "Random", "SharedArrays", "SimpleTraits", "SparseArrays", "Statistics"]
git-tree-sha1 = "1dc470db8b1131cfc7fb4c115de89fe391b9e780"
uuid = "86223c79-3864-5bf0-83f7-82e725a168b6"
version = "1.12.0"
[[deps.Grisu]]
git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2"
uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe"
version = "1.0.2"
[[deps.HTTP]]
deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "PrecompileTools", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"]
git-tree-sha1 = "6c22309e9a356ac1ebc5c8a217045f9bae6f8d9a"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
version = "1.10.13"
[[deps.HarfBuzz_jll]]
deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "Graphite2_jll", "JLLWrappers", "Libdl", "Libffi_jll"]
git-tree-sha1 = "55c53be97790242c29031e5cd45e8ac296dadda3"
uuid = "2e76f6c2-a576-52d4-95c1-20adfe4de566"
version = "8.5.0+0"
[[deps.HypertextLiteral]]
deps = ["Tricks"]
git-tree-sha1 = "7134810b1afce04bbc1045ca1985fbe81ce17653"
uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2"
version = "0.9.5"
[[deps.Inflate]]
git-tree-sha1 = "d1b1b796e47d94588b3757fe84fbf65a5ec4a80d"
uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9"
version = "0.1.5"
[[deps.InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
version = "1.11.0"
[[deps.Interpolations]]
deps = ["Adapt", "AxisAlgorithms", "ChainRulesCore", "LinearAlgebra", "OffsetArrays", "Random", "Ratios", "Requires", "SharedArrays", "SparseArrays", "StaticArrays", "WoodburyMatrices"]
git-tree-sha1 = "88a101217d7cb38a7b481ccd50d21876e1d1b0e0"
uuid = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
version = "0.15.1"
weakdeps = ["Unitful"]
[deps.Interpolations.extensions]
InterpolationsUnitfulExt = "Unitful"
[[deps.IrrationalConstants]]
git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2"
uuid = "92d709cd-6900-40b7-9082-c6be49f344b6"
version = "0.2.2"
[[deps.IterTools]]
git-tree-sha1 = "42d5f897009e7ff2cf88db414a389e5ed1bdd023"
uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
version = "1.10.0"
[[deps.IteratorInterfaceExtensions]]
git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856"
uuid = "82899510-4779-5014-852e-03e436cf321d"
version = "1.0.0"
[[deps.JLFzf]]
deps = ["Pipe", "REPL", "Random", "fzf_jll"]
git-tree-sha1 = "71b48d857e86bf7a1838c4736545699974ce79a2"
uuid = "1019f520-868f-41f5-a6de-eb00f4b6a39c"
version = "0.1.9"
[[deps.JLLWrappers]]
deps = ["Artifacts", "Preferences"]
git-tree-sha1 = "be3dc50a92e5a386872a493a10050136d4703f9b"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.6.1"
[[deps.JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.4"
[[deps.JpegTurbo_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "25ee0be4d43d0269027024d75a24c24d6c6e590c"
uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
version = "3.0.4+0"
[[deps.LAME_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "170b660facf5df5de098d866564877e119141cbd"
uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d"
version = "3.100.2+0"
[[deps.LERC_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "36bdbc52f13a7d1dcb0f3cd694e01677a515655b"
uuid = "88015f11-f218-50d7-93a8-a6af411a945d"
version = "4.0.0+0"
[[deps.LLVMOpenMP_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "78211fb6cbc872f77cad3fc0b6cf647d923f4929"
uuid = "1d63c593-3942-5779-bab2-d838dc0a180e"
version = "18.1.7+0"
[[deps.LZO_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "854a9c268c43b77b0a27f22d7fab8d33cdb3a731"
uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac"
version = "2.10.2+1"
[[deps.LaTeXStrings]]
git-tree-sha1 = "dda21b8cbd6a6c40d9d02a73230f9d70fed6918c"
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
version = "1.4.0"
[[deps.Latexify]]
deps = ["Format", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "OrderedCollections", "Requires"]
git-tree-sha1 = "ce5f5621cac23a86011836badfedf664a612cee4"
uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
version = "0.16.5"
[deps.Latexify.extensions]
DataFramesExt = "DataFrames"
SparseArraysExt = "SparseArrays"
SymEngineExt = "SymEngine"
[deps.Latexify.weakdeps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SymEngine = "123dc426-2d89-5057-bbad-38513e3affd8"
[[deps.LazilyInitializedFields]]
git-tree-sha1 = "0f2da712350b020bc3957f269c9caad516383ee0"
uuid = "0e77f7df-68c5-4e49-93ce-4cd80f5598bf"