blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 3
171
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
8
| license_type
stringclasses 2
values | repo_name
stringlengths 6
82
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 13
values | visit_date
timestamp[ns] | revision_date
timestamp[ns] | committer_date
timestamp[ns] | github_id
int64 1.59k
594M
⌀ | star_events_count
int64 0
77.1k
| fork_events_count
int64 0
33.7k
| gha_license_id
stringclasses 12
values | gha_event_created_at
timestamp[ns] | gha_created_at
timestamp[ns] | gha_language
stringclasses 46
values | src_encoding
stringclasses 14
values | language
stringclasses 2
values | is_vendor
bool 2
classes | is_generated
bool 1
class | length_bytes
int64 4
7.87M
| extension
stringclasses 101
values | filename
stringlengths 2
149
| content
stringlengths 4
7.87M
| has_macro_def
bool 2
classes |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
026a9dd8a35f56221cd0e29dcdd9a4ab8424275e | c161c2096ff80424ef06d144dacdb0fc23e25635 | /chapter3/exercise/ex3.8.rkt | 5bf966ecd76b6e39ed9c2d3086ec4e54c1d3f326 | []
| no_license | tangshipoetry/SICP | f674e4be44dfe905da4a8fc938b0f0460e061dc8 | fae33da93746c3f1fc92e4d22ccbc1153cce6ac9 | refs/heads/master | 2020-03-10T06:55:29.711600 | 2018-07-16T00:17:08 | 2018-07-16T00:17:08 | 129,242,982 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 119 | rkt | ex3.8.rkt | #lang racket
(define (f x)
(set! f (lambda(y) 0))
x)
(+ (f 1) (f 0))
| false |
00d79cd6a496a5ac66bf72e93235820c20912073 | a70301d352dcc9987daf2bf12919aecd66defbd8 | /res+edu+pro/bar.rkt | 3106ddfb375505d93f9b87edef96870481d2cdeb | []
| no_license | mflatt/talks | 45fbd97b1ca72addecf8f4b92053b85001ed540b | 7abfdf9a9397d3d3d5d1b4c107ab6a62d0ac1265 | refs/heads/master | 2021-01-19T05:18:38.094408 | 2020-06-04T16:29:25 | 2020-06-04T16:29:25 | 87,425,078 | 2 | 2 | null | null | null | null | UTF-8 | Racket | false | false | 5,203 | rkt | bar.rkt | #lang slideshow
(require slideshow/play
"color.rkt"
"paper.rkt"
"gear.rkt"
"person.rkt")
(provide bar-slides
department-view
citizen-title
reality-title)
(define BAR-W 150)
(define BAR-H 500)
(define (just-bar amt color)
(linewidth
#f
(cellophane
(colorize (filled-rectangle BAR-W (* BAR-H amt))
color)
medium-alpha)))
(define (bar amt
#:color color
#:extras [extras null]
#:icon icon)
(vc-append
gap-size
(inset
(for/fold ([p (just-bar amt color)]) ([e (in-list (reverse extras))])
(vc-append (just-bar (car e) (cadr e)) p))
0 (* BAR-H (- 1 (+ amt (for/sum ([e (in-list extras)])
(car e)))))
0 0)
(ct-superimpose (blank BAR-W (* 3/4 BAR-W))
icon)))
(define (expectation #:res res-amt
#:edu edu-amt
#:prod prod-amt
#:prod-as-res [prod-as-res #f]
#:prod-as-edu [prod-as-edu #f]
#:prod-as-serv [prod-as-serv #f]
#:serv serv-amt
#:serv-visible [serv-visible 1])
(hc-append
BAR-W
(bar res-amt
#:color res-color
#:icon (scale (paper) 0.7))
(bar edu-amt
#:color edu-color
#:icon (scale (students) 0.4))
(hc-append
(* serv-visible BAR-W)
(bar prod-amt
#:color prod-color
#:icon (scale (gear) 0.7)
#:extras (append
(if prod-as-res (list (list prod-as-res res-color)) null)
(if prod-as-edu (list (list prod-as-edu edu-color)) null)
(if prod-as-serv (list (list prod-as-serv serv-color)) null)))
(let ([serv (bar serv-amt
#:color serv-color
#:icon (scale (accountant) 0.8))])
(if (= serv-visible 1)
serv
(let ([p (blank (* serv-visible (pict-width serv))
(pict-height serv))])
(refocus (lt-superimpose p (cellophane serv serv-visible))
p)))))))
(define min-bar 0.01)
(define citizen-res 0.20)
(define citizen-edu 0.80)
(define citizen-prod min-bar)
(define citizen-serv min-bar)
(define dept-res 0.55)
(define dept-edu 0.30)
(define dept-prod min-bar)
(define dept-serv 0.15)
(define my-res 0.25)
(define my-edu 0.30)
(define my-prod 0.30)
(define my-serv 0.15)
(define my-prod-as-res 0.20)
(define my-prod-as-edu 0.05)
(define my-prod-as-serv 0.02)
(define (from-to n a b)
(+ a (* n (- b a))))
(define the-prof (delay (professor)))
(define (add-prof-icon s #:prof [prof (force the-prof)])
(hc-append gap-size (titlet s) (scale prof 0.6)))
(define (department-view-title)
(add-prof-icon "Department View of Professors"))
(define (reality-title #:prof [prof (force the-prof)])
(add-prof-icon "My Reality" #:prof prof))
(define department-view-at-n
(lambda (n)
(expectation #:res (from-to n citizen-res dept-res)
#:edu (from-to n citizen-edu dept-edu)
#:prod (from-to n citizen-prod dept-prod)
#:serv (from-to n citizen-serv dept-serv))))
(define (department-view)
(vc-append
gap-size
(department-view-title)
(department-view-at-n 1)))
(define (citizen-title [prof (force the-prof)])
(add-prof-icon "Citizen View of Professors" #:prof prof))
(define (bar-slides)
(play-n
#:title (citizen-title)
#:name "Citizen View of Professors"
#:layout 'tall
#:skip-last? #t
(lambda (n)
(expectation #:res (+ min-bar (* (- citizen-res min-bar) n))
#:edu citizen-edu
#:prod citizen-prod
#:serv citizen-serv
#:serv-visible 0)))
(play-n
#:title (add-prof-icon "Citizen View of Professors")
#:name "Citizen View of Professors"
#:layout 'tall
(lambda (n)
(expectation #:res citizen-res
#:edu citizen-edu
#:prod citizen-prod
#:serv citizen-serv
#:serv-visible n)))
(play-n
#:title (department-view-title)
#:name "Department View of Professors"
#:layout 'tall
#:skip-first? #t
department-view-at-n)
(play-n
#:title (reality-title)
#:name "My Reality"
#:layout 'tall
#:skip-first? #t
(lambda (n)
(expectation #:res (from-to n dept-res my-res)
#:edu (from-to n dept-edu my-edu)
#:prod (from-to n dept-prod my-prod)
#:serv (from-to n dept-serv my-serv))))
(play-n
#:title (reality-title)
#:name "My Reality"
#:layout 'tall
#:skip-first? #t
(lambda (n)
(expectation #:res (from-to n my-res (- my-res my-prod-as-res))
#:edu (from-to n my-edu (- my-edu my-prod-as-edu))
#:prod my-prod
#:prod-as-res (from-to n 0 my-prod-as-res)
#:prod-as-edu (from-to n 0 my-prod-as-edu)
#:prod-as-serv (from-to n 0 my-prod-as-serv)
#:serv (from-to n my-serv (- my-serv my-prod-as-serv))))))
(module+ main
(bar-slides))
| false |
af361c23fad9cfdf6f1fa65c88676430f00c69aa | 3b0fcaabcffcfb529bf0030056c3ed7ea0edae0d | /dlist/dlist.rkt | 9a2d6283e1ec9d5589ed41eb8dbc77ddaf0ad7e7 | []
| no_license | dkamdar5/Data-Structures | ff840b2891812da5ae9e2e64c371b851759532fc | 54f6b0ddf3d20ba951316587edd099d0b8aba967 | refs/heads/master | 2021-01-13T00:16:20.743138 | 2012-12-07T09:33:30 | 2012-12-07T09:33:30 | 55,434,416 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 3,064 | rkt | dlist.rkt | (module dlist racket
(provide make-dlist size insert-front insert-back insert-ordered
delete dlist-reverse dlist-to-cons cons-to-dlist
dlist-tests)
(struct dlist (sentinel size) #:mutable #:transparent)
(struct dnode (prev data next) #:mutable #:transparent)
(define (make-dlist)
(let ((sentinel (dnode null 'sentinel null)))
(begin
(set-dnode-prev! sentinel sentinel)
(set-dnode-next! sentinel sentinel)
(dlist sentinel 0))))
; Here is a size function. Just because I provide it doesn't mean it's complete!
(define (size dl)
(dlist-size dl))
(define (inc-dlist-size! dl)
(set-dlist-size! dl (+ (dlist-size dl) 1)))
(define (insert-front dl elt)
(let ((node (dnode (dlist-sentinel dl) elt (dnode-next (dlist-sentinel dl)))))
;node = new dnode. prev = sentinal. data = element. next = next dnode of sentinal.
(begin
(set-dnode-prev! (dnode-next node) node);set prev of the next node to itself
(set-dnode-next! (dlist-sentinel dl) node);set next of the sentinal to itself
(inc-dlist-size! dl))))
(define (insert-back dl elt)
(let ((node (dnode (dnode-prev (dlist-sentinel dl)) elt (dlist-sentinel dl))))
;node = new dnode. prev = prev dnode of sentinal. data = element. next = sentinal.
(begin
(set-dnode-prev! (dlist-sentinel dl) node);set prev of sentinal to itselft
(set-dnode-next! (dnode-prev node) node);set next of the prev node to itself
(inc-dlist-size! dl))))
(define (find-greater dn elt)
(cond ((null? dn) null)
((< elt (dnode-data dn)) dn)
(else (find-greater (dnode-next dn) elt))))
(define (insert-ordered dl elt)
(cond ((equal? (size dl) 0) (insert-front dl elt))
((equal? (size dl) 1) (insert-back dl elt))
(else
(begin
(find-greater (dnode-next (dlist-sentinel dl)) elt)
(let ((node (dnode (dnode-prev (find-greater (dnode-next (dlist-sentinel dl)) elt)) elt (find-greater (dnode-next (dlist-sentinel dl)) elt))))
(set-dnode-prev! ((find-greater (dnode-next (dlist-sentinel dl)) elt)) node)
(set-dnode-next! (dnode-prev (find-greater (dnode-next (dlist-sentinel dl)) elt)) node)
(inc-dlist-size! dl))))))
(define (delete dl elt)
(if (null? (find-greater dl elt)) null
(if ((eq? (dnode-data (dnode-prev (find-greater dl elt))))) null
null)))
(define (dlist-reverse dl)
dl
)
(define (dlist-to-cons dl)
(define (aux x y)
(cond ((equal? (dlist-size x) 0) y)
(else
(define y (cons (dnode-data (dnode-prev (dlist-sentinel x))) y))
(delete x (car y))
(aux x y))))
(aux dl '()))
(define (cons-to-dlist cl)
(define dl (make-dlist))
(define (aux x y)
(cond ((null? x) y)
(else
(insert-back dl (car x))
(aux (cdr x) dl))))
(aux cl dl))
; Test cases here
(include "test-dlist.rkt")
)
| false |
c5fd6b4d9f674349f8c88252658597ca236dfbaa | 662e55de9b4213323395102bd50fb22b30eaf957 | /dissertation/scrbl/jfp-2019/data/7.7/acquire-v7.7-2020-07-21T00:00:00.rktd | 20df3a0b139f0c275c3a99caf9b9708e646369e9 | []
| no_license | bennn/dissertation | 3000f2e6e34cc208ee0a5cb47715c93a645eba11 | 779bfe6f8fee19092849b7e2cfc476df33e9357b | refs/heads/master | 2023-03-01T11:28:29.151909 | 2021-02-11T19:52:37 | 2021-02-11T19:52:37 | 267,969,820 | 7 | 1 | null | null | null | null | UTF-8 | Racket | false | false | 100,752 | rktd | acquire-v7.7-2020-07-21T00:00:00.rktd | #lang gtp-measure/output/typed-untyped
("000000000" ("cpu time: 459 real time: 460 gc time: 61" "cpu time: 460 real time: 461 gc time: 65" "cpu time: 463 real time: 464 gc time: 69" "cpu time: 473 real time: 474 gc time: 65"))
("000000001" ("cpu time: 788 real time: 791 gc time: 89" "cpu time: 784 real time: 787 gc time: 86" "cpu time: 781 real time: 783 gc time: 86" "cpu time: 779 real time: 781 gc time: 86"))
("000000010" ("cpu time: 485 real time: 487 gc time: 87" "cpu time: 488 real time: 489 gc time: 88" "cpu time: 478 real time: 479 gc time: 86" "cpu time: 492 real time: 493 gc time: 91"))
("000000011" ("cpu time: 790 real time: 792 gc time: 88" "cpu time: 783 real time: 786 gc time: 87" "cpu time: 816 real time: 819 gc time: 100" "cpu time: 792 real time: 795 gc time: 86"))
("000000100" ("cpu time: 962 real time: 965 gc time: 102" "cpu time: 973 real time: 976 gc time: 107" "cpu time: 987 real time: 989 gc time: 119" "cpu time: 991 real time: 993 gc time: 106"))
("000000101" ("cpu time: 1264 real time: 1267 gc time: 116" "cpu time: 1243 real time: 1247 gc time: 111" "cpu time: 1255 real time: 1259 gc time: 116" "cpu time: 1253 real time: 1256 gc time: 117"))
("000000110" ("cpu time: 988 real time: 990 gc time: 109" "cpu time: 990 real time: 993 gc time: 116" "cpu time: 1005 real time: 1008 gc time: 128" "cpu time: 997 real time: 999 gc time: 114"))
("000000111" ("cpu time: 1267 real time: 1271 gc time: 118" "cpu time: 1264 real time: 1267 gc time: 112" "cpu time: 1273 real time: 1277 gc time: 117" "cpu time: 1271 real time: 1276 gc time: 132"))
("000001000" ("cpu time: 758 real time: 760 gc time: 150" "cpu time: 735 real time: 737 gc time: 128" "cpu time: 749 real time: 751 gc time: 137" "cpu time: 750 real time: 752 gc time: 142"))
("000001001" ("cpu time: 1027 real time: 1030 gc time: 129" "cpu time: 1020 real time: 1024 gc time: 127" "cpu time: 1031 real time: 1034 gc time: 129" "cpu time: 1016 real time: 1020 gc time: 125"))
("000001010" ("cpu time: 760 real time: 762 gc time: 139" "cpu time: 748 real time: 750 gc time: 140" "cpu time: 747 real time: 749 gc time: 145" "cpu time: 741 real time: 744 gc time: 139"))
("000001011" ("cpu time: 1020 real time: 1023 gc time: 137" "cpu time: 1023 real time: 1026 gc time: 130" "cpu time: 1020 real time: 1024 gc time: 130" "cpu time: 1033 real time: 1036 gc time: 140"))
("000001100" ("cpu time: 1260 real time: 1264 gc time: 139" "cpu time: 1251 real time: 1255 gc time: 146" "cpu time: 1312 real time: 1315 gc time: 183" "cpu time: 1427 real time: 1431 gc time: 279"))
("000001101" ("cpu time: 1761 real time: 1767 gc time: 267" "cpu time: 1677 real time: 1682 gc time: 275" "cpu time: 1694 real time: 1698 gc time: 274" "cpu time: 1564 real time: 1568 gc time: 166"))
("000001110" ("cpu time: 1280 real time: 1283 gc time: 162" "cpu time: 1430 real time: 1434 gc time: 278" "cpu time: 1422 real time: 1425 gc time: 278" "cpu time: 1402 real time: 1406 gc time: 275"))
("000001111" ("cpu time: 1740 real time: 1744 gc time: 274" "cpu time: 1704 real time: 1709 gc time: 276" "cpu time: 1541 real time: 1545 gc time: 163" "cpu time: 1587 real time: 1592 gc time: 156"))
("000010000" ("cpu time: 890 real time: 892 gc time: 159" "cpu time: 1052 real time: 1055 gc time: 271" "cpu time: 921 real time: 924 gc time: 156" "cpu time: 1030 real time: 1033 gc time: 278"))
("000010001" ("cpu time: 1191 real time: 1195 gc time: 147" "cpu time: 1179 real time: 1183 gc time: 144" "cpu time: 1188 real time: 1190 gc time: 148" "cpu time: 1186 real time: 1190 gc time: 142"))
("000010010" ("cpu time: 1026 real time: 1029 gc time: 269" "cpu time: 906 real time: 909 gc time: 154" "cpu time: 942 real time: 944 gc time: 182" "cpu time: 921 real time: 924 gc time: 157"))
("000010011" ("cpu time: 1210 real time: 1215 gc time: 171" "cpu time: 1190 real time: 1194 gc time: 150" "cpu time: 1188 real time: 1191 gc time: 139" "cpu time: 1194 real time: 1199 gc time: 137"))
("000010100" ("cpu time: 1493 real time: 1498 gc time: 163" "cpu time: 1505 real time: 1509 gc time: 165" "cpu time: 1493 real time: 1497 gc time: 167" "cpu time: 1520 real time: 1525 gc time: 173"))
("000010101" ("cpu time: 1946 real time: 1951 gc time: 279" "cpu time: 1855 real time: 1860 gc time: 167" "cpu time: 1963 real time: 1969 gc time: 281" "cpu time: 1806 real time: 1810 gc time: 171"))
("000010110" ("cpu time: 1650 real time: 1655 gc time: 279" "cpu time: 1498 real time: 1502 gc time: 167" "cpu time: 1688 real time: 1693 gc time: 277" "cpu time: 1643 real time: 1647 gc time: 270"))
("000010111" ("cpu time: 1905 real time: 1911 gc time: 167" "cpu time: 1788 real time: 1793 gc time: 170" "cpu time: 1821 real time: 1827 gc time: 160" "cpu time: 1852 real time: 1857 gc time: 165"))
("000011000" ("cpu time: 613 real time: 615 gc time: 103" "cpu time: 629 real time: 631 gc time: 112" "cpu time: 616 real time: 618 gc time: 110" "cpu time: 640 real time: 643 gc time: 125"))
("000011001" ("cpu time: 918 real time: 920 gc time: 103" "cpu time: 955 real time: 958 gc time: 112" "cpu time: 924 real time: 928 gc time: 111" "cpu time: 946 real time: 948 gc time: 121"))
("000011010" ("cpu time: 628 real time: 629 gc time: 120" "cpu time: 626 real time: 628 gc time: 116" "cpu time: 620 real time: 621 gc time: 115" "cpu time: 631 real time: 633 gc time: 114"))
("000011011" ("cpu time: 932 real time: 934 gc time: 110" "cpu time: 924 real time: 928 gc time: 108" "cpu time: 921 real time: 924 gc time: 107" "cpu time: 963 real time: 965 gc time: 132"))
("000011100" ("cpu time: 1104 real time: 1107 gc time: 144" "cpu time: 1146 real time: 1149 gc time: 144" "cpu time: 1111 real time: 1114 gc time: 149" "cpu time: 1115 real time: 1118 gc time: 149"))
("000011101" ("cpu time: 1401 real time: 1405 gc time: 155" "cpu time: 1403 real time: 1406 gc time: 145" "cpu time: 1410 real time: 1415 gc time: 141" "cpu time: 1394 real time: 1398 gc time: 146"))
("000011110" ("cpu time: 1126 real time: 1129 gc time: 140" "cpu time: 1115 real time: 1118 gc time: 144" "cpu time: 1103 real time: 1106 gc time: 148" "cpu time: 1115 real time: 1118 gc time: 148"))
("000011111" ("cpu time: 1418 real time: 1423 gc time: 150" "cpu time: 1426 real time: 1431 gc time: 155" "cpu time: 1404 real time: 1407 gc time: 144" "cpu time: 1427 real time: 1431 gc time: 141"))
("000100000" ("cpu time: 590 real time: 592 gc time: 109" "cpu time: 565 real time: 568 gc time: 84" "cpu time: 557 real time: 559 gc time: 84" "cpu time: 574 real time: 577 gc time: 107"))
("000100001" ("cpu time: 867 real time: 870 gc time: 91" "cpu time: 881 real time: 884 gc time: 87" "cpu time: 876 real time: 878 gc time: 101" "cpu time: 883 real time: 886 gc time: 99"))
("000100010" ("cpu time: 572 real time: 573 gc time: 90" "cpu time: 560 real time: 561 gc time: 87" "cpu time: 581 real time: 582 gc time: 101" "cpu time: 562 real time: 564 gc time: 87"))
("000100011" ("cpu time: 858 real time: 861 gc time: 88" "cpu time: 868 real time: 872 gc time: 88" "cpu time: 869 real time: 871 gc time: 91" "cpu time: 881 real time: 883 gc time: 86"))
("000100100" ("cpu time: 1018 real time: 1021 gc time: 116" "cpu time: 1042 real time: 1045 gc time: 116" "cpu time: 1028 real time: 1031 gc time: 105" "cpu time: 1025 real time: 1028 gc time: 115"))
("000100101" ("cpu time: 1279 real time: 1283 gc time: 112" "cpu time: 1314 real time: 1318 gc time: 136" "cpu time: 1283 real time: 1286 gc time: 123" "cpu time: 1290 real time: 1294 gc time: 120"))
("000100110" ("cpu time: 1031 real time: 1034 gc time: 115" "cpu time: 1020 real time: 1023 gc time: 113" "cpu time: 1070 real time: 1073 gc time: 126" "cpu time: 1029 real time: 1032 gc time: 117"))
("000100111" ("cpu time: 1284 real time: 1287 gc time: 116" "cpu time: 1307 real time: 1311 gc time: 116" "cpu time: 1345 real time: 1350 gc time: 116" "cpu time: 1290 real time: 1293 gc time: 113"))
("000101000" ("cpu time: 832 real time: 834 gc time: 136" "cpu time: 824 real time: 827 gc time: 134" "cpu time: 818 real time: 821 gc time: 129" "cpu time: 858 real time: 861 gc time: 150"))
("000101001" ("cpu time: 1127 real time: 1131 gc time: 133" "cpu time: 1116 real time: 1119 gc time: 129" "cpu time: 1131 real time: 1135 gc time: 143" "cpu time: 1145 real time: 1148 gc time: 144"))
("000101010" ("cpu time: 852 real time: 855 gc time: 138" "cpu time: 827 real time: 829 gc time: 137" "cpu time: 832 real time: 834 gc time: 128" "cpu time: 803 real time: 805 gc time: 126"))
("000101011" ("cpu time: 1101 real time: 1105 gc time: 126" "cpu time: 1106 real time: 1109 gc time: 134" "cpu time: 1107 real time: 1109 gc time: 131" "cpu time: 1115 real time: 1120 gc time: 134"))
("000101100" ("cpu time: 1331 real time: 1335 gc time: 162" "cpu time: 1525 real time: 1529 gc time: 280" "cpu time: 1462 real time: 1465 gc time: 275" "cpu time: 1457 real time: 1461 gc time: 269"))
("000101101" ("cpu time: 1638 real time: 1644 gc time: 163" "cpu time: 1601 real time: 1605 gc time: 158" "cpu time: 1745 real time: 1750 gc time: 269" "cpu time: 1777 real time: 1782 gc time: 289"))
("000101110" ("cpu time: 1465 real time: 1469 gc time: 277" "cpu time: 1451 real time: 1455 gc time: 268" "cpu time: 1482 real time: 1486 gc time: 274" "cpu time: 1458 real time: 1462 gc time: 267"))
("000101111" ("cpu time: 1720 real time: 1725 gc time: 271" "cpu time: 1742 real time: 1747 gc time: 287" "cpu time: 1717 real time: 1722 gc time: 271" "cpu time: 1598 real time: 1602 gc time: 164"))
("000110000" ("cpu time: 978 real time: 981 gc time: 144" "cpu time: 982 real time: 984 gc time: 154" "cpu time: 982 real time: 985 gc time: 155" "cpu time: 975 real time: 978 gc time: 155"))
("000110001" ("cpu time: 1271 real time: 1276 gc time: 139" "cpu time: 1254 real time: 1257 gc time: 141" "cpu time: 1287 real time: 1292 gc time: 151" "cpu time: 1239 real time: 1243 gc time: 138"))
("000110010" ("cpu time: 982 real time: 985 gc time: 160" "cpu time: 1157 real time: 1160 gc time: 306" "cpu time: 966 real time: 968 gc time: 147" "cpu time: 976 real time: 978 gc time: 159"))
("000110011" ("cpu time: 1307 real time: 1311 gc time: 160" "cpu time: 1278 real time: 1282 gc time: 141" "cpu time: 1272 real time: 1276 gc time: 152" "cpu time: 1259 real time: 1263 gc time: 140"))
("000110100" ("cpu time: 1550 real time: 1556 gc time: 160" "cpu time: 1544 real time: 1549 gc time: 170" "cpu time: 1679 real time: 1684 gc time: 281" "cpu time: 1587 real time: 1591 gc time: 165"))
("000110101" ("cpu time: 1984 real time: 1989 gc time: 281" "cpu time: 1856 real time: 1862 gc time: 163" "cpu time: 1851 real time: 1856 gc time: 163" "cpu time: 2013 real time: 2018 gc time: 276"))
("000110110" ("cpu time: 1582 real time: 1587 gc time: 168" "cpu time: 1585 real time: 1589 gc time: 181" "cpu time: 1560 real time: 1565 gc time: 167" "cpu time: 1741 real time: 1746 gc time: 285"))
("000110111" ("cpu time: 1885 real time: 1891 gc time: 168" "cpu time: 1860 real time: 1866 gc time: 162" "cpu time: 1844 real time: 1850 gc time: 167" "cpu time: 2031 real time: 2037 gc time: 280"))
("000111000" ("cpu time: 717 real time: 720 gc time: 116" "cpu time: 713 real time: 715 gc time: 116" "cpu time: 705 real time: 706 gc time: 114" "cpu time: 705 real time: 708 gc time: 107"))
("000111001" ("cpu time: 1014 real time: 1018 gc time: 116" "cpu time: 1026 real time: 1028 gc time: 128" "cpu time: 1000 real time: 1003 gc time: 109" "cpu time: 1014 real time: 1016 gc time: 112"))
("000111010" ("cpu time: 710 real time: 712 gc time: 125" "cpu time: 722 real time: 724 gc time: 118" "cpu time: 709 real time: 711 gc time: 114" "cpu time: 722 real time: 725 gc time: 132"))
("000111011" ("cpu time: 1008 real time: 1011 gc time: 108" "cpu time: 1017 real time: 1020 gc time: 111" "cpu time: 1014 real time: 1018 gc time: 111" "cpu time: 1005 real time: 1008 gc time: 105"))
("000111100" ("cpu time: 1161 real time: 1165 gc time: 146" "cpu time: 1182 real time: 1185 gc time: 152" "cpu time: 1249 real time: 1252 gc time: 167" "cpu time: 1206 real time: 1210 gc time: 149"))
("000111101" ("cpu time: 1461 real time: 1466 gc time: 145" "cpu time: 1481 real time: 1485 gc time: 147" "cpu time: 1443 real time: 1447 gc time: 149" "cpu time: 1486 real time: 1491 gc time: 148"))
("000111110" ("cpu time: 1169 real time: 1173 gc time: 162" "cpu time: 1174 real time: 1177 gc time: 163" "cpu time: 1174 real time: 1177 gc time: 157" "cpu time: 1146 real time: 1148 gc time: 144"))
("000111111" ("cpu time: 1438 real time: 1442 gc time: 149" "cpu time: 1434 real time: 1438 gc time: 143" "cpu time: 1484 real time: 1488 gc time: 163" "cpu time: 1444 real time: 1449 gc time: 150"))
("001000000" ("cpu time: 506 real time: 508 gc time: 106" "cpu time: 495 real time: 497 gc time: 91" "cpu time: 495 real time: 497 gc time: 91" "cpu time: 494 real time: 495 gc time: 90"))
("001000001" ("cpu time: 807 real time: 811 gc time: 93" "cpu time: 802 real time: 805 gc time: 86" "cpu time: 798 real time: 801 gc time: 93" "cpu time: 819 real time: 821 gc time: 103"))
("001000010" ("cpu time: 505 real time: 506 gc time: 93" "cpu time: 519 real time: 520 gc time: 108" "cpu time: 520 real time: 521 gc time: 105" "cpu time: 510 real time: 512 gc time: 96"))
("001000011" ("cpu time: 809 real time: 811 gc time: 91" "cpu time: 803 real time: 806 gc time: 87" "cpu time: 807 real time: 810 gc time: 94" "cpu time: 804 real time: 807 gc time: 95"))
("001000100" ("cpu time: 987 real time: 990 gc time: 120" "cpu time: 992 real time: 994 gc time: 119" "cpu time: 1045 real time: 1047 gc time: 137" "cpu time: 987 real time: 989 gc time: 117"))
("001000101" ("cpu time: 1259 real time: 1263 gc time: 132" "cpu time: 1282 real time: 1286 gc time: 119" "cpu time: 1269 real time: 1273 gc time: 121" "cpu time: 1288 real time: 1292 gc time: 125"))
("001000110" ("cpu time: 1017 real time: 1020 gc time: 138" "cpu time: 1004 real time: 1007 gc time: 122" "cpu time: 994 real time: 996 gc time: 126" "cpu time: 996 real time: 999 gc time: 118"))
("001000111" ("cpu time: 1281 real time: 1284 gc time: 122" "cpu time: 1281 real time: 1284 gc time: 126" "cpu time: 1316 real time: 1320 gc time: 130" "cpu time: 1284 real time: 1288 gc time: 115"))
("001001000" ("cpu time: 739 real time: 741 gc time: 134" "cpu time: 751 real time: 754 gc time: 140" "cpu time: 745 real time: 748 gc time: 137" "cpu time: 747 real time: 749 gc time: 131"))
("001001001" ("cpu time: 1035 real time: 1038 gc time: 129" "cpu time: 1025 real time: 1029 gc time: 132" "cpu time: 1023 real time: 1025 gc time: 129" "cpu time: 1053 real time: 1055 gc time: 131"))
("001001010" ("cpu time: 762 real time: 764 gc time: 153" "cpu time: 751 real time: 753 gc time: 139" "cpu time: 759 real time: 761 gc time: 149" "cpu time: 750 real time: 752 gc time: 146"))
("001001011" ("cpu time: 1015 real time: 1018 gc time: 125" "cpu time: 1037 real time: 1040 gc time: 134" "cpu time: 1033 real time: 1036 gc time: 132" "cpu time: 1032 real time: 1034 gc time: 137"))
("001001100" ("cpu time: 1422 real time: 1425 gc time: 295" "cpu time: 1405 real time: 1409 gc time: 273" "cpu time: 1286 real time: 1291 gc time: 180" "cpu time: 1422 real time: 1426 gc time: 273"))
("001001101" ("cpu time: 1566 real time: 1571 gc time: 167" "cpu time: 1671 real time: 1675 gc time: 272" "cpu time: 1566 real time: 1571 gc time: 160" "cpu time: 1566 real time: 1570 gc time: 164"))
("001001110" ("cpu time: 1405 real time: 1408 gc time: 271" "cpu time: 1330 real time: 1334 gc time: 182" "cpu time: 1271 real time: 1274 gc time: 166" "cpu time: 1257 real time: 1261 gc time: 162"))
("001001111" ("cpu time: 1530 real time: 1534 gc time: 161" "cpu time: 1678 real time: 1683 gc time: 268" "cpu time: 1687 real time: 1692 gc time: 282" "cpu time: 1550 real time: 1555 gc time: 166"))
("001010000" ("cpu time: 915 real time: 918 gc time: 157" "cpu time: 897 real time: 900 gc time: 151" "cpu time: 897 real time: 901 gc time: 151" "cpu time: 894 real time: 897 gc time: 143"))
("001010001" ("cpu time: 1176 real time: 1180 gc time: 135" "cpu time: 1169 real time: 1172 gc time: 130" "cpu time: 1178 real time: 1182 gc time: 129" "cpu time: 1166 real time: 1169 gc time: 133"))
("001010010" ("cpu time: 884 real time: 887 gc time: 149" "cpu time: 898 real time: 901 gc time: 148" "cpu time: 891 real time: 893 gc time: 152" "cpu time: 883 real time: 885 gc time: 134"))
("001010011" ("cpu time: 1195 real time: 1198 gc time: 130" "cpu time: 1208 real time: 1211 gc time: 153" "cpu time: 1181 real time: 1186 gc time: 131" "cpu time: 1186 real time: 1190 gc time: 139"))
("001010100" ("cpu time: 1727 real time: 1733 gc time: 318" "cpu time: 1555 real time: 1559 gc time: 170" "cpu time: 1616 real time: 1620 gc time: 192" "cpu time: 1483 real time: 1488 gc time: 163"))
("001010101" ("cpu time: 1784 real time: 1788 gc time: 175" "cpu time: 1833 real time: 1838 gc time: 163" "cpu time: 1957 real time: 1962 gc time: 282" "cpu time: 1844 real time: 1850 gc time: 167"))
("001010110" ("cpu time: 1549 real time: 1554 gc time: 170" "cpu time: 1629 real time: 1634 gc time: 268" "cpu time: 1572 real time: 1577 gc time: 162" "cpu time: 1518 real time: 1522 gc time: 169"))
("001010111" ("cpu time: 1807 real time: 1813 gc time: 169" "cpu time: 1955 real time: 1960 gc time: 296" "cpu time: 1924 real time: 1930 gc time: 275" "cpu time: 1954 real time: 1960 gc time: 282"))
("001011000" ("cpu time: 627 real time: 628 gc time: 117" "cpu time: 613 real time: 614 gc time: 108" "cpu time: 635 real time: 636 gc time: 117" "cpu time: 630 real time: 632 gc time: 114"))
("001011001" ("cpu time: 937 real time: 940 gc time: 110" "cpu time: 938 real time: 941 gc time: 125" "cpu time: 948 real time: 952 gc time: 114" "cpu time: 959 real time: 962 gc time: 132"))
("001011010" ("cpu time: 624 real time: 626 gc time: 112" "cpu time: 626 real time: 628 gc time: 118" "cpu time: 629 real time: 631 gc time: 115" "cpu time: 653 real time: 656 gc time: 137"))
("001011011" ("cpu time: 932 real time: 934 gc time: 111" "cpu time: 942 real time: 946 gc time: 124" "cpu time: 934 real time: 936 gc time: 111" "cpu time: 943 real time: 946 gc time: 116"))
("001011100" ("cpu time: 1105 real time: 1108 gc time: 142" "cpu time: 1108 real time: 1111 gc time: 153" "cpu time: 1102 real time: 1104 gc time: 147" "cpu time: 1099 real time: 1102 gc time: 144"))
("001011101" ("cpu time: 1388 real time: 1392 gc time: 133" "cpu time: 1392 real time: 1395 gc time: 145" "cpu time: 1394 real time: 1398 gc time: 146" "cpu time: 1437 real time: 1441 gc time: 156"))
("001011110" ("cpu time: 1098 real time: 1101 gc time: 148" "cpu time: 1099 real time: 1102 gc time: 139" "cpu time: 1093 real time: 1095 gc time: 150" "cpu time: 1118 real time: 1121 gc time: 158"))
("001011111" ("cpu time: 1395 real time: 1399 gc time: 147" "cpu time: 1408 real time: 1412 gc time: 138" "cpu time: 1380 real time: 1383 gc time: 142" "cpu time: 1420 real time: 1425 gc time: 144"))
("001100000" ("cpu time: 501 real time: 503 gc time: 87" "cpu time: 503 real time: 504 gc time: 88" "cpu time: 507 real time: 508 gc time: 91" "cpu time: 505 real time: 507 gc time: 88"))
("001100001" ("cpu time: 798 real time: 801 gc time: 84" "cpu time: 816 real time: 819 gc time: 97" "cpu time: 801 real time: 805 gc time: 90" "cpu time: 818 real time: 820 gc time: 102"))
("001100010" ("cpu time: 505 real time: 507 gc time: 87" "cpu time: 528 real time: 530 gc time: 105" "cpu time: 511 real time: 513 gc time: 91" "cpu time: 516 real time: 517 gc time: 92"))
("001100011" ("cpu time: 821 real time: 824 gc time: 93" "cpu time: 827 real time: 830 gc time: 105" "cpu time: 829 real time: 832 gc time: 93" "cpu time: 811 real time: 814 gc time: 93"))
("001100100" ("cpu time: 945 real time: 947 gc time: 108" "cpu time: 981 real time: 983 gc time: 109" "cpu time: 965 real time: 968 gc time: 116" "cpu time: 959 real time: 962 gc time: 120"))
("001100101" ("cpu time: 1230 real time: 1233 gc time: 112" "cpu time: 1247 real time: 1250 gc time: 109" "cpu time: 1248 real time: 1252 gc time: 131" "cpu time: 1272 real time: 1276 gc time: 119"))
("001100110" ("cpu time: 987 real time: 989 gc time: 109" "cpu time: 987 real time: 989 gc time: 137" "cpu time: 973 real time: 975 gc time: 119" "cpu time: 978 real time: 980 gc time: 121"))
("001100111" ("cpu time: 1242 real time: 1246 gc time: 121" "cpu time: 1247 real time: 1250 gc time: 117" "cpu time: 1242 real time: 1246 gc time: 119" "cpu time: 1270 real time: 1274 gc time: 122"))
("001101000" ("cpu time: 757 real time: 759 gc time: 136" "cpu time: 760 real time: 762 gc time: 146" "cpu time: 751 real time: 754 gc time: 126" "cpu time: 784 real time: 787 gc time: 163"))
("001101001" ("cpu time: 1045 real time: 1048 gc time: 135" "cpu time: 1026 real time: 1029 gc time: 131" "cpu time: 1051 real time: 1053 gc time: 136" "cpu time: 1053 real time: 1056 gc time: 135"))
("001101010" ("cpu time: 746 real time: 749 gc time: 132" "cpu time: 755 real time: 756 gc time: 135" "cpu time: 753 real time: 755 gc time: 134" "cpu time: 794 real time: 796 gc time: 164"))
("001101011" ("cpu time: 1022 real time: 1026 gc time: 120" "cpu time: 1011 real time: 1014 gc time: 121" "cpu time: 1052 real time: 1055 gc time: 143" "cpu time: 1027 real time: 1030 gc time: 123"))
("001101100" ("cpu time: 1406 real time: 1409 gc time: 279" "cpu time: 1266 real time: 1269 gc time: 162" "cpu time: 1384 real time: 1388 gc time: 274" "cpu time: 1274 real time: 1277 gc time: 165"))
("001101101" ("cpu time: 1526 real time: 1530 gc time: 166" "cpu time: 1558 real time: 1564 gc time: 187" "cpu time: 1680 real time: 1684 gc time: 273" "cpu time: 1546 real time: 1550 gc time: 158"))
("001101110" ("cpu time: 1374 real time: 1378 gc time: 264" "cpu time: 1342 real time: 1346 gc time: 159" "cpu time: 1415 real time: 1419 gc time: 275" "cpu time: 1438 real time: 1441 gc time: 281"))
("001101111" ("cpu time: 1549 real time: 1554 gc time: 163" "cpu time: 1531 real time: 1535 gc time: 171" "cpu time: 1703 real time: 1707 gc time: 277" "cpu time: 1525 real time: 1530 gc time: 159"))
("001110000" ("cpu time: 940 real time: 943 gc time: 164" "cpu time: 943 real time: 946 gc time: 141" "cpu time: 906 real time: 909 gc time: 147" "cpu time: 932 real time: 936 gc time: 167"))
("001110001" ("cpu time: 1189 real time: 1193 gc time: 145" "cpu time: 1183 real time: 1186 gc time: 132" "cpu time: 1221 real time: 1224 gc time: 125" "cpu time: 1219 real time: 1222 gc time: 132"))
("001110010" ("cpu time: 911 real time: 914 gc time: 158" "cpu time: 897 real time: 899 gc time: 144" "cpu time: 904 real time: 907 gc time: 146" "cpu time: 908 real time: 911 gc time: 138"))
("001110011" ("cpu time: 1190 real time: 1194 gc time: 138" "cpu time: 1193 real time: 1198 gc time: 136" "cpu time: 1220 real time: 1224 gc time: 141" "cpu time: 1250 real time: 1254 gc time: 146"))
("001110100" ("cpu time: 1614 real time: 1618 gc time: 276" "cpu time: 1519 real time: 1524 gc time: 168" "cpu time: 1489 real time: 1493 gc time: 165" "cpu time: 1491 real time: 1494 gc time: 169"))
("001110101" ("cpu time: 1792 real time: 1797 gc time: 167" "cpu time: 1792 real time: 1797 gc time: 164" "cpu time: 1810 real time: 1815 gc time: 164" "cpu time: 1844 real time: 1850 gc time: 171"))
("001110110" ("cpu time: 1506 real time: 1510 gc time: 159" "cpu time: 1636 real time: 1641 gc time: 280" "cpu time: 1511 real time: 1516 gc time: 178" "cpu time: 1616 real time: 1620 gc time: 278"))
("001110111" ("cpu time: 1778 real time: 1783 gc time: 166" "cpu time: 1794 real time: 1799 gc time: 168" "cpu time: 1782 real time: 1787 gc time: 174" "cpu time: 1815 real time: 1820 gc time: 162"))
("001111000" ("cpu time: 644 real time: 646 gc time: 119" "cpu time: 647 real time: 649 gc time: 111" "cpu time: 657 real time: 659 gc time: 124" "cpu time: 640 real time: 642 gc time: 115"))
("001111001" ("cpu time: 934 real time: 938 gc time: 110" "cpu time: 942 real time: 945 gc time: 110" "cpu time: 932 real time: 935 gc time: 107" "cpu time: 949 real time: 952 gc time: 112"))
("001111010" ("cpu time: 634 real time: 636 gc time: 113" "cpu time: 643 real time: 645 gc time: 115" "cpu time: 633 real time: 634 gc time: 114" "cpu time: 659 real time: 661 gc time: 133"))
("001111011" ("cpu time: 943 real time: 946 gc time: 113" "cpu time: 924 real time: 927 gc time: 110" "cpu time: 932 real time: 935 gc time: 111" "cpu time: 948 real time: 950 gc time: 113"))
("001111100" ("cpu time: 1097 real time: 1099 gc time: 135" "cpu time: 1082 real time: 1085 gc time: 141" "cpu time: 1105 real time: 1107 gc time: 149" "cpu time: 1095 real time: 1097 gc time: 153"))
("001111101" ("cpu time: 1366 real time: 1370 gc time: 146" "cpu time: 1359 real time: 1363 gc time: 138" "cpu time: 1422 real time: 1425 gc time: 164" "cpu time: 1387 real time: 1391 gc time: 140"))
("001111110" ("cpu time: 1084 real time: 1087 gc time: 146" "cpu time: 1091 real time: 1094 gc time: 157" "cpu time: 1097 real time: 1100 gc time: 148" "cpu time: 1079 real time: 1082 gc time: 144"))
("001111111" ("cpu time: 1387 real time: 1391 gc time: 142" "cpu time: 1364 real time: 1367 gc time: 149" "cpu time: 1372 real time: 1376 gc time: 142" "cpu time: 1398 real time: 1402 gc time: 164"))
("010000000" ("cpu time: 464 real time: 465 gc time: 66" "cpu time: 463 real time: 464 gc time: 68" "cpu time: 456 real time: 458 gc time: 65" "cpu time: 459 real time: 460 gc time: 64"))
("010000001" ("cpu time: 784 real time: 785 gc time: 86" "cpu time: 799 real time: 802 gc time: 89" "cpu time: 779 real time: 781 gc time: 86" "cpu time: 800 real time: 804 gc time: 93"))
("010000010" ("cpu time: 488 real time: 490 gc time: 86" "cpu time: 494 real time: 495 gc time: 90" "cpu time: 510 real time: 512 gc time: 107" "cpu time: 501 real time: 502 gc time: 93"))
("010000011" ("cpu time: 804 real time: 807 gc time: 103" "cpu time: 791 real time: 793 gc time: 85" "cpu time: 794 real time: 797 gc time: 87" "cpu time: 794 real time: 797 gc time: 90"))
("010000100" ("cpu time: 757 real time: 759 gc time: 117" "cpu time: 748 real time: 751 gc time: 111" "cpu time: 776 real time: 779 gc time: 119" "cpu time: 746 real time: 748 gc time: 111"))
("010000101" ("cpu time: 1024 real time: 1027 gc time: 114" "cpu time: 1036 real time: 1039 gc time: 119" "cpu time: 1025 real time: 1029 gc time: 119" "cpu time: 1057 real time: 1060 gc time: 113"))
("010000110" ("cpu time: 766 real time: 768 gc time: 120" "cpu time: 777 real time: 779 gc time: 124" "cpu time: 771 real time: 773 gc time: 120" "cpu time: 767 real time: 770 gc time: 128"))
("010000111" ("cpu time: 1051 real time: 1054 gc time: 116" "cpu time: 1061 real time: 1064 gc time: 111" "cpu time: 1039 real time: 1042 gc time: 116" "cpu time: 1029 real time: 1032 gc time: 112"))
("010001000" ("cpu time: 749 real time: 752 gc time: 140" "cpu time: 748 real time: 750 gc time: 131" "cpu time: 749 real time: 752 gc time: 134" "cpu time: 766 real time: 768 gc time: 159"))
("010001001" ("cpu time: 1012 real time: 1015 gc time: 124" "cpu time: 1016 real time: 1020 gc time: 124" "cpu time: 1028 real time: 1031 gc time: 130" "cpu time: 1049 real time: 1052 gc time: 140"))
("010001010" ("cpu time: 733 real time: 735 gc time: 136" "cpu time: 738 real time: 740 gc time: 138" "cpu time: 758 real time: 761 gc time: 157" "cpu time: 762 real time: 764 gc time: 152"))
("010001011" ("cpu time: 1024 real time: 1028 gc time: 127" "cpu time: 1030 real time: 1033 gc time: 131" "cpu time: 1036 real time: 1040 gc time: 132" "cpu time: 1025 real time: 1028 gc time: 127"))
("010001100" ("cpu time: 1067 real time: 1070 gc time: 161" "cpu time: 1195 real time: 1199 gc time: 273" "cpu time: 1189 real time: 1192 gc time: 288" "cpu time: 1054 real time: 1057 gc time: 160"))
("010001101" ("cpu time: 1492 real time: 1497 gc time: 290" "cpu time: 1328 real time: 1333 gc time: 166" "cpu time: 1318 real time: 1322 gc time: 163" "cpu time: 1496 real time: 1501 gc time: 290"))
("010001110" ("cpu time: 1221 real time: 1225 gc time: 262" "cpu time: 1062 real time: 1066 gc time: 160" "cpu time: 1076 real time: 1079 gc time: 175" "cpu time: 1209 real time: 1213 gc time: 275"))
("010001111" ("cpu time: 1334 real time: 1338 gc time: 175" "cpu time: 1352 real time: 1356 gc time: 162" "cpu time: 1335 real time: 1339 gc time: 163" "cpu time: 1330 real time: 1333 gc time: 165"))
("010010000" ("cpu time: 1021 real time: 1023 gc time: 271" "cpu time: 895 real time: 898 gc time: 160" "cpu time: 889 real time: 891 gc time: 155" "cpu time: 917 real time: 920 gc time: 161"))
("010010001" ("cpu time: 1178 real time: 1182 gc time: 151" "cpu time: 1214 real time: 1218 gc time: 143" "cpu time: 1201 real time: 1205 gc time: 151" "cpu time: 1230 real time: 1233 gc time: 142"))
("010010010" ("cpu time: 1008 real time: 1010 gc time: 266" "cpu time: 884 real time: 887 gc time: 151" "cpu time: 909 real time: 912 gc time: 166" "cpu time: 1030 real time: 1033 gc time: 277"))
("010010011" ("cpu time: 1200 real time: 1204 gc time: 150" "cpu time: 1212 real time: 1216 gc time: 149" "cpu time: 1217 real time: 1221 gc time: 151" "cpu time: 1228 real time: 1232 gc time: 143"))
("010010100" ("cpu time: 1296 real time: 1300 gc time: 158" "cpu time: 1315 real time: 1320 gc time: 184" "cpu time: 1438 real time: 1442 gc time: 279" "cpu time: 1424 real time: 1428 gc time: 279"))
("010010101" ("cpu time: 1553 real time: 1558 gc time: 159" "cpu time: 1565 real time: 1569 gc time: 168" "cpu time: 1611 real time: 1616 gc time: 167" "cpu time: 1612 real time: 1617 gc time: 159"))
("010010110" ("cpu time: 1366 real time: 1371 gc time: 181" "cpu time: 1315 real time: 1319 gc time: 177" "cpu time: 1307 real time: 1311 gc time: 166" "cpu time: 1455 real time: 1459 gc time: 287"))
("010010111" ("cpu time: 1565 real time: 1571 gc time: 162" "cpu time: 1572 real time: 1577 gc time: 168" "cpu time: 1607 real time: 1613 gc time: 172" "cpu time: 1603 real time: 1608 gc time: 171"))
("010011000" ("cpu time: 638 real time: 639 gc time: 118" "cpu time: 649 real time: 651 gc time: 127" "cpu time: 630 real time: 631 gc time: 111" "cpu time: 639 real time: 641 gc time: 123"))
("010011001" ("cpu time: 937 real time: 940 gc time: 113" "cpu time: 937 real time: 940 gc time: 122" "cpu time: 933 real time: 936 gc time: 114" "cpu time: 927 real time: 929 gc time: 111"))
("010011010" ("cpu time: 631 real time: 633 gc time: 114" "cpu time: 634 real time: 636 gc time: 121" "cpu time: 625 real time: 626 gc time: 111" "cpu time: 629 real time: 632 gc time: 115"))
("010011011" ("cpu time: 925 real time: 928 gc time: 109" "cpu time: 940 real time: 942 gc time: 107" "cpu time: 933 real time: 936 gc time: 106" "cpu time: 930 real time: 933 gc time: 112"))
("010011100" ("cpu time: 887 real time: 890 gc time: 145" "cpu time: 886 real time: 888 gc time: 147" "cpu time: 893 real time: 896 gc time: 144" "cpu time: 911 real time: 913 gc time: 155"))
("010011101" ("cpu time: 1175 real time: 1178 gc time: 147" "cpu time: 1201 real time: 1205 gc time: 164" "cpu time: 1177 real time: 1180 gc time: 149" "cpu time: 1162 real time: 1165 gc time: 134"))
("010011110" ("cpu time: 879 real time: 881 gc time: 148" "cpu time: 886 real time: 889 gc time: 144" "cpu time: 888 real time: 890 gc time: 146" "cpu time: 898 real time: 900 gc time: 148"))
("010011111" ("cpu time: 1204 real time: 1207 gc time: 165" "cpu time: 1201 real time: 1204 gc time: 145" "cpu time: 1182 real time: 1185 gc time: 152" "cpu time: 1187 real time: 1191 gc time: 154"))
("010100000" ("cpu time: 556 real time: 557 gc time: 85" "cpu time: 565 real time: 567 gc time: 91" "cpu time: 561 real time: 562 gc time: 86" "cpu time: 559 real time: 560 gc time: 82"))
("010100001" ("cpu time: 863 real time: 865 gc time: 87" "cpu time: 876 real time: 878 gc time: 99" "cpu time: 856 real time: 860 gc time: 86" "cpu time: 856 real time: 860 gc time: 88"))
("010100010" ("cpu time: 556 real time: 558 gc time: 86" "cpu time: 563 real time: 565 gc time: 85" "cpu time: 567 real time: 568 gc time: 95" "cpu time: 580 real time: 581 gc time: 86"))
("010100011" ("cpu time: 860 real time: 862 gc time: 89" "cpu time: 869 real time: 872 gc time: 87" "cpu time: 865 real time: 867 gc time: 88" "cpu time: 887 real time: 891 gc time: 107"))
("010100100" ("cpu time: 797 real time: 800 gc time: 116" "cpu time: 816 real time: 819 gc time: 135" "cpu time: 811 real time: 814 gc time: 116" "cpu time: 813 real time: 815 gc time: 121"))
("010100101" ("cpu time: 1063 real time: 1067 gc time: 115" "cpu time: 1097 real time: 1101 gc time: 132" "cpu time: 1074 real time: 1077 gc time: 117" "cpu time: 1081 real time: 1085 gc time: 130"))
("010100110" ("cpu time: 795 real time: 797 gc time: 115" "cpu time: 805 real time: 807 gc time: 114" "cpu time: 811 real time: 814 gc time: 120" "cpu time: 817 real time: 821 gc time: 120"))
("010100111" ("cpu time: 1090 real time: 1093 gc time: 132" "cpu time: 1067 real time: 1071 gc time: 118" "cpu time: 1105 real time: 1108 gc time: 117" "cpu time: 1077 real time: 1079 gc time: 116"))
("010101000" ("cpu time: 811 real time: 813 gc time: 130" "cpu time: 858 real time: 860 gc time: 159" "cpu time: 846 real time: 848 gc time: 146" "cpu time: 855 real time: 858 gc time: 144"))
("010101001" ("cpu time: 1105 real time: 1109 gc time: 131" "cpu time: 1095 real time: 1099 gc time: 130" "cpu time: 1127 real time: 1131 gc time: 135" "cpu time: 1123 real time: 1127 gc time: 145"))
("010101010" ("cpu time: 808 real time: 810 gc time: 131" "cpu time: 830 real time: 832 gc time: 143" "cpu time: 832 real time: 834 gc time: 147" "cpu time: 824 real time: 827 gc time: 141"))
("010101011" ("cpu time: 1105 real time: 1108 gc time: 129" "cpu time: 1133 real time: 1136 gc time: 149" "cpu time: 1104 real time: 1107 gc time: 129" "cpu time: 1108 real time: 1111 gc time: 128"))
("010101100" ("cpu time: 1118 real time: 1122 gc time: 164" "cpu time: 1219 real time: 1222 gc time: 271" "cpu time: 1117 real time: 1121 gc time: 159" "cpu time: 1259 real time: 1263 gc time: 274"))
("010101101" ("cpu time: 1427 real time: 1431 gc time: 168" "cpu time: 1372 real time: 1376 gc time: 154" "cpu time: 1373 real time: 1377 gc time: 162" "cpu time: 1376 real time: 1380 gc time: 171"))
("010101110" ("cpu time: 1237 real time: 1240 gc time: 279" "cpu time: 1244 real time: 1247 gc time: 287" "cpu time: 1258 real time: 1261 gc time: 297" "cpu time: 1109 real time: 1113 gc time: 166"))
("010101111" ("cpu time: 1524 real time: 1529 gc time: 289" "cpu time: 1355 real time: 1360 gc time: 163" "cpu time: 1517 real time: 1521 gc time: 284" "cpu time: 1509 real time: 1513 gc time: 277"))
("010110000" ("cpu time: 975 real time: 978 gc time: 156" "cpu time: 963 real time: 965 gc time: 152" "cpu time: 1002 real time: 1005 gc time: 159" "cpu time: 982 real time: 986 gc time: 156"))
("010110001" ("cpu time: 1278 real time: 1282 gc time: 144" "cpu time: 1250 real time: 1254 gc time: 133" "cpu time: 1277 real time: 1281 gc time: 155" "cpu time: 1261 real time: 1265 gc time: 144"))
("010110010" ("cpu time: 1095 real time: 1098 gc time: 266" "cpu time: 998 real time: 1001 gc time: 178" "cpu time: 978 real time: 981 gc time: 170" "cpu time: 1106 real time: 1109 gc time: 282"))
("010110011" ("cpu time: 1269 real time: 1273 gc time: 149" "cpu time: 1274 real time: 1277 gc time: 155" "cpu time: 1269 real time: 1272 gc time: 145" "cpu time: 1260 real time: 1265 gc time: 149"))
("010110100" ("cpu time: 1458 real time: 1462 gc time: 276" "cpu time: 1487 real time: 1492 gc time: 281" "cpu time: 1320 real time: 1323 gc time: 162" "cpu time: 1331 real time: 1335 gc time: 166"))
("010110101" ("cpu time: 1605 real time: 1610 gc time: 161" "cpu time: 1615 real time: 1620 gc time: 168" "cpu time: 1619 real time: 1625 gc time: 173" "cpu time: 1627 real time: 1632 gc time: 168"))
("010110110" ("cpu time: 1470 real time: 1476 gc time: 274" "cpu time: 1460 real time: 1464 gc time: 274" "cpu time: 1544 real time: 1548 gc time: 279" "cpu time: 1468 real time: 1473 gc time: 279"))
("010110111" ("cpu time: 1638 real time: 1643 gc time: 158" "cpu time: 1648 real time: 1653 gc time: 190" "cpu time: 1620 real time: 1626 gc time: 164" "cpu time: 1614 real time: 1619 gc time: 180"))
("010111000" ("cpu time: 712 real time: 714 gc time: 111" "cpu time: 691 real time: 693 gc time: 107" "cpu time: 718 real time: 720 gc time: 120" "cpu time: 707 real time: 709 gc time: 118"))
("010111001" ("cpu time: 1007 real time: 1010 gc time: 116" "cpu time: 1028 real time: 1031 gc time: 130" "cpu time: 993 real time: 996 gc time: 104" "cpu time: 1000 real time: 1003 gc time: 109"))
("010111010" ("cpu time: 715 real time: 717 gc time: 113" "cpu time: 719 real time: 722 gc time: 116" "cpu time: 696 real time: 699 gc time: 112" "cpu time: 731 real time: 733 gc time: 135"))
("010111011" ("cpu time: 1032 real time: 1036 gc time: 129" "cpu time: 1020 real time: 1023 gc time: 129" "cpu time: 1012 real time: 1015 gc time: 112" "cpu time: 1013 real time: 1015 gc time: 113"))
("010111100" ("cpu time: 936 real time: 938 gc time: 152" "cpu time: 939 real time: 942 gc time: 156" "cpu time: 957 real time: 960 gc time: 163" "cpu time: 942 real time: 945 gc time: 155"))
("010111101" ("cpu time: 1227 real time: 1230 gc time: 149" "cpu time: 1233 real time: 1238 gc time: 139" "cpu time: 1229 real time: 1233 gc time: 141" "cpu time: 1207 real time: 1211 gc time: 146"))
("010111110" ("cpu time: 924 real time: 926 gc time: 149" "cpu time: 945 real time: 947 gc time: 167" "cpu time: 1083 real time: 1087 gc time: 268" "cpu time: 936 real time: 939 gc time: 149"))
("010111111" ("cpu time: 1243 real time: 1247 gc time: 147" "cpu time: 1219 real time: 1223 gc time: 137" "cpu time: 1247 real time: 1251 gc time: 139" "cpu time: 1220 real time: 1224 gc time: 132"))
("011000000" ("cpu time: 511 real time: 512 gc time: 106" "cpu time: 495 real time: 496 gc time: 90" "cpu time: 489 real time: 489 gc time: 88" "cpu time: 491 real time: 492 gc time: 90"))
("011000001" ("cpu time: 788 real time: 790 gc time: 88" "cpu time: 813 real time: 815 gc time: 92" "cpu time: 795 real time: 797 gc time: 92" "cpu time: 827 real time: 829 gc time: 111"))
("011000010" ("cpu time: 499 real time: 500 gc time: 92" "cpu time: 515 real time: 517 gc time: 107" "cpu time: 516 real time: 517 gc time: 107" "cpu time: 510 real time: 511 gc time: 97"))
("011000011" ("cpu time: 807 real time: 809 gc time: 92" "cpu time: 826 real time: 829 gc time: 106" "cpu time: 818 real time: 821 gc time: 92" "cpu time: 799 real time: 801 gc time: 91"))
("011000100" ("cpu time: 766 real time: 769 gc time: 117" "cpu time: 764 real time: 766 gc time: 114" "cpu time: 786 real time: 788 gc time: 122" "cpu time: 801 real time: 804 gc time: 140"))
("011000101" ("cpu time: 1059 real time: 1062 gc time: 122" "cpu time: 1054 real time: 1058 gc time: 136" "cpu time: 1041 real time: 1045 gc time: 118" "cpu time: 1048 real time: 1051 gc time: 114"))
("011000110" ("cpu time: 776 real time: 778 gc time: 118" "cpu time: 768 real time: 770 gc time: 119" "cpu time: 763 real time: 766 gc time: 115" "cpu time: 776 real time: 778 gc time: 122"))
("011000111" ("cpu time: 1065 real time: 1069 gc time: 119" "cpu time: 1053 real time: 1057 gc time: 122" "cpu time: 1058 real time: 1062 gc time: 133" "cpu time: 1057 real time: 1061 gc time: 137"))
("011001000" ("cpu time: 762 real time: 764 gc time: 156" "cpu time: 758 real time: 759 gc time: 145" "cpu time: 746 real time: 748 gc time: 141" "cpu time: 747 real time: 749 gc time: 135"))
("011001001" ("cpu time: 1037 real time: 1041 gc time: 138" "cpu time: 1041 real time: 1045 gc time: 139" "cpu time: 1027 real time: 1029 gc time: 132" "cpu time: 1036 real time: 1039 gc time: 131"))
("011001010" ("cpu time: 751 real time: 753 gc time: 138" "cpu time: 769 real time: 771 gc time: 157" "cpu time: 756 real time: 758 gc time: 158" "cpu time: 743 real time: 744 gc time: 139"))
("011001011" ("cpu time: 1047 real time: 1050 gc time: 134" "cpu time: 1043 real time: 1046 gc time: 149" "cpu time: 1020 real time: 1023 gc time: 126" "cpu time: 1038 real time: 1041 gc time: 133"))
("011001100" ("cpu time: 1210 real time: 1213 gc time: 282" "cpu time: 1229 real time: 1233 gc time: 298" "cpu time: 1181 real time: 1184 gc time: 270" "cpu time: 1226 real time: 1229 gc time: 315"))
("011001101" ("cpu time: 1454 real time: 1458 gc time: 272" "cpu time: 1348 real time: 1352 gc time: 165" "cpu time: 1371 real time: 1375 gc time: 160" "cpu time: 1377 real time: 1381 gc time: 170"))
("011001110" ("cpu time: 1060 real time: 1063 gc time: 167" "cpu time: 1189 real time: 1193 gc time: 276" "cpu time: 1230 real time: 1234 gc time: 278" "cpu time: 1183 real time: 1186 gc time: 281"))
("011001111" ("cpu time: 1480 real time: 1484 gc time: 289" "cpu time: 1467 real time: 1471 gc time: 281" "cpu time: 1462 real time: 1466 gc time: 270" "cpu time: 1329 real time: 1333 gc time: 168"))
("011010000" ("cpu time: 898 real time: 901 gc time: 156" "cpu time: 892 real time: 894 gc time: 148" "cpu time: 892 real time: 895 gc time: 148" "cpu time: 907 real time: 909 gc time: 164"))
("011010001" ("cpu time: 1191 real time: 1195 gc time: 138" "cpu time: 1212 real time: 1216 gc time: 151" "cpu time: 1170 real time: 1173 gc time: 130" "cpu time: 1158 real time: 1162 gc time: 127"))
("011010010" ("cpu time: 880 real time: 883 gc time: 140" "cpu time: 899 real time: 901 gc time: 150" "cpu time: 917 real time: 920 gc time: 145" "cpu time: 905 real time: 908 gc time: 151"))
("011010011" ("cpu time: 1193 real time: 1197 gc time: 141" "cpu time: 1219 real time: 1222 gc time: 142" "cpu time: 1200 real time: 1204 gc time: 130" "cpu time: 1216 real time: 1221 gc time: 161"))
("011010100" ("cpu time: 1426 real time: 1430 gc time: 300" "cpu time: 1435 real time: 1439 gc time: 274" "cpu time: 1446 real time: 1450 gc time: 296" "cpu time: 1326 real time: 1330 gc time: 179"))
("011010101" ("cpu time: 1729 real time: 1734 gc time: 283" "cpu time: 1568 real time: 1572 gc time: 165" "cpu time: 1574 real time: 1579 gc time: 163" "cpu time: 1590 real time: 1595 gc time: 171"))
("011010110" ("cpu time: 1329 real time: 1334 gc time: 168" "cpu time: 1416 real time: 1420 gc time: 285" "cpu time: 1456 real time: 1459 gc time: 280" "cpu time: 1444 real time: 1449 gc time: 272"))
("011010111" ("cpu time: 1782 real time: 1788 gc time: 280" "cpu time: 1612 real time: 1616 gc time: 169" "cpu time: 1578 real time: 1583 gc time: 168" "cpu time: 1631 real time: 1637 gc time: 168"))
("011011000" ("cpu time: 635 real time: 637 gc time: 116" "cpu time: 625 real time: 626 gc time: 114" "cpu time: 639 real time: 640 gc time: 124" "cpu time: 634 real time: 636 gc time: 118"))
("011011001" ("cpu time: 939 real time: 941 gc time: 117" "cpu time: 934 real time: 937 gc time: 114" "cpu time: 952 real time: 955 gc time: 132" "cpu time: 933 real time: 936 gc time: 111"))
("011011010" ("cpu time: 619 real time: 620 gc time: 109" "cpu time: 631 real time: 632 gc time: 115" "cpu time: 629 real time: 630 gc time: 117" "cpu time: 641 real time: 643 gc time: 117"))
("011011011" ("cpu time: 924 real time: 927 gc time: 112" "cpu time: 935 real time: 938 gc time: 114" "cpu time: 920 real time: 922 gc time: 110" "cpu time: 933 real time: 936 gc time: 111"))
("011011100" ("cpu time: 882 real time: 885 gc time: 136" "cpu time: 885 real time: 888 gc time: 144" "cpu time: 883 real time: 885 gc time: 143" "cpu time: 904 real time: 907 gc time: 157"))
("011011101" ("cpu time: 1194 real time: 1198 gc time: 134" "cpu time: 1183 real time: 1187 gc time: 137" "cpu time: 1212 real time: 1216 gc time: 161" "cpu time: 1181 real time: 1185 gc time: 142"))
("011011110" ("cpu time: 901 real time: 904 gc time: 153" "cpu time: 892 real time: 895 gc time: 154" "cpu time: 854 real time: 856 gc time: 132" "cpu time: 869 real time: 872 gc time: 141"))
("011011111" ("cpu time: 1173 real time: 1177 gc time: 142" "cpu time: 1174 real time: 1178 gc time: 139" "cpu time: 1175 real time: 1178 gc time: 146" "cpu time: 1229 real time: 1232 gc time: 138"))
("011100000" ("cpu time: 518 real time: 519 gc time: 103" "cpu time: 510 real time: 511 gc time: 93" "cpu time: 517 real time: 519 gc time: 103" "cpu time: 514 real time: 516 gc time: 95"))
("011100001" ("cpu time: 812 real time: 814 gc time: 93" "cpu time: 820 real time: 823 gc time: 89" "cpu time: 810 real time: 813 gc time: 94" "cpu time: 814 real time: 817 gc time: 97"))
("011100010" ("cpu time: 508 real time: 510 gc time: 89" "cpu time: 531 real time: 532 gc time: 105" "cpu time: 510 real time: 511 gc time: 90" "cpu time: 510 real time: 512 gc time: 90"))
("011100011" ("cpu time: 809 real time: 811 gc time: 91" "cpu time: 815 real time: 817 gc time: 96" "cpu time: 814 real time: 816 gc time: 95" "cpu time: 820 real time: 823 gc time: 95"))
("011100100" ("cpu time: 759 real time: 761 gc time: 129" "cpu time: 740 real time: 741 gc time: 122" "cpu time: 769 real time: 771 gc time: 124" "cpu time: 764 real time: 766 gc time: 124"))
("011100101" ("cpu time: 996 real time: 1000 gc time: 109" "cpu time: 1020 real time: 1024 gc time: 120" "cpu time: 1018 real time: 1021 gc time: 120" "cpu time: 1000 real time: 1003 gc time: 113"))
("011100110" ("cpu time: 763 real time: 765 gc time: 122" "cpu time: 773 real time: 775 gc time: 124" "cpu time: 753 real time: 755 gc time: 115" "cpu time: 755 real time: 757 gc time: 125"))
("011100111" ("cpu time: 1010 real time: 1013 gc time: 114" "cpu time: 995 real time: 999 gc time: 110" "cpu time: 1020 real time: 1024 gc time: 116" "cpu time: 1024 real time: 1027 gc time: 125"))
("011101000" ("cpu time: 774 real time: 776 gc time: 146" "cpu time: 771 real time: 773 gc time: 148" "cpu time: 768 real time: 771 gc time: 136" "cpu time: 792 real time: 795 gc time: 156"))
("011101001" ("cpu time: 1045 real time: 1048 gc time: 133" "cpu time: 1027 real time: 1030 gc time: 126" "cpu time: 1044 real time: 1046 gc time: 130" "cpu time: 1066 real time: 1068 gc time: 155"))
("011101010" ("cpu time: 746 real time: 749 gc time: 133" "cpu time: 772 real time: 774 gc time: 139" "cpu time: 764 real time: 766 gc time: 148" "cpu time: 763 real time: 764 gc time: 136"))
("011101011" ("cpu time: 1029 real time: 1032 gc time: 135" "cpu time: 1037 real time: 1041 gc time: 125" "cpu time: 1050 real time: 1054 gc time: 130" "cpu time: 1036 real time: 1038 gc time: 128"))
("011101100" ("cpu time: 1040 real time: 1044 gc time: 170" "cpu time: 1155 real time: 1158 gc time: 276" "cpu time: 1209 real time: 1213 gc time: 308" "cpu time: 1186 real time: 1190 gc time: 280"))
("011101101" ("cpu time: 1454 real time: 1458 gc time: 286" "cpu time: 1448 real time: 1452 gc time: 289" "cpu time: 1346 real time: 1350 gc time: 171" "cpu time: 1455 real time: 1459 gc time: 287"))
("011101110" ("cpu time: 1151 real time: 1155 gc time: 274" "cpu time: 1051 real time: 1054 gc time: 166" "cpu time: 1166 real time: 1170 gc time: 284" "cpu time: 1173 real time: 1176 gc time: 273"))
("011101111" ("cpu time: 1448 real time: 1452 gc time: 278" "cpu time: 1311 real time: 1315 gc time: 162" "cpu time: 1428 real time: 1432 gc time: 278" "cpu time: 1308 real time: 1312 gc time: 164"))
("011110000" ("cpu time: 902 real time: 906 gc time: 150" "cpu time: 894 real time: 897 gc time: 141" "cpu time: 917 real time: 919 gc time: 145" "cpu time: 884 real time: 886 gc time: 147"))
("011110001" ("cpu time: 1185 real time: 1188 gc time: 140" "cpu time: 1192 real time: 1196 gc time: 135" "cpu time: 1202 real time: 1206 gc time: 155" "cpu time: 1186 real time: 1189 gc time: 131"))
("011110010" ("cpu time: 920 real time: 922 gc time: 149" "cpu time: 906 real time: 908 gc time: 147" "cpu time: 931 real time: 932 gc time: 168" "cpu time: 913 real time: 916 gc time: 141"))
("011110011" ("cpu time: 1196 real time: 1201 gc time: 135" "cpu time: 1227 real time: 1231 gc time: 123" "cpu time: 1214 real time: 1219 gc time: 139" "cpu time: 1179 real time: 1183 gc time: 134"))
("011110100" ("cpu time: 1408 real time: 1412 gc time: 285" "cpu time: 1259 real time: 1263 gc time: 164" "cpu time: 1278 real time: 1282 gc time: 160" "cpu time: 1416 real time: 1421 gc time: 293"))
("011110101" ("cpu time: 1586 real time: 1591 gc time: 162" "cpu time: 1562 real time: 1566 gc time: 164" "cpu time: 1541 real time: 1546 gc time: 168" "cpu time: 1699 real time: 1706 gc time: 270"))
("011110110" ("cpu time: 1390 real time: 1394 gc time: 271" "cpu time: 1396 real time: 1400 gc time: 280" "cpu time: 1413 real time: 1416 gc time: 275" "cpu time: 1435 real time: 1439 gc time: 292"))
("011110111" ("cpu time: 1592 real time: 1597 gc time: 164" "cpu time: 1536 real time: 1541 gc time: 160" "cpu time: 1546 real time: 1551 gc time: 167" "cpu time: 1582 real time: 1587 gc time: 165"))
("011111000" ("cpu time: 640 real time: 642 gc time: 117" "cpu time: 642 real time: 644 gc time: 115" "cpu time: 629 real time: 631 gc time: 109" "cpu time: 621 real time: 623 gc time: 108"))
("011111001" ("cpu time: 937 real time: 940 gc time: 107" "cpu time: 948 real time: 951 gc time: 115" "cpu time: 938 real time: 941 gc time: 106" "cpu time: 941 real time: 944 gc time: 114"))
("011111010" ("cpu time: 632 real time: 634 gc time: 110" "cpu time: 635 real time: 637 gc time: 110" "cpu time: 636 real time: 639 gc time: 113" "cpu time: 635 real time: 637 gc time: 113"))
("011111011" ("cpu time: 934 real time: 938 gc time: 115" "cpu time: 942 real time: 945 gc time: 115" "cpu time: 950 real time: 953 gc time: 118" "cpu time: 948 real time: 952 gc time: 127"))
("011111100" ("cpu time: 867 real time: 869 gc time: 151" "cpu time: 866 real time: 867 gc time: 148" "cpu time: 901 real time: 903 gc time: 165" "cpu time: 865 real time: 867 gc time: 150"))
("011111101" ("cpu time: 1152 real time: 1155 gc time: 147" "cpu time: 1139 real time: 1142 gc time: 141" "cpu time: 1146 real time: 1150 gc time: 144" "cpu time: 1200 real time: 1204 gc time: 142"))
("011111110" ("cpu time: 857 real time: 859 gc time: 142" "cpu time: 871 real time: 873 gc time: 152" "cpu time: 859 real time: 862 gc time: 142" "cpu time: 881 real time: 884 gc time: 153"))
("011111111" ("cpu time: 1143 real time: 1147 gc time: 137" "cpu time: 1140 real time: 1143 gc time: 127" "cpu time: 1179 real time: 1182 gc time: 148" "cpu time: 1167 real time: 1170 gc time: 165"))
("100000000" ("cpu time: 1265 real time: 1269 gc time: 128" "cpu time: 1260 real time: 1263 gc time: 134" "cpu time: 1268 real time: 1271 gc time: 151" "cpu time: 1241 real time: 1244 gc time: 128"))
("100000001" ("cpu time: 995 real time: 997 gc time: 142" "cpu time: 970 real time: 973 gc time: 135" "cpu time: 989 real time: 991 gc time: 137" "cpu time: 975 real time: 978 gc time: 135"))
("100000010" ("cpu time: 1251 real time: 1255 gc time: 133" "cpu time: 1270 real time: 1274 gc time: 134" "cpu time: 1263 real time: 1267 gc time: 129" "cpu time: 1306 real time: 1311 gc time: 146"))
("100000011" ("cpu time: 1000 real time: 1004 gc time: 154" "cpu time: 994 real time: 997 gc time: 148" "cpu time: 982 real time: 985 gc time: 152" "cpu time: 987 real time: 989 gc time: 138"))
("100000100" ("cpu time: 1267 real time: 1270 gc time: 111" "cpu time: 1263 real time: 1267 gc time: 106" "cpu time: 1249 real time: 1252 gc time: 109" "cpu time: 1249 real time: 1252 gc time: 108"))
("100000101" ("cpu time: 931 real time: 933 gc time: 101" "cpu time: 951 real time: 954 gc time: 110" "cpu time: 945 real time: 948 gc time: 108" "cpu time: 947 real time: 950 gc time: 110"))
("100000110" ("cpu time: 1264 real time: 1268 gc time: 107" "cpu time: 1255 real time: 1259 gc time: 109" "cpu time: 1240 real time: 1243 gc time: 101" "cpu time: 1252 real time: 1255 gc time: 108"))
("100000111" ("cpu time: 961 real time: 963 gc time: 110" "cpu time: 944 real time: 947 gc time: 103" "cpu time: 962 real time: 965 gc time: 123" "cpu time: 942 real time: 945 gc time: 107"))
("100001000" ("cpu time: 1740 real time: 1745 gc time: 292" "cpu time: 1732 real time: 1738 gc time: 273" "cpu time: 1752 real time: 1757 gc time: 292" "cpu time: 1758 real time: 1764 gc time: 282"))
("100001001" ("cpu time: 1484 real time: 1488 gc time: 287" "cpu time: 1478 real time: 1482 gc time: 298" "cpu time: 1447 real time: 1451 gc time: 276" "cpu time: 1488 real time: 1492 gc time: 312"))
("100001010" ("cpu time: 1731 real time: 1737 gc time: 289" "cpu time: 1722 real time: 1727 gc time: 286" "cpu time: 1744 real time: 1749 gc time: 273" "cpu time: 1739 real time: 1744 gc time: 273"))
("100001011" ("cpu time: 1478 real time: 1482 gc time: 285" "cpu time: 1491 real time: 1495 gc time: 284" "cpu time: 1437 real time: 1441 gc time: 293" "cpu time: 1461 real time: 1465 gc time: 292"))
("100001100" ("cpu time: 1537 real time: 1542 gc time: 155" "cpu time: 1490 real time: 1495 gc time: 144" "cpu time: 1497 real time: 1501 gc time: 149" "cpu time: 1501 real time: 1505 gc time: 158"))
("100001101" ("cpu time: 1226 real time: 1229 gc time: 137" "cpu time: 1209 real time: 1213 gc time: 154" "cpu time: 1212 real time: 1216 gc time: 153" "cpu time: 1221 real time: 1224 gc time: 146"))
("100001110" ("cpu time: 1509 real time: 1513 gc time: 152" "cpu time: 1500 real time: 1504 gc time: 154" "cpu time: 1514 real time: 1517 gc time: 166" "cpu time: 1525 real time: 1529 gc time: 153"))
("100001111" ("cpu time: 1195 real time: 1198 gc time: 153" "cpu time: 1217 real time: 1221 gc time: 141" "cpu time: 1203 real time: 1206 gc time: 168" "cpu time: 1203 real time: 1207 gc time: 156"))
("100010000" ("cpu time: 1385 real time: 1390 gc time: 165" "cpu time: 1396 real time: 1401 gc time: 169" "cpu time: 1414 real time: 1418 gc time: 187" "cpu time: 1427 real time: 1432 gc time: 182"))
("100010001" ("cpu time: 1328 real time: 1332 gc time: 300" "cpu time: 1251 real time: 1255 gc time: 276" "cpu time: 1263 real time: 1267 gc time: 292" "cpu time: 1128 real time: 1132 gc time: 158"))
("100010010" ("cpu time: 1445 real time: 1450 gc time: 157" "cpu time: 1403 real time: 1408 gc time: 182" "cpu time: 1375 real time: 1380 gc time: 158" "cpu time: 1373 real time: 1377 gc time: 156"))
("100010011" ("cpu time: 1154 real time: 1157 gc time: 151" "cpu time: 1277 real time: 1281 gc time: 277" "cpu time: 1291 real time: 1295 gc time: 293" "cpu time: 1189 real time: 1193 gc time: 186"))
("100010100" ("cpu time: 1323 real time: 1327 gc time: 129" "cpu time: 1324 real time: 1328 gc time: 131" "cpu time: 1329 real time: 1333 gc time: 125" "cpu time: 1349 real time: 1353 gc time: 142"))
("100010101" ("cpu time: 1036 real time: 1039 gc time: 121" "cpu time: 1046 real time: 1048 gc time: 130" "cpu time: 1058 real time: 1060 gc time: 127" "cpu time: 1070 real time: 1074 gc time: 145"))
("100010110" ("cpu time: 1349 real time: 1352 gc time: 131" "cpu time: 1327 real time: 1331 gc time: 131" "cpu time: 1339 real time: 1343 gc time: 129" "cpu time: 1345 real time: 1348 gc time: 147"))
("100010111" ("cpu time: 1061 real time: 1064 gc time: 132" "cpu time: 1058 real time: 1061 gc time: 130" "cpu time: 1058 real time: 1061 gc time: 129" "cpu time: 1120 real time: 1123 gc time: 141"))
("100011000" ("cpu time: 1132 real time: 1135 gc time: 123" "cpu time: 1132 real time: 1135 gc time: 140" "cpu time: 1123 real time: 1127 gc time: 126" "cpu time: 1099 real time: 1103 gc time: 121"))
("100011001" ("cpu time: 858 real time: 861 gc time: 131" "cpu time: 863 real time: 866 gc time: 129" "cpu time: 883 real time: 885 gc time: 138" "cpu time: 866 real time: 868 gc time: 130"))
("100011010" ("cpu time: 1096 real time: 1100 gc time: 127" "cpu time: 1119 real time: 1123 gc time: 131" "cpu time: 1109 real time: 1112 gc time: 126" "cpu time: 1104 real time: 1107 gc time: 133"))
("100011011" ("cpu time: 862 real time: 864 gc time: 128" "cpu time: 845 real time: 848 gc time: 134" "cpu time: 853 real time: 855 gc time: 136" "cpu time: 865 real time: 868 gc time: 132"))
("100011100" ("cpu time: 1117 real time: 1120 gc time: 102" "cpu time: 1121 real time: 1124 gc time: 102" "cpu time: 1107 real time: 1110 gc time: 101" "cpu time: 1136 real time: 1139 gc time: 106"))
("100011101" ("cpu time: 830 real time: 832 gc time: 98" "cpu time: 830 real time: 833 gc time: 111" "cpu time: 852 real time: 854 gc time: 118" "cpu time: 836 real time: 838 gc time: 114"))
("100011110" ("cpu time: 1117 real time: 1120 gc time: 110" "cpu time: 1165 real time: 1168 gc time: 102" "cpu time: 1132 real time: 1136 gc time: 99" "cpu time: 1126 real time: 1130 gc time: 97"))
("100011111" ("cpu time: 825 real time: 826 gc time: 117" "cpu time: 838 real time: 840 gc time: 116" "cpu time: 834 real time: 837 gc time: 119" "cpu time: 824 real time: 826 gc time: 113"))
("100100000" ("cpu time: 1327 real time: 1331 gc time: 133" "cpu time: 1360 real time: 1364 gc time: 139" "cpu time: 1352 real time: 1356 gc time: 142" "cpu time: 1350 real time: 1354 gc time: 138"))
("100100001" ("cpu time: 1067 real time: 1070 gc time: 158" "cpu time: 1065 real time: 1069 gc time: 138" "cpu time: 1063 real time: 1066 gc time: 136" "cpu time: 1035 real time: 1039 gc time: 136"))
("100100010" ("cpu time: 1346 real time: 1350 gc time: 132" "cpu time: 1359 real time: 1363 gc time: 141" "cpu time: 1366 real time: 1371 gc time: 137" "cpu time: 1340 real time: 1344 gc time: 136"))
("100100011" ("cpu time: 1070 real time: 1072 gc time: 153" "cpu time: 1055 real time: 1058 gc time: 134" "cpu time: 1055 real time: 1058 gc time: 145" "cpu time: 1060 real time: 1064 gc time: 152"))
("100100100" ("cpu time: 1294 real time: 1298 gc time: 112" "cpu time: 1306 real time: 1309 gc time: 110" "cpu time: 1322 real time: 1325 gc time: 123" "cpu time: 1308 real time: 1312 gc time: 109"))
("100100101" ("cpu time: 984 real time: 988 gc time: 108" "cpu time: 1014 real time: 1016 gc time: 104" "cpu time: 992 real time: 994 gc time: 113" "cpu time: 1002 real time: 1005 gc time: 112"))
("100100110" ("cpu time: 1284 real time: 1287 gc time: 104" "cpu time: 1307 real time: 1311 gc time: 107" "cpu time: 1313 real time: 1317 gc time: 116" "cpu time: 1339 real time: 1342 gc time: 109"))
("100100111" ("cpu time: 995 real time: 997 gc time: 112" "cpu time: 982 real time: 984 gc time: 105" "cpu time: 990 real time: 993 gc time: 105" "cpu time: 990 real time: 993 gc time: 110"))
("100101000" ("cpu time: 1875 real time: 1882 gc time: 308" "cpu time: 1859 real time: 1865 gc time: 290" "cpu time: 1868 real time: 1874 gc time: 296" "cpu time: 1834 real time: 1840 gc time: 285"))
("100101001" ("cpu time: 1564 real time: 1570 gc time: 325" "cpu time: 1563 real time: 1568 gc time: 310" "cpu time: 1566 real time: 1570 gc time: 314" "cpu time: 1539 real time: 1544 gc time: 281"))
("100101010" ("cpu time: 1809 real time: 1815 gc time: 281" "cpu time: 1827 real time: 1833 gc time: 303" "cpu time: 1823 real time: 1828 gc time: 280" "cpu time: 1902 real time: 1908 gc time: 293"))
("100101011" ("cpu time: 1553 real time: 1557 gc time: 321" "cpu time: 1553 real time: 1558 gc time: 299" "cpu time: 1548 real time: 1552 gc time: 295" "cpu time: 1569 real time: 1573 gc time: 312"))
("100101100" ("cpu time: 1573 real time: 1578 gc time: 162" "cpu time: 1550 real time: 1555 gc time: 166" "cpu time: 1584 real time: 1588 gc time: 166" "cpu time: 1560 real time: 1565 gc time: 168"))
("100101101" ("cpu time: 1258 real time: 1262 gc time: 145" "cpu time: 1258 real time: 1262 gc time: 156" "cpu time: 1245 real time: 1249 gc time: 163" "cpu time: 1276 real time: 1280 gc time: 153"))
("100101110" ("cpu time: 1586 real time: 1591 gc time: 189" "cpu time: 1581 real time: 1585 gc time: 167" "cpu time: 1589 real time: 1594 gc time: 184" "cpu time: 1584 real time: 1588 gc time: 164"))
("100101111" ("cpu time: 1398 real time: 1403 gc time: 288" "cpu time: 1239 real time: 1242 gc time: 157" "cpu time: 1245 real time: 1249 gc time: 153" "cpu time: 1248 real time: 1251 gc time: 167"))
("100110000" ("cpu time: 1487 real time: 1491 gc time: 153" "cpu time: 1491 real time: 1496 gc time: 167" "cpu time: 1481 real time: 1486 gc time: 160" "cpu time: 1488 real time: 1492 gc time: 156"))
("100110001" ("cpu time: 1206 real time: 1209 gc time: 161" "cpu time: 1345 real time: 1349 gc time: 287" "cpu time: 1370 real time: 1374 gc time: 282" "cpu time: 1359 real time: 1363 gc time: 282"))
("100110010" ("cpu time: 1478 real time: 1483 gc time: 164" "cpu time: 1480 real time: 1485 gc time: 166" "cpu time: 1489 real time: 1494 gc time: 172" "cpu time: 1512 real time: 1516 gc time: 186"))
("100110011" ("cpu time: 1221 real time: 1225 gc time: 166" "cpu time: 1210 real time: 1214 gc time: 167" "cpu time: 1235 real time: 1238 gc time: 167" "cpu time: 1246 real time: 1250 gc time: 162"))
("100110100" ("cpu time: 1371 real time: 1376 gc time: 129" "cpu time: 1362 real time: 1365 gc time: 126" "cpu time: 1388 real time: 1393 gc time: 145" "cpu time: 1413 real time: 1417 gc time: 151"))
("100110101" ("cpu time: 1090 real time: 1093 gc time: 123" "cpu time: 1098 real time: 1101 gc time: 136" "cpu time: 1126 real time: 1129 gc time: 146" "cpu time: 1096 real time: 1100 gc time: 130"))
("100110110" ("cpu time: 1405 real time: 1409 gc time: 129" "cpu time: 1372 real time: 1376 gc time: 130" "cpu time: 1382 real time: 1387 gc time: 132" "cpu time: 1380 real time: 1383 gc time: 144"))
("100110111" ("cpu time: 1116 real time: 1119 gc time: 128" "cpu time: 1091 real time: 1093 gc time: 133" "cpu time: 1097 real time: 1100 gc time: 134" "cpu time: 1094 real time: 1097 gc time: 129"))
("100111000" ("cpu time: 1195 real time: 1198 gc time: 120" "cpu time: 1184 real time: 1188 gc time: 122" "cpu time: 1200 real time: 1203 gc time: 117" "cpu time: 1203 real time: 1207 gc time: 131"))
("100111001" ("cpu time: 954 real time: 957 gc time: 133" "cpu time: 948 real time: 950 gc time: 138" "cpu time: 967 real time: 970 gc time: 161" "cpu time: 961 real time: 963 gc time: 140"))
("100111010" ("cpu time: 1198 real time: 1203 gc time: 141" "cpu time: 1187 real time: 1191 gc time: 128" "cpu time: 1201 real time: 1205 gc time: 131" "cpu time: 1229 real time: 1233 gc time: 162"))
("100111011" ("cpu time: 914 real time: 917 gc time: 133" "cpu time: 924 real time: 927 gc time: 133" "cpu time: 936 real time: 939 gc time: 123" "cpu time: 927 real time: 930 gc time: 131"))
("100111100" ("cpu time: 1163 real time: 1166 gc time: 101" "cpu time: 1177 real time: 1181 gc time: 114" "cpu time: 1152 real time: 1156 gc time: 99" "cpu time: 1174 real time: 1177 gc time: 101"))
("100111101" ("cpu time: 851 real time: 854 gc time: 94" "cpu time: 849 real time: 851 gc time: 94" "cpu time: 842 real time: 844 gc time: 93" "cpu time: 854 real time: 857 gc time: 96"))
("100111110" ("cpu time: 1165 real time: 1168 gc time: 110" "cpu time: 1150 real time: 1153 gc time: 98" "cpu time: 1196 real time: 1200 gc time: 111" "cpu time: 1164 real time: 1168 gc time: 114"))
("100111111" ("cpu time: 882 real time: 883 gc time: 119" "cpu time: 882 real time: 884 gc time: 117" "cpu time: 895 real time: 897 gc time: 136" "cpu time: 885 real time: 887 gc time: 119"))
("101000000" ("cpu time: 1241 real time: 1245 gc time: 125" "cpu time: 1265 real time: 1270 gc time: 138" "cpu time: 1272 real time: 1277 gc time: 131" "cpu time: 1293 real time: 1296 gc time: 131"))
("101000001" ("cpu time: 1000 real time: 1003 gc time: 135" "cpu time: 975 real time: 978 gc time: 128" "cpu time: 986 real time: 989 gc time: 148" "cpu time: 987 real time: 990 gc time: 137"))
("101000010" ("cpu time: 1280 real time: 1284 gc time: 151" "cpu time: 1277 real time: 1281 gc time: 143" "cpu time: 1258 real time: 1262 gc time: 133" "cpu time: 1241 real time: 1245 gc time: 125"))
("101000011" ("cpu time: 992 real time: 996 gc time: 141" "cpu time: 976 real time: 979 gc time: 134" "cpu time: 1008 real time: 1011 gc time: 146" "cpu time: 994 real time: 997 gc time: 140"))
("101000100" ("cpu time: 1271 real time: 1274 gc time: 113" "cpu time: 1257 real time: 1260 gc time: 114" "cpu time: 1274 real time: 1277 gc time: 112" "cpu time: 1258 real time: 1262 gc time: 111"))
("101000101" ("cpu time: 951 real time: 953 gc time: 111" "cpu time: 969 real time: 971 gc time: 116" "cpu time: 975 real time: 977 gc time: 134" "cpu time: 952 real time: 954 gc time: 113"))
("101000110" ("cpu time: 1284 real time: 1288 gc time: 113" "cpu time: 1277 real time: 1280 gc time: 128" "cpu time: 1275 real time: 1278 gc time: 108" "cpu time: 1256 real time: 1260 gc time: 111"))
("101000111" ("cpu time: 948 real time: 951 gc time: 110" "cpu time: 976 real time: 978 gc time: 133" "cpu time: 977 real time: 981 gc time: 111" "cpu time: 955 real time: 957 gc time: 109"))
("101001000" ("cpu time: 1756 real time: 1761 gc time: 306" "cpu time: 1774 real time: 1779 gc time: 300" "cpu time: 1743 real time: 1749 gc time: 300" "cpu time: 1776 real time: 1782 gc time: 306"))
("101001001" ("cpu time: 1490 real time: 1494 gc time: 298" "cpu time: 1458 real time: 1461 gc time: 297" "cpu time: 1462 real time: 1467 gc time: 302" "cpu time: 1463 real time: 1468 gc time: 293"))
("101001010" ("cpu time: 1744 real time: 1749 gc time: 292" "cpu time: 1722 real time: 1727 gc time: 285" "cpu time: 1769 real time: 1775 gc time: 316" "cpu time: 1742 real time: 1748 gc time: 285"))
("101001011" ("cpu time: 1455 real time: 1459 gc time: 297" "cpu time: 1486 real time: 1490 gc time: 295" "cpu time: 1489 real time: 1494 gc time: 304" "cpu time: 1487 real time: 1491 gc time: 296"))
("101001100" ("cpu time: 1479 real time: 1483 gc time: 139" "cpu time: 1511 real time: 1515 gc time: 154" "cpu time: 1482 real time: 1486 gc time: 145" "cpu time: 1497 real time: 1502 gc time: 158"))
("101001101" ("cpu time: 1203 real time: 1207 gc time: 146" "cpu time: 1203 real time: 1207 gc time: 146" "cpu time: 1222 real time: 1225 gc time: 148" "cpu time: 1216 real time: 1219 gc time: 156"))
("101001110" ("cpu time: 1530 real time: 1534 gc time: 161" "cpu time: 1465 real time: 1469 gc time: 138" "cpu time: 1496 real time: 1500 gc time: 157" "cpu time: 1502 real time: 1506 gc time: 168"))
("101001111" ("cpu time: 1170 real time: 1173 gc time: 139" "cpu time: 1220 real time: 1224 gc time: 181" "cpu time: 1205 real time: 1208 gc time: 156" "cpu time: 1204 real time: 1207 gc time: 144"))
("101010000" ("cpu time: 1383 real time: 1388 gc time: 155" "cpu time: 1391 real time: 1396 gc time: 142" "cpu time: 1426 real time: 1429 gc time: 139" "cpu time: 1365 real time: 1369 gc time: 143"))
("101010001" ("cpu time: 1107 real time: 1110 gc time: 141" "cpu time: 1125 real time: 1129 gc time: 160" "cpu time: 1145 real time: 1149 gc time: 149" "cpu time: 1138 real time: 1141 gc time: 151"))
("101010010" ("cpu time: 1391 real time: 1395 gc time: 148" "cpu time: 1370 real time: 1374 gc time: 140" "cpu time: 1392 real time: 1396 gc time: 161" "cpu time: 1405 real time: 1410 gc time: 135"))
("101010011" ("cpu time: 1135 real time: 1139 gc time: 139" "cpu time: 1113 real time: 1117 gc time: 135" "cpu time: 1150 real time: 1154 gc time: 153" "cpu time: 1151 real time: 1154 gc time: 164"))
("101010100" ("cpu time: 1329 real time: 1332 gc time: 129" "cpu time: 1339 real time: 1343 gc time: 129" "cpu time: 1334 real time: 1337 gc time: 134" "cpu time: 1382 real time: 1386 gc time: 135"))
("101010101" ("cpu time: 1076 real time: 1079 gc time: 145" "cpu time: 1085 real time: 1089 gc time: 143" "cpu time: 1049 real time: 1052 gc time: 124" "cpu time: 1070 real time: 1073 gc time: 138"))
("101010110" ("cpu time: 1370 real time: 1374 gc time: 145" "cpu time: 1340 real time: 1344 gc time: 128" "cpu time: 1342 real time: 1346 gc time: 136" "cpu time: 1341 real time: 1344 gc time: 128"))
("101010111" ("cpu time: 1057 real time: 1061 gc time: 126" "cpu time: 1070 real time: 1073 gc time: 146" "cpu time: 1067 real time: 1070 gc time: 145" "cpu time: 1058 real time: 1061 gc time: 129"))
("101011000" ("cpu time: 1108 real time: 1112 gc time: 123" "cpu time: 1134 real time: 1137 gc time: 133" "cpu time: 1123 real time: 1126 gc time: 125" "cpu time: 1134 real time: 1137 gc time: 128"))
("101011001" ("cpu time: 872 real time: 875 gc time: 127" "cpu time: 874 real time: 877 gc time: 146" "cpu time: 854 real time: 856 gc time: 131" "cpu time: 877 real time: 880 gc time: 144"))
("101011010" ("cpu time: 1109 real time: 1112 gc time: 134" "cpu time: 1101 real time: 1104 gc time: 126" "cpu time: 1098 real time: 1102 gc time: 124" "cpu time: 1107 real time: 1111 gc time: 123"))
("101011011" ("cpu time: 888 real time: 890 gc time: 152" "cpu time: 866 real time: 869 gc time: 139" "cpu time: 846 real time: 849 gc time: 132" "cpu time: 877 real time: 880 gc time: 133"))
("101011100" ("cpu time: 1102 real time: 1106 gc time: 101" "cpu time: 1120 real time: 1124 gc time: 115" "cpu time: 1109 real time: 1111 gc time: 103" "cpu time: 1125 real time: 1128 gc time: 101"))
("101011101" ("cpu time: 833 real time: 835 gc time: 103" "cpu time: 810 real time: 812 gc time: 92" "cpu time: 823 real time: 825 gc time: 110" "cpu time: 809 real time: 811 gc time: 92"))
("101011110" ("cpu time: 1109 real time: 1113 gc time: 101" "cpu time: 1097 real time: 1099 gc time: 97" "cpu time: 1093 real time: 1096 gc time: 94" "cpu time: 1141 real time: 1145 gc time: 114"))
("101011111" ("cpu time: 844 real time: 846 gc time: 134" "cpu time: 860 real time: 861 gc time: 131" "cpu time: 818 real time: 820 gc time: 116" "cpu time: 825 real time: 827 gc time: 116"))
("101100000" ("cpu time: 1283 real time: 1287 gc time: 123" "cpu time: 1275 real time: 1280 gc time: 128" "cpu time: 1254 real time: 1258 gc time: 124" "cpu time: 1296 real time: 1300 gc time: 145"))
("101100001" ("cpu time: 980 real time: 983 gc time: 126" "cpu time: 1040 real time: 1042 gc time: 148" "cpu time: 991 real time: 994 gc time: 135" "cpu time: 969 real time: 972 gc time: 132"))
("101100010" ("cpu time: 1287 real time: 1291 gc time: 132" "cpu time: 1283 real time: 1286 gc time: 128" "cpu time: 1286 real time: 1289 gc time: 141" "cpu time: 1275 real time: 1279 gc time: 128"))
("101100011" ("cpu time: 989 real time: 992 gc time: 132" "cpu time: 984 real time: 987 gc time: 133" "cpu time: 1008 real time: 1012 gc time: 152" "cpu time: 1007 real time: 1010 gc time: 147"))
("101100100" ("cpu time: 1249 real time: 1253 gc time: 110" "cpu time: 1233 real time: 1236 gc time: 112" "cpu time: 1236 real time: 1239 gc time: 111" "cpu time: 1250 real time: 1253 gc time: 113"))
("101100101" ("cpu time: 933 real time: 935 gc time: 111" "cpu time: 955 real time: 957 gc time: 105" "cpu time: 931 real time: 933 gc time: 112" "cpu time: 925 real time: 927 gc time: 113"))
("101100110" ("cpu time: 1255 real time: 1259 gc time: 115" "cpu time: 1238 real time: 1241 gc time: 108" "cpu time: 1254 real time: 1258 gc time: 112" "cpu time: 1228 real time: 1231 gc time: 104"))
("101100111" ("cpu time: 937 real time: 939 gc time: 124" "cpu time: 936 real time: 938 gc time: 115" "cpu time: 944 real time: 947 gc time: 115" "cpu time: 941 real time: 944 gc time: 112"))
("101101000" ("cpu time: 1780 real time: 1785 gc time: 316" "cpu time: 1625 real time: 1630 gc time: 185" "cpu time: 1876 real time: 1881 gc time: 292" "cpu time: 1770 real time: 1775 gc time: 310"))
("101101001" ("cpu time: 1504 real time: 1509 gc time: 296" "cpu time: 1485 real time: 1489 gc time: 305" "cpu time: 1482 real time: 1487 gc time: 289" "cpu time: 1478 real time: 1483 gc time: 309"))
("101101010" ("cpu time: 1758 real time: 1763 gc time: 289" "cpu time: 1750 real time: 1756 gc time: 301" "cpu time: 1774 real time: 1779 gc time: 313" "cpu time: 1628 real time: 1634 gc time: 187"))
("101101011" ("cpu time: 1472 real time: 1476 gc time: 305" "cpu time: 1347 real time: 1351 gc time: 176" "cpu time: 1492 real time: 1496 gc time: 328" "cpu time: 1483 real time: 1487 gc time: 286"))
("101101100" ("cpu time: 1488 real time: 1493 gc time: 161" "cpu time: 1497 real time: 1501 gc time: 161" "cpu time: 1460 real time: 1464 gc time: 156" "cpu time: 1516 real time: 1521 gc time: 173"))
("101101101" ("cpu time: 1191 real time: 1194 gc time: 159" "cpu time: 1195 real time: 1198 gc time: 170" "cpu time: 1186 real time: 1190 gc time: 155" "cpu time: 1212 real time: 1215 gc time: 175"))
("101101110" ("cpu time: 1491 real time: 1496 gc time: 168" "cpu time: 1484 real time: 1488 gc time: 167" "cpu time: 1470 real time: 1473 gc time: 148" "cpu time: 1484 real time: 1488 gc time: 168"))
("101101111" ("cpu time: 1173 real time: 1177 gc time: 148" "cpu time: 1185 real time: 1188 gc time: 154" "cpu time: 1160 real time: 1163 gc time: 151" "cpu time: 1170 real time: 1174 gc time: 161"))
("101110000" ("cpu time: 1388 real time: 1391 gc time: 156" "cpu time: 1409 real time: 1412 gc time: 145" "cpu time: 1379 real time: 1383 gc time: 151" "cpu time: 1414 real time: 1419 gc time: 140"))
("101110001" ("cpu time: 1112 real time: 1115 gc time: 138" "cpu time: 1121 real time: 1125 gc time: 144" "cpu time: 1130 real time: 1133 gc time: 152" "cpu time: 1126 real time: 1129 gc time: 144"))
("101110010" ("cpu time: 1388 real time: 1393 gc time: 143" "cpu time: 1440 real time: 1445 gc time: 154" "cpu time: 1429 real time: 1434 gc time: 144" "cpu time: 1400 real time: 1405 gc time: 137"))
("101110011" ("cpu time: 1180 real time: 1184 gc time: 166" "cpu time: 1133 real time: 1136 gc time: 146" "cpu time: 1148 real time: 1152 gc time: 161" "cpu time: 1121 real time: 1125 gc time: 144"))
("101110100" ("cpu time: 1329 real time: 1333 gc time: 144" "cpu time: 1326 real time: 1331 gc time: 146" "cpu time: 1325 real time: 1329 gc time: 135" "cpu time: 1359 real time: 1363 gc time: 146"))
("101110101" ("cpu time: 1036 real time: 1039 gc time: 126" "cpu time: 1028 real time: 1031 gc time: 128" "cpu time: 1010 real time: 1012 gc time: 122" "cpu time: 1026 real time: 1029 gc time: 123"))
("101110110" ("cpu time: 1295 real time: 1299 gc time: 125" "cpu time: 1339 real time: 1343 gc time: 128" "cpu time: 1328 real time: 1332 gc time: 129" "cpu time: 1314 real time: 1317 gc time: 125"))
("101110111" ("cpu time: 1039 real time: 1041 gc time: 128" "cpu time: 1029 real time: 1031 gc time: 124" "cpu time: 1051 real time: 1054 gc time: 131" "cpu time: 1033 real time: 1036 gc time: 130"))
("101111000" ("cpu time: 1143 real time: 1147 gc time: 144" "cpu time: 1111 real time: 1114 gc time: 122" "cpu time: 1109 real time: 1112 gc time: 118" "cpu time: 1148 real time: 1151 gc time: 145"))
("101111001" ("cpu time: 884 real time: 886 gc time: 153" "cpu time: 855 real time: 858 gc time: 130" "cpu time: 861 real time: 864 gc time: 136" "cpu time: 860 real time: 863 gc time: 122"))
("101111010" ("cpu time: 1134 real time: 1137 gc time: 126" "cpu time: 1141 real time: 1144 gc time: 139" "cpu time: 1128 real time: 1131 gc time: 126" "cpu time: 1098 real time: 1101 gc time: 116"))
("101111011" ("cpu time: 864 real time: 867 gc time: 122" "cpu time: 862 real time: 864 gc time: 136" "cpu time: 855 real time: 858 gc time: 127" "cpu time: 864 real time: 867 gc time: 143"))
("101111100" ("cpu time: 1096 real time: 1098 gc time: 98" "cpu time: 1090 real time: 1093 gc time: 100" "cpu time: 1132 real time: 1134 gc time: 112" "cpu time: 1101 real time: 1103 gc time: 116"))
("101111101" ("cpu time: 778 real time: 781 gc time: 91" "cpu time: 788 real time: 790 gc time: 99" "cpu time: 791 real time: 793 gc time: 96" "cpu time: 802 real time: 803 gc time: 110"))
("101111110" ("cpu time: 1072 real time: 1074 gc time: 95" "cpu time: 1083 real time: 1086 gc time: 96" "cpu time: 1073 real time: 1076 gc time: 94" "cpu time: 1085 real time: 1087 gc time: 98"))
("101111111" ("cpu time: 797 real time: 800 gc time: 111" "cpu time: 795 real time: 796 gc time: 112" "cpu time: 811 real time: 813 gc time: 116" "cpu time: 794 real time: 797 gc time: 115"))
("110000000" ("cpu time: 1246 real time: 1250 gc time: 130" "cpu time: 1256 real time: 1259 gc time: 134" "cpu time: 1306 real time: 1310 gc time: 153" "cpu time: 1251 real time: 1255 gc time: 139"))
("110000001" ("cpu time: 952 real time: 955 gc time: 125" "cpu time: 980 real time: 983 gc time: 144" "cpu time: 967 real time: 970 gc time: 144" "cpu time: 993 real time: 996 gc time: 157"))
("110000010" ("cpu time: 1296 real time: 1301 gc time: 132" "cpu time: 1274 real time: 1278 gc time: 129" "cpu time: 1258 real time: 1262 gc time: 134" "cpu time: 1259 real time: 1263 gc time: 137"))
("110000011" ("cpu time: 976 real time: 979 gc time: 146" "cpu time: 974 real time: 976 gc time: 137" "cpu time: 999 real time: 1003 gc time: 141" "cpu time: 993 real time: 997 gc time: 149"))
("110000100" ("cpu time: 1030 real time: 1033 gc time: 110" "cpu time: 1039 real time: 1043 gc time: 123" "cpu time: 1029 real time: 1032 gc time: 105" "cpu time: 1040 real time: 1044 gc time: 108"))
("110000101" ("cpu time: 717 real time: 718 gc time: 109" "cpu time: 728 real time: 730 gc time: 108" "cpu time: 736 real time: 739 gc time: 114" "cpu time: 735 real time: 737 gc time: 116"))
("110000110" ("cpu time: 1051 real time: 1054 gc time: 125" "cpu time: 1033 real time: 1037 gc time: 107" "cpu time: 1067 real time: 1070 gc time: 114" "cpu time: 1027 real time: 1029 gc time: 101"))
("110000111" ("cpu time: 732 real time: 735 gc time: 114" "cpu time: 726 real time: 728 gc time: 105" "cpu time: 739 real time: 741 gc time: 113" "cpu time: 725 real time: 727 gc time: 103"))
("110001000" ("cpu time: 1764 real time: 1770 gc time: 293" "cpu time: 1735 real time: 1741 gc time: 291" "cpu time: 1752 real time: 1757 gc time: 286" "cpu time: 1758 real time: 1763 gc time: 271"))
("110001001" ("cpu time: 1463 real time: 1467 gc time: 292" "cpu time: 1505 real time: 1509 gc time: 290" "cpu time: 1476 real time: 1481 gc time: 300" "cpu time: 1489 real time: 1494 gc time: 309"))
("110001010" ("cpu time: 1730 real time: 1735 gc time: 282" "cpu time: 1783 real time: 1789 gc time: 287" "cpu time: 1764 real time: 1769 gc time: 297" "cpu time: 1744 real time: 1750 gc time: 293"))
("110001011" ("cpu time: 1433 real time: 1437 gc time: 295" "cpu time: 1420 real time: 1424 gc time: 269" "cpu time: 1462 real time: 1466 gc time: 310" "cpu time: 1442 real time: 1446 gc time: 291"))
("110001100" ("cpu time: 1288 real time: 1292 gc time: 153" "cpu time: 1272 real time: 1275 gc time: 143" "cpu time: 1269 real time: 1273 gc time: 145" "cpu time: 1278 real time: 1284 gc time: 144"))
("110001101" ("cpu time: 983 real time: 987 gc time: 151" "cpu time: 995 real time: 998 gc time: 147" "cpu time: 970 real time: 973 gc time: 141" "cpu time: 985 real time: 988 gc time: 164"))
("110001110" ("cpu time: 1248 real time: 1252 gc time: 132" "cpu time: 1259 real time: 1264 gc time: 141" "cpu time: 1330 real time: 1335 gc time: 174" "cpu time: 1256 real time: 1260 gc time: 138"))
("110001111" ("cpu time: 959 real time: 962 gc time: 141" "cpu time: 963 real time: 966 gc time: 141" "cpu time: 990 real time: 992 gc time: 156" "cpu time: 977 real time: 980 gc time: 167"))
("110010000" ("cpu time: 1390 real time: 1394 gc time: 157" "cpu time: 1409 real time: 1413 gc time: 155" "cpu time: 1383 real time: 1387 gc time: 152" "cpu time: 1398 real time: 1402 gc time: 165"))
("110010001" ("cpu time: 1146 real time: 1149 gc time: 171" "cpu time: 1128 real time: 1131 gc time: 151" "cpu time: 1150 real time: 1153 gc time: 160" "cpu time: 1276 real time: 1280 gc time: 273"))
("110010010" ("cpu time: 1403 real time: 1408 gc time: 156" "cpu time: 1422 real time: 1427 gc time: 161" "cpu time: 1390 real time: 1395 gc time: 156" "cpu time: 1431 real time: 1437 gc time: 154"))
("110010011" ("cpu time: 1163 real time: 1167 gc time: 168" "cpu time: 1147 real time: 1151 gc time: 167" "cpu time: 1145 real time: 1148 gc time: 162" "cpu time: 1146 real time: 1150 gc time: 168"))
("110010100" ("cpu time: 1099 real time: 1102 gc time: 130" "cpu time: 1102 real time: 1106 gc time: 129" "cpu time: 1104 real time: 1108 gc time: 126" "cpu time: 1148 real time: 1150 gc time: 142"))
("110010101" ("cpu time: 836 real time: 838 gc time: 133" "cpu time: 836 real time: 839 gc time: 126" "cpu time: 845 real time: 847 gc time: 139" "cpu time: 821 real time: 824 gc time: 132"))
("110010110" ("cpu time: 1138 real time: 1141 gc time: 125" "cpu time: 1125 real time: 1128 gc time: 129" "cpu time: 1122 real time: 1125 gc time: 140" "cpu time: 1098 real time: 1102 gc time: 120"))
("110010111" ("cpu time: 846 real time: 847 gc time: 145" "cpu time: 836 real time: 838 gc time: 137" "cpu time: 836 real time: 839 gc time: 133" "cpu time: 835 real time: 836 gc time: 128"))
("110011000" ("cpu time: 1120 real time: 1124 gc time: 121" "cpu time: 1112 real time: 1115 gc time: 121" "cpu time: 1111 real time: 1114 gc time: 119" "cpu time: 1108 real time: 1111 gc time: 118"))
("110011001" ("cpu time: 862 real time: 864 gc time: 136" "cpu time: 880 real time: 883 gc time: 138" "cpu time: 857 real time: 860 gc time: 128" "cpu time: 857 real time: 859 gc time: 131"))
("110011010" ("cpu time: 1108 real time: 1111 gc time: 120" "cpu time: 1116 real time: 1119 gc time: 121" "cpu time: 1106 real time: 1109 gc time: 128" "cpu time: 1123 real time: 1126 gc time: 134"))
("110011011" ("cpu time: 877 real time: 879 gc time: 151" "cpu time: 861 real time: 864 gc time: 133" "cpu time: 840 real time: 842 gc time: 127" "cpu time: 855 real time: 858 gc time: 137"))
("110011100" ("cpu time: 882 real time: 885 gc time: 94" "cpu time: 888 real time: 891 gc time: 94" "cpu time: 895 real time: 897 gc time: 97" "cpu time: 907 real time: 909 gc time: 115"))
("110011101" ("cpu time: 609 real time: 611 gc time: 107" "cpu time: 596 real time: 598 gc time: 92" "cpu time: 614 real time: 616 gc time: 108" "cpu time: 618 real time: 620 gc time: 111"))
("110011110" ("cpu time: 902 real time: 905 gc time: 114" "cpu time: 899 real time: 902 gc time: 111" "cpu time: 904 real time: 907 gc time: 108" "cpu time: 887 real time: 890 gc time: 95"))
("110011111" ("cpu time: 582 real time: 584 gc time: 92" "cpu time: 585 real time: 587 gc time: 94" "cpu time: 582 real time: 584 gc time: 89" "cpu time: 600 real time: 602 gc time: 105"))
("110100000" ("cpu time: 1362 real time: 1366 gc time: 137" "cpu time: 1338 real time: 1341 gc time: 143" "cpu time: 1362 real time: 1366 gc time: 148" "cpu time: 1359 real time: 1363 gc time: 133"))
("110100001" ("cpu time: 1062 real time: 1065 gc time: 143" "cpu time: 1058 real time: 1061 gc time: 148" "cpu time: 1062 real time: 1066 gc time: 153" "cpu time: 1071 real time: 1074 gc time: 139"))
("110100010" ("cpu time: 1392 real time: 1396 gc time: 137" "cpu time: 1345 real time: 1349 gc time: 141" "cpu time: 1360 real time: 1364 gc time: 135" "cpu time: 1333 real time: 1337 gc time: 136"))
("110100011" ("cpu time: 1055 real time: 1058 gc time: 153" "cpu time: 1060 real time: 1064 gc time: 143" "cpu time: 1062 real time: 1065 gc time: 160" "cpu time: 1050 real time: 1054 gc time: 146"))
("110100100" ("cpu time: 1079 real time: 1082 gc time: 122" "cpu time: 1092 real time: 1095 gc time: 114" "cpu time: 1094 real time: 1098 gc time: 115" "cpu time: 1078 real time: 1082 gc time: 109"))
("110100101" ("cpu time: 766 real time: 768 gc time: 116" "cpu time: 776 real time: 778 gc time: 110" "cpu time: 767 real time: 769 gc time: 104" "cpu time: 767 real time: 770 gc time: 109"))
("110100110" ("cpu time: 1073 real time: 1076 gc time: 107" "cpu time: 1075 real time: 1078 gc time: 108" "cpu time: 1092 real time: 1096 gc time: 124" "cpu time: 1119 real time: 1123 gc time: 127"))
("110100111" ("cpu time: 782 real time: 786 gc time: 114" "cpu time: 766 real time: 768 gc time: 110" "cpu time: 776 real time: 778 gc time: 117" "cpu time: 783 real time: 785 gc time: 104"))
("110101000" ("cpu time: 1699 real time: 1704 gc time: 189" "cpu time: 1824 real time: 1829 gc time: 300" "cpu time: 1845 real time: 1851 gc time: 300" "cpu time: 1843 real time: 1849 gc time: 307"))
("110101001" ("cpu time: 1580 real time: 1585 gc time: 323" "cpu time: 1542 real time: 1546 gc time: 305" "cpu time: 1564 real time: 1569 gc time: 309" "cpu time: 1565 real time: 1570 gc time: 323"))
("110101010" ("cpu time: 1819 real time: 1825 gc time: 291" "cpu time: 1861 real time: 1867 gc time: 306" "cpu time: 1828 real time: 1833 gc time: 312" "cpu time: 1829 real time: 1835 gc time: 307"))
("110101011" ("cpu time: 1550 real time: 1555 gc time: 307" "cpu time: 1545 real time: 1548 gc time: 317" "cpu time: 1552 real time: 1557 gc time: 306" "cpu time: 1613 real time: 1618 gc time: 326"))
("110101100" ("cpu time: 1351 real time: 1355 gc time: 178" "cpu time: 1360 real time: 1365 gc time: 169" "cpu time: 1331 real time: 1335 gc time: 167" "cpu time: 1328 real time: 1333 gc time: 165"))
("110101101" ("cpu time: 1020 real time: 1022 gc time: 160" "cpu time: 1055 real time: 1058 gc time: 170" "cpu time: 1163 real time: 1166 gc time: 273" "cpu time: 1027 real time: 1031 gc time: 144"))
("110101110" ("cpu time: 1341 real time: 1346 gc time: 169" "cpu time: 1332 real time: 1337 gc time: 152" "cpu time: 1335 real time: 1339 gc time: 168" "cpu time: 1330 real time: 1334 gc time: 172"))
("110101111" ("cpu time: 1011 real time: 1014 gc time: 157" "cpu time: 1145 real time: 1148 gc time: 269" "cpu time: 1038 real time: 1042 gc time: 159" "cpu time: 1052 real time: 1055 gc time: 176"))
("110110000" ("cpu time: 1455 real time: 1460 gc time: 157" "cpu time: 1467 real time: 1472 gc time: 153" "cpu time: 1463 real time: 1468 gc time: 162" "cpu time: 1466 real time: 1471 gc time: 169"))
("110110001" ("cpu time: 1221 real time: 1225 gc time: 182" "cpu time: 1199 real time: 1203 gc time: 160" "cpu time: 1211 real time: 1215 gc time: 185" "cpu time: 1190 real time: 1193 gc time: 153"))
("110110010" ("cpu time: 1444 real time: 1448 gc time: 147" "cpu time: 1522 real time: 1526 gc time: 171" "cpu time: 1503 real time: 1508 gc time: 175" "cpu time: 1521 real time: 1526 gc time: 171"))
("110110011" ("cpu time: 1195 real time: 1200 gc time: 155" "cpu time: 1207 real time: 1211 gc time: 163" "cpu time: 1216 real time: 1220 gc time: 161" "cpu time: 1265 real time: 1268 gc time: 164"))
("110110100" ("cpu time: 1145 real time: 1149 gc time: 129" "cpu time: 1132 real time: 1137 gc time: 126" "cpu time: 1174 real time: 1178 gc time: 145" "cpu time: 1160 real time: 1163 gc time: 136"))
("110110101" ("cpu time: 854 real time: 856 gc time: 122" "cpu time: 877 real time: 880 gc time: 129" "cpu time: 866 real time: 869 gc time: 125" "cpu time: 880 real time: 883 gc time: 123"))
("110110110" ("cpu time: 1149 real time: 1153 gc time: 124" "cpu time: 1169 real time: 1173 gc time: 135" "cpu time: 1173 real time: 1177 gc time: 131" "cpu time: 1144 real time: 1147 gc time: 124"))
("110110111" ("cpu time: 873 real time: 876 gc time: 130" "cpu time: 867 real time: 869 gc time: 130" "cpu time: 874 real time: 876 gc time: 139" "cpu time: 886 real time: 889 gc time: 130"))
("110111000" ("cpu time: 1189 real time: 1193 gc time: 124" "cpu time: 1180 real time: 1183 gc time: 126" "cpu time: 1212 real time: 1216 gc time: 146" "cpu time: 1210 real time: 1214 gc time: 142"))
("110111001" ("cpu time: 952 real time: 954 gc time: 136" "cpu time: 938 real time: 941 gc time: 138" "cpu time: 951 real time: 954 gc time: 134" "cpu time: 942 real time: 945 gc time: 134"))
("110111010" ("cpu time: 1176 real time: 1180 gc time: 123" "cpu time: 1206 real time: 1210 gc time: 129" "cpu time: 1197 real time: 1200 gc time: 126" "cpu time: 1178 real time: 1182 gc time: 123"))
("110111011" ("cpu time: 914 real time: 917 gc time: 128" "cpu time: 917 real time: 919 gc time: 133" "cpu time: 921 real time: 924 gc time: 124" "cpu time: 939 real time: 942 gc time: 138"))
("110111100" ("cpu time: 937 real time: 941 gc time: 100" "cpu time: 942 real time: 945 gc time: 99" "cpu time: 956 real time: 959 gc time: 118" "cpu time: 963 real time: 966 gc time: 117"))
("110111101" ("cpu time: 640 real time: 643 gc time: 98" "cpu time: 652 real time: 654 gc time: 97" "cpu time: 648 real time: 650 gc time: 99" "cpu time: 644 real time: 647 gc time: 96"))
("110111110" ("cpu time: 919 real time: 922 gc time: 92" "cpu time: 981 real time: 985 gc time: 112" "cpu time: 939 real time: 941 gc time: 109" "cpu time: 941 real time: 943 gc time: 98"))
("110111111" ("cpu time: 632 real time: 635 gc time: 91" "cpu time: 624 real time: 626 gc time: 93" "cpu time: 634 real time: 636 gc time: 104" "cpu time: 640 real time: 642 gc time: 97"))
("111000000" ("cpu time: 1240 real time: 1244 gc time: 125" "cpu time: 1258 real time: 1262 gc time: 131" "cpu time: 1271 real time: 1275 gc time: 131" "cpu time: 1274 real time: 1277 gc time: 141"))
("111000001" ("cpu time: 971 real time: 974 gc time: 129" "cpu time: 980 real time: 984 gc time: 144" "cpu time: 977 real time: 980 gc time: 133" "cpu time: 975 real time: 978 gc time: 132"))
("111000010" ("cpu time: 1253 real time: 1256 gc time: 129" "cpu time: 1267 real time: 1271 gc time: 136" "cpu time: 1250 real time: 1255 gc time: 124" "cpu time: 1289 real time: 1293 gc time: 132"))
("111000011" ("cpu time: 991 real time: 994 gc time: 138" "cpu time: 988 real time: 991 gc time: 138" "cpu time: 994 real time: 998 gc time: 142" "cpu time: 991 real time: 995 gc time: 130"))
("111000100" ("cpu time: 1047 real time: 1051 gc time: 111" "cpu time: 1030 real time: 1033 gc time: 113" "cpu time: 1048 real time: 1052 gc time: 109" "cpu time: 1027 real time: 1030 gc time: 109"))
("111000101" ("cpu time: 738 real time: 740 gc time: 116" "cpu time: 735 real time: 737 gc time: 110" "cpu time: 734 real time: 736 gc time: 113" "cpu time: 737 real time: 740 gc time: 114"))
("111000110" ("cpu time: 1044 real time: 1047 gc time: 110" "cpu time: 1040 real time: 1043 gc time: 111" "cpu time: 1046 real time: 1050 gc time: 106" "cpu time: 1037 real time: 1040 gc time: 107"))
("111000111" ("cpu time: 746 real time: 748 gc time: 116" "cpu time: 741 real time: 744 gc time: 114" "cpu time: 738 real time: 740 gc time: 113" "cpu time: 758 real time: 761 gc time: 128"))
("111001000" ("cpu time: 1763 real time: 1769 gc time: 303" "cpu time: 1793 real time: 1798 gc time: 314" "cpu time: 1774 real time: 1780 gc time: 327" "cpu time: 1760 real time: 1766 gc time: 306"))
("111001001" ("cpu time: 1454 real time: 1458 gc time: 297" "cpu time: 1493 real time: 1497 gc time: 301" "cpu time: 1458 real time: 1462 gc time: 283" "cpu time: 1514 real time: 1519 gc time: 294"))
("111001010" ("cpu time: 1774 real time: 1780 gc time: 285" "cpu time: 1741 real time: 1746 gc time: 295" "cpu time: 1770 real time: 1775 gc time: 289" "cpu time: 1636 real time: 1641 gc time: 181"))
("111001011" ("cpu time: 1460 real time: 1464 gc time: 294" "cpu time: 1469 real time: 1473 gc time: 304" "cpu time: 1437 real time: 1441 gc time: 286" "cpu time: 1465 real time: 1469 gc time: 304"))
("111001100" ("cpu time: 1286 real time: 1290 gc time: 152" "cpu time: 1252 real time: 1257 gc time: 138" "cpu time: 1262 real time: 1266 gc time: 146" "cpu time: 1294 real time: 1298 gc time: 155"))
("111001101" ("cpu time: 974 real time: 976 gc time: 156" "cpu time: 945 real time: 948 gc time: 138" "cpu time: 972 real time: 975 gc time: 160" "cpu time: 1000 real time: 1003 gc time: 157"))
("111001110" ("cpu time: 1286 real time: 1289 gc time: 148" "cpu time: 1279 real time: 1282 gc time: 148" "cpu time: 1255 real time: 1259 gc time: 144" "cpu time: 1277 real time: 1281 gc time: 154"))
("111001111" ("cpu time: 962 real time: 965 gc time: 152" "cpu time: 987 real time: 990 gc time: 162" "cpu time: 962 real time: 966 gc time: 160" "cpu time: 975 real time: 978 gc time: 158"))
("111010000" ("cpu time: 1381 real time: 1386 gc time: 140" "cpu time: 1369 real time: 1373 gc time: 135" "cpu time: 1374 real time: 1379 gc time: 141" "cpu time: 1379 real time: 1383 gc time: 151"))
("111010001" ("cpu time: 1135 real time: 1139 gc time: 155" "cpu time: 1137 real time: 1140 gc time: 146" "cpu time: 1123 real time: 1126 gc time: 146" "cpu time: 1125 real time: 1129 gc time: 153"))
("111010010" ("cpu time: 1391 real time: 1395 gc time: 151" "cpu time: 1398 real time: 1402 gc time: 162" "cpu time: 1376 real time: 1380 gc time: 147" "cpu time: 1417 real time: 1422 gc time: 138"))
("111010011" ("cpu time: 1133 real time: 1136 gc time: 141" "cpu time: 1136 real time: 1139 gc time: 150" "cpu time: 1153 real time: 1158 gc time: 145" "cpu time: 1148 real time: 1151 gc time: 171"))
("111010100" ("cpu time: 1111 real time: 1114 gc time: 128" "cpu time: 1120 real time: 1124 gc time: 145" "cpu time: 1104 real time: 1108 gc time: 131" "cpu time: 1111 real time: 1114 gc time: 129"))
("111010101" ("cpu time: 846 real time: 848 gc time: 140" "cpu time: 839 real time: 842 gc time: 135" "cpu time: 824 real time: 827 gc time: 126" "cpu time: 827 real time: 830 gc time: 127"))
("111010110" ("cpu time: 1106 real time: 1110 gc time: 131" "cpu time: 1104 real time: 1107 gc time: 128" "cpu time: 1116 real time: 1119 gc time: 132" "cpu time: 1087 real time: 1091 gc time: 115"))
("111010111" ("cpu time: 836 real time: 839 gc time: 131" "cpu time: 821 real time: 823 gc time: 125" "cpu time: 878 real time: 880 gc time: 139" "cpu time: 854 real time: 856 gc time: 137"))
("111011000" ("cpu time: 1108 real time: 1112 gc time: 125" "cpu time: 1114 real time: 1116 gc time: 122" "cpu time: 1104 real time: 1107 gc time: 130" "cpu time: 1129 real time: 1133 gc time: 129"))
("111011001" ("cpu time: 848 real time: 850 gc time: 129" "cpu time: 856 real time: 859 gc time: 130" "cpu time: 860 real time: 863 gc time: 131" "cpu time: 888 real time: 892 gc time: 139"))
("111011010" ("cpu time: 1109 real time: 1113 gc time: 134" "cpu time: 1108 real time: 1111 gc time: 118" "cpu time: 1106 real time: 1109 gc time: 125" "cpu time: 1114 real time: 1118 gc time: 129"))
("111011011" ("cpu time: 850 real time: 852 gc time: 132" "cpu time: 860 real time: 863 gc time: 137" "cpu time: 848 real time: 850 gc time: 134" "cpu time: 861 real time: 864 gc time: 136"))
("111011100" ("cpu time: 875 real time: 878 gc time: 95" "cpu time: 883 real time: 886 gc time: 95" "cpu time: 884 real time: 887 gc time: 95" "cpu time: 888 real time: 890 gc time: 95"))
("111011101" ("cpu time: 583 real time: 585 gc time: 92" "cpu time: 593 real time: 594 gc time: 90" "cpu time: 588 real time: 590 gc time: 92" "cpu time: 590 real time: 591 gc time: 93"))
("111011110" ("cpu time: 875 real time: 878 gc time: 96" "cpu time: 872 real time: 875 gc time: 94" "cpu time: 873 real time: 874 gc time: 95" "cpu time: 864 real time: 867 gc time: 91"))
("111011111" ("cpu time: 600 real time: 602 gc time: 108" "cpu time: 590 real time: 592 gc time: 104" "cpu time: 572 real time: 573 gc time: 90" "cpu time: 577 real time: 578 gc time: 92"))
("111100000" ("cpu time: 1276 real time: 1280 gc time: 137" "cpu time: 1258 real time: 1261 gc time: 127" "cpu time: 1296 real time: 1300 gc time: 142" "cpu time: 1300 real time: 1305 gc time: 153"))
("111100001" ("cpu time: 985 real time: 988 gc time: 127" "cpu time: 955 real time: 958 gc time: 126" "cpu time: 990 real time: 993 gc time: 136" "cpu time: 962 real time: 965 gc time: 126"))
("111100010" ("cpu time: 1272 real time: 1276 gc time: 129" "cpu time: 1278 real time: 1282 gc time: 134" "cpu time: 1305 real time: 1309 gc time: 139" "cpu time: 1262 real time: 1265 gc time: 122"))
("111100011" ("cpu time: 986 real time: 989 gc time: 140" "cpu time: 982 real time: 985 gc time: 135" "cpu time: 991 real time: 993 gc time: 137" "cpu time: 993 real time: 996 gc time: 131"))
("111100100" ("cpu time: 1019 real time: 1022 gc time: 118" "cpu time: 1030 real time: 1033 gc time: 107" "cpu time: 1021 real time: 1024 gc time: 113" "cpu time: 1022 real time: 1026 gc time: 115"))
("111100101" ("cpu time: 689 real time: 691 gc time: 104" "cpu time: 701 real time: 703 gc time: 107" "cpu time: 723 real time: 725 gc time: 132" "cpu time: 718 real time: 720 gc time: 125"))
("111100110" ("cpu time: 1022 real time: 1024 gc time: 110" "cpu time: 1046 real time: 1049 gc time: 131" "cpu time: 1008 real time: 1012 gc time: 109" "cpu time: 1016 real time: 1019 gc time: 108"))
("111100111" ("cpu time: 715 real time: 717 gc time: 113" "cpu time: 709 real time: 712 gc time: 110" "cpu time: 720 real time: 721 gc time: 124" "cpu time: 706 real time: 708 gc time: 107"))
("111101000" ("cpu time: 1805 real time: 1810 gc time: 306" "cpu time: 1800 real time: 1806 gc time: 317" "cpu time: 1788 real time: 1793 gc time: 310" "cpu time: 1787 real time: 1792 gc time: 305"))
("111101001" ("cpu time: 1480 real time: 1485 gc time: 311" "cpu time: 1482 real time: 1487 gc time: 299" "cpu time: 1468 real time: 1472 gc time: 313" "cpu time: 1566 real time: 1570 gc time: 334"))
("111101010" ("cpu time: 1810 real time: 1816 gc time: 291" "cpu time: 1760 real time: 1765 gc time: 300" "cpu time: 1783 real time: 1789 gc time: 289" "cpu time: 1789 real time: 1794 gc time: 334"))
("111101011" ("cpu time: 1462 real time: 1466 gc time: 310" "cpu time: 1500 real time: 1505 gc time: 296" "cpu time: 1461 real time: 1465 gc time: 310" "cpu time: 1357 real time: 1362 gc time: 204"))
("111101100" ("cpu time: 1247 real time: 1251 gc time: 149" "cpu time: 1266 real time: 1269 gc time: 170" "cpu time: 1247 real time: 1251 gc time: 154" "cpu time: 1320 real time: 1324 gc time: 162"))
("111101101" ("cpu time: 964 real time: 966 gc time: 165" "cpu time: 970 real time: 973 gc time: 173" "cpu time: 1085 real time: 1089 gc time: 280" "cpu time: 989 real time: 992 gc time: 175"))
("111101110" ("cpu time: 1261 real time: 1265 gc time: 163" "cpu time: 1294 real time: 1299 gc time: 184" "cpu time: 1299 real time: 1303 gc time: 174" "cpu time: 1255 real time: 1259 gc time: 164"))
("111101111" ("cpu time: 939 real time: 942 gc time: 160" "cpu time: 1089 real time: 1092 gc time: 272" "cpu time: 960 real time: 963 gc time: 159" "cpu time: 945 real time: 948 gc time: 156"))
("111110000" ("cpu time: 1393 real time: 1398 gc time: 143" "cpu time: 1404 real time: 1409 gc time: 138" "cpu time: 1392 real time: 1397 gc time: 135" "cpu time: 1440 real time: 1444 gc time: 171"))
("111110001" ("cpu time: 1142 real time: 1146 gc time: 145" "cpu time: 1140 real time: 1144 gc time: 144" "cpu time: 1133 real time: 1136 gc time: 141" "cpu time: 1168 real time: 1170 gc time: 170"))
("111110010" ("cpu time: 1387 real time: 1391 gc time: 135" "cpu time: 1393 real time: 1398 gc time: 151" "cpu time: 1397 real time: 1401 gc time: 143" "cpu time: 1410 real time: 1415 gc time: 169"))
("111110011" ("cpu time: 1112 real time: 1115 gc time: 141" "cpu time: 1133 real time: 1136 gc time: 145" "cpu time: 1147 real time: 1151 gc time: 166" "cpu time: 1150 real time: 1154 gc time: 151"))
("111110100" ("cpu time: 1092 real time: 1095 gc time: 137" "cpu time: 1111 real time: 1114 gc time: 144" "cpu time: 1127 real time: 1130 gc time: 142" "cpu time: 1106 real time: 1109 gc time: 148"))
("111110101" ("cpu time: 786 real time: 788 gc time: 124" "cpu time: 803 real time: 805 gc time: 131" "cpu time: 793 real time: 794 gc time: 123" "cpu time: 809 real time: 812 gc time: 137"))
("111110110" ("cpu time: 1084 real time: 1088 gc time: 123" "cpu time: 1092 real time: 1095 gc time: 133" "cpu time: 1092 real time: 1095 gc time: 125" "cpu time: 1091 real time: 1094 gc time: 142"))
("111110111" ("cpu time: 832 real time: 835 gc time: 130" "cpu time: 790 real time: 792 gc time: 115" "cpu time: 796 real time: 798 gc time: 116" "cpu time: 823 real time: 825 gc time: 139"))
("111111000" ("cpu time: 1165 real time: 1168 gc time: 134" "cpu time: 1132 real time: 1135 gc time: 130" "cpu time: 1183 real time: 1187 gc time: 125" "cpu time: 1130 real time: 1134 gc time: 128"))
("111111001" ("cpu time: 867 real time: 869 gc time: 135" "cpu time: 900 real time: 903 gc time: 155" "cpu time: 867 real time: 871 gc time: 125" "cpu time: 890 real time: 893 gc time: 143"))
("111111010" ("cpu time: 1102 real time: 1106 gc time: 120" "cpu time: 1106 real time: 1109 gc time: 121" "cpu time: 1126 real time: 1130 gc time: 122" "cpu time: 1147 real time: 1151 gc time: 146"))
("111111011" ("cpu time: 862 real time: 863 gc time: 138" "cpu time: 851 real time: 853 gc time: 127" "cpu time: 834 real time: 837 gc time: 123" "cpu time: 860 real time: 863 gc time: 134"))
("111111100" ("cpu time: 858 real time: 860 gc time: 99" "cpu time: 874 real time: 876 gc time: 95" "cpu time: 886 real time: 888 gc time: 113" "cpu time: 866 real time: 869 gc time: 98"))
("111111101" ("cpu time: 573 real time: 575 gc time: 96" "cpu time: 572 real time: 574 gc time: 97" "cpu time: 572 real time: 574 gc time: 97" "cpu time: 563 real time: 563 gc time: 94"))
("111111110" ("cpu time: 877 real time: 879 gc time: 113" "cpu time: 860 real time: 863 gc time: 95" "cpu time: 866 real time: 869 gc time: 110" "cpu time: 853 real time: 856 gc time: 94"))
("111111111" ("cpu time: 554 real time: 556 gc time: 98" "cpu time: 564 real time: 565 gc time: 101" "cpu time: 571 real time: 572 gc time: 100" "cpu time: 570 real time: 572 gc time: 104"))
| false |
77956d8d6d8831c26ccd898d6889c54cd680d092 | d38b44cc1e913d3906f92a3f5bf3c6afad7b4aa5 | /state/lang/reader.rkt | 4a20aac0ff1632791404a6a441cd931b6343e6c8 | []
| no_license | shriram/smol | 41cb00d908a8f75a8edf796e1ada8830e5665c68 | da99591c7c4bb58ece6a1c935d95fbd2d64685b1 | refs/heads/master | 2022-12-22T03:56:51.031967 | 2022-12-02T00:20:53 | 2022-12-02T00:20:53 | 204,587,082 | 12 | 3 | null | 2022-11-08T22:24:33 | 2019-08-27T00:42:00 | Racket | UTF-8 | Racket | false | false | 54 | rkt | reader.rkt | #lang s-exp syntax/module-reader
smol/state/semantics
| false |
47432edd51b9552818e6787f5716fb9cf1d0215e | 4c2dc47a9d9aa20d516a3a70d12d4e33ea28984b | /examples/dragon.rkt | de221f700f5f0da9635957bec4102851de209316 | [
"CC-BY-4.0"
]
| permissive | rfindler/lindenmayer | 92c0d0bafdc9097ba60a7dea73a548b5eb27e8b7 | 695db090aa4cfdb9338cd34ad0a0b8f72b698a54 | refs/heads/master | 2023-03-13T01:13:59.554157 | 2023-03-04T16:21:58 | 2023-03-04T16:50:37 | 83,209,018 | 27 | 4 | null | 2017-03-05T03:55:58 | 2017-02-26T13:06:46 | Racket | UTF-8 | Racket | false | false | 622 | rkt | dragon.rkt | #lang lindenmayer racket
## axiom ##
F X
## rules ##
X -> X + Y F +
Y -> - F X - Y
## variables ##
n=10
============================================================
(provide (all-defined-out))
(require graphics/value-turtles pict)
(define (X turtles variables) turtles)
(define (Y turtles variables) turtles)
(define (F turtles variables)
(draw 4 turtles))
(define (+ turtles variables)
(turn -90 turtles))
(define (- turtles variables)
(turn 90 turtles))
(define w 500)
(define h 250)
(define (start variables) (turn 90 (turtles w h)))
(define (finish turtles variables)
(inset (turtles-pict turtles) 1))
| false |
f895b826af0809fc79d5a7393bbaa768ac700b73 | 66c92b955f3caa70ea4b322654079450ab9eff36 | /gm-pepm-2018/nepls-2017/src/tr-data/lnm-v6.4-2016-07-25T06:46:31.rktd | 8c3ec59de5ff449cbec19c18261cd5aefb72d83b | [
"MIT"
]
| permissive | nuprl/retic_performance | ebc3a5656ce77539ff44c50ac00dacd0a22496ec | da634137b151553c354eafcc549e1650043675f9 | refs/heads/master | 2023-06-22T05:41:16.151571 | 2023-06-12T20:16:13 | 2023-06-12T20:16:13 | 85,637,202 | 3 | 1 | MIT | 2023-06-12T20:16:14 | 2017-03-20T23:23:11 | Racket | UTF-8 | Racket | false | false | 4,973 | rktd | lnm-v6.4-2016-07-25T06:46:31.rktd | ;; data0
;; #(-v 6.4 -i 1 benchmarks/forth benchmarks/fsm benchmarks/mbta benchmarks/morsecode benchmarks/zombie benchmarks/zordoz.6.3 benchmarks/lnm benchmarks/suffixtree benchmarks/kcfa benchmarks/take5 benchmarks/acquire benchmarks/tetris benchmarks/synth)
;; 6.4
;; binaries in /home/ben/code/racket/6.4/bin/
;; base @ <unknown-commit>
;; typed-racket @ 495da1bd
;; 2017-02-20T21:37:37
;; #(-v (6.4 6.3) benchmarks/morsecode benchmarks/fsm benchmarks/forth benchmarks/take5 benchmarks/zordoz.6.3 benchmarks/zombie benchmarks/suffixtree benchmarks/snake benchmarks/tetris benchmarks/synth benchmarks/kcfa benchmarks/lnm benchmarks/mbta benchmarks/acquire benchmarks/dungeon)
;; 6.4
;; binaries in /home/ben/code/racket/6.4/bin/
;; base @ <unknown-commit>
;; typed-racket @ 495da1bd
;; 2016-06-03T11:39:27
#(
( 3951 3989 3951 3979 3972 3964 4002 3996 3980 #| data0 |# 4021)
( 3133 3114 3137 3095 3138 3137 3117 3104 3137 #| data0 |# 3114)
( 3991 3982 4014 4000 3946 3987 3974 3987 4020 #| data0 |# 4008)
( 3159 3130 3118 3144 3127 3123 3140 3112 3126 #| data0 |# 3140)
( 3978 3967 3974 3943 4029 3995 3964 3964 4022 #| data0 |# 3998)
( 3115 3128 3110 3139 3120 3118 3129 3137 3115 #| data0 |# 3124)
( 4014 4000 3991 4016 3989 3968 3979 3977 3989 #| data0 |# 4026)
( 3141 3145 3131 3146 3135 3114 3121 3112 3139 #| data0 |# 3131)
( 3986 4009 4007 3986 3998 3997 4028 4007 4053 #| data0 |# 3979)
( 3138 3136 3131 3139 3146 3127 3123 3141 3168 #| data0 |# 3122)
( 4015 4026 4002 4095 4011 3980 4020 4021 4016 #| data0 |# 4005)
( 3139 3127 3136 3124 3135 3156 3134 3163 3134 #| data0 |# 3116)
( 4000 3989 3996 4034 4021 4008 4033 4059 4032 #| data0 |# 4017)
( 3133 3134 3126 3130 3157 3136 3143 3140 3121 #| data0 |# 3126)
( 3994 4053 3997 4023 4017 3995 4033 4020 4035 #| data0 |# 4026)
( 3115 3137 3143 3126 3177 3143 3160 3131 3151 #| data0 |# 3113)
( 3869 3898 3890 3910 3841 3849 3884 3880 3912 #| data0 |# 3909)
( 3042 3081 3037 3042 3040 3026 3041 3073 3037 #| data0 |# 3027)
( 3947 3933 3898 3864 3913 3904 3861 3897 3880 #| data0 |# 3903)
( 3056 3062 3059 3037 3044 3035 3056 3061 3055 #| data0 |# 3056)
( 3919 3912 3895 3866 3882 3889 3874 3874 3908 #| data0 |# 3894)
( 3049 3054 3057 3059 3052 3050 3049 3075 3051 #| data0 |# 3039)
( 3904 3886 3901 3889 3933 3905 3940 3912 3908 #| data0 |# 3927)
( 3076 3061 3049 3056 3023 3053 3058 3070 3060 #| data0 |# 3039)
( 3880 3896 3875 3910 3857 3898 3851 3908 3885 #| data0 |# 3910)
( 3043 3070 3041 3034 3051 3059 3052 3040 3044 #| data0 |# 3040)
( 3371 3387 3344 3383 3366 3387 3325 3391 3355 #| data0 |# 3900)
( 3058 3034 3046 3057 3091 3051 3033 3070 3043 #| data0 |# 3037)
( 3906 3892 3899 3919 3931 3911 3870 3942 3981 #| data0 |# 3920)
( 3069 3087 3055 3059 3030 3080 3046 3044 3046 #| data0 |# 3052)
( 3384 3364 3422 3388 3410 3392 3388 3355 3412 #| data0 |# 3856)
( 3052 3078 3067 3058 3090 3075 3083 3074 3082 #| data0 |# 3047)
( 4493 4488 4514 4501 4517 4538 4477 4506 4498 #| data0 |# 4478)
( 4145 4146 4185 4166 4162 4174 4158 4154 4133 #| data0 |# 4138)
( 4534 4481 4477 4529 4528 4489 4464 4469 4489 #| data0 |# 4517)
( 4129 4148 4140 4159 4145 4120 4151 4131 4160 #| data0 |# 4132)
( 4523 4484 4550 4531 4494 4549 4544 4562 4541 #| data0 |# 4541)
( 4172 4180 4157 4154 4144 4150 4136 4168 4139 #| data0 |# 4149)
( 4531 4532 4460 4479 4553 4499 4491 4481 4504 #| data0 |# 4516)
( 4146 4128 4154 4149 4121 4098 4156 4110 4114 #| data0 |# 4138)
( 4484 4515 4529 4555 4488 4531 4485 4555 4538 #| data0 |# 4564)
( 4139 4115 4121 4154 4100 4117 4137 4102 4160 #| data0 |# 4119)
( 4531 4508 4555 4533 4510 4519 4520 4577 4523 #| data0 |# 4535)
( 4150 4150 4110 4133 4141 4090 4105 4102 4122 #| data0 |# 4118)
( 4508 4490 4480 4519 4543 4531 4566 4440 4541 #| data0 |# 4498)
( 4132 4122 4159 4114 4165 4157 4149 4094 4142 #| data0 |# 4121)
( 4542 4558 4502 4566 4512 4547 4555 4547 4538 #| data0 |# 4549)
( 4147 4097 4137 4132 4150 4146 4127 4121 4137 #| data0 |# 4124)
( 4326 4302 4280 4325 4328 4295 4299 4309 4307 #| data0 |# 4276)
( 3352 3354 3354 3344 3353 3377 3343 3374 3372 #| data0 |# 3332)
( 4275 4297 4308 4279 4281 4265 4288 4274 4288 #| data0 |# 4252)
( 3349 3325 3331 3330 3326 3366 3337 3335 3333 #| data0 |# 3326)
( 4279 4273 4279 4321 4312 4335 4293 4302 4306 #| data0 |# 4303)
( 3379 3376 3349 3340 3351 3345 3348 3356 3348 #| data0 |# 3372)
( 4317 4252 4261 4299 4277 4252 4298 4288 4277 #| data0 |# 4319)
( 3348 3348 3334 3336 3329 3386 3320 3343 3371 #| data0 |# 3351)
( 4245 4286 4304 4296 4299 4265 4216 4306 4235 #| data0 |# 4302)
( 3326 3340 3342 3349 3330 3345 3353 3324 3340 #| data0 |# 3352)
( 4294 4293 4262 4311 4273 4258 4247 4222 4303 #| data0 |# 4275)
( 3347 3327 3329 3343 3336 3336 3336 3323 3329 #| data0 |# 3347)
( 4275 4274 4280 4272 4264 4290 4289 4221 4306 #| data0 |# 4292)
( 3327 3319 3327 3348 3369 3366 3291 3336 3340 #| data0 |# 3318)
( 4245 4285 4280 4265 4264 4302 4270 4271 4252 #| data0 |# 4232)
( 3367 3358 3368 3358 3371 3344 3323 3346 3345 #| data0 |# 3338)
)
| false |
56e7cca72d8e5393b11ffd5a3045be08ca439a77 | 5bbc152058cea0c50b84216be04650fa8837a94b | /data/6.7/snake-v6.7-2017-06-07T21:21:17.rktd | 3eb149c8d2f791bff41861ec7011676a3f0dea58 | []
| no_license | nuprl/gradual-typing-performance | 2abd696cc90b05f19ee0432fb47ca7fab4b65808 | 35442b3221299a9cadba6810573007736b0d65d4 | refs/heads/master | 2021-01-18T15:10:01.739413 | 2018-12-15T18:44:28 | 2018-12-15T18:44:28 | 27,730,565 | 11 | 3 | null | 2018-12-01T13:54:08 | 2014-12-08T19:15:22 | Racket | UTF-8 | Racket | false | false | 8,772 | rktd | snake-v6.7-2017-06-07T21:21:17.rktd | ;; #(-v 6.7 -i 6 benchmarks/acquire/ benchmarks/dungeon/ benchmarks/forth/ benchmarks/fsm/ benchmarks/fsmoo/ benchmarks/gregor/ benchmarks/kcfa/ benchmarks/lnm/ benchmarks/mbta/ benchmarks/morsecode/ benchmarks/sieve/ benchmarks/snake/ benchmarks/stack/ benchmarks/suffixtree/ benchmarks/synth/ benchmarks/synth2/ benchmarks/take5/ benchmarks/tetris/ benchmarks/zombie/ benchmarks/zordoz.6.5/)
;; 6.7
;; binaries in /home/ben/code/racket/6.7/bin/
;; base @ <unknown-commit>
;; typed-racket @ 495da1bd
;; 2017-05-25T20:56:32
#(
(777 783 783 776 783 813)
(4409 4113 4281 4234 4155 4185)
(4518 4613 4492 4575 4513 4450)
(6931 7183 7069 7326 7340 7274)
(2986 2662 2670 2660 2635 2990)
(6527 6317 5745 5503 5887 5822)
(7193 7432 7867 7639 7765 7863)
(8653 9014 8894 8981 8939 8875)
(3255 3242 3030 3149 3148 3296)
(7065 7046 7071 6980 6996 6979)
(7506 7504 7705 7333 7619 7548)
(10088 10150 10010 10469 10179 10162)
(3410 3363 3335 3364 3373 3269)
(6401 5974 6488 6215 5819 5960)
(8346 8077 8270 7857 7992 7886)
(9259 9159 9093 8867 9329 9395)
(6101 5932 6090 6189 6227 6323)
(5440 5479 5453 5357 5205 5483)
(4962 5023 5007 5097 4978 5084)
(3092 3056 3323 3297 3192 3073)
(9643 9738 9688 10214 9915 9768)
(7722 7516 7869 7522 7332 7387)
(8578 8572 8523 8652 8512 8513)
(4881 5022 4950 4870 4761 5041)
(9463 9166 8437 8878 8885 9130)
(7614 7911 7579 7935 7859 7981)
(7821 7961 8061 7944 7770 8104)
(5083 5203 5144 5159 5226 5104)
(9845 9754 10040 9711 10326 9993)
(7036 7040 7222 7301 7140 6986)
(8772 8483 8505 8335 8599 8331)
(4749 4301 4397 4543 4396 4480)
(1697 1661 1668 1630 1538 1670)
(4470 5059 5070 4900 5019 4886)
(3686 3855 3655 3671 3719 3693)
(6156 5971 5915 6026 5846 6017)
(3770 3549 3969 3850 3833 3495)
(6509 7578 6787 7068 7430 6559)
(5924 6388 6863 6415 6246 6370)
(7855 7999 7784 8196 8316 7869)
(4147 4029 4110 3967 4099 4191)
(7723 8158 7340 8104 7875 8056)
(6637 6458 6807 6358 6536 6068)
(8982 9260 9166 9224 9171 9005)
(4151 4321 4616 4183 4446 4167)
(7114 6789 6887 7060 6962 6780)
(7075 7074 7249 7040 6973 7067)
(7915 8085 8307 7848 8361 8307)
(7084 7175 7238 6826 7062 6915)
(6240 6464 6494 6478 6278 6349)
(3997 4102 4068 4013 4231 4130)
(2312 2267 2317 2268 2290 2239)
(10401 10987 10873 11262 10812 10985)
(8749 8458 8355 8776 8599 8501)
(6950 6896 6661 6936 7076 6813)
(4027 3799 3809 3998 3841 4029)
(9572 10056 10012 10231 9728 10299)
(8804 8798 9002 8563 8880 8433)
(6214 6388 6430 6104 6383 6071)
(4044 4074 4014 3920 4062 3914)
(10848 10774 10279 10527 10668 10102)
(8278 7424 7889 7630 8066 7945)
(7286 6776 6757 6950 6964 6896)
(3462 3316 3511 3526 3666 3518)
(1076 999 1003 1000 1006 1014)
(4498 4341 4541 4311 4365 4500)
(4475 4493 4611 4760 4583 4717)
(6955 7297 7081 7024 6934 7034)
(2705 2865 2743 2956 2975 2878)
(5800 6498 6197 5980 5874 6190)
(7520 7330 7479 7338 7569 7938)
(9107 8733 9274 9006 9328 9147)
(3055 3217 3449 3064 3322 3242)
(7129 7364 7169 7172 7029 7621)
(7920 8180 7502 7812 7496 7769)
(9660 10053 10316 10660 10378 10625)
(3272 3506 3451 3461 3330 3499)
(6170 6228 6032 5964 6205 5757)
(8291 8484 8041 8112 8387 8053)
(9214 9408 8854 9095 9441 8851)
(6598 6759 6730 6725 6698 6706)
(5505 5926 5441 5834 5764 5543)
(4971 5134 5243 5108 5145 5134)
(3098 3198 3286 3343 3178 3154)
(9970 9953 9747 9442 9521 9703)
(8059 8335 7500 7245 7871 7552)
(8327 8008 7820 8153 8031 7978)
(5187 4716 4938 5069 5030 5175)
(9655 9408 9470 9351 9528 9864)
(8134 8237 7831 8356 8010 7883)
(8286 8019 7858 8146 7944 7947)
(5549 5280 5046 5279 5465 4916)
(9629 9705 9828 9675 9546 9643)
(7273 7386 7200 6837 7117 7247)
(7771 8020 7995 8225 8046 8151)
(4326 4650 4589 4603 4479 4620)
(1607 1641 1580 1498 1593 1643)
(4728 5149 4857 4916 5141 5188)
(3602 3719 3908 3888 3673 3601)
(6165 6088 6189 6027 6205 6115)
(3670 3519 3812 3694 3764 3565)
(6834 6525 7050 7265 6853 6873)
(6665 6595 6881 6670 6329 6467)
(7997 8302 7797 8183 7584 7840)
(4043 4126 4085 4127 4048 4049)
(8347 8391 8216 8083 8158 7915)
(6860 6588 7074 7092 6828 6990)
(9121 8950 8974 8923 9028 9043)
(4288 4339 4257 3855 4216 4351)
(7175 7041 6703 6991 7174 7166)
(7211 6882 7336 7158 7283 6873)
(8384 8304 8110 8305 7877 8003)
(7693 7610 7511 7627 7509 7580)
(6495 6562 6613 6706 6616 6715)
(4008 3783 4055 4086 3976 4037)
(2460 2273 2308 2359 2279 2346)
(11216 10045 10675 10491 10957 10313)
(8426 8290 8859 8405 8677 8443)
(6694 6821 6806 7004 6663 6584)
(4093 3914 3924 4110 4058 4003)
(10941 10483 10660 10872 10333 10995)
(8994 9020 8968 8849 9129 9520)
(6653 6348 6748 6675 6490 6899)
(4191 4156 4019 4177 4065 3901)
(9714 10749 10525 10629 10833 10839)
(7769 7590 8046 7752 7642 8094)
(6717 6613 6681 6867 6504 6714)
(3495 3606 3419 3279 3378 3578)
(2842 2685 2827 2763 2763 2773)
(6041 6313 5907 5959 5924 6252)
(6184 6295 6280 6271 6324 6023)
(8663 8644 8656 8674 8538 8730)
(5508 5363 5151 5285 5251 5542)
(8118 7726 8268 7917 7677 7899)
(9461 9568 9609 9510 9979 9728)
(10915 10846 10617 11007 10431 10531)
(3038 3114 3118 3135 3035 3066)
(5856 5956 5851 5963 5846 5927)
(6530 6446 6478 6387 6497 6524)
(8686 8770 8725 8751 8579 8738)
(3291 3247 3161 3212 3214 2872)
(5479 5481 5447 5516 5200 5449)
(7090 6858 6607 6963 7455 7036)
(8257 8118 8065 8064 8173 8123)
(5738 5851 5572 5723 5607 5778)
(5171 5177 4921 5240 4935 5266)
(4501 4433 4483 4517 4636 4485)
(2579 2594 2491 2618 2678 2655)
(9308 9449 9202 8929 9034 9384)
(7562 7133 7619 7504 7365 6522)
(7701 7838 7493 7913 7728 7944)
(4406 4146 4169 4127 4259 4261)
(5469 5830 5675 5663 5527 5752)
(4250 4295 4191 4436 4299 4237)
(4481 4395 4550 4518 4536 4667)
(1952 2075 1971 1973 2106 1941)
(6002 5971 5916 6298 6052 5829)
(3808 3894 4022 3847 3821 3898)
(4284 4680 4529 4664 4493 4473)
(1599 1614 1640 1632 1643 1651)
(3337 3261 3285 3283 3322 3305)
(6873 6884 6493 7136 6726 6644)
(5252 5099 5325 5194 5218 5271)
(7746 7423 7695 7654 7812 7831)
(5972 5763 5977 6164 5674 5966)
(9346 9399 9135 8667 8974 9405)
(8394 8444 8394 8780 8428 8520)
(9767 9689 9354 9779 9748 9759)
(3560 3768 3695 3650 3711 3742)
(6587 6521 6819 6908 6809 6818)
(5664 5733 5849 5766 5593 5621)
(7798 7932 7869 8200 7723 8144)
(3810 3792 3896 3797 3780 3865)
(6142 6145 6126 5947 5909 5898)
(6006 6258 5858 6039 5991 6100)
(7365 7066 7072 6837 7156 6585)
(6524 6561 6483 6480 6664 6803)
(5592 5832 5900 5517 5925 5666)
(3550 3607 3552 3440 3640 3587)
(1780 1769 1778 1795 1792 1789)
(10048 9591 9792 9429 10204 10632)
(7850 8419 8816 8664 8126 8833)
(6027 6450 5872 6011 6284 6407)
(3267 3197 3079 3304 3126 3225)
(6389 6406 6519 6447 6442 6514)
(5302 5235 4887 4838 4791 5166)
(3323 3535 3429 3362 3387 3344)
(1250 1327 1299 1299 1297 1264)
(6767 6791 6740 7066 7223 6711)
(4635 4307 4577 4458 4944 4587)
(3878 3593 3666 3633 3588 3896)
(969 978 964 969 972 969)
(2826 2723 2805 2840 2849 2855)
(6057 6094 5959 5685 5983 6124)
(6172 6207 6137 6101 6357 6188)
(8611 8787 8759 8643 8697 8711)
(5249 5629 5835 5264 5596 5050)
(7653 8382 7779 7602 8222 7790)
(9341 9186 9706 9206 9307 9633)
(11081 10732 10500 11107 11075 10530)
(3036 3043 2971 3099 3050 3093)
(6000 6344 5941 6039 5806 5786)
(6586 6654 6535 6620 6579 6652)
(8468 9069 8090 8620 8788 8727)
(3081 3305 3133 3128 3261 3209)
(5649 5396 5327 5245 5623 5291)
(6834 6869 6847 7002 6858 6936)
(8131 7916 7838 7794 7979 8246)
(6180 6033 5937 6251 6452 6282)
(5308 5317 5449 5310 5409 5370)
(4663 4744 4918 4562 4802 4713)
(2531 2533 2598 2606 2563 2685)
(10043 9172 9358 9253 9572 9278)
(7387 7208 6966 7167 7562 7192)
(7672 7762 7622 8142 7925 7992)
(4346 4262 4163 4157 4314 4266)
(6271 5515 6025 6063 5829 6085)
(4581 4598 4522 4509 4428 4453)
(4467 4430 4336 4290 4334 4184)
(1982 1954 1973 2018 1921 1949)
(6238 6146 6351 6215 6167 6349)
(3671 3595 3733 3717 3663 3703)
(4539 4420 4542 4388 4455 4520)
(1579 1608 1603 1617 1557 1596)
(3285 3331 3286 3225 3280 3319)
(6790 6963 7000 6862 6722 6973)
(5477 5297 5421 5434 5282 5260)
(7827 7769 7646 7798 7861 7603)
(5628 5884 5691 5801 5678 5570)
(8470 8696 8692 8787 8911 8913)
(8466 8466 8515 8409 8471 8380)
(9631 9840 9995 10053 9669 9789)
(3466 3588 3573 3763 3609 3591)
(6636 6768 6874 6777 6526 6686)
(5501 5464 5584 5724 5661 5709)
(7813 7927 7992 7826 7895 7626)
(3833 3945 3778 3900 3765 3854)
(5994 6101 6048 6145 5908 6070)
(6001 5876 5922 5784 5864 5758)
(7162 7219 7366 7124 6976 7063)
(7033 6941 7128 7115 7243 7233)
(5830 5857 5997 5963 5965 5957)
(3757 3588 3646 3707 3661 3622)
(1741 1711 1882 1707 1837 1865)
(10380 10252 10151 10598 10299 10198)
(8340 7803 8220 8177 8081 7497)
(6283 6564 6377 6365 6029 6298)
(3205 2934 3010 3211 3063 3163)
(6608 7140 7171 6639 6825 6756)
(5373 5268 5465 5408 5606 5301)
(3331 3171 3359 3321 3327 3335)
(1246 1268 1247 1258 1260 1320)
(7191 6868 6906 7106 7331 6815)
(4356 4480 4560 4554 4740 4699)
(3682 3601 3549 3598 3577 3503)
(944 972 934 961 935 949)
)
| false |
ebe2e68a2d1f2054477bb174bef9dc0fa7483a56 | 6858cbebface7beec57e60b19621120da5020a48 | /14/2/1/9.rkt | b09c0df6a61b01543abed1a20fd557aa8f67a853 | []
| no_license | ponyatov/PLAI | a68b712d9ef85a283e35f9688068b392d3d51cb2 | 6bb25422c68c4c7717b6f0d3ceb026a520e7a0a2 | refs/heads/master | 2020-09-17T01:52:52.066085 | 2017-03-28T07:07:30 | 2017-03-28T07:07:30 | 66,084,244 | 2 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 120 | rkt | 9.rkt | <cps-macro-app-1-case-take-1> ::=
[(_ (f a))
#'(lambda (k)
((cps f) (lambda (fv)
((cps a) (lambda (av)
(k (fv av)))))))] | false |
d71c60442a026b7bb53d4465dc861cd9d9d8880f | c161c2096ff80424ef06d144dacdb0fc23e25635 | /chapter3/exercise/ex3.38.rkt | 8fe6a03bc446532e467b61811c7da0b2906b7333 | []
| no_license | tangshipoetry/SICP | f674e4be44dfe905da4a8fc938b0f0460e061dc8 | fae33da93746c3f1fc92e4d22ccbc1153cce6ac9 | refs/heads/master | 2020-03-10T06:55:29.711600 | 2018-07-16T00:17:08 | 2018-07-16T00:17:08 | 129,242,982 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 1,525 | rkt | ex3.38.rkt | #lang racket
假设银行按先来先服务(first come first service) 的方式处理业务,那么 Peter 、 Paul 和 Mary 的交易有以下六种可能的排列方式:
Peter -> Paul -> Mary
Peter -> Mary -> Paul
Paul -> Peter -> Mary
Paul -> Mary -> Peter
Mary -> Peter -> Paul
Mary -> Paul -> Peter
以上的这些排列方式会产生以下的余额值(括号里面表示的是执行操作之后的余额):
Peter (110) -> Paul (90) -> Mary (45)
Peter (110) -> Mary (55) -> Paul (35)
Paul (80) -> Peter (90) -> Mary (45)
Paul (80) -> Mary (40) -> Peter (50)
Mary (50) -> Peter (60) -> Paul (40)
Mary (50) -> Paul (30) -> Peter (40)
Peter 、 Paul 和 Mary每个人分别对应一次读和写的操作,不妨记作:A1,A2(Peter),B1,B2(Paul),C1,C2(Mary),然后对它们进行排列,一共有6!种排法,但是“读”必须在对应的“写”前面,比如对Peter,A1必须在A2前,但在6!中排法中有一半正好是这样的,因此除以2,对Paul,Mary同样操作,故一共有6!/8=90种不同的排法,也就对应90种不同交错方式,但是需要注意的是结果并没有90种,有重复。枚举列出也不是那么麻烦
分情况
Peter最后完成写,按不同时刻读取有结果:110, 90, 60, 50, 40
Paul 最后完成写,按不同时刻读取有结果:80, 90, 30, 40,35
Mary 最后完成写,按不同时刻读取有结果:50,55,40,45
总结一下也就是 110,90,80,60,55,50,45,40,35,30 共10中不同结果
| false |
b3e6a8ce6fb297aa8bf37c8e425bc2054eab9231 | 139e3e6327a08fe083048c36546f2f2aefdb3015 | /tests/unit-tests.rkt | 5c23092a788825ceb8708c19649723f6df21f160 | [
"MIT"
]
| permissive | LeifAndersen/nanopass-framework-racket | 77d11d76badfb20c5710d6794bb4b591c4a2f7e3 | 562d63e39309b68a035d3f228f3e32fae2265fc3 | refs/heads/master | 2023-08-29T02:11:02.542367 | 2015-09-04T20:29:32 | 2015-09-04T20:29:32 | 29,948,361 | 6 | 2 | null | 2015-09-07T20:55:22 | 2015-01-28T03:20:22 | Racket | UTF-8 | Racket | false | false | 39,707 | rkt | unit-tests.rkt | #lang racket
;;; Copyright (c) 2000-2013 Andrew W. Keep, R. Kent Dybvig
;;; See the accompanying file Copyright for details
(provide unit-tests
ensure-correct-identifiers
maybe-tests
maybe-dots-tests
language-dot-support
maybe-unparse-tests
error-messages)
(require rackunit
"../private/helpers.rkt"
"../private/language.rkt"
"../private/pass.rkt"
"../private/parser.rkt"
"../private/unparser.rkt")
(define primitives '(car cdr cons + - =))
(define primitive? (lambda (x) (memq x primitives)))
(define variable? (lambda (x) (and (symbol? x) (not (primitive? x)))))
(define constant?
(lambda (x)
(or (number? x) (boolean? x) (string? x)
(and (pair? x) (constant? (car x)) (constant? (cdr x))))))
(define-language L0
(terminals
(variable (x))
(constant (c))
(primitive (pr)))
(Expr (e)
(var x)
(quote c)
(begin e0 ... e1)
(if e0 e1 e2)
(lambda (x ...) e0 ... e1)
(let ([x e] ...) e0 ... e1)
(letrec ([x e] ...) e0 ... e1)
(primapp pr e1 ...)
(app e0 e1 ...)))
(define-struct var (sym ref set mset) #:prefab #:constructor-name $make-var)
(define make-var (lambda (sym) ($make-var sym #f #f #f)))
(define-language LUNPARSE
(terminals
(var (x)) => var-sym
(constant (c))
(primitive (pr)))
(Expr (e body)
(var x) => x
(quoted c) => (quote c)
(seq e0 e1) => (begin e0 e1)
(if e0 e1 e2)
(lambda (x ...) e0 ... e1)
(binding (x ...) (e ...) body0 ... body1) => (let ([x e] ...) body0 ... body1)
(recbinding (x ...) (e ...) body0 ... body1) => (letrec ([x e] ...) body0 ... body1)
(primapp pr e1 ...) => (pr e1 ...)
(app e0 e1 ...) => (e0 e1 ...)))
(define-language LBool
(terminals
(boolean (b)))
(Expr (e)
b))
(define-language LBoolLambda
(terminals
(boolean (b))
(symbol (x)))
(Expr (e)
v
x
(lambda (x) e)
(and e0 e1)
(or e0 e1)
(not e)
(e0 e1))
(Value (v)
b))
(define unit-tests
(test-suite "unit-tests"
(test-case "with-output-language"
(check-equal?
'(var a)
(unparse-L0 (with-output-language L0 (in-context Expr `(var a)))))
(check-equal?
'(let ([x '1] [y '2]) (primapp + (var x) (var y)))
(unparse-L0
(with-output-language L0
(in-context Expr
`(let ([x (quote 1)] [y (quote 2)])
(primapp + (var x) (var y)))))))
(check-equal?
'(var a)
(unparse-L0 (with-output-language (L0 Expr) `(var a))))
(check-equal?
'(let ([x '1] [y '2]) (primapp + (var x) (var y)))
(unparse-L0
(with-output-language (L0 Expr)
`(let ([x (quote 1)] [y (quote 2)])
(primapp + (var x) (var y)))))))
(test-case "unparse-language"
(check-equal?
`(quoted 5)
(unparse-LUNPARSE
(with-output-language (LUNPARSE Expr) `(quoted 5))
#t))
(check-equal?
`(seq (quoted 7) (quoted 8))
(unparse-LUNPARSE
(with-output-language (LUNPARSE Expr)
`(seq (quoted 7) (quoted 8)))
#t))
(let ([x.0 (make-var 'x.0)])
(check-equal?
`(var ,x.0)
(unparse-LUNPARSE
(with-output-language (LUNPARSE Expr) `(var ,x.0))
#t)))
(let ([x.1 (make-var 'x.1)]
[x.2 (make-var 'x.2)]
[y.3 (make-var 'y.3)]
[x.4 (make-var 'x.4)]
[zero?.5 (make-var 'zero?.5)]
[*.6 (make-var '*.6)]
[f.7 (make-var 'f.7)])
(check-equal?
`(recbinding (,zero?.5 ,*.6 ,f.7)
((lambda (,x.1) (primapp = (var ,x.1) (quoted 0)))
(lambda (,x.2 ,y.3)
(if (app (var ,zero?.5) (var ,x.2))
(quoted 0)
(if (primapp = (var ,x.2) (quoted 1))
(var ,y.3)
(primapp + (var ,y.3)
(app (var ,*.6)
(primapp - (var ,x.2) (quoted 1))
(var ,y.3))))))
(lambda (,x.4)
(if (app (var ,zero?.5) (var ,x.4))
(quoted 1)
(app (var ,*.6) (var ,x.4)
(app (var ,f.7)
(primapp - (var ,x.4) (quoted 1)))))))
(app (var ,f.7) (quoted 10)))
(unparse-LUNPARSE
(with-output-language (LUNPARSE Expr)
`(recbinding
(,zero?.5 ,*.6 ,f.7)
((lambda (,x.1) (primapp = (var ,x.1) (quoted 0)))
(lambda (,x.2 ,y.3)
(if (app (var ,zero?.5) (var ,x.2))
(quoted 0)
(if (primapp = (var ,x.2) (quoted 1))
(var ,y.3)
(primapp + (var ,y.3)
(app (var ,*.6)
(primapp - (var ,x.2) (quoted 1))
(var ,y.3))))))
(lambda (,x.4)
(if (app (var ,zero?.5) (var ,x.4))
(quoted 1)
(app (var ,*.6) (var ,x.4)
(app (var ,f.7)
(primapp - (var ,x.4) (quoted 1)))))))
(app (var ,f.7) (quoted 10)))) #t)))
(check-equal?
'(quote 5)
(unparse-LUNPARSE
(with-output-language (LUNPARSE Expr) `(quoted 5))
#f))
(check-equal?
'(begin (quote 7) (quote 8))
(unparse-LUNPARSE
(with-output-language (LUNPARSE Expr)
`(seq (quoted 7) (quoted 8)))
#f))
(let ([x.0 (make-var 'x.0)])
(check-equal?
'x.0
(unparse-LUNPARSE
(with-output-language (LUNPARSE Expr) `(var ,x.0))
#f)))
(let ([x.1 (make-var 'x.1)]
[x.2 (make-var 'x.2)]
[y.3 (make-var 'y.3)]
[x.4 (make-var 'x.4)]
[zero?.5 (make-var 'zero?.5)]
[*.6 (make-var '*.6)]
[f.7 (make-var 'f.7)])
(check-equal?
'(letrec ([zero?.5 (lambda (x.1) (= x.1 '0))]
[*.6 (lambda (x.2 y.3)
(if (zero?.5 x.2)
'0
(if (= x.2 '1)
y.3
(+ y.3 (*.6 (- x.2 '1) y.3)))))]
[f.7 (lambda (x.4)
(if (zero?.5 x.4)
'1
(*.6 x.4 (f.7 (- x.4 '1)))))])
(f.7 '10))
(unparse-LUNPARSE
(with-output-language (LUNPARSE Expr)
`(recbinding
(,zero?.5 ,*.6 ,f.7)
((lambda (,x.1) (primapp = (var ,x.1) (quoted 0)))
(lambda (,x.2 ,y.3)
(if (app (var ,zero?.5) (var ,x.2))
(quoted 0)
(if (primapp = (var ,x.2) (quoted 1))
(var ,y.3)
(primapp + (var ,y.3)
(app (var ,*.6)
(primapp - (var ,x.2) (quoted 1))
(var ,y.3))))))
(lambda (,x.4)
(if (app (var ,zero?.5) (var ,x.4))
(quoted 1)
(app (var ,*.6) (var ,x.4)
(app (var ,f.7)
(primapp - (var ,x.4) (quoted 1)))))))
(app (var ,f.7) (quoted 10)))) #f)))
)
(test-case "boolean-terminals"
(let ()
(define-parser parse-LBool LBool)
(check-equal? #t (parse-LBool #t)))
(let ()
(define-parser parse-LBool LBool)
(check-equal? #f (parse-LBool #f)))
(let ()
(define-parser parse-LBool LBool)
(with-handlers ([exn:fail? (lambda (x) #t)])
(check-equal? 'a (parse-LBool 'a))))
(let ()
(define-parser parse-LBoolLambda LBoolLambda)
(check-equal? #t (parse-LBoolLambda #t)))
(let ()
(define-parser parse-LBoolLambda LBoolLambda)
(check-equal? #f (parse-LBoolLambda #f)))
(let ()
(define-parser parse-LBoolLambda LBoolLambda)
(check-equal?
'(lambda (x) #f)
(unparse-LBoolLambda
(parse-LBoolLambda '(lambda (x) #f)))))
(let ()
(define-parser parse-LBoolLambda LBoolLambda)
(check-equal?
'(lambda (f) (f #f))
(unparse-LBoolLambda
(parse-LBoolLambda '(lambda (f) (f #f))))))
(let ()
(define-parser parse-LBoolLambda LBoolLambda)
(check-equal?
'(lambda (f) (not (f #f)))
(unparse-LBoolLambda
(parse-LBoolLambda '(lambda (f) (not (f #f))))))))))
(define datum?
(lambda (x)
(or (number? x) (string? x) (symbol? x)
(and (pair? x) (datum? (car x)) (datum? (cdr x)))
(and (vector? x) (andmap datum? (vector->list x))))))
(define-language LVAR
(terminals
(var (x))
(primitive (pr))
(datum (d)))
(Expr (e)
(var x)
(quote d)
(if e0 e1 e2)
(begin e0 ... e1)
(let ([x e] ...) e1)
(letrec ([x e] ...) e1)
(app e0 e1 ...)
(primapp pr e ...)))
(define-pass break-variable : LVAR (ir) -> LVAR ()
(definitions
(define var? symbol?))
(Expr : Expr (ir) -> Expr ()
[(var ,x) (printf "found var: ~a\n" (var-sym x)) `(var ,x)]))
(define ensure-correct-identifiers
(test-suite "ensure-correct-identifiers"
(test-case "accidental-variable?-capture"
(check-equal?
(with-output-to-string
(lambda ()
(break-variable
(with-output-language (LVAR Expr)
`(var ,(make-var 'x))))))
"found var: x\n"))))
(define-language Lmaybe
(terminals
(boolean (b))
(integer (i)))
(Exp (e)
(Int i)
(Bool b)
(Bar (maybe i) e)
(Foo i (maybe e))))
(define-parser parse-Lmaybe Lmaybe)
(define maybe-tests
(test-suite "maybe-tests"
(test-case "maybe-parse/unparse"
(check-equal?
'(Int 72)
(unparse-Lmaybe (parse-Lmaybe '(Int 72))))
(check-equal?
'(Bool #t)
(unparse-Lmaybe (parse-Lmaybe '(Bool #t))))
(check-equal?
'(Bar 5 (Bool #t))
(unparse-Lmaybe (parse-Lmaybe '(Bar 5 (Bool #t)))))
(check-equal?
'(Bar #f (Bool #t))
(unparse-Lmaybe (parse-Lmaybe '(Bar #f (Bool #t)))))
(check-equal?
'(Foo 5 #f)
(unparse-Lmaybe (parse-Lmaybe '(Foo 5 #f))))
(check-equal?
'(Foo 5 (Foo 4 (Foo 3 #f)))
(unparse-Lmaybe (parse-Lmaybe '(Foo 5 (Foo 4 (Foo 3 #f))))))
(check-equal?
'(Foo 5 (Bar 3 (Foo 1 #f)))
(unparse-Lmaybe (parse-Lmaybe '(Foo 5 (Bar 3 (Foo 1 #f))))))
(check-equal?
'(Foo 5 (Int 3))
(unparse-Lmaybe (parse-Lmaybe '(Foo 5 (Int 3))))))
(test-case "maybe-with-output-language/unparse"
(check-equal?
'(Int 72)
(unparse-Lmaybe (with-output-language (Lmaybe Exp) `(Int 72))))
(check-equal?
'(Bool #t)
(unparse-Lmaybe (with-output-language (Lmaybe Exp) `(Bool #t))))
(check-equal?
'(Bar 5 (Bool #t))
(unparse-Lmaybe (with-output-language (Lmaybe Exp) `(Bar 5 (Bool #t)))))
(check-equal?
'(Bar #f (Bool #t))
(unparse-Lmaybe (with-output-language (Lmaybe Exp) `(Bar #f (Bool #t)))))
(check-equal?
'(Foo 5 #f)
(unparse-Lmaybe (with-output-language (Lmaybe Exp) `(Foo 5 #f))))
(check-equal?
'(Foo 5 (Foo 4 (Foo 3 #f)))
(unparse-Lmaybe (with-output-language (Lmaybe Exp) `(Foo 5 (Foo 4 (Foo 3 #f))))))
(check-equal?
'(Foo 5 (Bar 3 (Foo 1 #f)))
(unparse-Lmaybe (with-output-language (Lmaybe Exp) `(Foo 5 (Bar 3 (Foo 1 #f))))))
(check-equal?
'(Foo 5 (Int 3))
(unparse-Lmaybe (with-output-language (Lmaybe Exp) `(Foo 5 (Int 3))))))
(test-case "maybe-pass"
(let ()
(define-pass add-one-int : Lmaybe (ir) -> Lmaybe ()
(Exp : Exp (ir) -> Exp ()
[(Int ,i) `(Int ,(+ i 1))]))
(and
(check-equal?
'(Int 4)
(unparse-Lmaybe (add-one-int (with-output-language (Lmaybe Exp) `(Int 3)))))
(check-equal?
'(Foo 4 (Int 4))
(unparse-Lmaybe (add-one-int (with-output-language (Lmaybe Exp) `(Foo 4 (Int 3))))))
(check-equal?
'(Foo 4 (Foo 5 (Int 3)))
(unparse-Lmaybe (add-one-int (with-output-language (Lmaybe Exp) `(Foo 4 (Foo 5 (Int 2)))))))
(check-equal?
'(Foo 3 #f)
(unparse-Lmaybe (add-one-int (with-output-language (Lmaybe Exp) `(Foo 3 #f)))))
(check-equal?
'(Bar #f (Int 5))
(unparse-Lmaybe (add-one-int (with-output-language (Lmaybe Exp) `(Bar #f (Int 4))))))))
(let ()
(define-pass add-one : Lmaybe (ir) -> Lmaybe ()
(Exp : Exp (ir) -> Exp ()
[(Foo ,i ,[e?]) `(Foo ,(+ i 1) ,e?)]
[(Bar ,i? ,[e]) `(Bar ,(and i? (+ i? 1)) ,e)]
[(Int ,i) `(Int ,(+ i 1))]))
(and
(check-equal?
'(Int 4)
(unparse-Lmaybe (add-one (with-output-language (Lmaybe Exp) `(Int 3)))))
(check-equal?
'(Foo 5 (Int 4))
(unparse-Lmaybe (add-one (with-output-language (Lmaybe Exp) `(Foo 4 (Int 3))))))
(check-equal?
'(Foo 5 (Foo 6 (Int 3)))
(unparse-Lmaybe (add-one (with-output-language (Lmaybe Exp) `(Foo 4 (Foo 5 (Int 2)))))))
(check-equal?
'(Foo 4 (Bar 6 (Foo 7 #f)))
(unparse-Lmaybe (add-one (with-output-language (Lmaybe Exp) `(Foo 3 (Bar 5 (Foo 6 #f)))))))
(check-equal?
'(Foo 4 (Bar #f (Foo 7 #f)))
(unparse-Lmaybe (add-one (with-output-language (Lmaybe Exp) `(Foo 3 (Bar #f (Foo 6 #f))))))))))))
(define-language Lmaybe2
(terminals
(boolean (b))
(integer (i)))
(Exp (e)
(Int i)
(Bool b)
(Bar (maybe i) ... e)
(Foo i (maybe e) ...)))
(define-parser parse-Lmaybe2 Lmaybe2)
(define maybe-dots-tests
(test-suite "maybe-dots-tests"
(test-case "maybe-parse/unparse"
(check-equal?
'(Foo 3)
(unparse-Lmaybe2 (parse-Lmaybe2 '(Foo 3))))
(check-equal?
'(Bar (Int 72))
(unparse-Lmaybe2 (parse-Lmaybe2 '(Bar (Int 72)))))
(check-equal?
'(Int 72)
(unparse-Lmaybe2 (parse-Lmaybe2 '(Int 72))))
(check-equal?
'(Bool #t)
(unparse-Lmaybe2 (parse-Lmaybe2 '(Bool #t))))
(check-equal?
'(Bar 5 (Bool #t))
(unparse-Lmaybe2 (parse-Lmaybe2 '(Bar 5 (Bool #t)))))
(check-equal?
'(Bar #f (Bool #t))
(unparse-Lmaybe2 (parse-Lmaybe2 '(Bar #f (Bool #t)))))
(check-equal?
'(Bar #f 1 #f 2 #f 3 (Bool #t))
(unparse-Lmaybe2 (parse-Lmaybe2 '(Bar #f 1 #f 2 #f 3 (Bool #t)))))
(check-equal?
'(Bar 1 #f 2 #f 3 #f (Bool #t))
(unparse-Lmaybe2 (parse-Lmaybe2 '(Bar 1 #f 2 #f 3 #f (Bool #t)))))
(check-equal?
'(Foo 5 #f)
(unparse-Lmaybe2 (parse-Lmaybe2 '(Foo 5 #f))))
(check-equal?
'(Foo 5 #f #f (Bar 3 (Foo 2 #f)) (Bool #t) #f #f (Int 2) #f)
(unparse-Lmaybe2 (parse-Lmaybe2 '(Foo 5 #f #f (Bar 3 (Foo 2 #f)) (Bool #t) #f #f (Int 2) #f))))
(check-equal?
'(Foo 5 (Foo 4 (Foo 3 #f (Bool #t) (Int 3))))
(unparse-Lmaybe2 (parse-Lmaybe2 '(Foo 5 (Foo 4 (Foo 3 #f (Bool #t) (Int 3)))))))
(check-equal?
'(Foo 5 (Bar 3 (Foo 1 (Bar 2 (Bool #t)) #f #f)))
(unparse-Lmaybe2 (parse-Lmaybe2 '(Foo 5 (Bar 3 (Foo 1 (Bar 2 (Bool #t)) #f #f))))))
(check-equal?
'(Foo 5 (Int 3) (Bool #f))
(unparse-Lmaybe2 (parse-Lmaybe2 '(Foo 5 (Int 3) (Bool #f))))))
(test-case "maybe-with-output-language/unparse"
(check-equal?
'(Foo 3)
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Foo 3))))
(check-equal?
'(Bar (Int 72))
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Bar (Int 72)))))
(check-equal?
'(Int 72)
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Int 72))))
(check-equal?
'(Bool #t)
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Bool #t))))
(check-equal?
'(Bar 5 (Bool #t))
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Bar 5 (Bool #t)))))
(check-equal?
'(Bar #f (Bool #t))
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Bar #f (Bool #t)))))
(check-equal?
'(Bar #f 1 #f 2 #f 3 (Bool #t))
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Bar #f 1 #f 2 #f 3 (Bool #t)))))
(check-equal?
'(Bar 1 #f 2 #f 3 #f (Bool #t))
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Bar 1 #f 2 #f 3 #f (Bool #t)))))
(check-equal?
'(Foo 5 #f)
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Foo 5 #f))))
(check-equal?
'(Foo 5 #f #f (Bar 3 (Foo 2 #f)) (Bool #t) #f #f (Int 2) #f)
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Foo 5 #f #f (Bar 3 (Foo 2 #f)) (Bool #t) #f #f (Int 2) #f))))
(check-equal?
'(Foo 5 (Foo 4 (Foo 3 #f (Bool #t) (Int 3))))
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Foo 5 (Foo 4 (Foo 3 #f (Bool #t) (Int 3)))))))
(check-equal?
'(Foo 5 (Bar 3 (Foo 1 (Bar 2 (Bool #t)) #f #f)))
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Foo 5 (Bar 3 (Foo 1 (Bar 2 (Bool #t)) #f #f))))))
(check-equal?
'(Foo 5 (Int 3) (Bool #f))
(unparse-Lmaybe2 (with-output-language (Lmaybe2 Exp) `(Foo 5 (Int 3) (Bool #f))))))
(test-case "maybe-pass"
(let ()
(define-pass add-one-int : Lmaybe2 (ir) -> Lmaybe2 ()
(Exp : Exp (ir) -> Exp ()
[(Int ,i) `(Int ,(+ i 1))]))
(and
(check-equal?
'(Int 4)
(unparse-Lmaybe2 (add-one-int (with-output-language (Lmaybe2 Exp) `(Int 3)))))
(check-equal?
'(Foo 4 (Int 4) (Int 5) (Int 7) #f #f (Int 8))
(unparse-Lmaybe2 (add-one-int (with-output-language (Lmaybe2 Exp) `(Foo 4 (Int 3) (Int 4) (Int 6) #f #f (Int 7))))))
(check-equal?
'(Foo 4 (Foo 5 (Int 3) #f (Int 4) (Int 5)))
(unparse-Lmaybe2 (add-one-int (with-output-language (Lmaybe2 Exp) `(Foo 4 (Foo 5 (Int 2) #f (Int 3) (Int 4)))))))
(check-equal?
'(Foo 3 #f (Int 4))
(unparse-Lmaybe2 (add-one-int (with-output-language (Lmaybe2 Exp) `(Foo 3 #f (Int 3))))))
(check-equal?
'(Bar 3 #f 4 #f (Int 4))
(unparse-Lmaybe2 (add-one-int (with-output-language (Lmaybe2 Exp) `(Bar 3 #f 4 #f (Int 3))))))))
(let ()
(define-pass add-one : Lmaybe2 (ir) -> Lmaybe2 ()
(Exp : Exp (ir) -> Exp ()
[(Foo ,i ,[e?*] ...) `(Foo ,(+ i 1) ,e?* ...)]
[(Bar ,i?* ... ,[e]) `(Bar ,(map (lambda (i?) (and i? (+ i? 1))) i?*) ... ,e)]
[(Int ,i) `(Int ,(+ i 1))]))
(and
(check-equal?
'(Int 4)
(unparse-Lmaybe2 (add-one (with-output-language (Lmaybe2 Exp) `(Int 3)))))
(check-equal?
'(Foo 5 (Int 4) (Int 5) (Int 6) #f (Int 8))
(unparse-Lmaybe2 (add-one (with-output-language (Lmaybe2 Exp) `(Foo 4 (Int 3) (Int 4) (Int 5) #f (Int 7))))))
(check-equal?
'(Foo 5 (Foo 6 (Int 3) (Bar 4 3 2 #f 1 (Foo 3 (Int 8) (Int 9)))))
(unparse-Lmaybe2 (add-one (with-output-language (Lmaybe2 Exp) `(Foo 4 (Foo 5 (Int 2) (Bar 3 2 1 #f 0 (Foo 2 (Int 7) (Int 8)))))))))
(check-equal?
'(Foo 4 (Bar 6 #f 8 #f 9 (Foo 7 #f)) (Bool #t) #f)
(unparse-Lmaybe2 (add-one (with-output-language (Lmaybe2 Exp) `(Foo 3 (Bar 5 #f 7 #f 8 (Foo 6 #f)) (Bool #t) #f)))))
(check-equal?
'(Foo 4 (Bar #f (Foo 7 #f)) (Bool #t) #f)
(unparse-Lmaybe2 (add-one (with-output-language (Lmaybe2 Exp) `(Foo 3 (Bar #f (Foo 6 #f)) (Bool #t) #f))))))))))
(define-language LMaybeNoBool
(terminals
(symbol (x))
(number (n)))
(Expr (e)
(foo x (maybe n))
(bar (maybe e) x)
(num n)
(ref x)))
(define-language LMaybeListNoBool
(terminals
(symbol (x))
(number (n)))
(Expr (e)
(foo ([x (maybe n)] ...) e)
(bar (maybe e) ... x)
(num n)
(ref x)))
(define maybe-unparse-tests
(test-suite "maybe-unparse-tests"
(test-case "maybe-unparse"
(check-equal? '(foo x 10)
(unparse-LMaybeNoBool
(with-output-language (LMaybeNoBool Expr)
`(foo x 10))))
(check-equal? '(bar (foo x #f) x)
(unparse-LMaybeNoBool
(with-output-language (LMaybeNoBool Expr)
`(bar (foo x #f) x))))
(check-equal? '(bar (bar (foo y #f) y) z)
(unparse-LMaybeNoBool
(with-output-language (LMaybeNoBool Expr)
`(bar (bar (foo y #f) y) z))))
(check-equal? '(bar (bar (bar #f x) y) z)
(unparse-LMaybeNoBool
(with-output-language (LMaybeNoBool Expr)
`(bar (bar (bar #f x) y) z)))))
(test-case "maybe-unparse-dots"
(check-equal? '(foo ([x 10] [y 12]) (ref x))
(unparse-LMaybeListNoBool
(with-output-language (LMaybeListNoBool Expr)
`(foo ([x 10] [y 12]) (ref x)))))
(check-equal? '(foo ([x #f] [y 12] [z #f]) (ref y))
(unparse-LMaybeListNoBool
(with-output-language (LMaybeListNoBool Expr)
`(foo ([x #f] [y 12] [z #f]) (ref y)))))
(check-equal? '(bar #f #f (num 10) (ref x) #f (foo ([x #f] [y 10] [z 5] [w #f]) (bar #f z)) #f w)
(unparse-LMaybeListNoBool
(with-output-language (LMaybeListNoBool Expr)
`(bar #f #f (num 10) (ref x) #f (foo ([x #f] [y 10] [z 5] [w #f]) (bar #f z)) #f w)))))))
;; tests related to issue #7 on github.com
(define-language LPairs
(terminals
(symbol (x))
(null (n)))
(Expr (e)
x
n
(e0 . e1)))
(define-parser parse-LPairs LPairs)
(define-pass reverse-pairs : LPairs (p) -> LPairs ()
(Expr : Expr (p) -> Expr ()
[(,[e0] . ,[e1]) `(,e1 . ,e0)]))
(define-language LList
(terminals
(symbol (x))
(null (n)))
(Expr (e)
x
n
(e0 ... . e1)))
(define-parser parse-LList LList)
(define-language LList2
(terminals
(symbol (x))
(null (n)))
(Expr (e)
x
n
(e0 ... e1)))
(define-pass swap-parts : LList (e) -> LList ()
(Expr : Expr (e) -> Expr ()
[(,[e*] ... . ,[e])
`(,e ,e* ... . ())]))
;; example provided by Simon Stapleton via bug #7
(define-language Lx
(terminals
(symbol (x)))
(Expr (e)
x
(lambda (x* ... . x) e)
(define (x x* ... . x1) e)
(define x e)))
(define-parser parse-Lx Lx)
(define-pass Px1 : Lx (ir) -> Lx ()
(Expr : Expr (ir) -> Expr()
[(define (,x ,x* ... . ,x1) ,[e])
`(define ,x (lambda (,x* ... . ,x1) ,e))]))
(define language-dot-support
(test-suite "language-dot-support"
(test-case "simple-dots"
(check-equal?
'()
(unparse-LPairs (parse-LPairs '())))
(check-equal?
'a
(unparse-LPairs (parse-LPairs 'a)))
(check-equal?
'(a)
(unparse-LPairs (parse-LPairs '(a))))
(check-equal?
'(a . b)
(unparse-LPairs (parse-LPairs '(a . b))))
(check-equal?
'(a b c . d)
(unparse-LPairs (parse-LPairs '(a b c . d))))
(check-equal?
'(((a b . c) d e) f . g)
(unparse-LPairs (parse-LPairs '(((a b . c) d e) f . g))))
(check-equal?
'()
(unparse-LPairs (with-output-language (LPairs Expr) `())))
(check-equal?
'a
(unparse-LPairs (with-output-language (LPairs Expr) `a)))
(check-equal?
'(a)
(unparse-LPairs (with-output-language (LPairs Expr) `(a))))
(check-equal?
'(a . b)
(unparse-LPairs (with-output-language (LPairs Expr) `(a . b))))
(check-equal?
'(a b c . d)
(unparse-LPairs (with-output-language (LPairs Expr) `(a b c . d))))
(check-equal?
'(((a b . c) d e) f . g)
(unparse-LPairs (with-output-language (LPairs Expr) `(((a b . c) d e) f . g))))
(check-equal?
'(() . a)
(unparse-LPairs (reverse-pairs (parse-LPairs '(a)))))
(check-equal?
'(b . a)
(unparse-LPairs (reverse-pairs (parse-LPairs '(a . b)))))
(check-equal?
'(((d . c) . b) . a)
(unparse-LPairs (reverse-pairs (parse-LPairs '(a b c . d)))))
(check-equal?
'((g . f) ((() . e) . d) (c . b) . a)
(unparse-LPairs (reverse-pairs (parse-LPairs '(((a b . c) d e) f . g))))))
(test-case "dot-after-ellipsis"
(check-equal?
'()
(unparse-LList (parse-LList '())))
(check-equal?
'x
(unparse-LList (parse-LList 'x)))
(check-equal?
'(a b c)
(unparse-LList (parse-LList '(a b c))))
(check-equal?
'(a b c . d)
(unparse-LList (parse-LList '(a b c . d))))
(check-equal?
'(((a b) (c d)) e . f)
(unparse-LList (parse-LList '(((a b) (c d)) e . f))))
(check-equal?
'()
(unparse-LList (with-output-language (LList Expr) `())))
(check-equal?
'x
(unparse-LList (with-output-language (LList Expr) `x)))
(check-equal?
'(a b c)
(unparse-LList (with-output-language (LList Expr) `(a b c))))
(check-equal?
'(a b c . d)
(unparse-LList (with-output-language (LList Expr) `(a b c . d))))
(check-equal?
'(((a b) (c d)) e . f)
(unparse-LList (with-output-language (LList Expr) `(((a b) (c d)) e . f))))
(check-equal?
'(() a b c)
(unparse-LList (swap-parts (with-output-language (LList Expr) `(a b c)))))
(check-equal?
'(d a b c)
(unparse-LList (swap-parts (with-output-language (LList Expr) `(a b c . d)))))
(check-equal?
'(f (() (() a b) (() c d)) e)
(unparse-LList (swap-parts (with-output-language (LList Expr) `(((a b) (c d)) e . f))))))
(test-case "github-issue-7"
(check-equal?
'x
(unparse-Lx (parse-Lx 'x)))
(check-equal?
'(lambda (x . z) x)
(unparse-Lx (parse-Lx '(lambda (x . z) x))))
(check-equal?
'(lambda (x y . z) x)
(unparse-Lx (parse-Lx '(lambda (x y . z) x))))
(check-equal?
'(lambda x x)
(unparse-Lx (parse-Lx '(lambda x x))))
(check-equal?
'(define (x y . z) z)
(unparse-Lx (parse-Lx '(define (x y . z) z))))
(check-equal?
'(define x x)
(unparse-Lx (parse-Lx '(define x x))))
(check-equal?
'(define (l m . n)
(define g
(lambda (x . z)
(lambda (a . b)
(lambda (c . d)
l)))))
(unparse-Lx (parse-Lx '(define (l m . n)
(define g
(lambda (x . z)
(lambda (a . b)
(lambda (c . d)
l))))))))
(check-equal?
'x
(unparse-Lx (with-output-language (Lx Expr) `x)))
(check-equal?
'(lambda (x . z) x)
(unparse-Lx (with-output-language (Lx Expr) `(lambda (x . z) x))))
(check-equal?
'(lambda (x y . z) x)
(unparse-Lx (with-output-language (Lx Expr) `(lambda (x y . z) x))))
(check-equal?
'(define (x y . z) z)
(unparse-Lx (with-output-language (Lx Expr) `(define (x y . z) z))))
(check-equal?
'(lambda x x)
(unparse-Lx (with-output-language (Lx Expr) `(lambda x x))))
(check-equal?
'(define x x)
(unparse-Lx (with-output-language (Lx Expr) `(define x x))))
(check-equal?
'(define (l m . n)
(define g
(lambda (x . z)
(lambda (a . b)
(lambda (c . d)
l)))))
(unparse-Lx (with-output-language (Lx Expr) `(define (l m . n)
(define g
(lambda (x . z)
(lambda (a . b)
(lambda (c . d)
l))))))))
(check-equal?
'(define f (lambda (x . y) x))
(unparse-Lx (Px1 (parse-Lx '(define (f x . y) x)))))
(check-equal?
'(define g (lambda (x y z . w) w))
(unparse-Lx (Px1 (parse-Lx '(define (g x y z . w) w)))))
(check-equal?
'(define h (lambda (x y . z) (define i (lambda (a b c . d) d))))
(unparse-Lx (Px1 (parse-Lx '(define (h x y . z) (define (i a b c . d) d))))))
(check-equal?
'(define f (lambda x (define g (lambda y x))))
(unparse-Lx (Px1 (parse-Lx '(define (f . x) (define (g . y) x)))))))))
(define-language LMULTI
(terminals
(var (x))
(primitive (pr))
(datum (d)))
(Expr (e)
(var x)
(primref pr)
(quote d)
(if e0 e1 e2)
(begin e0 ... e1)
(let ([x e] ...) e1)
(letrec ([x le] ...) e)
(app e0 e1 ...))
(LambdaExpr (le)
(lambda (x ...) e)
(case-lambda cl ...))
(CaseLambdaClause (cl)
(clause (x ...) e)))
#;(test-suite error-messages
(
))
(define-language L-list-tagged
(entry Expr)
(terminals
(symbol (x))
(syntax (s)))
(Binding (b)
[(x ...) e])
(Expr (e)
x
(e1 e2)
(let-values s (b ...) e0 e1 ...)))
(define error-messages
(test-suite "error-messages"
(test-case "error-regressions"
(check-exn
#rx"unexpected constant as pattern, maybe missing unquote?"
(lambda ()
(eval #'(let ()
;; error reported against Racket version of nanopass-framework
;; from Jens Axel Søgaard
;; (github.com/akeep/nanoass-framework-racket issue #9)
(define (constant? c) (number? c))
(define-language L
(terminals
(constant (c)))
(Expr (e)
c))
(define (parse v)
(with-output-language (L Expr)
(cond
[(number? v) `,v]
[else (error 'parse "got: ~s" v)])))
(define-pass add1 : L (e) -> L ()
(Expr : Expr (e) -> Expr ()
[c (guard (even? c)) (+ c 1)]))
(add1 (parse 42))))))
(check-exn
#rx"unrecognized base language name"
(lambda ()
(eval #'(let ()
;; error reported against Racket version of nanopass-framework
;; from Jens Axel Søgaard
;; (github.com/akeep/nanopass-framework-racket issue #11)
(define-language L1 (extends Lsrc) (Expr (e) (- (if e0 e1))))))))
(check-exn
#rx"unrecognized language name"
(lambda ()
(eval #'(let ()
;; error reported against Racket version of nanopass-framework
;; from Jens Axel Søgaard
;; (github.com/akeep/nanopass-framework-racket issue #12)
(define-pass pass1 : * (s-exp) -> L () 42)))))
;; variations on the issue #12 reports
(check-exn
#rx"unrecognized language name"
(lambda ()
(eval #'(define-pass pass1 : L (s-exp) -> * (x) 42))))
(check-exn
#rx"unrecognized language name"
(lambda ()
(eval #'(define-parser parse-Lundefined Lundefined))))
(check-exn
#rx"unrecognized language name"
(lambda ()
(eval #'(define-unparser unparse-Lundefined Lundefined))))
(check-exn
#rx"unrecognized language name"
(lambda ()
(eval #'(language->s-expression Lundefined))))
(check-exn
#rx"unrecognized base language name"
(lambda ()
(eval #'(diff-languages Lundefined1 Lundefined2))))
(check-exn
#rx"unrecognized target language name"
(lambda ()
(eval #'(let ()
(define-language L
(terminals
(symbol (x)))
(Expr (e)
x
(lambda (x) e)
(e0 e1)))
(diff-languages L Lundefined2)))))
(check-exn
#rx"unrecognized base language name"
(lambda ()
(eval #'(let ()
(define-language L
(terminals
(symbol (x)))
(Expr (e)
x
(lambda (x) e)
(e0 e1)))
(diff-languages Lundefined2 L)))))
(check-exn
#rx"unrecognized language name"
(lambda ()
(eval #'(prune-language Lundefined))))
(check-exn
#rx"unrecognized language name"
(lambda ()
(eval #'(define-pruned-language Lundefined L))))
(check-exn
#rx"unrecognized terminal syntax"
(lambda ()
(eval #'(let ()
;; error reported against Racket version of nanopass-framework
;; from Jens Axel Søgaard
;; (github.com/akeep/nanopass-framework-racket issue #13)
(define-language L
(terminals
(symbol x))
(Term (M)
x))))))
(check-exn
#rx"unrecognized L2 language form"
(lambda ()
(eval #'(let ()
;; error reported against Racket version of nanopass-framework
;; from Jens Axel Søgaard
;; (github.com/akeep/nanopass-framework-racket issue #14)
(define-language L1
(terminals (symbol (x)))
(Term (M)
(foo x)))
(define-language L2
(terminals (symbol (x)))
(Term (M)
(foo x)))
(unparse-L2 (with-output-language (L1 Term) `(foo a)))))))
(check-exn
#rx"parse: unrecognized output non-terminal\n in: Foo"
(lambda ()
(eval #'(let ()
(define-language Lsrc
(entry Expr)
(terminals
(symbol (x)))
(Expr (e)
x))
(define-pass parse : * (stx) -> Lsrc ()
(definitions)
(foo : * (E) -> Foo ()
`,'t)
(foo stx))))))
(check-exn
#rx"define-language: expected nonterminal clause of the form"
(lambda ()
;; error reported against Racket version of nanopass-framework
;; from Jens Axel Søgaard
;; (github.com/akeep/nanopass-framework-racket issue #22)
(eval #'(define-language L
(entry Expr)
(terminals (number (r)))
(Expr r)))))
(check-exn
#px"define-pass: cannot find a transformer that accepts input type symbol and output type symbol,\\s+and cannot generate one when either the input or output type is a terminal"
(lambda ()
;; error reported against Racket version of nanopass-framework
;; from Jens Axel Søgaard
;; (github.com/akeep/nanopass-framework-racket issue #27)
(eval #'(let ()
(define-language L
(entry Expr)
(terminals
(symbol (x)))
(Expr (e)
x
(x (... ...))))
(define-language L1 (extends L)
(Expr (e)
(+ (call e0 (... ...)) => (e0 (... ...)))))
(define-pass pass1 : L (E) -> L1 ()
(Expr : Expr (E) -> Expr ()
[(,[x] (... ...)) `(call ,x (... ...))]))))))
(check-exn
#rx"define-language: expected symbol keyword or meta-variable reference at start of nonterminal production"
(lambda ()
;; error reported against Racket version of nanopass-framework
;; from Jens Axel Søgaard
;; (github.com/akeep/nanopass-framework-racket issue #28)
(eval #'(define-language L
(terminals
(symbol (x)))
(entry Expr)
(Expr (e)
(1 2)
(e0 e1))))))
(check-exn
#rx"define-language: expected meta-variable reference or pattern in nonterminal production"
(lambda ()
;; related to error reported against Racket version of nanopass-framework
;; from Jens Axel Søgaard
;; (github.com/akeep/nanopass-framework-racket issue #28)
(eval #'(define-language L
(terminals
(symbol (x)))
(entry Expr)
(Expr (e)
(bob 2)
(e0 e1))))))
(check-exn
#rx"define-language: duplicate production in add\n at: s"
(lambda ()
;; error reported against Racket version of nanopass-framework
;; from Jens Axel Søgaard
;; (github.com/akeep/nanopass-framework-racket issue #33)
(eval #'(let ()
(define-language L
(entry e)
(terminals
(symbol (s)))
(Expr (e)
s))
(define-language L1 (extends L)
(Expr (e)
(+ s)))))))
(check-exn
#rx"invalid transformer clause"
(lambda ()
;; error reported against Racket version of nanopass-framework
;; from Jens Axel Søgaard
;; (github.com/akeep/nanopass-framework-racket issue #40)
(eval #'(let ()
(define-language L
(terminals
(symbol (s)))
(Expr (e)
s
(lambda (s) e)
(e0 s1)))
(define-pass foo : L (ir) -> * ()
(Expr : Expr (e) -> * ()
[(lambda (,s) ,e (list 'lambda (list s) (Expr e)))]
[(,e0 ,e1) (list (Expr e0) (Expr e1))]
[,s s])
(Expr ir))))))
)))
| false |
b28b177a80aeb590d8bd5597faebced66a472e21 | 4dd1b42e32ca1825271b3f51b76df930a66d6fbd | /day_3/morning_1.rkt | 454901635c3f5a0b73c3cbe8234c6819a04a79fa | []
| no_license | CorbanSwain/Racket-Summer-School-2018 | e3f7117063ffefeeb8439aa3023739ba9233b131 | cefaad755d80572e9e1253b7e8d4390dd77eb066 | refs/heads/master | 2020-03-22T16:02:51.235496 | 2018-07-14T06:44:08 | 2018-07-14T06:44:08 | 140,299,128 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 127 | rkt | morning_1.rkt | #lang racket
(define ip (open-input-string "(Some cool text (no)) (foo)"))
(read ip)
(list? (read ip))
(eof-object? (read ip))
| false |
0c5266ce5fa37a0a19389b8c9e555725eda0559c | 799b5de27cebaa6eaa49ff982110d59bbd6c6693 | /soft-contract/test/gradual-typing-benchmarks/take5/card-pool.rkt | 8b40c503ac0f8572a87c92e0fa568fd6bf7c4583 | [
"MIT"
]
| permissive | philnguyen/soft-contract | 263efdbc9ca2f35234b03f0d99233a66accda78b | 13e7d99e061509f0a45605508dd1a27a51f4648e | refs/heads/master | 2021-07-11T03:45:31.435966 | 2021-04-07T06:06:25 | 2021-04-07T06:08:24 | 17,326,137 | 33 | 7 | MIT | 2021-02-19T08:15:35 | 2014-03-01T22:48:46 | Racket | UTF-8 | Racket | false | false | 1,664 | rkt | card-pool.rkt | #lang racket/base
;; a representation of the complete deck of cards
(provide
;; { [Listof X] -> [Listof X] }
;; { -> Bulls }
;; -> CardPool
;; create and organize the pool of cards in a random order so that
;; the dealer can hand cards to players and create the initial deck
;;
;; so we can keep things deterministic
;; the first optional argument is a shuffle algorithm for lists
;; the second optional argument generates bulls
create-card-pool)
;; -----------------------------------------------------------------------------
(require
racket/class
"../base/untyped.rkt"
(only-in racket/list shuffle first rest))
(require "card.rkt")
(require (only-in "basics.rkt"
FACE
HAND
MIN-BULL
MAX-BULL
))
;; For the assert
(define (hand? h)
(and (list? h)
(= 10 (length h))
(for/and ([c (in-list h)]) (card? c))))
;; ---------------------------------------------------------------------------------------------------
(define (create-card-pool (shuffle shuffle) (random-bulls random-bulls))
(new card-pool% (shuffle shuffle) (random-bulls random-bulls)))
;; -> Bulls
;; pick a random number of BULLS
(define (random-bulls)
(assert (random MIN-BULL (+ MAX-BULL 1)) bulls?))
(define card-pool%
(class object%
(init-field (shuffle shuffle) (random-bulls random-bulls))
(super-new)
(define my-cards
(shuffle (build-list FACE (lambda (i) (card (assert (+ i 1) face?) (random-bulls))))))
(define/public (draw-card)
(begin0 (first my-cards)
(set! my-cards (rest my-cards))))
(define/public (draw-hand)
(assert (build-list HAND (lambda (_) (draw-card))) hand?))))
| false |
e15402537363282505801e851907a62cb19a01e1 | b544188e9e7517a216abeb93f2aec6d7bb64acd5 | /oauth/parameters.rkt | 556c19d39d985b4c5d82d00c4b783756f92213ad | []
| no_license | lyons/twitter | fc6818cb76ce783a21229415d35179eac7b5f2d5 | ba109f18d78d9a2957ff465fac32b687cef354de | refs/heads/master | 2016-09-05T23:36:03.862956 | 2014-08-21T02:52:06 | 2014-08-21T02:52:06 | 23,165,047 | 2 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 517 | rkt | parameters.rkt | #lang typed/racket/base
(provide (all-defined-out))
;; default value of Accept header
(: oauth-accept (Parameterof String))
(define oauth-accept
(make-parameter "*/*"))
;; default value of User-Agent header
(: oauth-user-agent (Parameterof String))
(define oauth-user-agent
(make-parameter "Racket OAuth Client"))
;; PNRG used for generating nonce
(: oauth-pseudo-random-generator (Parameterof Pseudo-Random-Generator))
(define oauth-pseudo-random-generator
(make-parameter (make-pseudo-random-generator)))
| false |
5b897aee4a2ec8077dfad916e2af4fedc0b354b1 | 94c038f61575ec72929634d05bfa369f524462f1 | /new-derivation/mk-streams-derivation-1.rkt | b7a1fb62033b1e9c974e0a83857d4d95b6fbca6f | [
"MIT"
]
| permissive | jasonhemann/mk-search-w-continuations | b53026134db8224f71ebc5c442d12f1d29a0b303 | aa37bf956fee875b9f503ea3364876ec6fd48580 | refs/heads/master | 2021-08-04T10:13:31.479834 | 2021-07-27T16:31:55 | 2021-07-27T16:31:55 | 236,832,420 | 1 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 4,378 | rkt | mk-streams-derivation-1.rkt | #lang racket
#|
We are beginning with two known/presumed good bits of meaningful theoretical code
The first are the advanced stream-based implementations of traditional microKanren
The second are the known good sk/fk continuation implementations.
(Which have the MonadPlus property via Mitch's paper)
We also know the translation between the two different monad definitions & laws
http://www.ccs.neu.edu/home/dherman/browse/projects/derivations/monad-equiv/monad-equiv.pdf
|#
(module streams-unit-map-join racket
(require (combine-in rackunit racket/promise))
(define (unit a) (list a))
;; These definitions came largely from the Danvy paper
;; Wasn't immediately clear how to write the promise lines for
;; map/join, but got here because map must return a single value
(define ((map f) m)
(cond
((null? m) '())
((promise? m) (delay/name ((map f) m)))
((cons? m) (cons (f (car m)) ((map f) (cdr m))))))
(define (join mma)
(cond
((null? mma) '())
((promise? mma) mma)
((cons? mma) (mplus (car mma) (join (cdr mma))))))
(define (mzero) '())
;; mplus: Ma -> Ma -> Ma
(define (mplus m1 m2)
(cond
((null? m1) m2)
((promise? m1) (delay/name (mplus m2 (force m1))))
((cons? m1) (cons (car m1) (mplus (cdr m1) m2)))))
;; The derived behaviors
(define (return a)
(unit a))
(define ((bind m) f)
(join ((map f) m)))
)
(module streams-bind-return racket
(require (combine-in rackunit racket/promise))
;; return: a -> Ma
(define (return a) (cons a '()))
(define (mzero) '())
;; bind : Ma -> (a -> Mb) -> Mb
(define ((bind m) f)
(cond
((null? m) '())
((promise? m) (delay/name (bind (force m) f)))
((cons? m) (mplus (f (car m)) ((bind (cdr m)) f)))))
;; mplus: Ma -> Ma -> Ma
(define (mplus m1 m2)
(cond
((null? m1) m2)
((promise? m1) (delay/name (mplus m2 (force m1))))
((cons? m1) (cons (car m1) (mplus (cdr m1) m2)))))
;; The derived behaviors
(define (unit a)
(return a))
(define ((map f) m)
((bind m) (λ (a) (unit (f a)))))
(define (join z)
((bind z) (λ (a) a)))
)
(module sk/fk-unit-map-join racket
(require rackunit)
(define (unit a)
(λ (sk)
(λ (fk)
((sk a) fk))))
;; These two definitions came from Mitch's paper
(define (mzero)
(λ (sk)
(λ (fk)
(fk))))
(define (mplus m1 m2)
(λ (sk)
(λ (fk)
((m1 sk)
(λ ()
((m2 sk)
fk))))))
(define ((map f) m)
(λ (sk)
(λ (fk)
((m
(λ (b)
(λ (fk)
((sk (f b)) fk))))
fk))))
(define (join mma)
(λ (sk)
(λ (fk)
((mma
(λ (mb)
(λ (fk)
((mb sk) fk))))
fk))))
;; The derived behaviors
(define (return a)
(unit a))
(define ((bind m) f)
(join ((map f) m)))
)
#|
BTW: For bind in the next module
(m
(λ (b)
(λ (fk)
(((f b)
sk)
fk))))
Because m is a computation in sk/fk, so it first needs a success continuation.
Which we are giving it here.
This is the appropriate sk, because it first takes a pure we can provide f
A sk then eats a fk, which this does. (f b) is a computation
We execute the computation (f a) within the context of the original, smaller sk
(So we've grown the sk by function extension)
And from within the context of whatever new fk we take in.
(See also in Mitch "Relating .." Section 4.2)
|#
(module sk/fk-bind-return racket
(require rackunit)
;; return: a -> Ma
(define (return a)
(λ (sk)
(λ (fk)
((sk a) fk))))
;; bind : Ma -> (a -> Mb) -> Mb
(define ((bind m) f)
(λ (sk)
(λ (fk)
((m
(λ (b)
(λ (fk)
(((f b)
sk)
fk))))
fk))))
;; These two definitions came from Mitch's paper
(define (mzero)
(λ (sk)
(λ (fk)
(fk))))
(define (mplus m1 m2)
(λ (sk)
(λ (fk)
((m1 sk)
(λ ()
((m2 sk)
fk))))))
;; The derived behaviors
(define (unit a)
(return a))
(define ((map f) m)
((bind m) (λ (a) (unit (f a)))))
(define (join z)
((bind z) (λ (a) a)))
)
| false |
8ba982ad5b847da3bf0c73ecf34f3347261c6068 | c65580f6385ed194cbfe213e6d095937987e6e8e | /racket-immutable/immutable.rkt | f74c9127a2c3f1f0a66b23443cf6f6e03ea51924 | [
"MIT"
]
| permissive | AlexKnauth/racket-immutable | d2dd110855e64b39566c5e7fbeb01b5b9b875f7b | ceb8282535b0a14073fd1c420fcdfbcb44fe4913 | refs/heads/master | 2022-01-12T16:05:56.652261 | 2022-01-07T14:32:43 | 2022-01-07T14:32:43 | 99,033,867 | 2 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 12,522 | rkt | immutable.rkt | #lang racket/base
;; This module provides operations that return immutable
;; strings, immutable byte-strings, or immutable vectors.
(provide immutable-string?
immutable-bytes?
immutable-vector?
;; String Operations
make-immutable-string
build-immutable-string
immutable-string
immutable-substring
immutable-string-append
immutable-string-append*
immutable-string-join
list->immutable-string
number->immutable-string
symbol->immutable-string
keyword->immutable-string
immutable-string-normalize-spaces
immutable-string-replace
immutable-string-split
immutable-string-trim
immutable-string-upcase
immutable-string-downcase
immutable-string-titlecase
immutable-string-foldcase
immutable-string-locale-upcase
immutable-string-locale-downcase
immutable-string-normalize-nfd
immutable-string-normalize-nfkd
immutable-string-normalize-nfc
immutable-string-normalize-nfkc
immutable-~a
immutable-~v
immutable-~s
immutable-~e
immutable-~r
immutable-~.a
immutable-~.v
immutable-~.s
;; Byte String Operations
make-immutable-bytes
immutable-bytes
immutable-subbytes
immutable-bytes-append
immutable-bytes-append*
immutable-bytes-join
list->immutable-bytes
bytes->immutable-string/utf-8
bytes->immutable-string/locale
bytes->immutable-string/latin-1
string->immutable-bytes/utf-8
string->bytes/locale
string->bytes/latin-1
;; Vector Operations
make-immutable-vector
list->immutable-vector
build-immutable-vector
immutable-vector-map
immutable-vector-append
immutable-vector-take
immutable-vector-take-right
immutable-vector-drop
immutable-vector-drop-right
immutable-vector-split-at
immutable-vector-split-at-right
immutable-vector-copy
immutable-vector-filter
immutable-vector-filter-not
)
(require racket/bytes
racket/format
racket/string
racket/vector
(for-syntax racket/base))
(module+ as-rkt-names)
;; -------------------------------------------------------
;; Predicates
(define-syntax-rule
(define-immutable-predicates immutable?
[immutable-v? v?]
...)
(begin
(define (immutable-v? v)
(and (v? v) (immutable? v)))
...
(module+ as-rkt-names
(provide (rename-out [immutable-v? v?] ...)))))
(define-immutable-predicates immutable?
[immutable-string? string?]
[immutable-bytes? bytes?]
[immutable-vector? vector?])
;; -------------------------------------------------------
;; Helper Macros
(define-syntax define-immutable-version
(lambda (stx)
(syntax-case stx ()
[(define-immutable-version ->immutable
[immutable-f f (arg ...)])
#'(define-immutable-version ->immutable
[immutable-f f (arg ...) () ()])]
[(define-immutable-version ->immutable
[immutable-f f (arg ...) ([opt-arg opt-arg-default] ...)])
#'(define-immutable-version ->immutable
[immutable-f f (arg ...) ([opt-arg opt-arg-default] ...) ()])]
[(define-immutable-version ->immutable
[immutable-f f
(arg ...)
([opt-arg opt-arg-default] ...)
([opt-kw [kw-arg kw-arg-default]] ...)])
(with-syntax ([((kw/arg+def ...) ...) #'((opt-kw [kw-arg kw-arg-default]) ...)]
[((kw/arg ...) ...) #'((opt-kw kw-arg) ...)])
#'(begin
(define (immutable-f arg ... [opt-arg opt-arg-default] ... kw/arg+def ... ...)
(->immutable (f arg ... opt-arg ... kw/arg ... ...)))
(module+ as-rkt-names
(provide (rename-out [immutable-f f])))))]
[(define-immutable-version ->immutable
[immutable-f f
(arg ...)
([opt-arg opt-arg-default] ...)
([opt-kw [kw-arg kw-arg-default]] ...)
rest-arg])
(with-syntax ([((kw/arg+def ...) ...) #'((opt-kw [kw-arg kw-arg-default]) ...)]
[((kw/arg ...) ...) #'((opt-kw kw-arg) ...)])
#'(begin
(define (immutable-f arg ... [opt-arg opt-arg-default] ... kw/arg+def ... ... . rest-arg)
(->immutable (apply f arg ... opt-arg ... kw/arg ... ... rest-arg)))
(module+ as-rkt-names
(provide (rename-out [immutable-f f])))))]
)))
(define-syntax-rule
(define-immutable-versions ->immutable stuff ...)
(begin
(define-immutable-version ->immutable stuff)
...))
;; -------------------------------------------------------
;; Helper Conversion Functions
(define (maybe-string->immutable-string str)
(and str (string->immutable-string str)))
(define (strings->immutable-strings strs)
(map string->immutable-string strs))
;; -------------------------------------------------------
;; String Operations
(define-immutable-versions string->immutable-string
[make-immutable-string make-string (k) ([char #\nul])]
[immutable-string string () () () chars]
[immutable-string-append string-append () () () strs]
[immutable-string-append* string-append* (str0) () () rest]
[immutable-substring substring (str start) ([end (string-length str)])]
[list->immutable-string list->string (lst)]
[build-immutable-string build-string (n proc)]
[symbol->immutable-string symbol->string (sym)]
[keyword->immutable-string keyword->string (kw)]
[bytes->immutable-string/utf-8 bytes->string/utf-8
(bstr)
([err-char #f] [start 0] [end (bytes-length bstr)])]
[bytes->immutable-string/locale bytes->string/locale
(bstr)
([err-char #f] [start 0] [end (bytes-length bstr)])]
[bytes->immutable-string/latin-1 bytes->string/latin-1
(bstr)
([err-char #f] [start 0] [end (bytes-length bstr)])]
[immutable-string-upcase string-upcase (str)]
[immutable-string-downcase string-downcase (str)]
[immutable-string-titlecase string-titlecase (str)]
[immutable-string-foldcase string-foldcase (str)]
[immutable-string-locale-upcase string-locale-upcase (str)]
[immutable-string-locale-downcase string-locale-downcase (str)]
[immutable-string-normalize-nfd string-normalize-nfd (str)]
[immutable-string-normalize-nfkd string-normalize-nfkd (str)]
[immutable-string-normalize-nfc string-normalize-nfc (str)]
[immutable-string-normalize-nfkc string-normalize-nfkc (str)]
[immutable-string-join string-join
(strs)
([sep " "])
([#:before-first [before-first ""]]
[#:before-last [before-last sep]]
[#:after-last [after-last ""]])]
[immutable-string-normalize-spaces string-normalize-spaces
(str)
([sep #px"\\s+"]
[space " "])
([#:trim? [trim? #t]]
[#:repeat? [repeat? #f]])]
[immutable-string-replace string-replace
(str from to)
()
([#:all? [all? #t]])]
[immutable-string-trim string-trim
(str)
([sep #px"\\s+"])
([#:left? [left? #t]]
[#:right? [right? #t]]
[#:repeat? [repeat? #f]])])
(define-immutable-version strings->immutable-strings
[immutable-string-split string-split
(str)
([sep #px"\\s+"])
([#:trim? [trim? #t]]
[#:repeat? [repeat? #f]])])
(define-immutable-version maybe-string->immutable-string
[number->immutable-string number->string (n) ([radix 10])])
;; -------------------------------------------------------
;; Immutable versions of racket/format functions
(define-syntax-rule
(define-immutable-versions/~a ->immutable
[immutable-~a ~a separator-default limit-marker-default] ...)
(define-immutable-versions ->immutable
[immutable-~a ~a
()
()
([#:separator [separator separator-default]]
[#:width [width #f]]
[#:max-width [max-width (or width +inf.0)]]
[#:min-width [min-width (or width 0)]]
[#:limit-marker [limit-marker limit-marker-default]]
[#:align [align 'left]]
[#:pad-string [pad-string " "]]
[#:left-pad-string [left-pad-string pad-string]]
[#:right-pad-string [right-pad-string pad-string]])
vs]
...))
(define-immutable-versions/~a string->immutable-string
[immutable-~a ~a "" ""]
[immutable-~v ~v " " "..."]
[immutable-~s ~s " " "..."]
[immutable-~e ~e " " "..."]
[immutable-~.a ~.a "" ""]
[immutable-~.v ~.v " " "..."]
[immutable-~.s ~.s " " "..."]
)
(define-immutable-version string->immutable-string
[immutable-~r ~r
(x)
()
([#:sign [sign #f]]
[#:base [base 10]]
[#:precision [precision 6]]
[#:notation [notation 'positional]]
[#:format-exponent [format-exponent #f]]
[#:min-width [min-width 1]]
[#:pad-string [pad-string " "]])])
;; -------------------------------------------------------
;; Byte String Operations
(define-immutable-versions bytes->immutable-bytes
[make-immutable-bytes make-bytes (k) ([b 0])]
[immutable-bytes bytes () () () bs]
[immutable-subbytes subbytes (bstr start) ([end (bytes-length bstr)])]
[list->immutable-bytes list->bytes (lst)]
[immutable-bytes-append bytes-append () () () bstrs]
[immutable-bytes-append* bytes-append* (bstr0) () () rest]
[immutable-bytes-join bytes-join (bstrs sep)]
[string->immutable-bytes/utf-8 string->bytes/utf-8
(str)
([err-byte #f] [start 0] [end (string-length str)])]
[string->immutable-bytes/locale string->bytes/locale
(str)
([err-byte #f] [start 0] [end (string-length str)])]
[string->immutable-bytes/latin-1 string->bytes/latin-1
(str)
([err-byte #f] [start 0] [end (string-length str)])])
;; -------------------------------------------------------
;; Vector Operations
(define-immutable-versions vector->immutable-vector
[make-immutable-vector make-vector (size) ([v 0])]
[list->immutable-vector list->vector (lst)]
[build-immutable-vector build-vector (n proc)]
[immutable-vector-map vector-map (proc vec0) () () rest-vecs]
[immutable-vector-append vector-append () () () vecs]
[immutable-vector-take vector-take (vec pos)]
[immutable-vector-take-right vector-take-right (vec pos)]
[immutable-vector-drop vector-drop (vec pos)]
[immutable-vector-drop-right vector-drop-right (vec pos)]
[immutable-vector-copy vector-copy (vec) ([start 0] [end (vector-length vec)])]
[immutable-vector-filter vector-filter (pred vec)]
[immutable-vector-filter-not vector-filter-not (pred vec)])
(define (immutable-vector-split-at vec pos)
(define-values [v1 v2]
(vector-split-at vec pos))
(values (vector->immutable-vector v1)
(vector->immutable-vector v2)))
(define (immutable-vector-split-at-right vec pos)
(define-values [v1 v2]
(vector-split-at-right vec pos))
(values (vector->immutable-vector v1)
(vector->immutable-vector v2)))
(module+ as-rkt-names
(provide (rename-out
[immutable-vector-split-at
vector-split-at]
[immutable-vector-split-at-right
vector-split-at-right])))
;; -------------------------------------------------------
| true |
2575d8dd5530e9c833a763464e96f428eaa94b3c | f2e65ac33a71e4e1315107f3bdc9eb2389c84871 | /gb/graphics/crt.rkt | e07a2dc3a541ed22a596dbf6e9deb47f4acd51d3 | []
| no_license | daviesaz/get-bonus | ac217ade9879dbcd9aca1adc5fcfa7f102864dbe | ea77c5b2914316343eabd86265aee0433d0e7b03 | refs/heads/master | 2020-05-20T19:27:59.194962 | 2014-09-25T01:51:29 | 2014-09-25T01:51:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 9,371 | rkt | crt.rkt | #lang racket/base
(require ffi/vector
ffi/cvector
ffi/unsafe/cvector
ffi/unsafe
gb/graphics/gl-util
racket/match
opengl)
(module+ test
(require rackunit))
(define-syntax-rule (log* e ...) (begin (log e) ...))
(define-syntax-rule (log e) (begin (printf "~v\n" `e) e))
(define-shader-source fragment-source "crt.fragment.glsl")
(define-shader-source vertex-source "crt.vertex.glsl")
;; This width and height is based on the SNES, which was 256x239. The
;; smallest 16:9 rectangle that this fits in is 432x243, which is
;; crt-scale 27, but this makes it so that we have an odd number in
;; various places. So, we'll use crt-scale 28, or 448x252. This makes
;; the GBIES basically a "widescreen" SNES.
;;
;; But, it is good to have the resolution always divisible by 8, 16,
;; and 32, which are common sprite sizes. (Just 16 would probably be
;; okay, but that is smaller than the SNES in height.)
;;
;; But, the small SNES size was 256x224, which is very close to scale
;; 25 or scale 26, which would be nice and pure
(define crt-scale 32)
(define crt-width (* crt-scale 16))
(define crt-height (* crt-scale 9))
;; XXX what text terminal dimensions does this give?
;; xxx 400x240 is what shovel knight does
;; FBO stuff based on: http://www.songho.ca/opengl/gl_fbo.html
;; shader stuff based on
;; :bsnes_v085-source/bsnes/ruby/video/opengl.hpp
;; We want to find how to scale the CRT to the real screen, but it is
;; important to only use powers of two in the decimals and only up to
;; 2^5
(define (quotient* x y)
(define-values (q r) (quotient/remainder x y))
(define (recur r i max-i)
(cond
[(= i max-i)
0]
[else
(define d (expt 2 (* -1 i)))
(define dy (* d y))
(cond
[(> dy r)
(recur r (add1 i) max-i)]
[else
(+ d (recur (- r dy) (add1 i) max-i))])]))
(+ q (recur r 1 5)))
(module+ test
(define-syntax-rule (check-1q name x y e-r)
(begin
(define a-r (quotient* x y))
(check-= a-r e-r 0
(format "~a: ~a vs ~a"
name
(exact->inexact a-r)
(exact->inexact e-r)))))
(define-syntax-rule (check-q* name (w h) (e-ws e-hs))
(begin
(check-1q (format "~a width(~a)" name w) w crt-width e-ws)
(check-1q (format "~a height(~a)" name h) h crt-height e-hs)))
(define ws 1)
(define hs 1)
(check-q* "PS Vita"
(960 544)
((+ 1 1/2 1/4 1/8)
(+ 1 1/2 1/4 1/8)))
(check-q* "iPhone 4"
(960 640)
((+ 1 1/2 1/4 1/8)
(+ 2 1/8 1/16)))
(check-q* "Normal laptop"
(1024 640)
(2
(+ 2 1/8 1/16)))
(check-q* "iPhone 5"
(1136 640)
((+ 2 1/8 1/16)
(+ 2 1/8 1/16)))
(check-q* "720p"
(1280 720)
((+ 2 1/2)
(+ 2 1/2)))
(check-q* "1080p"
(1920 1080)
((+ 3 1/2 1/4)
(+ 3 1/2 1/4)))
(check-q* "MacBook Pro Retina, Arch"
(1440 900)
((+ 2 1/2 1/4 1/16)
(+ 3 1/8))))
(define (make-draw-on-crt actual-screen-width actual-screen-height)
(eprintf "You are using OpenGL ~a\n"
(gl-version))
(define texture-width crt-width)
(define texture-height crt-height)
(define scale
(* 1.
(min (quotient* actual-screen-width crt-width)
(quotient* actual-screen-height crt-height))))
(define screen-width (* scale crt-width))
(define screen-height (* scale crt-height))
(define inset-left (/ (- actual-screen-width screen-width) 2.))
(define inset-right (+ inset-left screen-width))
(define inset-bottom (/ (- actual-screen-height screen-height) 2.))
(define inset-top (+ inset-bottom screen-height))
(define myTexture (u32vector-ref (glGenTextures 1) 0))
(glBindTexture GL_TEXTURE_2D myTexture)
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MIN_FILTER GL_NEAREST)
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_MAG_FILTER GL_NEAREST)
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_S GL_CLAMP_TO_EDGE)
(glTexParameteri GL_TEXTURE_2D GL_TEXTURE_WRAP_T GL_CLAMP_TO_EDGE)
(glTexImage2D
GL_TEXTURE_2D 0 GL_RGBA8 texture-width texture-height 0
GL_RGBA GL_UNSIGNED_BYTE
0)
(glBindTexture GL_TEXTURE_2D 0)
(define myRB (u32vector-ref (glGenRenderbuffers 1) 0))
(glBindRenderbuffer GL_RENDERBUFFER myRB)
(glRenderbufferStorage GL_RENDERBUFFER
GL_DEPTH_COMPONENT24
texture-width texture-height)
(glBindRenderbuffer GL_RENDERBUFFER 0)
(define myFBO (u32vector-ref (glGenFramebuffers 1) 0))
(glBindFramebuffer GL_FRAMEBUFFER myFBO)
(glFramebufferTexture2D
GL_DRAW_FRAMEBUFFER
GL_COLOR_ATTACHMENT0
GL_TEXTURE_2D myTexture 0)
(glFramebufferRenderbuffer
GL_FRAMEBUFFER
GL_DEPTH_ATTACHMENT
GL_RENDERBUFFER myRB)
(match (glCheckFramebufferStatus GL_FRAMEBUFFER)
[(== GL_FRAMEBUFFER_COMPLETE)
(void)]
[x
(eprintf "FBO creation failed: ~v\n" x)
(exit 1)])
(glBindFramebuffer GL_FRAMEBUFFER 0)
(define shader_program (glCreateProgram))
(glBindAttribLocation shader_program 0 "iTexCoordPos")
(define&compile-shader fragment_shader
GL_FRAGMENT_SHADER
shader_program fragment-source)
(define&compile-shader vertex_shader
GL_VERTEX_SHADER
shader_program vertex-source)
(glLinkProgram shader_program)
(print-shader-log glGetProgramInfoLog 'Program shader_program)
(glUseProgram shader_program)
(glUniform1i
(glGetUniformLocation shader_program "rubyTexture")
0)
(glUniform2fv
(glGetUniformLocation shader_program "rubyInputSize")
1
(f32vector (* 1. crt-width) (* 1. crt-height)))
(glUniform2fv
(glGetUniformLocation shader_program "rubyOutputSize")
1
;; xxx this might have to be without actual-
(f32vector (* 1. actual-screen-width) (* 1. actual-screen-height)))
(glUniform2fv
(glGetUniformLocation shader_program "rubyTextureSize")
1
(f32vector (* 1. texture-width) (* 1. texture-height)))
(glUseProgram 0)
;; xxx turn this entirely into a shader
(define (draw-on-crt do-the-drawing)
(glBindFramebuffer GL_FRAMEBUFFER myFBO)
(glPushAttrib GL_CURRENT_BIT)
(glPushMatrix)
(glViewport 0 0 crt-width crt-height)
(do-the-drawing)
(glPopMatrix)
(glPopAttrib)
(glBindFramebuffer GL_FRAMEBUFFER 0)
(glUseProgram shader_program)
(glClearColor 0. 0. 0. 1.)
(glClear (bitwise-ior GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
(glMatrixMode GL_PROJECTION)
(glLoadIdentity)
(glEnable GL_TEXTURE_2D)
(glMatrixMode GL_MODELVIEW)
(glLoadIdentity)
(glOrtho 0 actual-screen-width 0 actual-screen-height 0. -10.)
(glViewport 0 0 actual-screen-width actual-screen-height)
(glBindTexture GL_TEXTURE_2D myTexture)
(glBegin GL_QUADS)
(glTexCoord2i 0 0) (glVertex2f inset-left inset-bottom)
(glTexCoord2i 1 0) (glVertex2f inset-right inset-bottom)
(glTexCoord2i 1 1) (glVertex2f inset-right inset-top)
(glTexCoord2i 0 1) (glVertex2f inset-left inset-top)
(glEnd)
(glBindTexture GL_TEXTURE_2D 0)
(glDisable GL_TEXTURE_2D)
(glUseProgram 0))
(define VaoId (u32vector-ref (glGenVertexArrays 1) 0))
(glBindVertexArray VaoId)
(define VboId (u32vector-ref (glGenBuffers 1) 0))
(glBindBuffer GL_ARRAY_BUFFER VboId)
(define DataWidth 4)
(define DataSize 4)
(define DataCount 6)
(glVertexAttribPointer 0 DataSize GL_FLOAT #f 0 0)
(glEnableVertexAttribArray 0)
(glBufferData GL_ARRAY_BUFFER (* DataCount DataWidth DataSize) #f GL_STATIC_DRAW)
(define DataVec
(make-cvector*
(glMapBufferRange
GL_ARRAY_BUFFER
0
(* DataCount DataSize)
GL_MAP_WRITE_BIT)
_float
(* DataWidth
DataSize
DataCount)))
(define (cvector-set*! vec k . vs)
(for ([v (in-list vs)]
[i (in-naturals)])
(cvector-set! vec (+ k i) v)))
(cvector-set*! DataVec 0
0.0 0.0 inset-left inset-bottom
1.0 0.0 inset-right inset-bottom
1.0 1.0 inset-right inset-top
0.0 1.0 inset-left inset-top
1.0 1.0 inset-right inset-top
0.0 0.0 inset-left inset-bottom)
(glUnmapBuffer GL_ARRAY_BUFFER)
(set! DataVec #f)
(glBindBuffer GL_ARRAY_BUFFER 0)
(glBindVertexArray 0)
(define (new-draw-on-crt do-the-drawing)
(glBindFramebuffer GL_FRAMEBUFFER myFBO)
(glViewport 0 0 crt-width crt-height)
(do-the-drawing)
(glBindFramebuffer GL_FRAMEBUFFER 0)
(glBindVertexArray VaoId)
(glEnableVertexAttribArray 0)
(glUseProgram shader_program)
(glClearColor 0. 0. 0. 0.)
(glClear (bitwise-ior GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT))
(glViewport 0 0 actual-screen-width actual-screen-height)
(glActiveTexture GL_TEXTURE0)
(glBindTexture GL_TEXTURE_2D myTexture)
(glDrawArrays GL_TRIANGLES 0 DataCount)
(glActiveTexture GL_TEXTURE0)
(glBindTexture GL_TEXTURE_2D 0)
(glUseProgram 0)
(glDisableVertexAttribArray 0)
(glBindVertexArray 0))
(define (fake-draw-on-crt do-the-drawing)
(do-the-drawing))
new-draw-on-crt)
(provide crt-height
crt-width
make-draw-on-crt)
| true |
82b956d0b3c1f1dd427bf392b430982056d42b15 | e553691752e4d43e92c0818e2043234e7a61c01b | /sdsl/ifc/indistinguishable.rkt | 93ad78e421ad2e9e6db2fcc69e3e222a07157ed1 | [
"BSD-2-Clause"
]
| permissive | emina/rosette | 2b8c1bcf0bf744ba01ac41049a00b21d1d5d929f | 5dd348906d8bafacef6354c2e5e75a67be0bec66 | refs/heads/master | 2023-08-30T20:16:51.221490 | 2023-08-11T01:38:48 | 2023-08-11T01:38:48 | 22,478,354 | 656 | 89 | NOASSERTION | 2023-09-14T02:27:51 | 2014-07-31T17:29:18 | Racket | UTF-8 | Racket | false | false | 2,236 | rkt | indistinguishable.rkt | #lang rosette
(require rosette/lib/match "machine.rkt")
(provide ≈ mem≈ low≈ full≈)
; See Def. 2.3.1 in the full draft of "Testing Noninterference, Quickly".
(define (≈ v0 v1)
(match* (v0 v1)
[((@ x Lx) (@ y Ly))
(and (equal? Lx Ly)
(or (equal? Lx ⊤)
(equal? x y)))]
[((R x _) (R y _)) (≈ x y)]
[((instruction p0 args0) (instruction p1 args1))
(and (equal? p0 p1)
(≈ args0 args1))]
[((? list? v0) (? list? v1))
(and (= (length v0) (length v1))
(andmap ≈ v0 v1))]
[(_ _) #f]))
; See Def. 5.1.1. in the full draft of "Testing Noninterference, Quickly".
(define (mem≈ v0 v1)
(match* (v0 v1)
[((machine (@ _ L0) _ mem0 insts0) (machine (@ _ L1) _ mem1 insts1))
(and (equal? L0 L1)
(or (equal? L0 ⊤)
(and (≈ insts0 insts1)
(≈ mem0 mem1))))]
[(_ _) #f]))
; See Def. 6.1.1. in the full draft of "Testing Noninterference, Quickly".
(define (low≈ v0 v1)
(match* (v0 v1)
[((machine (@ pc0 L0) stack0 mem0 insts0) (machine (@ pc1 L1) stack1 mem1 insts1))
(and (equal? L0 L1)
(or (equal? L0 ⊤)
(and (= pc0 pc1)
(≈ insts0 insts1)
(≈ stack0 stack1)
(≈ mem0 mem1))))]
[(_ _) #f]))
; See Def. 6.4.2. in the full draft of "Testing Noninterference, Quickly".
(define (full≈ v0 v1)
(match* (v0 v1)
[((machine (@ pc0 L0) stack0 mem0 insts0) (machine (@ pc1 L1) stack1 mem1 insts1))
(and (equal? L0 L1)
(≈ insts0 insts1)
(≈ mem0 mem1)
(if (equal? L0 ⊥)
(and (equal? pc0 pc1)
(≈ stack0 stack1))
(≈ (cropStack stack0) (cropStack stack1))))]))
; The cropStack helper function takes a stack and removes elements from
; the top until it reaches the first low return address (or until all
; elements are removed).
(define (cropStack s)
(or (memf low-return-address? s) '()))
; Returns true iff v is a return value, and (Rpc v) has the low label.
(define (low-return-address? v)
(and (return? v)
(let@ ([(_ L) (Rpc v)])
(equal? L ⊥))))
| false |
f20ce59ebdaaf6e50a994da53378688a683d9c78 | e53279a881cec435cff05f8cde5b7be9fcf2b750 | /system-unit.rkt | b75bef94b39155e2c342c026128919693d34ff4d | []
| no_license | ecoble/pop-pl | 5b48b57254cb41e6be3a70d8cb98d8f6a1c63ee9 | b26e7cc5bf7376e924eb41454d8c67f90236b16e | refs/heads/master | 2022-07-22T01:01:38.795645 | 2020-05-25T23:45:28 | 2020-05-25T23:45:28 | 266,209,941 | 0 | 0 | null | 2020-05-22T21:21:40 | 2020-05-22T21:21:39 | null | UTF-8 | Racket | false | false | 457 | rkt | system-unit.rkt | #lang racket/unit
(require "system-sig.rkt" "private/shared.rkt"
"prescription-sig.rkt")
(import prescription^)
(export system^)
(define TIME-ADVANCE 30)
(define (start!) (-start))
(define (send-message! msg)
(-eval msg))
(define (advance! time)
(define t (time->stamp time))
(reverse
(for/fold ([msg null])
([_ (in-range 0 t TIME-ADVANCE)])
(append msg (send-message! (message '(time) (list TIME-ADVANCE) #f))))))
| false |
c88949858c8963e21e86171533d87e3c0bb11c80 | 00bc49d65db47db55d79664714dd18f91653647a | /unify-freevars.rkt | 10aa21d81a04f1e343fa79195a0b6408ba7eee7e | []
| no_license | Flexilis/Skiffle | 72be5ac1b084937946179ae4bb58808f05ad6f7d | d3830ce8fc8847e72cbbc9470677c040a0a810e2 | refs/heads/master | 2022-04-14T20:03:53.673002 | 2020-04-04T04:28:33 | 2020-04-04T04:28:33 | 250,324,044 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 1,752 | rkt | unify-freevars.rkt | #lang racket
;; e ::= (begin e*) | (let ((sym e)*) e*) | (lambda ((sym . int)*) ((sym . int)*) ((sym . int)*) e*) | (e e*) | (var sym int)
;; --->>>
;; e ::= (begin e*) | (let ((sym e)*) e*) | (lambda ((sym int int)*) ((sym . int)*) ((sym . int)*) e*) | (e e*) | (var sym int)
;; (freevar internal-offsets external-offsets)
(require "general-walker.rkt")
(provide unify-freevars)
(define vars (make-hash))
(define (print-id x) (println x) x)
(define (unify-freevars code)
(for/list ([expr code])
(unify-freevars-expr expr)))
(define (unify-freevars-expr expr)
(match expr
[(list 'if cond if-branch else-branch)
(list 'if
(unify-freevars-expr cond)
(unify-freevars-expr if-branch)
(unify-freevars-expr else-branch))]
[(list 'let (list (list (cons names offsets) values) ...) body ...)
(for ([name names] [offset offsets])
(hash-set! vars name offset))
(list-rest
'let
(build-assoc offsets (map unify-freevars-expr values))
(unify-freevars body))]
[(list 'begin body ...)
(list-rest
'begin
(unify-freevars body))]
[(list 'lambda
(list (cons freevars offsets) ...)
(list (cons boundvars bound-offsets) ...)
(list (cons arg-names arg-offsets) ...)
body ...)
(for ([name arg-names] [offset arg-offsets])
(hash-set! vars name offset))
(list-rest
'lambda
(build-assoc
offsets
(map (λ (x) (hash-ref vars x)) freevars))
bound-offsets
arg-offsets
(unify-freevars body))]
[(list 'var sym offset)
(list 'var offset)]
[(list fn args ...)
(unify-freevars expr)]
[other other]))
| false |
0fa0bb419f13b10d1e121a47facf05a6a7e565ea | 6a5e7628a6fb45e945cbec9f9df271a578baa6c7 | /turnstile-test.rkt | 7cd0549906874f6eee50c76ab90eb2dd9fe3073a | [
"MIT"
]
| permissive | guojing0/2018-racket-summer-school | d6dd82eb9c2b4e3444d9bd0bcb39a98dff92fc59 | c87ed8663bbbaedc2ab6357003b201fa28e99f6c | refs/heads/master | 2020-03-23T01:04:03.601423 | 2018-07-13T22:56:08 | 2018-07-13T22:56:08 | 140,899,383 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 402 | rkt | turnstile-test.rkt | #lang s-exp "turnstile-main.rkt"
; e.g., save this to file "typed-lang-prog.rkt"
(require turnstile/rackunit-typechecking)
;(check-type 5 : Int)
;(check-type "five" : String)
;
;(typecheck-fail #f #:with-msg "Unsupported literal")
;(typecheck-fail 1.1 #:with-msg "Unsupported literal")
;
;(check-type + : (-> Int Int Int))
;
;(check-type (+ 1 2) : Int -> 3)
;
;(typecheck-fail (+ 1))
(if #t 3 2) | false |
9b6ecda9ef876868eb95c3d143f39c17f7bce562 | 4919215f2fe595838a86d14926c10717f69784e4 | /lessons/Structs-Intro/lesson/lesson.scrbl | 39453297ce2b2cb1b37cae4252a8052e54b68097 | []
| no_license | Emmay/curr | 0bae4ab456a06a9d25fbca05a25aedfd5457819b | dce9cede1e471b0d12ae12d3121da900e43a3304 | refs/heads/master | 2021-01-18T08:47:20.267308 | 2013-07-15T12:23:41 | 2013-07-15T12:23:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 3,729 | scrbl | lesson.scrbl | #lang curr/lib
@declare-tags[group pedagogy selftaught]
@lesson[#:title "Introducing Structs"
#:duration "10 minutes"]{
@itemlist/splicing[@pedagogy{@item{Pass out the bags of datatype cards.}}
@pedagogy{@item{Now we're going to play a game...but first I'm going to explain the rules. First off, everyone take out all of the cards from the bags, and set them on the table in front of you.}}
@item{Raise your hand if you can tell me what's written on the cards.}
@item{Right: number, string, image, boolean...but what are these? Datatypes.}
@item{Here's how this is going to work: I'm going to say something that can be returned by a Racket function, and you're going to hold up a card to show me what datatype it would be. If I were to say age, which would you hold up?}
@item{Now, there's one very important rule: no matter what I say, you can only hold up one thing. Ready?}
@tag[selftaught]{For each of the things below, figure out which datatype you would use to represent it in Racket:}
@itemlist/splicing[@item{a color}
@item{a picture of a circle}
@item{your name}
@item{whether or not something is correct}
@item{an x-coordinate}
@item{your friend's favorite food}
@item{a picture of ninja cat}
@item{a set of coordinates}]
@item{Wait! How many things are in a set of coordinates? An x and a y. Is that one thing? Is it one number? NO! @tag[pedagogy]{You can only hold one thing up, but we'd need to show two numbers.}}
@item{Can we use a String to return two numbers? Not if we want to add or subtract!}
@item{Can we use a Boolean? An Image? None of our data types work!}
@item{It turns out that Racket has exactly this problem. Every function that you could possibly write or use in Racket can only give back one thing. That is, its range only has one thing in it.}
@item{We need a new type - something that can hold more than one thing at once. Racket actually has a tool to make such a thing, and it's called a data structure, or "struct" for short.}
@pedagogy{@item{Set aside the two number cards; one for the x and one for the y coordinates. Then pick up your plastic bags.}}
@pedagogy{@item{Put the two number cards inside the plastic bag, and then hold it up. How many things are you holding? One!}}
@tag[selftaught]{@item{Now imagine that you've put the two numbers that you're using to describe the x and y into a box. If you were to hold up the box, you'd only be holding one thing!}}
@item{In the same way, complex structs can be defined, in Racket, to hold multiple things. @tag[pedagogy]{Let's keep going with the game, but keep in mind that you may need to use your "struct bag" for some of these.}@tag[selftaught]{Let's do some more, but remember that you might need a "struct" to group things together.} What if your function was returning:}
@itemlist/splicing[@item{the name and the age of a character}
@item{a flavor of soup, and whether it is hot or not}
@item{how many pets you have}
@item{a picture of a shape, with the number of sides and its color}
@item{a direction that a plane is traveling, and how fast it is going}]
@pedagogy{@item{Good job guys! Put all of your cards back in the bag and leave it on the table.}}]} | false |
c705c5af34a32908eca9aedc869820c8be4b1f0a | f1dda554fd9bf0dc7de60c84d9c87edf0e416ef8 | /TSPL/3.5.rkt | 8247e306ce8016df3c4018837b262d9536e1c9eb | [
"MIT"
]
| permissive | shenxs/about-scheme | 3381680b6b685dc19df20c0a253eb9fd7530d663 | 7260128257b5b99fd516116de0387df92e2027e2 | refs/heads/master | 2021-11-23T11:15:36.994915 | 2021-10-24T02:39:29 | 2021-10-24T02:39:29 | 40,663,316 | 20 | 1 | null | null | null | null | UTF-8 | Racket | false | false | 3,774 | rkt | 3.5.rkt | #lang racket
;;在之前的章节中,讨论过顶层定义.定义也可以出现在lambda let 或者 letrec 的body之前
;; 在这时这些定义是属于函数体的局部定义
(define f (lambda (x) (* x x)))
(let ([x 3])
(define f (lambda (y) (+ y x)))
(f 4))
(f 4)
;;局部定义可以相互递归调用
(let ()
(define even?
(lambda (x)
(or (= x 0)
(odd? (- x 1)))))
(define odd?
(lambda (x)
(and (not (= x 0))
(even? (- x 1)))))
(even? 20))
(define list?
(lambda (x)
(define race
(lambda (h t)
(if (pair? h)
(let ([h (cdr h)])
(if (pair? h)
(and (not (eq? h t))
(race (cdr h) (cdr t)))
(null? h)))
(null? h))))
(race x x)))
;;实际上,内部变量定义和letrec是基本上通用的。除了语法上的唯一的区别,
;;他们的区别是变量的定义是可以保证被从左向右解析的,但是letrec有可能以任何顺序解析
;; 所以我们不能将一个包含内部定义的lambda,let,letrec的函数体用letrec替代.但是我们可以使用letrec*
;; let*来保证从左向右的解析顺序
#|
(define var expr0)
expr1
expr2
和以下的表达式等价
(letrec* ((var epr0) ...) expr1 expr2..)
反过来 一个letrec*的形式
(letrec* ((var epr0) ...) expr1 expr2..)
可以被一个包含内部定义的let表达式替代
(let ()
(define var expr0)
...
expr1
expr2)
在这些变换中似乎缺少对称性.因为letrec* 表达式可以出现在一个合法表达式的任何位置
而内部定义只能出现在函数体前面.所以在使用内部定义替代letrec*的时候我们通常使用let表达式来
包裹define表达式
内部定义的另一个不同是,语法定义有可能出现在内部定义中,而letrec* 只是绑定变量
|#
(let ([x 3])
(define-syntax set-x!
(syntax-rules ()
[(_ e) (set! x e)]))
(set-x! (+ x x))
x)
#|
使用内部定义的语法扩展的作用域也只限于内部定义所在的函数体中,就像定义一个变量一样
内部定义也许可以和顶层定义以及赋值联合起来帮助模块化程序
每个模块应该只将被其他模块需要的绑定暴露出来,将那些会污染顶层命名空间和有可能导致无意识的使用和重定义
的绑定隐藏起来.一个常见的模块构建如下
(define export-var #f)
(let ()
(define var expr)
...
内部表达式
...
(set! export-var export-val))
首先定义一个顶层的值,这个值是之后需要暴露出去的
然后是一个模块的内部定义
最后使用set!将正确的值赋值给需要暴露的值
这种形式的模块化的一个优点就是let表达式中间的函数体可以被当做是被注释掉的,这使得测试比较容易,但是这也会带来一些缺点
|#
(define calc #f)
(let ()
(define do-calc
(lambda (ek expr)
(cond
[(number? expr) expr]
[(and (list? expr) (= (length expr) 3))
(let ([op (car expr)] [args (cdr expr)])
(case op
[(add) (apply-op ek + args)]
[(sub) (apply-op ek - args)]
[(mul) (apply-op ek * args)]
[(div) (apply-op ek / args)]
[else (complain ek "invalid operator" op)]))]
[else (complain ek "invalid expression" expr)])))
(define apply-op
(lambda (ek op args)
(op (do-calc ek (car args)) (do-calc ek (cadr args)))))
(define complain
(lambda (ek msg expr)
(ek (list msg expr))))
(set! calc
(lambda (expr)
; grab an error continuation ek
(call/cc
(lambda (ek)
(do-calc ek expr))))))
(calc '(add (mul 3 2 ) -4))
(calc '(add (mul 3 2) (div 4)))
| true |
5396f7166e8cb0f5e274bfc0176722b43a29463c | f4727367e2dcd3e1ef02aefd67efb521e0adb1cc | /private/derived.rkt | 1f4f3c3da9088077d0ed3106446ccb9427e2abb8 | [
"Apache-2.0",
"MIT"
]
| permissive | rodrigogribeiro/peg-racket | 40c751f3f22997c9d4b0922b5cdbd031deafbd78 | 64856e38121405a95a53ea85ba2c303a15f74f5b | refs/heads/master | 2023-04-26T20:08:03.008920 | 2021-06-01T21:09:41 | 2021-06-01T21:09:41 | 372,641,108 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 542 | rkt | derived.rkt | #lang racket
(require "core.rkt")
(provide any-p
interval
opt
plus
and-p)
;; extended peg syntax
(define any-p
(for/fold ([ac eps])
([i (in-range 1 256)])
(/ (chr (integer->char i)) ac)))
(define (interval s e)
(for/fold ([ac eps])
([i (in-range (char->integer s)
(add1 (char->integer e)))])
(/ (chr (integer->char i)) ac)))
(define (opt e)
(/ e eps))
(define (plus e)
(<> e (star e)))
(define (and-p e)
(not (not e))) | false |
406309b392602df847b7c539c3f9a3079ffb6c65 | 8e0de54f99232e2e414bb3f34f584bdb7f89dafa | /main.rkt | d09b6607e74eadd6ec4c46484c41cfae45d59a9b | []
| no_license | mfelleisen/take5 | d7818c27a4c9f56090063a67e4a473eccdd1096c | f74a573087841ab701c30aed6824b450cf6948df | refs/heads/master | 2021-01-10T06:34:15.202668 | 2016-03-06T03:25:16 | 2016-03-06T03:25:16 | 53,235,188 | 2 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 1,507 | rkt | main.rkt | #lang racket
;; the main entry point for an OO implementation of "6 Nimmt!" (Take 5)
(provide
;; (U String N) -> [Listof [List N N]]
;; (main n) creates n players, hands them to the dealer, and asks the
;; latter to run a complete simulation of a 6-Nimmit! game
;; EFFECT also write result to stdout
;; NOTE the default player and dealer are completely deterministic
;; To run a random simulation, it is necessary to override the defaults
main)
(module+ test (require rackunit))
;; ---------------------------------------------------------------------------------------------------
(require "player.rkt" "dealer.rkt")
(define (main n)
(define (e)
(error 'main "input must be a natural number; given ~e" n))
(define k
(cond
[(string? n)
(define l (string->number n))
(if (natural-number/c l) l (e))]
[(natural-number/c n) n]
[else (e)]))
(define players (build-list k create-player))
(define dealer (create-dealer players))
(send dealer play-game))
(module+ test
(define (check-main n result)
(void
(with-output-to-string
(lambda ()
(check-equal? (main n) result)))))
(check-main 2 '((after round 3) ((1 0) (0 78))))
(check-main 3 '((after round 2) ((1 0) (2 0) (0 76))))
(check-main 4 '((after round 2) ((1 0) (2 0) (3 0) (0 100))))
(check-main 5 '((after round 2) ((1 0) (2 0) (3 0) (0 56) (4 80))))
(void
(with-output-to-string
(lambda ()
(check-exn exn:fail? (lambda () (main 12)))))))
| false |
5dde08a47e0a0eb2e6e77d618305e915fb9bc77a | f4aeaa0812ac15d5a8d2cb6da75ac335c3cf5cf4 | /racket/miruKanren/eqeq-watch.rkt | be125627ad60678af83210408e6212863aa710b0 | [
"MIT"
]
| permissive | orchid-hybrid/microKanren-sagittarius | 13f7916f8ef7c946cefeb87e9e52d6d4a5dfe6c9 | 9e740bbf94ed2930f88bbcf32636d3480934cfbb | refs/heads/master | 2021-01-13T01:54:20.589391 | 2015-06-13T12:40:14 | 2015-06-13T12:40:14 | 29,868,626 | 12 | 4 | null | 2015-02-12T07:11:25 | 2015-01-26T16:01:10 | Scheme | UTF-8 | Racket | false | false | 269 | rkt | eqeq-watch.rkt | (module eqeq-watch racket (provide == watch bijectiono peanoo binaryo) (require "scheme/base.rkt" "utils.rkt" "variables.rkt" "kanren.rkt" "monad.rkt" "mini.rkt" "bijections.rkt" "unification.rkt" "surveillance.rkt") (include (file "../../miruKanren/eqeq-watch.scm")))
| false |
1dad328866726f0f0e879059b21f121bef3d1004 | e4d80c9d469c9ca9ea464a4ad213585a578d42bc | /courses/textbook/units/unit7/the-unit.scrbl | 49f4886e7470ea160ce33d6115e7e72beac6d130 | []
| no_license | garciazz/curr | 0244b95086b0a34d78f720e9cae1cb0fdb686ec5 | 589a93c4a43967b06d7a6ab9d476b470366f9323 | refs/heads/master | 2021-01-17T19:14:21.756115 | 2016-02-24T22:16:26 | 2016-02-24T22:16:26 | 53,657,555 | 1 | 0 | null | 2016-03-11T09:58:01 | 2016-03-11T09:58:01 | null | UTF-8 | Racket | false | false | 2,292 | scrbl | the-unit.scrbl | #lang curr/lib
@declare-tags[group pedagogy selftaught bootstrap]
@title{Unit 7: Booleans and Conditionals}
@overview{
Students discover Boolean types, and use them to create programs that test values, and then model scenarios using these programs.
@objectives[
@item{Understand how to declare Boolean values}
@item{Learn functions to generate and manipulate Booleans and Strings}
@item{Reason about the relative positioning of objects using mathematics}
@item{Discover Partial Functions, and how to implement them using @code{Cond}}
@item{Use Booleans with @code{cond} to change control flow}
@item{Adapt Design Recipe to add @code{cond}}
]
@product-outcomes[
@item{Students will write functions that use conditionals and Booleans }
@item{Students write functions to perform tests on various domains}
@item{Students will write @code{update-player}}
]
@preparation[
@item{"Cage" [@(hyperlink "http://www.bootstrapworld.org/curriculum/BS1-sp2012/downloads/Cage.rkt" "DrRacket file") + @(hyperlink "http://www.bootstrapworld.org/curriculum/BS1-sp2012/Teachpack/cage-teachpack.rkt" "teachpack") | @(hyperlink "http://www.wescheme.org/openEditor?publicId=equal-guild-ebony-apply-snore" "WeScheme")] preloaded on students' machines, in front}
]
}
Language Table
@(language-table (list "Number" @code{+ - * / sq sqrt expt})
(list "String" @code{string-append string-length})
(list "Image" @code{radial-star scale rotate put-image}))
}
@lesson[#:title "Introduction" #:duration "15 minutes"]{
@itemlist/splicing[
@item{Review the previous material}]}
@(include-lesson (lib "curr/lessons/Intro-to-Booleans/lesson/lesson-long.scrbl"))
@(include-lesson (lib "curr/lessons/onscreen1/lesson/lesson-long.scrbl"))
@(include-lesson (lib "curr/lessons/Boolean-Function/lesson/lesson.scrbl"))
@(include-lesson (lib "curr/lessons/onscreen2/lesson/lesson.scrbl"))
@(include-lesson (lib "curr/lessons/Cond-Example-With-Pizza-Toppings/lesson/lesson.scrbl"))
@(include-lesson (lib "curr/lessons/Player-Movement/lesson/lesson.scrbl"))
@copyright[]
| false |
1b5798e27fd2005393d79ace966b31ed30972b46 | cbdf773c05364e99f8c689c86d96b110173d5266 | /courses/2017/01/cs2500/code/02-basics/rocket.rkt | d2191fdfc99c1be786d35afbf27241d8bffe17e3 | []
| no_license | NatTuck/khoury-ntuck | 4ca4cc3cbeb193e007674afb6921bfa25829887e | a0f1ea5f506408bb5dfa287f476b616d57d39d56 | refs/heads/master | 2023-06-14T20:47:12.336828 | 2021-05-13T23:27:02 | 2021-05-13T23:27:02 | 28,753,895 | 1 | 0 | null | 2021-07-12T18:59:17 | 2015-01-03T20:28:10 | Racket | UTF-8 | Racket | false | false | 150,761 | rkt | rocket.rkt | #reader(lib"read.ss""wxme")WXME0108 ##
#|
This file uses the GRacket editor format.
Open this file in DrRacket version 6.2.1 or later to read it.
Most likely, it was created by saving a program in DrRacket,
and it probably contains a program with non-text elements
(such as images or comment boxes).
http://racket-lang.org/
|#
32 7 #"wxtext\0"
3 1 6 #"wxtab\0"
1 1 8 #"wximage\0"
2 0 8 #"wxmedia\0"
4 1 34 #"(lib \"syntax-browser.ss\" \"mrlib\")\0"
1 0 16 #"drscheme:number\0"
3 0 44 #"(lib \"number-snip.ss\" \"drscheme\" \"private\")\0"
1 0 36 #"(lib \"comment-snip.ss\" \"framework\")\0"
1 0 93
(
#"((lib \"collapsed-snipclass.ss\" \"framework\") (lib \"collapsed-sni"
#"pclass-wxme.ss\" \"framework\"))\0"
) 0 0 43 #"(lib \"collapsed-snipclass.ss\" \"framework\")\0"
0 0 19 #"drscheme:sexp-snip\0"
0 0 36 #"(lib \"cache-image-snip.ss\" \"mrlib\")\0"
1 0 68
(
#"((lib \"image-core.ss\" \"mrlib\") (lib \"image-core-wxme.rkt\" \"mr"
#"lib\"))\0"
) 1 0 29 #"drscheme:bindings-snipclass%\0"
1 0 101
(
#"((lib \"ellipsis-snip.rkt\" \"drracket\" \"private\") (lib \"ellipsi"
#"s-snip-wxme.rkt\" \"drracket\" \"private\"))\0"
) 2 0 88
(
#"((lib \"pict-snip.rkt\" \"drracket\" \"private\") (lib \"pict-snip.r"
#"kt\" \"drracket\" \"private\"))\0"
) 0 0 34 #"(lib \"bullet-snip.rkt\" \"browser\")\0"
0 0 25 #"(lib \"matrix.ss\" \"htdp\")\0"
1 0 22 #"drscheme:lambda-snip%\0"
1 0 29 #"drclickable-string-snipclass\0"
0 0 26 #"drracket:spacer-snipclass\0"
0 0 57
#"(lib \"hrule-snip.rkt\" \"macro-debugger\" \"syntax-browser\")\0"
1 0 26 #"drscheme:pict-value-snip%\0"
0 0 45 #"(lib \"image-snipr.ss\" \"slideshow\" \"private\")\0"
1 0 38 #"(lib \"pict-snipclass.ss\" \"slideshow\")\0"
2 0 55 #"(lib \"vertical-separator-snip.ss\" \"stepper\" \"private\")\0"
1 0 18 #"drscheme:xml-snip\0"
1 0 31 #"(lib \"xml-snipclass.ss\" \"xml\")\0"
1 0 21 #"drscheme:scheme-snip\0"
2 0 34 #"(lib \"scheme-snipclass.ss\" \"xml\")\0"
1 0 10 #"text-box%\0"
1 0 32 #"(lib \"text-snipclass.ss\" \"xml\")\0"
1 0 1 6 #"wxloc\0"
0 0 470 0 1 #"\0"
0 75 1 #"\0"
0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 0 9
#"Standard\0"
0 75 10 #"Monospace\0"
0 14 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 2 24
#"framework:default-color\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 2
1 #"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 150 0 150 0 0 0 -1 -1 2 15
#"text:ports out\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 150 0 150 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 255 0 0 0 0 0 -1
-1 2 15 #"text:ports err\0"
0 -1 1 #"\0"
1 0 -1 92 93 -1 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 175 0 0 0 -1 -1 2 17
#"text:ports value\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 175 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 34 139 34 0 0 0 -1
-1 2 27 #"Matching Parenthesis Style\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 34 139 34 0 0 0 -1
-1 2 1 #"\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 37
#"framework:syntax-color:scheme:symbol\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 38
#"framework:syntax-color:scheme:keyword\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 38 38 128 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2
38 #"framework:syntax-color:scheme:comment\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 194 116 31 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 37
#"framework:syntax-color:scheme:string\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 35
#"framework:syntax-color:scheme:text\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 39
#"framework:syntax-color:scheme:constant\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 41 128 38 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 49
#"framework:syntax-color:scheme:hash-colon-keyword\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 42
#"framework:syntax-color:scheme:parenthesis\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 132 60 36 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 36
#"framework:syntax-color:scheme:error\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 36
#"framework:syntax-color:scheme:other\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 16
#"Misspelled Text\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 81 112 203 0 0 0 -1 -1 2
38 #"drracket:check-syntax:lexically-bound\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 81 112 203 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 28
#"drracket:check-syntax:set!d\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 37
#"drracket:check-syntax:unused-require\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 36
#"drracket:check-syntax:free-variable\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 255 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 68 0 203 0 0 0 -1 -1 2 31
#"drracket:check-syntax:imported\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 68 0 203 0 0 0 -1 -1 2 47
#"drracket:check-syntax:my-obligation-style-pref\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 116 0 0 0 0 -1 -1 2 50
#"drracket:check-syntax:their-obligation-style-pref\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 116 0 0 0 0 -1 -1 2 48
#"drracket:check-syntax:unk-obligation-style-pref\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 139 142 28 0 0 0 -1 -1 2
49 #"drracket:check-syntax:both-obligation-style-pref\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 139 142 28 0 0 0 -1 -1 2
26 #"plt:htdp:test-coverage-on\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 2 27
#"plt:htdp:test-coverage-off\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 4 1
#"\0"
0 70 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 4 4 #"XML\0"
0 70 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 37 #"plt:module-language:test-coverage-on\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 38
#"plt:module-language:test-coverage-off\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 0 1
#"\0"
0 75 10 #"Monospace\0"
0.0 11 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 150 0 150 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 92 93 -1 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 175 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 0 1 #"\0"
0 75 10 #"Monospace\0"
0.0 9 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255 255
255 1 -1 0 1 #"\0"
0 75 1 #"\0"
0.0 10 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 1 #"\0"
0 75 12 #"Courier New\0"
0.0 14 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 38 38 128 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 194 116 31 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 41 128 38 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 4 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 4 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 4 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 100 0 0 0
0 -1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 17 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 24 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 44 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 46 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 0 1 #"\0"
0 75 11 #" Monospace\0"
0.0 13 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 38 38 128 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 194 116 31 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 41 128 38 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 81 112 203 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 68 0 203 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 116 0 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 139 142 28 0
0 0 -1 -1 0 1 #"\0"
0 -1 1 #"\0"
0.0 10 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 -1 1 #"\0"
0.0 10 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 100 0 0 0
0 -1 -1 0 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 200 0 0 0 0
0 -1 -1 24 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 15 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 26 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 14 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 21 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 24 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 255 165 0 0
0 0 -1 -1 14 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 255 165 0 0
0 0 -1 -1 26 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 255 165 0 0
0 0 -1 -1 21 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 255 165 0 0
0 0 -1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 19 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 14 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 15 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 21 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 19 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 26 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 0 1 #"\0"
0 75 1 #"\0"
0.0 11 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 1 #"\0"
0 75 11 #" Monospace\0"
0.0 14 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 14 #"Html Standard\0"
0 -1 1 #"\0"
1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 2 38
#"drscheme:check-syntax:lexically-bound\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 81 112 203 0
0 0 -1 -1 2 31 #"drscheme:check-syntax:imported\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 68 0 203 0 0
0 -1 -1 8 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 8 24 #"drscheme:text:ports err\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 0 1 #"\0"
0 75 10 #"Monaco CE\0"
0.0 11 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 40 #"framework:syntax-coloring:scheme:symbol\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 38 38 128 0
0 0 -1 -1 2 41 #"framework:syntax-coloring:scheme:keyword\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 38 38 128 0
0 0 -1 -1 2 41 #"framework:syntax-coloring:scheme:comment\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 194 116 31 0
0 0 -1 -1 2 40 #"framework:syntax-coloring:scheme:string\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 41 128 38 0
0 0 -1 -1 2 42 #"framework:syntax-coloring:scheme:constant\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 41 128 38 0
0 0 -1 -1 2 45 #"framework:syntax-coloring:scheme:parenthesis\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 -1 -1 2 39 #"framework:syntax-coloring:scheme:error\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 39 #"framework:syntax-coloring:scheme:other\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 49 #"drscheme:check-syntax:lexically-bound-identifier\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 81 112 203 0
0 0 -1 -1 2 42 #"drscheme:check-syntax:imported-identifier\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 68 0 203 0 0
0 -1 -1 2 37 #"profj:syntax-coloring:scheme:keyword\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 139 0 139 0
0 0 -1 -1 2 39 #"profj:syntax-coloring:scheme:prim-type\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 139 0 139 0
0 0 -1 -1 2 40 #"profj:syntax-coloring:scheme:identifier\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 38 38 128 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0
0 0 -1 -1 2 36 #"profj:syntax-coloring:scheme:string\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0
0 0 -1 -1 2 37 #"profj:syntax-coloring:scheme:literal\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0
0 0 -1 -1 2 37 #"profj:syntax-coloring:scheme:comment\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 194 116 31 0
0 0 -1 -1 2 35 #"profj:syntax-coloring:scheme:error\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 37 #"profj:syntax-coloring:scheme:default\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 39 #"profj:syntax-coloring:scheme:uncovered\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 37 #"profj:syntax-coloring:scheme:covered\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 139 0 139 0
0 0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 0 1 #"\0"
0 75 12 #"Courier New\0"
0.0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 4 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 100 0 0 0
0 -1 -1 120 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 116 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 115 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 119 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 120 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 115 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 119 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 117 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 121 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 120 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 116 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 115 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 119 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 178 34 34
255 255 255 -1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 70 1 #"\0"
2.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 -2 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 -2 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0
0 0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 121 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 70 1 #"\0"
1.5 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 -1 1 #"\0"
1.5 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 70 1 #"\0"
1.5 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
1.2 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 118 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 116 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 118 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 121 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 118 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 121 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 178 34 34
255 255 255 -1 -1 0 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
0 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 0 -1 -1 117 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 118 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 178 34 34
255 255 255 -1 -1 117 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 -1 1 #"\0"
1.0 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 -1 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 -1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 153 0 0 0 0
0 -1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 -1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 109 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 -1 1 #"\0"
2.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 70 1 #"\0"
2.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
1.5 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 -1 1 #"\0"
1.5 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
0.8 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 0 -1 109 1 #"\0"
0 70 1 #"\0"
0.6000000000000001 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0
1.0 0 0 255 0 0 0 0 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 36 36 140 0
0 0 -1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0
0 0 -1 -1 109 1 #"\0"
0 -1 1 #"\0"
1.2 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 70 1 #"\0"
1.2 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 -1 1 #"\0"
1.2 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 153 0 0 0 0
0 -1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 68 64 108 0
0 0 -1 -1 109 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
0.8 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
1 -1 109 1 #"\0"
0 70 1 #"\0"
0.8 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 68 64 108 0
0 0 -1 -1 109 1 #"\0"
0 75 1 #"\0"
0.8 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 36 36 140 0
0 0 1 -1 109 1 #"\0"
0 75 1 #"\0"
0.8 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 36 36 140 0
0 0 1 -1 109 1 #"\0"
0 75 1 #"\0"
0.8 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 0 -1 109 1 #"\0"
0 70 1 #"\0"
0.8 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
0 -1 2 36 #"honu:syntax-coloring:scheme:keyword\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 40 #"honu:syntax-coloring:scheme:parenthesis\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 -1 -1 2 35 #"honu:syntax-coloring:scheme:string\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0
0 0 -1 -1 2 36 #"honu:syntax-coloring:scheme:literal\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0
0 0 -1 -1 2 36 #"honu:syntax-coloring:scheme:comment\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 194 116 31 0
0 0 -1 -1 2 34 #"honu:syntax-coloring:scheme:error\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 39 #"honu:syntax-coloring:scheme:identifier\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 38 38 128 0
0 0 -1 -1 2 36 #"honu:syntax-coloring:scheme:default\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 0 1 #"\0"
0 75 12 #"Courier New\0"
0.0 16 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 70 1 #"\0"
2.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 -2 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 -2 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 -2 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 50 205 50 0
0 0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 70 1 #"\0"
1.5 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 70 1 #"\0"
1.5 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.2 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 0 1 #"\0"
0 75 7 #"Monaco\0"
0.0 11 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 248 20 64 0
0 0 -1 -1 0 1 #"\0"
0 75 1 #"\0"
0.0 12 90 -1 90 -1 3 -1 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 1 #"\0"
0 75 8 #"Courier\0"
0.0 12 90 -1 90 -1 0 -1 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 40 25 15 0 0
0 -1 -1 2 30 #"drscheme:check-syntax:keyword\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 40 25 15 0 0
0 -1 -1 2 39 #"drscheme:check-syntax:unbound-variable\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 248 20 64 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 36 36 140 0
0 0 -1 -1 2 37 #"drscheme:check-syntax:bound-variable\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 36 36 140 0
0 0 -1 -1 2 32 #"drscheme:check-syntax:primitive\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 36 36 140 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 51 135 39 0
0 0 -1 -1 2 31 #"drscheme:check-syntax:constant\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 51 135 39 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 165 0 0
0 0 -1 -1 2 32 #"drscheme:check-syntax:tail-call\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 165 0 0
0 0 -1 -1 2 27 #"drscheme:check-syntax:base\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 -1 -1 0 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 92 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0 0
0 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 92 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 40 25 15 0 0 0
1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 248 20 64 0 0
0 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 36 36 140 0 0
0 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 51 135 39 0 0
0 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0 0
0 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 0 1 #"\0"
0 75 1 #"\0"
0.0 12 90 90 90 90 3 3 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255 255
255 1 1 0 1 #"\0"
0 75 8 #"Courier\0"
0.0 12 90 90 90 90 3 3 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255 255
255 1 1 2 1 #"\0"
0 71 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 80 80 248 0 0
0 1 1 2 1 #"\0"
0 71 1 #"\0"
1.0 0 90 90 90 90 3 3 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 80 80 248 0 0
0 1 1 2 1 #"\0"
0 71 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 100 0 0 0 0
1 1 0 1 #"\0"
0 75 8 #"Courier\0"
0.0 17 90 90 90 90 3 3 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255 255
255 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 92 90 90 90 3 3 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255 255
0 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 92 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 175 0 0 0
1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 94 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0 0
1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 200 0 0 0 0 0
1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 92 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 150 0 150 0 0
0 1 1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 0 1 #"\0"
0 75 6 #"VT100\0"
0.0 12 90 90 90 90 3 3 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255 255
255 1 1 0 1 #"\0"
0 75 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 100 0 0 0 0
1 1 0 1 #"\0"
0 75 15 #"-adobe-courier\0"
0.0 12 90 90 90 90 3 3 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255 255
255 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 250 19 64 0 0
0 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 36 35 142 0 0
0 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 133 62 38 0 0
0 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 81 81 251 0 0
0 1 1 2 1 #"\0"
0 71 1 #"\0"
1.0 0 90 90 90 90 3 3 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 81 81 251 0 0
0 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0 0
1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 128 0 0 0
1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 165 42 42 0 0
0 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0 0
1 1 2 1 #"\0"
0 71 1 #"\0"
1.0 0 90 90 90 90 3 3 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0 0
1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 255 0 0 0 0
1 1 0 1 #"\0"
0 70 1 #"\0"
0.0 12 90 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 0 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0 0
1 1 0 13 #"h-link-style\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0 0
1 1 2 1 #"\0"
0 70 1 #"\0"
2.0 0 92 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 0 1 #"\0"
0 70 1 #"\0"
1.0 0 92 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 299 1 #"\0"
1 297 0 1 #"\0"
0 70 1 #"\0"
1.0 -2 90 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 301 1 #"\0"
1 297 300 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 50 205 50 0 0
0 1 1 0 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 93 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 93 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 250 19 64 0 0
0 1 1 305 1 #"\0"
1 297 298 1 #"\0"
1 297 307 1 #"\0"
0 75 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 307 1 #"\0"
0 75 1 #"\0"
1.0 0 92 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 133 62 38 0 0
0 1 1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 36 35 142 0 0
0 1 1 2 1 #"\0"
0 70 1 #"\0"
1.0 -2 90 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0 0
0 1 1 2 1 #"\0"
1 297 314 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 93 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 0 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 48 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 1
1 0 1 #"\0"
0 70 1 #"\0"
1.0 0 90 90 90 90 3 3 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 0
1 48 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 80 80 248 0
0 0 -1 -1 2 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 80 80 248 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 94 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 100 0 0 0
0 -1 -1 0 1 #"\0"
0 70 1 #"\0"
0.0 12 90 -1 90 -1 3 -1 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 1 #"\0"
0 75 12 #"Courier New\0"
0.0 12 90 -1 90 -1 0 -1 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 150 0 150 0
0 0 -1 -1 2 29 #"syntax-coloring:Java:keyword\0"
0 -1 1 #"\0"
1 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 2 1
#"\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 100 0 0 0
0 -1 -1 2 28 #"syntax-coloring:Java:string\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 100 0 0 0
0 -1 -1 2 29 #"syntax-coloring:Java:literal\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 100 0 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 105 105 105
0 0 0 -1 -1 2 29 #"syntax-coloring:Java:comment\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 105 105 105
0 0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 248 20 64 0
0 0 -1 -1 2 27 #"syntax-coloring:Java:error\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 248 20 64 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 139 0 0
0 -1 -1 2 32 #"syntax-coloring:Java:identifier\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 139 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 169 169 169
0 0 0 -1 -1 2 29 #"syntax-coloring:Java:default\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 169 169 169
0 0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 200 0 0 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 0 -1 -1 115 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 118 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 0 1 #"\0"
0 75 10 #"Monaco CE\0"
0.0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 4 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 175 0 0
0 -1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 178 34 34
255 255 255 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 2 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 2 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 80 80 248 0
0 0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 2 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 80 80 248 0
0 0 -1 -1 0 1 #"\0"
0 75 8 #"Courier\0"
0.0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 1 #"\0"
0 75 7 #"Monaco\0"
0.0 11 90 -1 90 -1 0 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 47 #"drscheme:check-syntax:lexically-bound-variable\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 81 112 203 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 122 81 203 0
0 0 -1 -1 2 40 #"drscheme:check-syntax:imported-variable\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 122 81 203 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 51 203 0 0
0 -1 -1 2 45 #"drscheme:check-syntax:lexically-bound-syntax\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 51 203 0 0
0 -1 -1 2 38 #"drscheme:check-syntax:imported-syntax\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 68 0 203 0 0
0 -1 -1 0 1 #"\0"
0 75 8 #"Courier\0"
0.0 12 90 -1 90 -1 0 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 115 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 178 34 34
255 255 255 -1 -1 0 1 #"\0"
0 75 7 #"Monaco\0"
0.0 15 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 4 1 #"\0"
0 70 1 #"\0"
0.0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 150 0 150
255 255 255 1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 2 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 2 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
2.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.5 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 -1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0
0 0 -1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 36 36 140 0
0 0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.2000000476837158 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0
1.0 0 0 0 0 0 0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.2000000476837158 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0
1.0 0 0 255 0 0 0 -1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 153 0 0 0 0
0 -1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 68 64 108 0
0 0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
0.800000011920929 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0
1.0 0 0 255 0 0 0 0 -1 2 1 #"\0"
0 70 1 #"\0"
0.6000000238418579 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0
1.0 0 0 255 0 0 0 0 -1 2 1 #"\0"
0 75 1 #"\0"
0.800000011920929 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0
1.0 68 64 108 0 0 0 0 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 36 36 140 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 92 -1 93 -1 -1 0 1 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0
0 0 -1 -1 0 1 #"\0"
0 75 7 #"Monaco\0"
0.0 11 90 -1 90 -1 0 -1 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 1 #"\0"
0 75 10 #"Monaco CE\0"
0.0 11 90 -1 90 -1 0 -1 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 1 #"\0"
0 75 8 #"Courier\0"
0.0 18 90 -1 90 -1 0 -1 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 1 #"\0"
0 75 10 #"Monaco CE\0"
0.0 12 90 -1 90 -1 0 -1 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 -2 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 248 20 64 0
0 0 -1 -1 0 1 #"\0"
0 75 7 #"Monaco\0"
1.0 0 -1 -1 -1 -1 2 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 0 1 #"\0"
0 75 10 #"Monaco CE\0"
0.0 18 90 -1 90 -1 0 -1 0 1 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 1 #"\0"
0 75 10 #"Monaco CE\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 0 1 #"\0"
0 70 1 #"\0"
0.0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0
0 0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0
0 0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 -1 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 -1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 153 0 0 0 0
0 -1 -1 2 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 -1 -1 0 1 #"\0"
0 75 7 #"Monaco\0"
0.0 11 -1 -1 -1 -1 3 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 125 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 128 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 130 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 131 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 134 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 122 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 119 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 -2 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 50 205 50 0
0 0 -1 -1 109 1 #"\0"
0 75 1 #"\0"
2.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 109 1 #"\0"
0 70 1 #"\0"
0.75 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 36 36 140 0
0 0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.2 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
0.8 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 0 -1 2 1 #"\0"
0 70 1 #"\0"
0.6000000000000001 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0
1.0 0 0 255 0 0 0 0 -1 2 1 #"\0"
0 75 1 #"\0"
2.0 0 92 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 255 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
0.8 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
0 -1 2 1 #"\0"
0 75 1 #"\0"
0.8 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 0 -1 109 1 #"\0"
0 75 1 #"\0"
1.0 0 92 -1 93 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 24 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 15 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 14 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 21 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 19 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 24 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 14 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 21 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 24 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 15 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 14 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 19 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 17 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 21 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 17 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 17 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 17 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 178 34 34
255 255 255 -1 -1 19 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 15 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 178 34 34 0
0 0 -1 -1 4 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 255 165 0 0
0 0 -1 -1 19 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 255 165 0 0
0 0 -1 -1 17 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 0 1 #"\0"
0 75 11 #" Monospace\0"
0.0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 26 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 -1 -1 26 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 15 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 255 165 0 0
0 0 -1 -1 17 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 255 165 0 0
0 0 -1 -1 0 1 #"\0"
0 75 6 #"Menlo\0"
0.0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 65 105 225 0
0 0 -1 -1 0 1 #"\0"
0 75 12 #"Courier New\0"
0.0 10 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 4 1 #"\0"
0 71 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 1 #"\0"
0 70 1 #"\0"
1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 148 0 211 0
0 0 -1 -1 0 1 #"\0"
0 -1 1 #"\0"
0.0 12 -1 -1 -1 -1 -1 -1 0 0 1 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 -1 1 #"\0"
0.0 12 -1 -1 -1 -1 -1 -1 0 0 1 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 0 1 #"\0"
0 75 12 #"Courier New\0"
0.0 21 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 1 #"\0"
0 75 12 #"Courier New\0"
0.0 29 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 1 #"\0"
0 75 12 #"Courier New\0"
0.0 15 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 38 38 128 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 128 64 0 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 41 128 38 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 132 60 36 0
0 0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 255 0 0 0 0
0 -1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0
-1 -1 2 1 #"\0"
0 -1 1 #"\0"
1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 255 165 0 0
0 0 -1 -1 0 1 #"\0"
0 75 12 #"Courier New\0"
0.0 25 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 1 #"\0"
0 75 12 #"Courier New\0"
0.0 26 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255
255 255 1 -1 0 136 0 4 3 85
(
#";; The first three lines of this file were inserted by DrRacket. The"
#"y record metadata"
) 0 0 4 29 1 #"\n"
0 0 4 3 85
(
#";; about the language level of this file in a form that our tools ca"
#"n easily process."
) 0 0 4 29 1 #"\n"
0 0 4 3 176
(
#"#reader(lib \"htdp-beginner-reader.ss\" \"lang\")((modname rocket) ("
#"read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t construc"
#"tor repeating-decimal #f #t none #f () #f)))"
) 0 0 4 29 1 #"\n"
0 0 17 3 43 #"; These two lines are needed to draw stuff."
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 7 #"require"
0 0 24 3 1 #" "
0 0 14 3 11 #"2htdp/image"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 7 #"require"
0 0 24 3 1 #" "
0 0 14 3 14 #"2htdp/universe"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 17 3 33 #"; Here are two values we'll need."
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 6 #"define"
0 0 24 3 1 #" "
0 0 14 3 6 #"ROCKET"
0 0 24 3 1 #" "
0 2 137 4 1 #"\0"
2 -1.0 -1.0 0.0 0.0 0 63 500
(
#"\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0\341\0\0\0\341\b"
#"\6\0\0\0>\263\322z\0\0 \0IDATx\234\354\275W\260$Yz"
#"\337\367;&3\313\335\272\367v\337\266"
#"\323c\326/\326\3\340\6\30\22\200\200@\5HJ\241\b*BZ\204B\346\201"
#"\241\27\352UozP\210\21\224\30\241\27A\n\220 \1\211\20Aa\341\27\4"
#"\260\300\2\\oggvv\2613;\266gzLO\273\333\327\227Kw\316\371"
#"\364p\262\314\275\335\263\6\335\320\2140"
#"\371\357\310\256\252\254\274U\231\247\316?"
#"\277\357|V\211\210\320\342\315\203\0034"
#"\210\6\17\4\34 h\24\26\v\325\312\261\22\217E\a\352zLP\201\275/\374"
#">\27\177\366\27 =E\225\2541\3"
#"\22\240#\25&\224\20\4\304\200\352\202"
#"\326x\r\250\3701\212\2729\272\305\233"
#"\t\375f\237\300\333\36\352\207<\306\37"
#"?\326jCU\25\354\354\354\2001\20\2\260\362\203*\vJ\307\277Q:n-"
#"\336\222h\177\231\267\20\24\201(\356\""
#"\4\226\277\220\2B\363\250\2*\321L"
#"\307c\256^\275\32w\206\260\370\313\370"
#")\212\205\210e\3453\216}W\370k\272\222\26?\nZ\22\276\331Pq\213\374"
#"\b\350f\213\257 \250\225\343\26\20P"
#"\212\275\235\35\266o\334l\336W\363w"
#"\0pA\32\t\330\220\261\305[\26\355"
#"\257\363\226\201C7\362k\25\312\200W\200m\b&\36\360 \236\355\eW\231N"
#"F0\36\203\265\213\277\21\240\366\2.4j\250^\222x\361\5\255$|\253\240"
#"%\341\233\r\35@Ec\214j\244\340\234'Bc\254i\264J\261\200\22\360\16"
#"B\315\315\327_CyG~\343\332\2124m\250\2455a\256\317\252\273-<\347"
#"\237\336\342\315FK\3027\35\363u`\224L\253\312"
#"c`IB\257@[\"iC\t\256`\357\306U"
) 500
(
#",\201\e\257\\\1\t\230\346\357\4H\214B\331\0040\v\3\215\250\325\25g+"
#"\t\337*hI\370\246#:&V\t\21\227\211\361\247\21\226\24\215oz\b5"
#"\3249\345\301\36\2518\366\267\257\203\324"
#"\30\346\256\207\346Pm\233\27\361\263\216S\256%\340[\5-\t\337dD\311t"
#"\222\20\307\177\226\271\254\34\215\367\241\234"
#"B\"L_\271L\276{\235\365T\270\372\302\323\20*\212\361!\26p\276\361j"
#"x\317b=\330H\302\226\210o=\264$|\223q\334)A\263\370S\350\346\247"
#"\231\373\352\217&c\206k\375F\22\226"
#"\224\207;\230b\302\351\216\2428\270\5\345\224N/A\352@\317D\37\2751f"
#"\345s\357\366\315-\t\337\nhI\370&#r\243\261`\312r;i\314\354v"
#",P\203\tP\214\331y\371\5\206R"
#"14\236\303\e\257@\230\201\224\364\22"
#"\260@p5\22\334\362{\324\222\360m\210\324[\v-\t\337d,\275\202,\244"
#"`|\214?N\2\324\"tm\22U\321P\203\25\236y\374\353<rz\r\246"
#"\273\244\325\30\236\375.L\217\242Z:"
#"\233\322K\22\304\35\267~\266\344{k\242%\341\233\fA!h\300\20\27nz"
#"!\256T| S\212@\5\251\205j\6\267n\360\332\263\337\345\301\315>*?"
#"\342\342F\227\317\374\376'!SPM\30\366R\24\16m\346a6K\305\363\230"
#"\221\247\305[\2-\t\337dDR\254\204\230\315I\30@\257\0201\324\25\210\3"
#"+<\361\251\337\346\354\240GZ\227\f"
#"\214#\223\212\227\236\371\16\362\342\263`"
#"54A\340\264\261\371\377\277@K\3027\31a\276\36\204e\234\347\nw40"
#"\235M\351$\t\314F\214\376\362\333<"
#"\371\3707y\317C\27\251\307\207P\317\320.g\243\327\345O>\365"
#"{\370\335\355\30\314-\1\314\361\357\2227x\336\342\315EK\3027"
) 500
(
#"\35zec\311\216\25\226\244\211A$"
#"\200M\370\215\177\375\353l\254\r\350X"
#"\203\362\216\243\275\300p\320es\330\343"
#"\333O|\213/\177\356s\200\220\37\35"
#"4j\355q\272\265\252\350[\17\252\315'\274G\254\222f\21o\26@\255:\37"
#"\302J\314\346\t\37`\235\240u<\4\3^C\1L\35\254[\310\306W\301\354"
#"\300\345\257\362\355\377\365\177 \214r\336"
#"\377\241\237\344\305[9\245]\347\306\350Qd\6\357>{\26\31in^\233\361"
#"s\377\311'\350\375\303\377\16\6\353\220"
#"u\231\246k\34\222\"\244d\300\0\350"
#":`\6t\232\363\326\241\361\364\307\214"
#"F\217\34\223\226q\325\252\242p\25b"
#"\30\17\200i\357\343\367\212v\4\377Z\3210O\235\220v+\357k\rE\36\337"
#"*\312h\315\254K\330\260P\37\335\206"
#"\216\206\313\317\362\251\377\345\237\322[\337"
#"\342\235?\366~\236\271\374<\27.\234F\212Cz)\f:\260\277\273G\222X"
#"\36~\344\1\276\372\325/\363\374\257\374"
#"2\24\0230\1EA\206\0\325\"\252fo{\4)+!6\363\b\35\335\234"
#"\231\2723\346\373.\227\326\342\336\321\222"
#"\360^q7\307\333\312\244^\204\253\254"
#"l\321\"j\342\204\17\320\351AQC\3225\214F%\e)\244\345!\203nM"
#"x\346q~\347W\376\17z\203!9\31\373\271\343\335\357\177?\267\257_\341T"
#"\267\302\324\260\321\353\"\265\247(g\254"
#"o\364\360~\312\343\217~\211\347\376\340"
#"\267\340\366uzx\326(\351\341\310\232"
#"3[\337\34\36\327\204\347\311\277hb"
#"\250\200F\241\232\377\343\343\261\353S!"
#"J\317\26\367\214V\35\275W\274\321\350"
#"\251p\227\303\356\214\3414\16\212\332c"
#"\273\6\347\242\227A\311\4\352\35x\372"
#"\e\374\376\257\375\22\246\32\363\236\207\37B\373\212|\177\233"
#"\263k)&?\342\340\326u\16p\364\222\f\251\204\272\320"
) 500
(
#"d\275M\314`\213\355\\xiR\360"
#"\341_\370\217\371\351_\374\257\340\314\203"
#"@\227:$\204\332\222%\tn\6\266\37]\223s\334I\253\345\236\271G\363\270"
#"\20\264\264\2707\264\222\360\257\rQ\252"
#"H\263\315\235\362\236\245\360\24\0\e\250"
#"\304\305 2\17\2528\2w\b/}\233?\375\225\177J\347\350:\37\270t\216"
#"\303\203\3T\332gp\346<\273\373\273\244I\205\252\34g{\3\244(\261J\221"
#"\245p8\332&\237\355\2609\204\263]"
#"\341\331\257\374\5\237\373\365\177\t\243=p9ztH\226(\234\23l\37*\5"
#"us^\376\330\231G\343\252A7\333\374\235e\22T\233\bu\177\320\222\360^"
#"!\363\30\314\25\31\242\216g?\254\22"
#"o\216\371_T\256\246\337\313\230M\246"
#"\364R\a\246\204\27\277\303\243\277\376K"
#"\364&\267\370\211G\316\342F{\254\367"
#"z\354\35\36\240\214\346\302\245s\\{\355&\2476 \255\205\201IPuI\220"
#"\222\301\232\241\256\17\230\34^\343\\_"
#"\330R\5\257=\366e\236\376\344\377\r"
#"\373\2671\235\24B\215\265\361l\334\312"
#"9\256J\301\205]i\21\353\246\233\n\ezA@\337::\356\vZ\22\336+"
#"\324\n\1UX\20p\276w\265\356\313*U\347\322\246R\286\6\32\366^"
#"\205\203+|\3437\377\31\243W\237\346\307\337q\21SM\331\354\246$\241`="
#"S\230\2203\e\3572X\203\262\6]\224\f\214%5`\2640\350\e\372\3\301"
#"\270#\352\243\353<\330\207\207\254\360\235"
#"?\376\24\333\177\361gP\216\241\236\202"
#"\224@}\214g\213K:^\254f\205"
#"\235ze\267\264\356\216\373\204\226\204\367"
#"\214\325\31{|\357*\31\341\270}tn\246\261&e2\336\5?\202\316\224/"
#"\376\322\377\310\344\325\247\370\310;.R\314F\364:"
#"\31\241.\351Rr\246\a\252\330e\274\177\213\302\303,"
) 500
(
#"\300Z\332\241.\n\272Y\302\332\320\222"
#"\27\5\256\254\30\366\2045]\242G\267"
#"9\243+\316[\307\327\376\350w8\372\302gb\260\367\3506\250rq\276j\365"
#"\374\216I\300\23\227\331\342\276\243%\341"
#"\375\200Z\316\320U\301\261\32\257\271J"
#">\323l\345l\206\306\263\276\226B\275"
#"\313K\277\365\313\34\275\364\30\357\334\312"
#"\30\244\32\1J\17\235T\263\226\324\330|\e3\333!U5i\6\203\263\n%"
#"B\277\233\241\361x\347H\322\30b\252|\364n\364BA\337\317\2704H\31\372"
#"\234\337\376\325\377\235\372\273\217B\346\241"
#":\300\22+\257\31\300\373\345\245\324\371"
#"\t9w\207\237\263\365Q\334/\264$"
#"\274g\314U\321\345\236U\241\341\303\""
#"4\e\274\340\213\22%\201z6\246\327"
#"I\220\331.\270\21\317\375\356\257\361\374"
#"W\376\204\217>|\212\215N\240\250\v"
#"\222\341:Nk\224\366\244\344t\352C\272\376\210T\305z\276\5\235X\376PI"
#"\254b\241@7\233%f`h\27\350\351\232\256\314`r\233\367^X\347\267\376"
#"\345/\301\325\347\200\31\345t\227.\236"
#"*\37\221\231\0\2.w$=\275\274"
#"\2134\1\254\363\353\322\215\303\242\245\341"
#"\375AK\302{\305\t\362\235\224\202\246)\300$^\320\22H3\3R#\371\4"
#"\244\"Ks\266\277\362i\236\372\322\247"
#"9\2239\266\372\6\347Kt\232@\222\342\215\302\30H\251H\374\210$\b\35\3"
#"\306h\34\26\261\201`\2Z\203\3261"
#"\200\305\350\370\275\26\310\22\bnFB"
#"\305\326Z\2\323=\2467\257\360\357\376"
#"\315\257\302\356k\f\273\35\374\364\200^"
#"\226@\236\203\4l\326\270\35V|\210'\313\227\316#hZ\334;Z\22\336W"
#"\350;^i\5\256r\370\252D\353\20\363\1\213)\351 Z)y\375)\276"
#"\366\333\277\3129S\361\276\207/2\232NPi\206O,\2058\260\1c\3"
) 500
(
#"ZWH\250Q!&J$:A\v\370D!\26\202\21\264\211R\327\252HB"
#"\255cq(c\3yq\310\251\215\f]\355\363\301\207Ns\345[_\342\371\337"
#"\371W\340\n\214\257\301\227\370\351!P"
#"\203\n\24\263\34LS\236_\235\\\333F\267E\353!\274?hIx\317X\16"
#"\341\35\245*\210R#\263\206\254cc*R\235\343\16w@\5\302\255\253<\375"
#"+\377\23\347\375.\17nv9:\32\343M\227tc\213<\324\4J\322\244F"
#"\353\212@\35\23\224t\254zo\25\244\22\360\t\4\253QZGI\270B@\325"
#"\304\242\352TS\272\232\"?\340\322\331"
#"u\230\334\346\243\17\236\346[\177\366\a"
#"<\361\a\277\3\211\206\311\21f\330\205"
#"\272\0<I\327\340\24+\356\210\345\332"
#"V\321\254\35\245\235>\367\3\355(\336'\234$\337|`}\335X;\304\307\240"
#"P\3vs\rB\305\27?\363i\334sO\362\343\347:t\\\201$]\322\323"
#"\17\260W\201\355\366\260\326\3211\16\243\vj\2\26568\3\1K*B_\\"
#"$a\22k\222\252&\26\325\20%0\32L\246\330\233\324t\207\226\262\232PL"
#"\366\350I\311V\342\271\220\t\377\356\17"
#"\177\217\311w\277\5\231\215\347h\4\224\303X\215\27Y\370\17\217]_ \6p"
#"\267>\212\373\202\226\204\367\5w/5"
#"\37\215\27\1\202\203\272\212&K\211\244"
#"\274\374\205\317\362\275'\277\305\307.@"
#"\257\334'\3013\330<G\221\f\230`\261\375\16\375\216\242\233T()q!\340"
#"l\27\237\364\b\30\264\b=\345\360F\bF\300h\264\326X\245\342:TEI"
#"(Z\341\4\222^\212I\25\207{c\316\256w\231\335\276\301;\267\326Qy\316"
#"\37\376\346o\302\344\20\366w\201\0\276\4\204\240\3021\22\36\343\334"
#"j&E\213{B;\212\177\315H\222\2441Y\2\332\200\253`\373"
) 500
(
#"\26_\376\322\347\330\350\17\"S\363#\326\373}n\356\36p\220;N\235{\200"
#"\274,\351d\26k\2\"\16'\340u\202\327\31\2424:xR\4\321\221q\252"
#"1\215*\245PJ\243T,\2351\236\6\316\\\\c2\235\1\201\255\323\t\343"
#"\203]\326{\t\305\321\1\357x\340<"
#"\267o\336\340\217~\345\237\303\306\20\216"
#"\16\241v\321=RWw\324=U\255"
#"\277\360\276\243\r\340\276W\370=\220\16\230>c\5%1_\257S\326\340\34("
#"\307Q\257G\215b\313O`\373\25^\374\357?A7\275\2029\3451\203w4"
#"\304\21\2645q-g\ei\246=\231"
#"1\24\323\21\371\370\20\352\222\314@\252"
#"\258\3019\360&\346\355\212\304\330\323"
#"\20\232\315\307}\256n\336\17\212\20\344"
#"\330{\"P\366a\2355\276\372\330\230"
#"\377\354\37\377c\272\277\370\337\260\303&"
#"IXcc\242\343b0\v\270^\315\230@\n\364I\240n\232c\244o\352\350"
#"\377\215@+\t\357\25\2224e\346\243"
#"\303;\245\311+\320\n\214\205\254\203\241"
#"&\2231\270)\257\376\346\257\221\364,"
#":M\351\246\313\372\23\252\351\27\261|"
#"\214\215Be\245B\267\232K<\336\240"
#"\275\304\n\224Z\335\336\370\340Nb\270"
#"\275?\346\303?\376\20\237\372\275\337\""
#"\274~\235\276\224\f\346\245\336,\240\301"
#"\242I\2334\247\370\5\264\216\302\373\204"
#"\226\204\367\n\325\5\235\340\t\30\2=\300\n\3217\220&`\fY\235\263\26f"
#"\310\223_\345\271'\277\314$\214\31\236"
#">\213U\eh\255\27\344\322:\22\3064\304QJ\360\336#\"\350\306\372\t\221"
#"\240\201\306\2\252\356\276\35\207,\276c"
#"\271\305\343\\\25\350o\2561\363\5\306"
#"\225\374\376/\375o\364\274\307\372)\330"
#"\32\272D\307\2437\3640X\f\16\r6\264\263\347>\241"
#"\35\306{F\202W\26\207\220RcC\35;\227i\230j"
) 500
(
#"\30\273\232D\5\270\3612\217\376\356\277"
#"`\330\237`\326<\222u\260\254-\3107'\343\374yt\270k\3049\224\370\270"
#"\254<F\304\343$<\t\265 \362\352\363f\323\2628\6o)EP=\313\351"
#"^\302\321S\337\341\225\337\372\177\300\317"
#"\310\303\21\225uQ\32z\215\252-\t"
#"\26O\314\276\300\270;\277\270\305\217\214"
#"\226\204\367\b\321\213\2\203\321\22\332h"
#"\217\245\202\34\350Z\3\325\230\203\177\373"
#"\233\244{/\322\261G\254_\\c4\313\321\241\337\20K\203V\221\210:f!"
#"*%(-xW\21\202;&)!j\300\253\204\374\376\233j\302\333\340\244Z"
#"K\241\250\\L*\316\244\340\235\231\346"
#"\211O\376\ex\351{t3\241\240\216\375\21\3\340b\242\210\240q\4|\233Q"
#"x_\320\222\360\36Q\253y;y\263"
#"\254\240\335\354\323\200e\6\217}\205\253\217}\236\213}G\277SRTcT\243"
#"\342\315\3>#\17\5\243t\214|\321`\265\20\\\25C\3114X\245YU'"
#"c\274\350r\215\2504wJ>\r\307\327\222s\22G\25\265\230T\364\272\3\216"
#"F\373\254\245\201a=\342ty\310\347"
#"\376\257\177\16\214\201\0227/T\325\230I#'%\356oq\317hIx\217\b"
#"\314\343(5\204\f\224\215\344\0\6\344"
#"\260w\225\247>\363{t\375\21\211\344"
#"\234^\357Q\316\306d\251\305\352\23j"
#"\342\334J\2124\231\354B\360\25\4\37"
#"\245\243\26\264Z\252\222Z+\214\22\f\n-,\2128\305GAK, \254\t"
#"\261R\232RM\305\264\346x%tM\237b4c\330\3510\235\334\346\314\272f"
#"]M\330{\346[\274\364\331O\263F\216\242^~\270,l5\370\226\204\367\5"
#"-\t\357\21\v\2117\367h\ep\0322JR\277\317\301W\376\224\361"
#"\253O\321M\35N9\264\326l\r\207\370|\214\356\2354\230\314\245\241"
) 500
(
#"D\207\234\222\206\200\261\204\242^I\356"
#";\346WR\262X\27\256\256\17\227k\277\271>9GXH\304\265n\37\362\212"
#"486\206\31\271?\244\223Vl\251\222/\376\332\257\242|NJ\211\267,\312"
#"\311\230\20\237J;}\356\v\332Q\274"
#"g\224\30q\321AX\303\304\3055\242"
#"\341\20n\276\300\323\377\3667\270\320\27"
#":\353)\311\372:\301[\222\n\206\235\4\tG8\t\30c0\306,\327}\326"
#"\200/\311\217\366\311\22\2035\2616\333"
#"R\335\214\4\n\253.\336U\343\314\212"
#"\261\346\30)\eb\307\277\217\177+>04\31\356pL\221\217\221>t7\r"
#"g2\270\224\347|\376\177\376' 9%3f4\206\230I\311l<\246\235>"
#"\367\a\355(\336#\2yT\35\353\370"
#"\332\246\340\31\203;d\377\217?\311\271"
#"z\237\216\316\251\22\310m\n\222\221x\215U5\242s\224R\204\306`2/\212"
#"\217x\220\200\"\304\306.\b\n\217\222"
#"\325\\\206\210U\241\251\270\313s@\211\240\225BI,h\270\3727 $!\320"
#"u\361\273\v\343(lI'T\234-g\324/<\317\365G\277\204\245\300X\201"
#"\252\2044\243\2533\24\311\377'c\374"
#"7\35-\t\357\21\212\245T\241Y\227"
#"\365\231\3023\217\361\302\227?\315\272\344"
#"\30]\343\22\215\327\26\25\22\22\257\242"
#"\e>\251\242e\264\201\236\253\215\342\301"
#";\324|-(\1\365W\252/q\262\264T\363\270\262\256\24\25\260\b\211\3042"
#"\242NyJ\35\320\252b\350K\270y\225\257\374\336o\220r\204e\34\335\22\2"
#"I\326G\267\323\347\276\240\35\305{\204"
#"&\215}\0\23\0\207\36\337\4w\300s\237\375\23\322|L\226\306T\"\261\32"
#"-\32\323\360\"h\2057\ne\364B\275\234\373\375\360\16\202[H?"
#"\325\20H\317WaJ\b\212F\202\236\300\e\370\f\343\223p\307>o*"
) 500
(
#"\320\201D)\222\08\215\17\202\263\1"
#"c\35\3\246L\256<\303\225\257\3749"
#"\206I$\241\272[\375\321\26\177U\264$\274Gh\272TAAR\203>\304\250"
#"\21|\363\v\334\376\336\267\331\330\30P"
#"w\22|\232\220`\350\4\301\6OP\340\264\302\331\354XK\353\350\317\213iO"
#"\336\327(Y\26\"\324+B-\34\373\376\225ma\r]>.-\246\352\330\246"
#"\211y\207\301\4\202\361(\245\260^\223"
#"\326\32\35\24\265\206\272\eH\222\212\a"
#"\22\307\327\376\365\257\301\364\0\244\0\23"
#"\b.&\205\264\270w\264$\274G\4"
#"\17*\313\300\346`\16\240\270\3113\237"
#"\372$\e\256\204\3242\353\365\360i\227"
#"\216(z\336a\245\302kOm\22\274\352\235 \241D\21\345]lu\35d\231"
#"$u\17b\347\215\"j\0\202\256\tI\224\314\211\327t\v\215\2514U\242\230"
#"\364\2\322\251\351\27G\310\v\317s\370"
#"\231?\3\251\301\b*m\362\177[\3343Z\22\336#,\363\210\231\22d\37\276"
#"\361\27\344\317\177\217\363\335\16>\3530"
#"\353\366\251\223\2144(z\256\306P\343\255\340LBP\35\264n\34\17\v\253%"
#"\210\b!\0347\302\250\325\256O?\2\356\36\273\275\24\253^;*#\4\243H"
#"\274\241[j\22\247)-L\272\2\3"
#"\215\236Nx\177\247\313\243\177\360\3730"
#"\336gVN\250tS\367\270\305=\243%\341\275B`\346\241\242\0067\346\271/"
#"\374)\0272C\27\205]\353S&)\242SRQh\361\30\251\361*\340\225\302"
#"\223\334%\232% \"\3143\314\356\333\17\264B\362Ub\212\216\365iP\261l"
#"SZ+\214S\4\255)3\215t\25\353\231bS\2\343\327\257\361\324\347?K"
#"\326\355Q{\350e\367\353\344\336\336"
#"x\333\327\352\221\306\214\37\377sD_\303<\16f"
#"\236\317\263t\223\307\233\277kR\214\34i\331g+\0"
) 500
(
#"e\227\362s\337\241\234UL7\246\2349[s\326M\331tP&\226\235aF"
#"\260\6k 59\31\373$\4\246\325{H\254\306&\t>\224\270\252\244v\25"
#"A\4\25b\356`\254\347\242@\24\312\e\224\30\b\20\224&\2355\276\21\t "
#"\n\t\1\t*\366\27\24\205s\216 "
#"\363\374\301\200\227e#\337\371\5\325\4"
#"\212\254\344\260\23\335\235!\200.`c"
#"\n\353=\2506`\317\35\262\231\256\361"
#"\344\37\3762\37\371\205\377\200A\377\1"
#"\320\3j\22\242\215\330\306\362\32\315@-\307t^d\177\276\303.\212\n\v1"
#"\324\356\355\216\267=\t\277?\2263D"
#"\311\361\356E\213\3675\315\254\336\347\361"
#"\307\276H\222\0371L4\263qI\277\337'\4\215u\35Du\321\222a|,"
#"Wo\224G\343Q\332b\304\304\n\372"
#"bQ\336\240\305\200$\261\211Z\230\373\372\24H\23\320&\0&Nx\23\177\302"
#"\271\n\353\320\210\222E\"o\255#\31E\4/\212\20\2\242\25\241\271\235$u"
#"\214\2761\n\22\225\342Ib\255\324Pc\244\302xK?QT\336s0\365\214"
#"\213\t\317\374\341\37\363\301_\374Gq"
#"Q\270q\247\257\360\356\252\363\374\306\326"
#"\342$\336\366$\274\373\204\321\307\237\313"
#"\361wB\223n\ewL \231r\364"
#"\215\317\362\362\225\277\344\303[\302\346\306"
#"\6i\310\361\225\305\230.F\6\4\31"
#"\200\357b\265%1\220\20\260\4\352\356>\niZ\375\325 5Z<\212\n\215"
#"\213n\213\320D\312\bM\227'\5\312\"\"Ti\243\276\206\206`\2!\4\274"
#"\250(\tU\210\375\20%f\325\273\260"
#"\314\252\27\201\265\31(\225 \252CP\31\"\206 \202\26\207\t3$\b:\263"
#"\30\3471\245&\v\t\337\374\342\327"
#"\370\340\337\373\257a\363\374\312\320\251\37\262\364\305\222\214"
#"\255\213#\342mO\302\273\23p>QN\274\331\20V"
) 500
(
#"/\216\1\302.\310\214/}\341\2178"
#"}\252C\277\353\250\252\31\203N\227\351"
#"hF6\334\304\204\16\250\fT\212U"
#"\6\353\3\211\216\2557\255\236\222(\215V\1\t\5\206)0\1\0253)t\223"
#"\35\2618%\211)I\"\36\5\324\215\201d^\346b\256j\372\206e^\305\360"
#"\266\325\367\334\n\t\223\220\242TJ\20"
#"K\320\6\304\20\210n\22#\206\216\2115F{\211\245/\226M\272\274z\373&"
#"\257~\355\313<\362\37\375\3T\243^\316GJ\344n\344Z52\251\245\16\332"
#"\26V\1Z\375\340\4VgE\263&\\i\210r,$\f\242\267M9n="
#"\372u\256\277\366*gN\237\305$]\216F3\252:\240\255E\351\200\322\5\332"
#"\214\260v\17koc\223\233({\r\222\253$*f9\20\2*\370&Jf"
#"Y8x!]\232/\235\247*i\35w\351\346\271Q,|\177\213\277\345\3706"
#"wu\30Xd]XUa\324\4m&\30=\301\352)F\347\30\225cT\305"
#",\0373\315G\330\4\326\372\35R\23"
#"X\353h\376\354\217\177\27\306;\213\361"
#"@\302b|de\314\216\343D\361\304V\24\2\255$\\H\267\343\320\307\37W"
#"'\323\202\0241\231\a\237\362\273\237\374"
#"\24\365\24v\366s.\\\334\"\221\200\263\216\3010\243p%\230\31$B\2605"
#"b+\224)@\22713\"|\260\371z\a\316D\333\220S\350P\241TSr"
#"7p,\237o~\36\321\232\31'\275'J\271y!'\323\34c\242\273\21\21"
#"E\360\340i\324\326\320\254\23\263\370>"
#"\252FT\215\210\216\357\351\330\374\254r"
#"1\257\261\333M\321\2222\e\345\210\355"
#"\361\255\307\276\316\253\337\370*\17\375\247"
#"\0176\271\224\363q\211\337;'\342\235.\222&;\270\235z\v\264"
#"#\261\300\322\351\325DV.^\253\343o\254\34\378x\352E\36}"
) 500
(
#"\364I\336\265\325\347\272\2539\327\e\262"
#"\225\236\246*\217\240\323\303kM0\16\245K\224\365\30[Q'\3712D\255\350"
#"4\272\241F\202\20$E\304#J\307\220\2240Og\367\313\e\206\254\224\244w"
#"\321\265\240C\264\216F\225S\307G4"
#"\332\305\365\242\27C\b\202m\310\30\32"
#"\353\351,\311\361D\233p\t\224\1\274Q\210X\b\202^3\344b\231\314\f\207"
#"\336s\343\240f\247:d\367\260\344\377"
#"\374\365O\362O\376\301'\232\363\212I\315\262rS;n\310\n+#\332,t"
#"\333\n\336@K\3027\300\\!<\201\325I%\2*\360\371/~\216\262\252\31"
#"\345\216i\267\307w\236\277\311\251\0246"
#"\272\206\363>\345\324\351-\240\2jt"
#"\310\t\222\223\204\234@\211Q5\306\2241RF<\22*\234\252\b\306cp("
#"%\210\212\241\0s\265tU\352\1d"
#"\363\3301\315\"\302\6\25\242\240n\244\245(\25-\261J\305d$\0253+\224"
#"R\34\232\24\207\242&\245\22\203S)\265\30\202(\4\303\255[;L\362\202Q"
#"\221Sg\353\354\225\t\373\225\345\354\245"
#"\17\361\330\23/\262p?\210\216\332\201"
#"\350V\315\374\21\321\222\20\216\251\244\363"
#"D\325\271\244\361u\354\367\267t\24\n"
#"H\t\326\223\357\357b\262\202\217\377\354"
#"\307\270\361\322\25\366\212\202\316\306&\245M\270]yv^s\310\253{dYF"
#"\177\220\2626\\c\270f\30t5Y\26\260\6\326\a\333t\322\f\b\24#a"
#"\342g(o\2606%h\320&\5\34JB\323\236z\351\314\27\5I\241\e\307"
#"\276F\264Bl\264\212\"\232\200\242V1\3558\240\243\253\"\304\265lCWn"
#"\214\316\340\3\224^\230U\201Q^1\236\226Lg9\245\363\24e\240\26M\326"
#"?E\232\235\245\322\212iUc\315\200\217\376\355"
#"\17\360\257\376\305?\343\37\376\267\377\b\254m\310\r"
) 500
(
#"U\31H;\221\214\253MddU\32\312\362\235\267;Z\22\36C\324\365V\243"
#"\261\224]\224\215\211j`\225\243\230\241"
#"\254\345\325+\317\323\335\310\371\251\237~"
#"?\341o\275\233\275\e\267\271u\345:"
#"\257\356\214\311\244\313\240\267I\242:\224"
#"!a2\321\354\315\f\351.\244\211\306"
#"\30\301j\30\244\257\323\353(\254QT"
#"\205\305\25=\22\255\350f\26k\204\324\30\264\362\213\314\5Q1+~~\216i"
#"a\342z/\4\274\v\361\321K\343\212\320\24y\205\vB]y\252\252&/k"
#"\312rF]{\274\17\274\32\326c\275\30\201Z\300\aE-)\201$\6\232'"
#"\1\207b\242324\331\351\r\336\375\256\323l]x\2203\347\316\263}p\215"
#"\327_y\201\a\337\373!\300\203\326h\243\20\5u\20\214\206x\23\b\215Uy"
#"u\275\335\22\20Z\22\36[g\335\315#\241O\314\223\20fX\343\300W\274x"
#"\371I\22\275Gg\260N\377\314:\27"
#".\275\217\217\376\344Gp\271b\367\306"
#"\210\333\327\366\31\35\316\220\332R\a\205"
#"\17\232Z)Je\261\332b\214\301\372"
#"\277E(\23\202\257\231\214\16\231\216GH]c\224\240\32\t8O\346\215Q0"
#">\272\20T\224\210\204\264\361\1\306\32"
#"\245>\200\367\321q\357Q\270:\3T\\\3\206h#\235;\356\1\216\262\16\336"
#"{\234\3248q\210\216]MU\242\301\4T\2428w\3664\347.\235g\363\334"
#"\31\372\353C\202Q\34\36\35q}\357"
#"\333\224bx\346\311'x\360\275\357\207P\200\211e\370i\f@Z\253fXW"
#"\6R\32[\355_1\36\366o\32Z\22.\260\342\373c.\17O0P*l"
#"\2d\212\355\27\237c2\272\315\305S\236$s`s\352\340Q)\fO\235\342"
#"\364\245-\336\361\221\207\31v6\360\205c:."
#"\30\215\306L\217\246L&\23fe\205s\216\203["
) 500
(
#"}Ro\361\276&\17\201B\e\264\215\5\235T\bd\251%\4\27\243aB\215"
#"s\216\312W\204\320H\275$E\20\202!Z4e^\372\">N\247\323\270\206"
#"\24AT\343\264\247QgE\341\273\216$1\254u{\f\6\35\206\233\3\3266"
#"\372\364\327:\230\256\301v\rA\t\323"
#"z\302\254\334\306W\333d]Kg\340"
#"\330\320c\16\216\316\361\312+\317\301\354"
#"\20z[ \16\255cm\374\304\232&B-,+w\263B\300\326O\b\264$"
#"<nZ\277\3+DT\16(!S@\311\363\317}\227A_\323I,\211V"
#"h\3\225T\34\25\25S\2273\350\17\31\16\327\230\371\233\330\201f8Tl>"
#"\324A\353\1\212\213\213h\312\264\34\240"
#"\5\212Y\316\341\376\1\223\321\b_T"
#"\270\272\304U5\343\361\30%\236:\304\34\303\332;\274Oq!V\346\256\315|"
#"M\310b\2358_3\6\5iz\6\243\23l\232\220e\31\235N\207,\3130"
#"i\2021\6\235\244Q\322\252\200\302\23B\205\223\212Jjj)\31\347c0\n"
#"\223\4\6I\215\322\321\214#~F\22"
#"\246\364{\3479:\334\341\365\327^\342"
#"\301\17\254\203h\224\261\344eE\232u"
#"\232\253\\\275\301\255\370_[\22\2-"
#"\t\357\212\325\271\341c\321w\342z'"
#"\200\252`v\304\255\233\257\260uz\r"
#"]j\212\252\304f\226\336\306&\353\247\3728/Tu\301\355\361\230A7%U"
#"\2*!1\t\306$\2102\204\306p\22\262[$\332`\326\25\233[\216SX"
#"zI\37\255Mcx\234[\37\eUT\315\335\vqR\207\20\t\347\3047\353"
#"\301\3461\4\4O]\327\4\211\252j"
#"\224\242%\316M\27\345\365g\343\264\351s\37\35\214.T\324uMY9\252\0"
#"&I\t\242\232P6\205v\32\25\4\353-\35"
#"3\240\20\1)\270\374\302\367x\360\3\37\5\235\1"
) 500
(
#"\202s\16\233\255D\322\0w\4@\264\0Z\22\236@\343\200'Nt\b\4q"
#"\210\322(\346\251\344\236\27\237\373\36J"
#"{\234/\351\352>*I\320Y\17_\302\336l\204G\350\365;l\234:\35\333"
#"Q\353@P\202\223@\b\03601D\fEi%\2466\5\207\v5\n(\352"
#"\200E\341\\@\205\345\214\225&EA\24\204\306@cf\325\"x;\204(1"
#"\343sG@\b!VH\363\22UZ\361>\226\325'\340\225\320\351Nb\224K"
#"\360(\37\320\312\307H\32\255\311B\a"
#"\2472\320\235\30\236\346\3\3129\304\225"
#"\324\371\204:\237\21\6\25\326\32^|"
#"\3512?\265}\223\301\271w\202\n\244"
#"\251\305\371\32c\222fdO\252\366\264"
#"dl\320\222\360\a \204\200\230\225\373"
#"y]\362\312\313\227\31\364;\344\323#"
#"\262\265\214 \t\336)t\226\322\357\245\3504\26\0.+G/\353@\360H\b"
#"M-\265\24c\273$\266\2076\226\2\e\243X\224\20t\215\301`m'VF"
#"\v\1e\226zrh\f3\3228\30\2`\353\331\242\242\232!\26m\n\3327"
#"\241\257\202k\310\347}M\25j\224T"
#"8\357\b\316\241E\350\254\35\340kG\250\34\301\327H\20D\fVe(\323!"
#"\324\26\361\31\2562\324EEJ\207~2\244\227\256S\271)\333\344$V\263}"
#"\363\6\327\257\277\316\373\316>\4\244\244"
#"IJ\31VU\3206\213\342\215\320\222p\21\347\30@\315kJ7yo@j"
#",\256\b\230\324\0\5\323\233W\30m?\317\326ia8\310\231u\37n\232\270"
#"\4\264\211\2242\336`0\2102h\37\37\305\32DkDk\234\226\350\346\b\6"
#"\372\273\261_\340\274\366\213O\360\276\306"
#"\212%\321\t\370\306\nJ\0\345\b\324\30\345\361\324(\2uO-"
#"R\225\304\aB\20\360\241\tM\v8_\341\361\4qx]\23\222\212"
) 500
(
#"\332\324H\26\20\361\224\343\265\305\32\322"
#"\343\t\6\34~\221\177\250\222\2\t\5*\25\214\361TA\250\0\225\30TWq"
#"\272\336#\27\215J\fO=\372e\336\367\261\237\201JPi,l\25i\327\24"
#"\255\2\20\3b\217\207\340\275\315\321\336"
#"\232~\0\0040f^\313!\260\275\275M\247\223\342kG\232\246w\364\376;\326"
#"lee\337I,\366\211m\266\371\344\\=\326\1\1\245}\243\nG\2258\250"
#"\270?\372\16c,fT\227\35\20\217"
#"\215\201\343q\246\e\232\n\337\242@,"
#"\206\4\35\232\234\305\273\365\251\370A\315"
#"\17\201E\1*\255\t!~\327\301\301\1\356`o\0210\232,\312\347\264>\301"
#"\357\207vd`\3052\252\356\30\20\361`\347i\a\342y\355\265W\350v\273x"
#"\357\311\262n\374\253\225R\366\213O:"
#"\261\357d\317\211\305\276\320E\207\f0\273\244)\0\0 \0IDAT%i"
#"L\346]Xc\e\342\251\32TM\320e\264L\352\370\32]\3\36\255\35Z\273"
#"\370\236\362\30]7\307T\240\252\30\22Gh\262&\f\232X\373TK\a\e:"
#"\334QL\370\304\371\3361T\307\366\205"
#"E\335T\2555\207\207\373<\373\314\323"
#"\220(\360w[\360\235\30\335\326G\b"
#"\264$\\N\4\265\272\243\231X\314\265"
#"U\1qT\373\273\334\276\275\35M\373"
#"Z\223$\311\e\222\354\373\21pu\323\276\213\362]T\310@Rt\23\324\34T"
#"@\224C\214k\bX#\272\"\350:J<-\240\"\361\324BJ\326\213-\222"
#"2D\222\252\200V\n\215\301\4\213\221\f\0352t\350.\232\320\334M\"\36o"
#"\2436\357_!'\b\252I\323\264)"
#"X\345y\356\271\357\201\4\202T\307\322"
#"\250\336p\334[\264k\302\345,\231\337\217\346\205v\343n\203 \276D"
#"\31\317\365k\257\341\353\222\0204i\332A\344\215\311\5+\322\344\r$"
) 500
(
#"\212R*vr\22\327\344+\nK\vm\\\243\212\212\317E\2Ay\24\321\351"
#"\36\3\310M\363Y\rY\2644I\277M\336\236\226HPmb\256\237\262M\231"
#"}\335XD!\250\331\361\317X<\256\206\22\261 \340\311k\b\265'\313z\244"
#"\271g\255\337\343\346\215kP\345\215\253"
#"\"A\307lI\364\234uJ\277a\204\322\333\25\255$\274K.\241ZN\31\214"
#"\16(U\3\25\327o\274B\232Z\202"
#"\367\244i\212/\375\217\254\206\336\361\276"
#"ht\260\v\t8_\353\211v\4\25\211\27\224 ME4\301\"\222\0001\276"
#"S\2216k\273\4\305\334\370\23\363\1"
#"\225\26\244QG\225\212\301k\363\342\277V4V\314\211s\272[[\3559!a"
#")\31\227\243%\2420&\301ZK\267"
#"\227R\346#\256\275\372\2Z\307\365\252"
#"\232\367\3278\271.|C\21\371\366CK\302\205\201\3NN\24M\224\20\30\360"
#"\223C\366\367n\323\355$(%Xm"
#"\250\252X\351\354^\326\204\363\266g\252"
#"\311:\217j\250\217\276@\35\20\255\tJ\21Hb\21&\272q\2235\220!0"
#"\0\6\210t\201\36\"\261\214\206`\360"
#"*Zc\321\363\357\223h\260!\240\361"
#"\30\325\\\373\261\362\370*\236\317B\212"
#"\207c\347\277<n.\340\25\342<\306j\202\257Q\332\363\364S\337\6+\370*"
#"g\231G8w\324\317\327\274\264$l\320\252\243*p\262\356\3362\312q\336#"
#"\272f6;\244*G\254w\25Vi\220\306\231~\217\326QE\25\277G\325\v"
#"\353fh&\250R\363v\234\32/\32\21\2134\225\330\202DU\324\a\217\340\21"
#"q\4)\360*!H\31\253\262)\217W1_QkA\202\240\b(\255\217\271"
#"\b\242*\e\232\327\361\232\26k\341\5\346\a\37O\306\325\312\342\234"
#"\307\250\224\272\230\222\330\16/_y\36p\270\332a\322Ns\235'\a"
) 500
(
#"\340\316\237\342\355\212\226\204j>\e\365"
#"\261)\327\204A\203\257\300\324<\377\314"
#"w\b\276\"\353tp\271\243\333\35\342"
#"\355\222t\363\336\363\307$^\363\232\273"
#"HJ\221\330\330\323&\302\366\366-\326"
#"77\350\367\273\224\256&\317s\20\215"
#"\325\31I\332\303\325B\225\vU\t\343"
#"i\305\336\356\1\263iE\226\366\350+"
#"\205\315\24\306@\177\2200<\265\216V\5e>B\244\304\3\251U(\355Q\22"
#"\255\245I\252\220\312Q\24E4\2504\t\276\332\304\240n\5\r)\325b?\230"
#"\250\0254U\335\202o|\213^H\322"
#"\4%\226N\320\224\263\232\243\243\333\214"
#"n\275\316\360\364\2458\206\222\254./"
#"W\214a\255\3\37Z\22\22\343P\314\261=\313\342J\22\335\4>g2\336\243"
#"\233i|\235\323\315R\352\332\221\332\230"
#"-\360F\222\356\207\211\312\32Ov9w\361\fUU\261wx@U;No"
#"\235g\232W\350t\310\355\335\21\267w"
#"\306\214\216J\262t\215A\3774\e\233"
#"\347\310\262\232\311dJ\356*\312Y\316"
#"\376\301\16\243\351!6\361\f\3262\36xp\213w>r\1kk\246\243=\312"
#"\342\210T)\254\22\212:G\5G\322U\224\345\361\342KJ\251\350\227Y\\\327"
#"\235\306\30\2401\2\t\211N\21\37\"i\245\306hEb\2;\267^gx\376"
#"\301\225`\210\325\17\211\343\336F\321D"
#"\274\355IxG\312\322\261\242N\1\264"
#"P\356\357s4\332\247\227\202\253K:\375\1\241.H\262>\356\a\371\1O\220"
#"\361\344\353N/\343\225W\256\260u\366\"\247N\237eZx\352\2201+\340/"
#"\237\276Lp\tg\317=\314\277\367\221\217\2606\334\342po\302lZ\342\275b"
#":\235\222*\217\27\307\305bFY\347\224\325\224\233;\327x\362\231W\371"
#"\326_>\307\373\336\3670\233\303\224\315\301:JW\370z\2062\261@\260"
) 500
(
#"\227e\301\245\205\361ee\r\270\232\336"
#"\254\264\34WW\233\314\2154\351\220We,\e#\1\243!\261\226\27/?\315"
#"\273>\366SDI8\377\220;G\277EK\302;\332\214\1'*\207\5vw"
#"\256S\25#z\3\215\265\261\245\265\a\2646(\336\330 #'\366\235<\6`"
#"2\253\270x\351\21:\335!\327n\356b\3225\256^\275F\0352\36~\344'"
#"X?u\201\361\250\342\265\e\23\306/"
#"\354p\2707b0\30\322\353\16\330\333"
#"\333\243\223\4\202\202\331l\206\v5\203"
#"\341\200\363\17~\230\341\326\203\24\371!"
#"/]y\226\255\215\204\362\354\200\263\247"
#"2z\251\206Z\250\213\22W\327h\25\3\254\347*\351\374\374b\226\206ZHC"
#"\221\206\210\376\370\250Y\233\"e\21\363"
#"\37U4\320\230 \274t\345\5\250\nHzw\214\251,F>\264KCZ\22"
#"6w\373\260(_\241\216\251O\1\250"
#"\270y\375\32Z\5\202\257\351\256u\b"
#"\336\307\354\0\321M\37\3717pA\374\0\3\215R\212\265\341i$\30F\223\300"
#"px\221\317}\3411>\372\343?\3"
#"f\300\254P\334\272\274\313\341\321\f\304\222e\31io\235\316\332:\aGG<"
#"s\371y\214u\274\363\235\357fxz\213iQ\222\aE][\202\331De]"
#"\36y\357\200\355\353/\361\334K;L\317\17x\350\201!\251Jq\336\"$'"
#"V\302sC\223o\36\347a\342w\vm\223\305~\245L\f \327\261sG\300"
#"\263\275{\213\203[\327\330|p\363\270"
#"J\252V\277\215\23\v\201\267'Z\205|e\22.:\337.v\5\230M\271\275"
#"}\235,Q\210x\272iB\b\2561h\334\251\212\316q7\325t\365q\16\253"
#"\327\330\335\235Q\24\206\307\237x"
#"\201\277\373\367\177\221\274\354\260\267/\274\360\342m\246"
#"eF\247w\226\365\255K\244\375M\n\27\330=:`"
) 500
(
#"\\LH\373\31\311 \301\16\22T\226"
#"P\370\300\341\264\344p\342\31\317,y"
#"\325%\355^\344\354\205\367\323\353?\300\265[S\256\274\274C^&tz[`"
#"\6\3159q\307\271\317\257\177y\rr\227k\b\204\0\326Z `\214\302\350X"
#"\236Q|\315K/\275\370\206\32\347<U\254E+\t\227\325\345\271\273\325|6"
#"\2331\32\0371\354jRc@-\343%O\252p?,\361V\217\231\315 /"
#"\24\243\333\373|\354\243?\315\347?\377"
#"\30\353\233\17q{\277d\260~\201\311"
#"\304a\22(|\211\321\201\254\333\243\323U\330T8\23\266\20S \2110q\5"
#"\246\333es8@\202\345`\177\314\344"
#"\350\220\311\270\340\302\231\263\234\277\224r"
#"\363\252cw\377\6\275l\212=?\300"
#"\332\1*\224\213\365\335\\\n\376\340\21"
#"[\302{Of\23fu\205\261\32\345"
#"\34\336\327t\273\35\256\274t\231\217\377"
#"\334\361\301=Q\277\270\5-\t\e\334\345\216\334L\234\272,(\313\34z:F"
#"\313\204\2001\6\251\347)Fo\34\350|r\222\335\215\214\273;G\270Z\263u"
#"\366\22/\275\370\32\e\233\27\30\215k"
#"z\375\323x\237\220uz\244\235\214\351"
#"l\304\2537^\341\366\316\353\214G{"
#"\24\345\30\241&\330\2c2\224\352r\352\324%\36z\370\307\330\3348\217I:"
#"l\236>\217\313\247\354\356\36\321M\35"
#"g\317=\310x\277\346\352\353\257R\25}>\360\276w\340\252\275\37i\244V-"
#"\246J)\274\367X\233 \"h\323\304"
#"\275\212\247\327\35\260\275\275\335\370\25y"
#"\203\273\\+\t\241%!\251t\210\246"
#"\275(\3\234\216\353@_\35\222Y\307"
#"\213\227\237\340\302F\0377\333\305&\35\214$\324\256@\214\"I3\260\6A#"
#"\312\242%\0051h\321(QhU!\336\241\b$\335"
#"\16\263\274\246\267\266\205\3671\372e<\312\371\372\313\3"
) 500
(
#"~\346g\377}\276\373\355\357PLS"
#"\316n\256\321\355V\2500f\320\363\334"
#"\276\265\315\263\227_\340\332\265kdY"
#"\306\351\323\233<pj\23\235\234\301\30"
#"C\230\306\236\325\263\262`\377\332u."
#"_~\211\376\372\220w\274\373]<\364"
#"\360#$\303\224k7\367\311\206[\354"
#"\36\224$\275\17\322\355\177\220o]\276"
#"L\271\361c|\354\241>{\267_\241"
#"\337\315\361\325\1F\227\204\0342\275\316"
#"x\252\321I\37\247<\301\344H(Q"
#"\316\221x\215\362\t\332\247\34\232\21\225\317Pv\200xC\"\201A2eZ\215"
#"\360nDu\373;\244k\217@v\t\202\215<l\252\346{\\;\1iIx"
#"Wh\210\341^@\236\347\210x\254\265"
#"\321!OL\333\301\330\273H\273\260\22"
#"\345\262\224\26Z[\202\amS\20\215"
#"\326\226\262\20\252\322\363\223?\371\223<"
#"\375\364\323Xm\330\336\336\346\e_\376"
#"*\377\305\177\376\t\252\"\347\362\363/"
#"\360\304c\2173\\_\343\341\207\37f8\34b\355\262\260\23F\323I:\210\b"
#"]\337\247\333\3531\231\345\214\247S\236"
#"}\366Y\236|\352{\374\374\177\370w"
#"x\317{\336\303\227\277\364U\256\337\274"
#"\301\207?\374a\36y\344\21\16\317\236"
#"\345\351\247\237\346\214\236q\376\354i&"
#"G\257b\4\2242\30C\23a\332\250"
#"\333+\27\371\375\254\231w\254+\225\347"
#"\340p\217s\247\336\303\311vM\322\374"
#"k\321\2220N\16\315\242\24\240R\202B\221X\r\3361\32\35bD\310\254A"
#"7\307i\255Q\306 Z5\225\312\3564\314@3\221\215F+p^\221\246]"
#"D4Z'\224ENQ\n\207\356\220"
#"\311\321\210K\27\37\340\374\371\363\f\232"
#"\34\305'\236x\202k\257\276\306\205\v"
#"\27\30\256\257\321\315:TEI\201\247\333\355\222\246)!\204"
#"X\310)\304\232\244\335n\227N\257O\247\327C\37\354s8\32"
) 500
(
#"\363\351?\376\23\376\356\337\377{\274\357"
#"}\357\243\333\357q\346\314\31\16\16\16"
#"\330\332\332\342`\377\210\253\257\337\342\301"
#"K\37\245v`M\202\4\301\30\vA\243U\314\3327J!\250;V\213\201f"
#"}\ec\354\242\306y\302\220s\355\332"
#"5\316\275\327B\35\26\246\320\230'\322"
#"\22p\216\326:\32\200E\241\244@\220e$G=\0353\233LP\"\244i\32"
#"cF\233D\326\271d\204\23\22`\356\363V1/Qk\3\306\22\202\"\261="
#"DR|H)J\250J!\237N9s\346\f\3169.\234=\307\307?\376q"
#"\276\362\225\257\360\312\225+lnn\262"
#"\261\261A'\315\26\325\321\262$\245\337"
#"\355\221$\311b}jL\314\206p\316Q\227\25F)\206\303a$\360p\310g"
#"?\373YF\a\207|\350\3\37$MS\272\335.k\275>\37\370\300\a\230\345"
#"\302\316\356\21\251]\303\330.>\30\264"
#"\262\30\235\240\224\271\353\4\271kP\202"
#",\203\277\347\331\374\32\305\325\253\257\305"
#"\361\249&Q\3438\267\323\17\332Q \204(\311\346\22n\351@\26\216\16\366"
#"qU\205\210\307h\265\210\24\231\307\212"
#"\302\222\200z^\235f>9\347\356\vb\343ME\202\322)\22,\2653\270\312"
#"\22$c0\30 >PW\25\235N\207\357|\353\t\236\372\356\223lnnr"
#"\346\324i\352*\26\372\355f\35\206\2035\222$\241,cM\322,I\27\344\214"
#"\22)Z+\253\252\302U5\276\256y"
#"\344\241\207\311\2473\276\376\365\257\23B"
#"\240\314\v\326\327\327\311\363\234\315\315M"
#"\326\327/\360\362\313\267\310\272\eX\323"
#"\307;\20\321\221\200+\261\260\361\332\346"
#"\377\305+^^\377J\222\362\374ySZc{{;\206\301\255*\t\0225\n"
#"\323\272\352\201\226\204q}%q\262Y\245\233\211\21"
#"\0\317\301\336\16V\23\23iE\26a\\\363\2\273\261"
) 500
(
#"I\305<_\357N?!\272\351\23\341"
#"5\312\244x\247\361\222R\344\201@\206"
#"\265C\212Y\216\265\226\265\2655\366v"
#"vy\374\361\307\271t\351\22\335\254C"
#"Q\24\254\255\255\2216\326\307\20\2\256\256\231M\247\344y\36_;GUU\370"
#"\252F)E7\3530\350\365\351f\31"
#"\2512\34\355\355\363\316G\336\201\204\300"
#"\343\217~\223\255\255-f\263\31\303\341"
#"\220\272\2569{\356\35\34\36\325x\237 d(\335\1\261\304{\2239~=s"
#"h\25s\26U<\346$\1\215\212\316|\245a:\31!\243\321\235\225-\244Q"
#"c[\264$\234\367dXJ6\0\1\3579<\330'Km\223]_7\3354"
#"9\326\25)\376\315\eO&\27\300\205\200\321\31\316\eB\260\314rA\353\36Y"
#"g\35k-\347\316\236\305\240\370\3467\277I]U\2349u\32\245\24\235,\343"
#"\350\340\220\361\341\21\345,\307\240X\353"
#"\365\31\f\6\30\255)\362\234~\277O"
#"\247\323\211%7\204X\235\315\ap\261"
#"\332\332\240\333csmHj\23\276\366\325\2572><b}m\310\2313g\260"
#"\3262\3348\307\372\3729v\17f\370`Hl\2541ZW\36\253t\323}7"
#"\240%\334q\255J\231E\222\360j$M\224\312\1\215P\327%\207\207\aq`"
#"\3538\264\212\245\4m\321\2220b\241f\205eN\275\253\311\247\23Rk\320J"
#"\20\357\216\225\233\367\302\242\274\305b\20"
#"\225,&\241(@T\354\25\357A\31K\355A\304PV\202\322\31\211\355\221%"
#")uQR\346\5{\267w\270p\356<{\273\273\f\272=\362\351\214n\232\221"
#"e\31Z)f\323)\373\373\373\314\306\23\360\201\314&L&\23\252\252Z\234W"
#"]\327\324EI\250\35J`2\36SLg\2349u\232G\36z"
#"\230o|\343\elllp\343\306\r\326\326\3260v\310\351\263\17r"
) 500
(
#"p8\303y\215I\272\2106\324\265;\346\23\0040\213\230>\215,\24\360e\336"
#"\274\322\363\206k!\206\265\251XVq"
#"6\35\3\201\340Z\277\340\335\360\266'a\232e8\347\26\257\5A\\\tY\302"
#"\336\3166\342\35\211\321dYF\226\30"
#"\214\322\215\321\"N7\333\254\235V\363"
#"\t\347Nh\245A\31M\322\311\360A\310:=*'\261;\223\323\224\225\242\337"
#"\355\262\261\261\301\223O>\t\"TU\305`0`6\235\242\265\216\22n\305\0"
#"\222\30\213\325\6i\216\5\26j\251\253j$\304\242Ni\222\320K2\0224\275"
#"n\227\252,\351e\35^\276r\205ic\f\252\353\32\233\r8u\366\"E)"
#"x1\344y\2111\206\341`@]\227h%\221|\352$\201\242\341)\226\335\217"
#"\347\240B\274\t\31\35\313D\32\23U\323\227^\272\f\256Bwc2qQ\b"
#"\251^m\372\370\366F\353\242P\307\327"
#">\210\217w\361\252\214Y\350\22\320\4\314\\}ZI\365YL\313\246;\355\274"
#"6R4LD*\366\373=&\263\222\252*Hq8oH;=\372\375S\370"
#"\3322%P\227\25\273\333\267\321Z\223\232Xn^\20\320\201\252(cK\317\205"
#"E26z\231\337\4\346*\261\314\213\4{\240\351O\21 \226\341(J\264\227"
#"\205a\351\306\215\e<\364\310\303\210\22\234(z\375u\6k\233\330D\23jC"
#"UUhgH\23C-1\337P\257$6\205\246\16\217\320\24\220j\306q\211"
#"XW\306(\301\30E^La^I\\\321\214\245\216F\253\26-\tW\261\22"
#"\220E=\233\240\202\307h\211Nkh|\202M\273/E\254R:'\340\312Z"
#"i\321TT\5\216\216\216\b\332\322[[\307\246\35\16\3069\336[\224I\250K"
#"G\226e\340\35\333\267n\321\315:h\245"
#"\250\212x\3\220\312!i\n\310\322\5\240\217"
) 500
(
#"\307\253\372\306wI\20T\220\230\217\333"
#"\30q\4E\355\35\305\270\242\16\202\230"
#"H\312k\257]\345C\37\3710\323\274\304b\350X(|\315\356\301\224\3154\22"
#"G|\210\356\225\320\324\277\231\227g\233"
#"\257\377\324\274F\352\\\35UM[\356eQ(\20\214U\214\17\17\243Z\20\333"
#"p`\f\255\243~\5-\t\341D\312Q\234p\223\243\303\330$E\307\302\271\363"
#"h\230\345\324Y-eaP\242Qz~\267\237\aK\n\30\205V \22\230N"
#"\247L\2479\235\336ZT9\363C\\Qb\255f\177\177\237\a\317_\244\256k"
#"\244v$\n\252F\242\314\373\313\317\375"
#"p\253iR\301\250\5\t\361\1\325\224"
#"\237P!\346\0\326\336Q\269\244\31"
#"\342\2I\222\260\263\263C\267\333eg\357\2004\355q\356\354)N\235>\215T"
#"S\224\325(\221X>\337+\264\321\213\212\337\313<\311\245$;\351#UJ\241"
#"\27%C\2V+\216F\a\321MQ{0\6m\210ui\332\331\a\264k\302"
#"&\312#>\17\22\215\31h\305\321\341"
#"\376\242\16\214R\22\315\357'|\201\321C\241Wr\20\325J~a\\\37eY"
#"\202\266\232\312\225T.\266P\323\211\345"
#"\325\253\257\360\231?\377s\366\366\366\250"
#"\312\222b\226Gg{Q\242Q\315\0324!\270\246\313\222\367q\233\267?[y"
#"=\337\244y\234[H\305\a\214\322$"
#"\306\222\30\263\360\315M\247SB\b\334"
#"\272u\213/|\361\213\334\274}\213\356"
#"\240\37\317\325@\345*\264\201N']"
#"\\\307\222l*J\177\321\210\322\213\312"
#"\336\307-\304\261\334b\334`2\231@Y\336\341\260o\247_D{/ZA\b"
#"a\241N\35\35\35\305\365!suLA3\331N\226\253\230\373\312V>\t\210"
#"jiY\345\230\244K\222\30\320\226$\321TU\301"
#"\301\301\204\203\303\275H\32bN^\360\236Z<\306"
) 500
(
#"*\\U\243dN\376\25\0254\310J\tC\205o\312\315\353\246Ev\24Z\363"
#"N\27412E)\205w>\272.\232\357\232[R\213\252d4\0313\313'P"
#"\316X\357\200\266\212\324j$DW\a+\266\320\371\r(h\205\n\372\270$\324"
#"\2154\236G\3204\321GUUPNGd\203S\361\300\271j\335\252\244@K"
#"B`)\tE\2421\4`6\231.\3\245i\252\316\237$ +\275#D\241"
#"\364\322_\26\324\274aJ\214\36\251\352"
#"\202\302)*gQ\246\317\273\336\373."
#"\316\\x\210z\352\321Z\323\351t\"\211P\321\371^\26X\255Im\302B\313"
#"]H\330\271\243\\-\375\234^\220\25"
#"\22\316\325Q\27b\t\305\302W\210\325"
#"8\27\e\331\210\b\303\341\220\237\377\371"
#"\237\343\354i\315\213;\36\35\2Y\226\341*\301\273\232rZc\322tY\34m"
#"\305E1\267\216.\242eD\0353\30-\212X\204(\221\247\343\t\331\306r\272"
#"im\201\352\257\374\233\375MBK\302"
#"\25\254\222\256\252\vT\360\v\362\315\241"
#"\205\330\373\375\207\370\274H\232\330\260\323"
#"c\351\365:\2403\16\217*F\243\21"
#"\265\263\244i\207\272\256\27\226\313\304&"
#"\210\17\270\332\221d1f4\34\353\377"
#"\260\2626S\321\16)\"\350\350\270\214"
#"\315\233\232\365!(\2224\1\t\204\272"
#"\6\364\302\255Q\226%\335n,\261\270"
#"\267\27\245\362\272\255@%8W\321\321)\375~\237\242\216e\22Uc\34\372a"
#"\261\260\3366\201\rEQ\254&\227\334qC{;\343mO\302\2!\241\2\361"
#"XzMb\371>\243\331\213$\e\a\324*\305w\6\324\235\200G\241e\203$"
#"la\245B\302\16>\0314.\t\207\30\r\312\240\225Ac $t\262\1E"
#"\255YK\327\250\312\224\351\301\4_kT:\201\0"
#"\a\371\6\27\316\235\347\364\231\a\20\347\231\3463l"
) 500
(
#"\b\f\272k\344\2231\203~\37\202\340\232N\274\314c:\255A+\215#GB"
#"\300\a\37\211\27\4\2535\332X\224\202i9c\363\314\31n_\e\243\24T%"
#"|\370\203?\301\336\315#\304)\6\376"
#"6\233\e\35\256N\205\323\27/q\260\273G/]'\210\217\rF}\202\362}"
#"LP\204\246\321KP%>\331F\22G\277\204\322%\210>\205WkL]M"
#"\245R|\326\305\251\tF\tR\346\214'7\200\t\350\301\"w\263\16\t\235v"
#"Y\330\256\214\347\361\213Q\272,\367/"
#"B\323\344n\367\353\270\326\221\273:\260"
#"O\34\31\242\344\212\201\342\201\324&("
#"\204\242\230Q\327\25UU\262\263\267\303"
#"O\375\355\217\363\362\313/\221\347S\322"
#"N\302d:bmc\r\21\337\264\272"
#"\216\233\3675u\250q\256\242\366\25\316"
#"\305\315\373\32\357kB\323\2317H\214\3609uf\213\227_~\231\301p-\26"
#"VJ\r\227.]b\357p\177\241\336\356\357\337F\32\377h\226e\0\370\260\214"
#"\20B\205\246\247\305\235\243\27\216]r"
#"\\?*\2z\336\330\264\201s.\352"
#"\375\253\271\211\337'\334\357\355\204\267="
#"\t\347\253\eX\361Tx\217\v+\331s\341NU, \315\4\\\351\261 \363"
#"Ok,\210\304\254\6\245hz\325\v\235n\254GV\314F\224\305\4\235\300\316"
#"\3766\37\372\350\a\310z\26e\3.\324\230Ts8:$,\3769D\t\202"
#"\303\207\n\347K\352\272\240\256+j_"
#"G\3224\345\223\374\312\277W^{\231"
#"\a\36\272\304hr\3044\237\360\261\237"
#"\370(\242\34>\324\344\345\24\t3\266\267_'I\2F\a\3224f\2228\347"
#"\232\262\207\363\215e\236\326b=\30\215O^-\213dECV\214\260\321+c"
#"6W\203\217\215{KB\240%\341J\337\t\265\340"
#"\17\336\341}S\205\272)\203\250\5\224xD\342\32"
) 500
(
#"\315\353\330V\32\321MG\245\223d\214"
#"\237\36%\241\20B\364\265e\35\203\325"
#"\236\242\234R\225c\212zJ\177\330\341"
#"\306\316\r>\361_~\202\333\373\273TR\341px\345q\252&(\207hA\264"
#"G\264\a\355\t\324Q5\24\207\20\245\2304.\1\26\255&\376_\366\336,\346"
#"\226\354\272\357\373\255\275wU\235\341\233"
#"\356wo\367\355nv\263IJ\24\335\242IDT\350I\203-K\216m\311\266"
#"d\311\220\r$F`\311\216\202\300\t\2\5\310\203\200 O~\310C\20#0"
#"\340\4\1\364b\3~\210`\30\16\2\344%\261\2\333\262!\221Pd\211\315\346"
#" \262\233=\335\371\e\317PU{\357"
#"\225\207\265\253\316\371\356\275-J\274M"
#"Y\352{\26P\337\31\2763\3249\247"
#"\376\265\326^\353\277\376K\231\314'\274"
#"}\373mf\373sN\316O\370\354\237"
#"\370\f\367N\356\321\305\25\353~\315r"
#"\371\200\363\323\333\354\3575 \375X\343"
#"SM\2331\335\243<\323\306\2639u\240\2018\300\256\360D!#\332\3434\27"
#"\306QB\263\260Z\267\266cy\273\322\272[\25\302\16\204c~s\373\234\234b"
#"$\3068\36D\242\t\227\323\2267\34\246'a\323uU@\267\31$VC3"
#"3:\231\35\252\221\340\241i\240r=}w\301bu\301r}I\322\310\365g"
#"\216\371\344\247\377\bo\274\365\6g\313sf\3733:MDI\26\372:E<"
#"F \360\212z\vu]\231\274\344\\@\235\275SB\3514\341\252\32u\302\257"
#"}\376s\374\235\237\373;\274\361\326\233"
#"\254\332%\365\264f\325]ry\361.\"+\256\35Mp\305\313\"\366>\252\211"
#"qj\223\24~\355C\23\254\2228Ri\355\22\22N#^\23.\3670\324]"
#"Um\276\6n\303\263c\263\24x\332\355\251O"
#"\314\214\2630\a\36\243\30\313d\360\204.\203/\236"
) 500
(
#"\20\315\306\240\224L&\21%C\336@X\262\2003\0\2164n'\346\251\234\240"
#"\222ptL'\236\331\324\263^_\322\346\25m\273bo>\347\355[\267\371\263"
#"\177\356G\270\177\377>\257\177\365k\204"
#"\20h\\\260)\273\316\21\206\22\210l"
#"2\271\212+\n\35\256\210\4\230\2Z"
#"\312\366\230\273\367\357\260\\\257\370\331\237"
#"\373\317\350bO\323\324\314\346S\36\234"
#"\236ppt\310\372\301\3f3\2304\320\256{D{k\335\22\301\206\224JY"
#"\373:\3\242R\274}\306\251'J.\245\211\214\313\t\257\35d\e\221Vi$"
#"\252\205\256\353u\307\350\242\31\2\332]"
#"w=\354\276\201\307\326\213c4\20\212"
#"\32\0C\316\204\224\360)\343r\266\336"
#"\244A\271[]\341\225\26\178\236\335"
#"7\235\347C\322\303\21\321\3343\233\4"
#"\366\367\32D;\326\355\212\272\t\274\376"
#"\372\327888\340\374\342\202\37\373\313"
#"?\316s/\276\310\252M\234-\326\\,;V\353\216U\227hc\242\217JL"
#"\320\307D\354\205\24\35}\204\256\27\326mb\261N\\.[\316.[B5\341"
#"\257\374\304O\361\374\363/\220\263RU"
#"\326\376\4pzr\37\307\202\303}\17"
#"\272\302;\343\215\16\373\254CG\210D"
#"\262\213l\253\206\16\2377!d\25c\316h\"h\"hO\310\35.+^\215"
#"B\327\256{l\305\270\375\205\357Z\233"
#"`\a\302\2\302M\222\1\261\265\224j\306+xU\252\4U\202:Q\356\e<"
#"h9\210t\373k\264\220+\227\327\e"
#"\352\177\316Y\30\251\251\245\256`>\361"
#"\4\351\320\276\343\344\376}\216\217\257q"
#"\367\356mV\253\226\256\213\374\314\337\376"
#"9n\334\274\311\345\272c\321\366,\333"
#"\314:f\272(\264\321\204\243b\362\364"
#"\311\321'G\27\305@\330;\326\255\262Zg\26\253\236\377"
#"\374\277\370\257\370\316\217\177\202[\267\357\2F!;?="
) 500
(
#"AS\313\273o\275I\23z\246\r\364\335\302\0223\301fS\24\"O\231\26\\"
#"\326\211\3\1\241\374\25\r\214\201\274Z(Z\245\226:wT\271\243J=^-"
#"\251e\314\36\207\346\355pt\267&\204]8:zB\35\206\236\0u]\343\235"
#"\303k&.\326h\355\351\327-_\374\352k\34?\377\n\327_\236\221|G\226"
#"\216M?\300\346\340\312B\221zp\340\234\325\312Hxq\204\312\321u+\352\0"
#"\337\371\261\17s\353\325\310\305jA\217"
#"rr\377\36\353U\317\215\343\233,\227"
#"+~\352'\377:o\274\361&\377\357"
#"\277\370e\276\366\265\257q|t\215\203"
#"\303\232\334Y\222\247\256k\326+c\334"
#"4\315\2046\365\334z\367>!\4\376"
#"\302\217\376E~\372\247\377\32\377\317\277"
#"\370\277\t\301q\347\366m./\317\370"
#"\360\313/\2\221\273\357\334\341\231\243\3"
#"\236\177\376\32^\3009\353\e\\\257\327"
#"\250\nU\325\240\311\326\201\26\371*Y"
#"\0257\266p\271B?\363\314\252\32\326\31\351ZNn\275K\267z\3003\37\272"
#"F\225\225\324\n\363\331\265\322.\346p"
#"\241\2243SK\250\24\241\372}\372\241"
#"\377\340\332\16\204[\226K\202T\245H"
#"6\304L\243J\35\225\334-p\353\226\376\354\34\326\35n\222hB\200hT3"
#"U\353\232\37\314:\3537gzQlm\250\340%\341\311\4Q\236\273\276\217\304"
#"5}\354\230\4av\270\307\301\301\36m\e\271}\357.\363\203}\376\312O\376"
#"\24\313\213\5\277\371\233\277\311\253_\370"
#"-\332\266e6i\320E\313tr\300"
#"\305\305\202\366\3019/\275\364\22?\363"
#"\267\177\234\317|\3463<x\360\200\177"
#"\366\317\3769\316+\a\a3\216\16\367\360\256G\343\2\264\347`*<w}\237"
#"@\217 x-]\21j!\346@\320\0362\245\31\212"
#"\347/`RA\325\223\273\25Y{Xu\366\275,/"
) 500
(
#"q\335\22Y5\326\n\25\v\23\250\252"
#"\306\312\215\367 \352Q\332]j\206\35\b\307\216#J\302#+c\227<1Q"
#"%\207\213\35\253\223s\302\262\247\225S"
#"\322bA\330\v4\276\302E\353\333\263"
#"5\222\35\260R\276\326\355\251C\252\311"
#"\322\372bz-\301e\262\203\233\327g\304U\315\305bM\333d|\345\231T\20"
#"\273\314\272\275$\370\t\235K\314\17\366"
#"\371\301\37\3723\374\251\37\370~\\!__\\\\pq\276\346\345\227_\346\205"
#"\27^ \245\304\351\351)_x\365U"
#"\326\355\222\311\254&\366+T[\246\215\345U$^\22B\346\370h\217g\16\205"
#" \331\24\303E\320l\223zI\336\276"
#"\24\315\26\232\27){\35\342\365q\366"
#"\274C\373L\37#,V\310\305\5\371\362\f\237\26\270eE5\235A'd\337"
#"3\233\316\315s\226\334\2148\223\313\337"
#"\241p\a\302-\333\34\r\336{\202\363\244u\213t\25\22\225|vA\2232\313"
#"\363%\361rA\2706\305E\233\25o5F_6%\223\21\206\f\251\216\0361"
#"\347h-E\"x\347\250\235p8\355\211\327<\323*\220Z\307b\265`\275v"
#"8\251i\246S\234\363\234\236\236\261\356"
#"\327\34\37\36\215\262\26M\323\360\374K"
#"\317\363r5\345\344\344\204\327\276\372*"
#"M\323\20B\240\313+\326q\201\270\226"
#"\375}O\337\235\222\372s\274[P\373\310\265\203\206k\207J%\247\324NPu"
#"\326\257\253\1\35$B\263\2\221A\252\27\6i\310R\353+=\214.\201\3532"
#"i\325\221/.\t\353\226\340z|\333\"\223\t!gb\352\231\317\367\355[."
#"\305}\a\357\301\302y\372l\aB`\30Vb\224g\360\316Q9On{\244"
#"UX;|\e\331s\25}\237\351\317\0274+G\\vT\315pp"
#"\226\343\22_x\312yL\330\250PX7v\340\372r\237\363\216\251\\"
) 500
(
#"\362\314\221c6\361\344\24\270u\367\222e{\37us4{\332\324rp\274G"
#"S\317Xw\v\326\253\216\371l\6!r\373\301;\344\36\256]\273\306\265\331>"
#"\247\247\247\\\256\326L\247\r\auE"
#"\273\\\222X\320\255\357!\272\342`\246"
#"\354\317\35\327\217<{\223\216\330\237\23"
#"\246\36\315B\312\236\250BN\2409\224\23G@\2655o8|;W\250z\216"
#"\220\34\322g\\J\304\365\232\211&\32"
#"\21\252\276\303\213c\36j\356,{\366\347\a\343W\rvr\332%f\314v "
#"\4\310\231\3546\3539\347=\301\v\332"
#"G\274\6\244\357\251\222\205m\313,\364"
#"\27\27H7%\255Z\252\272\267\330J"
#",S\250\244\222\340q\e\375\227\202\320"
#"\355\21d\301y\262\207\271\277d\342\241\25229Mp^\271w\332r\271jY"
#"\256\356\343\252}\264WT\"\210c\357"
#"\260f:\t\334\271s\207\327^{\215"
#"\312\327|\374\343\37\347\346\315\233\204\211"
#"\322kD\274\220\322\232\266?%\266\247\4Yq\264/\\?l8\234)\363i"
#"\244v-QVT\316\221\325\223K;\22\331YX\212G\235\251\252\301P\234H"
#"\343L\306\341sI\312H\312\204\250\344"
#"\256\247Q\230yAcG\245\312\336t\212\236'f\263\31d\310~<\347\341v"
#"\311y`\aB`\273\360]\3768\207\27G\337G\246U\215OK\32\34m\212"
#"T\252\264\27\v\353\327\353\207\354\350v"
#"\343\257\255\4\207\256\374\315{\b\232\a"
#"9\fg\275y\316!n\201\210\243\366\312\265\303\n_\315\tu\315\311e\264a"
#"\237\353\v.\226\27\204jB\335\314\321"
#"\245\262\\\325\354\35L\232j\16p\0\0 \0IDAT\371c\177\3423\264"
#"\253\216\20\2\227\313S\262D|\210,W\27\254W\27t\253S\216\366"
#"<\a\263\206\343}\317\341T\231\325\221\232\25^:\352&\341e\37T\360"
) 500
(
#"8\372l^Q\a\211\372\355\322\313\226\a4J\233\35:\332e\3502\32\23\322"
#"Ej\201\32Xu\35>%\16\16\366\320\264\30\211\341`\331Q\357,l\337I"
#"=\355@\b\\\355#,\245hc\246\344LS\325xY!\342hS\306e\245"
#"[\267x\315\205\69\244_\276yh\265!\212[\202\303#\244\270\300\271\nQ"
#"\241\256={\256\241\223\2120\363T\263"
#"\304\r7\345\301\331\232\313UG\327\256"
#"\350R\244\327\206u\\\323\266->\333"
#"\0326\306\310ry\211\222\331\337\233pt0az\343&\363&\2637IL\335"
#"\232J\326x\211\240k\320\226P9$I)\312\273\r\341\272$\2206d\332\341"
#";z4\213\22\273\236\320G$f4G\234\263\357HS&\307\304\244np\272"
#"\260\361\342\303s\"P\357\306\242\r\366"
#"\324\177\17\261\202\304t\204P\240\207\4"
#"\363\305\r\366\373\353\34,\317\311\253\257"
#"\220\273\a\b\302Z<}\363,\247\367.\230\207\17[F\323\vU\35p\323@"
#"%\25\342*Dm\234\266v\31\361\16\37\34^\202\315@\314\31MV\227\f\365"
#"\207M\373\245\316H\206\251\317<\277\a:W\364(\360\316;ops_\211\323"
#"H\337\333\234\211\276K\304\30\311!\343"
#"r\217\363\202o<\325QE]\a\252\260 \4\207s\302\265\303}\206\325\256R"
#"\227\2\373\34%[_{\327[\257\"\31\232\214\v\t-Z\242\250\325\361\2346"
#"\306\24\322LN=1&\372\366\214\224\0227\374%g\375\202\263\365%\325dJ"
#"\237\24\327\365\274T{\302\351\31G/t\374\366\334q\270'\\H\246\27G\250"
#"A\272\212\306\313nh=;\20\2\214R\207\nx'\260\216\34\36\354\21\233\t"
#")/F\356\346\220\314\323l\a\243h!9?t$YR\306"
#"\2225&\227\261!s?LR\272\332\2578t\315g[W:\265"
) 500
(
#"\2011\252\304h\300\213\321\306\241\r\203"
#"`\264o\21\21\313\350\6\233\26\25\274"
#"\24\372\331\306\353\216\243\275\265\274gq"
#"j\351\261\375\222Wm[y\374\341}\36z.\5@\362\25I|\260\26\246\275"
#"\351\214\331d\312e\36\322VP\327\25\364\335\16\204\354@8\232`T-q\n"
#"\271\347hoN\2677'\335\273E@\300{\244p\271b\214&MHBr\260"
#"5\22\t\311\6\f\247\200\f\f\234a"
#"\235\270\rD-\341\336f\310\314\306\206"
#"\316\b\253\331\35\34\356\241E\3060g5rvQYS\25r\267\36\345.\234"
#"\243(`\273\242E\3\344\310\30Rn"
#"\275\313\343\232\225\37\327\304\254\203BZ"
#"\311\354n7;\213\252eS\313m\207\351\351\210\312(\250\274\\.9:\274\16"
#"\265\243\t\260f\273ke\227\230\201\35\bG\23\240r\2456V9\264oi\202"
#"'\366-\23\21D\2\"\246\5\223cO\337\266\220\"\252\301\272'\n\0005G"
#"\v\345\262C\305#\f\263*r\241\263a^\262\274\357&)Tz\1\263\371e"
#"\21;\356\253\252\202\242#\243\17\35\364"
#"\226\235\2342\264KQ\336\307\24\200\355Ucg 7U7)x\262\23\304v"
#"\247\262^I\"i)\271\330\332\316d"
#"\35\215\266F\326\261\334\222U\255\3719"
#"\31\1\301\211\345R\375\226&\316z\271"
#"\342\350\331\31\\\236R\35\333\200\354\361"
#"\255\302\216\262\6\273S\21\0\2617\221\335@\262\20I{.N\357\343rO\352"
#";;\250\200a\206\241\252\322\267+R"
#"\327\215\245\207\1\200\203W$\e_t\343\371ts\320\17=zc\363\354\360\270"
#"R\355(\233\r\212\312W6\347\301\346\216\n>\bMSQ\327\265\255\5+\e"
#"\30j31\354\255\206\371\30\2339\31f\6\350\253\236\355w\362\216\252"
#"\246\340f\36XG\200\246Aj\21\b\230\27\36\336Kq\304\276e^"
) 500
(
#"\5\36\274\365\6h\213\317\6\324\34\263"
#"}\310\235\355@\b\203\227(\3\241\323"
#"\32\226\347\364\227\247\244va\315\274E"
#"#F\3252\221^\204\334\265\244ni!h\216P\0(:\310\rZxZ\4"
#"\20\331\264\355\350\270\251<\f\200\0024W\250s^PL\255m\0k\316\359"
#"w\244\324\216\335\372\243\316)\251\324)\213\0300i3\250fL}\272o\n\272"
#"\341\362\312\343J(J\tC5Y\213\322\20\32KNx\354D\346\304H\242\26"
#"5tH\352\270\363\346W \257\250u"
#"M5\276\317\356\360\203\335\267\0\300\244"
#"\t\20{\310=H\342\344\267\376?*:r\273D\324:\354c4\1\245\332\a"
#"\274\b\2517m\320\301C\f\35\344\243g\273\2,F)\375\207\355a0l\17"
#"~q\256\200>\30 \a\179xU%\216\362\26\203\300\223j\361T\224\365\251"
#"\333x\303\207=\341\b8yt\237(o3\202\256\0QJ8\352J\270\32K"
#"\363\260\211;E\202\260\365^6\302;"
#"\267\v.\357\274\3\267\337\4\351\21\215"
#"T\225\337\361e\212\355@H\311\216\346\b\335\32\350\371\306W^e/\b.\256"
#"-\24\315\233\231\366\256\264&I\212\20"
#"\273\222\306\a)\a\3468\245\210\307'?\362{\34\360\217\354S9\220-\343Y"
#"\306\214y)\240b\224\2477\257\227J"
#"\201\275\200e\230W\1\217\\>l\303"
#"\324\341\367\332\217a\37e\340\213\226\317"
#":\210_\rkG\247\231\200\342T\213"
#"vLa\332\304\36\355\26\350\352\204x\357MH+H\326=\261\352\337\363-\237"
#"*{\352A\230\225\262\36\314\226\246\322"
#"\236\323\333oRkO^\257\220\324\21\373\216\351tJ\25\32V\253\225\t?\345"
#"L\2738\247[\267L\233\t\"B\337v\264\253\216\365b\r)\23\234"
#"\265\375l\16\360\262Vr\362\320<\303\262F+s&\206\354k\327u"
) 500
(
#"\264mk\265\301R\226\30\326dP\2005j\300X\370i\20397\36yP\t"
#"\30J\32\366<\217s\1\347\334\370\272"
#")%\372\362\330A5;\347\214\3676\376l\270=,m5g\372\256\3\361t"
#"mk\rN\32\311\261\243r\336J%!\320\204@\177q\316s\207\23^\375\334"
#"\257@^A\352\207\257cg\354\262\243[\22\363@\273\202w\177\233Z#\322w"
#"\370\334\22$\227|JQ\272\306\31EM{H\21;\356K\302\335\225\254\347\320"
#"\346\243b\212\330e\306\273\271\r\31\262\375V\302\220oV(\373\335H@l+"
#"\242mB``\\\e\16 \277\272\326\2231\321\344\234\24\255P3-\241hN"
#"\231\\\324\262]\361\362YL\316\302)"
#"\244\261\317\336\346x\4\324\246P\t8<u\25\210\375\212\231t<\270\274g "
#"\224\231\355\333\256\215\t\330\235\213\200\22"
#">: \267\274\361\205\177\307A#\244"
#"\325\5\22;|\36\24\3276\336\307\251"
#"\211\32\21;r\324R\222\30\250_\256\244\364m\eZ\203r\266ld\316\306#"
#"\265\351\266\300\250\326\366\230\215a\307~"
#"\247\237\351q \335dS\37\6\340\366\24\247A\230x\30\265&\217\331`\3>"
#"\207\\\t\267\35B\322l\234X2AL\273\3249\207+Cr\246u\5\375\222"
#"\211v\260:\205\333o\r\35\316;\205"
#"\231b;\20n\233(\257\177\345\213\334"
#"8\230\21\227\347\270\334\26\35\316\301\212"
#"x\23\220S$\365-\271\317\344\250\245"
#"\345NL\376\36\331\364\345\2510\220\267\2555H\256lC0\274\331\2665L\37"
#"\a\306\207\177\262\374\230m\353\277\303\330"
#"\264\307z\302a\242\357{\203\324=\304"
#"\27\225\342\5\245\204\361C\335\322\27\241"
#"\212J\204 C\330m\335(\201\214"
#"\256\316\231\323\262\372\332\253\f\362\211\273\n\205\331\356"
#"k\200R1\310\220{\316\357\335\341x\177J^_\232"
) 500
(
#"r\30\345\304]<\341xP\246H\356\326\244>\221\273T\3027\1\365\e\345\265"
#"\354\vM\333#RY\332\36\377;oru\273\2\306\307\1rkM\270\251?"
#"nl\333\243=.9\2234?\2<\335\272>|f_H\a\6>\301\227\327"
#"\215C\331\202\\\346\333\17\312\4a|"
#"\277\211\207\356\362\1\307\263\212o|\345"
#"5P%\366\351\221}yZ\355\251\aa\36\217\331\214\336z\327B*\"\236D"
#"p\230'\224\253\311\20\17Fd\356[bo\5kM E\215[\360\243*\267"
#"\227\200s\1\357*\274\267\315\222\"\25"
#"\316UP<\347\270\251g\243\342\375\360\306C`|\17\333\2\344\220\0z\257m"
#"Cys\217\\:w\365\360x\30\304\242\214\36TT\t\16*\357\361[e\221"
#"\324w\324A\350.\3179\336\237r\367\3557\240]Z\242\350[\376\325>X\366"
#"\324'fl\275\226pd\276\362\245/\2627\233ryrJ\355\35F\362\267\365"
#"K\334\316H\16e\213\230F\0Z\37\336\300\231,+\250\254x_\241\336!\316"
#"![\363\241e\310bF\270z.\34Z\210\264\0001\261\221\230\30.\331\0q"
#"{4\367clH\274\214\336p\3208\26\333_W\347\221\16\347\2757pxO"
#"N\340\262\322\247n\243'W\274`\36\336\226M8*N\212\302\234\1?\213 "
#"xb\354h\324\221b\v\215gyq\ng'\270g?\266\3a\261\247\36\204"
#"\0\261\353\250k\370\306\353op}6"
#"\341\374\364\36\223\20\306\314\351\343\314\326"
#"Oq\213\324<\254\357\206\a\230\367r\256pH\255\270W:\31\\))(\351"
#"\221\306Y\23\214\272\2\304+\367o\1"
#"\361\321\275z\344\36\347@\325\2155\316"
#"\234\265\\\332\343}(\242T\316\206\3278g\23z\263+ l"
#"m\220\313\225\31\215\345\366\330U2\236\240\n\211{+\261\263\251\257"
) 500
(
#"f\360\202\246\236xy\211\177~\327>1\330S\17B'P\345\4\353\a\344/"
#"\376+\276\347\323\37b}\353.'\27\247H3\343^/\370\272\302\245\26\\G"
#"\350\26\314z\270\356+\326\313\314Y{\312\21G\314\274#\251)c;_\341\235"
#"\311=\255\227+\264\nHU\343\253\32"
#"B\0q\344\362\315\17\274\221\355u\333"
#"\366:.o\342\345+\224\262q\377s\231\21\241\351J\22f\350\350\2101Zv"
#"\267\20\273\325\365VC,'\201\330\364"
#"VK\314\275I\34\212\255\357r\352\351"
#"\372D\212Bp\1\25\350r$\367\221\230z.\333%\213\213\v\256_|\205\306"
#"W\34\3449\310\36\353\272\246\v\2\323"
#"\216\20N\331\233%\252\365\5\215\356\301"
#"\2355\337\21\256\363\326\277\375\34\37\371"
#"\350\367\262\27\16\330\255\210v ,D"
#"g\201\213K\e\3375\233\261Z\255\250"
#"\353\372\n\0\36y^\351\250\37\22\31"
#"\303\272h\350h\0302\215.\310\25\3570H+>\f\262\367\2\341`\217\3\240"
#"=!\217\234N3\243\256\r\267\235\307"
#"\334\34\224\2\276\e\377\247\252t)\241"
#"\261\08%\274\232G\314\345~Mi\324\231\361\b\342=\2502\251jb\323\330"
#"J\266\364)\216\353\313\22\302\17\346\234"
#"\263Zj\327\262\267\267\307;'\367\370"
#"\by7\213\242\330\16\204\0\301\303\273"
#"o\223\372\16\246\r\253\365\222\375\371\214"
#"\325z\233W\365\350\301\"\30-\213d@\224\"\353\2003i\au\212/\205\356"
#"a=eUo)\202\301J\32\333\216\206\31\20\303+?\32\v?\276\2516\215"
#" \34\351g\222\307>\305!d\266\242}\331t\3031\225!\234N\205%\3\343"
#"\304_\262\216\331\340\201)#\0240\226\317cI\250\1\200Z6\1\247cV5"
#"\204\32\242\207\345\222\343\343\347\371\374\233oA\352\215"
#"0\277;\4w\247!_\250 _\377\332W\231Nj"
) 500
(
#"\20%\365\21W@rE\354\350\221\254"
#"d&\367\221\\\200\210\232\276\212\244\214"
#"\246D\352\343\310\261\4F\242\367\300\275"
#"\4\v\207\275\23\234l\256\17\267\275\23+\235<\264I\21\346E7\255Pc\a"
#"\5\351j\327\305\3266L\363\335\336Fp)VvPLI@\207\234\254\20\20"
#"\3k\266\317\233\332\216\276m\351\226\253"
#"Qu@\335\320C\b\262\5@W\272\376U\204\270^Q_?\342\336\335[p"
#"yb\204\371\235\355NCC\215\360\353"
#"_\3762\317\36_\203\345\222\340\214\375"
#"\277)T\277\367\271*\367\21\355\243\311"
#"\341\373\214\372R\36\350\223\245OR\271\2352\331e$G\264h:(C7\274"
#"\275\326\30\255n\335N)?\344\371\36"
#"\276\236,{9\26\343\363\26\231\333\246"
#"A!\212H\32=\225+\t\\\325\214\212\214u?-:\0Z\274\234\"\264]"
#"gT\273\230H\353\216\324\367\304\256'"
#"\256;\23y\22\223\304\267\342<#\30"
#"\275\230~+\252\210\363\210\367,\273\226"
#"\203Y\3\261eu\353-\246\327\237\335\271\1v_\201%\32c\307\235w\337\342"
#"\271\e\307\260\270\244\362\236\324\333Yz{\3443l\2\305\2015b\0L\326U"
#"1\266\372Dr\352!\366\344\324\223\242"
#"\335\316\251\267\365W,\22\25\261\37\333"
#"\220F/\246W\333\223FR6\351\221"
#"\315\326\203[\e\233\327\31<\341\320u"
#"\261\335\fl\367\31_4\227u_\32"
#"\326\206\311:\3455\331~\266\2535\335\272\245_\267\344h'\e\227\224P<d"
#"P\363vR\310\244\342\24'J\300\21\212\224\242\rd\n$,\236=\332\237q"
#"\373\353\277\rq\371\373\374c\377\301\264\235'L\21\226g\254.N9>\370N"
#"X\235!Z\326t\376\241b\365c\236\256}o\353\300l\"\270\2223D"
#"\310\336X4\251\217\210\n\331\t\16GV\261\261\327E\348\247\326^\373"
) 500
(
#"\241\304\314\366}\343{=\316#\216c"
#"\255\207\316\t\35\0233J\242\217}Y\23\246\215>M,\0W%\25\345\266\330"
#"YH-Y\221\230\311]\217\366\261\254\367`\30zc#\3416\4n\207\333J"
#"&)\"\31\21\eY\32\260\307e\5"
#"_\31\241\235\274\346\346\365C\356\274\361"
#"e>\322\377\20L\336\227_\361\17\265\355@\230;X^\"\261\243\256\34,\22"
#"\344\210\23o\232*\243m\0\271\315\235\264.\363X\222\30yl\200\25UrV"
#"H\231$\t\227<\331g\320\210f_f\274;x\17\20\16\267Mcfh\234"
#"\345\221\353\t\e\252\242%\313jR\31\e\1\251\325j9&fR\3567 \34"
#"K\31b\355L}Dc2\317\337'\264\217h\3333\251\eS\205\221D\327'"
#"\e\23>$\240R\36\247\30\233\230\261"
#"\226\204\214i\212\272\fN\0341\2034"
#"\236\214@\3548>\234\362\366\275w\241"
#"[\274\377\277\347\37B\333\201\320%\336"
#"z\355\v\304\365\2\16\367h\277\376\200"
#"\246\256P\204u\eq.\220\223\3118x\265Bw\b\16Ij\342N)\323\256"
#"V\344\375\236\34+|e\ab\352;"
#"\352\311\204\252\366\344\340\221\312\243^L"
#"Z^\212\27T\265\"\376\226=\354\375\226K\v\331\36';\1\220\325@l@"
#"\213Whd\203\314\5YG\317W\36"
#"\214\251\272\201\370\300\304{\244\301\302\320"
#"\230\310m\217\372\210\370\n\372D\\\256"
#"\361\nM\250h\333\236>\2461y\3433\270\242\253\352j!T\340\2753E\202"
#"\234\tuM\227#\223\351\214\365y\a\353K\216\217\346|\3767?\17\353\363o"
#"\327\257\372\207\312v DY\236\335gV\t\220\320\330\342PbR\202x\272m"
#"g\250\16\247\203F\367\226\347\31\206"
#"\275\224\333\262\225QM)\31\360\262I\276[\2C"
#"\1g\245\212\255\214\353\343\302\320\252\252\36\1\340p\35"
) 500
(
#" \227R\3e\254\331\330\242TB\324a\354w.\263\354s\316\250\270\222AU"
#"R\334H\3?.Ap\345\375\6/\17ci\303\225\22\5`\336\275\204\256^"
#"\261\365\242:\234T\244\254\20<)\367LB\240NK\270x\360{\376\265>\210"
#"\266\3\241F\356\337~\227\375i\rE\300)\240t)#\22\266U\1G\e\356"
#"s\n\344<z ;\260\353\221k\t\e\20\342\213\230\224d\3630bI\v\227"
#"6\207\3766\370F@nq\347\36\366\202\252j\341a\1a\316~\244\323\ra"
#"\261s\256\374\317\341\234u\316\253dr.\252q\261\e\263\300Y,\220\35$/"
#"\220\253\357)\217\331\17\vU\255.("
#"\242E\a'\21\206\266\256\254\204P\333"
#"\b\201\246\242\355\327\354\315fLr\v"
#"\17\336}\362\337\357\3`;\20j\317\275w\336b\1776\5I\304\256\245\361B"
#"J\21WOm\230\36\351j\215P\362"
#"x\366\357\323\220\360\350\311\271\331\0D"
#"l\270f,\214\32W\344\17ml\232"
#"\201\313\312\21\e\16\345\343<\341\266\374"
#"\205]\35\2220\345\266\26\b\215\2323jmP\252X[\377\326~\227\307*\e"
#"\r\32\25+r\330\347\261}O\f\257=\226\367\313\32wC\213\e6\207\315\262"
#"\30j\205\352Ri{\262\f\251\252\340]E\2272nR\321ukf\307\236&"
#"\257\341\235\327\237\370\347\373 \330\16\204"
#"]\313\331\203;<\277_CN\344\24Q/EM\254<F\37_\311\21 \246"
#"\236\230\23Q3A3\231\4e\204X\26\f\b\342mX\350P\3\224\\\326\205"
#"J\275\365zC\267\303v\327CJ\351"
#"\312\377\37\361\204\224\220\270$\202\254+"
#"d\303\35MI\257\360JsNE\r\2400j\nFU\212\266\352\340\t\313\347"
#"\333n\374u\303u\265B\210ja\4\225)S"
#"\3427\312\337N\255\17R\324!\336Fp\213w"
) 500
(
#"\364\251\207\306\323\270\f\357\274\371\276\374"
#"\204\177\330m\a\302\325%\355r\311\364"
#"\306\4\372\36\321\204\246\242\231ye\340\365\3066!\352 K?\b$\305q\355"
#"\224\245t\n:G.t\230\301\353\250f\353\1\22\e\3129\276\256l\224\271\a"
#"g8\320W\257\202o\263VKCGE\221\313\310\271\214j+\364\321\224\212\20"
#"\261B\312eM\230\a\300\352\230\1\266"
#"2\204\216\2163\27\255\230\204\0225S)c\205r\333\e:-\304\203R+t"
#"^pY\v1}\340\224:T\354\363\213&\bB#\260x\373M\346O\374\3"
#"\376\341\267\35\b\27\227\344\324\23\334\24"
#"\nK&\245\210w~\354!\34l\333;\216%\202\355\216\364\342!\206I\274\n"
#"\4\357\255Z^j\216Y\225\254\31\262"
#"y\274:\16 \220M\337\336\326u\267"
#"\245\1\241<\306\23\272m5\267\362\334<\4\275\17\367 \272\22qn\tA\t"
#"[\211\225\362\357\307$\202\222n<\341"
#"\360\277\204\342\n\270(\224\265a\37\256"
#"\320\177\324!\316\246Q\5g\341t\355\225\263\373wv d\aB\350:\223f"
#"p\316H\305\"\240\e\271\373of\2436\v\233\20m[E\3149G\366\306M"
#"\263\303\317\352\203J$\251<\222\355\34"
#"\302\321\341\272\367\376\312\377\267\37\263]"
#"ST\3158\347\255A\331\271\253\211\31"
#"\204\234\343\3463\25\21&P\320~\4\342vq$\27.k\306\274\345\325\266\343"
#"\307)x[G\204\210\232\20\206\214\334"
#"\"\333W_\331\332\262\0\323\v\264\213"
#"\313\337\345\217\364\301\266\35\b_\3737"
#"\34\337\371\6\307\237|\26\262\343\301\321"
#"1\322\236S\367-\325z\311\364\262c\277\336g}\331R\315\347\254}f\21/"
#"\310MO}\340\270h\236\345\335\203=8:\340\360\372\r\226\263\31R"
#"\5\302dJU7\334\353;\\J\324]O\225\225\272\367x'T\305\303"
) 500
(
#"ul\16D;l7BJ\0\2426Ll\354t\260\270r\343\241\252B\202\336"
#"\232\23\201\16!\250\342\222\235\36|\312"
#"\220\254\bo!\252%\214z\226\f}\207))\261\317`\377\266\362\311$\20\275"
#"\22\333\210K\2\223=\272u\305\345\245"
#"\260\252\225\323\325}\246U\315\\\3\315"
#"9\334\330\333'\204LLK\334D\311\325\232u\276\344FsD\277v\324k\205"
#"\313\300\213\341En\335\276\307z\275f21\332L\214\326\e9\234x\336K\260"
#"\370\203f;\20\246%\242-u%\20#\335j\215\317\231\312\325\324\3639\313n"
#"\311\355EG]\357s\322)\275\v\254\253}NW\347\274\365\316\212?\371W?"
#"\311\374`\237\203k\327\b\223\206\16X"
#"'%\256\226\304\276g>\237\226\344I"
#"\244\357\243iv\"\254\313\245` \32\275_\271>rS\265t^\210\20\6\375"
#"\27\244dW\205\276\217\343\363s\336\200o\270\\-.\354`\36\357\317\5p}"
#"\361P\200\202\317\256\264/A\214\205\266"
#"\27\225I\335\220\332L\\\256I}\244r\236J\34\a\3239{U\303W\276\372"
#"e\246\325\204\217\276\360\22\317]\277\306"
#"\22A\343\212$\221k\a{\244\264\244"
#"\362\211\313u\213\327\232\3403\276R\232"
#"\231g\325]\360\340\301\3\236{\356\271+z6O\v\370\6{\352Ax\371\265"
#"\327Hy\311\376\321>HD\243c\266"
#"wL\277ny\367\262\345\370\331\227\271"
#"\377\215\273\370jN5\235\361\353\277\365"
#"\5ZzzID\205_\371\245\177\312\v/~\210\357x\345\273y\361;>\302"
#"\365\343cb\345Y\v\264$\350\327DQ\222\2308|\334R\337\316\"\204x5"
#"\314\24\30\17H\247\214\252\327\252JW"
#"\30:W\326\205\365\246\201\230\242\340\235\322\346q\315tn\252\336]G"
#"\37{\3\227\2RY\rrua=\202y`\300\30\361Z\361d\227"
) 500
(
#"\351.\326\324\22\330\233_#xO\267n\271w\373\16o\274\361\6wn\337f"
#"\377\"s~\266\340\325\267^\343\346\365"
#"k|\367w}\234\227\236\177\201\266="
#"\343r\325\322\367\211\343ksR\277f"
#"\257\231\321\367\t\37[\242O\244\209"
#"??\347\370\370\230\311d\362\b\370\6"
#"I\216\17\272=\365 \f\207s\302\336\334Z\f\262\242n\316\"V\254S M"
#"\217\370\302\275\236\343\227\377(\317|\350"
#"en~\327'\370\325w\377!\367\357"
#"\275\313\376\336\234\343\203}\276+\257\310"
#"9\363\340\325W\271\367\325/\321\34\35"
#"r\364\302M\236}\371\303\34\337\274A"
#"\237{\326\222\351\25zQK\333\343\361\2766a\245\225i\270<\234p\31<\340"
#"\366\372p\373r\270\336\257\343\246\214\220"
#"\363X\216\30\274\341:\265\306_M\251"
#"\320\357\256\326\372\366\231\322\367=m\333"
#"\22\373H\216\t\347\2\265\363&RU"
#"y\316O\316y\373\366\35.\316\316\211"
#"\205_:\323\300\207o<O8\236\301\335\373\274y\357\1_\372\352\t\37\3773"
#"\337\311\361g>\315\275\333\337\340\355\327"
#"_\343\360p\237\23\355\t> R\31c\246\256\270\250\205\372\305\ec(\n\e"
#"\205\266\355\317\3674\330S\17\302\311\247"
#">C\363\357\276\300\235>p4\335\207"
#"\375\27\271\177vA\224\212g^\376\30"
#"\257\274\362i\302\367\374\2070\233\203\302"
#"K\377\346s|\361\377\370\3474\263\212\273w/\270^_\20\352\212\351t\6\2"
#"\361\362\204{_>\341\255\337\376\"\235"
#"\23^\374\370\307h\366\3679\270q\203\243\353\327\230Lgdq\264}K\\E"
#"*),\227\307\351\177\2522\231LJ\"dPE\333\210\364\2\244\242\337ia"
#"\252\205\263A\34\210%eOOO\361\336S\371@\345=Y\214\260\335\2676"
#"\337\242\275\350\b!p\24j\244\231\320i\313\305\305\5\347g\227,\227K."
) 500
(
#"\317/\210]\242\357{*\t\314*\363\240}\333\323\266\2217\336y\27\232\t}"
#"\2301\373\320!\177\374\307\377:\315+"
#"\37\347\303\335\202\17\277\373\r^\377\334"
#"\277\345\354\235\257s8\367,RG\362"
#"\21f\327\271U\355\301\207\16\271y\363"
#"\346(%\262\355\365\266k\245\37t{"
#"\352A\310\367\376i\276/\315Y\335\277"
#"\317o|\345+\364\371\6/}\367\367\362\322\37\375\24|\354\343pp\0a\320"
#"\374\354\371\201?\377\243\374\353_\376e"
#"\366&S\216\347G\244\223{x\24\347"
#"\2\223\312\343\2475R\325\344\340\310^"
#"X\334z\227\3137\337\344\255\330\21\21"
#"\246\263=\216\256\37s\343\231g\331\337"
#"\337'\317\247\6\234A\347s\bW\203\211+\305\330\32\335z(\201\350UO6"
#"\3635C\373\322\250\0253\b\367\252\362"
#"\314lBN\226\364\210\353\236\34\243I\373\347L-\16\267lY,\36p\353\344"
#"\224\263\2633\272\266ED\230\324\rU"
#"\325\260\227\2256E\\\27\201\210D\233"
#"\327(}\302\367\221\303\340\351\312W\371"
#"\311\317\3761\232O\274\2\325\24r\r"
#"7j>\362S\237\202\327\276\300\342\316"
#";|\371\325\337\342\376\351}\366\333)"
#"\317\377\300\217\361\302g?\v\323)\260I\312\f@L)\21\302\323qx\212\376"
#"n\362\360\37d\353\357\1\2]\202o"
#"\274\5\315\24\256\35\233*\232f\230V"
#"\320^B\5\270\b\375\202_\372\371\277"
#"\313\253\377\362\227\371\330\215c\2369^"
#"\200\263RBU\331\324\334\20<.\230\2\365d6\243\252\32\352fJUUd"
#"qtm\317\272\263\251Ko\247\213\322"
#"\231\21\250\252\212PW\204\20L\212\320"
#";\v\327\312\353\213\267iG\276\n\343"
#"\2722-\af\314f\2\323\220\351\224"
#"\254\234\235\235\215\341f\327uE\326\320&\372\6\347\271\226\3"
#"u\250\354\275\305\2464-\27\v...X\255V\5\300y"
) 500
(
#"\244\237\205\272F\263\260X\257X\257\327"
#",OZ\356\367\211\267\332\314\317\377\217"
#"\177\237O\375\304_\0037\301\250\n\16"
#"b\266)L1\333\360\325\373w\310\223"
#"\6\277\277G\270~\r\270\t0\222\313"
#"\253\252\"\227\344Q]\327\357\375\273}"
#"\200\354\3518\325\374\16vQ\335\240\1j\22|\344\330\n\332m\aa\2^\215"
#"\221\2627\307\323\302\331;0\t\374\340\237\375a^\377\265_aRW\364Me"
#"\35\25\"x\17\270\214\23G\225{\234"
#"B\275\26d\325\222\335\22\365\25U\250"
#"\231W\23\252j\202\237\354s0(\261\371\242\210].\361\2\2\367o\277MB"
#"i\325\326u}\332\362v(u|\334\334\367MXw0\235\22BM3?\242"
#"i\32B\be\264\231\205|\367\337\274"
#"E\277:\347\362\264\245[\255\351\vP"
#"\1\32\240\357K\27\6\236\340\4G\240"
#"\317\231\34;\372vE\235\224\343\351\f\177}\237O\375\271?\17\22HL\2104"
#"x\2y\275\244\256\17l\2\362\374\210\352\350#t\375\2324\233s\277[r,"
#"=UU\341\275\37G\302mS\366\206r\305\a\331\236z\20\266\30K\304U\236"
#"P\270\332L'eN\213\260\"\320\3S\4?=\240\222\216g\177\344G9\372"
#"\307\377\230\323\363\23\232\305\212\275\331\324"
#"\350i\n}\eq>Sy\317z\271`\272\177\200\303\343%\202Oh\237\350\333"
#"\2164\314\a\\\276\316\252m\251\353\232"
#"\246ih\373\316\346\2V\1\25\341\372"
#"\341\241\365\36\n\20@\2532\347\242\354"
#"\277k\207\361\327r\205[:\334>\275u\213V\225\265^mu\262\0H\210\303"
#"\334B5!\247\220\22.gr6\362A\355k\36\234vD\205\347?\264\317\262"
#"\3538\273\270$4\23.\327\211g"
#"\367\236\341\353\357\334\345\277\376\37\376;\250\367Hk\210"
#"\323)\227I\231{h\3463\210@c\343\320\20p\263"
) 500
(
#"\212\25P\325{l\237B\232\246\371}"
#"\371\315\377\240\331S\17B\317\26;\324\b\36\5\225\3209;~\22pI`\257"
#"\276N\225.`\346\370O~\376\277\347"
#"\357\375\302\177\313\37?|\216\a\367\357"
#"\322\34\35\342\304\203\366\364md\275\272"
#"0\341\250\254\250$\0241\236\246\250)"
#"o\2135\306\316\373\226\320\267\4M\324"
#"\222\251\372\276\220\301\3\n\254nY1"
#"\177h\342xX\360\315\367\366\23Z\262f\223YM\345\2013\6\220\226ue."
#"\343\314\312\343VC\333\222\32\351;\227"
#"\372\344\320(\177\357A\307\321\r\317\242"
#"\313\334yp\237f\377\200\351\265\3\316.W\344\6>\377\372]~\370'~\222"
#"\17\375\300_\4\331\203jB\207#\370"
#"\315\214\250+\276L\355\366\343\374\367\323"
#"jO=\b\347\304\2\304\241o`PF\272:r3\1\35\25\"{\324]d"
#"\362'\377#\376\364\337|\235_\375_"
#"~\201\357\371\364'\2708\275GG\344\331k\373d]q\375\306!B\246\327\204"
#"\240DG\tU\263%z\274\200\313\34j&\247\214\323\16q\340b$\344\214\37"
#"\232\207S\2722\354\354a\20V\f\245\r\267I\330d1Q%\204T\352\220\231"
#"\342\5\23#\aTUY\a\373\220:|\320\262e\243\267\262w\0g\227\211j"
#"\177\302|v@\253\201\213U\317\203u"
#"O\357*^\376\376\37\342/\377\334\317\3033\37\0057C\203#&\223r\215\31"
#"\246\217|\343\246\3053\361\16\363{\37"
#"\374:\3407\263\247\36\2045k\6\331"
#"\303\241\333\35\251\301UE\350\26V\31"
#"\352\342\25\203\2539\367{\34\326\25?"
#"\3623\177\227\357\316o\362O\177\351\177"
#"\347h\177\316\301\301\214\a\213\v\216g"
#"\373\234.\26\314\233\n\347\213\320o!9\343\24\35]\215p\340\204X\270"
#"\326\332\3676`F\1\342\25\262\3708"
#"\377\345\341\17\240\275\355~\t?7\336"
) 500
(
#"\320Hp)g(\263\20\223\3462\300e\263e\267u\275\200/fH\212\3256"
#"\261\210\0_s\367dA+5a~H\337@\e\224\277\365\337\374\2\341S\237"
#"\1\r,\326\231\260\347\354+\4\e\f5\324M\\\304^-\27ny\351\203\364"
#"\217\302\364i\263]v4]\332\321B\36\310\233\330\271\251!R\261V\303N\6"
#"\326-\314\e\3\346zu\301\244\t4"
#"\367\177\203\223\177\365/\371G\277\370\277"
#"R\347\236\27\2379\246\273\270\317\215\275"
#"\32\322\232\272\262\351N\22@\275C\253"
#"\n\202Mj\3029^:\371:\347\347"
#"\227\244T\22\262\245\341\3019\3\304\303"
#"\204\221\207A8\266:\345\342\304\206\311"
#"\300\345W5\312\\\1\350\26\320R\371"
#"\177\3476\257\2233D\243\246\22\201^"
#"`\231 \205\212\326M\310\263C\334\344"
#"\220\337\370\322\327\270\361\374K\374\275\377"
#"\351\357\303G\276\17\252\206\24=\22\2Y\f\3049C\23J(\252\21\264\337|"
#"\270qx\216\203\360t\256\3\267m\a"
#"\302\24\213W\32V\177\2714\376x\240"
#"\36\364\247\351Z\250\eX\255Z\232\251"
#"\a\22g\313\a\34\247\273\20<\347\277\3769\376\311/\376o\254Onqso"
#"\302\372\336->\361\362\207\350\227\347\4\222yDo\245\v\202G\\@\235p}"
#"\3756'''\364\275R\331\230\aDL\r;F\245i\256Jl<\254\203\332"
#"\347\201;\272\1_q~\250\nq\320\236)\3360\347L\314W\2732\266=\341"
#"\350\1\25z\a\313$\\&\317\315\217}\202[\27\221\327o?\340/\374\325\277"
#"\301\217\375\315\277\5\207G\350\344\2206&&a\17\250\30'\335\fg\v\211h"
#"\361\200vW\300f0\6\363\210\37\374"
#"\344\3477\265\35\b\263U%\254\37\276GK*\306\1\25e\352\356\242"
#"\310\334\317\246h{A\224\226j^"
#"\333\223Y\321\235\337\243\336\237\301\345\31"
) 500
(
#"\377\347?\374\a|\351W\3775\337\365"
#"\3743\234\275\371:\317\35\316\251Q*"
#"\1/\16\357=.x\234\v\340\204\340"
#"\356\362\340\301\3\272u\207\367\226D\31"
#"\306M\247>\232\2125\e\360=\254y\223\\\276\32^\352\266'\24t`\344 "
#"F[+kC-\375\214M\371\371s\266P\266\327\2D\240\25\317R+\16n"
#"\276\310\327n\237q\364\322\307\370\217\177"
#"\366\277\344\306g\377TI\327zt\277"
#"\320\351\262\207\324\200\224\32\2418\310\35Z9:2\251\b^\364K\315z\0\0"
#"\0323IDAT\b\325f\354\251b\31\351\247\334\236z\20F5\31\31\3!"
#"(=BG\215Z\342 \v\264\271\304\223=T\21|O\277:\301O\2'\232"
#"\330\363\r\256_P\21A\22\375o|\236\377\353\237\374#N_\377m\236\235O"
#"\230\252\311XT\2\225\263\232\230sV"
#"\202H\323{\334\273w\217\365\272\303{"
#"#p\373\1\204]\34\323\26\303\250j"
#"\270\nD\251\234\t4\251\242\305\223m\262\243&6\f\346\t-\334\334\0PU"
#"\231\227\270\324\232\223\355\373\30\327\202\22"
#"\270}\219z\341e~\350/\375$\257\374\215\377\24\232}\323f=8\206."
#"qY\277\315^u\200v\212\310\314@\230\2x\17\336\276\333\26\350\t$c<"
#"\fe|\34\354\232z\331\201\360w\260"
#"\374\310\365\241\333]u\363?\327^\202"
#"\217\340:p+\220%\304\5\364+\210"
#"\221_\374\237\377\1\213\333w\211\247'"
#"\34y\307\315\331\224\303*S\347\16\257"
#"\211\243\365G89{\300\351\362\36\321"
#"uH\350I\271\205\234\231\210\21\274\e"
#"\27\b\336\221\351\211\256#\205D\357\355"
#"\374 \311\"iI\20\24|\202\234\205"
#".[\20\330\227\344\v\336V\272U\256\361}\215\217\r\222\34\313\371]b"
#"\206\30\240\v5\347\331q/f.] M&\374\364\317\376,\237\374\314g"
) 500
(
#"\231\275\364q\350=\375B\251&\317\200"
#"\337\207UO\336\237\215\337\205\224\36I"
#"y\354\f\217]\26\364\275l\a\302\367\264\337%\b\273\5\270~\3B\26hZ"
#"\"qmt-\347\271\374\322\227\370\322"
#"\347\177\215\267\276\370[\254\357\277C\223"
#"W\\\233\6\346\223\212\311\342&\367O"
#"\356q\357\354\16\275\364\270\0\241\202\211"
#"\367\314\374\224~\321Se_\344\344#\311ER\310\344\0\331\203t@v\270\344"
#"\361\331\343S \213#\223\350]O\364\231\236H\237,?B\17u\16\324:\301"
#"\21\320\203S\222\300E\204\373Khk"
#"x\361\225O\362\375?\372\227\370\360\367"
#"\377\240\305\266G\327\315\303\255\225\234\32"
#"\334\364\31\300\224\350\362\26\277s\a\302o\315v |O\373]\2020.\213;"
#"j\201%\310\322@\230W&q\257\21"
#"b\a\347\367\340\326\353\234~\343\213\334"
#"\177\373\313\234\335\376\6\313\213\5\254\346\234^,8]X\bXJ\224\370\fu"
#"\264:\233\353\300%?\316\375K.\223"
#"\202\242\16\326\347\25^\2\265T\324\322"
#"\230@\225d\222\264\364\241eEG,"
#"a\241\226\374\323\270%\270\24\250&p"
#"\343Ex\345{\177\220\217}\337\17\303"
#"\37\371\17\240\232C\333\303\374\20\360\226"
#".\225\211y@\346\240\rdGv\e~\347\16\204\337\232=\365u\302'6\347"
#"\306\324\273\212\255\301\6y\25qj\336"
#"\320\257\240Z@}\316\336\365\226\243\203"
#"}\370\344G\201\236\366By\347\366-"
#"\276\376\3469\357\336\201\345\322\226\236!"
#"b\31|K\330\342\372D\20[K&\261A.x\360\22\250\234\307;S\267\216"
#"qM\227\327\254\5\372\f\375\4\26\nm\262\226\311\203Cx\376:<\177\3\216"
#"\367\257\361\374K\307\314n\274\0\a\317"
#"\3\373\244\356\f\276\376E\374\365\27\341\360\31\322\3459\311"
#"7\370z\216\3675\246W\323\231\242\2703\326\355\316\236\314"
) 500
(
#"v |Rs\326\250;\314\226\320\241\6&\36\361\16\372\26t\5\234Cu\206"
#"\237^\300\354\34\344\2\362\212\346\345\353"
#"|\364\323\317\361Q\367\202\245\354\227\35"
#"g\267.y\347\253\3679\177#\261|\27\326\n\353\25\344>A*\311\27\21\252"
#"&\260\356V$oy\20\21p5L\217\340\370:\3105x\346;\240\276\16\307"
#"/\314\270~\363\0\366K\3s\257\206"
#"\322\373s\350\316Y^\264\344\346Y\366"
#"\236;\206\347n\302\344\20\272\36\232}B5\3jz2Y\215`\355\303@\265"
#"\371\367\372\355\177 l\a\302'\265\201"
#"\32\242\24\252\230Z\347\274x\313\250\356"
#"\355\301\342\f\332s.\226wH\353[\314\344\36us\tU\202\351b\363B\331"
#"\303\376\204\3030a>y\201\356\31\3177~\375.'\353\226{\367#\355\2\362"
#":\221\22\270\340\251\247\201\276\265P\323"
#"9\3605\314\257\301\215\353\360\334+\207"
#"\34}\244\342\340\225C\230\236\220\233%9\334\6)j\333V\203\201\352Cd*"
#"\324\357\223\374\232u\272`\262>\203j"
#"\37\246\327p\256B\250\210x\"6{\260&\0B\314k\234\354\362\233Oj;"
#"\20>\261\365\230\4\257\t')\16\2073\0J ].q\3535*0\337\237"
#"\221\303\4m\v1 C\257-\276*e\265\4\364kR\252\270\\(\213\a\312"
#"\244\231R\271\216J\r\3539\t\335\332\204y\253\f\317N\3\252\211>+\2713"
#"\247\333-!.\23}\347\351./\310\276%\314\2240\363\26\337vJ\273\202>"
#"\302\\NHa\206\257'\204\n\244\312\244\334\3425\202\253h\327=Ru\250s"
#"x\251\b\230\aT:\e\t\267;\202\236\330v_\341\23[\1\224\30\3z\20"
#"\344\3156\253\26?;\2\275D\372\31\352\e\24OL\212\367\340\32"
#"\363^\342 %\350{\220\234\b\3363\235\324\370\231\347\366\345%\332"
) 500
(
#"&&\t\234\17\270P\263\246'\367B"
#"\205\262Zz\234\3634!\223\253\36\327"
#"\202_U\244U\240\273\204n!\244J\211\23\250\203\307\251CH8\227\b\25$"
#"]\322\305\36\365\r\315$\22j\e\255M\327\203o\231T\ad_#\324\b\226"
#"uM\261\305\273@U\325#=ng\337\272\355@\370\304f\35\211B\302{k"
#"zU\244\314.\364\210\324\340f@C"
#"\327\5\272\326\343\231!\322A\216\226\267"
#"\251\254\251B\235%e\342:\22\327\212"
#"\3665y\225`\1\276\5\277\216\310\22"
#"\216\250q\301\23\373\310$\4b\216\20"
#"A\235@RB\337S\345\304\274j\250"
#"\235@3\301\327\221LK\356\243\215\267"
#"\26AP\202\37\224\334z\272v\211\324"
#"\35a*\306\321\v5\250\303e\307\300\255uxS\23W\2128\351\277\337o\377"
#"\203`;\20>\261Y\303\223\371\bs\vF1+\234\20u\240\25\350\4\264A"
#"t\206\352\234\254\35>E\\\\\216$m\237,\321*9\220\263\203(T\nU"
#"\341u\206\4>%\2522\3530\305D\37V\203\\h\31@\3\215@\315\5A"
#":<\16\301T\306Q\e\3662\312\336\227\356\r\2472Ln\e/G2\251\344"
#"\322aR\356\307\225\330yh\225\370}"
#"\371\222?\320\266\3\341\23\333f\326\203"
#"\365\3\3330\261QE[\213\213#\224"
#"\220n\2y\n\271\203\324[\235\321\331"
#"\263]Rr\n\270\24p\321\0225\241\200P\2650^P\202\366x\t$\265^"
#"\310,\306\212\311\336.\3\2669Z\312"
#"\350\a\353&*\270r\203\202@\302\n"
#"\375\261\302i\205\323`\22\366y\360t"
#"\303\23\v\20\207\271\30J\371L;\366\365\373a;\20>\261y\254<=t\306"
#"R\16\372\322\0365\264\360\210\351\215ZWF@s\30\25\257\211\2362\2"
#"\tI\16\315\246ga\2658\207\227\214w\306=\365\16*U\274$\234\263"
) 500
(
#"L\247\265+mpUa\270\261\306\20\217\244T\212\355[%\363R\260'6\240"
#"\rN\247\b\215=\273\314\343\260\35*\256Q\2127\34\232\ee`\177\356\354I"
#"m\a\302'\265\\3xBa\230\361\27Az\333\264\263Kz\234\244\321\231\240"
#"\326\272/\tC\f~\253\357OI\252du\210\347\312\346<@\306\t\250W$"
#"\317H.byY\223\324\227\f\32+r\337 1\2401\332\356\f\323\231p\20"
#"\235\325\t\323\4\325\6u\r\16kf\266\220\23\373\\.mB\322\2219n\236"
#"}\a\302\367\307v |R\313\rV\246P\220hL\231q,Y\17\262\6V"
#"\340z\234Ox\351\311\222\21\355-yCy\274\332`\321X\332\220\222(I\254"
#"\23A\3\343e\366e)6\264\375\353\24'\21\365\220]\17nm\343\260\361$"
#"\265M\266{\235\310\210\16\0020\16\362"
#"\24\245A\231\242n\n\322X\345\37-t<\363\350Ir\331W\207\27W\32s"
#"w\207\317\373a\273o\361IM+; ]iL\24(1\246\261\253\265\303\300"
#"\330\"\322#.\342\244cP\255Q\212\203\21%\213\242NH\2442\220\0234\250"
#"\365\277\16\216'P\3309v\237\260\";\205*\241u\217\4-}\263k\242o"
#"\311\316\203\2136\36q\240\323\351j\314"
#"\eE}\206D\rZ\243\324\245\225\277"
#"$]\212\302Nos\206\241\274\204\226"
#"\344\214c\230w\270\263'\261\35\b\237\324r0\2171\f\364S6r\31\2437"
#",\2535I\210+\360\222\b\222\313p\26\312\24_L\362^\262\365\bJ\266\274"
#"Na\302\345\262t\264\26A-\367/\255\207\266b\310\334X\202&`\272\251>"
#"Z\30[\274\250\203\1IFy\325\32\250Q\t\350\260\316\23s\267Y\n'\26"
#"\306\314\257\214\233+\334\240\235=\251\355@"
#"\370\244\326\234\227\2439\226\254a\rz`\35"
) 500
(
#"\a\262o\364/7\207^\310a\211\352"
#"\t\22O\360\335\302\3204\305\326\206\16"
#"\232\4\271,%\233^\311=\204V\231\bD\261\362A\240\364\17F\e\3349\355"
#"Aka\35\224\313\f\255\a\231C\325\30\307\324%`mT\325\252\204\265H\r"
#"\275\220V\221\320\236 nF\3665\270"
#"\214\206\200\204\32\374\24'\a\240sj\255\nX\vA\25\354\363:E\3054b"
#"dW\257\370\226m\267\262\376v\332pL\2260u3Yw\350-\227!\342\e"
#"\303\272+\362\25\222\215\224=8\2472y\233R\35\20o\257\251E\245\321o="
#"f\230T\r\217\352\322\24\1\232Q*"
#"Q\304\243\342\221a\202\257\24\325\271G"
#"\354\241\303Ew\207\317\373a;O\370~X\t\357\256\330\260>\34u\v\v\370"
#"\304\225 \316\222\e\271\264\30\211lj"
#"\342\343\313\212\20\312\232\320\27>\270\v"
#"Xd;\326\312\25\27\34.\350\330\20,E\321x[\251M\6\260\0177\22E"
#"r\315\241\5\210\326\257\30\306\230W\345"
#"1\276m\\\367\356\0\370~\331\16\204"
#"Ol\333\r\254\17\35\262Z\334\326\340"
#"\312|\260^#\347Q\251\20\202\351\215\26P\r\245F\313~\n\331)\256r\204"
#"\220\311\225U\17\\\266\325X\216\303\273"
#"\tT\212\324\216PgRm\271\242\0206\355M@\231u\270)\367\21!'\207"
#"\16\265KW\341|m \224P\236\270\255p\263m;\0\276\237\266\3\341\373a"
#"Z\270\225\300\340\341\256`R\235\271;"
#"\27\212\300S\221\375\303\223{\3\313X\201+*i\342,\24\r\225\207&\343\n"
#"\225\323\27\26\216\363\340\21T2R;\\#\370I\301xmx\17\245\234\341\300"
#"*\16\212%\220\324\221{%G%\23\n\272\353\361\4a\256\331\25O8\0\356"
#"a\237\270+\326\277_\266\3\341\23\232\342J]"
#"p;\366c\274\235\21[^\211\35\350\"\r*\23"
) 500
(
#"\324\246\273X\222\264/k;\275\332$+\"\370ZH\225\303\327\31i@TP"
#"\24\211jjm\31\\\255H\3n\2\2761L\205\340\361\276\324\5mG\313\332"
#"S\206B$\332;\224\n[`\2327\264\27\b\346\271\325m>\3266\37v#"
#"*\372m\372V\237.\333\201\360\211\315"
#"\30\243\214@\334\366\16\3\207&\24\357"
#"\22\20W\243x\324\325\270\330\243C8"
#"\32\235\311a\224\327\24Q\324)\22\34\256J\245\1\27P\3Uv\340\304d\355"
#"-\34\25\244\266\216\f\302&A3J%\16\374\1\253\352\243I :\324U@"
#"\203\223\301\215V%\34\3656\304\6\301"
#"=\234\200\31\302\354\221Y\263\263'\261"
#"\35\b\237\330\\Yl%\256\256\241\266n\17]\366R\221\361\250\324@E\2462"
#"\301\245\241\227i\310\270(\200Z\362\305g$dsL\301\32\1775\f\265B\214"
#"\23Z\1U\36\213\372cD)\262\1`\36\212\215\316tA\23H\316&\324$"
#"\346\r}\331G\343\306\271q\242R\26"
#"\n\20\a\351\0166\305\313\235=\261\355@\370{\260AELd\373\340s\266\220"
#"S\267If\210C\305\244\362\305\5\v\0313\210\257q\263\3\\{H\267<\245"
#"m/\2305\r\261\315h\216\370\n\234WH\212s\202\233:X(\365^\205?"
#"JD\315\269N\30*\373\324s @\254\200\31\370\3G\330wPA\312E"
#"<8\2\235eer\314h\37\221\334\320\204\2326\327\324\325\34?\277\6\223\3"
#";Y$1\3409+,\312P'\321\302\225\eN*\370-e\265\235}\253\266"
#"\3\341\23\333\20\216\272\255\272\231]*"
#"\216,\316\244\364\245\332\332j\220\232,"
#"\r.W\210$r\24\313\272\f,\32\315\b\31\25E\234CCF\313S\211\26"
#"Uj*K<?\22_\20\237QW\272:\6\e{\4\35.9RrHv\b5\352\e"
) 500
(
#"l\261Y\27`\5\262\265\373\242e\30\251\303\331\211g\370|Zz\n\37[\303"
#"\330\331\357\325v |b\e2\243C"
#"\230\346\240\f\5\5\30[\37\244\350\316"
#"\224,\244\363\23\234\237@\252\20Wd\22SO\6d\320\214\20\265\232_P\353"
#"0\252\313\372\256(nk\2312\246\36"
#"h\354\245\31\252\fE\241{\264\264\271"
#"\224\354\221\302\n\0277A\374\4\\\263I\253JE\26c\4\310#!\347\20\a"
#"\357B\321\367\313v |_l\313\3n\35\370\31g\341Za\243\340\202\211\312"
#"\204)\22f8\277\264\365YV\343\223F\323\177\311Y\257vJ\0045-\232\t"
#"\306\274\211BJj\363\377\n\301E\254"
#"-\20\3278\b\202x\35k\217\233\341\237\202\306\262.\314V\17t~\212\333N"
#"\253J(\244\202\215/\315#\24\37\2\236l\227fv\366\255\332\16\204Oj\352"
#"J\5\334=t\237]\315\210\205r\256xAo\352N\3367\204j\16m\200\234"
#"\21\204\34\25\35\346$^i\335sH"
#"\235\361\23\354\300\217\2)\31\b\265\344"
#"Q\32`\342\220\332C\255\f\363N\313N\24R\200\2557I%\311\342<>4"
#"\343>\31\20\353\262\236\275\352\361\254\24"
#"3\354\220\333$fd\a\302'\265\35\b\337\27\e\326Jv`\252K\344\222!"
#"\25\244$6\206\260\324\27e\247\6\27J\313\203ZCo\26 \353\246474"
#"\260\a\201\312C]\326`\321\0311;\251\255\35=0\21\e'\\;\v_\35"
#"H\321C\5\30&\210\346XZ\361]\0ux\337\330\240N\337l\366O\6&"
#"\315n\301\367\373a;\20>\261\275\367\201j\32\244\276pE\207p4\30\bC"
#"\300;S3\e\t\325I7I\326\1<\345\251\6\304\362O\347 *NJ\347"
#"F\205\201\264rF\223\361j\31\333mO("
#"\226\310\311\331\250o\266\353\16\361U\361\322\303\346"
) 500
(
#"\n\301\274\364\r\276\347'|\fMo"
#"g\337\222\355V\327\357\233=\376\200\34\312tc[\303\2205\301#CKD\221"
#"\317W\265u\336##z\304<\233\1"
#"\322\272\355\255\22\357\312\365B\223\en"
#"\213n\242\311\255\35\321\255\367\261\327\35"
#"\22F\3\311t\3\254\355N\301\253\273"
#"\263\235\5\336\331\373a;O\370\236\346"
#"\336\343\372C\226\227\e\232\232L\310\322"
#"\224\361\320\t\307\232\24/\3608,m"
#"9\267\365\332\314\321\246\31\253\352\222\243"
#"\325-r\273\200\325}\302\352\214\300e"
#"I}\262\331&\231\354\305\346G\264\t\332TD\232\n\315\255R\2503L#i"
#"*\344\6\264\216\340\240\246\314\235H\36"
#"\3275h\232\21\374u\ePQ\37p\367\370\3434\3239{{G\270\311\1\370"
#"9\242\25!\v\tO\360s\223\311\247B]c\322\30B\321\253I\354\6\302<"
#"\271\355Ni\337\26\333dKE\344\241"
#"\373\215\314\355\234\307\r\335\258\262\24"
#"\321\340\355\36\303!\347q\305\25\345\""
#"\26\225-\344\34\231r\366\340\301\t\222"
#"\305\344ab\32e\330\314\23b\345\207"
#"R:\21l_\256\3648\216\244\204\355\16\221]\360\371\355\262\235'|R\333:"
#"2u\254\31n\375[\2065a\211'\v\333\304\371\n\37\352R\237k-\21\242"
#"\201\234e\203\2511\226\305\n\367H\351"
#"#T[\367\351\26\b=\345\301\202d\305\245M\202\a\315h\16\245u\251tq"
#"\370\32\252\232\20\2n,KlBP\31k\204\345\3ne|w\366\376\332\16"
#"\204Ol%M\377\210\340\221\255\261\234\4\3a.\a\2648\b\1\361\25\241\232"
#"\200\233\">\"n\211\312\302\304\226r"
#",\235\16\366\24\315\346\305\314G\345\302"
#"\17P\256\f\177\37\230\332\232p\311\326\237\242j\2245@E@+\3247"
#"\3440\30173hf\270\320\340\253z"
#"\223\31\35\244\203\235\337Z\27\356\2\246"
) 500
(
#"o\247\355@\370~\230\16\324\265\274\271"
#"]D\223D\274\255\243\234\225\"\206\226"
#"&\27&\370\234\241\336G\262\"a\205"
#"\272\5\222;\320\36r\267\351\264\327\377"
#"\277\275\263\355m\\\271\241\360\303y\321"
#"\213\35'{\201\2\375\320\377\377\357Z"
#"\24h\263\233\330\226\206\367\39\222\354"
#"$\273\333\e{\261\5\346\0\201e\305q\342X\307\344\fy\16AU\214\200\302"
#"\232\206\272@c)\347I\261F\353\342"
#"\344\253&\276\276\v\252\261\203\270C\206"
#"\a\30\3660>\222\272\321viC\317\302jWIH\250,\207\2656\330pk"
#"4\22\336\2U\370\260\21\337\211\207'"
#"!\242\222\220\342Q&\270D>\367\26\251\372GP%\36_(\371\eZNh"
#"8#s1\23a'b\250D\17\236\206\2725\350B\302\372\245\254\263\261\t\26"
#"FCF\244G\322hc\260\207\203\215"
#"\301~\370\203\24{B\32\354\303\201\274"
#"\210\215\353\16nY\330\276%\343FI\321x\371i4\22~\26\233\213\377\"#"
#"]\n~\276\351!\331\"\\\355\37M"
#"\275m\234\f_\254\350\336\275\242\347\27"
#"\302|F\312\331d\27\345H\321\31Q(j\2534k\376\334\374\336%\25\335\374"
#"^\r>\260\305?\35\244\a\31-\nv\a\264{\264q\276\343#\22{d\253"
#"#\254\6\247\222\326'\327\260\30\377\256"
#"\257\257\261\357Vh$\374,\352\276E"
#"\275\177\221\232\6\0263P=\333\261\24"
#"\217\206=\32\v\222\36 O\224\364\225\22\366\49\242rDM?\217r\362\347"
#"\265\356\30\v\201\323*\336\360\210hA"
#"\311\325\360\265\302_p2\215\300\200\206"
#"=s\330\21\363\36\272\3\364\17H\350"
#"\221\320\263\32\227F\224d\r\336.W\322\305q\333\b\331\350w[4\22~\32"
#"u\3\6'N=+@a\326\211\240\262v\315\24\1"
#"2$\265\266\265\356`\355c\323\4\247#\347\323+\224g"
) 500
(
#"\2302a.fGX\n\252\23:\237\211e2\37\232Z\315\250\25\215\2Z\326"
#"Q\335\342\223\202\255't\204| \366_`\377\5\306/\234\244G\346L\336?"
#"\261..#f\301\321\371\a\200GrOO\345\"\3746\334\n\215\204\237\304\246"
#"\20\260IG\3\250E&\325\350\226\202"
#"\331S\275l\305x2 \226\216\22\220"
#"\323\v\fO\204\3437\364\364\n\223\17"
#"\211\231\314\rX\t\24\255\312\211\263\255"
#"'}\351W\24\264\4\n\35\342>\30"
#"\251\352\26\363\350_\217h\377\0\375\23"
#"\322\37,\25\355\17\230H\261\346\264\353"
#"\320\v\221\214.\333\257\302ji\321\342"
#"\340\255\321Hx3\\\24\f\331\326\16l\260\365d\321\311%\rV\2\f\204\361"
#"\321vN\313D<\275\"\307\257\314\347#2\25 S\312\vZ2p\2\204Y"
#"\216\210\26\242\31\306\240% \32\231\211"
#"\250f\263R\224\221\"\246\r\fy\17"
#"\335\16\206\3q\374\203\270\373\202\216O"
#"0<!\303#\324\24V\"\320\231\1\225\247\244\246\234\270\250\201l^cx\363"
#"\262\e\376\32\32\t?\211mi~\225"
#"\372x\201\217\200\220l\6\274f\324\225"
#"\270J4\305<\5\206\a{\354\351\305H\321?!\257/\220&S\344\317\202\310"
#"D)\321}h\240\24%2\1\205P\"\205h\21-th\350\231\343\b\251G"
#"c\242\313\17\320\355\321\376\301\"_\177"
#"\260\333\356\0idq\205\262.q\4"
#"\23\365\352Z\367\270\352\25m\321\360\326"
#"h$\374$,\5\255+\300\260\21\277"
#"\332\224&k\a\313\20f\353\210\221\263"
#"\365a\342kH\231\220\324C\36\220nD\272=!\333f\r\305\314\177\231N\240"
#"\301\267z\314\272\302R\334\202h\"J"
#"\242H\242\204\36\215#t{J\356\315\337\246\337A\267't\17\26\21\363"
#"\16\342`\353E7\234\302\205\307\352\21"
#"O\275\5G\210\233h\270\331\201j\34"
) 500
(
#"\274)\32\to\2047\r3n\b,\"K\331@\275o\24\315\330\24\230\3029"
#"&B\311\244\274C\262\27\322\307o0M \201(\231\22O\204\220(b\2a"
#"\t z2m\222Z\207K\n\2319\215\246\332\357vH72\307L\36\0160"
#"\354\221\335\1\306\203\0211\271\257\214\326"
#"(\b\220L|\274\211\202\313\255\34032\332\206\314=\320H\370I\\i\352Y"
#"k\a\eGn\251\251\251\245}\312\204Jt\357\245\214\304B\350\6\30\367p~"
#"\200\323\213y\e\2725w\230M\351\36"
#"\252\25b)\356\244=\301\354\226\24\261"
#"#\305\1\311\3\245\e\241\e\b\271G"
#"\16\217\320\357aw\260\347\357G\310\203"
#"\r\255\b\301#[\334(\210\331D@\217\216*\255w\364\216h$\274;.\205"
#"}\205\260\316\1D\21IH*\346\371\322\r\3665\356`>\1\n\257\257\336\365"
#"2#\321\\\273Q/\346\303\32\315\304"
#"\304\302\222z{\\\352\321\224`\30\241"
#"\37\374\326\217\243;\253\205\f\263\355\200"
#"Z\264\vn\360\364\3\350\325m\303\247"
#" \252o$\244\r\377\v\266\377\275\205kU\207\244\24N@A\325\322O;v"
#"\3533Qt\376'B!1\303|B_\237\231\277\376\207\351\371\337\204\3433\363"
#"\363\277\220\363W\344\365\277\350\3133\345"
#"\370\f\347\27d\236P\235\311\271\267T7f4\365H\277C\273=:\36(i"
#"\307\356o\377\260M\231\335\223m\2u#\32z\223\30\26%\367\177_\272_\26"
#"9\223\272\305!\201@\307ek\316G\257\271\341\257\242E\302_\4\21yg\335"
#"h\3763A\374m(\21\t&s\n\271#\224\16\372\35Q\314\34\30-\224\352"
#"\354T\316\b\205 \331\225\365\35\232z"
#"B\277\2675\340\260g\356\366\2202\222\334\302\"\232\205\205\204`\26"
#"\27Q\337m?\273\324@6\334\e\215\204\367\306\342\306\266B$.\321"
) 500
(
#"PBr\03731\203\246y t'R\331\21DQ-H2\25\206V\rb"
#"\367\n:\271?\251\245\267\22\222\247\233"
#"{\213x\303\203\271\271\365\26\375\310\236"
#"\206F[C\206\20\330&A\262\321\22^\376\355w\374\3374\0\215\204w\207x"
#"\23\2672\373F\a\330\256\251]\364\226"
#"\356\271\342Ap\243\337\235m\302\204\204"
#"\250\330\260\301`\233/\244\36\346\311\346"
#"j\253\242\3057RbB\272\1\206\335BB\272\235\227%\6'\241;mc\304"
#"\27\tVc\\P7\217\274\315\256E\304_\202F\302[\341\a\327k\255\356\t"
#"+)\r\225\4.\245\217\352\276\241\tr\207\317>3\362\204\1M;d>{"
#"y\302\202\354\22\tS\266h8\356-\"\246\336n\253\255a\350Y\32\312\221\v"
#"U\304\326\330\351\207V\207[7\270\206"
#"O\243\221\360\316X\247B\204\213k\327"
#"\216u\231\367`\ti\266\350\23\255xNH0(\304\243\25\330\323+2M\350"
#"<Y\267\315R\276_=c\350zK?\273\301\210W\311'.U\242J\224V"
#"\325\274l\232\262e\263\1\323|G\177"
#"\r\32\to\201w\257\325\3527S\311\347k@\202\271l\373\371\231U\32$@"
#"\254%\207\220 \f0&\350Np>\301t\206\351\210\224yM\25CfMg"
#"\243\325\26s\ai\360\271\22\346%\n6\35\270T\273EO\215/#\340ud"
#"\274\26\364^\275\346\26\ro\202F\302"
#"\317\342\247\203\305\366B^\257^]\4\263b=\245Z\210\242.ER\30\262\221"
#"/\235\341|F\347\263u\257\210;\372"
#"\246\316\265\206\256r\367\261\334V\214\317"
#"\256)\f\314\b\252F,\333\251\255\21"
#"\360\332\r\356\372o\275\305ko\370\36"
#"Z\235\360.(W\267\372\316\271z\357\2649\277z\35ZwL\261\265"
#"\337r\213\t\a/\236\247\22\306\31Qk}\301#\230\317\225(\233\316"
) 376
(
#"\235mt\vo>\207\267D\224w\3165\334\32-\22\336\25[\v\304\217.\340"
#"\355\5\276\222\265\370\324^\251J}\301"
#"\210\30X\312\e\1\254\261[\354\336R"
#"\337\223\3659\265\246\233K\t\342\243\350"
#"\367\263\367\en\215F\302\273`K>X/z_\273-(l\t!\213\232\335"
#"\34\322\324\375d\226\16\233\340\26\366\225"
#"P~|\361\233d\263\311\342\375\251\262"
#"!\345v\243\350\362\357\335\342\275<\263"
#"\221\361^h\351\350\335P>8\206\313"
#"\35\215\311\317l\326\211K\371B\235t"
#"\233\237/\366\275\365m\253\204\333\246\243"
#"\25rI\3127e\210\37\221\357{Dm\270\25\32\t\357\206\367\346\366\275wn"
#"^\216t\223\216n\211\b\266\252[\337"
#"\252\362\1\t\327c\275Z\317\311\233\222"
#"D\305\317F\275F\302{\241\221\360\256"
#"\370\336\0\315\353A\23\37m\342l\210"
#"\347\337\273|\3136e\5\217\202o\r\231j\343u\335\234\201\357G\275k4\2"
#"\336\23mMxW\\\257\r\257\277\ak$\254\217\275&\307Z\220\253\21\314\242"
#"\336v\206Z]#\226\253t\364J\6\377.\1\177D\260F\300{\243\375\207\377"
#"/PISI\352\304\2563\17es\177!\375GE\274V\334\373\335\320\322\321"
#"\337\2\37\257\37\225\315h\246\17\37"
#"\273\305\366sU6\353\277\266\316\373]\361'2c\336"
#"\247\311\231\316R\0\0\0\0IEND\256B`\202"
) 0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 6 #"define"
0 0 24 3 1 #" "
0 0 14 3 13 #"ROCKET-HEIGHT"
0 0 24 3 2 #" ("
0 0 14 3 12 #"image-height"
0 0 24 3 1 #" "
0 0 14 3 6 #"ROCKET"
0 0 24 3 2 #"))"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 17 3 38 #"; Calculate rocket height from ground."
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 6 #"define"
0 0 24 3 2 #" ("
0 0 14 3 13 #"rocket-height"
0 0 24 3 1 #" "
0 0 14 3 1 #"t"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 6 #" ("
0 0 14 3 1 #"+"
0 0 24 3 2 #" ("
0 0 14 3 3 #"sqr"
0 0 24 3 1 #" "
0 0 14 3 1 #"t"
0 0 24 3 2 #") "
0 0 24 29 1 #"\n"
0 0 24 3 9 #" ("
0 0 14 3 1 #"/"
0 0 24 3 1 #" "
0 0 14 3 13 #"ROCKET-HEIGHT"
0 0 24 3 1 #" "
0 0 21 3 1 #"2"
0 0 24 3 3 #")))"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 17 3 27 #"; Draw the rocket at time t"
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 15 3 6 #"define"
0 0 24 3 2 #" ("
0 0 14 3 11 #"draw-rocket"
0 0 24 3 1 #" "
0 0 14 3 1 #"t"
0 0 24 3 1 #")"
0 0 24 29 1 #"\n"
0 0 24 3 3 #" ("
0 0 14 3 11 #"place-image"
0 0 24 3 1 #" "
0 0 14 3 6 #"ROCKET"
0 0 24 3 1 #" "
0 0 17 3 7 #"; image"
0 0 24 29 1 #"\n"
0 0 24 3 15 #" "
0 0 21 3 3 #"150"
0 0 24 3 4 #" "
0 0 17 3 25 #"; horizontal position (x)"
0 0 24 29 1 #"\n"
0 0 24 3 16 #" ("
0 0 14 3 1 #"-"
0 0 24 3 1 #" "
0 0 21 3 3 #"800"
0 0 24 3 2 #" ("
0 0 14 3 13 #"rocket-height"
0 0 24 3 1 #" "
0 0 14 3 1 #"t"
0 0 24 3 3 #")) "
0 0 17 3 23 #"; vertical position (y)"
0 0 24 29 1 #"\n"
0 0 24 3 16 #" ("
0 0 14 3 11 #"empty-scene"
0 0 24 3 1 #" "
0 0 21 3 3 #"300"
0 0 24 3 1 #" "
0 0 21 3 3 #"800"
0 0 24 3 4 #"))) "
0 0 17 3 12 #"; background"
0 0 24 29 1 #"\n"
0 0 24 29 1 #"\n"
0 0 17 3 43 #"; Generate an animation, using some pieces."
0 0 24 29 1 #"\n"
0 0 24 3 1 #"("
0 0 14 3 8 #"big-bang"
0 0 24 3 1 #" "
0 0 21 3 1 #"0"
0 0 24 3 22 #" "
0 0 17 3 14 #"; initial time"
0 0 24 29 1 #"\n"
0 0 24 3 11 #" ("
0 0 14 3 7 #"to-draw"
0 0 24 3 1 #" "
0 0 14 3 11 #"draw-rocket"
0 0 24 3 3 #") "
0 0 17 3 34 #"; how to draw a frame of animation"
0 0 24 29 1 #"\n"
0 0 24 3 11 #" ("
0 0 14 3 7 #"on-tick"
0 0 24 3 1 #" "
0 0 14 3 4 #"add1"
0 0 24 3 10 #")) "
0 0 17 3 26 #"; how to get the next time"
0 0
| false |
c17a7df1fc73e7cb642df43e0796f9e05743842b | a2ea4dbcc000a056c5a69ef175aec6eafd90226e | /main.rkt | 4ef11358d80f9181d6e23beeacd54810459f0919 | []
| no_license | jarnaldich/entish | fe9b77fe7d0a35c2c9e65d9cd5e02a26703aa364 | bfcd8472c495546bd29bf17ad64265c9e32e3f86 | refs/heads/master | 2021-07-25T15:19:03.551189 | 2021-06-23T09:38:59 | 2021-06-23T09:38:59 | 2,417,601 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 1,115 | rkt | main.rkt | #!/usr/bin/env racket
#lang racket
;;; Params
(define root-path (make-parameter "."))
(define mode (make-parameter 'test))
(define rest-args (make-parameter '()))
(define spec-file (make-parameter "tree.rkt"))
;;; Command-line parsing
;;TODO: Add verbosity
;;TODO: Add
(define extra-args
(command-line
#:program "entish"
#:once-each
[("-r" "--root")
path
"Root Path. Default is current path."
(root-path path)]
[("-f" "--file")
fname
"Tree spec file name (default is tree.rkt)."
(spec-file fname)]
#:once-any
[("-t" "--test")
"Test mode (checks if the spec is met). This is the default."
(mode 'test)]
[("-b" "--build")
"Build mode (creates the directory structure)."
(mode 'build)]
[("-r" "--remove")
"Remove mode. Deletes the directory structure."
(mode 'remove)]
#:args args
(rest-args args)))
;;; MAIN
(parameterize ([current-namespace (make-base-namespace)])
(namespace-require "./entish/macros.rkt")
(namespace-require "./entish/builtins.rkt")
;; Here we could also load user-provided functions...
(load (spec-file)))
| false |
9979181a7e2da6a249d55787f19e10bd735219c4 | 471a04fa9301455c51a890b8936cc60324a51f27 | /srfi-lib/srfi/%3a98.rkt | f4943331183cd539b71aa2f6fa7c1be6e283d365 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"MIT"
]
| permissive | racket/srfi | e79e012fda6d6bba1a9445bcef461930bc27fde8 | 25eb1c0e1ab8a1fa227750aa7f0689a2c531f8c8 | refs/heads/master | 2023-08-16T11:10:38.100847 | 2023-02-16T01:18:44 | 2023-02-16T12:34:27 | 27,413,027 | 10 | 10 | NOASSERTION | 2023-09-14T14:40:51 | 2014-12-02T03:22:45 | HTML | UTF-8 | Racket | false | false | 380 | rkt | %3a98.rkt | #lang scheme/base
(require srfi/98
scheme/mpair)
(provide get-environment-variable
(rename-out (mpair:get-environment-variables
get-environment-variables)))
(define (mpair:get-environment-variables)
(list->mlist (map (lambda (pair)
(mcons (car pair) (cdr pair)))
(get-environment-variables))))
| false |
cf2bde78b587d6424228dc2b36e0dd4f4ae1d116 | ed4bb47c647061cb527a79dc05a0f568bef10a57 | /well-formedness.rkt | 6efa28ea54d25eb28f059d8b9791bc49f88c9378 | []
| no_license | jrslepak/Revised-Remora | dd58cefa4988516dd9613ff912154ee1502db8bb | 0b7b8ad3d757a09536679f515fb30033a3b092ad | refs/heads/master | 2022-04-26T13:01:59.615292 | 2020-04-10T23:00:55 | 2020-04-10T23:01:30 | 95,819,473 | 6 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 2,368 | rkt | well-formedness.rkt | #lang racket
(require redex
"elab-lang.rkt")
(provide kind-atm kind-array
sort-dim sort-shp
sort-compat)
;;;;----------------------------------------------------------------------------
;;;; Type-/index-level well-formedness checks
;;;;----------------------------------------------------------------------------
(define-judgment-form Remora-elab
#:mode (kind-atm I I)
#:contract (kind-atm env type)
[--- kind:Base
(kind-atm _ base-type)]
[(kind-array env arrtype_in) ...
(kind-array env arrtype_out)
--- kind:fn
(kind-atm env (-> [arrtype_in ...] arrtype_out))]
[(kind-array (env-entry ... tvar ...) arrtype)
--- kind:all
(kind-atm (env-entry ...) (∀ [tvar ...] arrtype))]
[(kind-array (env-entry ... ivar ...) arrtype)
--- kind:pi
(kind-atm (env-entry ...) (Π [ivar ...] arrtype))]
[(kind-array (env-entry ... ivar ...) arrtype)
--- kind:sigma
(kind-atm (env-entry ...) (Σ [ivar ...] arrtype))]
[--- kind:atmvar
(kind-atm [_ ... atmvar _ ...] atmvar)]
[--- kind:exatmvar
(kind-atm [_ ... exatmvar _ ...] exatmvar)])
(define-judgment-form Remora-elab
#:mode (kind-array I I)
#:contract (kind-array env type)
[(sort-shp env shp)
(kind-atm env atmtype)
--- kind:Array
(kind-array env (Array atmtype shp))]
[--- kind:arrvar
(kind-array [_ ... arrvar _ ...] arrvar)]
[--- kind:exarrvar
(kind-array [_ ... exarrvar _ ...] exarrvar)])
(define-judgment-form Remora-elab
#:mode (sort-shp I I)
#:contract (sort-shp env idx)
[(sort-dim env dim) ...
--- sort:Shp
(sort-shp env {Shp dim ...})]
[(sort-shp env shp) ...
--- sort:++
(sort-shp env {++ shp ...})]
[--- sort:svar
(sort-shp [_ ... svar _ ...] svar)]
[--- sort:exsvar
(sort-shp [_ ... exsvar _ ...] exsvar)])
(define-judgment-form Remora-elab
#:mode (sort-dim I I)
#:contract (sort-dim env idx)
[(sort-dim env dim) ...
--- sort:+
(sort-dim env {+ dim ...})]
[--- sort:nat
(sort-dim env natural)]
[--- sort:dvar
(sort-dim [_ ... dvar _ ...] dvar)]
[--- sort:exdvar
(sort-dim [_ ... exdvar _ ...] exdvar)])
(define-judgment-form Remora-elab
#:mode (sort-compat I I I)
#:contract (sort-compat env ivar idx)
[(sort-shp env shp)
--- sort:shp
(sort-compat env svar shp)]
[(sort-dim env dim)
--- sort:dim
(sort-compat env dvar dim)])
| false |
bbda2ba57e8ed6e14a25110d7d132bca1a11c3b6 | fc22bffe6fd01f0045ade778d3ea534acb6f9e48 | /chapter02/Exercise 2.72.rkt | 93398dbaf3bccb4d882acecb1970898d7c9e5cd4 | []
| no_license | HuTongsama/sicp | 0cd9eafed8bb03e71b4e005ff4382629fc63894f | ba722200ebc81e6fe2fd6d4c47893f36420c0f2e | refs/heads/master | 2021-07-23T06:05:01.884911 | 2020-05-06T15:26:47 | 2020-05-06T15:26:47 | 159,015,398 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 123 | rkt | Exercise 2.72.rkt | #lang sicp
;search the symbol list at each node: O(n)
;the most deep branch log(n)
;total is between O(n) and o(n * log(n)) | false |
76a8e5b611a0ff61a70431a2c3472f4cbee2d34f | c18764e8a3262420655e066d248c2c31a24f1fa3 | /pt.rkt | 339ec61efba52893a40a5ec75fc901bfb343dac3 | []
| no_license | jpverkamp/chess-puzzles | 31eaf2095c37f4d8d09b0fdae1e4a8d60b5da054 | 8913931091ec42c65fe452a236fa9102e2bc0f14 | refs/heads/master | 2016-09-05T22:47:26.523606 | 2014-09-04T22:39:22 | 2014-09-04T22:39:22 | 23,128,691 | 1 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 430 | rkt | pt.rkt | #lang racket/base
(provide (struct-out pt)
pt+
pt*)
(require racket/match)
; Points, with associated methods; can also be used as offsets
(struct pt (x y) #:transparent)
; Add two points together
(define (pt+ p1 p2)
(match-define (pt x1 y1) p1)
(match-define (pt x2 y2) p2)
(pt (+ x1 x2) (+ y1 y2)))
; Multiply a point by a scalar
(define (pt* s p)
(match-define (pt x y) p)
(pt (* s x) (* s y)))
| false |
06c1a14fe806abb4ecdcd339d4270dba1e2109ba | 2bee16df872240d3c389a9b08fe9a103f97a3a4f | /racket/P150.rkt | 79102eb3cf155beaddaf247dadd78a24380f1f2a | []
| no_license | smrq/project-euler | 3930bd5e9b22f2cd3b802e36d75db52a874bd542 | 402419ae87b7180011466d7443ce22d010cea6d1 | refs/heads/master | 2021-01-16T18:31:42.061121 | 2016-07-29T22:23:05 | 2016-07-29T22:23:05 | 15,920,800 | 1 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 1,555 | rkt | P150.rkt | #lang racket
; (define max-row 6)
; (define cells (vector 15 -14 -7 20 -13 -5 -3 8 23 -26 1 -4 -5 -18 5 -16 31 2 9 28 3))
(define max-row 1000)
(define cells (make-vector (* max-row (add1 max-row) 1/2) #f))
(let loop ([t 0]
[k 0])
(when (< k (vector-length cells))
(let ([t (modulo (+ (* 615949 t)
797807)
(expt 2 20))])
(vector-set! cells k (- t (expt 2 19)))
(loop t (add1 k)))))
(define (rc->i r c)
(+ c (* r (add1 r) 1/2)))
(define (lookup r c)
(let ([i (rc->i r c)])
(if (< i (vector-length cells))
(vector-ref cells i)
(cons 0 null))))
(define (merge self next-a next-b next-shared)
(let ([best-a (car next-a)]
[best-b (car next-b)]
[next-a (cdr next-a)]
[next-b (cdr next-b)]
[next-shared (cdr next-shared)])
(let ([merged
(for/list ([a (cons 0 next-a)]
[b (cons 0 next-b)]
[s (cons 0 (cons 0 next-shared))])
(+ self a b (- s)))])
(values (min best-a best-b (apply min merged))
merged))))
(for* ([r (in-range (sub1 max-row) -1 -1)]
[c (in-range 0 (add1 r))])
(let* ([i (rc->i r c)]
[self (vector-ref cells i)]
[next-a (lookup (add1 r) c)]
[next-b (lookup (add1 r) (add1 c))]
[next-shared (lookup (+ r 2) (add1 c))])
(let-values ([(best merged) (merge self next-a next-b next-shared)])
(vector-set! cells i (cons best merged)))))
(car (vector-ref cells 0))
| false |
06c42becc5800f0fdf53a16299d611e68291a462 | 9683b726ac3766c7ed1203684420ab49612b5c86 | /ts-battle-arena-fortnite-summer-camp/scribblings/manual.scrbl | 09e298aaa6db9c87d1b96355846c79fc6c5ada57 | []
| no_license | thoughtstem/TS-GE-Katas | 3448b0498b230c79fc91e70fdb5513d7c33a3c89 | 0ce7e0c7ed717e01c69770d7699883123002b683 | refs/heads/master | 2020-04-13T21:22:10.248300 | 2020-02-13T18:04:07 | 2020-02-13T18:04:07 | 163,454,352 | 1 | 0 | null | 2020-02-13T18:04:08 | 2018-12-28T22:25:21 | Racket | UTF-8 | Racket | false | false | 900 | scrbl | manual.scrbl | #lang scribble/manual
@(require ts-kata-util/badge-maker/main
"../katas.rkt"
"../rendering.rkt"
(except-in racket read do)
)
@title{Fortnite Summer Camp}
@larger[@larger{Coding for Fortnite Fans}]
@fortnite-badges
@table-of-contents[]
@section{Intro Katas}
@(render code-of-awesomeness-katas)
@(render hello-world-katas)
@section{Avatar Katas}
@(render avatar-katas)
@section{Enemy Katas}
@(render selected-enemy-katas)
@section{Weapon Katas}
@(render selected-weapon-katas)
@section{Power-Up Katas}
@(render powerup-katas)
@section{Tower Katas}
@(render selected-tower-katas)
@;(include-section ts-camp-materials/scribblings/half-day-schedule)
@(include-section ts-camp-materials/scribblings/gameshow-fortnite)
@;(include-section ts-camp-materials/scribblings/game-jam-resources)
@(include-section battlearena-fortnite/scribblings/assets-library) | false |
ae5e0d01c908e5abd985cd10fdfe263527c1d5f3 | d864f3c2881e6839e7944bc939bf86b5ef35fd48 | /core/common.rkt | d3aae51d38aaf59aca7fd925dbf506d0ba473382 | [
"MIT"
]
| permissive | philipcmonk/phlisped | f49fc0a06e5dc4822cf604482c61bd2cecb20e18 | ded1be5d9e7206cd3c71db49ccd250fa4381cf99 | refs/heads/master | 2021-01-10T20:29:36.449644 | 2017-01-27T20:25:13 | 2017-01-27T20:25:13 | 17,927,373 | 30 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 5,730 | rkt | common.rkt | #lang racket
(require sgl sgl/gl)
(require ffi/unsafe ffi/unsafe/define ffi/unsafe/cvector)
(define-ffi-definer define-ftgl (ffi-lib "libftgl"))
(define _FTGLfont (_cpointer 'FTGLfont))
(define _GLuint _uint)
(define-ftgl ftglCreatePixmapFont (_fun _path -> _FTGLfont))
(define-ftgl ftglCreateBitmapFont (_fun _path -> _FTGLfont))
(define-ftgl ftglCreateBufferFont (_fun _path -> _FTGLfont))
(define-ftgl ftglCreateTextureFont (_fun _path -> _FTGLfont))
(define-ftgl ftglCreateOutlineFont (_fun _path -> _FTGLfont))
(define-ftgl ftglCreatePolygonFont (_fun _path -> _FTGLfont))
(define-ftgl ftglCreateExtrudeFont (_fun _path -> _FTGLfont))
(define-ftgl ftglSetFontFaceSize (_fun _FTGLfont _int _int -> _void))
(define-ftgl ftglGetFontLineHeight (_fun _FTGLfont -> _float))
(define-ftgl ftglGetFontAdvance (_fun _FTGLfont _string -> _float))
(define-ftgl ftglRenderFont (_fun _FTGLfont _string _int -> _void))
(define-ftgl ftglDestroyFont (_fun _FTGLfont -> _void))
(define-ffi-definer define-soil (ffi-lib "libsoil"))
(define-soil SOIL_load_OGL_texture (_fun _path _int _uint _uint -> _uint))
(define-soil SOIL_last_result (_fun -> _string))
(provide (all-defined-out))
(define-syntax (with stx)
(let* ((l (syntax->datum stx))
(body (cadr l))
(defs (cddr l))
(lams (map (lambda (def) `(,(car def) (lambda ,(cadr def) ,@(cddr def)))) defs)))
(datum->syntax stx `(letrec ,lams ,@body))))
(struct node (data laddr prom-args text-func) #:transparent)
(struct utterance (node args clr) #:transparent)
(struct cartesian-utterance utterance (x y w h text-w text-h))
(struct whole-tree (n-tree childfunc utterance-tree open selection x y w h v11n offset-x offset-y zoom) #:mutable)
(struct v11n (paint-tree node->v11n-utterance find-utterance wheel))
(define Selected-tree '())
(define (set-selected-tree tree)
(set! Selected-tree tree))
(define Font #f)
(define (set-font f)
(set! Font f))
(define PADDING 5)
(define VERTICAL #f)
(define CELLHEIGHT 25)
(define SCROLLDIST 100)
(define node-args (compose force node-prom-args))
(define (node-width n tree)
(if VERTICAL (box-width ((node-text-func n) (node-data n))) (node-maj-dim n tree)))
(define (node-height n tree)
(if VERTICAL (node-maj-dim n tree) CELLHEIGHT))
(define (node-maj-dim n tree)
(if (closed? n tree)
(box-maj-dim ((node-text-func n) (node-data n)))
(max
(box-maj-dim ((node-text-func n) (node-data n)))
(foldl
+
0
(map (lambda (arg) (node-maj-dim arg tree)) (node-args n))))))
(define (whole-tree-selection-u tree)
(find-utterance-from-laddr-safe (whole-tree-utterance-tree tree) (whole-tree-selection tree)))
(define (find-utterance-from-laddr-safe tree laddr)
(if (null? laddr)
tree
(if (> (length (utterance-args tree)) (car laddr))
(find-utterance-from-laddr-safe (list-ref (utterance-args tree) (car laddr)) (cdr laddr))
#f)))
(define (draw-rectangle clr x y w h)
(gl-color (/ (car clr) 255) (/ (cadr clr) 255) (/ (caddr clr) 255))
(gl-begin 'quads)
(gl-vertex x (- y) -1.01)
(gl-vertex (+ x w) (- y) -1.01)
(gl-vertex (+ x w) (- (+ y h)) -1.01)
(gl-vertex x (- (+ y h)) -1.01)
(gl-end))
(define (draw-text text x y clr (rot 0))
(gl-color (/ (car clr) 255) (/ (cadr clr) 255) (/ (caddr clr) 255))
(gl-push-matrix)
(gl-translate x (- y) -1.01)
(gl-rotate rot 0 0 -1.1)
(ftglRenderFont Font text 65535)
(gl-pop-matrix))
(define (whole-tree-dim tree)
(list (whole-tree-x tree) (whole-tree-y tree) (whole-tree-w tree) (whole-tree-h tree)))
(define (box-width box)
(+ PADDING (ftglGetFontAdvance Font box)))
(define (box-height box)
(ftglGetFontLineHeight Font))
(define (box-maj-dim box)
(if VERTICAL (box-height box) (box-width box)))
(define (open? n tree) (set-member? (whole-tree-open tree) (node-laddr n)))
(define closed? (negate open?))
(define get-color (lambda (a94 a95) (letrec ((v432 0.6180339887498949) (v354 (lambda (a359 a364) (letrec ((v358 a359)) (- v358 (letrec ((v363 a364)) (* v363 (truncate (/ v358 v363)))))))) (v206 (lambda (a222 a229 a230) (letrec ((v221 a222) (v223 (letrec ((v227 a230) (v228 a229)) (* v227 v228))) (v231 (* v223 (- 1 (abs (- (v354 (* v221 6) 2) 1)))))) (cond ((< v221 (/ 1 6)) (list v223 v231 0)) ((< v221 (/ 2 6)) (list v231 v223 0)) ((< v221 (/ 3 6)) (list 0 v223 v231)) ((< v221 (/ 4 6)) (list 0 v231 v223)) ((< v221 (/ 5 6)) (list v231 0 v223)) ((< v221 (/ 6 6)) (list v223 0 v231)))))) (v35 a95) (v26 a94) (v96 (cons (quote (0 0 0)) (map (curry * 255) (v206 0.15 1.0 1.0))))) (if (equal? (node-laddr v26) (whole-tree-selection v35)) v96 (letrec ((v110 (cons (quote (0 0 0)) (map (curry * 255) (v206 0.15 0.9 0.9))))) (if (equal? (car (node-data v26)) (car (node-data (utterance-node (whole-tree-selection-u v35))))) v110 (letrec ((v450 (lambda () (v354 (* (letrec ((v452 (lambda (a462) (letrec ((v461 a462)) (if (null? v461) 0 (last v461)))))) (v452 (node-laddr v26))) v432) 1))) (v85 (if (null? (node-laddr v26)) 0 (last (node-laddr v26)))) (v188 (cons (quote (255 255 255)) (quote (80 0 0)))) (v373 (cons (quote (255 255 255)) (map (curry * 255) (v206 (v450) 0.8 0.8)))) (v405 (cons (quote (255 255 255)) (map (curry * 255) (v206 (v450) 0.6 0.8))))) (if (odd? (length (node-laddr v26))) v373 v405))))))))
(define (maj-dim x y) (if VERTICAL y x))
(define (min-dim x y) (if VERTICAL x y))
(define (center offset lenwhole lenpiece start width)
(let ((visible-width (- (min (+ offset lenwhole) (+ start width)) (max offset start))))
(if (< visible-width lenpiece)
(if (< offset start)
(- (+ offset lenwhole) lenpiece)
offset)
(+ (max offset start) (/ visible-width 2) (- (/ lenpiece 2))))))
(define (replace t1 t2s es)
(append (takef es (negate (curry equal? t1))) t2s (cdr (member t1 es))))
| true |
baf73808404d11829af6199d14678ab79ac7cf14 | e597d3a9ae6141d14b1131e7491d9fea877af17a | /grammar.rkt | 55a00938905270815babad92f5a99e727fa9577d | [
"ISC"
]
| permissive | LiberalArtist/riposte | 9b47dad1cba74c500dcdde657ca850ac156a4516 | 8ae941f082a051bba0aa23c1cab009a76e2b495b | refs/heads/master | 2020-07-06T13:32:10.681235 | 2019-07-28T12:08:26 | 2019-07-28T12:08:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 4,874 | rkt | grammar.rkt | #lang brag
riposte-program : (program-step | import)*
program-step: assignment
| echo
| command
| exec
| assertion
| unset
import: /"import" FILENAME
uri-template: ( URI-TEMPLATE-LITERAL | uri-template-expression ) +
uri-template-expression: /"{" [ uri-template-operator ] uri-template-variable-list /"}"
uri-template-operator: "+" | "#" | "." | "/" | ";" | "?" | "&" | "=" | "," | "!" | "@" | "|"
uri-template-variable-list: uri-template-varspec ( /"," uri-template-varspec ) *
uri-template-varspec: IDENTIFIER [ uri-template-variable-modifier ]
uri-template-variable-modifier: uri-template-variable-modifier-prefix | "*"
uri-template-variable-modifier-prefix: ":" NUMBER
digit: ZERO | ONE | NON-ZERO-NON-ONE-DIGIT
exec: EXEC URI
echo: /"echo" [ json-pointer | normal-identifier | head-id ]
unset: /"unset" HEADER-IDENTIFIER
assertion : equality | disequality | inequality | predication
equality : expression /"=" expression
disequality : expression /"!=" expression
inequality : expression ("<" | ">") expression
@predication : has-type
| adjective-applies
| has-property
| has-length
| has-element-count
| header-presence
| jp-existence
has-type: expression "is" [ "not" ] json-type
adjective-applies: expression "is" (sequence-adjective | arithmetical-adjective | object-adjective )
has-element-count: expression "has"
"at" [ "least" | "most" ]
expression
( "properties" | "elements" | "characters" )
has-length: expression "has" "length" expression
has-property: expression ("has" | "does" "not" "have") "property" expression
jp-existence: JSON-POINTER
("exists" | ("does" "not" "exist"))
[ "relative" "to" (normal-identifier | HEADER-IDENTIFIER) ]
[ "and" "is" [ "non" ] "empty" ]
header-presence: HEADER-REF "is" ("absent" | "present")
json-type : "boolean" | json-number-type | "null" | json-sequence-type | json-object-type
json-sequence-type: [ sequence-adjective ] ( "string" | "array" )
json-number-type: [ arithmetical-adjective ] ( "number" | "integer" | "float" )
json-object-type: [ object-adjective ] "object"
object-adjective: [ "non" ] "empty"
arithmetical-adjective: [ "non" ] ( "positive" | "negative" )
sequence-adjective: [ "non" ] "empty"
@assignment : normal-assignment | parameter-assignment | header-assignment
normal-assignment: IDENTIFIER /":=" expression [ "(" json-type ")" ]
parameter-assignment: PARAMETER /":=" (uri-template | expression)
header-assignment: REQUEST-HEADER-IDENTIFIER /":=" expression
command:
HTTP-METHOD [ (id | json-expression) /"to" ] uri-template [ with-headers ] [ emptiness | satisfies | responds-with ]
| HTTP-METHOD ( id | json-expression ) /"to" uri-template [ with-headers ] [ emptiness | satisfies | responds-with ]
| HTTP-METHOD [ (id | json-expression) /"to" ] uri-template [ with-headers ] (responds-with | satisfies) [ /"and" emptiness ]
| HTTP-METHOD [ (id | json-expression) /"to" ] uri-template [ with-headers ] responds-with /"and" (satisfies | emptiness)
| HTTP-METHOD [ (id | json-expression) /"to" ] uri-template [ with-headers ] responds-with /"and" satisfies /"and" emptiness
with-headers: "with" "headers" ( normal-identifier | json-object )
@satisfies: positive-satisfies | negative-satisfies
positive-satisfies: /"satisfies" /"schema" schema-ref
negative-satisfies: /"does" /"not" /"satisfy" /"schema" schema-ref
emptiness: "is" [ "non" ] "empty"
responds-with: /"responds" /"with" HTTP-STATUS-CODE
schema-ref: id
| "at" uri-template
| "in" FILENAME
expression: json-pointer
| json-expression
| id
| head-id
| expression "*" expression
| expression "+" expression
| ( "length" "(" expression ")" )
json-pointer: JSON-POINTER | (JSON-POINTER "relative" "to" normal-identifier)
reference-token: escaped-token | unescaped-token
escaped-token: TILDE (ZERO | ONE)
unescaped-token: (letter | UNDERSCORE | digit) *
@letter: UPPERCASE-LETTER | LOWERCASE-LETTER
@json-expression: json-boolean | NUMBER | json-null | json-array | json-object | JSON-STRING
json-boolean : "true" | "false"
json-float : json-integer+ "." json-integer+
json-integer : digit +
json-null : "null"
json-array : /"[" [ json-array-item (/"," json-array-item)* ] /"]"
json-array-item : json-expression | normal-identifier
json-object: /"{" [ json-object-item (/"," json-object-item)* ] /"}"
json-object-item: JSON-STRING /":" (json-expression | normal-identifier | env-identifier)
@id: normal-identifier | env-identifier | parameter-identifier | head-id
normal-identifier: IDENTIFIER
env-identifier: ENV-IDENTIFIER
| (ENV-IDENTIFIER /"with" /"fallback" json-expression)
@head-id: request-head-id | response-head-id
request-head-id: REQUEST-HEADER-IDENTIFIER
response-head-id: RESPONSE-HEADER-IDENTIFIER
parameter-identifier: PARAMETER-IDENTIFIER
riposte-repl: normal-identifier | command | assignment
| false |
3b23261caf1cdb4e5d72208d4b2334dfcfc7e063 | e4d80c9d469c9ca9ea464a4ad213585a578d42bc | /courses/bs1/units/unit1/the-unit.scrbl | 5e08c75ae2993020ab43eb63b759fada080214c6 | []
| no_license | garciazz/curr | 0244b95086b0a34d78f720e9cae1cb0fdb686ec5 | 589a93c4a43967b06d7a6ab9d476b470366f9323 | refs/heads/master | 2021-01-17T19:14:21.756115 | 2016-02-24T22:16:26 | 2016-02-24T22:16:26 | 53,657,555 | 1 | 0 | null | 2016-03-11T09:58:01 | 2016-03-11T09:58:01 | null | UTF-8 | Racket | false | false | 53,410 | scrbl | the-unit.scrbl | #lang curr/lib
@title{Unidade 1: Games e Coordenadas}
@declare-tags[management]
@unit-overview/auto[#:lang-table (list (list "" @code{}))]{
@unit-descr{Os alunos discutem os componentes de seus jogos favoritos, e descobrem que eles podem ser reduzidos a uma série de coordenadas. Eles, então, exploram as coordenadas no plano cartesiano, e identificam as coordenadas para os personagens em um jogo em vários pontos no tempo. Uma vez que eles estiverem confortáveis com coordenadas, eles poderão ter idéias para seus próprios jogos e criar lista de amostras de coordenadas para diferentes pontos no tempo.}
}
@unit-lessons{
@lesson/studteach[
#:title "Introdução"
#:duration "5 minutos"
#:overview ""
#:learning-objectives @itemlist[]
#:evidence-statements @itemlist[]
#:product-outcomes @itemlist[]
#:standards (list)
#:materials @itemlist[]
#:preparation @itemlist[@item{OPTIONAL: Hand out @(hyperlink "https://docs.google.com/document/d/1USFPXkeO5AbGOzm_U0tMv4NV3RrxTMTyg-bqIKUf4q4/edit?usp=sharing" "Warmup activity sheet").}]
#:pacings (list
@pacing[#:type "remediation"]{@itemlist[@item{}]}
@pacing[#:type "misconception"]{@itemlist[@item{}]}
@pacing[#:type "challenge"]{@itemlist[@item{}]}
)
]{
@points[
@point{@student{Bem vindo ao Bootstrap! Neste curso, você vai aprender uma nova linguagem de programação – uma maneira simples de dizer ao computador exatamente o que você quer que ele faça. Assim como inglês, espanhol ou francês, uma linguagem de programação tem seu próprio vocabulário e gramática que você terá que aprender. Felizmente, a linguagem que você vai usar aqui tem muito em comum com a matemática simples que você já sabe!}
@teacher{@management{Crie expectativas e regras para a aula.}
Faça uma conexão entre o material de estudo com as coisas que os alunos já sabem:
@itemlist[@item{What makes a language? Do some students already speak more than one language?}
@item{Programming is very much a language, with its own syntax, semantics, etc}
@item{Ask students about their favorite videogames. Be open about the scale of a modern game: they cost millions of dollars, are built by huge teams of programmers and artists, and are developed over years.}
@item{Set expectations about what can be accomplished in a single, introductory programming class.}]}
}
]
}
@lesson/studteach[
#:title "Analisando uma Demonstração"
#:duration "10 minutos"
#:overview "Jogar um jogo simples, então deixe de lado por um tempo e tente descobrir o que está acontecendo no computador."
#:learning-objectives @itemlist[@item{Model a simple videogame}]
#:evidence-statements @itemlist[@item{Students will be able to identify the elements of a game and how each one changes during gameplay}]
#:product-outcomes @itemlist[@item{Nas apostilas, os alunos criam um modelo de dados que descreve um videogame simples.}]
#:standards (list "BS-M")
#:materials @itemlist[@item{Editing environment (WeScheme or DrRacket with the bootstrap-teachpack installed)}]
#:preparation @itemlist[@item{Computer for each student (or pair), running WeScheme or DrRacket}
@item{If using DrRacket, make sure the Ninja.rkt file is loaded}
@item{"NinjaCat" [NinjaCat.rkt from @resource-link[#:path "source-files.zip" #:label "source-files.zip"] | @(hyperlink "http://www.wescheme.org/view?publicId=LyMwExWayT" "WeScheme")] preloaded on students' machines}
@item{Student @resource-link[#:path "workbook/StudentWorkbook.pdf" #:label "workbook"] folders with names on covers, and something to write with}]
#:pacings (list
@pacing[#:type "remediation"]{@itemlist[@item{}]}
@pacing[#:type "misconception"]{@itemlist[@item{}]}
@pacing[#:type "challenge"]{@itemlist[@item{}]}
)
]{
@points[
@point{@student{Vamos começar a explorar um jogo simples, e, em seguida, descobrir como ele funciona. Abra @run-link[#:public-id "LyMwExWayT" "este link"] para jogar o jogo, e passe um ou dois minutos explorando-o. @italic{Você pode usar as teclas de setas para mover o gato para a esquerda, direita e saltar – tentar pegar o rubi e evitar o cão!.}}
@teacher{[@(hyperlink "https://www.youtube.com/watch?v=KSt_3ovWfjk" "Video")] Mostrar o Gato Ninja para as crianças, either letting them play or by demoing it in front of the class. You can move the cat up, down, left and right by using the arrow keys.
Play until the students see all the characters (the clouds, the ruby, the dog and the cat), and be
sure to point out the title and score as well.}
}
@point{@student{Este jogo é composto por personagens, cada qual com seu próprio comportamento. O rubi se move da direita para a esquerda, como faz o cão. O Gato Ninja só se move quando você usar as teclas de setas para ele se movimentar. Descobriremos como funciona o jogo após entendermos como funciona cada personagem.}
@teacher{}
}
@point{@student{@activity[#:forevidence (list "BS-M&1&1")]{@bitmap{images/game-table1.png} Turn to @worksheet-link[#:name "NinjaCat-Dissection"] in your workbook. Here we have a table, which we'll use to reverse-engineer NinjaCat and see how it works. Fill out the first column with a complete list of all things in the game.}
}
@teacher{This can be a team activity. Solicit a few examples from students, to make sure they understand what's being listed here: nouns like "the cat", not verbs like "jumping". @management{During this activity, walk around and see how groups are doing. This is the time to encourage expectations of community and respect - call out good teamwork when you see it! When time is up, give them a countdown: "30...10... 5... 4... 3... 2... 1... PENCILS DOWN, EYES UP HERE!" Wait for total silence and complete attention. }}
}
@point{@student{Did you list all four moving characters? What else is in the game? Is the background a part of the game? The score?}
@teacher{@management{Have students come up to the board, and fill in the table with what they've found. If time is short, call on students and have them tell you what to write.}}
}
@point{@student{@activity{@bitmap{images/game-table2.png}We also need to think about what is @italic{changing} when we play the game. What about the Ruby? Does it get bigger? Does it change color? Does it spin around? The only thing that changes about the Ruby is its @italic{position}! Everything else about it is the same. What about the Dog? The Cat? Fill in the rest of the second column, listing everything that changes about each character.}}
@teacher{}
}
@point{@student{Did you notice that the Dog, Ruby, Cloud and Cat only change position, and nothing else? What about the Background - it doesn't change at all, so we can @italic{leave that cell in table blank!} Did you notice the Score changes value? You'll want to add that to your table, too!}
@teacher{@management{Quickly fill in the second column on the board. Assign scores.}}
}
]}
@lesson/studteach[
#:title "Coordinate Planes"
#:duration "15 minutes"
#:overview "Students must use the Cartesian plane to describe the location of characters in a picture."
#:learning-objectives @itemlist[@item{Understand the use of number lines in defining locations via coordinates}]
#:evidence-statements @itemlist[@item{Students apply the number line as a tool for objectively defining location, first identifying how to apply it to
describe the position of a character onscreen in one dimension. This understanding is extended to two dimensions,
ultimately motivating the use of a coordinate grid.}]
#:product-outcomes @itemlist[@item{Os alunos identificam as coordenadas dos personagens na imagem}]
#:standards (list "6.NS.5-8" "N-Q" "5.G.1-2")
#:materials @itemlist[@item{Cutouts of @resource-link[#:path "images/ninjacat.png" #:label "NinjaCat"], @resource-link[#:path "images/dog.png" #:label "Dog"]
and the @resource-link[#:path "images/ruby.png" #:label "Ruby"]}
@item{Student Workbooks, and something to write with}]
#:preparation @itemlist[@item{Student Workbooks, and something to write with}]
#:prerequisites (list "Dissecting a Demo")
#:pacings (list
@pacing[#:type "remediation"]{@itemlist[@item{}]}
@pacing[#:type "misconception"]{@itemlist[@item{}]}
@pacing[#:type "challenge"]{@itemlist[@item{Are there locations that can be described using one coordinate system, that cannot be described
using another? Can any valid coordinate system can be perfectly mapped to any other valid
coordinate system?}]}
)
]{
@points[
@point{@student{@bitmap{images/number-line.png}Computers use numbers to represent a character's position onscreen, using number lines as rulers to measure
the distance from the bottom-left corner of the screen. For our videogame, we will place the numberline so that the screen runs from 0
(on the left) to 640 (on the right). We can take the image of the Dog, stick it anywhere on the line, and measure the distance back to
the lefthand edge. Anyone else who knows about our number line will be able to duplicate the exact position of the Dog, knowing only
the number. What is the coordinate of the Dog on the righthand side of the screen? The center? What coordinate would place the Dog beyond
the lefthand edge of the screen?}
@teacher{The key point for students here is @italic{precision} and @italic{objectivity}. There are many possible correct answers, but students
should understand why any solution should be accurate and unambiguous. This requires students to propose solutions that share a common
"zero" (the starting point of their number line) and direction (literally, the direction from which a character's position is measured).
@management{Have students discuss this. If time allows, have a student leave the room and let other students come up with ways to write
down where the dog is on the board. Then remove the dog, call in the other student, and have the class direct them using
only what they've written down.Try positioning the characters at different places on the line, and have students tell you
what their coordinates are. Try giving them verbal descriptions (e.g. "The center of the screen", "Off the righthand
side of the screen", etc.) and have them translate those into coordinates.}}
}
@point{@student{@bitmap{images/cat-coordinates.png}By adding a second number line, we can locate a character anywhere on the screen in either
dimension. The first line is called the x-axis, which runs from left to right. The second line, which runs up and down, is
called the y-axis. A 2-dimensional @italic{coordinate} consists of both the x- and y-locations on the axes. Suppose we wanted
to locate NinjaCat's position on the screen. We can find the x-coordinate by dropping a line down from NinjaCat and read
the position on the number line. The y-coordinate is found by running a line to the y-axis.}
@teacher{A coordinate represents a single point, and an image is (by definition) many points. Some students will ask whether a
character's coordinate refers to the center of the image, or one of the corners. In this particular program, the center
serves as the coordinate - but other programs may use another location. The important point in discussion with students
is that there is flexibility here, @italic{as long as the convention is used consistently}. @management{If time allows,
invite volunteers up to the board to try placing NinjaCat and the Ruby at different locations. Have students identify the
coordinates at the corners of the screen. For additional practice, have students bisect each side of the screen and label
the midpoints.}}
}
@point{@student{When we write down these coordinates, we always put the x before the y (just like in the alphabet!). Most of the time,
you'll see coordinates written like this: (200, 50) meaning that the x-coordinate is 200 and the y-coordinate is 50.}
@teacher{}
}
@point{@student{Depending on how a character moves, their position might change only along the x-axis, only along the y-axis, or both. Look
back to the table you wrote in the workbook (@worksheet-link[#:name "NinjaCat-Dissection"]).
Can NinjaCat move up and down in the game? Can she move left and right? So what's changing: her x-coordinate, her y-coordinate,
or both? What about the clouds? Do they move up and down? Left and right? Both?}
@teacher{}
}
@point{@student{@activity[#:forevidence (list "N-Q&1&4" "5.G.1-2&1&1" "5.G.1-2&1&2")]{
@bitmap{images/game-table3.png}Fill in the rest of the table, identifying what is changing for each of your characters.}
}
@teacher{}
}
@point{@student{@activity[#:forevidence (list "6.NS.5-8&1&2")]{Turn to @worksheet-link[#:name "NinjaCat-Coordinates"] in your game-planning workbook, and look at the
project sheet that has a picture of the NinjaCat game. What are the coordinates at the bottom-left corner
of the screen? Top-right? Center? For practice, label the coordinates at the midpoint of @italic{each side}
of the screen, then label the coordinates of each of the characters.}}
@teacher{}
}]
}
@lesson/studteach[
#:title "Brainstorming"
#:duration "15 minutes"
#:overview "Students select the theme and characters for their videogame"
#:learning-objectives @itemlist[]
#:evidence-statements @itemlist[]
#:product-outcomes @itemlist[@item{Os alunos completam a planilha de design do videogame, para projetar seu próprio jogo}]
#:standards (list)
#:materials @itemlist[@item{}]
#:preparation @itemlist[@item{Computer for each student (or pair), running WeScheme or DrRacket}
@item{If using DrRacket, make sure the Ninja.rkt file is loaded}
@item{Student Workbooks, and something to write with}]
#:pacings (list
@pacing[#:type "remediation"]{@itemlist[@item{}]}
@pacing[#:type "misconception"]{@itemlist[@item{}]}
@pacing[#:type "challenge"]{@itemlist[@item{}]}
)
]{
@points[
@point{@student{On @worksheet-link[#:name "Game-Design"], you'll find a planning template for you to make your own game.
Just like we made a list of everything in the NinjaCat game, we're going to start with a list of everything in your game.}
@teacher{@management{Put your names at the top of this page.}}
}
@point{@student{To start, your game will have with four things in it:
@itemlist[
@item{A Background, such as a forest, a city, space, etc.}
@item{A Player, who can move when the user hits a key.}
@item{A Target, which flies from the right to the left, and gives the player points for hitting it.}
@item{A Danger, which flies from the right to the left, which the player must avoid.}]}
@teacher{Have students walk through some sample themes, to make sure they understand the format of the game. For example: A football
game might have a quarterback for the player, a rival player for the danger, and a football as the target. A jungle game
might have a monkey as the player, a snake as the danger, and bananas as the target.}
}
@point{@student{@activity{Now it's time to get creative! Fill out @worksheet-link[#:name "Game-Design"] in your
workbook for @italic{your} game, using your own player, target and danger.}}
@teacher{@management{Be sure to consult with every team. A lot of students will have trouble fitting their ideas into this
format, or they'll struggle with coordinates. Be clear about what can and cannot be done! (e.g. - no
3d games, joysticks, multiplayer games, etc. Hint: students who have a well-worded description of their
images will be happier with any images you could find them. Try searching for "Person" versus "Jogger",
for example.}}
}
]}
@lesson/studteach[
#:title "Order of Operations"
#:duration "20 minutes"
#:overview "Students identify the order of operations for complicated arithmetic expressions through diagramming (circles) and
evaluating (the numerical answer). This lesson introduces students to the Circle of Evaluation, which is a sentence
diagramming tool for arithmetic expressions. This is a powerful way to understand Order of Operations, as it forces
students to focus on the structure of expressions over their computed result."
#:learning-objectives @itemlist[@item{Understand the structure of arithmetic expressions}
@item{Understand order of operations in an expression}
@item{Write expressions as Circles of Evaluation}
@item{Translate between Circle of Evaluation and arithmetic expressions}
]
#:evidence-statements @itemlist[@item{Students will be able to explain why arithemetic expressions require structure}
@item{Students will be able to identify the order of operations in an expression that includes
adding, subtracting, multiplying and dividing}
@item{Given a Circle of Evaluation, students will be able translate the expression into the
arithmetic expression it represents}
@item{Given an arithmetic expression, students will be able to complete a partially-finished Circle
of Evaluation for the same expression}
@item{Given a bank of Circles of Evaluation and arithmetic expressions, students will be able to match them}
@item{Students will be able to translate the structure of an arithmetic expression into a Circle of
Evaluation}
]
#:product-outcomes @itemlist[@item{Os alunos convertem várias expressões aritméticas entre várias representações.}]
#:standards (list "A-SSE.1-2" "BS-CE" "5.OA.1-2")
#:exercises (list (make-exercise-locator "Order-of-Operations" "complete-coe-from-arith")
(make-exercise-locator "Order-of-Operations" "arith-to-coe1")
(make-exercise-locator "Order-of-Operations" "coe-to-arith1")
(make-exercise-locator "Order-of-Operations" "match-arith-coe1"))
#:materials @itemlist[@item{Editing environment (WeScheme or DrRacket with the bootstrap-teachpack installed)}]
#:preparation @itemlist[@item{Computer for each student (or pair), running WeScheme or DrRacket}
@item{If using DrRacket, make sure the Ninja.rkt file is loaded}
@item{Student Workbooks, and something to write with}]
#:pacings (list
@pacing[#:type "remediation"]{@itemlist[@item{Have students practice translating very simple (one-operation) expressions into
simple (one-circle) Circles of Evaluation. By choosing the numbers in these
examples carefully, you can gradually introduce nesting by replacing a number
in one expression with the Circle of Evaluation for another expression that
evaluates to the same number. @italic{Replace the 7 in @code{7+5} with the
Circle for @code{10-3}.}}]}
@pacing[#:type "misconception"]{@itemlist[@item{This is the first opportunity to expose students to core vocabulary words,
so be sure to use words like @bold{function}, @bold{value} and @bold{expression}
carefully and consistently. Ask students to identify the parts of a Circle of
Evaluation, and push them to use the vocabulary as well.}]}
@pacing[#:type "challenge"]{@itemlist[@item{}]}
)
]{
@points[
@point{@student{Math is a language, just like English, Spanish, or any other language. We use nouns, like "bread", "tomato",
"mustard" and "cheese" to describe physical objects. Math has @vocab{values}, like the numbers @math{1},
@math{2} or @math{3}, to describe quantities. Humans also use verbs like "toast", "slice", "spread" and "melt"
to describe operations on these nouns. Mathematics has @vocab{functions} like addition and subtraction, which
are operations performed on numbers. Just as you can "slice piece of bread", a person can also "add four and five".}
@teacher{Students should begin to look at math as a @italic{language}. To help them with this, you can discuss syntax
and grammar of math, and its potential for ambiguity in the absence of a fixed order of operations. Help
students see that math is a way to communicate calculations among people.}
}
@point{@student{A @vocab{mathematical expression} is like a sentence: it's an instruction for doing something. The
expression @math{4+5} tells us to add 4 and 5. To @vocab{evaluate} an expression, we follow the instructions
in the expression. The expression @math{4+5} @vocab{evaluates to} @math{9}.
@activity{What does @math{8*4} evaluate to? What does @math{20-16} evaluate to? What does @math{16-20} evaluate to?}}
@teacher{}}
@point{@student{Sometimes, we need multiple expressions to accomplish a task. If you were to write instructions for making
a sandwich, it would matter very much which came first: melting the cheese, slicing the bread, spreading the
mustard, etc. The order of functions matters in mathematics, too. If someone says "four plus two minus one",
they could mean several things:
@itemlist[@item{Add four and two, then subtract one: @math{(4+2) - 1}}
@item{Add four to the result of subtracting one from two: @math{4 + (2-1)}}]
@activity{Write an expression of your own that can mean several things.}}
@teacher{}
}
@point{@student{Depending on which way you read the expression, you might have very different results! This is a problem,
because we often use math to share calculations between people. For example, you and your cell phone company
should agree upfront on how much you will pay for sending text messages and making calls. Different results
might mean that your bill looks wrong. We avoid problems by agreeing on the order in which to use the
different operations in an expression. There are two ways to do this:
@itemlist[#:style 'ordered
@item{We can all agree on an order to use}
@item{We can add detail to expressions that indicate the order}]
@activity{Write down one reason why it is important to have rules about the order of operations.}}
@teacher{}}
@point{@student{@bitmap{images/PEMDASTriangle.png} Mathematicians didn't always agree on the order of operations, but now
we have a common set of rules for how to evaluate expressions. The pyramid on the right summarizes the
order. When evaluating an expression, we begin by applying the operations written at the top of the
pyramid (multiplication and division). Only after we have completed all of those operations can we
move down to the lower level. If both operations are present (as in @math{4+2-1}), we read the expression
from left to right, @vocab{apply}ing the operations in the order in which they appear.
@activity[#:forevidence (list "A-SSE.1-2&1&3" "5.OA.1-2&1&2")]{In what order should we apply the functions in the following example?
@math{19 \div 2 * 11 - 7 + 8}
@itemlist[#:style 'ordered
@item{@math{+ \div * - }}
@item{@math{\div * - +}}
@item{@math{\div * + -}}
@item{@math{* \div + -}}]
}}
@teacher{This item covers PEMDAS (order of operations in ambiguous expressions). You can skip this item if you
do not need to cover PEMDAS.}
}
@point{@student{@bitmap{images/FixedCircle.png} One way to indicate the order of operations in an expression is to first
draw the expression as a diagram. This diagram is called a @vocab{Circle of Evaluation}. Here you can
see an example of a Circle of Evaluation, for the math expression @math{4-5}. Circles of Evaluation
show the structure that's going on inside an expression. All Circles of Evaluation have two rules:
@bannerline{Circle Rule 1: Each circle must have one function, which goes at the top of the circle.}
@bannerline{Circle Rule 2: The numbers are written below, in order from left to right.}
@activity[#:forevidence "BS-CE&1&1"]{@bitmap{images/CircleBug.png}Which rule does this Circle of Evaluation break?}
}
@teacher{[@(hyperlink "https://www.youtube.com/watch?v=AMFaPKHp3Mg" "Video")] This section benefits enormously from visual aids, diagrams, etc. Make sure you have plenty of board space to
draw examples!}
}
@point{@student{@activity[#:forevidence (list "BS-CE&1&1" "5.OA.1-2&1&1")]{Try drawing the Circle of Evaluation for each of the following
expressions:
@itemlist[#:style 'ordered
@item{@math{6*4}}
@item{@math{7-10}}
@item{@math{5 + 8}}
@item{@math{\frac{351}{-1} }}]
}
@bitmap{images/FixedCircle.png} Every Circle of Evaluation @vocab{evaluates to} the result of its
corresponding expression. For example, the circle on the right evaluates to @math{-1}, because
the circle says to use subtraction (the function at the top) on the numbers in order (@math{4-5}).}
@teacher{It's important for students to view the Circles of Evaluation as "just another way of writing arithemetic".
Have students discuss whether associativity and commutativity still matter here (they do).}
}
@point{@student{@bitmap{images/Nesting.png}To use multiple functions in the same expression, we can combine Circles
of Evaluation. Look at the Circle of Evaluation you've written for @math{351 / -1}. We already
know that the Circle for @math{4 - 5} will evaluate to @math{-1}, so we can @italic{replace the
number with the expression.} Does this change what the expression evaluates to?
@activity[#:forevidence (list "BS-CE&1&2" "5.OA.1-2&1&1")]{
@bitmap{images/fill-in-circle.png}Finish writing the Circle of
Evaluation shown here, so that it represents @math{(23 + 7) * (13 - 5)}}
}
@teacher{From this point forward, the Circles of Evaluation are your assessment tool for Order of Operations.
Quizzing students by asking them to correctly evaluate an expression is fraught with false negatives,
as many student might get the order right but may still have problems with basic calculations. This
method is also vulnerable to Commutativity, since a student will correctly evaluate @math{1*2+2}
even if they get the order of operations wrong! Circles of Evaluation have neither of these flaws,
as they put the emphasis where it should be: exercising a student's ability to see the structure
inside the arithemetic.}
}
@point{@student{@bitmap{images/NestedCircle.png}What does this Circle of Evaluation evaluate to? Let's review how
we evaluate a Circle:
@itemlist[@item{We know we are multiplying because that's the function at the top of the Circle.}
@item{The Number @math{6} is the first number in the multiplication, because it's on
the left-hand side.}
@item{The second number in the multiplication is on the right-hand side. The right-hand
side has a separate circle, so we need to @vocab{evaluate} the number for that
circle. The second number is therefore @italic{the result of adding 4 and 5}.}
@item{@math{4 + 5} (the inner circle) evaluates to @math{9}, and @math{6 * 9} (the outer
circle) evaluates to @math{54}. This circle evaluates to @math{54}.}]
@activity[#:forevidence (list "BS-CE&1&3" "A-SSE.1-2&1&3" "5.OA.1-2&1&1")]{
@bitmap{images/NestedCircle2.png}Convert this Circle of Evaluation into an arithmetic expression.}
}
@teacher{Work through several of these examples with students, asking them to come up with arithmetic
expressions and then convert them into Circles, or giving them Circles and having them
translate them back into arithmetic. When you talk about Circles, be sure to consistently use
the term @italic{function} for what's on top, rather than similar terms like "operation", "symbol",
"procedure", "name", etc. The Circles of Evaluation will help students see the similarity between
arithmetic functions (like @math{+}) and algebraic functions (like @math{f}) if you use
terminology carefully.}
}
@point{@student{@activity[#:forevidence (list "BS-CE&1&3" "A-SSE.1-2&1&3" "5.OA.1-2&1&1")]{
Match the following Circles of Evaluation with the corresponding arithmetic expressions:
@(circeval-matching-exercise/math
(list (math "9 * (4 - 3)")
(math "(9 * 4) - 3")
(math "(9 - 3) * 4")
(math "(2 + 4) / (6 - 3)")
(math "-5 * 2"))
(list "(/ (+ 2 4) (- 6 3))"
"(- (* 9 4) 3)"
"(* -5 2)"
"(* 9 (- 4 3))"
"(* (- 9 3) 4)"))}
}
@teacher{}
}
]
}
@lesson/studteach[
#:title "Intro to Programming"
#:duration "15 minutes"
#:overview "Students are introduced to the programming environment"
#:learning-objectives @itemlist[@item{Convert Circles of Evaluation into code}
@item{Enter and evaluate code expressions for arithmetic on the computer}
@item{Understand the goal of error messages from the computer}]
#:evidence-statements @itemlist[@item{Students will be able to identify the Interactions and Definitions windows}
@item{Students will be able to enter and evaluate simple arithmetic expressions in the Interactions window}
@item{Students will be able to convert Circles of Evaluation into correctly-formed programs}
@item{Students will be able to explain an 'unbounded identifier' error message}
@item{Students will be able to explain the purpose of error messages}
@item{Given a Circle of Evaluation, students will be able to complete a partially-written program}
@item{Given a bank of Circles of Evaluation and programs, students will be able to match them}]
#:product-outcomes @itemlist[]
#:standards (list "A-SSE.1-2" "N-Q" "BS-CE" "BS-PL.1" "BS-IDE")
#:materials @itemlist[@item{Editing environment (WeScheme or DrRacket with the bootstrap-teachpack installed)}]
#:preparation @itemlist[@item{Computer for each student (or pair), running WeScheme or DrRacket}
@item{Student Workbooks, and something to write with}
@item{Overhead projector}]
#:prerequisites (list "Order of Operations")
#:exercises (list (make-exercise-locator "Intro-to-Programming" "complete-code-from-coe1")
(make-exercise-locator "Intro-to-Programming" "coe-to-code1")
(make-exercise-locator "Intro-to-Programming" "coe-code-matching1")
)
#:pacings (list
@pacing[#:type "remediation"]{@itemlist[@item{}]}
@pacing[#:type "misconception"]{@itemlist[@item{}]}
@pacing[#:type "challenge"]{@itemlist[@item{}]}
)
]{
@points[
@point{@student{Open the programming tool of your choice: If you've installed, DrRacket, double-click the
application to launch it. If you are using the online-tool, @login-link["click here to log in"]
enter your username and password to log in, then click "Start a New Program".}
@teacher{@management{Have the students look at the editor on their computers. Refer to overhead
projector as necessary.}}
}
@point{@student{@bitmap{images/wireframeIDE.png}This screen is called the @vocab{editor}, and it looks something
like the diagram you see here. There are a few buttons at the top, but most of the screen is
taken up by two large boxes: the @vocab{Definitions window} at the top and the
@vocab{Interactions window} at the bottom.}
@teacher{The Definitions window is where programmers define values and functions in their program,
while the Interactions window allows them to experiment with those values and functions.
This is analogous to writing a series of function definitions on a blackboard, and having
student evaluate expressions using those function on scrap paper. As students are not yet
defining values of their own, it is not important that students understand this distinction
right now. For now, we will work only with the Interactions window.}
}
@point{@student{A program is a @vocab{legal expression} that, when evaluated, produces a value. You've been
writing programs using mathematical expressions since you first learned how
to add! Just as in English, there are rules that determine whether a sentence
makes sense. Programs have rules too! A program can be very complicated, but
it doesn't have to be: the simplest programs of all are just Numbers.}
@teacher{@management{Draw students' attention to the Language Table (see Lesson Overview for Unit 1),
which currently sits empty. Add "Numbers" to the Types section of the language
table.}}
}
@point{@student{@bannerline{Code Rule 1: All values are legal expressions.}
@activity[#:forevidence "BS-IDE&1&1"]{What do you think @code{4} will evaluate to?
@editor-link[#:interactions-text "4"
"Click here to test it out."]}
@itemlist[@item{Enter 4 in the Interactions window and hit "Return". You
will see the value @code{4} appear on the next line in
the Interactions window.}
@item{Type 10 in the Interactions window and hit "Return". Now the
value @code{10} appears in the Interactions window.}
@item{Try evaluating numbers, like @code{10345017}, or negative
numbers, like @code{-2}. Is there a limit to how big a number can be?
What happens if you write a decimal? What happens when you click on
a decimal, like @code{1.5}? You get a new type of number, a
fraction, like @code{3/2}.}]
}
@teacher{The editing environment evaluates all fractions and returns them as decimals by default. This can be
surprising to students at first, so you may want to take a moment to explain what's going on, and
show them that these decimals can be converted back to fractions just by clicking on them. The
environment uses standard annotations for repeating, non-terminating decimal expressions and
properly handles expressions like @math{(\sqrt -1)}. If you want to work with those kinds of
numbers in your class, enter them to get familiar with how they appear in the Interactions window.}
}
@point{@student{@activity[#:forevidence "BS-IDE&1&2"]{The computer obviously knows about Numbers, but what happens
if you type in something that it @italic{doesn't} know about?
Will it complain? Crash? Guess?
@editor-link[#:interactions-text "dog" "Try asking the computer"]
to evaluate @code{dog} in the Interactions window.}
These error messages are really useful for programmers. Rather than saying "this program doesn't
work", the computer does the best it can to tell you what went wrong, and to give you as much
information as possible to help you fix the problem. Make sure you always read these messages carefully!
}
@teacher{The error message uses the term "variable". Don't worry if your students don't already know this
term; we will teach it to them shortly. For now, students just need to get used to error messages
and the kinds of problems that they catch in programs.}
}
@point{@student{The Circles of Evaluation are also easy to convert into computer programs. To translate a Circle of
Evaluation into a program, begin with an open parenthesis @code{(}, and then the function written at
the top of the circle. Then translate the inputs from left to right in the same way, adding a closing
parenthesis @code{)} when you're done. This process gives us the second rule for @vocab{expressions}:
@bannerline{Code Rule 2: Each open parenthesis is followed by one function, then by one or more legal
expressions, and finally by a closing parenthesis.}
@bitmap{images/FixedCircle.png}Here is the code for this Circle of Evaluation: @code{(- 4 5)}
@activity[#:forevidence "BS-PL.1&1&2"]{ @editor-link[#:interactions-text "(- 4 5)" "See what happens"]
when this code is entered into the Interactions window.
Press the Return key to evaluate the program. You should
see @math{-1} as an answer.
}
}
@teacher{Have students practice converting simple Circles of Evaluation into code. If you want to help students
understand when to use the parentheses, here are two explanations that we find useful. First, the
parens look like the Circle, and the Circle encloses the function name and its inputs. Second, we
use a more visual description of an ant eating its way through the expression. The ant eats into the
Circle (an open paren), then goes to the function at the top, then to the arguments from left to right,
then finally out of the Circle (a close paren). If the ant encounters another Circle while writing
down the arguments, it needs another open paren, etc.}
}
@point{@student{@bitmap{images/NestedCircle.png}When a Circle of Evaluation has other circles inside of it, the
translation still follows the same rules: each Circle requires a new set of parentheses:
@code{(* 6 (+ 4 5))}
@activity[#:forevidence "BS-PL.1&1&2"]{@itemlist[@item{Try entering this code into the Interactions
window. What should the program evaluate to
when you hit Return?}
@item{Practice converting other Circles of Evaluation you've drawn into code.}]}}
@teacher{@management{Scaffolding for Pair Programming: Talk to students about the roles of @italic{Driver}
and @italic{Navigator}. The Driver is the student with their hands on the keyboard - they're
in charge of typing, using the mouse, etc. The Navigator should be telling the Driver what to
type, and pointing out mistakes or suggesting things. It's important to clarify what these
roles are (perhaps reinforcing them with a visual), to ensure that both partners are active
and talking to one another about the task at hand.}}
}
@point{@student{@bannerline{All of the expressions that follow the function name are called @vocab{arguments} to the
function. The following diagram summarizes the shape of an expression that uses a function.
@bitmap{images/ExpressionDiagram.png}}
@activity[#:forevidence (list "BS-CE&1&2" "BS-CE&1&4")]{
For practice, turn to @worksheet-link[#:name "Circle-of-Evaluation-Practice"]
in your workbook. For each mathematical expression, draw the Circle of Evaluation, then convert
that Circle into Racket code.}}
@teacher{}
}
@point{@student{When expressions don't follow the code rules, the computer will tell you that it found a problem. The
computer also gives you information to help you fix the problem. This information is called an
@vocab{error message}. We'll talk more about error messages later. For now, we just want you to see
a couple of error messages so that you'll know what they are if you run into one while programming.
@activity[#:forevidence "BS-IDE&1&2"]{Enter each of the following illegal expressions in the Interactions Window
and look at the error message or behavior that the computer gives you.
@itemlist[@item{@code{(5 * 6)} [puts the function in the middle, instead of at the front]}
@item{@code{(*5 6)} [missing a space after the function]}
@item{@code{* 5 6)} [forgets the open parenthesis]}
@item{@code{(* 5 6} [forgets the close parenthesis]}
]}}
@teacher{At this point, the goal is simply to have students @italic{see} error messages. Students are not
expected to be experts at reading error messages this early
(you will drill this later). NOTE: When a close parenthesis is missing, hitting return will do nothing,
because the computer is waiting for the parenthesis. When an open parenthesis is missing, WeScheme
does nothing and waits for the programmer
to add the parens. If students hit enter and "nothing happens", they should check their parentheses.
Also note that if you do this sequence of exercises with @code{+} instead of @code{*}, the error
appears differently, because @code{+5} is a perfectly valid number (just like @code{-5}).}
}
]}
@lesson/studteach[
#:title "Closing"
#:duration "5 minutes"
#:overview ""
#:learning-objectives @itemlist[]
#:evidence-statements @itemlist[]
#:product-outcomes @itemlist[]
#:standards (list)
#:materials @itemlist[]
#:preparation @itemlist[]
#:pacings (list
@pacing[#:type "remediation"]{@itemlist[@item{}]}
@pacing[#:type "misconception"]{@itemlist[@item{}]}
@pacing[#:type "challenge"]{@itemlist[@item{}]}
)
]{
@points[@point{@student{You've done a lot in this first unit!
@itemlist[@item{You took a game apart to see how the parts move}
@item{You designed your own game, that you'll make during this course}
@item{You practiced using coordinates to put characters into a screen}
@item{You learned about order of operations, Circles of Evaluation, how to turn Circles of
Evaluation into programs, and how to run those programs to get answers.}]
In the next unit, we'll begin writing programs for more interesting things than just arithmetic.}
@teacher{@management{Make sure student names are on page 3. Take page 3 itself, or take photos of page 3, to prep game images for a later Unit. }}}
]
}
}
| false |
c4a05bc3df2788f14e93a5cab7a32b0e0f20ca0d | 662e55de9b4213323395102bd50fb22b30eaf957 | /dissertation/scrbl/shallow/data/blame/sieve.rktd | 1825ecc8b9e81a80851731ade132a057d4fe9918 | []
| no_license | bennn/dissertation | 3000f2e6e34cc208ee0a5cb47715c93a645eba11 | 779bfe6f8fee19092849b7e2cfc476df33e9357b | refs/heads/master | 2023-03-01T11:28:29.151909 | 2021-02-11T19:52:37 | 2021-02-11T19:52:37 | 267,969,820 | 7 | 1 | null | null | null | null | UTF-8 | Racket | false | false | 227 | rktd | sieve.rktd | #lang gtp-measure/output/file
/bin/sh: line 1: 599793 Killed /home/ben/code/racket/transient/head/racket/bin/racket /home/ben/code/racket/transient/tmp-transient-benchmark/min_sieve/blame/main.rkt > /dev/null
| false |
2acec98214bdc7db74f543fbda6b93f8b1587e2f | dce2cc91b7c1bbd4569b18302737af8072b11c94 | /code/boggle.rkt | 691ab56e308adee91d9704d667fd48ad7aaffdf9 | [
"MIT"
]
| permissive | benknoble/junk-drawer | 42126590c21cdfffd836c40b5e78de9c77a90616 | 4af03c47da24c5275d28143da03a86f0059baf6d | refs/heads/master | 2023-05-13T01:13:49.609283 | 2023-05-03T16:38:33 | 2023-05-03T16:38:33 | 70,744,626 | 2 | 0 | MIT | 2023-05-01T22:00:03 | 2016-10-12T21:49:46 | Java | UTF-8 | Racket | false | false | 2,788 | rkt | boggle.rkt | #lang racket/base
;; vim: lw+=%rel
(provide (all-defined-out)
(all-from-out racklog))
(require racket/list
racket/function
racket/set
racket/generator
racket/sequence
rackunit
racklog)
(define %product
(%rel (As Bs Cs A B)
[(As Bs Cs) ;-
(%set-of (cons A B)
(%and (%member A As)
(%member B Bs))
Cs)]))
;; spoofed from https://stackoverflow.com/a/8608389/4400820
(define %between
(%rel (Low High Value NewLow)
[(Low High Low)]
[(Low High Value) ;-
(%is NewLow (add1 Low))
(%<= NewLow High)
(%between NewLow High Value)]))
(define %range
(%rel (N L NN X)
[(N L) ;-
(%is NN (sub1 N))
(%bag-of X (%between 0 NN X) L)]))
(define %coords
(%rel (N Coords ToN)
[(N Coords) ;-
(%range N ToN)
(%product ToN ToN Coords)]))
(define %square
(%rel (Xss N)
[(Xss N) ;-
(%is N (length Xss))
(%andmap (λ (Xs) (%is N (length Xs))) Xss)]))
(define %empty-assoc
(%rel ()
[((hash))]))
(define %put-assoc
(%rel (Key Assoc Val New)
[(Key Assoc Val New) ;-
(%is New (hash-set Assoc Key Val))]))
;; more general than swipl's get_assoc, since we have
;; -Key +Assoc -Val
;; +Key +Assoc ?Val
;; though not
;; -Key +Assoc +Val
(define %get-assoc
(%rel (Key Assoc Val Keys)
[(Key Assoc Val) ;-
(%assoc-to-keys Assoc Keys)
(%member Key Keys)
(%is Val (hash-ref Assoc Key #f))]))
(define %del-assoc
(%rel (Key Assoc Val New)
[(Key Assoc Val New) ;-
(%get-assoc Key Assoc Val)
(%is New (hash-remove Assoc Key))]))
(define %assoc-to-keys
(%rel (Assoc Keys)
[(Assoc Keys) ;-
(%is Keys (hash-keys Assoc))]))
(define %foldl
(%rel (Goal H T V0 V1 V)
[(Goal empty V V)]
[(Goal (cons H T) V0 V) ;-
(Goal H V0 V1)
(%foldl Goal T V1 V)]))
(define %make-board-fold-helper
(%rel (Chars X Y Acc New Row Char)
[(Chars (cons X Y) Acc New) ;-
(%is Row (list-ref Chars X))
(%is Char (list-ref Row Y))
(%put-assoc (cons X Y) Acc Char New)]))
(define %make-board
(%rel (Chars B N Coords B0)
[(Chars B) ;-
(%square Chars N)
(%coords N Coords)
(%empty-assoc B0)
(%foldl (curry %make-board-fold-helper Chars)
Coords B0 B)]))
(define %board-has-word
(%rel (B W Cs C First X Y DX DY NewX NewY NewB)
[(B W) ;-
(%assoc-to-keys B Cs)
(%member C Cs)
(%board-has-word B W C)]
[((_) empty (_))]
[(B (cons First W) (cons X Y)) ;-
(%get-assoc (cons X Y) B First)
(%member DX '(-1 0 1))
(%member DY '(-1 0 1))
(%is NewX (+ X DX))
(%is NewY (+ Y DY))
(%del-assoc (cons X Y) B (_) NewB)
(%board-has-word NewB W (cons NewX NewY))]))
| false |
6aa69c908a2de55b715c34c218714e33323c3767 | 17185af882c8c4f518804b9e30c1f285e06bca53 | /2020/1.rkt | c991a1170ab65d7a0dd5e649d775f75321850411 | []
| no_license | bruceoberg/adventofcode | 2e70eb310034ba1d4c5e0a219fd946096be9704e | 1ac4ed37b0633a87ed3f35dfd249ad1e1258064c | refs/heads/master | 2021-06-18T20:16:54.124199 | 2021-01-25T03:12:30 | 2021-01-25T03:12:30 | 160,771,290 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 1,634 | rkt | 1.rkt | #lang racket
(require mzlib/etc)
(define g_pathCode (this-expression-source-directory))
(require srfi/1) ; for drop-right
(require racket/trace)
; (require racket/runtime-path)
; (define-runtime-path pathData "1.txt")
(define g_pathData
(build-path
g_pathCode
"1.txt"))
(define g_lStr (file->lines g_pathData))
(define g_lN (sort (map string->number g_lStr) <))
(define g_nTarget 2020)
(define (match2 i_lN i_nTarget)
(let check ([lN i_lN])
(define nFirst (first lN))
(define nLast (last lN))
(define nSum (+ nFirst nLast))
(cond
[(<= (length lN) 1) '()]
[(< nSum i_nTarget) (check (drop lN 1))]
[(> nSum i_nTarget) (check (drop-right lN 1))]
[else (list nFirst nLast)])))
; (define p2 (match2 g_lN g_nTarget))
; (displayln p2)
; (displayln (apply * p2))
(define (remove-nth lst i)
(let aux ([lst lst] [i i] [acc '()])
(cond [(null? lst) (reverse acc)] ;; what if (< (length lst) i)
[(<= i 0) (append-reverse acc (cdr lst))] ;; what if (< i 0)
[else (aux (cdr lst) (sub1 i) (cons (car lst) acc))])))
(define (match3 i_lN i_nTarget)
(let check ([lNPre '()] [n (first i_lN)] [lNPost (rest i_lN)])
(define lNLess (append lNPre lNPost))
(define nTargetLess (- i_nTarget n))
(define lNMatch2 (match2 lNLess nTargetLess))
(cond
[(< (length lNPost) 1) '()]
[(= (length lNMatch2) 2) (append lNMatch2 (list n))]
[else (check (append lNPre (list n)) (first lNPost) (rest lNPost))])))
(define p3 (match3 g_lN g_nTarget))
(displayln p3)
(displayln (apply * p3))
| false |
b986fca8956321a13232c239427d98d055441071 | ee37fa4dd086eff8ff6b15dc0fe016ec6cb67e32 | /graph/utils.rkt | e6b7ae2e768163c8034cbd9dbe6972cc11d88ab4 | []
| no_license | jpverkamp/graph | 4628f2c407e5da7fb4058b67e33b30a388ac9e26 | 7fe0d439389696ba5638ec70ea88c0ab4cd3c05f | refs/heads/master | 2021-01-15T11:23:17.580564 | 2014-01-06T21:46:15 | 2014-01-06T21:46:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 257 | rkt | utils.rkt | #lang racket
(provide (all-defined-out))
(define-syntax-rule (add1! x) (set! x (add1 x)))
(define WHITE 'white)
(define BLACK 'black)
(define GRAY 'gray)
(define (white? c) (eq? WHITE c))
(define (gray? c) (eq? GRAY c))
(define (black? c) (eq? BLACK c)) | true |
7904aca64733166485a6e775be57d1e6e2e9fc3b | c180d49b9f3785b2d0b75df262339aaae352639d | /Labs/lab20/2018-11-20-lab20.scrbl | 73da07920a719193a1868d68e8dc8f23f3016d9a | []
| no_license | abriggs914/CS2613 | 4180d304bf8e1fa0b5d675a341204e1ade65889f | aac085b409bb0e9fbd530274347f9f7bbed95694 | refs/heads/master | 2020-03-29T04:22:42.375054 | 2018-12-11T16:06:47 | 2018-12-11T16:06:47 | 149,317,591 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 1,625 | scrbl | 2018-11-20-lab20.scrbl | #lang scribble/manual
Title: Lab20
Date: 2018-11-20T11:07:21
Tags: Lab 20
Today was our last lab on python. We continued to talk about generators and built-in python functions like __next__ and __iter__. We used these functions to start some basic object oriented programming with python. It seems very similar to that of javaScript. We created a simple expression interpreter class to evaluate some mathematical expressions. Then adding on to that example, we had nested Expr objects stored as expressions, which would create a layer of recursion within the eval method.
We also recreated our fibonacci generator program using classes. We then ran tests comparing their outputs, to ensure that they had the same functionality. We did this four our counter program as well. Personally I prefer using classes and objects over functions as return values, like generators are meant to be used. Learning all of the "special" built-in function names seems to be important, because while bug-fixing the expr.py program, there was a confusing point where __eq__ was envoked, but there was no explicit function call in the code. I don't quite understand where the call came from in this example, I'm pretty sure it is used as a check for object equivalence.
I am almost sad to be moving on from python. I have found it to be very pleasant for coding, and error checking is intuitive and miles better than javaScript. It would be nice to have more time to learn more about the built-in functions and what you can do with them. Python seems to be a powerful language, and I feel I have just scraped the surface.
<!-- more -->
| false |
ed05113f7f2eda88f0d60364972009e996f94b2e | e3cfbb9a978d3ac739d7a623bc8982d3dee1ba64 | /download-images.rkt | e67db68261d19069cd20e129c0e9a879d3968fdd | []
| no_license | xuchunyang/learn-racket | 7cbeb1545c519705bb8759851c2d104760163203 | 13ca916e5eafa7f4de141034fe65a2f99c2b7f71 | refs/heads/master | 2020-03-22T17:10:47.754872 | 2020-01-17T17:24:08 | 2020-01-17T17:24:08 | 140,378,786 | 1 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 2,195 | rkt | download-images.rkt | #lang racket
(require net/url
html-parsing
sxml)
(define (expand-link target page)
(define u (string->url page))
(define scheme (url-scheme u))
(define host (url-host u))
(define base
(let ([filename (file-name-from-path page)])
(if filename
(substring page 0 (- (string-length page)
(string-length (path->string filename))))
page)))
(cond [(or (string-prefix? target "http://")
(string-prefix? target "https://"))
target]
[(string-prefix? target "//")
(string-append scheme ":" target)]
[(string-prefix? target "/")
(string-append scheme "://" host target)]
[else
(string-append base target)]))
(module+ test
(require rackunit)
(define page "https://www.gnu.org/software/emacs/tour/index.html")
(check-equal?
(expand-link "/graphics/heckert_gnu.transp.small.png" page)
"https://www.gnu.org/graphics/heckert_gnu.transp.small.png")
(check-equal?
(expand-link "images/splash-small.png" page)
"https://www.gnu.org/software/emacs/tour/images/splash-small.png")
(check-equal?
"https://www.gnu.org/software/emacs/tour/images/splash-small.png"
(expand-link "https://www.gnu.org/software/emacs/tour/images/splash-small.png"
page)))
(define (extract-image-urls page)
(printf "Downloading ~a...\n" page)
(define-values (status headers html) (http-sendrecv/url (string->url page)))
(define xexp (html->xexp html))
(for/list ([target (map cadr ((sxpath "//img/@src") xexp))]
#:when (non-empty-string? target))
(expand-link target page)))
(define (download-image imgurl)
(printf "Downloading ~a...\n" imgurl)
(define filename (file-name-from-path imgurl))
(unless (file-exists? filename)
(define-values (status headers in) (http-sendrecv/url (string->url imgurl)))
(call-with-output-file filename #:exists 'truncate
(lambda (out)
(copy-port in out)))))
(define (download-images page)
(for-each download-image (extract-image-urls page)))
(module+ main
(define page (vector-ref (current-command-line-arguments) 0))
(download-images page))
| false |
77cba57ee1f5f480fa13a3fcf86e9f02a70026e7 | fc22bffe6fd01f0045ade778d3ea534acb6f9e48 | /chapter02/Exercise 2.81.rkt | 0ca7524f8ee92c3185f9c4e9967bde12d949b622 | []
| no_license | HuTongsama/sicp | 0cd9eafed8bb03e71b4e005ff4382629fc63894f | ba722200ebc81e6fe2fd6d4c47893f36420c0f2e | refs/heads/master | 2021-07-23T06:05:01.884911 | 2020-05-06T15:26:47 | 2020-05-06T15:26:47 | 159,015,398 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 1,220 | rkt | Exercise 2.81.rkt | #lang sicp
;a
;There will be a infinite loop
;b
;The original apply-generic could work correctly,though there has
;something to do about arguments of the same type,such as return
;a new error message.The code Louis write can't work correctly.
;c
(define (apply-generic op . args)
(let ((type-tags (map type-tag args)))
(let ((proc (get op type-tags)))
(if proc
(apply proc (map contents args))
(if (= (length args) 2)
(let ((type1 (car type-tags))
(type2 (cadr type-tags))
(a1 (car args))
(a2 (cadr args)))
(if (eq? type1 type2)
(error "No method for these types" (list op type-tags))
(let ((t1->t2 (get-coercion type1 type2))
(t2->t1 (get-coercion type2 type1)))
(cond (t1->t2
(apply-generic op (t1->t2 a1) a2))
(t2->t1
(apply-generic op a1 (t2->t1 a2)))
(else (error "No method for these types" (list op type-tags)))))))
(error "No method for these types" (list op type-tags))))))) | false |
01622a1fe9bf1ff17bc2beefd0836949dfe17c5a | cc0e0f3853e6de005702a79d10ea7f75bc74d35d | /man.scrbl | 29ede5811a9eaddd470c136eac4c8dc83815239a | []
| no_license | nuprl/video-lang | 684914f40496ea226dc9db129be3cc69453c017d | 622b410116b4467eb5d15100b63f4c9e407248a5 | refs/heads/master | 2021-09-20T03:36:44.545033 | 2018-08-02T21:25:54 | 2018-08-02T21:25:54 | 75,484,758 | 0 | 1 | null | 2017-06-26T22:20:35 | 2016-12-03T16:15:52 | Racket | UTF-8 | Racket | false | false | 8,563 | scrbl | man.scrbl | #lang scribble/base
@(require scribble/manual
(for-label racket/base
video/base))
@title{Video Language Overview}
Racket's @racket[video] package is a DSL for Non-linear
video editing. Similarly to @racket[scribble] and
@racket[slideshow], you can create videos while taking
advantage of the full Racket language.
@section{Hello Green}
Create a file @tt{"green.vid"} with this content:
@codeblock{
#lang video
(color "green")}
The first line, @code{#lang video}, indicates that the file
implements a video. The content of the file, @code{(color
"green")} indicates that the video should be a solid green screen.
You can use the @exec{raco video} program to render the video:
@itemlist[
@item{Run:
@commandline{raco video green.vid}
to see a preview of the video. This includes playback
controls and the rendered video. In this case the
preview will be a solid green frame.}
@item{Run:
@commandline{raco video -o green.mp4 green.vid}
to render the video to an MP4 file.}
@item{Run:
@commandline{raco video -t xml -o green.xml green.vid}
to render the video to a plain text XML file.}]
@section{Multiple clips}
A video is formed by creating a
playlist of clips. All top-level video clips in a file are
placed in a single playlist. For example:
@codeblock{
#lang video
(color "blue" #:length 50)
(color "green" #:length 50)}
Creates a movie with 50 frames of blue (about 1 second),
followed by 50 frames of green.
You can even constructs native to, such as lists, to create a playlist:
@codeblock{
#lang video
(for/list ([i (in-range 255)])
(color (list 0 i 0)))}
Creates a clip that slowly fades from black to green. We
could use @racket[playlist] to convert the playlist to a
clip, but this is not needed, because playlists are clips.
You can even include clips generated by other video language
programs:
@codeblock{
#lang video
(include-video "green.vid")
(include-video "blue.vid")
}
This play the @tt{"green.vid"} program from above, followed
by a similar @tt{"blue.vid"} program.
@section{Creating pictures}
Using the @racket[picture] function, images created with the
@racketmodname[pict] and @racketmodname[racket/draw]
libraries can be placed in videos. For example, the
following program creates a video of the standard fish:
@codeblock{
#lang video
(require pict)
(picture (standard-fish 500 500))
}
Notice that @racket[(require pict)] was placed in the file
without adding a clip to the video. Only top level
expressions add clips to the video, definitions and require
forms do not. We could further extend this idea to create a
movie of a standard fish swimming in progressively contaminated water:
@codeblock{
#lang video
(require pict racket/draw)
(define fishy (standard-fish #:color "chocolate"
#:width 500
#:height 255))
(for/list ([i (in-list 255)])
(picture (cc-superimpose (filled-rectangle #:color (make-object color% 0 i (- 255 i))
#:width 600
#:height 600
fishy))))
}
@section{Importing camera videos}
While creating videos from clips is fun, we need to be able
to import videos from other sources, such as a camera. This
is be done with @racket[clip]:
@codeblock{
#lang video
(clip "step.mp4")
}
Here, @tt{"step.mp4"} is a video of a person walking. We can
use @racket[clip]'s optional arguments to keep only a slice
of the clip, play it slower, and even backwards. Here, we
make this person take the step several times before letting her continue on:
@codeblock{
#lang video
(define step "step.mp4")
(clip step #:out 100)
(for/list ([i (in-range 50)])
(clip step
#:in 100
#:out 200
#:speed (if (even? i) 1 -1)))
(clip step #:in 100)
}
@section{Applying Filters}
Every clip in @racket[video] can have a filter attached to
it, using @racket[attach-filter]. Filiters alter the
behavior of a clip such as turning it to grayscale,
inverting the colors, or even adding a watermark. As an
example, we can create a grayscale version of the girl
walking using the @racket[grayscale-filter]:
@codeblock{
#lang video
(define walking (include-video "walking.vid"))
(attach-filter walking (grayscale-filter))
}
@section{Clip Properties}
Let's say we want to add a watermark to our walking video.
However, we want to add it to the first 10% of the video,
and then we want the watermark to go away. Every clip has a
set of properties attached to it. The relevant one here is
@racket['length], which stores the clip's length. We can use
@racket[properties-ref] to get the property:
@codeblock{
#lang video
(define walking (include-video "walking.vid"))
(define walking-length (properties-ref walking 'length))
(attach-filter walking (watermark-filter 0 0 1/8 1/8
#:in 0 #:out (/ walking-length 10)))
}
@section{Using Multitracks}
While playlists are powerful for laying out clips
horizontally---playing clips in succession. Videos also need
an abstraction for laying out clips vertically---playing
clips at the same time. For example, we may want to play a song with our walking clip:
@codeblock{
#lang video
(multitrack
(include-video "walking.vid")
(audio "music.wav"))
}
The @racket[audio] function is similar to @racket[clip], but
the created clip only contains audio. @racket[multitrack]
superimposes a list of clips on top of each other. Like
@racket[playlist], a @racket[multitrack] is also itself a
clip. In the top clip only plays audio, the walking
clip plays in lockstep with the music.
This example works only because @tt{"music.wav"} does not
contain any video. If it did, @tt{ "walking.vid"} would be
completely overshadowed. We can tell @racket[multitrack] how
we would like the videos to be mixed by taking advantage
that each clip is @racket[eq?] with itself. The following
clip plays the walking clip and the toxic fish clip in lockstep,
with the fish clip taking up the top-left corner of the screen:
@codeblock{
#lang video
(define walking (include-video "walking.vid"))
(define polluted-fish (include-video "polluted-fish.vid"))
(multitrack
walking polluted-fish (audio "music.wav")
#:effects (list (composite walking polluted-fish 0 0 1/4 1/4)))
}
Another, more concise way, to express this is:
@codeblock{
#lang video
(define walking (include-video "walking.vid"))
(define polluted-fish (include-video "polluted-fish.vid"))
(multitrack
walking
(composite 0 0 1/4 1/4)
polluted-fish
(audio "music.wav"))
}
Here, @racket[composite] pulls the top and bottom tracks
from the ones above and below it in the multitrack.
@section{Transitions}
Jumping from one clip to the next can sometimes be jarring.
Because of this, @racket[video] also includes transitions
which can combine two clips together.
For example, we can make a transition of a clip of a person
walking, with an equivalent one that is grayscale:
@codeblock{
(define walking (include-video "walking.vid"))
(cut-clip walking #:out 100)
(fade-transition 50)
(attach-filter (cut-clip walking #:in 100)
(grayscale-filter))
}
Here, @racket[fade-transition] takes 50 frames from the
first clip, and 50 frames from the second clip, and inserts
a new clip that lasts 50 frames that fades from the first
clip to the second. Note here that the resulting playlist
will now have three rather than two clips, and will be 50
frames shorter.
We also introduce @racket[cut-clip], which takes itself a
clip, and returns the same clip, except cut between
@racket[#:in] and @racket[#:out].
@section{Abstractions}
So far, all of our programs have used @code{#lang video}
directly. But remember that each of these primitives produce
videos themselves. We can use the linguistic constructs in
Racket to build new videos, similarly to the
@racketmodname[pict] library. We can get all of these
primitives @code{#lang video} provides with
@racketmodname[video/base].
As an example, we create a function that takes an arbitrary
video, and places a watermark on the first 5% of the video frames.
@racketblock[
(code:comment "; utils.rkt")
(require video/base)
(define (add-watermark vid)
(attach-filter
vid
(watermark-filter 0 0 1/8 1/8
#:in 0 #:out (/ (properties-ref vid 'length) 10))))]
And a video that uses this file:
@codeblock{
#lang video
(require "utils.rkt")
(add-watermark (include-video "walk.vid"))
}
| false |
08f38f60e632319b154f430bb3bc6ff59317b0e7 | 17126876cd4ff4847ff7c1fbe42471544323b16d | /beautiful-racket-demo/basic-demo-3/expander.rkt | fc7fa77604e92cb754598b11b4e203ae45b96084 | [
"MIT"
]
| permissive | zenspider/beautiful-racket | a9994ebbea0842bc09941dc6d161fd527a7f4923 | 1fe93f59a2466c8f4842f17d10c1841609cb0705 | refs/heads/master | 2020-06-18T11:47:08.444886 | 2019-07-04T23:21:02 | 2019-07-04T23:21:02 | 196,293,969 | 1 | 0 | NOASSERTION | 2019-07-11T00:47:46 | 2019-07-11T00:47:46 | null | UTF-8 | Racket | false | false | 1,927 | rkt | expander.rkt | #lang br/quicklang
(require "struct.rkt" "run.rkt" "elements.rkt" "setup.rkt")
(provide (rename-out [b-module-begin #%module-begin])
(all-from-out "elements.rkt"))
(define-macro (b-module-begin (b-program LINE ...))
(with-pattern
([((b-line NUM STMT ...) ...) #'(LINE ...)]
[(LINE-FUNC ...) (prefix-id "line-" #'(NUM ...))]
[(VAR-ID ...) (find-property 'b-id #'(LINE ...))]
[(IMPORT-NAME ...)
(find-property 'b-import-name #'(LINE ...))]
[(EXPORT-NAME ...)
(find-property 'b-export-name #'(LINE ...))]
[((SHELL-ID SHELL-IDX) ...)
(make-shell-ids-and-idxs caller-stx)]
[(UNIQUE-ID ...)
(unique-ids
(syntax->list #'(VAR-ID ... SHELL-ID ...)))])
#'(#%module-begin
(module configure-runtime br
(require basic-demo-3/setup)
(do-setup!))
(require IMPORT-NAME) ...
(provide EXPORT-NAME ...)
(define UNIQUE-ID 0) ...
(let ([clargs (current-command-line-arguments)])
(set! SHELL-ID (get-clarg clargs SHELL-IDX)) ...)
LINE ...
(define line-table
(apply hasheqv (append (list NUM LINE-FUNC) ...)))
(parameterize
([current-output-port (basic-output-port)])
(void (run line-table))))))
(define (get-clarg clargs idx)
(if (<= (vector-length clargs) idx)
0
(let ([val (vector-ref clargs idx)])
(or (string->number val) val))))
(begin-for-syntax
(require racket/list)
(define (unique-ids stxs)
(remove-duplicates stxs #:key syntax->datum))
(define (find-property which line-stxs)
(unique-ids
(for/list ([stx (in-list (stx-flatten line-stxs))]
#:when (syntax-property stx which))
stx)))
(define (make-shell-ids-and-idxs ctxt)
(define arg-count 10)
(for/list ([idx (in-range arg-count)])
(list (suffix-id #'arg idx #:context ctxt) idx))))
| false |
c1e89bc5dde8914394e049b44e5f7499b6264137 | d0ea449400a715f50fd720c265d2b923c34bc464 | /digitama/resources/id1032.rkt | 1a2ece5aac6e4d44f96d0447d2c9ca92bbe88448 | []
| no_license | wargrey/psd | c3d69b8c7d6577cdac9be433be832e80d2bb32d4 | 73b16a52e0777250d02e977f7dcbd7c1d98ef772 | refs/heads/master | 2020-12-02T06:26:02.875227 | 2018-07-16T11:00:58 | 2018-07-16T11:00:58 | 96,830,933 | 1 | 1 | null | null | null | null | UTF-8 | Racket | false | false | 1,197 | rkt | id1032.rkt | #lang typed/racket/base
(require "format.rkt")
(require "../parser.rkt")
(require "../draw.rkt")
(unsafe-provide 0x408)
(define 0x408 : (-> Integer String Bytes Fixnum Index Null PSD-Grid+Guides)
(lambda [id name block idx size argl]
(PSD-Grid+Guides id name
(parse-uint32 block idx) ; version
(parse-uint32 block (fx+ idx 4)) ; horizontal
(parse-uint32 block (fx+ idx 8)) ; vertical
(let parse-guide ([fgridcount : Index (parse-size block (fx+ idx 12) 4)]
[start : Fixnum (fx+ idx 16)]
[guides : (Listof (Pairof Fixnum PSD-Guide-Direction)) null])
(cond [(fx= fgridcount 0) (reverse guides)]
[else (parse-guide (fx- fgridcount 1)
(fx+ start 5)
(cons (cons (parse-int32 block start) ; location
(integer->vhselect (parse-uint8 block (fx+ start 4))))
guides))])))))
| false |
4e0cdb348eb21d8682a3bc39c0f629236c11083b | bdb6b8f31f1d35352b61428fa55fac39fb0e2b55 | /sicp/ex1.18.rkt | 638ae20cdd946d26bb9f166fe1f38a755f79651c | []
| no_license | jtskiba/lisp | 9915d9e5bf74c3ab918eea4f84b64d7e4e3c430c | f16edb8bb03aea4ab0b4eaa1a740810618bd2327 | refs/heads/main | 2023-02-03T15:32:11.972681 | 2020-12-21T21:07:18 | 2020-12-21T21:07:18 | 323,048,289 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 985 | rkt | ex1.18.rkt | #lang sicp
;results of ex1.16
(define (fast-expt b n)
(fast-expt-iter b n 1))
(define (fast-expt-iter b counter product)
(cond ((= counter 0) product)
((even? counter) (fast-expt-iter (square b) (/ counter 2) product))
(else (fast-expt-iter b (- counter 1) (* b product)))))
;results of ex1.17
(define (even? n)
(= (remainder n 2) 0))
(define (double z) (+ z z))
(define (halve z) (/ z 2))
(define (square z) (fast-* z z))
;ex1.17 - my solution
(define (fast-* a b)
(cond ((= b 0) 0)
((even? b) (double (fast-* a (halve b))))
(else (+ a (fast-* a (- b 1))))))
;ex1.18 - Now come up with solution to come up with iterative multiplication that is using log(b) steps
(define (fast* a b)
(fast*iter a b 0))
(define (fast*iter a counter sum)
(cond ((= counter 0) sum)
((even? counter) (fast*iter (double a) (halve counter) sum))
(else (fast*iter a (- counter 1) (+ a sum)))))
;(fast-expt 3 4)
(fast-* 31 101)
(fast* 31 101) | false |
cea3d46f774973e040e5e312fd3286168d0ba416 | bdde8e6a31d70a992cb621a173c61c9f7392d1c1 | /rackjure/str.rkt | 087ff15a3d2c8ef2ed622346cc0cf841b416d934 | [
"BSD-2-Clause",
"BSD-3-Clause"
]
| permissive | greghendershott/rackjure | 4fe2e0e836f01d181c7691d28019f7ffc20f9592 | 9f7c74f5a499f71407890037839a3fa3b178dcef | refs/heads/master | 2022-11-30T00:55:01.225989 | 2022-11-25T18:20:52 | 2022-11-25T18:20:52 | 8,044,078 | 215 | 19 | null | 2018-05-25T02:05:16 | 2013-02-06T03:48:24 | Racket | UTF-8 | Racket | false | false | 1,496 | rkt | str.rkt | ;; Copyright (c) 2013-2022 by Greg Hendershott.
;; SPDX-License-Identifier: BSD-2-Clause
#lang racket/base
(require racket/contract
racket/function
racket/string)
(provide
(contract-out
[str (()
(#:fmt (any/c . -> . string?) #:sep string?)
#:rest list?
. ->* .
(and/c immutable? string?))]))
;; #:fmt: The function to apply. Defaults to ~a. Could be ~v, or
;; anything that returns a string?
;;
;; #:sep: A string to add between each. Defaults to "".
(define (str #:fmt [fmt (curry format "~a")] #:sep [sep ""] . xs)
(string->immutable-string (string-join (map fmt xs) sep)))
(module* test racket/base
(require (submod "..")
rackunit
(only-in racket/function curry thunk))
(check-equal? (str) "")
(check-equal? (str "hi") "hi")
(check-equal? (str 1) "1")
(check-equal? (str #f) "#f")
(check-equal? (str "Yo" "Yo") "YoYo")
(check-equal? (str "Yo" "Yo" "Ma") "YoYoMa")
(check-equal? (str #:fmt (curry format "~v") "Yo" "Yo") "\"Yo\"\"Yo\"")
(check-equal? (str #:sep " " "Yo" "Yo") "Yo Yo")
(check-equal? (str #:fmt (curry format "~v") #:sep " " "Yo" "Yo") "\"Yo\" \"Yo\"")
(check-equal? (str '(0 1 2 3 4 5 6 7 8 9)) "(0 1 2 3 4 5 6 7 8 9)")
(check-equal? (apply str '(0 1 2 3 4 5 6 7 8 9)) "0123456789")
(check-exn exn:fail:contract?
(thunk (str #:fmt values 1))) ;; not (any/c -> string?)
(check-exn exn:fail:contract?
(thunk (str #:sep #f 1)))) ;; not string?
| false |
394c95e82a68d16666dd57e15fd0e59c28b07d93 | 804e0b7ef83b4fd12899ba472efc823a286ca52d | /bindings/fastlz/fastlz.rkt | 755a9f27d8c5d55c5feaa83c162ded20352052d4 | []
| no_license | cha63506/CRESTaceans | 6ec436d1bcb0256e17499ea9eccd5c034e9158bf | a0d24fd3e93fc39eaf25a0b5df90ce1c4a96ec9b | refs/heads/master | 2017-05-06T16:59:57.189426 | 2013-10-17T15:22:35 | 2013-10-17T15:22:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 1,849 | rkt | fastlz.rkt | #lang racket/base
(require ffi/unsafe)
(provide (rename-out (fastlz-compress compress-bytes)
(fastlz-decompress uncompress-bytes)))
(define lib (ffi-lib "fastlz"))
(define-syntax-rule (deflz+ binding obj typ)
(define binding (get-ffi-obj (regexp-replaces (symbol->string 'obj) '((#rx"-" "_"))) lib typ)))
(define-syntax-rule (deflz obj typ)
(deflz+ obj obj typ))
(deflz fastlz-compress (_fun (ub) ::
(_bytes = (if (>= (bytes-length ub) 16)
ub
(error "uncompressed buffer too small")))
(_int = (bytes-length ub))
; The output buffer must be at least 5% larger than the input buffer
; and can not be smaller than 66 bytes.
(cb : (_bytes o (max 66
(inexact->exact
(round (+ 0.5 (* 1.1 (bytes-length ub))))))))
-> (actual : _int)
-> (cond [(positive? actual)
(make-sized-byte-string cb actual)]
[else (error "fastlz couldn't compress")])))
(deflz fastlz-decompress (_fun (cb ul) ::
(cb : _bytes)
(_int = (bytes-length cb))
(ub : (_bytes o ul))
(ul : _int)
-> (actual : _int)
-> (cond [(positive? actual)
(make-sized-byte-string ub actual)]
[else (error "fastlz couldn't decompress")]))) | true |
41780b27a3c2e6288bd8991c265fdd7b30e6dad6 | a1fcb2e07f8d9e1bd7e1cbd59c1f794ec1269cb0 | /plai-typed/main.rkt | ac3017f55f225b1c1bc609f07252085d1aa736b9 | []
| no_license | mflatt/plai-typed | 2798f6f12967fc280e483a1229cd655c1ed1b175 | 07fd70cdf2678bc27e4d95346a7d5a2906410f99 | refs/heads/master | 2022-12-23T04:10:47.964383 | 2022-09-14T16:59:28 | 2022-09-14T22:04:22 | 5,820,619 | 37 | 10 | null | 2022-09-14T22:04:22 | 2012-09-15T13:59:08 | Racket | UTF-8 | Racket | false | false | 137,310 | rkt | main.rkt | #lang racket/base
(require (only-in plai
define-type
type-case
test
test/exn
print-only-errors
error)
racket/pretty
racket/list
racket/bool
racket/local
racket/shared
racket/include
(only-in racket/contract/base contract-out)
racket/trace
"private/fixup-quote.rkt"
(for-syntax racket/base
racket/list
racket/syntax
"private/types.rkt"
racket/struct-info
"private/collapse.rkt"))
(provide :
(rename-out [define: define]
[define-values: define-values]
[lambda: lambda]
[lambda: λ]
[begin: begin]
[local: local]
[letrec: letrec] [let: let] [let*: let*]
[shared: shared]
[parameterize: parameterize]
[cond: cond]
[case: case]
[if: if]
[when: when]
[unless: unless]
[or: or]
[and: and]
[quote: quote]
[quasiquote: quasiquote]
[set!: set!]
[time: time]
[trace: trace]
[require: require]
[module+: module+]
[include: include]
[splice: splice]
[define-syntax: define-syntax]
[define-syntax-rule: define-syntax-rule])
#%app #%datum #%top unquote unquote-splicing
module submod
(rename-out [module-begin #%module-begin]
[top-interaction #%top-interaction])
else typed-in rename-in opaque-type-in
has-type
(for-syntax (all-from-out racket/base))
(rename-out [define-type: define-type]
[type-case: type-case])
define-type-alias
(rename-out [test: test]
[test/exn: test/exn])
print-only-errors
cons list empty first rest empty? cons?
second third fourth list-ref build-list length
map reverse map2 append
filter foldl foldr
(rename-out [member: member])
+ - = > < <= >= / * min max
add1 sub1 zero? odd? even?
modulo remainder floor ceiling
symbol=? string=? equal? eq? not
error try call/cc let/cc
string->symbol symbol->string
string-append to-string
display
char=? string-ref substring string-length string->list list->string
(rename-out [make-hash: make-hash]
[hash: hash]
[hash-ref: hash-ref])
hash-set! hash-remove! hash-keys
hash-set hash-remove
s-exp-symbol? s-exp->symbol symbol->s-exp
s-exp-number? s-exp->number number->s-exp
s-exp-string? s-exp->string string->s-exp
s-exp-boolean? s-exp->boolean boolean->s-exp
s-exp-list? s-exp->list list->s-exp
(rename-out [read: read])
box unbox set-box!
make-vector vector-ref vector-set! vector-length vector
(rename-out [values: values])
pair fst snd
identity
true false
make-parameter parameter-ref parameter-set!
number boolean symbol
(rename-out [string: string])
char
s-expression
->
(rename-out [listof: listof]
[boxof: boxof]
[parameterof: parameterof]
[vectorof: vectorof]
[hashof: hashof]
[void: void])
optionof none some some-v none? some?)
(define-type optionof
[none]
[some (v (lambda (x) #t))])
(define not-there (gensym))
(define (hash: l)
(apply hash
(apply
append
(for/list ([v (in-list l)])
(list (vector-ref v 0)
(vector-ref v 1))))))
(define (make-hash: l)
(make-hash (for/list ([v (in-list l)])
(cons (vector-ref v 0)
(vector-ref v 1)))))
(define (hash-ref: ht k)
(define v (hash-ref ht k not-there))
(if (eq? v not-there)
(none)
(some v)))
(define (s-exp-symbol? s) (symbol? s))
(define (s-exp->symbol s) (if (symbol? s) s (error 's-exp->symbol "not a symbol: ~e" s)))
(define (symbol->s-exp s) s)
(define (s-exp-number? s) (number? s))
(define (s-exp->number s) (if (number? s) s (error 's-exp->number "not a number: ~e" s)))
(define (number->s-exp s) s)
(define (s-exp-string? s) (string? s))
(define (s-exp->string s) (if (string? s) s (error 's-exp->string "not a string: ~e" s)))
(define (string->s-exp s) s)
(define (s-exp-boolean? s) (boolean? s))
(define (s-exp->boolean s) (if (boolean? s) s (error 's-exp->boolean "not a boolean: ~e" s)))
(define (boolean->s-exp s) s)
(define (s-exp-list? s) (list? s))
(define (s-exp->list s) (if (list? s) s (error 's-exp->list "not a list: ~e" s)))
(define (list->s-exp s) s)
(define (identity x) x)
(define (read:)
(define v (read))
(unless (let loop ([v v])
(or (symbol? v)
(string? v)
(number? v)
(boolean? v)
(and (list? v)
(map loop v))))
(error 'read "input is not an s-expression: ~e" v))
v)
(define (map2 f l1 l2) (map f l1 l2))
(define-syntax (: stx)
(raise-syntax-error
#f
"expected an expression instead of a colon"
stx))
(define-for-syntax type
(lambda (stx)
(raise-syntax-error
#f
"expected an expression, found a type"
stx)))
(define-syntax number type)
(define-syntax boolean type)
(define-syntax symbol type)
(define-syntax string: type)
(define-syntax char type)
(define-syntax s-expression type)
(define-syntax -> type)
(define-syntax listof: type)
(define-syntax boxof: type)
(define-syntax vectorof: type)
(define-syntax hashof: type)
(define-syntax parameterof: type)
(define void: void) ; allow as a function
(define (member: a l)
(and (member a l) #t))
(define (to-string x) (format "~v" x))
(define (parameter-ref p)
(p))
(define (parameter-set! p v)
(p v))
(define-for-syntax (is-type-keyword? a)
(and (identifier? a)
(ormap (lambda (i)
(free-identifier=? a i))
(syntax->list
#'(: number boolean symbol char s-expression
string: -> * listof: hashof:
boxof: vectorof: parameterof:
void: optionof)))))
(define-for-syntax (is-keyword? a)
(or (is-type-keyword? a)
(and (identifier? a)
(ormap (lambda (i)
(free-identifier=? a i))
(syntax->list
#'(true false
else))))))
(define-for-syntax (check-defn-keyword id stx)
(when (is-keyword? id)
(raise-syntax-error
#f
"cannot redefine a keyword"
stx
id)))
(define-for-syntax ((parse-arg stx) arg)
(if (identifier? arg)
(if (is-keyword? arg)
(raise-syntax-error
#f
(format "keyword used as an argument name~a"
(if (is-type-keyword? arg)
" (maybe missing square brackets?)"
""))
stx
arg)
arg)
(syntax-case arg (:)
[(id : type)
(identifier? #'id)
#'id]
[_ (raise-syntax-error
#f
"expected either <id> or `[<id> : <type>]' for function argument"
stx
arg)])))
(define-for-syntax (check-top k)
(lambda (stx)
(if (eq? 'module-begin (syntax-local-context))
#`(module-begin #,stx)
(k stx))))
(define-syntax try
(check-top
(syntax-rules (lambda:)
[(try expr1 (lambda: () expr2))
(with-handlers* ([exn:fail? (lambda (exn) expr2)])
expr1)])))
(define-for-syntax (absolute-module-path s)
(if (and (pair? s)
(or (and (eq? (car s) 'submod)
(or (equal? (cadr s) ".")
(equal? (cadr s) "..")))
(and (eq? (car s) 'quote))))
(module-path-index-join
s
(eval #'(variable-reference->module-path-index
(#%variable-reference))))
s))
(define-syntax require:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ clause ...)
(with-syntax ([(new-clause ...)
(map (lambda (clause)
(let loop ([clause clause])
(syntax-case clause (typed-in rename-in opaque-type-in :)
[(typed-in lib
[id : type]
...)
(begin
(let ([lib #'lib]
[ids (syntax->list #'(id ...))])
(unless (module-path? (syntax->datum lib))
(raise-syntax-error #f "bad module path" stx lib))
(for ([id (in-list ids)])
(unless (identifier? id)
(raise-syntax-error #f "expected an identifier" stx id))))
(with-syntax ([lib (fixup-quote #'lib #'quote:)])
(syntax/loc clause (only-in lib id ...))))]
[(typed-in lib spec ...)
(for ([spec (in-list (syntax->list #'(spec ...)))])
(syntax-case spec (:)
[(id : type) (void)]
[(id something . _)
(and (identifier? #'id)
(or (not (identifier? #'something))
(not (free-identifier=? #'something #':))))
(raise-syntax-error
#f
(format "expected a colon after the identifier `~s'"
(syntax-e #'id))
clause
#'something)]
[_ (raise-syntax-error
#f
"expected a specification of the form [<id> : <type>]"
clause
spec)]))]
[(rename-in sub-clause [old-id new-id] ...)
(let ([sub (loop #'sub-clause)])
(define (check id)
(unless (identifier? id)
(raise-syntax-error #f "expected an identifier" clause id)))
(for ([old-id (in-list (syntax->list #'(old-id ...)))]
[new-id (in-list (syntax->list #'(new-id ...)))])
(check old-id)
(check new-id))
(with-syntax ([sub sub])
(syntax/loc clause (rename-in sub [old-id new-id] ...))))]
[(opaque-type-in lib [id predicate-id] ...)
(let ()
(define (check id)
(unless (identifier? id)
(raise-syntax-error #f "expected an identifier" clause id)))
(for ([id (in-list (syntax->list #'(id ...)))]
[predicate-id (in-list (syntax->list #'(predicate-id ...)))])
(check id)
(check predicate-id))
(syntax/loc clause (only-in lib predicate-id ...
;; Also import predicate as `id':
[predicate-id id] ...)))]
[mp
(module-path? (syntax->datum #'mp))
(let ([s (syntax->datum #'mp)])
(define xs (if (and (pair? s)
(eq? (car s) 'quote)
;; The following check is intended to
;; allow access to modules at the top
;; level that have only symbolic names,
;; but `syntax-local-submodules' is broken
;; in expand mode as of v5.3.3, so we skip it
;; for now.
#;
(memq (cadr s) (syntax-local-submodules)))
;; convert to `submod' form:
(list 'submod "." (cadr s))
;; ok as-is:
s))
(define typed?
(module-declared? (absolute-module-path
(if (and (pair? xs) (eq? (car xs) 'submod))
`(,@xs plai-typed)
`(submod ,xs plai-typed)))
#t))
(unless typed?
(when (module-declared? (absolute-module-path xs) #t)
(raise-syntax-error #f
"not a `plai-typed' module"
stx
#'mp)))
(fixup-quote
(if typed?
(let ([new-clause
(if (and (pair? s) (eq? (car s) 'submod))
(quasisyntax/loc clause (#,@#'mp plai-typed))
(quasisyntax/loc clause (submod mp plai-typed)))])
(datum->syntax clause
(syntax-e new-clause)
clause
clause))
clause)
#'quote:))]
[_
(raise-syntax-error #f
"not a valid require specification"
stx
clause)])))
(syntax->list #'(clause ...)))])
#'(require new-clause ...))]))))
(define-syntax typed-in
(lambda (stx)
(raise-syntax-error #f "allowed only in `require'" stx)))
(define-syntax opaque-type-in
(lambda (stx)
(raise-syntax-error #f "allowed only in `require'" stx)))
(define-syntax test:
(check-top
(syntax-rules ()
[(_ e ...) (test e ...)])))
(define-syntax test/exn:
(check-top
(syntax-rules ()
[(_ e ...) (test/exn e ...)])))
(define-syntax-rule (module+: name e ...)
(module+ name
;; to register implicitly imported types:
(require (only-in (submod ".." plai-typed)))
e
...))
(define-syntax include:
(check-top
(lambda (stx)
(unless (memq (syntax-local-context) '(module top-level))
(raise-syntax-error #f "allowed only as a top-level form" stx))
(syntax-case stx ()
[(_ spec) (with-syntax ([orig-stx stx])
(syntax/loc stx
(include-at/relative-to orig-stx orig-stx spec)))]))))
(begin-for-syntax
(struct typed-macro (proc)
#:property prop:procedure 0)
(define macro-inspector (current-code-inspector))
(define (add-begin proc)
(lambda (stx)
(define result (proc stx))
(if (syntax? result)
;; Insert a `begin' wrapper so we can `local-expand' just once:
#`(begin #,result)
;; Otherwise, let expander report the error:
result))))
(define-syntax define-syntax:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ id rhs)
(identifier? #'id)
(syntax-case* #'rhs (syntax-rules lambda) free-transformer-identifier=?
[(syntax-rules . _)
(syntax/loc stx
(define-syntax id (typed-macro (add-begin rhs))))]
[(lambda (arg) . rest)
(syntax/loc stx
(define-syntax id (typed-macro (add-begin rhs))))]
[_
(raise-syntax-error #f "expected a `syntax-rules' or single-argument `lambda' form after identifier" stx)])]
[(_ (id arg-id) . rest)
(and (identifier? #'id)
(identifier? #'arg-id))
(if (and (pair? (syntax-e #'rest))
(syntax->list #'rest))
(syntax/loc stx
(define-syntax id (typed-macro (add-begin (lambda (arg-id) . rest)))))
(raise-syntax-error #f "ill-formed macro body" stx))]
[(_ id . _)
(raise-syntax-error #f "expected an identifier or `(<identifier> <identifier>)' header" stx #'id)]))))
(define-syntax define-syntax-rule:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ (id . rest) tmpl)
(identifier? #'id)
#`(define-syntax: id (syntax-rules () [(id . rest) tmpl]))]))))
(define-for-syntax (disarm stx)
(let loop ([e stx])
(cond
[(syntax? e)
(define stx (syntax-disarm e macro-inspector))
(datum->syntax stx
(loop (syntax-e stx))
stx
stx)]
[(pair? e) (cons (loop (car e)) (loop (cdr e)))]
[(vector? e) (list->vector (map loop (vector->list e)))]
[else e])))
(define-for-syntax (local-expand-typed expr)
(define stx (local-expand expr 'expression #f))
(syntax-case stx (begin)
[(begin e) (disarm #'e)]
[_ (error 'local-expand-typed "something went wrong: ~e => ~e" expr stx)]))
(define-for-syntax (expand-includes l)
(let loop ([l l])
(cond
[(null? l) null]
[else
(syntax-case (car l) (include: splice:)
[(include: spec)
(append
(cdr (syntax->list (local-expand (car l) (syntax-local-context) #f)))
(loop (cdr l)))]
[(splice: e ...)
(loop (append (syntax->list #'(e ...)) (cdr l)))]
[(id . _)
(and (identifier? #'id)
(typed-macro? (syntax-local-value #'id (lambda () #f))))
(loop (cons (local-expand-typed (car l))
(cdr l)))]
[_ (cons (car l) (loop (cdr l)))])])))
(define-syntax splice:
(check-top
(lambda (stx)
(unless (memq (syntax-local-context) '(module top-level))
(raise-syntax-error #f "allowed only as a top-level form" stx))
(syntax-case stx ()
[(_ e ...) #'(begin e ...)]))))
(define-syntax define:
(check-top
(lambda (stx)
(syntax-case stx (:)
[(_ id expr)
(identifier? #'id)
(begin
(check-defn-keyword #'id stx)
(syntax/loc stx
(define id expr)))]
[(_ id : type expr)
(identifier? #'id)
(begin
(check-defn-keyword #'id stx)
(syntax/loc stx
(define id expr)))]
[(_ (id arg ...) : type expr)
(identifier? #'id)
(begin
(check-defn-keyword #'id stx)
(with-syntax ([(arg ...)
(map (parse-arg stx) (syntax->list #'(arg ...)))])
(syntax/loc stx
(define (id arg ...) (#%expression expr)))))]
[(_ (id arg ...) expr)
(identifier? #'id)
(begin
(check-defn-keyword #'id stx)
(with-syntax ([(arg ...)
(map (parse-arg stx) (syntax->list #'(arg ...)))])
(syntax/loc stx
(define (id arg ...) (#%expression expr)))))]))))
(define values: vector-immutable)
(define (pair a b) (vector-immutable a b))
(define (fst v) (vector-ref v 0))
(define (snd v) (vector-ref v 1))
(define-syntax define-values:
(check-top
(lambda (stx)
(syntax-case stx (:)
[(_ (id ...) expr)
(with-syntax ([(id ...)
(map (lambda (id)
(if (identifier? id)
(begin (check-defn-keyword id stx)
id)
(syntax-case id (:)
[(id : type)
(begin (check-defn-keyword #'id stx) #'id)]
[else
(raise-syntax-error
#f
"expected <id> or `[<id> : <type>]'"
stx
id)])))
(syntax->list #'(id ...)))])
(syntax/loc stx
(define-values (id ...) (vector->values expr))))]))))
(define-syntax lambda:
(check-top
(lambda (stx)
(syntax-case stx (:)
[(_ (arg ...) : type expr)
(with-syntax ([(arg ...)
(map (parse-arg stx) (syntax->list #'(arg ...)))])
(syntax/loc stx
(lambda (arg ...) (#%expression expr))))]
[(_ (arg ...) expr)
(with-syntax ([(arg ...)
(map (parse-arg stx) (syntax->list #'(arg ...)))])
(syntax/loc stx
(lambda (arg ...) (#%expression expr))))]))))
(begin-for-syntax
;; Used to declare a variant name so that `shared' can create instances
(struct constructor-syntax (id selectors mutators)
#:property prop:set!-transformer
(lambda (c stx)
(with-syntax ([id (syntax-property (constructor-syntax-id c)
'constructor-for
(syntax-case stx (set!)
[(set! id . _) #'id]
[(id . _) #'id]
[_ stx]))])
(syntax-case stx (set!)
[(set! _ rhs) (syntax/loc stx (set! id rhs))]
[(_ arg ...) (syntax/loc stx (id arg ...))]
[_ #'id])))
#:property prop:struct-info
(lambda (c)
(list #f
(constructor-syntax-id c)
#f
(reverse (constructor-syntax-selectors c))
(reverse (constructor-syntax-mutators c))
#f))))
(define-for-syntax expand-define-type
(lambda (stx)
(syntax-case stx (:)
[(_ thing . rest)
(not (or (identifier? #'thing)
(syntax-case #'thing (quote:)
[(id (quote: arg) ...)
(and (identifier? #'id)
(andmap identifier? (syntax->list #'(arg ...))))]
[_ #f])))
(raise-syntax-error
#f
"expected an <id> for a type name or (<id> '<id> ...) for polymorphic type"
stx
#'thing)]
[(_ id [variant (field : type) ...] ...)
(with-syntax ([id (if (identifier? #'id)
#'id
(syntax-case #'id (quote:)
[(id (quote: arg) ...)
#'id]))]
[($variant ...) (map (lambda (variant)
(datum->syntax variant
(string->uninterned-symbol
(symbol->string (syntax-e variant)))
variant
variant))
(syntax->list #'(variant ...)))]
[((variant? (variant-field set-variant-field!) ...) ...)
(map (lambda (variant fields)
(cons
(datum->syntax variant
(string->symbol
(format "~a?" (syntax-e variant)))
variant
variant)
(map (lambda (field)
(define (mk fmt)
(datum->syntax variant
(string->symbol
(format fmt
(syntax-e variant)
(syntax-e field)))
variant
variant))
(list (mk "~a-~a") (mk "set-~a-~a!")))
(syntax->list fields))))
(syntax->list #'(variant ...))
(syntax->list #'((field ...) ...)))])
(let ([dup (check-duplicate-identifier
(syntax->list #'(id
variant ...
variant? ...
variant-field ... ...
set-variant-field! ... ...)))])
(when dup
(raise-syntax-error #f
"duplicate definition for identifier"
stx
dup)))
(let ([s #'(define-type id
[$variant (field (lambda (x) #t)) ...] ...)])
#`(begin
#,(datum->syntax stx (syntax-e s) stx stx)
(define-syntax variant (constructor-syntax
(quote-syntax $variant)
(list (quote-syntax variant-field)
...)
(list (quote-syntax set-variant-field!)
...)))
...)))]
[(_ id thing ...)
(for-each (lambda (thing)
(syntax-case thing ()
[[variant thing ...]
(for-each (lambda (thing)
(syntax-case thing (:)
[(field : type) 'ok]
[_ (raise-syntax-error
#f
"expected `(<id> : <type>)'"
stx
thing)]))
(syntax->list #'(thing ...)))]
[_ (raise-syntax-error
#f
"expected `[<id> (<id> : <type>) ...]'"
stx
thing)]))
(syntax->list #'(thing ...)))])))
(define-syntax define-type:
(check-top expand-define-type))
(define-syntax define-type-alias
(check-top
(lambda (stx)
(syntax-case stx (quote:)
[(_ (id (quote: arg) ...) t)
(begin
(map (lambda (id)
(unless (identifier? id)
(raise-syntax-error #f "expected an identifier" stx id)))
(syntax->list #'(id arg ...)))
(check-defn-keyword #'id stx)
#'(void))]
[(_ id t)
(let ([id #'id])
(unless (identifier? id)
(raise-syntax-error #f "expected `<id>' or `(<id> '<id> ...)'" stx id))
(check-defn-keyword #'id stx)
#'(void))]))))
(define-syntax begin:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ e0 e ...)
(with-syntax ([body (syntax/loc stx
(begin e0 e ...))])
#'(#%expression body))]))))
(define-syntax local:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ ((def . _d) ...) e)
(andmap (lambda (def)
(syntax-case def (define: define-values:)
[define: #t]
[define-values: #t]
[_ #f]))
(syntax->list #'(def ...)))
(syntax/loc stx
(local ((def . _d) ...) (#%expression e)))]
[(_ (thing ...) e)
(for-each (lambda (thing)
(syntax-case thing (define: define-values:)
[(define: . _) 'ok]
[(define-values: . _) 'ok]
[else (raise-syntax-error
#f
"expected a function, constant, or tuple definition"
thing)]))
(syntax->list #'(thing ...)))]))))
(define-syntax parameterize:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ ([param-expr rhs-expr] ...) e)
(syntax/loc stx
(parameterize ([param-expr rhs-expr] ...) e))]))))
(define-for-syntax (make-let kind)
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ ([id rhs] ...) body)
(let ([ids (syntax->list #'(id ...))])
(for ([id (in-list ids)])
(unless (identifier? id) (raise-syntax-error #f
"expected an identifier"
stx
id)))
(case kind
[(letrec) (syntax/loc stx (local: [(define: id rhs) ...] body))]
[(let) (with-syntax ([(tmp ...) (generate-temporaries ids)])
(syntax/loc stx
(local: [(define: tmp rhs) ...]
(local: [(define: id tmp) ...]
body))))]
[(let*) (let loop ([ids ids]
[rhss (syntax->list #'(rhs ...))])
(cond
[(empty? ids) #'body]
[else (with-syntax ([body (loop (cdr ids) (cdr rhss))]
[id (car ids)]
[rhs (car rhss)]
[tmp (car (generate-temporaries (list (car ids))))])
(syntax/loc stx
(local: [(define: tmp rhs)]
(local: [(define: id tmp)]
body))))]))]))]))))
(define-syntax letrec: (make-let 'letrec))
(define-syntax let: (make-let 'let))
(define-syntax let*: (make-let 'let*))
(define-syntax shared:
(check-top
(lambda (stx)
(if (eq? (syntax-local-context) 'expression)
(syntax-case stx ()
[(_ ([id rhs] ...) body)
(let ([ids (syntax->list #'(id ...))])
(for ([id (in-list ids)])
(check-defn-keyword id stx))
(syntax/loc stx
(shared ([id rhs] ...) body)))])
#`(#%expression #,stx)))))
(define-for-syntax (convert-clauses stx)
;; Preserve srcloc of each clause:
(map (lambda (clause)
(syntax-case clause (else)
[[variant (id ...) ans]
(for-each (lambda (id)
(when (is-keyword? id)
(raise-syntax-error
#f
"cannot bind a keyword"
stx
id)))
(syntax->list #'(id ...)))
(with-syntax ([$variant (let ([c (syntax-local-value #'variant (lambda () #f))])
(if (constructor-syntax? c)
(let ([id (constructor-syntax-id c)])
(datum->syntax id (syntax-e id) #'variant))
#'variant))])
(syntax/loc clause
[$variant (id ...) (#%expression ans)]))]
[[else ans]
(syntax/loc clause
[else (#%expression ans)])]))
(syntax-case stx ()
[(_ type expr clause ...)
(syntax->list #'(clause ...))])))
(define-for-syntax (signal-typecase-syntax-error stx)
(syntax-case stx ()
[(_ type expr clause ...)
(let* ([clauses (syntax->list #'(clause ...))]
[len (length clauses)])
(for ([clause (in-list clauses)]
[pos (in-naturals)])
(syntax-case clause (else)
[[variant (id ...) ans]
(identifier? #'variant)
'ok]
[[(variant args ...) (id ...) ans]
(identifier? #'variant)
'ok]
[[else ans]
(if (= pos (sub1 len))
'ok
(raise-syntax-error
#f
"misplaced `else' clause"
stx
clause))]
[[var . rest]
(not (identifier? #'var))
(raise-syntax-error
#f
"expected an identifier from a define-type"
stx
#'var)]
[[var ids . rest]
(syntax-case #'ids ()
[(x ...) (andmap identifier? (syntax->list #'(x ...))) #f]
[else #t])
(raise-syntax-error
#f
(format "second piece of the ~a clause must be a sequence of identifiers"
(syntax-e #'var))
stx
clause)]
[[var ids ans1 ans2 . ans]
(raise-syntax-error
#f
"clause does not contain a single result expression"
stx
clause)]
[[variant (id ...) ans ...]
(andmap identifier? (syntax->list #'(id ...)))
(raise-syntax-error
#f
"clause does not contain a single result expression"
stx
clause)]
[else (raise-syntax-error
#f
"ill-formed clause"
stx
clause)])))]
[else
(raise-syntax-error #f "ill-formed type-case" stx)]))
(define-syntax type-case:
(check-top
(lambda (stx)
(syntax-case stx (else)
[(_ thing . rest)
(not (or (identifier? #'thing)
(syntax-case #'thing ()
[(id arg ...)
(identifier? #'id)]
[_ #f])))
(raise-syntax-error
#f
"expected an <id> for a type name or `(<id> <type> ...)' for polymorphic type"
stx
#'thing)]
[(_ type expr [variant (id ...) ans] ...)
(with-syntax ([type (if (identifier? #'type)
#'type
(syntax-case #'type ()
[(id arg ...) #'id]))]
[(clause ...) (convert-clauses stx)])
(syntax/loc stx
(type-case type expr clause ...)))]
[(_ type expr [variant (id ...) ans] ... [else else-ans])
(with-syntax ([type (if (identifier? #'type)
#'type
(syntax-case #'type ()
[(id arg ...) #'id]))]
[(clause ...) (convert-clauses stx)])
(syntax/loc stx
(type-case type expr clause ...)))]
[_
(signal-typecase-syntax-error stx)]))))
(define-syntax cond:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ [ques ans] ...)
(with-syntax ([(catch ...)
(let ([ques (syntax->list #'(ques ...))])
(if (and (pair? ques)
(identifier? (last ques))
(free-identifier=? (last ques) #'else))
null
#'([else (cond-error)])))])
(syntax/loc stx
(cond [ques (#%expression ans)] ... catch ...)))]
[(_ thing ...)
(for-each (lambda (thing)
(syntax-case thing ()
[[ques ans] 'ok]
[_else (raise-syntax-error
#f
"expected [<test-expr> <result-expr>]"
stx
thing)]))
(syntax->list #'(thing ...)))]))))
(define (cond-error)
(error 'cond "no matching clause"))
(define-syntax case:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ expr [alts ans] ...)
(with-syntax ([(catch ...)
(let loop ([altss (syntax->list #'(alts ...))] [kind #f])
(if (null? altss)
#'([else (case-error)])
(syntax-case (car altss) (else)
[else
(if (null? (cdr altss))
'()
(raise-syntax-error #f
"an `else' case must be last"
stx
(car altss)))]
[(id ...)
(let id-loop ([ids (syntax->list #'(id ...))]
[kind kind])
(if (null? ids)
(loop (cdr altss) kind)
(let ([id (car ids)])
(unless (or (identifier? id)
(number? (syntax-e id)))
(raise-syntax-error #f
"alternative must be a symbol or a number"
stx
id))
(let ([new-kind (if (identifier? id)
'symbol
'number)])
(when (and kind (not (eq? new-kind kind)))
(raise-syntax-error #f
(format "~a disallowed after preceding ~a"
new-kind
kind)
stx
id))
(id-loop (cdr ids) new-kind)))))]
[_ (raise-syntax-error #f
"expected (<id/num> ...)"
stx
(car altss))])))])
(syntax/loc stx
(case expr [alts (#%expression ans)] ... catch ...)))]
[(_ expr thing ...)
(for-each (lambda (thing)
(syntax-case thing ()
[[alts ans] 'ok]
[_else (raise-syntax-error
#f
"expected [(<id/num> ...) <result-expr>] or [else <result-expr>]"
stx
thing)]))
(syntax->list #'(thing ...)))]))))
(define (case-error)
(error 'case "no matching clause"))
(define-syntax if:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ test then else)
(syntax/loc stx
(if test then else))]
[(_ test then)
(raise-syntax-error #f
"missing else-expression"
stx)]))))
(define-syntax when:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ tst expr ...)
(syntax/loc stx (when tst expr ...))]))))
(define-syntax unless:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ tst expr ...)
(syntax/loc stx (unless tst expr ...))]))))
(define-for-syntax (check-quoted stx on-escaped)
(let loop ([s stx] [qq 0])
(define (fst s) (car (syntax-e s)))
(define (d->s s e) (datum->syntax s e s s))
(define (default s)
(or (and (let ([v (syntax-e s)])
(or (symbol? v)
(number? v)
(string? v)
(boolean? v)))
s)
(let ([l (syntax->list s)])
(and l
(d->s s (map (lambda (v) (loop v qq)) l))))
(raise-syntax-error #f
"disallowed content; not a symbol, number, string, or list"
stx
s)))
(if on-escaped
(syntax-case s (unquote unquote-splicing quasiquote:)
[(unquote e) (if (zero? qq)
(on-escaped s)
(d->s s `(,(fst s) ,(loop #'e (sub1 qq)))))]
[(unquote-splicing e) (if (zero? qq)
(on-escaped s)
(d->s s `(,(fst s) ,(loop #'e (sub1 qq)))))]
[(quasiquote: e) (d->s s `(,(syntax/loc (fst s) quasiquote)
,(loop #'e (add1 qq))))]
[unquote (raise-syntax-error #f "bad syntax" s)]
[unquote-splicing (raise-syntax-error #f "bad syntax" s)]
[quasiquote: (raise-syntax-error #f "bad syntax" s)]
[_ (default s)])
(default s))))
(define-syntax quote:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ s)
(begin
(check-quoted stx #f)
#'(quote s))]))))
(define-syntax quasiquote:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ s)
(check-quoted stx (lambda (s) s))]))))
(define-syntax and:
(check-top
(syntax-rules ()
[(_ arg ...) (and arg ...)])))
(define-syntax or:
(check-top
(syntax-rules ()
[(_ arg ...) (or arg ...)])))
(define-syntax set!:
(check-top
(lambda (stx)
(syntax-case stx ()
[(_ id expr)
(if (identifier? #'id)
#'(set! id expr)
(raise-syntax-error #f
"expected an identifier"
stx
#'id))]))))
(define-syntax has-type
(check-top
(syntax-rules (:)
[(_ expr : type) expr])))
(define-syntax time:
(check-top
(syntax-rules ()
[(_ expr) (time expr)])))
(define-syntax trace:
(check-top
(lambda (stx)
(unless (eq? (syntax-local-context) 'module)
(raise-syntax-error #f "allowed only module top level" stx))
(syntax-case stx ()
[(_ id ...)
(let ([ids (syntax->list #'(id ...))])
(for-each (lambda (id)
(unless (identifier? id)
(raise-syntax-error 'trace
"expected an identifier"
id))
(let ([b (identifier-binding id)])
(when b
(let-values ([(base name) (module-path-index-split (car b))])
(when (or base name)
(printf "~s\n" (list base name))
(raise-syntax-error 'trace
"not a defined name in this module"
id))))))
ids)
#'(trace id ...))]))))
(define-syntax: let/cc
(lambda (stx)
(syntax-case stx ()
[(_ id expr)
(begin
(unless (identifier? #'id)
(raise-syntax-error #f "expected an identifier" stx #'id))
(syntax/loc stx (call/cc (lambda: (id) expr))))])))
;; ----------------------------------------
(define-for-syntax (mk stx . l)
(datum->syntax
stx
(string->symbol
(apply string-append
(map (lambda (e)
(if (string? e)
e
(symbol->string (syntax-e e))))
l)))))
(define-for-syntax (rename-ids ids expr)
(cond
[(null? ids) expr]
[else
(define d (syntax-local-make-definition-context))
(syntax-local-bind-syntaxes ids #f d)
(internal-definition-context-seal d)
(internal-definition-context-apply d expr)]))
(define-for-syntax (extract-definition-ids defn)
(syntax-case defn (: define-type: define: define-values:
define-type-alias)
[(define-type: name [variant (field-id : field-type) ...] ...)
(let-values ([(name args)
(syntax-case #'name (quote:)
[(name (quote arg) ...)
(values #'name (syntax->list #'(arg ...)))]
[else (values #'name null)])])
(apply append
(list #'id)
(map (lambda (var fields)
(list* var
(mk var var "?")
(map (lambda (field)
(mk var var "-" field))
(syntax->list fields))))
(syntax->list #'(variant ...))
(syntax->list #'((field-id ...) ...)))))]
[(define-type-alias (id (quote: arg) ...) t)
(list #'id)]
[(define-type-alias id t)
(list #'id)]
[(define: (id arg ...) . rest)
(list #'id)]
[(define: id : type expr)
(list #'id)]
[(define: id expr)
(list #'id)]
[(define-values: (id ...) rhs)
(syntax->list #'(id ...))]
[_ null]))
;; Since we manage macro expansion during type checking, we're also
;; responsible for renaming at local-binding forms:
(define-for-syntax (rename expr)
(syntax-case expr (: lambda: local: letrec: let: let*: shared:
type-case:)
[(lambda: (arg ...) . _)
(rename-ids (map (lambda (arg)
(syntax-case arg (:)
[(id : type) #'id]
[else arg]))
(syntax->list #'(arg ...)))
expr)]
[(local: [defn ...] body)
(rename-ids (apply append
(map extract-definition-ids
(syntax->list #'(defn ...))))
expr)]
[(letrec: ([id rhs] ...) body)
(rename-ids (syntax->list #'(id ...)) expr)]
[(let: ([id rhs] ...) body)
(rename-ids (syntax->list #'(id ...)) expr)]
[(let*: ([id rhs] ...) body)
(rename-ids (syntax->list #'(id ...)) expr)]
[(shared: ([id rhs] ...) body)
(rename-ids (syntax->list #'(id ...)) expr)]
[(type-case: type val clause ...)
(quasisyntax/loc expr
(#,(car (syntax-e expr)) type val
#,@(map (lambda (clause)
(syntax-case clause ()
[[variant (id ...) ans]
(rename-ids (syntax->list #'(id ...)) clause)]
[_ clause]))
(syntax->list #'(clause ...)))))]
[_ expr]))
(define-for-syntax (typecheck-defns tl datatypes opaques aliases init-env init-variants just-id?
poly-context orig-let-polys submods)
;; The `base-tvars` is a mapping from type names to type variables
;; for type variables written in the source. Since we have to infer
;; where type variables are bound, at each binding layer we create a
;; fresh box to represent that layer and mutate the box to add
;; variables that haven't been seen before, so they're apparently
;; bound at the layer represented by the box.
(let* ([poly-context (cons (gensym) poly-context)]
[datatypes (append (filter
values
(map
(lambda (stx)
(syntax-case stx (define-type:)
[(define-type: (name arg ...) . _)
(cons #'name (length (syntax->list #'(arg ...))))]
[(define-type: name . _) (cons #'name 0)]
[else #f]))
tl))
datatypes)]
[apply-renames (lambda (spec l cdrs-too?)
(syntax-case spec (rename-in)
[(rename-in spec [old-id new-id] ...)
(let ()
(define old-ids (syntax->list #'(old-id ...)))
(define new-ids (syntax->list #'(new-id ...)))
(map (lambda (p)
(let loop ([old-ids old-ids]
[new-ids new-ids])
(cond
[(null? old-ids) p]
[(free-identifier=? (car old-ids) (car p))
(cons (car new-ids) (cdr p))]
[(and cdrs-too?
(free-identifier=? (car old-ids) (cdr p)))
(cons (car p) (car new-ids))]
[else (loop (cdr old-ids) (cdr new-ids))])))
l))]))]
[opaques (append (apply
append
(map
(lambda (stx)
(syntax-case stx (require:)
[(require: spec ...)
(let loop ([specs (syntax->list #'(spec ...))])
(apply
append
(map (lambda (spec)
(syntax-case spec (opaque-type-in rename-in)
[(opaque-type-in lib [id pred] ...)
(map cons
(syntax->list #'(id ...))
(syntax->list #'(pred ...)))]
[(rename-in sub-spec . _)
(apply-renames spec (loop (list #'sub-spec)) #t)]
[_ null]))
specs)))]
[else
null]))
tl))
opaques)]
[aliases (append (for/fold ([aliases null]) ([stx (in-list tl)])
(syntax-case stx (define-type-alias quote:)
[(define-type-alias (name (quote: arg) ...) ty)
(cons (list #'name (syntax->list #'(arg ...)) #'ty)
aliases)]
[(define-type-alias name ty)
(cons (list #'name null #'ty) aliases)]
[else aliases]))
aliases)]
[make-polymorphic-wrt
(lambda (t ty tvars)
(let loop ([tvars tvars][ty ty])
(if (null? tvars)
ty
(make-poly t
(car tvars)
(loop (cdr tvars) ty)))))]
[parse-type/tenv
(lambda (t tenv)
(let ([tvars null])
(let ([ty
(letrec ([parse-one
(lambda (seen tenv t)
(let loop ([t t])
(syntax-case t (number boolean symbol string: char s-expression
gensym listof: boxof: hashof: parameterof: void: ->
vectorof: quote: * optionof)
[(quote: id)
(identifier? #'id)
(let ([a (ormap (lambda (p)
(and (free-identifier=? (car p) #'id)
p))
(append tenv
tvars))])
(if a
(cdr a)
(let ([t (gen-tvar #'id)])
(set! tvars (cons (cons #'id t) tvars))
t)))]
[number (make-num t)]
[boolean (make-bool t)]
[symbol (make-sym t)]
[s-expression (make-sexp t)]
[string: (make-str t)]
[char (make-chr t)]
[void: (make-vd t)]
[(gensym who) (gen-tvar #'who)]
[(arg-type ... -> result-type)
(make-arrow t
(map loop (syntax->list #'(arg-type ...)))
(loop #'result-type))]
[(listof: elem)
(make-listof t (loop #'elem))]
[(boxof: elem)
(make-boxof t (loop #'elem))]
[(vectorof: elem)
(make-vectorof t (loop #'elem))]
[(hashof: key val)
(make-hashof t (loop #'key) (loop #'val))]
[(parameterof: elem)
(make-parameterof t (loop #'elem))]
[(a * more ...)
(let ([m (syntax->list #'(more ...))])
(let loop ([m m])
(cond
[(null? m) #f]
[(null? (cdr m)) #t]
[(free-identifier=? #'* (cadr m))
(loop (cddr m))])))
(make-tupleof t
(let ploop ([m (syntax->list #'(a * more ...))])
(cond
[(null? (cdr m))
(list (loop (car m)))]
[else
(cons (loop (car m))
(ploop (cddr m)))])))]
[() (make-tupleof t null)]
[(optionof type)
(make-datatype t #'optionof (list (loop #'type)))]
[(id type0 type ...)
(let ([types (syntax->list #'(type0 type ...))])
(or (and (identifier? #'id)
(ormap (lambda (d)
(and (free-identifier=? (car d) #'id)
(if (= (cdr d) (length types))
#t
(raise-syntax-error
#f
(if (zero? (cdr d))
"bad type (incorrect use of a non-polymorphic type name)"
"type constructor applied to the wrong number of types")
t))))
datatypes)
(make-datatype t (car (syntax-e t)) (map loop types)))
(and (identifier? #'id)
(ormap (lambda (d)
(and (free-identifier=? (car d) #'id)
(if (null? types)
(make-opaque-datatype
t
(car (syntax-e t))
null
(cdr d))
(raise-syntax-error
#f
"bad type (incorrect use of a non-polymorphic type name)"
t))))
opaques))
(ormap (lambda (d)
(and (and (identifier? #'id)
(free-identifier=? (car d) #'id))
(begin
(unless (= (length (cadr d)) (length types))
(raise-syntax-error
#f
(if (zero? (cdr d))
"bad type (incorrect use of a non-polymorphic type alias name)"
"type alias constructor applied to the wrong number of types")
t))
(when (ormap (lambda (s)
(free-identifier=? s #'id))
seen)
(raise-syntax-error
#f
"recursively defined type alias"
t))
(parse-one
(cons (car d) seen)
(append (map (lambda (formal arg)
(cons formal
(loop arg)))
(cadr d)
types)
tenv)
(caddr d)))))
aliases)
(raise-syntax-error
#f
"bad type"
t)))]
[else
(or (and (identifier? t)
(ormap (lambda (d)
(and (free-identifier=? (car d) t)
(if (zero? (cdr d))
#t
(raise-syntax-error
#f
"type constructor must be applied to types"
t))))
datatypes)
(make-datatype t t null))
(and (identifier? t)
(ormap (lambda (d)
(and (free-identifier=? (car d) t)
(make-opaque-datatype
t
t
null
(cdr d))))
opaques))
(and (identifier? t)
(ormap (lambda (d)
(and (free-identifier=? (car d) t)
(begin
(unless (cadr d)
(raise-syntax-error
#f
"type alias constructor must be applied to types"
t))
(when (ormap (lambda (s)
(free-identifier=? s t))
seen)
(raise-syntax-error
#f
"recursively defined type alias"
t))
(parse-one (cons (car d) seen) tenv (caddr d)))))
aliases))
(raise-syntax-error
#f
"bad type"
t))])))])
(parse-one null tenv t))])
(make-polymorphic-wrt t ty (map cdr tvars)))))]
[parse-type (lambda (type)
(parse-type/tenv type null))]
[parse-mono-type (lambda (type)
(poly-instance (parse-type type)))]
[parse-param-type (lambda (tenv)
(lambda (type)
(poly-instance (parse-type/tenv type tenv))))]
[extract-arg-type (lambda (arg)
(syntax-case arg (:)
[(id : type) (parse-mono-type #'type)]
[_ (gen-tvar #'arg)]))]
[macros (apply append
(map
(lambda (stx)
(syntax-case stx (define-syntax:)
[(define-syntax: (id . _) . _)
(list #'id)]
[(define-syntax: id . _)
(list #'id)]
[_ null]))
tl))]
[variants (apply append
init-variants
(map
(lambda (stx)
(syntax-case stx (define-type: :)
[(define-type: name
[variant (field-id : type) ...] ...)
(let-values ([(name args)
(syntax-case #'name (quote:)
[(name (quote arg) ...)
(values #'name (syntax->list #'(arg ...)))]
[else (values #'name null)])])
(let ([arg-types (map gen-tvar args)])
(map (lambda (variant types)
(cons variant
(map (lambda (te)
(make-polymorphic-wrt
variant
((parse-param-type (map cons args arg-types)) te)
arg-types))
(syntax->list types))))
(syntax->list #'(variant ...))
(syntax->list #'((type ...) ...)))))]
[else null]))
tl))]
[is-value? (lambda (expr)
(let loop ([expr expr])
(syntax-case expr (lambda: list values: cons empty hash: quote: none some)
[(lambda: . _) #t]
[(values: a ...)
(andmap loop (syntax->list #'(a ...)))]
[(list a ...)
(andmap loop (syntax->list #'(a ...)))]
[(hash: a ...)
(andmap loop (syntax->list #'(a ...)))]
[empty #t]
[(cons a b)
(and (loop #'a) (loop #'b))]
[(id a ...)
(and (identifier? #'id)
(ormap (lambda (v)
(free-identifier=? #'id (car v)))
variants))
(andmap loop (syntax->list #'(a ...)))]
[(none) #t]
[(some e) (loop #'e)]
[(quote: a) #t]
[_ (or (identifier? expr)
(string? (syntax-e expr))
(char? (syntax-e expr))
(number? (syntax-e expr))
(boolean? (syntax-e expr)))])))]
[req-env (apply
append
(map
(lambda (stx)
(syntax-case stx (require:)
[(require: spec ...)
(let loop ([specs (syntax->list #'(spec ...))])
(apply
append
(map (lambda (spec)
(syntax-case spec (typed-in rename-in :)
[(typed-in lib (id : type) ...)
(map (lambda (id type)
(cons id (parse-type type)))
(syntax->list #'(id ...))
(syntax->list #'(type ...)))]
[(rename-in sub-spec . _)
(apply-renames spec (loop (list #'sub-spec)) #f)]
[_ null]))
specs)))]
[else
null]))
tl))]
[def-env (apply
append
(map
(lambda (stx)
(syntax-case stx (require: define: define-values: define-type: lambda: :)
[(define-values: (id ...) rhs)
(let ([val? (is-value? #'rhs)])
(map (lambda (id)
(if (identifier? id)
(cons id (if val?
(create-defn
(gen-tvar id)
poly-context)
(as-non-poly
(gen-tvar id)
poly-context)))
(syntax-case id (:)
[(id : type)
(cons #'id
(if val?
(create-defn
(parse-type #'type)
poly-context)
(as-non-poly
(parse-mono-type #'type)
poly-context)))])))
(syntax->list #'(id ...))))]
[(define: (id . args) : result-type . _body)
(list (cons #'id
(create-defn
(make-arrow
#'id
(map extract-arg-type
(syntax->list #'args))
(parse-mono-type #'result-type))
poly-context)))]
[(define: (id . args) . _body)
(list (cons #'id (create-defn (make-arrow
#'id
(map extract-arg-type (syntax->list #'args))
(gen-tvar #'id))
poly-context)))]
[(define: id : type (lambda: . _))
(list (cons #'id
(create-defn (parse-type #'type)
poly-context)))]
[(define: id (lambda: args : result-type expr))
(list (cons #'id
(create-defn
(make-arrow
#'id
(map extract-arg-type (syntax->list #'args))
(parse-mono-type #'result-type))
poly-context)))]
[(define: id (lambda: args expr))
(list (cons #'id
(create-defn
(make-arrow
#'id
(map extract-arg-type (syntax->list #'args))
(gen-tvar #'id))
poly-context)))]
[(define: id : type expr)
(list (cons #'id
(if (is-value? #'expr)
(create-defn
(parse-type #'type)
poly-context)
(as-non-poly
(parse-mono-type #'type)
poly-context))))]
[(define: id expr)
(list (cons #'id
(if (is-value? #'expr)
(create-defn
(gen-tvar #'id)
poly-context)
(as-non-poly
(gen-tvar #'id)
poly-context))))]
[(define-type: name
[variant (field-id : type) ...]
...)
(let-values ([(name args)
(syntax-case #'name (quote:)
[(name (quote arg) ...)
(values #'name (syntax->list #'(arg ...)))]
[else (values #'name null)])])
(let ([arg-tvars (map gen-tvar args)])
(apply append
(map (lambda (var fields types)
(let ([types (map (parse-param-type
(map cons args arg-tvars))
(syntax->list types))]
[dt (make-datatype name
name
arg-tvars)])
(list* (cons var
(make-polymorphic-wrt
var
(make-arrow
var
types
dt)
arg-tvars))
(cons (mk var var "?")
(make-polymorphic-wrt
var
(make-arrow
var
(list dt)
(make-bool var))
arg-tvars))
(map (lambda (field type)
(cons (mk var var "-" field)
(make-polymorphic-wrt
field
(make-arrow
field
(list dt)
type)
arg-tvars)))
(syntax->list fields)
types))))
(syntax->list #'(variant ...))
(syntax->list #'((field-id ...) ...))
(syntax->list #'((type ...) ...))))))]
[else null]))
tl))]
[env (append def-env
req-env
init-env)]
[let-polys (or orig-let-polys (box null))]
;; typecheck the sequence:
[types
(map
(lambda (tl)
(let typecheck ([expr tl] [env env])
(syntax-case (rename expr) (: require: define-type: define: define-values:
define-type-alias define-syntax: define-syntax-rule:
lambda: begin: local: letrec: let: let*:
shared: parameterize:
begin: cond: case: if: when: unless:
or: and: set!: trace:
type-case: quote: quasiquote: time:
has-type
list vector values: try
module+: module)
[(module+: name e ...)
(let*-values ([(datatypes dt-len opaques o-len aliases a-len
variants v-len env e-len
prev-macros prev-tys prev-tl-tys prev-submods)
(vector->values (hash-ref submods (syntax-e #'name)
(vector datatypes
(length datatypes)
opaques
(length opaques)
aliases
(length aliases)
variants
(length variants)
env
(length env)
null ; macros
null ; tys
null ; tl-tys
(hasheq))))]
[(tys env datatypes opaques aliases variants macros tl-tys next-submods)
(typecheck-defns (syntax->list #'(e ...))
datatypes
opaques
aliases
env
variants
#f
poly-context
let-polys
prev-submods)])
(set! submods (hash-set submods (syntax-e #'name)
(vector datatypes dt-len
opaques o-len
aliases a-len
variants v-len
env e-len
(append macros prev-macros)
(append tys prev-tys)
(append tl-tys prev-tl-tys)
next-submods))))]
[(module . _)
;; can ignore
(void)]
[(define-syntax: . _)
;; can ignore
(void)]
[(define-syntax-rule: . _)
;; can ignore
(void)]
[(require: . _)
;; handled in require env
(void)]
[(define-type: id [variant (field-id : field-type) ...] ...)
;; handled in initial env
(void)]
[(define-type-alias (id (quote: arg) ...) t)
;; check that `t' makes sense
((parse-param-type (map (lambda (arg) (cons arg (gen-tvar arg)))
(syntax->list #'(arg ...))))
#'t)]
[(define-type-alias id t)
;; check that `t' makes sense
(parse-type #'t)]
[(define: (id arg ...) . rest)
(typecheck #'(define: id (lambda: (arg ...) . rest))
env)]
[(define: id : type expr)
(unify-defn! #'expr (lookup #'id env)
(typecheck #'expr env))]
[(define: id expr)
(typecheck #'(define: id : (gensym id) expr)
env)]
[(define-values: (id ...) rhs)
(let ([id-ids (map (lambda (id)
(if (identifier? id)
id
(car (syntax-e id))))
(syntax->list #'(id ...)))]
[id-types (map (lambda (id)
(syntax-case id (:)
[(id : type)
(poly-instance (parse-type #'type))]
[else (gen-tvar id)]))
(syntax->list #'(id ...)))])
(unify! expr
(make-tupleof expr id-types)
(typecheck #'rhs env))
(for-each (lambda (id tvar)
(unify-defn! expr
(lookup id env)
tvar))
id-ids
id-types))]
[(lambda: (arg ...) : type body)
(let ([arg-ids (map (lambda (arg)
(if (identifier? arg)
arg
(car (syntax-e arg))))
(syntax->list #'(arg ...)))]
[arg-types (map (lambda (arg)
(syntax-case arg (:)
[(id : type)
(poly-instance (parse-type #'type))]
[else (gen-tvar arg)]))
(syntax->list #'(arg ...)))]
[result-type (poly-instance (parse-type #'type))])
(unify! #'body
(typecheck #'body (append (map cons
arg-ids
arg-types)
env))
result-type)
(make-arrow expr arg-types result-type))]
[(lambda: (arg ...) body)
(with-syntax ([expr expr])
(typecheck (syntax/loc #'expr
(lambda: (arg ...) : (gensym expr) body))
env))]
[(begin: e ... last-e)
(begin
(map (lambda (e)
(typecheck e env))
(syntax->list #'(e ...)))
(typecheck #'last-e env))]
[(local: [defn ...] expr)
(let-values ([(ty env datatypes opaques aliases vars macros tl-tys subs)
(typecheck-defns (syntax->list #'(defn ...))
datatypes
opaques
aliases
env
variants
#f
poly-context
let-polys
submods)])
(typecheck #'expr env))]
[(letrec: . _)
(typecheck ((make-let 'letrec) expr) env)]
[(let: . _)
(typecheck ((make-let 'let) expr) env)]
[(let*: . _)
(typecheck ((make-let 'let*) expr) env)]
[(shared: ([id rhs] ...) expr)
(let-values ([(ty env datatypes opaques aliases vars macros tl-tys subs)
(typecheck-defns (syntax->list #'((define: id rhs) ...))
datatypes
opaques
aliases
env
variants
#f
poly-context
let-polys submods)])
(typecheck #'expr env))]
[(parameterize: ([param rhs] ...) expr)
(begin
(for ([param (in-list (syntax->list #'(param ...)))]
[rhs (in-list (syntax->list #'(rhs ...)))])
(unify! #'param
(typecheck param env)
(make-parameterof rhs (typecheck rhs env))))
(typecheck #'expr env))]
[(cond: [ques ans] ...)
(let ([res-type (gen-tvar expr)])
(for-each
(lambda (ques ans)
(unless (syntax-case ques (else)
[else #t]
[_ #f])
(unify! ques
(make-bool ques)
(typecheck ques env)))
(unify! ans
res-type
(typecheck ans env)))
(syntax->list #'(ques ...))
(syntax->list #'(ans ...)))
res-type)]
[(case: expr [alts ans] ...)
(let ([res-type (gen-tvar #'expr)])
(unify! #'expr
(let loop ([alts (syntax->list #'(alts ...))])
(if (null? alts)
(make-sym #'expr)
(syntax-case (car alts) ()
[() (loop (cdr alts))]
[(v . _)
(number? (syntax-e #'v))
(make-num #'expr)]
[_ (make-sym #'expr)])))
(typecheck #'expr env))
(for-each
(lambda (ans)
(unify! #'ans
res-type
(typecheck ans env)))
(syntax->list #'(ans ...)))
res-type)]
[(if: test then else)
(begin
(unify! #'test
(make-bool #'test)
(typecheck #'test env))
(let ([then-type (typecheck #'then env)])
(unify! #'then then-type (typecheck #'else env))
then-type))]
[(when: test e ...)
(begin
(unify! #'test
(make-bool #'test)
(typecheck #'test env))
(typecheck #'(begin: e ...) env)
(make-vd expr))]
[(unless: test e ...)
(begin
(unify! #'test
(make-bool #'test)
(typecheck #'test env))
(typecheck #'(begin: e ...) env)
(make-vd expr))]
[(and: e ...)
(let ([b (make-bool expr)])
(for-each (lambda (e)
(unify! e b (typecheck e env)))
(syntax->list #'(e ...)))
b)]
[(or: e ...)
(let ([b (make-bool expr)])
(for-each (lambda (e)
(unify! e b (typecheck e env)))
(syntax->list #'(e ...)))
b)]
[(set!: id e)
(let ([t (lookup #'id env)])
(if (poly? t)
(raise-syntax-error #f
"cannot mutate identifier with a polymorphic type"
expr
#'id)
(unify-defn! #'id t (typecheck #'e env))))
(make-vd expr)]
[(trace: id ...)
(let ([ids (syntax->list #'(id ...))])
(for-each (lambda (id)
(unify! id (gen-tvar id #t) (typecheck id env)))
ids)
(make-tupleof expr null))]
[(type-case: type val [variant (id ...) ans] ...)
(let ([type (parse-mono-type #'type)]
[res-type (gen-tvar expr)])
(unify! #'val type (typecheck #'val env))
(for-each (lambda (var ids ans)
(let ([id-lst (syntax->list ids)]
[variant-params (lookup var variants)])
(unless (= (length id-lst)
(length variant-params))
(raise-syntax-error 'type-case
(format "variant ~a has ~a fields in the definition but ~a fields here at a use"
(syntax-e var)
(length variant-params)
(length id-lst))
var))
(unify!
expr
res-type
(typecheck ans
(append (map (lambda (id ftype)
(cons id
(instantiate-constructor-at
ftype
type)))
id-lst
variant-params)
env)))))
(syntax->list #'(variant ...))
(syntax->list #'((id ...) ...))
(syntax->list #'(ans ...)))
res-type)]
[(type-case: type val [variant (id ...) ans] ... [else else-ans])
(let ([t (typecheck (syntax/loc expr
(type-case: type val [variant (id ...) ans] ...))
env)])
(unify! #'else-ans t (typecheck #'else-ans env))
t)]
[(type-case: . rest)
(signal-typecase-syntax-error expr)]
[(quote: sym)
(if (identifier? #'sym)
(make-sym expr)
(make-sexp expr))]
[(quasiquote: e)
(check-quoted #'e (lambda (stx)
(syntax-case stx (unquote unquote-splicing)
[(unquote e) (unify! #'e
(typecheck #'e env)
(make-sexp #f))]
[(unquote-splicing e) (unify! #'e
(typecheck #'e env)
(make-listof #f (make-sexp #f)))])))
(make-sexp expr)]
[(time: expr)
(typecheck #'expr env)]
[(has-type expr : type)
(let ([t (typecheck #'expr env)]
[ty (parse-mono-type #'type)])
(unify! #'expr t ty)
ty)]
[(try expr1 (lambda: () expr2))
(let ([t (typecheck #'expr1 env)])
(unify! #'expr2 t (typecheck #'expr2 env))
t)]
[(list arg ...)
(let ([t (gen-tvar expr)])
(for-each (lambda (arg)
(unify! arg t (typecheck arg env)))
(syntax->list #'(arg ...)))
(make-listof expr t))]
[list
(raise-syntax-error #f
"list constructor must be applied directly to arguments"
expr)]
[(vector arg ...)
(let ([t (gen-tvar expr)])
(for-each (lambda (arg)
(unify! arg t (typecheck arg env)))
(syntax->list #'(arg ...)))
(make-vectorof expr t))]
[vector
(raise-syntax-error #f
"vector constructor must be applied directly to arguments"
expr)]
[(values: arg ...)
(make-tupleof expr
(map (lambda (arg)
(typecheck arg env))
(syntax->list #'(arg ...))))]
[values:
(raise-syntax-error #f
"tuple constructor must be applied directly to arguments"
expr)]
[(id . _)
(and (identifier? #'id)
(typed-macro? (syntax-local-value #'id (lambda () #f))))
(typecheck (local-expand-typed expr) env)]
[(f arg ...)
(let ([res-type (gen-tvar expr)])
(unify! #'f
(typecheck #'f env)
(make-arrow #'f
(map (lambda (arg)
(typecheck arg env))
(syntax->list #'(arg ...)))
res-type)
#:function-call? #t)
res-type)]
[_else
(cond
[(identifier? expr)
(let ([t (lookup expr env)])
(if just-id?
t
(at-source (poly-instance t) expr)))]
[(boolean? (syntax-e expr))
(make-bool expr)]
[(number? (syntax-e expr))
(make-num expr)]
[(string? (syntax-e expr))
(make-str expr)]
[(char? (syntax-e expr))
(make-chr expr)]
[(eq? (void) (syntax-e expr))
(void)]
[else
(raise-syntax-error #f
"don't know how to typecheck"
expr)])])))
tl)])
(set-box! let-polys (cons def-env (unbox let-polys)))
(define poly-env
(if orig-let-polys
def-env
(let-based-poly! (apply append (unbox let-polys)))))
(define poly-def-env
(if (eq? poly-env def-env)
def-env
(take poly-env (length def-env))))
(values
types
(if (eq? def-env poly-def-env)
env
(append poly-def-env
req-env
init-env))
datatypes
opaques
aliases
variants
macros
poly-def-env
submods)))
(define-for-syntax tl-env #f)
(define-for-syntax tl-datatypes #f)
(define-for-syntax tl-opaques #f)
(define-for-syntax tl-aliases #f)
(define-for-syntax tl-variants #f)
(define-for-syntax tl-submods #f)
(define-for-syntax (do-original-typecheck tl)
(let ([datatypes null]
[opaques null]
[aliases null]
[init-env (let ([NN->N (make-arrow #f
(list (make-num #f)
(make-num #f))
(make-num #f))]
[N->N (make-arrow #f
(list (make-num #f))
(make-num #f))]
[NN->B (make-arrow #f
(list (make-num #f)
(make-num #f))
(make-bool #f))]
[N->B (make-arrow #f
(list (make-num #f))
(make-bool #f))]
[N (make-num #f)]
[B (make-bool #f)]
[STR (make-str #f)]
[CHAR (make-chr #f)]
[SYM (make-sym #f)]
[BOOL (make-bool #f)])
(define-syntax-rule (POLY a e)
(let ([a (gen-tvar #f)]) (make-poly #f a e)))
(list
(cons #'error
(POLY a
(make-arrow #f
(list SYM
STR)
a)))
(cons #'void:
(make-arrow #f null (make-vd #f)))
(cons #'not
(make-arrow #f
(list B)
B))
(cons #'+ NN->N)
(cons #'- NN->N)
(cons #'/ NN->N)
(cons #'* NN->N)
(cons #'= NN->B)
(cons #'< NN->B)
(cons #'> NN->B)
(cons #'<= NN->B)
(cons #'>= NN->B)
(cons #'min NN->N)
(cons #'max NN->N)
(cons #'modulo NN->N)
(cons #'remainder NN->N)
(cons #'floor N->N)
(cons #'ceiling N->N)
(cons #'add1 N->N)
(cons #'sub1 N->N)
(cons #'zero? N->B)
(cons #'odd? N->B)
(cons #'even? N->B)
(cons #'symbol=? (make-arrow #f
(list SYM
SYM)
B))
(cons #'string=? (make-arrow #f
(list STR
STR)
B))
(cons #'char=? (make-arrow #f
(list CHAR
CHAR)
B))
(cons #'make-hash: (POLY a (POLY b (make-arrow #f
(list (make-listof
#f
(make-tupleof
#f
(list a b))))
(make-hashof #f a b)))))
(cons #'hash: (POLY a (POLY b (make-arrow #f
(list (make-listof
#f
(make-tupleof
#f
(list a b))))
(make-hashof #f a b)))))
(cons #'hash-ref: (POLY a (POLY b (make-arrow #f
(list (make-hashof #f a b)
a)
(make-datatype #f #'optionof (list b))))))
(cons #'hash-set! (POLY a (POLY b (make-arrow #f
(list (make-hashof #f a b)
a
b)
(make-vd #f)))))
(cons #'hash-remove! (POLY a (POLY b (make-arrow #f
(list (make-hashof #f a b)
a)
(make-vd #f)))))
(cons #'hash-set (POLY a (POLY b (make-arrow #f
(list (make-hashof #f a b)
a
b)
(make-hashof #f a b)))))
(cons #'hash-remove (POLY a (POLY b (make-arrow #f
(list (make-hashof #f a b)
a)
(make-hashof #f a b)))))
(cons #'hash-keys (POLY a (POLY b (make-arrow #f
(list (make-hashof #f a b))
(make-listof #f a)))))
(cons #'s-exp-symbol? (make-arrow #f
(list (make-sexp #f))
B))
(cons #'s-exp->symbol (make-arrow #f
(list (make-sexp #f))
SYM))
(cons #'symbol->s-exp (make-arrow #f
(list SYM)
(make-sexp #f)))
(cons #'s-exp-number? (make-arrow #f
(list (make-sexp #f))
B))
(cons #'s-exp->number (make-arrow #f
(list (make-sexp #f))
N))
(cons #'number->s-exp (make-arrow #f
(list N)
(make-sexp #f)))
(cons #'s-exp-string? (make-arrow #f
(list (make-sexp #f))
B))
(cons #'s-exp->string (make-arrow #f
(list (make-sexp #f))
STR))
(cons #'string->s-exp (make-arrow #f
(list STR)
(make-sexp #f)))
(cons #'s-exp-boolean? (make-arrow #f
(list (make-sexp #f))
B))
(cons #'s-exp->boolean (make-arrow #f
(list (make-sexp #f))
BOOL))
(cons #'boolean->s-exp (make-arrow #f
(list BOOL)
(make-sexp #f)))
(cons #'s-exp-list? (make-arrow #f
(list (make-sexp #f))
B))
(cons #'s-exp->list (make-arrow #f
(list (make-sexp #f))
(make-listof #f (make-sexp #f))))
(cons #'list->s-exp (make-arrow #f
(list (make-listof #f (make-sexp #f)))
(make-sexp #f)))
(cons #'read: (make-arrow #f null (make-sexp #f)))
(cons #'equal? (POLY a (make-arrow #f
(list a a)
B)))
(cons #'eq? (POLY a (make-arrow #f
(list a a)
B)))
(cons #'test: (POLY a (make-arrow #f
(list a a)
(make-vd #f))))
(cons #'test/exn: (POLY a (make-arrow #f
(list a
STR)
(make-vd #f))))
(cons #'print-only-errors (make-arrow #f
(list B)
(make-vd #f)))
(cons #'call/cc (POLY a
(POLY b
(make-arrow #f
(list (make-arrow
#f
(list (make-arrow
#f
(list a)
b))
a))
a))))
(cons #'true B)
(cons #'false B)
(cons #'empty (POLY a (make-listof #f a)))
(cons #'cons (POLY a (make-arrow #f
(list a (make-listof #f a))
(make-listof #f a))))
(cons #'cons? (POLY a (make-arrow #f
(list (make-listof #f a))
B)))
(cons #'empty? (POLY a (make-arrow #f
(list (make-listof #f a))
B)))
(cons #'first (POLY a (make-arrow #f
(list (make-listof #f a))
a)))
(cons #'rest (POLY a (make-arrow #f
(list (make-listof #f a))
(make-listof #f a))))
(cons #'second (POLY a
(make-arrow #f
(list (make-listof #f a))
a)))
(cons #'third (POLY a (make-arrow #f
(list (make-listof #f a))
a)))
(cons #'fourth (POLY a (make-arrow #f
(list (make-listof #f a))
a)))
(cons #'list-ref (POLY a (make-arrow #f
(list (make-listof #f a)
N)
a)))
(cons #'build-list (POLY a (make-arrow #f
(list N
(make-arrow #f
(list N)
a))
(make-listof #f a))))
(cons #'length (POLY a (make-arrow #f
(list (make-listof #f a))
N)))
(cons #'map (POLY a
(POLY b
(make-arrow #f
(list (make-arrow #f (list a) b)
(make-listof #f a))
(make-listof #f b)))))
(cons #'map2 (POLY a
(POLY b
(POLY c
(make-arrow #f
(list (make-arrow #f (list a b) c)
(make-listof #f a)
(make-listof #f b))
(make-listof #f c))))))
(cons #'member: (POLY a (make-arrow #f
(list a
(make-listof #f a))
B)))
(cons #'filter (POLY a (make-arrow #f
(list (make-arrow #f
(list a)
B)
(make-listof #f a))
(make-listof #f a))))
(cons #'foldl (POLY a
(POLY b
(make-arrow #f
(list (make-arrow #f (list a b) b)
b
(make-listof #f a))
b))))
(cons #'foldr (POLY a
(POLY b
(make-arrow #f
(list (make-arrow #f (list a b) b)
b
(make-listof #f a))
b))))
(cons #'reverse (POLY a (make-arrow #f
(list (make-listof #f a))
(make-listof #f a))))
(cons #'append (POLY a (make-arrow #f
(list (make-listof #f a)
(make-listof #f a))
(make-listof #f a))))
(cons #'box (POLY a (make-arrow #f
(list a)
(make-boxof #f a))))
(cons #'unbox (POLY a (make-arrow #f
(list (make-boxof #f a))
a)))
(cons #'set-box! (POLY a (make-arrow #f
(list (make-boxof #f a) a)
(make-vd #f))))
(cons #'make-vector (POLY a (make-arrow #f
(list N a)
(make-vectorof #f a))))
(cons #'vector-ref (POLY a (make-arrow #f
(list (make-vectorof #f a)
N)
a)))
(cons #'vector-set! (POLY a (make-arrow #f
(list (make-vectorof #f a)
N
a)
(make-vd #f))))
(cons #'vector-length (POLY a (make-arrow #f
(list (make-vectorof #f a))
N)))
(cons #'make-parameter (POLY a (make-arrow #f
(list a)
(make-parameterof #f a))))
(cons #'parameter-ref (POLY a (make-arrow #f
(list (make-parameterof #f a))
a)))
(cons #'parameter-set! (POLY a (make-arrow #f
(list (make-parameterof #f a)
a)
(make-vd #f))))
(cons #'string-append (make-arrow #f
(list STR STR)
STR))
(cons #'string->symbol (make-arrow #f
(list STR)
SYM))
(cons #'symbol->string (make-arrow #f
(list SYM)
STR))
(cons #'identity (POLY a
(make-arrow #f
(list a)
a)))
(cons #'to-string (POLY a
(make-arrow #f
(list a)
STR)))
(cons #'display (POLY a
(make-arrow #f
(list a)
(make-vd #f))))
(cons #'string-ref (make-arrow #f
(list STR N)
CHAR))
(cons #'string-length (make-arrow #f
(list STR)
N))
(cons #'substring (make-arrow #f
(list STR N N)
STR))
(cons #'string->list (make-arrow #f
(list STR)
(make-listof #f CHAR)))
(cons #'list->string (make-arrow #f
(list (make-listof #f CHAR))
STR))
(cons #'none (POLY a (make-arrow #f
(list)
(make-datatype #f #'optionof (list a)))))
(cons #'some (POLY a (make-arrow #f
(list a)
(make-datatype #f #'optionof (list a)))))
(cons #'none? (POLY a (make-arrow #f
(list
(make-datatype #f #'optionof (list a)))
B)))
(cons #'some? (POLY a (make-arrow #f
(list
(make-datatype #f #'optionof (list a)))
B)))
(cons #'some-v (POLY a (make-arrow #f
(list
(make-datatype #f #'optionof (list a)))
a)))
(cons #'pair (POLY a
(POLY b
(make-arrow #f
(list a b)
(make-tupleof #f (list a b))))))
(cons #'fst (POLY a
(POLY b
(make-arrow #f
(list (make-tupleof #f (list a b)))
a))))
(cons #'snd (POLY a
(POLY b
(make-arrow #f
(list (make-tupleof #f (list a b)))
b))))
))]
[init-variants (list
(cons #'none (list))
(cons #'some (list (let ([a (gen-tvar #f)])
(make-poly #f a a)))))])
(typecheck-defns (expand-includes tl)
(append import-datatypes datatypes)
(append import-opaques opaques)
(append import-aliases aliases)
(append import-env init-env)
(append import-variants init-variants)
#f
null
#f
(hasheq))))
(define-for-syntax import-datatypes null)
(define-for-syntax import-opaques null)
(define-for-syntax import-aliases null)
(define-for-syntax import-variants null)
(define-for-syntax import-env null)
(define-for-syntax (add-types! dts opqs als vars env)
(set! import-datatypes (append dts import-datatypes))
(set! import-opaques (append opqs import-opaques))
(set! import-aliases (append als import-aliases))
(set! import-variants (append vars import-variants))
(set! import-env (append env import-env)))
(define-syntax (typecheck-and-provide stx)
(let-values ([(tys e2 dts opqs als vars macros tl-types subs)
(with-handlers ([exn:fail? (lambda (exn)
(values exn #f #f #f #f #f #f null (hasheq)))])
(do-original-typecheck (cdr (syntax->list stx))))])
(if (exn? tys)
;; There was an exception while type checking. To order
;; type-checking errors after expansion, push the error into
;; a sub-expression:
#`(#%expression (let-syntax ([x (raise #,tys)])
x))
(generate-provides tys e2 dts opqs als vars macros tl-types subs))))
(define-for-syntax (generate-provides tys e2 dts opqs als vars macros tl-types subs)
#`(begin
;; Put all contracts implementations in a submodule,
;; so they're not loaded in a typed context:
(module* with-contracts #f
(begin) ; work around a bug in v6.1.1 and earlier
(provide
(contract-out
#,@(map (λ (tl-thing)
#`[#,(car tl-thing)
#,(to-contract (cdr tl-thing) #f)])
tl-types))))
;; Export identifiers for untyped use as redirections to the
;; submodule:
(module with-contracts-reference racket/base
(require racket/runtime-path
(for-syntax racket/base))
(define-runtime-module-path-index contracts-submod
'(submod ".." with-contracts))
(provide contracts-submod))
(require (for-syntax (submod "." with-contracts-reference)))
#,(let ([names (map (lambda (_) (gensym)) tl-types)]
[tl-names (map car tl-types)])
#`(begin
(define-syntaxes #,names
((make-make-redirects-to-contracts contracts-submod)
(syntax->list (quote-syntax #,tl-names))))
(provide #,@(for/list ([name (in-list names)]
[tl-name (in-list tl-names)])
#`(rename-out [#,name #,tl-name])))))
;; Providing each binding renamed to a generated symbol doesn't
;; make the binding directly inaccessible, but it makes the binding
;; marked as "exported" for the purposes of inspector-guarded
;; access. (In other words, we're not trying to be as secure
;; as Typed Racket, snce we can rely on Racket's safety.)
(provide
(rename-out
#,@(map (λ (tl-thing)
#`[#,(car tl-thing)
#,(gensym)])
tl-types)))
(module* plai-typed #f
(begin-for-syntax
(add-types!
;; datatypes:
(list #,@(map (lambda (dt)
#`(cons (quote-syntax #,(car dt))
(quote #,(cdr dt))))
dts))
;; opaques:
(list #,@(map (lambda (dt)
#`(cons (quote-syntax #,(car dt))
(quote-syntax #,(cdr dt))))
opqs))
;; aliases:
(list #,@(map (lambda (a)
#`(list (quote-syntax #,(car a))
(list #,@(map (lambda (a)
#`(quote-syntax #,a))
(cadr a)))
(quote-syntax #,(caddr a))))
als))
;; variants:
(list #,@(map (lambda (var)
#`(list (quote-syntax #,(car var))
#,@(map (lambda (t)
(to-expression t #hasheq()))
(cdr var))))
vars))
;; types
(list #,@(map (λ (tl-thing)
#`(cons (quote-syntax #,(car tl-thing))
#,(to-expression (cdr tl-thing) #hasheq())))
tl-types))))
(provide #,@(map (λ (tl-thing)
(car tl-thing))
tl-types)
#,@(map (λ (dt)
(car dt))
dts)
#,@(map (λ (opq)
(car opq))
opqs)
#,@macros
;; datatype predicates for contracts:
#,@(map (lambda (dt)
(datum->syntax (car dt)
(string->symbol (format "~a?" (syntax-e (car dt))))))
dts)))
;; Add provides to submodules, too:
#,@(for/list ([(name vec) (in-hash subs)])
(let-values ([(datatypes dt-len opaques o-len aliases a-len
variants v-len env e-len
macros tys tl-types submods)
(vector->values vec)])
(define (drop l n) (reverse (list-tail (reverse l) n)))
#`(module+ #,name
#,(generate-provides tys
(drop env e-len)
(drop datatypes dt-len)
(drop opaques o-len)
(drop aliases a-len)
(drop variants v-len)
macros
(let-based-poly! tl-types)
submods))))))
(define-for-syntax ((make-make-redirects-to-contracts submod-modidx) ids)
(define redirects
(for/list ([id (in-list ids)])
(define (redirect stx)
(cond
[(identifier? stx)
(with-syntax ([mp (collapse-module-path-index/relative
submod-modidx)]
[id (datum->syntax id (syntax-e id) stx stx)])
#`(let ()
(local-require (only-in mp [#,(datum->syntax #'mp (syntax-e #'id)) id]))
id))]
[else
(datum->syntax stx
(cons (redirect (car (syntax-e stx)))
(cdr (syntax-e stx)))
stx
stx)]))
redirect))
(apply values redirects))
(define-for-syntax orig-body #f)
(define-for-syntax (set-orig-body! v)
(set! orig-body v))
(define-syntax (typecheck stx)
(syntax-case stx ()
[(_ . body)
#'(begin
(begin-for-syntax (set-orig-body! (quote-syntax body)))
;; Typechecking happens at the `provide' expansion phase,
;; which is after everything else is expanded:
(typecheck-and-provide . body))]))
;; ----------------------------------------
(define-syntax (top-interaction stx)
(syntax-case stx ()
[(_ . body)
(let ([expanded-body (syntax-case #'body (define-type:)
[(define-type: . _)
;; Can't `local-expand' without also evaluating
;; due to introduced identifiers interleaved
;; in definitions;the only point of local expansion
;; is to check syntax, so just call the transformer
;; directly:
(begin
(expand-define-type #'body)
#'body)]
[_
(local-expand #'body 'top-level null)])])
(unless tl-env
(let-values ([(ts e d o a vars macros tl-types subs)
(do-original-typecheck (syntax->list (if orig-body
(syntax-local-introduce orig-body)
#'())))])
(set! tl-datatypes d)
(set! tl-opaques o)
(set! tl-aliases a)
(set! tl-env e)
(set! tl-variants vars)
(set! tl-submods subs)))
(let-values ([(tys e2 d2 o2 a2 vars macros tl-types subs)
(typecheck-defns (expand-includes (list #'body))
tl-datatypes tl-opaques tl-aliases tl-env tl-variants (identifier? #'body)
null #f tl-submods)])
(set! tl-datatypes d2)
(set! tl-opaques o2)
(set! tl-aliases a2)
(set! tl-env e2)
(set! tl-variants vars)
(set! tl-submods subs)
(with-syntax ([ty ((type->datum (make-hasheq)) (car tys))]
[body expanded-body])
(if (void? (car tys))
#'body
#'(begin
(print-type 'ty)
body)))))]))
(define (print-type t)
(parameterize ([pretty-print-print-line
(lambda (line p len maxcol)
(if (equal? line 0)
(display "- " p)
(if line
(display "\n " p)
(display "\n" p)))
0)])
(pretty-write t)))
;; ----------------------------------------
;; printing top-level expressions --- stolen from v4 "modbeg.ss",
;; which is why it is written in such primitive terms
(define-values (print-value)
(lambda (v)
(if (void? v)
(void)
(begin
(print v)
(newline)))))
(define-syntaxes (module-begin)
(lambda (stx)
(if (eq? 'module-begin (syntax-local-context))
(void)
(raise-syntax-error
#f
"allowed only around a module body"
stx))
(if (symbol? (syntax-e stx))
(raise-syntax-error
#f
"bad syntax"
stx)
(void))
(datum->syntax
stx
(list (quote-syntax #%module-begin)
(cons (quote-syntax begin)
(cdr (syntax-e stx)))
(cons (quote-syntax typecheck)
(cdr (syntax-e stx))))
stx
stx)))
;; ----------------------------------------
(module reader syntax/module-reader
plai-typed)
| true |
7e6144e4d6fe0f6f81ca2aec8ea82dc4b880a03a | 835673d94581169383461b031b830ce13525b27a | /test/test-order.rkt | 4554e238a8d8fc978ccaa79eba530860ceb6b2e3 | []
| no_license | c2d7fa/untask | f3b8301a87c967637fbb0732fc2d66c2eeca24e9 | 709f6c88a654c307888929440e056baf1c0ae45f | refs/heads/master | 2021-12-26T22:57:25.383515 | 2021-04-02T23:18:06 | 2021-04-02T23:18:06 | 244,209,340 | 3 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 5,917 | rkt | test-order.rkt | #lang racket
(require rackunit untask/test/util
untask/src/squiggle
(prefix-in a: untask/src/attribute)
(prefix-in dt: untask/src/datetime)
untask/src/untask/core/state
(only-in untask/src/untask/properties/order order-property)
(only-in untask/src/untask/properties/date date-property)
(prefix-in i: untask/src/untask/core/item)
(prefix-in p: untask/src/untask/core/property)
(prefix-in v: untask/src/untask/core/value)
(prefix-in bp: untask/src/untask/properties/builtin)
(prefix-in cmd: untask/src/untask/command/command))
(provide order-tests)
(define st1-full (load-example "example-5.t"))
(define st1 (a:get-path (st1-full state.item-state)))
(define order-tests
(test-suite "Order (in agenda)"
(test-case "Items have no order set by default"
(check-equal? (~> i:empty-state
(i:new/state)
(i:set 1 'description (v:make-string "Test"))
(p:get 1 (bp:ref 'order)))
#f))
(test-case "Setting order on an item with no date does nothing"
(check-equal? (~> i:empty-state
(i:new/state)
(i:set 1 'description (v:make-string "Test"))
(p:set 1 order-property (v:make-number 3))
(p:get 1 order-property))
#f))
(test-case "Setting order beyond last sets highest possible"
(check-equal? (~> st1
(p:set 1 order-property (v:make-number 10))
(p:get 1 order-property))
(v:make-number 4))
(check-equal? (~> st1
(p:set 3 order-property (v:make-number 10))
(p:get 3 order-property))
(v:make-number 5))
(check-equal? (~> st1
(p:set 5 order-property (v:make-number 10))
(p:get 5 order-property))
(v:make-number 4)))
(test-case "Setting same order as existing item nudges other items around"
(let ((st* (~> st1 (p:set 1 order-property (v:make-number 1)))))
(check-equal? (p:get st* 1 order-property) (v:make-number 1))
(check-equal? (p:get st* 5 order-property) (v:make-number 2))
(check-equal? (p:get st* 2 order-property) (v:make-number 3))
(check-equal? (p:get st* 4 order-property) (v:make-number 4)))
(let ((st* (~> st1 (p:set 6 order-property (v:make-number 3)))))
(check-equal? (p:get st* 5 order-property) (v:make-number 1))
(check-equal? (p:get st* 2 order-property) (v:make-number 2))
(check-equal? (p:get st* 6 order-property) (v:make-number 3))
(check-equal? (p:get st* 4 order-property) (v:make-number 4))
(check-equal? (p:get st* 1 order-property) (v:make-number 5))))
(test-case "Resetting an item's order nudges other items"
(let ((st* (~> st1 (p:set 2 order-property #f))))
(check-equal? (p:get st* 5 order-property) (v:make-number 1))
(check-equal? (p:get st* 4 order-property) (v:make-number 2))
(check-equal? (p:get st* 1 order-property) (v:make-number 3))
(check-equal? (p:get st* 2 order-property) #f)))
(test-case "Agenda view with both ordered and unordered items"
;; If some items have order and others don't, ordered items are displayed first in agenda view.
(check-equal? (cmd:agenda st1-full #:filter '())
`((,(dt:datetime 2019 11 03) 5 2 4 1 3 6))))
(test-case "Modifying an item's date resets its order"
(check-equal? (~> st1
(p:set 1 date-property (v:make-date (dt:datetime 2019 11 04)))
(p:get 1 order-property))
#f))
(test-case "Modifying and item's date nudges other items"
(let ((st* (~> st1 (p:set 2 date-property (v:make-date (dt:datetime 2019 11 04))))))
(check-equal? (p:get st* 5 order-property) (v:make-number 1))
(check-equal? (p:get st* 4 order-property) (v:make-number 2))
(check-equal? (p:get st* 1 order-property) (v:make-number 3))
(check-equal? (p:get st* 2 order-property) #f)))
(test-case "Copying an ordered item updates order"
(let*-values (((st*-full _) (cmd:copy st1-full #:filter '(item . 4) #:modify '()))
((st*) (a:get-path (st*-full state.item-state))))
(check-equal? (p:get st* 5 order-property) (v:make-number 1))
(check-equal? (p:get st* 2 order-property) (v:make-number 2))
(check-equal? (p:get st* 7 order-property) (v:make-number 3)) ; New item
(check-equal? (p:get st* 4 order-property) (v:make-number 4))
(check-equal? (p:get st* 1 order-property) (v:make-number 5))))
(test-case "Copying an ordered item to another does not change other items' orders"
(let*-values (((st*-full _) (~> st1-full (cmd:copy #:filter '(item . 4) #:modify '(date + (number . 1)))))
((st*) (a:get-path (st*-full state.item-state))))
(check-equal? (p:get st* 5 order-property) (v:make-number 1))
(check-equal? (p:get st* 2 order-property) (v:make-number 2))
(check-equal? (p:get st* 4 order-property) (v:make-number 3))
(check-equal? (p:get st* 1 order-property) (v:make-number 4))))
(test-case "Deserializing file with invalid 'order' properties automatically fixes them"
(let ((st (a:get-path ((load-example "example-7.t") state.item-state))))
(check-equal? (p:get st 5 order-property) (v:make-number 1))
(check-equal? (p:get st 2 order-property) (v:make-number 2))
(check-equal? (p:get st 4 order-property) (v:make-number 3))
(check-equal? (p:get st 1 order-property) (v:make-number 4))
(check-equal? (p:get st 3 order-property) (v:make-number 5))))))
| false |
57f406764f3b77e99021bc5abaa815ff52881501 | 00d4882c98aadb8010fcee2688e32d795fcc514e | /marketing/research/display/stem-and-leaf.rkt | 2e33c54c495aa7025a3cc336c86bf43b9387d826 | []
| no_license | thoughtstem/morugamu | dae77f19b9eecf156ffe501a6bfeef12f0c1749d | a9095ddebe364adffb036c3faed95c873a4d9f3c | refs/heads/master | 2020-03-22T04:09:18.238849 | 2018-08-20T18:55:55 | 2018-08-20T18:55:55 | 139,476,760 | 13 | 5 | null | 2018-08-02T22:29:48 | 2018-07-02T17:56:26 | Racket | UTF-8 | Racket | false | false | 3,308 | rkt | stem-and-leaf.rkt | #lang racket
(require (prefix-in game: "../../data/games/database.rkt"))
(require (prefix-in company: "../../data/companies/database.rkt"))
(require (prefix-in companies<->games: "../../data/join-games-companies/database.rkt"))
(require 2htdp/image)
(require "../../../../util/util.rkt")
;Below is the design for a stem and leaf plot.
;This function returns an integer in a number.
(define (digit d n)
(string->number
(substring
(number->string n)
d (+ d 1))))
(define (integers value)
(beside
(text value 24 'black)
(square 24 'solid 'transparent)))
;$asked-for was manually entered. Functions to make the proccess more efficient are in progress at the bottom.
(beside
;colum 1
(beside
(above
(text "Money Asked For" 24 'black)
;thousands
(beside
(integers "8")
(integers "8.5")
(integers "8")
(integers "7.5")
(integers "8")
(integers "7.6")
(integers "78")
(integers "4")
(integers "13")
(integers "1")
(integers "5")
(integers "6")
(integers "1")
(integers "7")
(integers "9")
(integers "6")
(integers "1.9")
(integers "8")
(integers "8"))
;ten thousands
(beside
(integers "0")
(integers "7")
(integers "2.8")
(integers "4")
(integers "3")
(integers "2")
(integers "7.5")
(integers "7.5")
(integers "1.5")
(integers "1.7")
(integers "2.6")
(integers "3")
(integers "1.2")
(integers "1")
(integers "1.9")
(integers "5")
(integers "1.5")
(integers "1.5")
(integers "1")
(integers "5.9")
(integers "4")
(integers "2.3")
(integers "7.5")
(integers "5")
(integers "5")
(integers "1")
(integers "2.3")
(integers "2.5")
(integers "3")
(integers "1.9")
(integers "5.3")
(integers "5")
(integers "1")
(integers "4.2")
(integers "2.6")
(integers "1.8")
(integers "1")
(integers "3")
(integers "2.5")
(integers "1.9")
(integers "3")
(integers "2")
(integers "3")
(integers "1")
(integers "2")
(integers "1.1")
(integers "2")
(integers "3")
(integers "2.9"))
;hundred thousands
(beside
(integers "1.658")
(integers "1.31")
(integers "5")
(integers "1.25")
(integers "1.5"))
;millions
(square 24 'solid 'transparent)
;ten millions
(square 24 'solid 'transparent)
;hundred millions
(square 24 'solid 'transparent))
(square 24 'solid 'transparent))
;column 2
(beside
(above
(text "Value (in thousands)" 24 'black)
(text "1" 24 'black)
(text "10" 24 'black)
(text "100" 24 'black)
(text "1,000" 24 'black)
(text "10,000" 24 'black)
(text "100,000" 24 'black))
(square 24 'solid 'transparent))
;column 3
(above
(text "Money Received" 24 'black)
;thousands
(beside
(integers "1")
(integers "2"))
;ten thousands
(beside
(integers "3")
(integers "4"))
;hundred thousands
(beside
(integers "5")
(integers "6"))
;millions
(beside
(integers "7")
(integers "8"))
;ten millions
(beside
(integers "7")
(integers "8"))
;hundred millions
(integers "9")
))
;(define (tens)
;Function to find the numbers with the tens thousands values
;Type: row? -> boolean?
(define (asked-for-tens? row)
(and (< ((list-ref (row) (- (length (row) 1)) 10))) (>= ((list-ref (row) (- (length (row)) 1)) 1))))
(filter (asked-for-tens? game:$asked-for) (game:table))
| false |
c78ffd76e601e5d272fd6d6eb511cb170baf8367 | 2ab75cf02f4f32326516cc5691ad6d15a676ec3b | /video/render.rkt | ac69d5fb47f46c3a66fbe990b4eebe63bb86c92b | [
"Apache-2.0"
]
| permissive | LeifAndersen/racket-video-backup | 0edc765c3076f44ae8ea9a4bb04b3c934d1803ef | 9ae85bb5d02eb50132a00768c8220eca76a3e78e | refs/heads/master | 2021-07-03T19:34:08.935299 | 2017-05-19T20:14:44 | 2017-05-19T20:14:44 | 57,415,017 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 5,294 | rkt | render.rkt | #lang racket/base
#|
Copyright 2016-2017 Leif Andersen
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
|#
(require racket/contract/base
racket/match
racket/math
racket/dict
racket/class
racket/file
(prefix-in file: file/convertible)
(only-in pict pict? pict->bitmap)
"private/init-mlt.rkt"
"init.rkt"
"private/mlt.rkt"
"private/video.rkt"
"private/utils.rkt"
(for-syntax racket/base
racket/list
racket/syntax
syntax/parse))
(provide
(contract-out
;; Render a video object (including the links
[render (->* [any/c]
[(or/c path-string? path? #f)
#:dest-filename (or/c path-string? path? #f)
#:render-mixin (-> class? class?)
#:profile-name (or/c string? #f)
#:width (and/c integer? positive?)
#:height (and/c integer? positive?)
#:fps number?
#:start (or/c nonnegative-integer? #f)
#:end (or/c nonnegative-integer? #f)
#:speed (or/c number? #f)
#:timeout (or/c number? #f)]
void?)])
render%
render<%>)
(define (render video
[dest #f]
#:dest-filename [dest-filename #f]
#:render-mixin [render-mixin values]
#:profile-name [profile-name #f]
#:width [width 720]
#:height [height 576]
#:start [start #f]
#:end [end #f]
#:fps [fps 25]
#:speed [speed #f]
#:timeout [timeout #f])
(define dest* (or dest (make-temporary-file "rktvid~a" 'directory)))
(define r% (render-mixin render%))
(define renderer
(new r%
[dest-dir dest*]
[dest-filename dest-filename]
[width width]
[height height]
[fps fps]))
(let* ([res (send renderer setup-profile)]
[res (send renderer prepare video)]
[target (send renderer render res)]
[res (send renderer play res target start end speed timeout)])
(void)))
(define render<%>
(interface () get-fps get-profile setup-profile prepare render play))
(define render%
(class* object% (render<%>)
(super-new)
(init-field dest-dir
[dest-filename #f]
[prof-name #f]
[width 720]
[height 576]
[fps 25])
(define res-counter 0)
(define profile (mlt-profile-init prof-name))
(define/private (get-current-filename)
(begin0 (format "resource~a" res-counter)
(set! res-counter (add1 res-counter))))
(define/public (get-fps)
fps)
(define/public (get-profile)
profile)
(define/public (setup-profile)
(define fps* (rationalize (inexact->exact fps) 1/1000000))
(set-mlt-profile-width! profile width)
(set-mlt-profile-height! profile height)
(set-mlt-profile-frame-rate-den! profile (denominator fps*))
(set-mlt-profile-frame-rate-num! profile (numerator fps*)))
(define/public (prepare source)
(parameterize ([current-renderer this]
[current-profile profile])
(cond
[(pict? source)
(define pict-name
(build-path (or dest-dir
(make-temporary-file "rktvid~a" 'directory))
(get-current-filename)))
(send (pict->bitmap source) save-file pict-name 'png 100)
(prepare (make-producer #:source (format "pixbuf:~a" pict-name)))]
[(file:convertible? source)
(define ret (or (file:convert source 'mlt)
(file:convert source 'video)))
(or ret (error "Not convertible to video data"))]
[else (raise-user-error 'render "~a is not convertible" source)])))
(define/public (render source)
(parameterize ([current-renderer this])
(mlt-*-connect (make-consumer) source)))
(define/public (play source target start end speed timeout)
(mlt-producer-set-in-and-out source (or start -1) (or end -1))
(when speed
(mlt-producer-set-speed source (exact->inexact speed)))
(mlt-consumer-start target)
(let loop ([timeout timeout])
(sleep 1)
(when (and timeout (zero? timeout))
(mlt-consumer-stop target))
(unless (mlt-consumer-is-stopped target)
(loop (and timeout (sub1 timeout))))))))
;; Set the current renderer
(let ([r (new render% [dest-dir #f])])
(send r setup-profile)
(current-renderer r)
(current-profile (send r get-profile)))
| false |
aaeb42670fc1af609d4ab9972a611cc90c92c93f | bdb6b8f31f1d35352b61428fa55fac39fb0e2b55 | /sicp/ex2.18.rkt | 418e27f9add09aa69eddef2995c790908aafc369 | []
| no_license | jtskiba/lisp | 9915d9e5bf74c3ab918eea4f84b64d7e4e3c430c | f16edb8bb03aea4ab0b4eaa1a740810618bd2327 | refs/heads/main | 2023-02-03T15:32:11.972681 | 2020-12-21T21:07:18 | 2020-12-21T21:07:18 | 323,048,289 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 447 | rkt | ex2.18.rkt | #lang racket
;ex2.18
;recreate:
(define (reverse2 list1)
(let ((n (- (length list1) 1))
(temp (list)))
(define (iter temp i)
(define temp1 (append temp (list (list-ref list1 i))))
(if (= i 0)
temp1
(iter temp1 (- i 1))))
(iter temp n)))
;(length (list 1 2 3))
;(list-ref (list 1 2 3) 2)
;(append (list 1 2 3) (list 4 6 8))
;(list)
;
(reverse (list 1 4 9 16 25))
(reverse2 (list 1 4 9 16 25)) | false |
62578edabfb08ccc39dca8ddd1d4dfd4f3558b7b | caf92e9cc39d4b123a1bfd8c2d0bed2f2c209142 | /week5/mcons.rkt | 2c96dad9388e8b12406f60cefa028ae1caf25636 | []
| no_license | sergiovasquez122/Programming-Languages-Coursera-Solutions | e02b28d8c36da429d621c46e9796b77d072c1e79 | 3aeef4471c66a57e3ac940f4d284d98fc88b86f4 | refs/heads/main | 2023-04-09T20:08:01.216873 | 2021-04-26T03:12:53 | 2021-04-26T03:12:53 | 326,312,125 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 670 | rkt | mcons.rkt | #lang racket
; cons cells are immutable
; In racket you cnnot mutate the content of a cons cell
; - list aliasing irrelevant
; - implement can make list? fast since listness if determined when cons cell is created
(define x (cons 14 null))
(define y x)
(set! x (cons 42 null)) ; alter what x points to not the list itself
(define mpr (mcons 1 (mcons true "hi")))
(mcar mpr)
(mcdr mpr)
(set-mcdr! mpr 47)
(mcdr mpr)
(set-mcdr! mpr (mcons true "hi"))
(set-mcar! mpr 14)
; (length mpr) cannot use lenght on mcons list
; new material
; - mcons
; - mcar
; - mcdr
; - mpair?
; - set-mcar!
; - set-mcdr!
; Run-time error to use mcar on a cons cell or car on an mcons cell | false |
ac63a74b5f8e16ea03164e447520ef55ffdd4287 | 52c2225c9f44c0da28ca1fd44606a8d197c8eac8 | /EOPL/ch1/1.23-test.rkt | 8f7ddd1ea7a8f022d4100ba7c895d21f49373cb8 | []
| no_license | alanzplus/EOPL | c74c1e9dd27c0580107fd860b88016320a6f231c | d7b06392d26d93df851d0ca66d9edc681a06693c | refs/heads/master | 2021-06-20T00:59:21.685904 | 2019-08-15T06:18:10 | 2019-08-15T07:06:53 | 147,045,798 | 8 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 354 | rkt | 1.23-test.rkt | #lang eopl
(require rackunit "1.23.rkt")
(require rackunit/text-ui)
(define list-index-test
(test-suite
"Tests for (list-index pred lst)"
(check-equal? (list-index number? '(a 2 (1 3) b 7)) 1)
(check-equal? (list-index symbol? '(a (b c) 17 foo)) 0)
(check-equal? (list-index symbol? '(1 2 (a b) 3)) #f)))
(run-tests list-index-test)
| false |
09cbe838e255c4205c76659af862527cf4364c62 | 51a53a16e2ab9fe5cfae68b5710788db7d9dd1f3 | /scribblings/rulesets.scrbl | 09cbb093a74c26db76fa6299811941d9725daaae | []
| no_license | spdegabrielle/inference | 09b41c4af9cfee2be36c3a20bdcbed551f69f87c | b407fd29d0a82f3262ddd9ced3259117b9448f40 | refs/heads/master | 2021-01-20T05:54:24.793208 | 2013-10-14T20:19:09 | 2013-10-14T20:19:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 1,811 | scrbl | rulesets.scrbl | #lang scribble/doc
@(require scribble/manual
scribblings/icons
(for-label scheme/base
"../inference.ss"))
@title[#:tag "rulesets"]{Rule Sets and Rules}
@local-table-of-contents[]
@section{Rule Sets}
A @deftech{rule set} is a collection of rules that together solve some (portion of a) problem.
@defform[(define-ruleset name)]{
Defines a ruleset with the given @scheme[name]. }
A rule set must be activated in an inference environment to be used in a inference. (See @scheme[activate] in Section 4.1, Rule Set Activation).
Multiple rule sets may be active in any given inference environment.
Currently, there is no way to deactivate a rule set.
@section{Rules}
@subsection{Forward Chaining (Data-Driven) Rules}
@subsection{Backward Chaining (Goal-Driven) Rules}
@section{Pattern Clauses}
@subsection{Binding Pattern Clauses}
@subsection{Existential Pattern Clauses}
@section{Patterns}
@subsection{List Patterns}
@subsection{List Pattern Example---Ancestors}
@subsection{Association List Patterns}
@subsection{Association List Pattern Example---Ancestors}
@subsection{Vector Patterns}
@subsection{Vector Pattern Example---Ancestors}
@subsection{Structure Patterns}
@subsection{Structure Pattern Example---Ancestors}
@section{Conflict Resolution Strategies}
@subsection{Depth First}
@subsection{Depth First Example}
@subsection{Breadth First}
@subsection{Breadth First Example}
@subsection{Rule Order}
@subsection{Rule Order Example}
@subsection{Specificity}
@subsection{Specificity Example}
@subsection{Simplicity}
@subsection{Simplicity Example}
@subsection{Complexity}
@subsection{Complexity Example}
@subsection{Random}
@subsection{Random Example}
| false |
48aee5fa5ae3198899e314a66294c4c964ad57c8 | bdfc662ca44fac5a652e3f1c812371c9fc5dd6c5 | /stx-helpers.rkt | bf0afa4e442c523383b0f425f3ffedc3802feb65 | []
| no_license | jackfirth/type-conventions | f5518e1f54cfde166cec3c5d48f97712f374b03d | 550d9045206bd1c0a05713fa866a9cc2a0b48d99 | refs/heads/master | 2020-12-24T08:18:13.542446 | 2016-08-19T14:51:44 | 2016-08-19T14:51:44 | 25,005,104 | 2 | 2 | null | 2016-08-19T14:51:45 | 2014-10-09T19:29:11 | Racket | UTF-8 | Racket | false | false | 1,098 | rkt | stx-helpers.rkt | #lang racket
(provide syntax-or-list->list
map-syntax
zip-flat
zip-stxs-flat
append-stxs)
;;;; Syntax helper functions ;;;;
; Turn a syntax object or a list of syntax objects into a list of syntax objects
(define (syntax-or-list->list stx-or-list)
(if (list? stx-or-list)
stx-or-list
(syntax->list stx-or-list)))
; Map a function to a syntax object's contents
(define (map-syntax f stxs) (map f (syntax->list stxs)))
; Zip lists together, then flatten zipped lists to one list
; (zip-flat '(1 2 3) '(a b c)) -> '(1 a 2 b 3 c)
(define (zip-flat . lsts) (apply append (apply map (cons list lsts))))
; Does the same, but for syntax objects or lists of syntax objects
; (zip-stxs-flat #'(1 2 3) (list #'a #'b #'c)) -> (list #'1 #'a #'2 #'b #'3 #'c)
(define (zip-stxs-flat . stxs) (apply zip-flat (map syntax-or-list->list stxs)))
; Append the contents of syntax objects into a list of syntax objects
; (append-stxs #'(1 2 3) #'(a b c)) -> (list #'1 #'2 #'3 #'a #'b #'c)
(define (append-stxs . stxs) (apply append (map syntax->list stxs)))
| false |
f3c99977b05266d470bd19bf4a7781b0f6c9b683 | 616e16afef240bf95ed7c8670035542d59cdba50 | /redex-doc/redex/scribblings/long-tut/wed-aft.scrbl | a6b7eec2f22b47339828aba9c79f14c590b55b36 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
]
| permissive | racket/redex | bd535d6075168ef7be834e7c1b9babe606d5cd34 | 8df08b313cff72d56d3c67366065c19ec0c3f7d0 | refs/heads/master | 2023-08-19T03:34:44.392140 | 2023-07-13T01:50:18 | 2023-07-13T01:50:18 | 27,412,456 | 102 | 43 | NOASSERTION | 2023-04-07T19:07:30 | 2014-12-02T03:06:03 | Racket | UTF-8 | Racket | false | false | 8,598 | scrbl | wed-aft.scrbl | #lang scribble/manual
@(require "shared.rkt")
@; ---------------------------------------------------------------------------------------------------
@title[#:tag "wed-aft"]{Abstract Machines}
@goals[
@item{why these three machines: CC machine, CK machine, CEK machine}
@item{theorems connecting the machines, theorems for debugging}
@item{equivalence theorems}
]
@; -----------------------------------------------------------------------------
@section{CC Machine}
@bold{Observation} β and β_v redexes often take place repeatedly in the
same evaluation context. On occasion they just add more layers (inside the
hole) to the evaluation context. Let's separate the in-focus expression
from the evaluation context. Historically the two have been called
@italic{control string} (C) and @italic{control context} (C).
@;%
@(begin
#reader scribble/comment-reader
(racketblock
(define-extended-language Lambda/v Lambda
(e ::= .... n +)
(n ::= integer)
(v ::= n + (lambda (x ...) e)))
(define vv? (redex-match? Lambda/v e))
(define e0
(term ((lambda (x) x) 0)))
(define e1
(term ((lambda (x y) x) 1 2)))
(module+ test
(test-equal (vv? e1) #true)
(test-equal (vv? e0) #true))
;; -----------------------------------------------------------------------------
;; the CC machine: keep contexts and expression-in-focus apart
(define-extended-language CC Lambda/v
(E ::=
hole
;; @bold{Note} right to left evaluation of application
(e ... E v ...)))
(module+ test
(test-->> -->cc (term [,e0 hole]) (term [0 hole]))
(test-->> -->cc (term [,e1 hole]) (term [1 hole])))
(define -->cc
(reduction-relation
CC
#:domain (e E)
(--> [(lambda (x ..._n) e)
(in-hole E (hole v ..._n))]
[(subst ([v x] ...) e) E]
CC-β_v)
(--> [+
(in-hole E (hole n_1 n_2))]
[,(+ (term n_1) (term n_2)) E]
CC-+)
(--> [(e_1 ...) E]
[e_last (in-hole E (e_1others ... hole))]
(where (e_1others ... e_last) (e_1 ...))
CC-push)
(--> [v (in-hole E (e ... hole v_1 ...))]
[e_last (in-hole E (e_prefix ... hole v v_1 ...))]
(where (e_prefix ... e_last) (e ...))
CC-switch)))
(module+ test
(test-equal (term (eval-cc ,e0)) 0)
(test-equal (term (eval-cc ,e1)) 1))
(define-metafunction Lambda/v
eval-cc : e -> v or closure or stuck
[(eval-cc e) (run-cc [e hole])])
(define-metafunction CC
run-cc : (e E) -> v or closure or stuck
[(run-cc (n hole)) n]
[(run-cc (v hole)) closure]
[(run-cc any_1)
(run-cc (e_again E_again))
(where ((e_again E_again)) ,(apply-reduction-relation -->cc (term any_1)))]
[(run-cc any) stuck])
))
@;%
@; -----------------------------------------------------------------------------
@section{The CK Machine}
@bold{Observation} The evaluation context of the CC machine behaves exactly
like a control stack. Let's represent it as such.
@bold{General Idea} The general idea is to show how valuable it is to
reconsider data representations in PL, and how easy it is to do so in
Redex.
@;%
@(begin
#reader scribble/comment-reader
(racketblock
(define-extended-language CK Lambda/v
;; @bold{Note} encode context as stack (left is top)
(k ::= ((app [v ...] [e ...]) ...)))
(module+ test
(test-->> -->ck (term [,e0 ()]) (term [0 ()]))
(test-->> -->ck (term [,e1 ()]) (term [1 ()])))
(define -->ck
(reduction-relation
CK
#:domain (e k)
(--> [(lambda (x ..._n) e)
((app [v ..._n] []) (app any_v any_e) ...)]
[(subst ([v x] ...) e)
((app any_v any_e) ...)]
CK-β_v)
(--> [+ ((app [n_1 n_2] []) (app any_v any_e) ...)]
[,(+ (term n_1) (term n_2)) ((app any_v any_e) ...)]
CK-+)
(--> [(e_1 ...) (any_k ...)]
[e_last ((app () (e_1others ...)) any_k ...)]
(where (e_1others ... e_last) (e_1 ...))
CK-push)
(--> [v ((app (v_1 ...) (e ...)) any_k ...)]
[e_last ((app (v v_1 ...) (e_prefix ...)) any_k ...)]
(where (e_prefix ... e_last) (e ...))
CK-switch)))
(module+ test
(test-equal (term (eval-ck ,e0)) 0)
(test-equal (term (eval-ck ,e1)) 1))
(define-metafunction Lambda/v
eval-ck : e -> v or closure or stuck
[(eval-ck e) (run-ck [e ()])])
(define-metafunction CK
run-ck : (e k) -> v or closure or stuck
[(run-ck (n ())) n]
[(run-ck (v ())) closure]
[(run-ck any_1)
(run-ck (e_again k_again))
(where ((e_again k_again)) ,(apply-reduction-relation -->ck (term any_1)))]
[(run-ck any) stuck])
))
@;%
@; -----------------------------------------------------------------------------
@section{The CC-CK Theorem}
The two machines define the same evaluation function. Let's formulate this
as a theorem and @racket[redex-check] it.
@bold{Note} When I prepared these notes, I found two mistakes in my
machines.
@;%
@(begin
#reader scribble/comment-reader
(racketblock
(module+ test
;; theorem:eval-ck=eval-cc
(test-equal (term (theorem:eval-ck=eval-cc ,e0)) #true)
(test-equal (term (theorem:eval-ck=eval-cc ,e1)) #true)
;; NEXT: CEK vs CK
(redex-check Lambda e (term (theorem:eval-ck=eval-cc e))
#:attempts 24
#:prepare (close-all-fv vv?)))
(define-metafunction Lambda/v
theorem:eval-ck=eval-cc : e -> boolean
[(theorem:eval-ck=eval-cc e)
,(equal? (term (eval-cc e)) (term (eval-ck e)))])
))
@;%
@; -----------------------------------------------------------------------------
@section{The CEK machine}
@bold{Observation} Substitution is an eager operation. It traverses the
term kind of like machine does anyway when it searches for a redex. Why not
combine the two by delaying substitution until needed? That's called an
@tech{environment} (E) in the contexts of machines (also see above).
@bold{General Idea} Universal laziness is @emph{not} a good idea. But
the selective delay of operations---especially when operations can be
merged---is a good thing.
@;%
@(begin
#reader scribble/comment-reader
(racketblock
(define-extended-language CEK Lambda/v
(ρ ::= ((x c) ...))
(c ::= (v ρ))
(k ::= ((app [c ...] ρ [e ...]) ...)))
(module+ test
(test-->> -->cek (term [,e0 () ()]) (term [0 () ()]))
(test-->> -->cek (term [,e1 () ()]) (term [1 () ()])))
(define -->cek
(reduction-relation
CEK
#:domain (e ρ k)
(--> [x
((x_1 c_1) ... (x (v ρ)) (x_2 c_2) ...)
((app any_v any_r any_e) ...)]
[v
ρ
((app any_v any_r any_e) ...)]
CEK-lookup)
(--> [(lambda (x ..._n) e)
(any_c ...)
((app [c ..._n] ρ []) (app any_v any_r any_e) ...)]
[e
([x c] ... any_c ...)
((app any_v any_r any_e) ...)]
CEK-β_v)
(--> [+
ρ
((app [n_1 n_2] []) (app any_v any_r any_e) ...)]
[,(+ (term n_1) (term n_2))
()
((app any_v any_r any_e) ...)]
CEK-+)
(--> [(e_1 ...)
ρ
(any_k ...)]
[e_last
ρ
((app () ρ (e_1others ...)) any_k ...)]
(where (e_1others ... e_last) (e_1 ...))
CEK-push)
(--> [v
ρ
((app (c_1 ...) ρ_stack (e ...)) any_k ...)]
[e_last
ρ_stack
((app ((v ρ) c_1 ...) ρ_stack (e_prefix ...)) any_k ...)]
(where (e_prefix ... e_last) (e ...))
CEK-switch)))
(module+ test
(test-equal (term (eval-cek ,e0)) 0)
(test-equal (term (eval-cek ,e1)) 1))
(define-metafunction Lambda/v
eval-cek : e -> v or closure or stuck
[(eval-cek e) (run-cek [e () ()])])
(define-metafunction CEK
run-cek : (e ρ k) -> v or closure or stuck
[(run-cek (n ρ ())) n]
[(run-cek (v ρ ())) closure]
[(run-cek any_1)
(run-cek (e_again ρ_again k_again))
(where ((e_again ρ_again k_again))
,(apply-reduction-relation -->cek (term any_1)))]
[(run-cek any) stuck])
))
@;%
@; -----------------------------------------------------------------------------
@section{The CEK-CK Theorem}
Again, the two machines define the @emph{same semantics}. Here is the
theorem.
@;%
@(begin
#reader scribble/comment-reader
(racketblock
(module+ test
;; theorem:eval-ck=eval-cc
(test-equal (term (theorem:eval-cek=eval-ck ,e0)) #true)
(test-equal (term (theorem:eval-cek=eval-ck ,e1)) #true)
;; NEXT: CEK vs CK
(redex-check Lambda e (term (theorem:eval-cek=eval-ck e))
#:attempts 24
#:prepare (close-all-fv vv?)))
(define-metafunction Lambda/v
theorem:eval-cek=eval-ck : e -> boolean
[(theorem:eval-cek=eval-ck e)
,(equal? (term (eval-cek e)) (term (eval-ck e)))])
))
@;%
| false |
c08e897d9c3597fcbe00b36943b931ea11353b39 | e4d80c9d469c9ca9ea464a4ad213585a578d42bc | /courses/bs1/units/unit3/homeworks/unit3-hw1.scrbl | 061ccc6ca47b92321d59d0f0aeaecee1f2638f4e | []
| no_license | garciazz/curr | 0244b95086b0a34d78f720e9cae1cb0fdb686ec5 | 589a93c4a43967b06d7a6ab9d476b470366f9323 | refs/heads/master | 2021-01-17T19:14:21.756115 | 2016-02-24T22:16:26 | 2016-02-24T22:16:26 | 53,657,555 | 1 | 0 | null | 2016-03-11T09:58:01 | 2016-03-11T09:58:01 | null | UTF-8 | Racket | false | false | 4,266 | scrbl | unit3-hw1.scrbl | #lang curr/lib
@title{Unit Three Homework}
@lesson[#:title "Question One:"]{@itemlist/splicing[@item{Eager to demonstrate your programming knowledge, you have decided to use Racket to create a flyer or poster to distribute.}
@item{Are you running for class president? President of the United States? Maybe you're advertising your services as a dog-walker in your neighborhood.}
@item{We've given you sample HEADER and BACKGROUND images.}
@item{@bold{A)} Create two more images representing the personal slogan and logo you would like on the poster. (Hint: The @bold{text} function will create an image out of any string you give it.) Your logo can be a simple shape, or any image taken from the web.}
@item{@bold{B)} Next, take the images you just created and define them with the variable names SLOGAN and LOGO for your poster.}]
@embedded-wescheme[#:id "campaign"
#:public-id "sH5iEU3zPn"
#:height 900]}
@lesson[#:title "Question Two:"]{@itemlist/splicing[@item{Below is the contract for @bold{put-image}, which places an image at a specific x and y coordinate on top of another image. We've started your poster by putting the header towards the bottom left of the background.}
@item{@code{;put-image : image number number image -> image}}
@item{Change the position of HEADER in the given expression to move it to the top center of the background.}]
}
@lesson[#:title "Question Three:"]{Use the @bold{put-image} function and the images you defined above to place your SLOGAN and LOGO on your poster, so they appear below the HEADER.}
@lesson[#:title "Question Four:"]{The following is the contract and two examples for a function called @bold{pt}, which takes in a string and creates an image of that string in purple text of size 40.
What's wrong with these examples?
@code{; pt : String -> Image}
@code{; creates an image from the given string in purple text of size 40.}
@bitmap{images/purple.png}
@itemlist/splicing[@item[@code{(EXAMPLE (pt "Bootstrap") (text "Bootstrap" 40 "green"))}]
@item[@code{(EXAMPLE (pt "Purple") (image "Purple" 40 "purple"))}]]
@free-response[#:id "example"]}
@lesson[#:title "Question Five:"]{Your friend is making a video game about a scuba diver. When she shows you her progress, you notice that the image of her player is much too small, and pointed in the wrong direction.
Change the definition of PLAYER to increase the size of the image, and rotate the image so that the scuba diver is swimming to the right.
@embedded-wescheme[#:id "Scuba"
#:public-id "Xexl4Npt9x"
#:height 600]
@itemlist/splicing[@item{@bold{Before:}
@bitmap{images/diversmall.gif}}
@item{@bold{After:}
@bitmap{images/diversmallr.gif}}]}
| false |
26d0ae1831b315d92a46aeee0a7a8bf52753b512 | e98742038ee53ed8cb512d4ef81a2891c540af23 | /utils.rkt | ef3a64a54988adf1705600e47b43805e56a872cc | [
"MIT"
]
| permissive | LRudL/lambda-engine | 9c560038726c17709eede66e4318e878ee7e39ce | 2be92f266643318f0d891d177592aeb6481b51c9 | refs/heads/main | 2023-04-15T02:40:46.588160 | 2021-04-25T21:13:21 | 2021-04-25T21:13:21 | 361,187,055 | 1 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 298 | rkt | utils.rkt | #lang racket
(provide (all-defined-out))
(define-syntax-rule (if-let (name val) body)
(let ((name val))
(if name body #f)))
(define (butlast l)
(take l (- (length l) 1)))
(define (uniques l)
(length (set->list (apply set l))))
(define (not-fn fn)
(λ args (not (apply fn args))))
| true |
779503554e637c0ba7b37798023a7f11ab5afcef | 8ba35da73d13d03e530112607bc11268f1b44711 | /aoc19/racket/aoc19.rkt | 8508b2f465478fe7a222c25bca1d5f327fe2994e | []
| no_license | sstoltze/advent-of-code | 687873612b274e1ffbd57f4837e54932b957aaef | 2321e33c0d9e24a40b89625847b16fa6ed2c813e | refs/heads/master | 2023-08-31T01:57:22.480513 | 2022-02-09T15:56:17 | 2022-02-09T15:56:17 | 225,222,428 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 19,574 | rkt | aoc19.rkt | #lang racket/base
(require racket/file
racket/string
racket/set
racket/match
racket/list
racket/vector
racket/function
racket/hash)
(define day1-input
(file->list (string->path "../input/day1-1.txt")
(lambda (port)
(let ([in (read-line port 'any)])
(cond [(string? in) (string->number in)]
[(equal? in eof) eof]
[else 0])))))
(define (fuel mass)
(max (- (floor (/ mass 3)) 2)
0))
(define (day1-1 input)
(for/sum ([mass input])
(fuel mass)))
(define (total-fuel mass)
(let ([f (fuel mass)])
(if (<= f 0)
0
(+ f (total-fuel f)))))
(define (day1-2 input)
(for/sum ([mass input])
(total-fuel mass)))
(define (day2-1-input)
(file->intcode-program "../input/day2-1.txt"))
(define (file->intcode-program f)
(string->intcode-program (file->string f)))
(define (string->intcode-program s)
(for/hash ([i (in-naturals)]
[p (in-list (map string->number
(string-split s #px"[\\s,]+")))])
(values i p)))
(define (intcode-parameter program ptr relative-pointer modes [debug #f])
(lambda (m [write-mode #f])
(define output (case (hash-ref modes m 0)
[(2) (if write-mode
(+ (hash-ref program (+ ptr m) 0) relative-pointer)
(hash-ref program (+ (hash-ref program (+ ptr m) 0) relative-pointer) 0))]
[(1) (hash-ref program (+ ptr m) 0)]
[else (if write-mode
(hash-ref program (+ ptr m) 0)
(hash-ref program (hash-ref program (+ ptr m) 0) 0))]))
(when debug
(printf "Deref ~S~A: ~S~%" m (if write-mode "w" "") output))
output))
(define (intcode-op f)
(lambda (program ptr relative-pointer [modes (make-hash)] [debug #f])
(define deref (intcode-parameter program ptr relative-pointer modes debug))
(hash-set! program (deref 3 #t)
(f (deref 1)
(deref 2)))
(values program (+ ptr 4) relative-pointer #f)))
(define intcode-1 (intcode-op +))
(define intcode-2 (intcode-op *))
(define (intcode-3 program ptr relative-pointer [modes (make-hash)] [debug #f])
(define deref (intcode-parameter program ptr relative-pointer modes debug))
(let ([cc (call/cc (lambda (cc) cc))])
(when (not (continuation? cc))
(hash-set! program (deref 1 #t) cc))
(values program (+ ptr 2) relative-pointer cc)))
(define (intcode-4 program ptr relative-pointer [modes (make-hash)] [debug #f])
(define deref (intcode-parameter program ptr relative-pointer modes debug))
(println (deref 1))
(values program (+ ptr 2) relative-pointer #f))
(define (intcode-5 program ptr relative-pointer [modes (make-hash)] [debug #f])
(define deref (intcode-parameter program ptr relative-pointer modes debug))
(if (not (zero? (deref 1)))
(values program (deref 2) relative-pointer #f)
(values program (+ ptr 3) relative-pointer #f)))
(define (intcode-6 program ptr relative-pointer [modes (make-hash)] [debug #f])
(define deref (intcode-parameter program ptr relative-pointer modes debug))
(if (zero? (deref 1))
(values program (deref 2) relative-pointer #f)
(values program (+ ptr 3) relative-pointer #f)))
(define (intcode-7 program ptr relative-pointer [modes (make-hash)] [debug #f])
(define deref (intcode-parameter program ptr relative-pointer modes debug))
(hash-set! program (deref 3 #t)
(if (< (deref 1)
(deref 2))
1
0))
(values program (+ ptr 4) relative-pointer #f))
(define (intcode-8 program ptr relative-pointer [modes (make-hash)] [debug #f])
(define deref (intcode-parameter program ptr relative-pointer modes debug))
(hash-set! program (deref 3 #t)
(if (= (deref 1)
(deref 2))
1
0))
(values program (+ ptr 4) relative-pointer #f))
(define (intcode-9 program ptr relative-pointer [modes (make-hash)] [debug #f])
(define deref (intcode-parameter program ptr relative-pointer modes debug))
(values program (+ ptr 2) (+ relative-pointer (deref 1)) #f))
(define (intcode-99 program ptr relative-pointer [modes (make-hash)] [debug #f])
(values eof ptr relative-pointer #f))
(define (intcode-machine ops [debug-all #f])
(lambda (input [debug debug-all])
(let loop ([program (hash-copy input)]
[pointer 0]
[relative-pointer 0])
(when debug
(printf "Pointer: ~A~%" pointer)
(printf "Relative pointer: ~A~%" relative-pointer)
(printf "Program: ~A~%" program))
(define opcode (hash-ref program pointer))
(define op (modulo opcode 100))
(define modes (for/hash ([i (in-naturals 1)]
[c (in-list (reverse (string->list (number->string (floor (/ opcode 100))))))])
(values i (string->number (string c)))))
(when debug
(printf "Opcode: ~A~%Op: ~A~%Modes: ~A~%" opcode op modes))
(define proc (hash-ref ops op))
(when debug
(printf "Proc: ~A~%" proc))
(define-values (prog ptr rel cont) (proc program pointer relative-pointer modes debug))
(cond [(eof-object? prog) program]
[(continuation? cont) cont]
[else (loop prog ptr rel)]))))
(define intcode-interpreter (intcode-machine (make-hash (list (cons 1 intcode-1)
(cons 2 intcode-2)
(cons 3 intcode-3)
(cons 4 intcode-4)
(cons 5 intcode-5)
(cons 6 intcode-6)
(cons 7 intcode-7)
(cons 8 intcode-8)
(cons 9 intcode-9)
(cons 99 intcode-99)))))
;; read-line itself has suddenly stopped working...
(define (read-line-plus)
(define contents (read-line (current-input-port) 'any))
(if (equal? contents "")
(read-line (current-input-port) 'any)
contents))
(define (intcode-with-current-in intcode-machine prog)
(let ([c (intcode-machine prog)])
(when (continuation? c)
(define input (read-line-plus))
(c (string->number (string-trim input))))))
(define (intcode-test [debug #f])
(define machine (intcode-machine (make-hash (list (cons 1 intcode-1)
(cons 2 intcode-2)
(cons 3 intcode-3)
(cons 4 intcode-4)
(cons 5 intcode-5)
(cons 6 intcode-6)
(cons 7 intcode-7)
(cons 8 intcode-8)
(cons 9 intcode-9)
(cons 99 intcode-99)))
debug))
(println "Checks whether input is equal to 8.")
(define prog (string->intcode-program "3,9,8,9,10,9,4,9,99,-1,8"))
(machine prog)
(println "Checks whether input is less than 8.")
(define prog-prime (string->intcode-program "3,9,7,9,10,9,4,9,99,-1,8"))
(machine prog-prime)
(println "Checks whether input is equal to 8.")
(define prog2 (string->intcode-program "3,3,1108,-1,8,3,4,3,99"))
(machine prog2)
(println "Checks whether input is less than 8.")
(define prog2-prime (string->intcode-program "3,3,1107,-1,8,3,4,3,99"))
(machine prog2-prime)
(println "Ouput 999 if input is less than 8, 1000 if it is equal and 1001 if it is larger.")
(define prog3 (string->intcode-program "3,21,1008,21,8,20,1005,20,22,107,8,21,20,1006,20,31,1106,0,36,98,0,0,1002,21,125,20,4,20,1105,1,46,104,999,1105,1,46,1101,1000,1,20,4,20,1105,1,46,98,99"))
(machine prog3)
(println "Outputs 0 when input is zero:")
(define prog4 (string->intcode-program "3,12,6,12,15,1,13,14,13,4,13,99,-1,0,1,9"))
(intcode-with-current-in machine prog4)
(println "Outputs 0 when input is zero:")
(define prog5 (string->intcode-program "3,3,1105,-1,9,1101,0,0,12,4,12,99,1"))
(intcode-with-current-in machine prog5)
(println "Multiply numbers and write the result.")
(define prog6 (string->intcode-program "1002,4,2,4,52,4,4,4,99"))
(machine prog6)
(println "Outputs the given input:")
(define prog7 (string->intcode-program "3,0,4,0,99"))
(intcode-with-current-in machine prog7)
(println "Takes no input, produces itself as output.")
(define prog8 (string->intcode-program "109,1,204,-1,1001,100,1,100,1008,100,16,101,1006,101,0,99"))
(machine prog8)
(println "Should produce a 16 digit number.")
(define prog9 (string->intcode-program "1102,34915192,34915192,7,4,7,99,0"))
(machine prog9)
(println "Should print 1125899906842624.")
(define prog10 (string->intcode-program "104,1125899906842624,99"))
(machine prog10))
(define (day2-1 input)
(hash-set! input 1 12)
(hash-set! input 2 2)
(hash-ref (intcode-interpreter input) 0))
(define (day2-2 input)
(for/or ([noun (in-range 100)])
(for/or ([verb (in-range 100)])
(let ([v (hash-copy input)])
(hash-set! v 1 noun)
(hash-set! v 2 verb)
(and (= (hash-ref (intcode-interpreter v) 0)
19690720)
(+ (* noun 100) verb))))))
(struct point (x y) #:transparent)
(define (manhattan-dist p1 p2)
(+ (abs (- (point-x p1) (point-x p2)))
(abs (- (point-y p1) (point-y p2)))))
(define (origin-dist p)
(manhattan-dist p (point 0 0)))
(define (day3-input)
(map (compose (lambda (s) (string-split s ",")) string-trim) (file->lines "../input/day3-1.txt")))
(define day3-test-input
(map (lambda (s) (string-split s ",")) '("R8,U5,L5,D3" "U7,R6,D4,L4")))
(define (move-point p dir len)
(match-define (point x y) p)
(case dir
[(#\U) (point x (+ y len))]
[(#\D) (point x (- y len))]
[(#\L) (point (- x len) y)]
[(#\R) (point (+ x len) y)]))
(define (add-wire p dir len )
(for/list ([i (in-range len)])
(move-point p dir (add1 i))))
(define (wire->points wire)
(for/fold ([points (set)]
[p (point 0 0)]
#:result points)
([w (in-list wire)])
(define direction (string-ref w 0))
(define length (string->number (substring w 1)))
(define new-points (set-union points (list->set (add-wire p direction length))))
(values new-points
(move-point p direction length))))
(define (intersect-wires w1 w2)
(define first-wire-points (wire->points w1))
(for/fold ([intersection (set)]
[p (point 0 0)]
#:result intersection)
([w w2])
(define direction (string-ref w 0))
(define length (string->number (substring w 1)))
(values (set-union intersection
(set-intersect first-wire-points
(list->set (add-wire p direction length))))
(move-point p direction length))))
(define (wire-steps wire target)
(for/fold ([result #f]
[length 0]
[p (point 0 0)]
#:result result)
([w wire])
(define direction (string-ref w 0))
(define wire-length (string->number (substring w 1)))
(if (not result)
(values
(cond
[(index-of (add-wire p direction wire-length) target) => (lambda (i) (+ length (add1 i)))]
[else #f])
(+ length wire-length)
(move-point p direction wire-length))
(values result length p))))
(define (day3 input)
(match-define (list w1 w2) input)
(define intersections (intersect-wires w1 w2))
(values (argmin origin-dist (set->list intersections))
(apply min (map (lambda (p) (+ (wire-steps w1 p)
(wire-steps w2 p)))
(set->list intersections)))))
(define (day5-1-input)
(file->intcode-program "../input/day5-1.txt"))
(define (day5 input)
(println "5-1: Enter 1 when prompted.")
(intcode-interpreter input)
(println "5-2: Enter 5 when prompted.")
(intcode-interpreter input))
(define (day4-1-input)
(map string->number (string-split (string-trim (file->string "../input/day4-1.txt")) "-")))
(define (six-digit? n)
(= (string-length (number->string n)) 6))
(define (equal-adjacent? n)
(define ns (number->string n))
(for/or ([i (in-range (sub1 (string-length ns)))])
(define sub (substring ns i (+ i 2)))
(char=? (string-ref sub 0) (string-ref sub 1))))
(define (equal-adjacent-2? n)
(define ns (number->string n))
(define ns-l (string-length ns))
(for/or ([i (in-range (sub1 ns-l))])
(define sub (substring ns i (+ i 2)))
(and (char=? (string-ref sub 0) (string-ref sub 1)))))
(define (increasing-digits? n)
(define ns (number->string n))
(for/and ([i (in-range (sub1 (string-length ns)))])
(define sub (substring ns i (+ i 2)))
(char<=? (string-ref sub 0) (string-ref sub 1))))
(define (day4-1-test? n)
(and (six-digit? n)
(equal-adjacent? n)
(increasing-digits? n)))
(define (day4-1-numbers low high)
(for/list ([n (in-range low high)]
#:when (day4-1-test? n))
n))
(define (string-group-equals s)
(for/fold ([result (list)]
[current-list (list)]
#:result (reverse (cons current-list result)))
([c (in-string s)])
(if (or (empty? current-list)
(char=? c (first current-list)))
(values result (cons c current-list))
(values (cons current-list result) (list c)))))
(define (two-equal-adjacent? n)
(not (empty?
(filter (lambda (x) (= x 2))
(map length (string-group-equals (number->string n)))))))
(define (day4 input)
(define day4-1-output (day4-1-numbers (first input) (second input)))
(printf "Number of passwords: ~A~%" (length day4-1-output))
(printf "Number of updated passwords: ~A~%" (length (filter two-equal-adjacent? day4-1-output))))
(define (day9-1-input)
(file->intcode-program "../input/day9-input.txt"))
(define (day9 input)
(println "Enter 1 to get first answer.")
(intcode-interpreter input)
(println "Enter 2 to get second answer.")
(intcode-interpreter input)
#t)
(define (string-ref-default l i default)
(if (<= 0 i (- (string-length l) 1))
(string-ref l i)
default))
(define (map-ref m i j)
(define lines (string-split m "\n"))
(if (<= 0 j (- (length lines) 1))
(string-ref-default (list-ref lines j) i #\.)
#\.))
(define (intersection-point? m x y)
(and (char=? (map-ref m x y) #\#)
(char=? (map-ref m (+ x 1) y) #\#)
(char=? (map-ref m (- x 1) y) #\#)
(char=? (map-ref m x (+ y 1)) #\#)
(char=? (map-ref m x (- y 1)) #\#)))
(define (map->intersection-points m)
(define lines (string-split m "\n"))
(flatten
(for/list ([i (in-range (string-length (first lines)))])
(for/list ([j (in-range (length lines))]
#:when (intersection-point? m i j))
(point i j)))))
(define (alignment-parameter p)
(* (point-x p) (point-y p)))
(define (calibration-parameter points)
(apply + (map alignment-parameter points)))
(define (day17-1-input)
(file->intcode-program "../input/day17-1-input.txt"))
(define (list->ascii-code l)
(define (symbol->ascii-character s)
(string-join
(map (compose number->string char->integer)
(string->list s))
","))
(define (list->ascii-line line)
(string-append
(string-join (map symbol->ascii-character line)
",44,")
",10"))
(string-join (map list->ascii-line l)
","))
(define (string->map s)
(list->string
(map (compose integer->char string->number)
(string-split s "\n"))))
(define (day17 input)
(define output (let ([s (open-output-string)])
(parameterize ([current-output-port s])
(intcode-interpreter input)
(get-output-string s))))
(define camera-view (string->map output))
(display camera-view)
(define intersection-points (map->intersection-points camera-view))
(printf "The calibration parameter is ~S.~%" (calibration-parameter intersection-points))
(define alt-program (hash-set input 0 2))
(define input-string (list->ascii-code (list
(list "A")
(list "L" "10" "R" "8" "L" "6" "R" "6" "L" "8" "L" "8")
(list "L")
(list "R")
(list "n")))
)
(let ([s (open-output-string)])
(with-handlers ([(const #t) (lambda (e)
(display (string->map (get-output-string s))))])
(parameterize ([current-input-port (open-input-string input-string)]
[current-output-port s])
(intcode-interpreter alt-program)
(display (string->map (get-output-string s))))))
)
(define (day7-1-input)
(file->intcode-program "../input/day7-1-input.txt"))
(define (run-amplifiers amplifier phases)
(let loop ([input 0]
[phases phases])
(cond
[(empty? phases) input]
[else (define input-string (format "~A\n~A\n" (first phases) input))
(define output-string (open-output-string))
(define output (parameterize ([current-input-port (open-input-string input-string)]
[current-output-port output-string])
(intcode-with-current-in intcode-interpreter amplifier)
(string->number (string-trim (get-output-string output-string)))))
(loop output (rest phases))])))
(define (day7-1 input)
(for/fold ([result 0])
([phase (permutations '(0 1 2 3 4))])
(max result (run-amplifiers input phase))))
(define (day7 input)
(printf "Day 7-1: The highest signal that can be sent is ~A~%" (day7-1 input))
)
(define (day13-1-input)
(file->intcode-program "../input/day13-1.txt"))
(define (with-output-to-string f)
(define s (open-output-string))
(parameterize ([current-output-port s])
(f)
(get-output-string s)))
(define (group-into l n)
(cond [(empty? l) '()]
[else
(define-values (g r) (split-at l n))
(cons g (group-into r n))]))
(define (block? output-instruction)
(string=? (third output-instruction) "2"))
(define (day13)
(define output (group-into (string-split
(with-output-to-string
(lambda ()
(intcode-interpreter (day13-1-input)))))
3))
(define blocks (filter block? output))
(printf "Day 13-1: Number of blocks: ~A~%" (length blocks)))
| false |
8851594d2c415040d5e700c99f157384cd926066 | 3424ab96c3265f69191dd3a219b2b66a1e61b57d | /litonico/reasoned-logicproblems.rkt | f5bb6409fe8c740e6b575cf38ab8007b397357a1 | []
| no_license | SeaRbSg/little-schemer | 9130db9720470c70ccddfc4803b0c14c214493c4 | 2864c2c46a546decb6e68cca92862c2d77fc6b65 | refs/heads/master | 2016-09-10T02:09:03.708360 | 2015-12-29T20:56:16 | 2015-12-29T20:56:16 | 26,874,199 | 10 | 4 | null | null | null | null | UTF-8 | Racket | false | false | 992 | rkt | reasoned-logicproblems.rkt | ;; I GET IT! 'd' is the 'decrement' part, like in 'cdr',
;; and 'a' is the 'address' part, like in 'car'.
#lang racket
(require "../lib/mk.rkt")
(require rackunit)
(require "reasoned-prelude.rkt")
(define five-floorso
(lambda (lst)
(fresh (a b c d e)
(== lst `(,a ,b ,c ,d ,e)))))
(define not-topo
(lambda (person lst)
(conde
[(== person (car lst)) %u]
[else %s])))
(define not-bottomo
(lambda (person lst)
(conde
[(== person (car (cdr (cdr (cdr (cdr lst)))))) %u]
[else %s])))
(define highero
(lambda (person1 person2 lst)
(conde
[(nullo lst) %u]
[(highero person1 person2 (cdr lst)) %s]
(define not-adjacento
(lambda (person1 person2 lst)
(conde
[(== person (car lst)) %u]
[else %s])))
(run 1 (x)
(five-floorso x)
(not-topo 'adam x)
(not-bottomo 'bill x)
(not-topo 'cora x)
(not-bottomo 'cora x)
(highero 'dale 'bill x)
(not-adjacento 'erin 'cora x)
(not-adjacento 'cora 'bill x))
| false |
cd2a685023260cac27f86770a5286c972e2d7a28 | 25a6efe766d07c52c1994585af7d7f347553bf54 | /gui-lib/framework/comment-snip.rkt | 3a4d1d63fb84ddf434bd34091d932065d8e1b369 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
]
| permissive | racket/gui | 520ff8f4ae5704210822204aa7cd4b74dd4f3eef | d01d166149787e2d94176d3046764b35c7c0a876 | refs/heads/master | 2023-08-25T15:24:17.693905 | 2023-08-10T16:45:35 | 2023-08-10T16:45:35 | 27,413,435 | 72 | 96 | NOASSERTION | 2023-09-14T17:09:52 | 2014-12-02T03:35:22 | Racket | UTF-8 | Racket | false | false | 111 | rkt | comment-snip.rkt |
(module comment-snip mzscheme
(require framework)
(provide (rename comment-box:snipclass snip-class)))
| false |
d9c90d44668a09d71d983b14261f69efcdb13dde | 82c76c05fc8ca096f2744a7423d411561b25d9bd | /typed-racket-lib/typed-racket/typecheck/tc-app/tc-app-hetero.rkt | ed3d9622df674e28cf53b7828e8587fcd1dd9e6d | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
]
| permissive | racket/typed-racket | 2cde60da289399d74e945b8f86fbda662520e1ef | f3e42b3aba6ef84b01fc25d0a9ef48cd9d16a554 | refs/heads/master | 2023-09-01T23:26:03.765739 | 2023-08-09T01:22:36 | 2023-08-09T01:22:36 | 27,412,259 | 571 | 131 | NOASSERTION | 2023-08-09T01:22:41 | 2014-12-02T03:00:29 | Racket | UTF-8 | Racket | false | false | 10,330 | rkt | tc-app-hetero.rkt | #lang racket/unit
(require "../../utils/utils.rkt"
racket/list
syntax/parse syntax/stx racket/match racket/sequence
(for-syntax racket/base syntax/parse racket/syntax)
"signatures.rkt"
"utils.rkt"
"../../utils/prefab.rkt"
(only-in "../../infer/infer.rkt" intersect)
"../../types/utils.rkt"
"../../types/abbrev.rkt"
"../../types/numeric-tower.rkt"
"../../types/resolve.rkt"
"../../types/type-table.rkt"
"../../types/generalize.rkt"
"../../types/match-expanders.rkt"
"../signatures.rkt"
"../check-below.rkt"
"../../rep/type-rep.rkt"
"../../rep/type-mask.rkt"
"../../rep/rep-utils.rkt"
(for-label racket/unsafe/ops racket/base))
(import tc-expr^ tc-app^ tc-literal^)
(export tc-app-hetero^)
(define-literal-set hetero-literals
#:for-label
(vector-ref unsafe-vector-ref unsafe-vector*-ref
vector-set! unsafe-vector-set! unsafe-vector*-set!
unsafe-struct-ref unsafe-struct*-ref
unsafe-struct-set! unsafe-struct*-set!
vector-immutable vector))
(define (tc/index expr)
(syntax-parse expr
#:literal-sets (kernel-literals)
[(quote i:number)
(let ((type (tc-literal #'i)))
(add-typeof-expr expr (ret type))
(syntax-e #'i))]
[_
(match (tc-expr expr)
[(tc-result1: (Val-able: (? number? i))) i]
[tc-results
(check-below tc-results (ret -Integer))
#f])]))
(define (index-error i-val i-bound expr type name)
(cond
[(not (and (integer? i-val) (exact? i-val)))
(tc-error/expr #:stx expr "expected exact integer for ~a index, but got ~a" name i-val)]
[(< i-val 0)
(tc-error/expr #:stx expr "index ~a too small for ~a ~a" i-val name type)]
[(not (< i-val i-bound))
(tc-error/expr #:stx expr "index ~a too large for ~a ~a" i-val name type)]))
(define (valid-index? i bound)
(and (integer? i) (exact? i) (<= 0 i (sub1 bound))))
;; FIXME - Do something with paths in the case that a structure/vector is not mutable
(define (tc/hetero-ref i-e es-t vec-t name op)
(define i-val (tc/index i-e))
(define i-bound (length es-t))
(cond
[(valid-index? i-val i-bound)
(define return-ty (list-ref es-t i-val))
(add-typeof-expr op (ret (-> vec-t -Fixnum return-ty)))
(ret return-ty)]
[(not i-val)
(define return-ty (apply Un es-t))
(add-typeof-expr op (ret (-> vec-t -Fixnum return-ty)))
(ret return-ty)]
[else
(index-error i-val i-bound i-e vec-t name)]))
(define (tc/hetero-set! i-e es-t val-e vec-t name op)
(define i-val (tc/index i-e))
(define i-bound (length es-t))
(cond
[(valid-index? i-val i-bound)
(define val-t (list-ref es-t i-val))
(tc-expr/check val-e (ret val-t))
(add-typeof-expr op (ret (-> vec-t -Fixnum val-t -Void :T+ #t)))
(ret -Void)]
[(not i-val)
(define val-res (single-value val-e))
(for ((es-type (in-list es-t)))
(check-below val-res (ret es-type)))
(define val-t
(match val-res [(tc-result1: t) t]))
(add-typeof-expr op (ret (-> vec-t -Fixnum val-t -Void :T+ #t)))
(ret -Void)]
[else
(single-value val-e)
(index-error i-val i-bound i-e vec-t name)]))
;; hetero-vecs->elems : (Listof Type?) -> (U #f (Listof Type?))
;; If `vts` is a list of HeterogeneousVector types
;; all with the same elements,
;; return the elements.
;; Else return `#false`
(define (hetero-vecs->elems ts)
(for/fold ([acc #t])
([t (in-list ts)])
(and acc
(match t
[(HeterogeneousVector: es)
(if (eq? acc #true)
es
(and (equal? acc es) acc))]
[_ #f]))))
(define-tc/app-syntax-class (tc/app-hetero expected)
#:literal-sets (hetero-literals)
(pattern (~and form ((~and op (~or unsafe-struct-ref unsafe-struct*-ref)) struct:expr index:expr))
(match (single-value #'struct)
[(tc-result1: (app resolve t))
(let loop ([struct-t t])
(match struct-t
[(Intersection: ts _)
(for/first ([t (in-list ts)]
#:when (or (Prefab? t) (Struct? t) (PrefabTop? t)))
(loop t))]
[(Struct: _ _ (list (fld: flds _ _) ...) _ _ _ _)
(tc/hetero-ref #'index flds struct-t "struct" #'op)]
[(Prefab: _ (list flds ...))
(tc/hetero-ref #'index flds struct-t "prefab struct" #'op)]
[(PrefabTop: key)
(tc/hetero-ref #'index
(build-list (prefab-key->field-count key) (λ (_) Univ))
struct-t
"prefab struct"
#'op)]
[_ (tc/app-regular #'form expected)]))]))
;; vector-ref on het vectors
(pattern (~and form ((~and op (~or vector-ref unsafe-vector-ref unsafe-vector*-ref)) vec:expr index:expr))
(match (single-value #'vec)
[(tc-result1: (and vec-t (app resolve (Is-a: (HeterogeneousVector: es)))))
(tc/hetero-ref #'index es vec-t "vector" #'op)]
[(tc-result1: (and vec-t (app resolve (Union: _ (app hetero-vecs->elems (? pair? es))))))
(tc/hetero-ref #'index es vec-t "vector" #'op)]
[v-ty (tc/app-regular #'form expected)]))
;; unsafe struct-set!
(pattern (~and form ((~and op (~or unsafe-struct-set! unsafe-struct*-set!)) s:expr index:expr val:expr))
(match (single-value #'s)
[(tc-result1: (and struct-t (app resolve (Struct: _ _ (list (fld: flds _ _) ...) _ _ _ _))))
(tc/hetero-set! #'index flds #'val struct-t "struct" #'op)]
[s-ty (tc/app-regular #'form expected)]))
;; vector-set! on het vectors
(pattern (~and form ((~and op (~or vector-set! unsafe-vector-set! unsafe-vector*-set!)) v:expr index:expr val:expr))
(match (single-value #'v)
[(tc-result1: (and vec-t (app resolve (Is-a: (HeterogeneousVector: es)))))
(tc/hetero-set! #'index es #'val vec-t "vector" #'op)]
[(tc-result1: (and vec-t (app resolve (Union: _ (app hetero-vecs->elems (? pair? es))))))
(tc/hetero-set! #'index es #'val vec-t "vector" #'op)]
[v-ty (tc/app-regular #'form expected)]))
(pattern (~and form (vector-immutable args:expr ...))
(tc-app-immutable-hetero-vector #'form expected))
(pattern (~and form (vector args:expr ...))
(tc-app-mutable-hetero-vector #'form expected)))
;; The cases for `(vector-immutable e ...)` and `(vector e ...)` are similar
;; but use different match expanders, so we use a macro to abstract over the similar parts
;; The `#:with` clause below contains the differences
(define-values [tc-app-immutable-hetero-vector tc-app-mutable-hetero-vector]
(let ()
(define-syntax (make-tc-app-hetero-vector stx)
(syntax-parse stx #:literals (quote)
[(_ (quote mode:id))
#:with (?make-HV ?match-V ?match-HV ?maskV ?tc-expr/t/maybe-generalize ?fn)
(case (syntax-e #'mode)
[(immutable)
(syntax/loc stx
(make-Immutable-HeterogeneousVector
Immutable-Vector:
Immutable-HeterogeneousVector:
mask:immutable-vector
tc-expr/t
"vector-immutable"))]
[(mutable)
(syntax/loc stx
(make-Mutable-HeterogeneousVector
Mutable-Vector:
Mutable-HeterogeneousVector:
mask:mutable-vector
(lambda (e) (generalize (tc-expr/t e)))
"vector"))]
[else
(raise-argument-error 'make-tc-app-hetero-vector "(or/c 'immutable 'mutable)" (syntax-e #'mode))])
(syntax/loc stx
(let ([has-vector-mask? (λ (t) (eq? ?maskV (mask t)))])
(λ (form expected)
(syntax-parse form #:literal-sets (hetero-literals)
[((~and op (~or vector-immutable vector)) . args)
(match expected
[(tc-result1: (app resolve (Is-a: (?match-V t))))
(define arg-tys
(for/list ([e (in-syntax #'args)])
(tc-expr/check e (ret t))
t))
(define return-ty
(?make-HV arg-tys))
(add-typeof-expr #'op (ret (->* arg-tys return-ty :T+ #t)))
(ret return-ty)]
[(tc-result1: (app resolve (Is-a: (?match-HV ts))))
(cond
[(= (length ts) (syntax-length #'args))
(define arg-tys
(for/list ([e (in-syntax #'args)]
[t (in-list ts)])
(tc-expr/check/t e (ret t))))
(define return-ty
(?make-HV arg-tys))
(add-typeof-expr #'op (ret (->* arg-tys return-ty :T+ #t)))
(ret return-ty -true-propset)]
[else
(tc-error/expr
"expected vector with ~a elements, but got ~a"
(length ts) (?make-HV (stx-map tc-expr/t #'args)))])]
;; If the expected type is a union, then we examine just the parts
;; of the union that are vectors. If there's only one of those,
;; we re-run this whole algorithm with that. Otherwise, we treat
;; it like any other expected type.
[(tc-result1: (app resolve (Is-a: (Union: _ ts))))
#:when (= 1 (count has-vector-mask? ts))
(define t0 (findf has-vector-mask? ts))
(tc/app #`(#%plain-app . #,form) (ret t0))]
;; if mutable, generalize element types
[_
(define tc-hv-elem ?tc-expr/t/maybe-generalize)
(define arg-tys
(for/list ((e (in-syntax #'args)))
(tc-hv-elem e)))
(define return-ty
(?make-HV arg-tys))
(add-typeof-expr #'op (ret (->* arg-tys return-ty :T+ #t)))
(ret return-ty)])]))))]))
(values (make-tc-app-hetero-vector 'immutable) (make-tc-app-hetero-vector 'mutable))))
| true |
e963434cf45658da1b1bd0f0bdba748cc8359900 | 47916e36535ef8513c6737a44cccf0847e9a2773 | /info.rkt | 5d6221e0f804d5552c2d98789a7eacfa1402a0cd | []
| no_license | branneman/status-page | 4be8dac6f231049b399b603015f0b635e4fc5a61 | 9e117e0c7828951ee70bf8f6ff912c5e698372d4 | refs/heads/main | 2023-06-02T23:24:29.343525 | 2021-06-24T09:30:45 | 2021-06-24T09:30:45 | 373,496,645 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 251 | rkt | info.rkt | #lang info
(define name "status-page")
(define version "1.0")
(define pkg-authors '(branneman))
(define pkg-desc "Communicate service status to your users via a web page.")
(define deps
'("dotenv"
"html-template"
"markdown"
"tzinfo"))
| false |
b1793b6bf0e7871a8ee95824317ed245deb857ae | 82c76c05fc8ca096f2744a7423d411561b25d9bd | /typed-racket-test/succeed/exceptions.rkt | 797945ff481a7c54e3fa8f993c60bd3c48ef7218 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
]
| permissive | racket/typed-racket | 2cde60da289399d74e945b8f86fbda662520e1ef | f3e42b3aba6ef84b01fc25d0a9ef48cd9d16a554 | refs/heads/master | 2023-09-01T23:26:03.765739 | 2023-08-09T01:22:36 | 2023-08-09T01:22:36 | 27,412,259 | 571 | 131 | NOASSERTION | 2023-08-09T01:22:41 | 2014-12-02T03:00:29 | Racket | UTF-8 | Racket | false | false | 1,512 | rkt | exceptions.rkt | #lang typed/racket
(: abort (Parameter (Any -> Nothing)))
(define abort (make-parameter (lambda (x) (error 'abort))))
(define-syntax (with-abort stx)
(syntax-case stx ()
((_ body ...)
#'(call/cc (lambda: ((k : (Any -> Nothing)))
(parameterize ((abort k))
body ...))))))
(call-with-exception-handler
(lambda (v) (displayln v) ((abort) v))
(lambda ()
(with-abort 2)
(with-abort (raise 3))
(with-abort (error 'foo))
(with-abort (error 'foo "Seven"))
(with-abort (error 'foo "Seven ~a" 5))
(with-abort (raise-user-error 'foo))
(with-abort (raise-user-error 'foo "Seven"))
(with-abort (raise-user-error 'foo "Seven ~a" 5))
(with-abort (raise-type-error 'slash "foo" 1))
(with-abort (raise-type-error 'slash "foo" 1 #\a #\c))
(with-abort (raise-mismatch-error 'er "foo" 2))
(with-abort (raise-syntax-error #f "stx-err"))
(with-abort (raise-syntax-error #f "stx-err" 45))
(with-abort (raise-syntax-error #f "stx-err" 4 5))
(with-abort (raise-syntax-error #f "stx-err" 4 5 (list #'stx)))
(void)
))
(parameterize ((uncaught-exception-handler (lambda (x) ((abort) x)))
(error-escape-handler (lambda () (void)))
(error-display-handler (lambda: ((s : String) (e : Any)) (void)))
(error-print-width 4)
(error-print-context-length 10)
(error-value->string-handler (lambda: ((v : Any) (n : Natural)) "str"))
(error-print-source-location 'yes))
(void))
| true |
7d0105d0151b97b62dd090b7b94bf538ca7fa214 | 099418d7d7ca2211dfbecd0b879d84c703d1b964 | /whalesong/selfhost/compiler/analyzer.rkt | 104aaaaf4b73e5b97f015ac311575e7eb5884cb6 | []
| no_license | vishesh/whalesong | f6edd848fc666993d68983618f9941dd298c1edd | 507dad908d1f15bf8fe25dd98c2b47445df9cac5 | refs/heads/master | 2021-01-12T21:36:54.312489 | 2015-08-19T19:28:25 | 2015-08-19T20:34:55 | 34,933,778 | 3 | 0 | null | 2015-05-02T03:04:54 | 2015-05-02T03:04:54 | null | UTF-8 | Racket | false | false | 12,172 | rkt | analyzer.rkt | #lang whalesong (require "../selfhost-lang.rkt")
(require "expression-structs.rkt"
"analyzer-structs.rkt"
"arity-structs.rkt"
"lexical-structs.rkt"
"il-structs.rkt"
"compiler-structs.rkt"
; racket/list
)
(require "compiler-helper.rkt")
(provide collect-all-lambdas-with-bodies
collect-lam-applications
extract-static-knowledge
ensure-prefix)
;; Holds helper functions we use for different analyses.
;; Given a lambda body, collect all the applications that exist within
;; it. We'll use this to determine what procedures can safely be
;; transformed into primitives.
(: collect-lam-applications (Lam CompileTimeEnvironment -> (Listof CompileTimeEnvironmentEntry)))
(define (collect-lam-applications lam cenv)
(let loop
([exp (Lam-body lam)] ; : Expression
[cenv cenv] ; : CompileTimeEnvironment
[acc '()]) ; : (Listof CompileTimeEnvironmentEntry)
(cond
[(Top? exp)
(loop (Top-code exp)
(cons (Top-prefix exp) cenv)
acc)]
[(Module? exp)
(loop (Module-code exp)
(cons (Module-prefix exp) cenv)
acc)]
[(Constant? exp)
acc]
[(LocalRef? exp)
acc]
[(ToplevelRef? exp)
acc]
[(ToplevelSet? exp)
(loop (ToplevelSet-value exp) cenv acc)]
[(Branch? exp)
(define acc-1 (loop (Branch-predicate exp) cenv acc))
(define acc-2 (loop (Branch-consequent exp) cenv acc-1))
(define acc-3 (loop (Branch-alternative exp) cenv acc-2))
acc-3]
[(Lam? exp)
acc]
[(CaseLam? exp)
acc]
[(EmptyClosureReference? exp)
acc]
[(Seq? exp)
(foldl (lambda (e ; [e : Expression]
acc ; [acc : (Listof CompileTimeEnvironmentEntry)]
)
(loop e cenv acc))
acc
(Seq-actions exp))]
[(Splice? exp)
(foldl (lambda (e ; [e : Expression]
acc ; [acc : (Listof CompileTimeEnvironmentEntry)]
)
(loop e cenv acc))
acc
(Splice-actions exp))]
[(Begin0? exp)
(foldl (lambda (e ; [e : Expression]
acc ; [acc : (Listof CompileTimeEnvironmentEntry)]
)
(loop e cenv acc))
acc
(Begin0-actions exp))]
[(App? exp)
(define new-cenv
(append (build-list (length (App-operands exp)) (lambda (i #;[i : Natural]) '?))
cenv))
(foldl (lambda (e #;[e : Expression]
acc #;[acc : (Listof CompileTimeEnvironmentEntry)])
(loop e new-cenv acc))
(cons (extract-static-knowledge (App-operator exp) new-cenv)
(loop (App-operator exp) new-cenv acc))
(App-operands exp))]
[(Let1? exp)
(define acc-1 (loop (Let1-rhs exp) (cons '? cenv) acc))
(define acc-2 (loop (Let1-body exp)
(cons (extract-static-knowledge (Let1-rhs exp) (cons '? cenv))
cenv)
acc-1))
acc-2]
[(LetVoid? exp)
(loop (LetVoid-body exp)
(append (build-list (LetVoid-count exp) (lambda (i #;[i : Natural]) '?))
cenv)
acc)]
[(InstallValue? exp)
(loop (InstallValue-body exp) cenv acc)]
[(BoxEnv? exp)
(loop (BoxEnv-body exp) cenv acc)]
[(LetRec? exp)
(let ([n (length (LetRec-procs exp))])
(let ([new-cenv (append (map (lambda (p #;[p : Lam])
(extract-static-knowledge
p
(append (build-list (length (LetRec-procs exp))
(lambda (i #;[i : Natural]) '?))
(drop cenv n))))
(LetRec-procs exp))
(drop cenv n))])
(loop (LetRec-body exp) new-cenv acc)))]
[(WithContMark? exp)
(define acc-1 (loop (WithContMark-key exp) cenv acc))
(define acc-2 (loop (WithContMark-value exp) cenv acc-1))
(define acc-3 (loop (WithContMark-body exp) cenv acc-2))
acc-3]
[(ApplyValues? exp)
(define acc-1 (loop (ApplyValues-proc exp) cenv acc))
(define acc-2 (loop (ApplyValues-args-expr exp) cenv acc-1))
acc-2]
[(DefValues? exp)
(loop (DefValues-rhs exp) cenv acc)]
[(PrimitiveKernelValue? exp)
acc]
[(VariableReference? exp)
(loop (VariableReference-toplevel exp) cenv acc)]
[(Require? exp)
acc])))
(: extract-static-knowledge (Expression CompileTimeEnvironment ->
CompileTimeEnvironmentEntry))
;; Statically determines what we know about the expression, given the compile time environment.
;; We should do more here eventually, including things like type inference or flow analysis, so that
;; we can generate better code.
(define (extract-static-knowledge exp cenv)
(cond
[(Lam? exp)
;(log-debug "known to be a lambda")
(make-StaticallyKnownLam (Lam-name exp)
(Lam-entry-label exp)
(if (Lam-rest? exp)
(make-ArityAtLeast (Lam-num-parameters exp))
(Lam-num-parameters exp)))]
[(and (LocalRef? exp)
(not (LocalRef-unbox? exp)))
(let ([entry (list-ref cenv (LocalRef-depth exp))])
;(log-debug (format "known to be ~s" entry))
entry)]
[(EmptyClosureReference? exp)
(make-StaticallyKnownLam (EmptyClosureReference-name exp)
(EmptyClosureReference-entry-label exp)
(if (EmptyClosureReference-rest? exp)
(make-ArityAtLeast (EmptyClosureReference-num-parameters exp))
(EmptyClosureReference-num-parameters exp)))]
[(ToplevelRef? exp)
;(log-debug (format "toplevel reference of ~a" exp))
;(when (ToplevelRef-constant? exp)
; (log-debug (format "toplevel reference ~a should be known constant" exp)))
(let ([name ; : (U Symbol False GlobalBucket ModuleVariable)
(list-ref (Prefix-names (ensure-prefix (list-ref cenv (ToplevelRef-depth exp))))
(ToplevelRef-pos exp))])
(cond
[(ModuleVariable? name)
;(log-debug (format "toplevel reference is to ~s" name))
name]
[(GlobalBucket? name)
'?]
[else
;(log-debug (format "nothing statically known about ~s" exp))
'?]))]
[(Constant? exp)
(make-Const (ensure-const-value (Constant-v exp)))]
[(PrimitiveKernelValue? exp)
exp]
[else
;(log-debug (format "nothing statically known about ~s" exp))
'?]))
(: collect-all-lambdas-with-bodies (Expression -> (Listof lam+cenv)))
;; Finds all the lambdas in the expression.
(define (collect-all-lambdas-with-bodies exp)
(let loop ; : (Listof lam+cenv)
([exp exp] ; : Expression
[cenv '()]) ; : CompileTimeEnvironment
(cond
[(Top? exp)
(loop (Top-code exp) (cons (Top-prefix exp) cenv))]
[(Module? exp)
(loop (Module-code exp) (cons (Module-prefix exp) cenv))]
[(Constant? exp)
'()]
[(LocalRef? exp)
'()]
[(ToplevelRef? exp)
'()]
[(ToplevelSet? exp)
(loop (ToplevelSet-value exp) cenv)]
[(Branch? exp)
(append (loop (Branch-predicate exp) cenv)
(loop (Branch-consequent exp) cenv)
(loop (Branch-alternative exp) cenv))]
[(Lam? exp)
(cons (make-lam+cenv exp (extract-lambda-cenv exp cenv))
(loop (Lam-body exp)
(extract-lambda-cenv exp cenv)))]
[(CaseLam? exp)
(cons (make-lam+cenv exp cenv)
(apply append (map (lambda (lam #;[lam : (U Lam EmptyClosureReference)])
(loop lam cenv))
(CaseLam-clauses exp))))]
[(EmptyClosureReference? exp)
'()]
[(Seq? exp)
(apply append (map (lambda (e #;[e : Expression]) (loop e cenv))
(Seq-actions exp)))]
[(Splice? exp)
(apply append (map (lambda (e #;[e : Expression]) (loop e cenv))
(Splice-actions exp)))]
[(Begin0? exp)
(apply append (map (lambda (e #;[e : Expression]) (loop e cenv))
(Begin0-actions exp)))]
[(App? exp)
(let ([new-cenv (append (build-list (length (App-operands exp)) (lambda (i #;[i : Natural]) '?))
cenv)])
(append (loop (App-operator exp) new-cenv)
(apply append (map (lambda (e #;[e : Expression]) (loop e new-cenv)) (App-operands exp)))))]
[(Let1? exp)
(append (loop (Let1-rhs exp)
(cons '? cenv))
(loop (Let1-body exp)
(cons (extract-static-knowledge (Let1-rhs exp) (cons '? cenv))
cenv)))]
[(LetVoid? exp)
(loop (LetVoid-body exp)
(append (build-list (LetVoid-count exp) (lambda (i #;[i : Natural]) '?))
cenv))]
[(InstallValue? exp)
(loop (InstallValue-body exp) cenv)]
[(BoxEnv? exp)
(loop (BoxEnv-body exp) cenv)]
[(LetRec? exp)
(let ([n (length (LetRec-procs exp))])
(let ([new-cenv (append (map (lambda (p #;[p : Lam])
(extract-static-knowledge
p
(append (build-list (length (LetRec-procs exp))
(lambda (i #;[i : Natural]) '?))
(drop cenv n))))
(LetRec-procs exp))
(drop cenv n))])
(append (apply append
(map (lambda (lam #;[lam : Lam])
(loop lam new-cenv))
(LetRec-procs exp)))
(loop (LetRec-body exp) new-cenv))))]
[(WithContMark? exp)
(append (loop (WithContMark-key exp) cenv)
(loop (WithContMark-value exp) cenv)
(loop (WithContMark-body exp) cenv))]
[(ApplyValues? exp)
(append (loop (ApplyValues-proc exp) cenv)
(loop (ApplyValues-args-expr exp) cenv))]
[(DefValues? exp)
(append (loop (DefValues-rhs exp) cenv))]
[(PrimitiveKernelValue? exp)
'()]
[(VariableReference? exp)
(loop (VariableReference-toplevel exp) cenv)]
[(Require? exp)
'()]
[else (error 'here (list exp cenv))]
)))
(: extract-lambda-cenv (Lam CompileTimeEnvironment -> CompileTimeEnvironment))
;; Given a Lam and the ambient environment, produces the compile time environment for the
;; body of the lambda.
(define (extract-lambda-cenv lam cenv)
(append (map (lambda (d #;[d : Natural])
(list-ref cenv d))
(Lam-closure-map lam))
(build-list (if (Lam-rest? lam)
(add1 (Lam-num-parameters lam))
(Lam-num-parameters lam))
(lambda (i #;[i : Natural]) '?))))
(: ensure-prefix (CompileTimeEnvironmentEntry -> Prefix))
(define (ensure-prefix x)
(if (Prefix? x)
x
(error 'ensure-prefix "Not a prefix: ~s" x)))
| false |
fcbd62ebced212320009a5ccfcf36b5da19419ab | aac00fa20ca35abc9557b5ec16b021c8c333992a | /expressive/video.rkt | 80fa662d53c6a08b1a78e9ccc62875eb72ff1b67 | []
| no_license | spdegabrielle/artifact2020 | c80ddced4c6be4bbe159c5ac42539b20f79e82c6 | 1863e9b58a09232bc85ba9fb6b1832c974559ad9 | refs/heads/master | 2022-12-03T12:48:55.930122 | 2020-08-09T05:21:25 | 2020-08-19T03:06:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 2,866 | rkt | video.rkt | #lang editor editor/lang
(require (for-editor data/gvector
racket/dict))
(begin-for-interactive-syntax
(module+ test
(require editor/test)))
(define-interactive-syntax video-table$ vertical-block$
(super-new))
(define-interactive-syntax insert-editor$ dialog$
(inherit set-result! show)
(super-new)
(define options (new option-bundle$))
(new labeled-option$ [parent this]
[label "Filename"]
[option (λ (this)
(new field$ [parent this]))]
[bundle options]
[bundle-label 'filename]
[bundle-finalizer (λ (opt)
(send opt get-text))])
(new labeled-option$ [parent this]
[label "Track#"]
[option (λ (this)
(new field$ [parent this]))]
[bundle options]
[bundle-label 'track]
[bundle-finalizer (λ (opt)
(string->number (send opt get-text)))])
(new labeled-option$ [parent this]
[label "Length"]
[option (λ (this)
(new field$ [parent this]))]
[bundle options]
[bundle-label 'length]
[bundle-finalizer (λ (opt)
(send opt get-text))])
(define confirm-row (new horizontal-block$ [parent this]))
(new button$ [parent confirm-row]
[label (new label$ [text "Cancel"])]
[callback (λ (button event)
(show #f))])
(new button$ [parent confirm-row]
[label (new label$ [text "OK"])]
[callback (λ (b event)
(set-result! (send options get-options))
(show #f))]))
(define-interactive-syntax video-editor$ vertical-block$
(super-new)
(define tracks (make-gvector))
(define table (new vertical-block$ [parent this]))
(define control-line (new horizontal-block$ [parent this]))
(define/public (remove-clip-interactive btn event)
(void))
(define/public (add-video-interactive btn event)
(define get-vid (new insert-editor$ [title "Insert Video"]))
(send get-vid show #t)
(define result (send get-vid get-result))
(define track# (dict-ref result 'track))
(when track#
(for ([i (in-range (- track# (gvector-count tracks)))])
(define row (new horizontal-block$ [parent table]))
(gvector-add! tracks (cons row (make-gvector))))
(define track (gvector-ref tracks (sub1 track#)))
(gvector-add! (cdr track)
(new button$ [parent (car track)]
[label (new label$ [text (or (dict-ref result 'filename) "")])]
[callback (list this 'remove-clip-interactive)]))))
(new button$ [parent this]
[label (new label$ [text "Add Clip"])]
[callback (list this 'add-video-interactive)]))
(begin-for-interactive-syntax
(module+ test
(test-window
(new video-editor$))))
| false |
94a6d1f11968582d8ec824b9c524bebc4b9e20cf | 67f496ff081faaa375c5000a58dd2c69d8aeec5f | /koyo-lib/koyo/cors.rkt | d215907da3cf1a5060ed8f3ff2162273587bff29 | [
"BSD-3-Clause"
]
| permissive | Bogdanp/koyo | e99143dd4ee918568ed5b5b199157cd4f87f685f | a4dc1455fb1e62984e5d52635176a1464b8753d8 | refs/heads/master | 2023-08-18T07:06:59.433041 | 2023-08-12T09:24:30 | 2023-08-12T09:24:30 | 189,833,202 | 127 | 24 | null | 2023-03-12T10:24:31 | 2019-06-02T10:32:01 | Racket | UTF-8 | Racket | false | false | 2,445 | rkt | cors.rkt | #lang racket/base
(require racket/contract
racket/function
racket/string
web-server/http
"contract.rkt"
"profiler.rkt"
"url.rkt")
(provide
current-cors-origin
current-cors-methods
current-cors-headers
current-cors-max-age
current-cors-credentials-allowed?
(contract-out
[wrap-cors middleware/c]))
(define/contract current-cors-origin
(parameter/c (or/c #f non-empty-string?))
(make-parameter #f))
(define/contract current-cors-methods
(parameter/c (listof non-empty-string?))
(make-parameter '("HEAD" "DELETE" "GET" "PATCH" "POST" "PUT" "OPTIONS")))
(define/contract current-cors-headers
(parameter/c (listof non-empty-string?))
(make-parameter (list "*")))
(define/contract current-cors-max-age
(parameter/c exact-nonnegative-integer?)
(make-parameter 86400))
(define/contract current-cors-credentials-allowed?
(parameter/c boolean?)
(make-parameter #t))
(define (make-allow-origin-header)
(define origin
(string->bytes/utf-8
(cond
[(current-cors-origin)
=> identity]
[else
(format "~a://~a"
(current-application-url-scheme)
(current-application-url-host))])))
(make-header #"Access-Control-Allow-Origin" origin))
(define (make-options-headers)
(define headers
(list (make-allow-origin-header)
(make-header #"Access-Control-Allow-Methods"
(string->bytes/utf-8
(string-join (current-cors-methods) ",")))
(make-header #"Access-Control-Allow-Headers"
(string->bytes/utf-8
(string-join (current-cors-headers) ",")))
(make-header #"Access-Control-Max-Age"
(string->bytes/utf-8
(number->string (current-cors-max-age))))))
(if (current-cors-credentials-allowed?)
(cons (make-header #"Access-Control-Allow-Credentials" #"true") headers)
headers))
(define ((wrap-cors handler) req . args)
(with-timing 'cors "wrap-cors"
(cond
[(bytes=? (request-method req) #"OPTIONS")
(response/full 200 #"OK" (current-seconds) #f (make-options-headers) null)]
[else
(define resp (apply handler req args))
(define headers (cons (make-allow-origin-header)
(response-headers resp)))
(struct-copy response resp [headers headers])])))
| false |
2f854ee1068b7d321061f9cd7cbf18c25d6c0d58 | c47cda0f82db8e6100f2e6d4f395c9bb9d1feebb | /bitmap/constructor.rkt | ede22124f61b0bd8ec707432c2a88021aec426c1 | []
| no_license | capfredf/graphics | 1ad793532894b53feb80a503046a53d762315ed7 | 50751297f244a01ac734099b9a1e9be97cd36f3f | refs/heads/master | 2021-06-17T04:06:43.007842 | 2021-03-25T15:35:15 | 2021-03-25T15:35:15 | 191,189,327 | 0 | 0 | null | 2019-06-10T14:58:47 | 2019-06-10T14:58:47 | null | UTF-8 | Racket | false | false | 10,417 | rkt | constructor.rkt | #lang typed/racket/base
(provide (all-defined-out))
(require "font.rkt")
(require "digitama/base.rkt")
(require "digitama/font.rkt")
(require "digitama/source.rkt")
(require "digitama/unsafe/convert.rkt")
(require "digitama/unsafe/image.rkt")
(require "digitama/unsafe/shape.rkt")
(require "digitama/unsafe/text.rkt")
(require racket/math)
(require racket/string)
(require racket/format)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define bitmap-rectangular : (-> Nonnegative-Real Nonnegative-Real XYWH->ARGB [#:density Positive-Flonum] Bitmap)
(lambda [width height λargb #:density [density (default-bitmap-density)]]
(λbitmap (real->double-flonum width) (real->double-flonum height)
density λargb)))
(define bitmap-blank : (->* () (Real (Option Real) #:density Positive-Flonum) Bitmap)
(lambda [[width 0.0] [height #false] #:density [density (default-bitmap-density)]]
(bitmap_blank (real->double-flonum width)
(real->double-flonum (or height width))
density)))
(define bitmap-ghost : (-> Bitmap Bitmap)
(lambda [bmp]
(define-values (w h) (bitmap-flsize bmp))
(bitmap_blank w h (bitmap-density bmp))))
(define bitmap-solid : (->* () (Color Real #:density Positive-Flonum) Bitmap)
(lambda [[color 'transparent] [size 1] #:density [density (default-bitmap-density)]]
(define side : Flonum (real->double-flonum size))
(bitmap_pattern side side (rgb* color) density)))
(define bitmap-text : (->* (Any)
(Font #:color Fill-Paint #:background (Option Fill-Paint) #:lines (Listof Symbol)
#:baseline (Option Color) #:capline (Option Color) #:meanline (Option Color)
#:ascent (Option Color) #:descent (Option Color)
#:density Positive-Flonum)
Bitmap)
(lambda [text [font (default-font)] #:color [fgsource black] #:background [bgsource #false] #:lines [lines null]
#:ascent [alsource #false] #:descent [dlsource #false] #:capline [clsource #false] #:meanline [mlsource #false]
#:baseline [blsource #false] #:density [density (default-bitmap-density)]]
(bitmap_text (~a text) (font-description font) lines (fill-paint->source fgsource) (fill-paint->source* bgsource)
(and alsource (rgb* alsource)) (and clsource (rgb* clsource)) (and mlsource (rgb* mlsource))
(and blsource (rgb* blsource)) (and dlsource (rgb* dlsource)) density)))
(define bitmap-paragraph : (->* ((U String (Listof String)))
(Font #:color Fill-Paint #:background (Option Fill-Paint) #:lines (Listof Symbol)
#:max-width Real #:max-height Real #:indent Real #:spacing Real
#:wrap-mode Paragraph-Wrap-Mode #:ellipsize-mode Paragraph-Ellipsize-Mode
#:density Positive-Flonum)
Bitmap)
(lambda [texts [font (default-font)] #:color [fgsource black] #:background [bgsource #false] #:lines [lines null]
#:max-width [max-width +inf.0] #:max-height [max-height +inf.0] #:indent [indent 0.0] #:spacing [spacing 0.0]
#:wrap-mode [wrap-mode 'word-char] #:ellipsize-mode [ellipsize-mode 'end]
#:density [density (default-bitmap-density)]]
(define-values (smart-height smart-emode)
(cond [(or (infinite? max-height) (nan? max-height)) (values -1 'none)]
[(negative? max-height) (values (exact-round max-height) ellipsize-mode)]
[else (values (real->double-flonum max-height) ellipsize-mode)]))
(bitmap_paragraph (if (list? texts) (string-join texts "\n") texts) (font-description font) lines
(if (or (infinite? max-width) (nan? max-width)) -1 (real->double-flonum max-width)) smart-height
(real->double-flonum indent) (real->double-flonum spacing)
(paragraph-wrap-mode->integer wrap-mode raise-argument-error)
(paragraph-ellipsize-mode->integer smart-emode raise-argument-error)
(fill-paint->source fgsource) (fill-paint->source* bgsource) density)))
(define bitmap-frame : (-> Bitmap [#:border (Option Stroke-Paint)] [#:fill (Option Fill-Paint)]
[#:margin (U Nonnegative-Real (Listof Nonnegative-Real))]
[#:padding (U Nonnegative-Real (Listof Nonnegative-Real))]
Bitmap)
(lambda [bmp #:margin [margin 0.0] #:padding [inset 0.0] #:border [stroke (default-border)] #:fill [fill #false]]
(define-values (mtop mright mbottom mleft)
(cond [(list? margin) (list->4:values (map real->double-flonum margin) 0.0)]
[else (let ([fl (real->double-flonum margin)]) (values fl fl fl fl))]))
(define-values (ptop pright pbottom pleft)
(cond [(list? inset) (list->4:values (map real->double-flonum inset) 0.0)]
[else (let ([fl (real->double-flonum inset)]) (values fl fl fl fl))]))
(bitmap_frame (bitmap-surface bmp) mtop mright mbottom mleft ptop pright pbottom pleft
(stroke-paint->source* stroke) (fill-paint->source* fill) (bitmap-density bmp))))
(define bitmap-square : (->* (Real)
((Option Real) #:border (Option Stroke-Paint) #:fill (Option Fill-Paint) #:density Positive-Flonum)
Bitmap)
(lambda [w [radius #false] #:border [border (default-stroke)] #:fill [pattern #false] #:density [density (default-bitmap-density)]]
(define width : Flonum (real->double-flonum w))
(if (and radius (positive? radius))
(bitmap_rounded_rectangle width width radius (stroke-paint->source* border) (fill-paint->source* pattern) density)
(bitmap_rectangle width width (stroke-paint->source* border) (fill-paint->source* pattern) density))))
(define bitmap-rectangle : (->* (Real)
(Real (Option Real) #:border (Option Stroke-Paint) #:fill (Option Fill-Paint) #:density Positive-Flonum)
Bitmap)
(lambda [w [h #false] [radius #false] #:border [border (default-stroke)] #:fill [pattern #false]
#:density [density (default-bitmap-density)]]
(define width : Flonum (real->double-flonum w))
(define height : Flonum (if (not h) width (real->double-flonum h)))
(if (and radius (positive? radius))
(bitmap_rounded_rectangle width height radius (stroke-paint->source* border) (fill-paint->source* pattern) density)
(bitmap_rectangle width height (stroke-paint->source* border) (fill-paint->source* pattern) density))))
(define bitmap-stadium : (-> Real Real [#:border (Option Stroke-Paint)] [#:fill (Option Fill-Paint)] [#:density Positive-Flonum] Bitmap)
(lambda [length radius #:border [border (default-stroke)] #:fill [pattern #false] #:density [density (default-bitmap-density)]]
(bitmap_stadium (real->double-flonum length) radius (stroke-paint->source* border) (fill-paint->source* pattern) density)))
(define bitmap-circle : (-> Real [#:border (Option Stroke-Paint)] [#:fill (Option Fill-Paint)] [#:density Positive-Flonum] Bitmap)
(lambda [radius #:border [border (default-stroke)] #:fill [pattern #false] #:density [density (default-bitmap-density)]]
(bitmap_circle (real->double-flonum radius) (stroke-paint->source* border) (fill-paint->source* pattern) density)))
(define bitmap-sector : (-> Real Real Real
[#:border (Option Stroke-Paint)] [#:fill (Option Fill-Paint)] [#:radian? Boolean] [#:density Positive-Flonum]
Bitmap)
(lambda [radius start end #:border [border (default-stroke)] #:fill [pattern #false] #:radian? [radian? #true]
#:density [density (default-bitmap-density)]]
(bitmap_sector (real->double-flonum radius) (real->double-flonum start) (real->double-flonum end)
(stroke-paint->source* border) (fill-paint->source* pattern) density radian?)))
(define bitmap-ellipse : (->* (Real) (Real #:border (Option Stroke-Paint) #:fill (Option Fill-Paint) #:density Positive-Flonum) Bitmap)
(lambda [width [height #false] #:border [border (default-stroke)] #:fill [pattern #false] #:density [density (default-bitmap-density)]]
(if (or (not height) (= width height))
(bitmap_circle (/ (real->double-flonum width) 2.0) (stroke-paint->source* border) (fill-paint->source* pattern) density)
(bitmap_ellipse (real->double-flonum width) (real->double-flonum height)
(stroke-paint->source* border) (fill-paint->source* pattern) density))))
#;(define bitmap-polygon : (->* ((Pairof (Pairof Real Real) (Listof (Pairof Real Real))))
(Real Real (U 'odd-even 'winding) #:color Brush+Color #:border Pen+Color #:density Positive-Flonum)
Bitmap)
(let ([path : (Instance DC-Path%) (make-object dc-path%)])
(lambda [vertices [xoffset 0.0] [yoffset 0.0] [style 'odd-even] #:color [color black] #:border [border-color 'transparent]
#:density [density (default-bitmap-density)]]
(define count : Integer (length vertices))
(send path reset)
(send path move-to (caar vertices) (cdar vertices))
(for ([p (in-list (cdr vertices))]) (send path line-to (car p) (cdr p)))
(send path close)
(define border-pen : Pen (select-pen border-color))
(define brush : Brush (select-brush color))
(define lw : Real (send border-pen get-width))
(define-values (xoff yoff) (values (+ xoffset (/ lw 2)) (+ yoffset (/ lw 2))))
(define-values (left top width height) (send path get-bounding-box))
(define bmp : Bitmap (bitmap-blank (+ (max left width) lw) (+ (max top height) lw) density))
(define dc : (Instance Bitmap-DC%) (send bmp make-dc))
(send dc set-smoothing 'aligned)
(send dc set-pen border-pen)
(send dc set-brush brush)
(when (< count 3)
(send dc set-pen (make-css-pen border-pen #:color (send brush get-color)))
(when (= count 1) (send dc draw-point (+ xoff (caar vertices)) (+ yoff (cdar vertices)))))
(send dc draw-path path xoff yoff style)
bmp)))
| false |
12cee03555bd30676560f0ec1c84417ad95828d8 | 60b6707dbd61950877e4a7fd8c3cc627efb79a5b | /examples/basics/neg.rkt | 7b39b328ec38b37f0402e863715622640d7fc455 | []
| no_license | chrisnevers/racket-compiler | 536e2a4aa3e8bc71c5637bc887a1bdb6084d0e43 | 900d190b1ca4046a39047e18682a623324e7f68a | refs/heads/master | 2020-03-28T17:24:06.380557 | 2019-05-03T21:02:58 | 2019-05-03T21:02:58 | 148,785,877 | 7 | 0 | null | 2019-02-04T17:59:34 | 2018-09-14T12:32:58 | OCaml | UTF-8 | Racket | false | false | 25 | rkt | neg.rkt | (let ((a 45))
(- a))
| false |
4f303e17c98f143ec1a76966e8ea279a8e9eff57 | 6d2ad86bea643bf6da92be66162653b14c87c312 | /src/spite-test.rkt | bce0784d8fcbc18315cf82822ed5ba47deab6999 | []
| no_license | ChipmunkHand/TriangleCat | 9fe757ec1347fd023f61f952a87fca6cac9539ed | 27034f6695b614dee6bea27a3c22daa4da65bf03 | refs/heads/master | 2020-03-28T21:20:07.017365 | 2019-01-11T13:48:52 | 2019-01-11T13:48:52 | 149,147,568 | 2 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 5,802 | rkt | spite-test.rkt | #lang asi64
(require (for-syntax syntax/parse))
(set-emulator-program! emu "c64.prg")
(set-emulator-execute?! emu #t)
(set-emulator-breakpoints?! emu #t)
(if (eq? (system-type 'os) 'windows)
(set-emulator-path! emu "C:\\Program Files\\WinVICE-3.0-x64\\x64.exe")
(set-emulator-path! emu "/snap/bin/vice-jz.x64"))
(require threading)
(require racket/string racket/list racket/file)
(require racket/list)
(struct sprite-data (frame-count data) #:transparent)
(define (extract-sprite filename)
(let* (;read file as a sequence of lines
[lines (file->lines filename)]
;count the amount of frames by looking at lines that end with :
[frames (length (filter (λ (s) (string-suffix? s ":")) lines))]
;; [colours (~>>
;; lines
;; (filter (λ (s) (string-prefix? s "// sprite")))
;; (map (λ (s)
;; (let* ([sl (string-length s)]
;; [start (- sl 2)])
;; (substring s start))))
;; (map (λ (s) (string->number s 16))))]
; extract the raw data as one big lump
[data (~>>
lines
; filter to .byte rows
(filter (λ (s) (string-prefix? s ".byte")))
; clean up text leaving raw hex values
(map (λ (s) (string-replace s ".byte " "")))
(map (λ (s) (string-replace s "$" "")))
(map (λ (s) (string-split s ",")))
; flatten into one big list of numbers
(flatten)
; parse hex
(map (λ (s) (string->number s 16))))])
(sprite-data frames data)))
(define sprites
(~>>
(directory-list "../sprites" #:build? #t)
(map path->string)
(filter (λ (s) (string-suffix? s ".txt")))
(map extract-sprite)))
(writeln sprites)
(C64{
*= $0801
;autostart
(data $0b $08 $01 $00 $9E $31 $32 $32 $38 $38 $00 $00 $00)
*= $1000
; raw sprite data starts at $2000
*= $2000
(data
(~>>
sprites
(map sprite-data-data)
(flatten)))
*= $3000
;enable all sprites
lda @$FF
sta $d015
(for/fold ([data-index $80]
[sprite-pointer $07f8]
[code (list)])
([s sprites])
(let ([new-code
{
lda @data-index
sta sprite-pointer
}])
(values (+ (sprite-data-frame-count s) data-index)
(+ 1 sprite-pointer)
(cons new-code code))))
;position sprites
(for ([x (in-range 8)])
{
lda @(+ $20 (* x 24))
sta (+ $d000 (* x 2)) ; x
lda @$D0
sta (+ $d000 (+ 1 (* x 2))) ; y
})
; turn on multicolour mode for all sprites
;; lda @$FF
;; sta $d01c
lda @$04 ; sprite multicolor 1
sta $D025
lda @$06 ; sprite multicolor 2
sta $D026
; jsr $1000
(define delay $15)
(define is-animating $58)
(define current-frame $60)
(define current-offset-lo $61)
(define current-offset-hi $62)
(define current-temp $63)
; set background colour to black
lda @0
sta $d021
sta is-animating
lda @ delay
sta $42
:loop
; wait for the raster to hit the bottom of the screen
lda $d012
cmp @$ff
bne loop-
lda is-animating
beq joy+
jmp skip-joy+
:joy
jsr check-joy:
:skip-joy
; decrease our delay by one
ldx $42
dex
; if it is zero, branch out
beq change+
; otherwise store the new value and go back to waiting
stx $42
jmp loop-
:change
ldx @ delay
stx $42
(for/fold ([base-offset $80]
[index 0]
[code (list)])
([ s sprites])
(let ([new-code
{
;load sprite pointer value
ldx (+ $07f8 index)
;is it on the final frame?
; break
cpx @(+ base-offset (- (sprite-data-frame-count s) 1))
bne skip+
;reset to its first frame
ldx @base-offset
stx (+ $07f8 index)
jmp done+
:skip
; move to next frame
inx
stx (+ $07f8 index)
:done
}])
(values (+ base-offset (sprite-data-frame-count s))
(+ 1 index)
(cons new-code code))))
jmp loop-
:check-joy
ldy @2 ;move amount
sty $45
lda $dc00
tax
and @%00010000 ; fire
bne next+
lda @1
;clear animation params
sta is-animating
lda @$40
sta current-offset-hi
lda @0
sta current-offset-lo
lda @1
sta current-frame
rts
;; ldy @4
;; sty $45
:next
txa
and @%00000001 ;up
bne next+
lda $d001
sec
sbc $45
sta $d001
:next
txa
and @%00000010 ; down
bne next+
lda $d001
clc
adc $45
sta $d001
:next
txa
and @%00000100 ; left
bne next+
lda $d000
sec
sbc $45
sta $d000
:next
txa
and @%00001000 ; right
bne done+
lda $d000
clc
adc $45
sta $d000
:done
rts
})
| false |
44506575aca6b046d2a2a05650d5b1e4a040e366 | ccb5841c13b37393ead49430ba02092a1e310ed1 | /Homework/a1.rkt | 2ce96c69b7d17957f81b92f35b3b3ada2008cf97 | []
| no_license | j0shualarkin/P424 | 52f13502b9d1f17af5e5f4a32b8208eca5631187 | b516aad9eaab0722abf99492d7ed2a731c3cd87a | refs/heads/master | 2020-03-27T00:33:45.358968 | 2018-10-12T19:47:22 | 2018-10-12T19:47:22 | 145,634,367 | 1 | 1 | null | 2018-09-04T22:55:09 | 2018-08-22T00:28:54 | Racket | UTF-8 | Racket | false | false | 3,021 | rkt | a1.rkt | #lang racket
;; Fred Fu and Joshua Larkin
;; yuqfu joslarki
;; Sam Tobin-Hochstadt -- samth
;; P424 -- Assignment 1
(require rackunit
racket/list)
;; A Graph is a [List [List Symbol]]
;; the first Symbol in the list is the domain vertice
;; the succeeding symbols are the vertices with edges
;; from the domain vertices
(struct graph [edges])
;; Sample Graphs
(define triangle
(graph '((A B C)
(B A C)
(C A B))))
(define 7verts
(graph '((A B C D)
(B E C)
(C)
(D C F)
(E)
(F E)
)))
(define G2
(graph '((A C D)
(B E)
(C D E)
(D A B)
(E))))
;; --------
;; graph=? : Graph -> Graph -> Boolean
;; checks for equality between graphs by checking for
;; equality between the list of vertices in the graphs
(define (graph=? G1 G2)
(equal? (graph-edges G1) (graph-edges G2)))
(check-false (graph=? (graph '((A B C)
(B)
(C)))
(graph '((A B C)
(B C)
(C)))))
(check-true (graph=? (graph '((A B C)
(B C)
(C)))
(graph '((A B C)
(B C)
(C)))))
;; read-file :: (U File String) -> Graph
;; converts a file of s-expression represented graph
;; to the host graph representation
(define (read-graph st)
(graph
(for/list ([e (read st)])
(cons (car e) (cadr e)))))
;; ----
;; Printing Graphs
;; ----
;; print-graph : Graph -> Void
;; prints the graph in s-exp form as desired from course webpage
(define print-graph
(λ (G)
(define data (graph-edges G))
(parameterize ([pretty-print-columns 20])
(pretty-print
(for/list ([i data])
(cons (car i) (list (cdr i))))))))
;; spanning-tree : Graph -> Graph
;; returns a graph with the same amount of vertices, but
; edges are minimized to only the essentials needed to traverse the graph
(define (spanning-tree G)
(define seen (list (caar (graph-edges G))))
(graph (for/list ([i (graph-edges G)])
(cons (car i)
(for/list ([vt (cdr i)] #:when (not (memv vt seen)))
(begin (set! seen (cons vt seen))
vt))))))
(module+ test
(check graph=? (read-graph (open-input-file "graph-test-fixtures")) triangle)
(check graph=? (read-graph (open-input-file "graph-test-fixtures2")) 7verts)
(check-equal? (graph-edges (spanning-tree triangle)) '((A B C) (B) (C)))
(check-equal? (graph-edges (spanning-tree 7verts)) '((A B C D) (B E) (C) (D F) (E) (F)))
(check-equal? (graph-edges (spanning-tree G2)) '((A C D) (B E) (C) (D B) (E)))
(check-equal? (with-output-to-string
(λ _
(print-graph 7verts)))
"'((A (B C D))\n (B (E C))\n (C ())\n (D (C F))\n (E ())\n (F (E)))\n"))
| false |
e04dd5bd5f844dce067530be74ca79a5d3be7e1b | 3e36e8e705b24acd5badca1ee64346774c3ee45a | /db-doc/db/scribblings/notes.scrbl | fcce264a4e32fd45628d7f6891e904c2fdad5288 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
]
| permissive | racket/db | 91527b25740d1f19bac2ce46104eb05c1120eb99 | bcf2fe2e2c42ede54c0eea616334e432de1a4fa4 | refs/heads/master | 2023-08-29T21:00:14.532430 | 2022-07-25T23:05:44 | 2022-07-26T00:22:36 | 27,431,270 | 21 | 20 | NOASSERTION | 2022-09-03T19:45:06 | 2014-12-02T12:21:02 | Racket | UTF-8 | Racket | false | false | 15,026 | scrbl | notes.scrbl | #lang scribble/doc
@(require scribble/manual
scribble/eval
scribble/struct
racket/sandbox
"config.rkt"
(for-label db
setup/dirs))
@title[#:tag "notes"]{Notes}
This section discusses issues related to specific database systems.
@section[#:tag "connecting-to-server"]{Local Sockets for PostgreSQL and MySQL Servers}
PostgreSQL and MySQL servers are sometimes configured by default to
listen only on local sockets (also called ``unix domain
sockets''). This library provides support for communication over local
sockets on Linux and Mac OS. If local socket communication is not
available, the server must be reconfigured to listen on a TCP port.
The socket file for a PostgreSQL server is located in the directory
specified by the @tt{unix_socket_directory} variable in the
@tt{postgresql.conf} server configuration file. For example, on
Ubuntu 11.04 running PostgreSQL 8.4, the socket directory is
@tt{/var/run/postgresql} and the socket file is
@tt{/var/run/postgresql/.s.PGSQL.5432}. Common socket paths may be
searched automatically using the @racket[postgresql-guess-socket-path]
function.
The socket file for a MySQL server is located at the path specified by
the @tt{socket} variable in the @tt{my.cnf} configuration file. For
example, on Ubuntu 11.04 running MySQL 5.1, the socket is located at
@tt{/var/run/mysqld/mysqld.sock}. Common socket paths for MySQL can be
searched using the @racket[mysql-guess-socket-path] function.
@section{PostgreSQL Database Character Encoding}
In most cases, a database's character encoding is irrelevant, since
the connect function always requests translation to Unicode (UTF-8)
when creating a connection. If a PostgreSQL database's character
encoding is @tt{SQL_ASCII}, however, PostgreSQL will not honor the
connection encoding; it will instead send untranslated octets, which
will cause corrupt data or internal errors in the client connection.
To convert a PostgreSQL database from @tt{SQL_ASCII} to something
sensible, @tt{pg_dump} the database, recode the dump file (using a
utility such as @tt{iconv}), create a new database with the desired
encoding, and @tt{pg_restore} from the recoded dump file.
@section{PostgreSQL Authentication}
PostgreSQL supports a large variety of
@hyperlink["http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html"]{authentication
mechanisms}, controlled by the @tt{pg_hba.conf} server configuration
file. This library currently works with the following authentication methods:
@itemlist[
@item{@tt{plain} (and @tt{ldap}, @tt{pam}, @tt{radius}): cleartext password, only if
explicitly allowed (see @racket[postgresql-connect])}
@item{@tt{md5}: MD5-hashed password}
@item{@tt{scram-sha-256}: password-based challenge/response protocol. Depending
on server configuration and whether TLS is used, this may correspond to either
@tt{SCRAM-SHA-256} or @tt{SCRAM-SHA-256-PLUS}.}
@item{@tt{peer}: only for local sockets}
]
The @tt{gss}, @tt{sspi}, and @tt{krb5} methods are not supported.
@history[#:changed "1.2" @elem{Added @tt{SCRAM-SHA-256} support.}
#:changed "1.7" @elem{Added @tt{SCRAM-SHA-256-PLUS} support.}]
@section[#:tag "postgresql-timestamp-tz"]{PostgreSQL Timestamps and Time Zones}
PostgreSQL's @tt{timestamp with time zone} type is inconsistent with
the SQL standard (probably), inconsistent with @tt{time with time
zone}, and potentially confusing to PostgreSQL newcomers.
A @tt{time with time zone} is essentially a @tt{time} structure with
an additional field storing a time zone offset. In contrast, a
@tt{timestamp with time zone} has no fields beyond those of
@tt{timestamp}. Rather, it indicates that its datetime fields should
be interpreted as a UTC time. Thus it represents an absolute point in
time, unlike @tt{timestamp without time zone}, which represents local
date and time in some unknown time zone (possibly---hopefully---known
the the database designer, but unknown to PostgreSQL).
When a @tt{timestamp with time zone} is created from a source without
time zone information, the session's @tt{TIME ZONE} setting is used to
adjust the source to UTC time. When the source contains time zone
information, it is used to adjust the timestamp to UTC time. In either
case, the time zone information is @emph{discarded} and only the UTC
timestamp is stored. When a @tt{timestamp with time zone} is rendered
as text, it is first adjusted to the time zone specified by the
@tt{TIME ZONE} setting (or by
@hyperlink["http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT"]{@tt{AT
TIME ZONE}}) and that offset is included in the rendered text.
This library receives timestamps in binary format, so the time zone
adjustment is not applied, nor is the session's @tt{TIME ZONE} offset
included; thus all @racket[sql-timestamp] values in a query result
have a @racket[tz] field of @racket[0] (for @tt{timestamp with time
zone}) or @racket[#f] (for @tt{timestamp without time
zone}). (Previous versions of this library sent and received
timestamps as text, so they received timestamps with adjusted time
zones.)
@section[#:tag "MySQL_Authentication"]{MySQL Authentication}
As of version 5.5.7, MySQL supports
@hyperlink["http://dev.mysql.com/doc/mysql-security-excerpt/5.5/en/pluggable-authentication.html"]{authentication
plugins}. This library supports the following plugins:
@itemlist[
@item{@tt{caching_sha2_password}: the default since MySQL version 8.0}
@item{@tt{mysql_native_password}: the default for MySQL versions since 4.1 and before 8.0}
@item{@tt{mysql_old_password}: the default before MySQL version 4.1}
@item{@tt{mysql_clear_password}: used by LDAP and PAM authentication}
]
The @tt{caching_sha2_password} authentication plugin has two
``paths''; a client always tries the fast path first, but the server
may demand that it go through the slow path, based on the state of the
server's authentication cache. The fast path uses a challenge-response
protocol. The slow path is divided into the following cases:
@itemlist[
@item{connection via unix socket or via TCP with TLS to @tt{localhost}:
The client simply sends the password to the server.}
@item{connection via TCP with TLS, but not to @tt{localhost}: The client
sends the password to the server if the
@racket[_allow-cleartext-password?] argument is true; otherwise, an
exception is raised.}
@item{connection via TCP without TLS: Not supported by this library; an
exception is raised.}
]
See also @secref["dbsec-connect"].
@history[#:changed "1.6" @elem{Added support for
@tt{caching_sha2_password} authentication.}]
@section{MySQL Connection Character Set}
This library communicates with MySQL servers using UTF-8 for all
character data. MySQL has
@hyperlink["https://mysqlserverteam.com/mysql-8-0-when-to-use-utf8mb3-over-utf8mb4/"]{two
different UTF-8 character sets}: @tt{utf8} (sometimes called
@tt{utf8mb3}) is a nonstandard version limited to three bytes, and
@tt{utf8mb4} is standard UTF-8. Each character set has multiple
collations, and the available collations and the default collation may
vary based on
@hyperlink["http://mysqlserverteam.com/new-collations-in-mysql-8-0-0/"]{server
version}. This library initializes a connection's character set and
collation as follows: @itemlist[
@item{if the collation in the server handshake is either
@tt{utf8mb4_general_ci} or @tt{utf8mb4_0900_ai_ci}, then the
connection uses that collation, with character set @tt{utf8mb4};}
@item{if the server version is at least 5.5.3, the connection uses
collation @tt{utf8mb4_general_ci}, with character set @tt{utf8mb4};
otherwise}
@item{the connection uses collation @tt{utf8_general_ci}, with
character set @tt{utf8} (@tt{utf8mb3}).}
]
Previous versions of this library issued a @tt{SET NAMES utf8} command
at the beginning of every connection.
@bold{Warning: } If the
@hyperlink["https://dev.mysql.com/doc/refman/8.0/en/charset-connection.html#charset-connection-system-variables"]{client,
connection, or result character sets} are changed (for example, using
@tt{SET NAMES}) to a character set other than UTF-8, errors or data
corruption may occur. Note that non-UTF-8 character sets attached to
databases, tables, and columns do not cause problems; the server
automatically translates between character set used for storage and
the one used for communication.
@section{MySQL @tt{CALL}ing Stored Procedures}
MySQL @tt{CALL} statements can be executed only if they return at most
one result set and contain no @tt{OUT} or @tt{INOUT} parameters.
@section{Cassandra Authentication}
Cassandra, like MySQL, supports
@hyperlink["http://cassandra.apache.org/doc/latest/operating/security.html#authentication"]{authentication
plugins}. The only plugins currently supported by this library are
@tt{AllowAllAuthenticator} and @tt{PasswordAuthenticator}.
@section[#:tag "sqlite3-requirements"]{SQLite Requirements}
SQLite support requires the appropriate native library.
@itemlist[
@item{On Windows, the library is @tt{sqlite3.dll}. It is included in
the Racket distribution.}
@item{On Mac OS, the library is @tt{libsqlite3.0.dylib}, which is
included (in @tt{/usr/lib}) in Mac OS version 10.4 onwards.}
@item{On Linux, the library is @tt{libsqlite3.so.0}. It is included in
the @tt{libsqlite3-0} package in Debian/Ubuntu and in the @tt{sqlite}
package in Red Hat.}
]
@section[#:tag "ffi-concurrency"]{FFI-Based Connections and Concurrency}
@tech{Wire-based connections} communicate using
@tech/reference{ports}, which do not cause other Racket threads to
block. In contrast, an FFI call causes all Racket threads to block
until it completes, so @tech{FFI-based connections} can degrade the
interactivity of a Racket program, particularly if long-running
queries are performed using the connection.
This problem can be avoided by creating the FFI-based connection in a
separate @tech/reference{place} using the @racket[#:use-place] keyword
argument. Such a connection will not block all Racket threads during
queries; the disadvantage is the cost of creating and communicating
with a separate @tech/reference{place}. On Racket CS, another solution
is to execute queries in a @seclink["Operating_System_Threads" #:doc
'(lib "scribblings/foreign/foreign.scrbl")]{separate OS thread}; this
solution may have lower time and memory overhead than the separate place.
@section[#:tag "odbc-requirements"]{ODBC Requirements}
ODBC requires the appropriate driver manager native library as well as
driver native libraries for each database system you want use ODBC to
connect to.
@itemlist[
@item{On Windows, the driver manager is @tt{odbc32.dll}, which is
included automatically with Windows.}
@item{On Mac OS, the driver manager is @tt{libiodbc.2.dylib}
(@hyperlink["http://www.iodbc.org"]{iODBC}), which is included (in
@tt{/usr/lib}) in Mac OS version 10.2 onwards.}
@item{On Linux, the driver manager is @tt{libodbc.so.{2,1}}
(@hyperlink["http://www.unixodbc.org"]{unixODBC}---iODBC is not
supported). It is available from the @tt{unixodbc} package in
Debian/Ubuntu and in the @tt{unixODBC} package in Red Hat.}
]
In addition, you must install the appropriate ODBC Drivers and
configure Data Sources. Refer to the ODBC documentation for the
specific database system for more information.
@section[#:tag "odbc-status"]{ODBC Status}
ODBC support is experimental. The behavior of ODBC connections can
vary widely depending on the driver in use and even the configuration
of a particular data source.
The following sections describe the configurations that this library
has been tested with. Reports of success or failure on other platforms
or with other drivers would be appreciated.
@subsection{DB2 ODBC Driver}
IBM DB2 ODBC drivers were tested with the following software configuration:
@itemlist[
@item{Platform: Centos 7.4 on x86_64}
@item{Database: DB2 Express-C for Linux x64 v11.1}
@item{Driver: ODBC for DB2 (included with DB2 Express-C)}
]
This driver seems to require environment variables to be set using the
provided scripts (eg, @tt{source /home/db2inst1/sqllib/db2profile}).
Known issues:
@itemlist[
@item{The driver does not support the standard @tt{SQL_C_NUMERIC}
structure for retrieving @tt{DECIMAL}/@tt{NUMERIC} fields.
@bold{Fix: } Use @racket[#:quirks '(no-c-numeric)] with @racket[odbc-connect].}
]
@subsection{Oracle ODBC Driver}
Oracle ODBC drivers were tested with the following software configuration:
@itemlist[
@item{Platform: Centos 7.4 on x86_64}
@item{Database: Oracle XE 11g (11.2.0)}
@item{Drivers: Oracle Instant Client ODBC (11.2.0 and 12.2.0)}
]
Typical installations of the drivers require the @tt{LD_LIBRARY_PATH}
environment variable to be set to the driver's installed @tt{lib}
directory (ie, the directory containing @tt{libsqora.so}) so the
driver can find its sibling shared libraries.
Known issues:
@itemlist[
@item{With the @racket[#:strict-parameter-types? #t] option,
parameters seem to be always assigned the type @tt{varchar}.
@bold{Fix: } Leave strict parameter types off (the default).}
@item{The driver does not support the @tt{SQL_C_BIGINT} format for
parameters or result fields. Consequently, passing large integers as
query parameters may fail.
@bold{Fix: } Use @racket[#:quirks '(no-c-bigint)] with
@racket[odbc-connect].}
@item{A field of type @tt{TIME} causes the driver to return garbage
for the typeid and type parameters. This usually causes an error with
a message like ``unsupported type; typeid: -29936'', but with a random
typeid value. (Oracle appears not to have a @tt{TIME} type, so this
bug might only appear when a value is explicitly @tt{CAST} as
@tt{TIME}---for some reason, that doesn't produce an error.)}
@item{Attempting to quit Racket with a connection still open may cause
Racket to hang. Specifically, the problem seems to be in the driver's
@tt{_fini} function.
@bold{Fix: } Close connections before exiting, either explicitly using
@racket[disconnect] or by shutting down their custodians.}
]
@subsection{SQL Server ODBC Driver}
Microsoft SQL Server ODBC drivers were tested with the following
software configuration:
@itemlist[
@item{Platform: Windows 10 on x86_64}
@item{Database: SQL Server Express 2017}
@item{Drivers: ODBC Driver 13 for SQL Server, SQL Server Native Client 11.0}
]
Known issues:
@itemlist[
@item{If queries are nested or interleaved---that is, a second query
is executed before the first query's results are completely
consumed---the driver might signal an error ``Connection is busy with
results for another command (SQLSTATE: HY000)''.
@bold{Fix: } Set the @tt{MARS_Connection} data source option to @tt{Yes} (see
@hyperlink["https://stackoverflow.com/questions/9017264/why-only-some-users-get-the-error-connection-is-busy"]{this page}). The ODBC Manager GUI does not expose the option, but it can be added @hyperlink["https://serverfault.com/questions/302169/odbc-sql-server-how-do-i-turn-on-multiple-active-result-sets"]{by editing the registry}.}
]
| false |
e59aae9b307e78cb53e2bc9d95beee2741598994 | 3ff658af1c58e6009d60aba7f7a0192590c828ce | /pd2af/server/libs/odysseus/ontology/common.rkt | 30beb3a40bd9c48aa75be28461ebe8f3ce518d63 | []
| no_license | acanalpay/pd2af-converter | ab994f52deacd96bc423365b1719bc734cae7b08 | b4c812172d747d32ae286db7b2efcdcf10fb7409 | refs/heads/master | 2023-06-06T08:10:42.247438 | 2021-06-30T07:38:35 | 2021-06-30T07:38:35 | 381,607,483 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 2,537 | rkt | common.rkt | #lang racket
(require "../lib/_all.rkt")
(require racket/syntax)
(provide (all-defined-out))
(define general-namespaces
(hash
'owl "http://www.w3.org/2002/07/owl#"
'rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
'rdfs "http://www.w3.org/2000/01/rdf-schema#"
'skos "http://www.w3.org/2004/02/skos/core#"
'dcterms "http://purl.org/dc/terms/"
'dcels "http://purl.org/dc/elements/1.1/"
'dcam "http://purl.org/dc/dcam/"
'vocab "http://www.w3.org/2003/06/sw-vocab-status/ns#"))
(define general-namespaces-reverted (hash-revert general-namespaces))
(define keys-order '(a instance-of subclass-of subproperty-of eq-property domain range inverse-of disjoint-with title description d comment note publisher modified))
(define own-namespace (make-parameter #f))
(define-catch (get-namespace val)
(let ((valstr (->string val)))
(cond
((not val) #f)
((empty? val) #f)
((list? val)
(map get-namespace val))
((not (re-matches? "/" valstr)) #f)
((re-matches? " " valstr) #f)
((re-matches? "#" valstr)
(format-symbol "~a#" (first (string-split valstr "#"))))
(else
(format-symbol "~a/" (implode (but-last (string-split valstr "/")) "/"))))))
(define-catch (get-pure-name val)
(let ((valstr (->string val)))
(cond
((not val) #f)
((empty? val) #f)
((re-matches? "#" valstr)
(->symbol (second (string-split valstr "#"))))
(else
(->symbol (last (string-split valstr "/")) "/")))))
(define-catch (replace-namespace-for-alias val)
(let* ((namespace (get-namespace val))
(own-ns (own-namespace))
(own-ns (and own-ns (hash-ref general-namespaces own-ns #f)))
(own-ns (and own-ns (->symbol own-ns)))
(name (get-pure-name val))
(alias (and namespace (hash-ref* general-namespaces-reverted namespace #f)))
(result (cond
((empty? val) #f)
((not (or name alias)) #f)
((and own-ns (equal? namespace own-ns))
(--- own-ns namespace)
(format-symbol "~a" name))
((and name (not alias))
(format-symbol "~a" name))
(else
(format-symbol "~a/~a" alias name)))))
result))
(define-catch (get-namespaces-in-use context)
(cleanmap
(opt/uniques
(flatten
(map
(λ (x)
(map get-namespace (append (hash-keys x) (hash-values x))))
context)))))
| false |
7cd11a766a1deb2718a66a21828e8dd41f9e75c4 | 4dd19196602623d0db1f5aa2ac44eaeace198b4a | /Chapter2/2.48.rkt | cd7b91d496d30f0a502814bcf4c9115c1e825be8 | []
| no_license | Dibel/SICP | f7810b2c45aa955b8207e6cb126431d6f0ef48cb | abd27c0ed4bdaaa755eff01e78e5fb2a2ef8ee18 | refs/heads/master | 2020-06-05T16:38:00.957460 | 2014-12-02T15:20:40 | 2014-12-02T15:20:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 252 | rkt | 2.48.rkt | #lang racket/load
(define (make-segment v1 v2)
(cons v1 v2))
(define (start-segment seg)
(car seg))
(define (end-segment seg)
(cdr seg))
(define (make-vect x y)
(cons x y))
(define s1 (make-segment (make-vect 1.0 2.0) (make-vect 6.0 5.0))) | false |
db32f3359b415926135b3d57caa309c11d4a9df2 | 20e13aed35dd7382496a568b6b1bf4e095442f60 | /cse1729_scheme_principles-to-programming/lab/lab05/Lab5.rkt | e7fb67d357fd0114eefdc3aeda01def93b5e6996 | []
| no_license | ericwangg/cse_coursework | b55ecdc12cc50c75f804c0795b9214173259ae2d | 3aa5401acb580e9a67b1340399134e55a15ec23e | refs/heads/master | 2023-01-22T21:02:01.281640 | 2020-12-06T22:38:45 | 2020-12-06T22:38:45 | 319,145,521 | 0 | 2 | null | null | null | null | UTF-8 | Racket | false | false | 611 | rkt | Lab5.rkt | "Lab 5 - Preliminary Examination 1 Review"
"Problem 1A - USB to Bitcoin"
(define (USD-to-Bitcoin x)
(/ x 389.943))
"Problem 1B - Energy from Mass"
(define (energy-from-mass m)
(let ((c 299792458))
(* m c c)))
"Problem 1C - Area of triangle"
(define (area-of-tri b h)
(* 0.5 b h))
"Problem 1D - Change in Drawer"
(define (cash q d n p)
(+ (* q 0.25)
(* d 0.10)
(* n 0.05)
(* p 0.01)))
"Problem 2A - Repeated Decimal"
(define (repeat-decimal n)
(if (= n 1)
0
(floor n)))
(repeat-decimal 3)
"Sum f(x) + g(x)"
(define (sum-function f g)
(lambda (x) (+ (f x) (g x)))) | false |
e12bc25f219e6604c1019a7dba7702c43aae44f4 | 525121efd1a017483c7d9186cebf0924ba17da2b | /interp.rkt | 402c65fd131ec50d00f573fe9fcb5e91d9287dc9 | []
| no_license | ntoronto/nonplussed | 5404e2bc20c3338fa172a42a97bedd107cfc3fbc | f6c069990eb6b0b3356f872fcce82a3fb2fe805a | refs/heads/master | 2021-01-23T22:37:11.113713 | 2014-01-13T06:07:41 | 2014-01-13T06:07:41 | 15,858,912 | 1 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 16,128 | rkt | interp.rkt | #lang typed/racket
(require math/number-theory
"types.rkt"
"defs.rkt")
(provide search-for-truth)
(: map* (All (A B) ((A -> (Listof B)) (Listof A) -> (Listof B))))
;; List monad's `bind' with arguments reversed, composed with remove-duplicates
(define (map* f x)
(remove-duplicates (append* (map f x))))
;; Basically, to simulate nondeterminism, we're using (finite) lists to model the (finite) set
;; monad's computations
;; ===================================================================================================
;; Types
;; Type of lexer output
(define-type Lexeme (Listof Tile-Value))
;; Type of tokenizer output
(define-type Token (U Symbol Boolean Natural Bottom))
;; Type of expressions
(define-type Expr (U Natural Boolean Name expr))
(struct: expr ([type : Expr-Type]) #:transparent)
(struct: unary-expr expr ([symbol : Unary-Symbol] [arg : Expr]) #:transparent)
(struct: binary-expr expr ([symbol : Binary-Symbol] [lhs : Expr] [rhs : Expr]) #:transparent)
(struct: let-expr expr ([name : Name] [body : Expr]) #:transparent)
;; Simple type system allows failing somewhat earlier
(define-type Expr-Type (U 'N 'B unary-type binary-type '⊥))
(struct: unary-type ([arg : Expr-Type] [ret : Expr-Type]) #:transparent)
(struct: binary-type ([lhs : Expr-Type] [rhs : Expr-Type] [ret : Expr-Type]) #:transparent)
;; ===================================================================================================
;; Helpers
(define (true? v) (eq? v #t))
(: num-fact (Exact-Rational -> (U Bottom Exact-Rational)))
(define (num-fact x) (if (natural? x) (factorial x) '⊥))
(: num/ (Exact-Rational Exact-Rational -> (U Bottom Exact-Rational)))
(define (num/ x y) (if (= y 0) '⊥ (/ x y)))
(define-syntax-rule (implies x y) (or (not x) y))
(define-syntax-rule (converse x y) (implies y x))
(: != (Number Number -> Boolean))
(define (!= x y) (not (= x y)))
(define-syntax-rule (make-number-unary f)
(λ: ([x : Expr-Value])
(if (exact-rational? x) (f x) '⊥)))
(define-syntax-rule (make-number-binary f)
(λ: ([x : Expr-Value] [y : Expr-Value])
(if (and (exact-rational? x) (exact-rational? y)) (f x y) '⊥)))
(define-syntax-rule (make-boolean-unary f)
(λ: ([x : Expr-Value])
(if (boolean? x) (f x) '⊥)))
(define-syntax-rule (make-boolean-binary f)
(λ: ([x : Expr-Value] [y : Expr-Value])
(if (and (boolean? x) (boolean? y)) (f x y) '⊥)))
;; ===================================================================================================
;; First-order environment
(: unary-env (HashTable Unary-Symbol (Pair (Expr-Value -> Expr-Value) unary-type)))
(define unary-env
(make-hasheq
(list (cons 'not (cons (make-boolean-unary not) (unary-type 'B 'B)))
(cons '! (cons (make-number-unary num-fact) (unary-type 'N 'N)))
(cons '- (cons (make-number-unary -) (unary-type 'N 'N))))))
(define get-unary-function (λ: ([sym : Unary-Symbol]) (car (hash-ref unary-env sym))))
(define get-unary-type (λ: ([sym : Unary-Symbol]) (cdr (hash-ref unary-env sym))))
(: binary-env (HashTable Binary-Symbol (Pair (Expr-Value Expr-Value -> Expr-Value) binary-type)))
(define binary-env
(make-hasheq
(list (cons '+ (cons (make-number-binary +) (binary-type 'N 'N 'N)))
(cons '- (cons (make-number-binary -) (binary-type 'N 'N 'N)))
(cons '* (cons (make-number-binary *) (binary-type 'N 'N 'N)))
(cons '/ (cons (make-number-binary num/) (binary-type 'N 'N 'N)))
(cons '= (cons (make-number-binary =) (binary-type 'N 'N 'B)))
(cons '!= (cons (make-number-binary !=) (binary-type 'N 'N 'B)))
(cons '< (cons (make-number-binary <) (binary-type 'N 'N 'B)))
(cons '<= (cons (make-number-binary <=) (binary-type 'N 'N 'B)))
(cons '> (cons (make-number-binary >) (binary-type 'N 'N 'B)))
(cons '>= (cons (make-number-binary >=) (binary-type 'N 'N 'B)))
(cons 'and (cons (make-boolean-binary and) (binary-type 'B 'B 'B)))
(cons 'or (cons (make-boolean-binary or) (binary-type 'B 'B 'B)))
(cons 'imp (cons (make-boolean-binary implies) (binary-type 'B 'B 'B)))
(cons 'conv (cons (make-boolean-binary converse) (binary-type 'B 'B 'B)))
(cons 'iff (cons (make-boolean-binary equal?) (binary-type 'B 'B 'B))))))
(define get-binary-function (λ: ([sym : Binary-Symbol]) (car (hash-ref binary-env sym))))
(define get-binary-type (λ: ([sym : Binary-Symbol]) (cdr (hash-ref binary-env sym))))
;; ===================================================================================================
;; Lexer
(: prefix-of? (Tile-Value Lexeme -> Boolean))
(define (prefix-of? v vs)
(cond [(empty? vs) #f]
[(and (digit? v) (digit? (first vs))) #t]
[else #f]))
(: cons-if-prefix (Tile-Value (Listof Lexeme) -> (Listof Lexeme)))
(define (cons-if-prefix x xss)
(if (prefix-of? x (first xss))
(cons (cons x (first xss)) (rest xss))
(cons (list x) xss)))
(: legal-groupings ((span (Listof Tile-Value)) -> (Listof (span (Listof Lexeme)))))
(define (legal-groupings sp)
(match-define (span start end lst) sp)
(define ress
(let: loop : (Listof (Listof Lexeme)) ([lst : (Listof Tile-Value) lst])
(cond [(empty? lst) empty]
[(empty? (rest lst)) (list (list lst))]
[else (map (λ: ([rst : (Listof Lexeme)])
(cons-if-prefix (first lst) rst))
(loop (rest lst)))])))
(map (λ: ([res : (Listof Lexeme)]) (span start end res))
ress))
(: sublists (All (A) ((Listof A) -> (Listof (span (Listof A))))))
(define (sublists lst)
(define vec (list->vector lst))
;; todo: change to for*/list: when for*/list: is fixed
(let: len-loop : (Listof (span (Listof A))) ([len : Integer (vector-length vec)])
(cond [(len . <= . 2) empty]
[else (let: start-loop : (Listof (span (Listof A))) ([start : Integer 0])
(cond [(start . >= . (+ 1 (- (vector-length vec) len)))
(len-loop (- len 1))]
[else (define end (+ start len))
(cons (span start end (vector->list (vector-copy vec start end)))
(start-loop (+ start 1)))]))])))
(: lex* ((Listof Tile-Value) -> (Listof (span (Listof Lexeme)))))
(define (lex* lst)
(map* legal-groupings (sublists lst)))
;; ===================================================================================================
;; Tokenizer
(: digits->natural ((Listof Digit) -> Natural))
(define (digits->natural ds)
(let loop ([ds ds] [#{acc : Natural} 0])
(cond [(empty? ds) acc]
[else (loop (rest ds) (+ (first ds) (* 10 acc)))])))
(: char->digit (Char -> Digit))
(define (char->digit c)
(define d (- (char->integer c) (char->integer #\0)))
(if (digit? d) d (raise-type-error 'char->digit "digit character" c)))
(: natural->digits (Natural -> (Listof Digit)))
(define (natural->digits n)
(map char->digit (string->list (number->string n))))
(: lexeme->token (Lexeme -> Token))
(define (lexeme->token lst)
(match lst
[(list (? tile-symbol? x)) x]
[(list (? boolean? b)) b]
[(list (? digit? #{ds : (Listof Digit)}) ...) (digits->natural ds)]
[(list (? name? x)) x]
[(list (? keyword? w)) w]
[_ '⊥]))
(: tokenize ((span (Listof Lexeme)) -> (span (Listof Token))))
(define (tokenize sp)
(match-define (span start end lst) sp)
(span start end (map lexeme->token lst)))
(: tokenize* ((Listof Tile-Value) -> (Listof (span (Listof Token)))))
(define (tokenize* lsts)
(map tokenize (lex* lsts)))
;; ===================================================================================================
;; Parser
(: get-expr-type (Expr -> Expr-Type))
(define (get-expr-type e)
(cond [(natural? e) 'N]
[(boolean? e) 'B]
[(symbol? e) 'N]
[else (expr-type e)]))
(: maybe-unary-expr (Unary-Symbol Expr -> (Listof unary-expr)))
(define (maybe-unary-expr sym arg)
(match-define (unary-type arg-type ret-type) (get-unary-type sym))
(if (equal? arg-type (get-expr-type arg))
(list (unary-expr ret-type sym arg))
empty))
(: maybe-binary-expr (Binary-Symbol Expr Expr -> (Listof binary-expr)))
(define (maybe-binary-expr sym lhs rhs)
(match-define (binary-type lhs-type rhs-type ret-type) (get-binary-type sym))
(if (and (equal? lhs-type (get-expr-type lhs))
(equal? rhs-type (get-expr-type rhs)))
(list (binary-expr ret-type sym lhs rhs))
empty))
(: parse-tokens ((Listof Token) -> (Listof Expr)))
(define (parse-tokens toks)
(cond
[(empty? toks) empty]
[else
(append
(match toks
[(list (? natural? n)) (list n)]
[(list (? boolean? b)) (list b)]
[(list (? name? x)) (list x)]
[_ empty])
(cond [(and ((length toks) . >= . 4)
(eq? (first toks) 'let)
(eq? (third toks) '=))
(define x (second toks))
(cond [(name? x) (map* (λ: ([body : Expr]) (list (let-expr '⊥ x body)))
(parse-tokens (rest (rest (rest toks)))))]
[else empty])]
[else empty])
(cond [((length toks) . >= . 2)
(define fst (first toks))
(cond [(prefix-symbol? fst)
(map* (λ: ([rhs : Expr]) (maybe-unary-expr fst rhs))
(parse-tokens (rest toks)))]
[else empty])]
[else empty])
(cond [((length toks) . >= . 2)
(define lst (last toks))
(cond [(postfix-symbol? lst)
(map* (λ: ([lhs : Expr]) (maybe-unary-expr lst lhs))
(parse-tokens (reverse (rest (reverse toks)))))]
[else empty])]
[else empty])
(append*
(let: loop : (Listof (Listof expr)) ([lhs : (Listof Token) empty]
[mid : Token (first toks)]
[rhs : (Listof Token) (rest toks)])
(cond [(empty? rhs) (list empty)]
[(infix-symbol? mid)
(append (map* (λ: ([lhs : Expr])
(map* (λ: ([rhs : Expr])
(list (maybe-binary-expr mid lhs rhs)))
(parse-tokens rhs)))
(parse-tokens (reverse lhs)))
(loop (cons mid lhs) (first rhs) (rest rhs)))]
[else (loop (cons mid lhs) (first rhs) (rest rhs))]))))]))
(: parse ((span (Listof Token)) -> (Listof (span Expr))))
(define (parse sp)
(match-define (span start end toks) sp)
(map (λ: ([res : Expr]) (span start end res))
(filter (λ: ([e : Expr]) (eq? 'B (get-expr-type e)))
(parse-tokens toks))))
(: parse* ((Listof Tile-Value) -> (Listof (span Expr))))
(define (parse* lst)
(map* parse (tokenize* lst)))
;; ===================================================================================================
;; Interpreter
(: interp (Expr (HashTable Name Exact-Rational) -> Expr-Value))
(define (interp e defs)
(let interp ([e e])
(match e
[(? natural? n) n]
[(? boolean? b) b]
[(? name? x) (hash-ref defs x (λ () '⊥))]
[(unary-expr _ sym arg) ((get-unary-function sym) (interp arg))]
[(binary-expr _ sym lhs rhs) ((get-binary-function sym) (interp lhs) (interp rhs))])))
(: interp* ((Listof Tile-Value) (HashTable Name Exact-Rational)
-> (Listof (result Expr Expr-Value))))
(define (interp* lst defs)
(define sps (map (λ: ([sp : (span Expr)])
(match-define (span start end e) sp)
(result (span start end e) (interp e defs)))
(parse* lst)))
(filter (λ: ([r : (result Expr Expr-Value)]) (true? (result-value r)))
sps))
;; ===================================================================================================
;; Unparser
(: unary-prec (HashTable Unary-Symbol Exact-Rational))
(define unary-prec
(make-hash
(list (cons '! 250)
(cons '- 225)
(cons 'not 125))))
(: binary-prec (HashTable Binary-Symbol Exact-Rational))
(define binary-prec
(make-hasheq
(list (cons '* 200)
(cons '/ 200)
(cons '+ 150)
(cons '- 150)
(cons '= 100)
(cons '!= 100)
(cons '< 100)
(cons '<= 100)
(cons '> 100)
(cons '>= 100)
(cons 'and 90)
(cons 'or 80)
(cons 'imp 70)
(cons 'conv 70)
(cons 'iff 60))))
(: right-assoc (Setof (Pair Tile-Symbol Tile-Symbol)))
(define right-assoc
(set (cons '* '*)
(cons '+ '+)
(cons 'and 'and)
(cons 'or 'or)
(cons '* '/)
(cons '+ '-)
(cons 'imp 'imp)))
(: left-assoc (Setof (Pair Tile-Symbol Tile-Symbol)))
(define left-assoc
(set (cons '* '*)
(cons '+ '+)
(cons 'and 'and)
(cons 'or 'or)
(cons '* '/)
(cons '+ '-)))
(: right-associative? (Tile-Symbol Tile-Symbol -> Boolean))
(define (right-associative? op1 op2)
(set-member? right-assoc (cons op1 op2)))
(: left-associative? (Tile-Symbol Tile-Symbol -> Boolean))
(define (left-associative? op1 op2)
(set-member? left-assoc (cons op1 op2)))
(: parenthesize-child? (Exact-Rational Tile-Symbol Boolean Expr -> Boolean))
(define (parenthesize-child? prec sym lhs? child)
(match child
[(unary-expr _ child-sym _)
(<= (hash-ref unary-prec child-sym) prec)]
[(binary-expr _ child-sym _ _)
(define child-prec (hash-ref binary-prec child-sym))
(or (< child-prec prec)
(and (= child-prec prec)
(not (cond [lhs? (left-associative? child-sym sym)]
[else (right-associative? sym child-sym)]))))]
[_ #f]))
(: maybe-parenthesize (Exact-Rational Tile-Symbol Boolean Expr (Listof Unparsed-Value)
-> (Listof Unparsed-Value)))
(define (maybe-parenthesize prec sym lhs? child-e child)
(if (parenthesize-child? prec sym lhs? child-e)
(append '(lparen) child '(rparen))
child))
(: unparse (Expr -> (Listof Unparsed-Value)))
(define (unparse e)
(match e
[(? natural? n) (natural->digits n)]
[(? boolean? b) (list b)]
[(unary-expr _ sym arg)
(define prec (hash-ref unary-prec sym))
(cond [(postfix-symbol? sym)
(append (maybe-parenthesize prec sym #t arg (unparse arg))
(list sym))]
[else
(append (list sym)
(maybe-parenthesize prec sym #f arg (unparse arg)))])]
[(binary-expr _ sym lhs rhs)
(define prec (hash-ref binary-prec sym))
(cond [(infix-symbol? sym)
(append (maybe-parenthesize prec sym #t lhs (unparse lhs))
(list 'space sym 'space)
(maybe-parenthesize prec sym #f rhs (unparse rhs)))]
[else
(append (list sym 'space)
(maybe-parenthesize prec sym #f lhs (unparse lhs))
'(space)
(maybe-parenthesize prec sym #f rhs (unparse rhs)))])]))
(: unparse-result ((result Expr Expr-Value) -> (result (Listof Unparsed-Value) Expr-Value)))
(define (unparse-result res)
(match-define (result (span start end e) value) res)
(result (span start end (unparse e)) value))
;; ===================================================================================================
;; Public API
(: search-for-truth ((Listof Tile-Value) (HashTable Name Exact-Rational)
-> (Listof (result (Listof Unparsed-Value) Expr-Value))))
(define (search-for-truth vs defs)
(remove-duplicates (map unparse-result (interp* vs defs))))
| true |
5ba1c1d20017339e1ce11bd7a2d17f9bebc31d07 | 6d74ddfca2eced5b56a6d0a2a64ac7c10df28232 | /unicode-test.rkt | 86a680d8ea5c0544c66719af79b9ee3212b968f0 | [
"MIT"
]
| permissive | rogerkeays/racket-fluent | 75382344135be3d03ba8160138e87a76ec4d2ac3 | b8bc82e25a35451ba3136f393157e380e6f4837f | refs/heads/main | 2023-03-24T13:13:08.677143 | 2021-03-23T14:59:25 | 2021-03-23T14:59:25 | 345,126,926 | 26 | 2 | MIT | 2021-03-10T13:59:02 | 2021-03-06T15:29:11 | Racket | UTF-8 | Racket | false | false | 921 | rkt | unicode-test.rkt | #lang racket
;; run with raco test
(module+ test
(require "unicode.rkt" rackunit)
;; renamed procedures
(check-equal? (+ 1 1) 2)
(check-equal? (add 1 1) 2)
(check-equal? (subtract 1 1) 0)
(check-equal? (gt? 1 0) #t)
(check-equal? (gte? 1 1) #t)
;; lambda shorthand
(check-equal? ((e : #f) 0) #f)
(check-equal? ((e : #t) 0) #t)
(check-equal? ((x y : + x y) 1 2) 3)
;; function composition
("FOO" → string-downcase → check-equal? "foo")
("FOO" → string-ref (1 → subtract 1) → char-downcase → check-equal? #\f)
('(1 2 3) ⇒ map (lambda (x) (+ x 1)) → check-equal? '(2 3 4))
;; function composition and lambda shorthand combined
("FOO" → (x : string-downcase x) → check-equal? "foo")
(((x y : x → add y) 1 2) → check-equal? 3)
((sort '(3 2 1) (a b : a → lt? b)) → check-equal? '(1 2 3))
((sort '(1 2 3) (a b : a → gt? b)) → check-equal? '(3 2 1)))
| false |
31a45988582be92b07e6e43d882726b544eb3a2c | aa0e6a65f31677783b8bd0262ef9fdeca870955e | /racket-graph/graph-lib.rkt | 204523b86f8b6a5f93b4dea9a927c3ab967c4bb8 | []
| no_license | StrongerXi/Traveler-lang | 56053d12542d71c6e9f3f0045fdace25369715e4 | 973f7c802197b4c7a613d2ca835299b274c293d1 | refs/heads/master | 2021-03-30T17:17:36.943712 | 2018-02-06T19:04:37 | 2018-02-06T19:04:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 5,200 | rkt | graph-lib.rkt | #lang racket
;; ----------------------------DATA DEFINITION-------------------------------------
;; A Graph is a [List-of Node]
;; Assume the graph is directed.
;; No duplicates are allowed
(define-struct node [name data edges])
;; A Node is a (make-node Symbol Number [List-of Edge])
;; An Edge is a [Pair Number Symbol]
;; A Directed-Edge is a (list Number Origin-Node-Name End-Node-Name)
;; INTERPRETATION:
;; For a graph (define G `(,a ,b ,c ,d))
;; a, b, c, d are all the nodes in this graph
;; For a node (make-node sb 10 `((5 ,c) (13 ,d)) )
;; sb represents this node's name
;; 10 represents the value it contains
;; (5 c) and (13 d) are the edges extending from a to other nodes
;; For an edge (list 17 b)
;; 17 represents the cost of this edge
;; b represents the end point of this edge
;; ----------------------------EXAMPLES-------------------------------------
(define graph0 '())
(define A (make-node 'a 20 (list 10 'b)))
(define B (make-node 'b 15 (list 5 'c)))
(define C (make-node 'c 30 (list 25 'd)))
(define D (make-node 'd 5 (list 15 'a)))
(define graph1 (list A B C D))
;; 20 15 5
;; A<--------D
;; | /\
;; 10| | 25
;; \/ |
;; B-------->C 30
;; 15 5
;; ----------------------------Selectors, Predicates, Helper functions-------------------------------
;; --------------------GRAPH----------------------------
;; Any -> Boolean
;; Check whether any is a graph
(define (graph? any)
(and (list? any)
(andmap node? any)))
;; Symbol Graph -> Boolean
;; Determine whether the g contains a node with name s
(define (graph-contains? s g)
(ormap (λ (node)
(symbol=? s (node-name node)))
g))
;; Symbol Graph -> Node
;; Return the node in g with name as s
;; If not found, raise an error
(define (graph-get-node s g)
(cond
[(empty? g)
(error "node named " (symbol->string s) "not found")]
[else (define this (first g))
(if (is-node? s this)
this
(graph-get-node s (rest g)))]))
;; Node [List-of Directed-Edge] Graph -> Graph
;; Add node into graph, raise an error if already exists
;; loe corresponds to the edges that extends FROM the endpoint to Node
;; Add them to their origin nodes in graph respectively
(define (add-node-to-graph node loe graph)
(cond
[(graph-contains? (node-name node) graph) (error "cannot add a node that already exists : "
(symbol->string (node-name node)))]
[else (foldr add-edge-to-graph
graph
loe)]))
;; Directed-Edge Graph -> Graph
;; Add a directed edge de into graph
;; Raise an error if already exists
;; or if any of the node in this edge does not exists
(define (add-edge-to-graph de graph)
(define origin (directed-edge-origin de))
(define end (directed-edge-end de))
(cond
[(not (and (graph-contains? origin graph)
(graph-contains? end graph)))
(error "end or origin node in this de cannot be found in graph given")]
[else (define edge-to-add (cons (directed-edge-cost de) end))
(foldr (λ (a-node checked-graph)
(if (is-node? origin a-node)
(cons (node-add-edge edge-to-add a-node)
checked-graph)
(cons a-node checked-graph))))]))
;; --------------------NODE----------------------------
;; Symbol Node -> Boolean
;; Determine whether node has name s
(define (is-node? s node)
(symbol=? (node-name node) s))
;; Edge Node -> Node
;; Add edge to node
;; raise an error if such an edge already exists
(define (node-add-edge edge node)
(define old-edges (node-edges node))
(define this-name (node-name node))
(if (member edge old-edges)
(error "edge already exists between nodes"
(symbol->string (edge-end edge))
"and"
(symbol->string this-name))
(make-node this-name
(node-data node)
(cons edge old-edges))))
;; --------------------EDGE----------------------------
;; Any -> Boolean
;; Check whether any is an edge
(define (edge? any)
(and (cons? any)
(= 2 (length any))
(number? (first any))
(symbol? (second any))))
;; Edge -> Number
;; Return the cost of this edge
(define (edge-cost edge)
(first edge))
;; Edge -> Symbol
;; Return the end node's name on this edge
(define (edge-end edge)
(second edge))
;; --------------------DIRECTED-EDGE----------------------------
;; Any -> Boolean
;; Check whether any is a directed-edge
(define (directed-edge? any)
(and (cons? any)
(= 3 (length any))
(number? (first any))
(symbol? (second any))
(symbol? (third any))))
;; Directed-Edge -> Symbol
;; return the name of the origin in de
(define (directed-edge-origin de)
(second de))
;; Directed-Edge -> Number
;; Return the cost of this de
(define (directed-edge-cost de)
(first de))
;; Directed-Edge -> Symbol
;; Return the name of the end node in de
(define (directed-edge-end de)
(third de))
;; ----------------------------FUNCTIONS-------------------------------------
| false |
8ef320f2605ceacb227dbbb26e052c76314e2b51 | 983ef7de7bd9951983223002354be2e70987908d | /eval.rkt | 2411d0c6040a32dc3d5aa9283454ab89bc01ba91 | []
| no_license | liumingc/eval | bfea2deb522aa267684e0f65de8d3e4a10176805 | bd7c11dd7d14667c11f0ea458f7f6ebfb285311b | refs/heads/master | 2021-01-19T02:11:40.562768 | 2016-07-31T13:32:55 | 2016-07-31T13:32:55 | 15,414,405 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 6,486 | rkt | eval.rkt | #lang racket
;; use macros, then use record, record-case to make code more readable
(require compatibility/mlist)
#|
env is
(env
(a . 3) (b . 4) (c . 5) ...)
|#
(define env0 (mcons 'env '()))
;; (ext-env e0 (a1 a2) (v1 v2))
(define ext-env
(lambda (e0 params vals)
(let ([env (mcdr e0)])
(define (f vars vals)
(if (not (null? vars))
(mcons (mcons (car vars)
(car vals))
(f (cdr vars)
(cdr vals)))
env))
(mcons 'env (f params vals)))))
(define def-var
(lambda (e0 var val)
(set-mcdr! e0
(mcons (mcons var val) (mcdr e0)))
(printf "def ~a to ~a~n" var val)
'def-ok))
(define set-var
(lambda (e0 var val)
(let ([p (lookup0 e0 var)])
(if (not (null? p))
(begin
(set-mcdr! p val)
(printf "set ~a to ~a~n" var val)
'set-ok)
(begin
;;(printf "set ~a failed~n" var)
'set-failed)))))
(define show-env
(lambda (e0)
(printf ">>> ENV >>>~n")
(mmap (lambda (x)
(display x)
(newline))
(mcdr e0))
(printf "<<< ENV <<<~n")))
(define lookup0
(lambda (e0 var)
(define f
(lambda (x)
(if (null? x)
(begin
(printf "lookup ~a failed~n" var)
'())
(let ([p (mcar x)])
(if (equal? (mcar p) var)
p
(f (mcdr x)))))))
(f (mcdr e0))))
(define lookup
(lambda (e0 var)
(let ([x (lookup0 e0 var)])
(if (null? x)
'()
(mcdr x)))))
;;; evaluator ;;;
#|
(basic-form
(define var val)
(set var val)
(quote dat)
(if cond then-clause else-clause)
(begin stmt-list ...)
(fn (param-list ...) body-list ...)
(fn-call arg-list ...))
|#
(define repl
(lambda ()
(prompt)
(usr-print (eval. (read) env0))
(repl)))
(define prompt
(lambda ()
(display "% ")))
(define usr-print
(lambda (expr)
(if (void? expr) ;; #<void>, how to compare?
(begin
(newline)
(newline))
(begin
(display expr)
(newline)
(newline)))))
(define eval.
(lambda (expr env)
((parse expr) env)))
(define parse
(lambda (expr)
(cond
[(atom? expr)
(parse-atom expr)]
[(var? expr)
(parse-var expr)]
[(define? expr)
(parse-define expr)]
[(set? expr)
(parse-set expr)]
[(quote? expr)
(parse-quote expr)]
[(if? expr)
(parse-if expr)]
[(begin? expr)
(parse-begin expr)]
[(fn? expr)
(parse-fn expr)]
;; make print as built-in, to make debug easier
;; print behaves different with scheme's print
[(print? expr)
(parse-print expr)]
[else ;; fn-call ...
(parse-fn-call expr)])))
(define atom?
(lambda (expr)
(or (string? expr)
(number? expr)
(null? expr)
(eq? expr '#t)
(eq? expr '#f))))
(define var?
(lambda (expr)
(symbol? expr)))
(define match-tag?
(lambda (expr tag)
(and (pair? expr)
(equal? (car expr) tag))))
(define define?
(lambda (expr)
(match-tag? expr 'define)))
(define set?
(lambda (expr)
(or (match-tag? expr 'set!)
(match-tag? expr 'set))))
(define quote?
(lambda (expr)
(match-tag? expr 'quote)))
(define if?
(lambda (expr)
(match-tag? expr 'if)))
(define begin?
(lambda (expr)
(match-tag? expr 'begin)))
(define fn?
(lambda (expr)
(match-tag? expr 'fn)))
(define print?
(lambda (expr)
(match-tag? expr 'print)))
(define fn-call?
(lambda (expr)
(pair? expr)))
(define nop
(lambda (expr)
(lambda (env)
(printf "~a not implemented~n" (car expr)))))
(define parse-atom
(lambda (expr)
(lambda (env)
expr)))
(define parse-var
(lambda (expr)
(lambda (env)
(lookup env expr))))
(define parse-define
(lambda (expr)
(let ([var (list-ref expr 1)]
[val (parse (list-ref expr 2))])
(lambda (env)
(def-var env var (val env))))))
(define parse-set
(lambda (expr)
(let ([var (list-ref expr 1)]
[val (parse (list-ref expr 2))])
(lambda (env)
(set-var env var (val env))))))
(define parse-quote
(lambda (expr)
(lambda (env)
(cadr expr))))
;; (if test-clause then-clause else-clause)
(define parse-if
(lambda (expr)
(let ([test-clause (parse (list-ref expr 1))]
[then-clause (parse (list-ref expr 2))]
[else-clause (parse (list-ref expr 3))])
(lambda (env)
(if (equal? (test-clause env) #f)
(else-clause env)
(then-clause env))))))
;; (begin e1 e2 ...)
(define parse-begin
(lambda (expr)
(let ([exprs (map parse (cdr expr))])
(define parse-seq
(lambda (seqs)
(if (null? (cdr seqs))
(car seqs)
(let ([rest (parse-seq (cdr seqs))])
(lambda (env)
((car seqs) env)
(rest env))))))
(parse-seq exprs))))
;; (fn (a1 a2 ...) b1 b2 ...)
;; (fn fn-params fn-body fn-env)
(define (parse-fn expr)
(lambda (env)
(let ([f (list 'fn (cadr expr) (parse (cons 'begin (cddr expr))) env)])
f)))
(define (fn-params fn-obj)
(list-ref fn-obj 1))
(define (fn-body fn-obj)
(list-ref fn-obj 2))
(define (fn-env fn-obj)
(list-ref fn-obj 3))
;; (f a b c)
(define parse-fn-call
(lambda (expr)
(let ([fp (parse (car expr))]
[args (map parse (cdr expr))])
(lambda (env)
(let ([fo (fp env)])
((fn-body fo)
(ext-env (fn-env fo)
(fn-params fo)
(map (lambda (x)
(x env)) args))))))))
(define parse-print
(lambda (expr)
(let ([elems (map (lambda (x)
(parse x))
(cdr expr))])
(lambda (env)
(map (lambda (x)
(display (x env)))
elems)
(void)))))
;;; test ;;;
#|
(def-var env0 'a 3)
(def-var env0 'b 4)
(def-var env0 'c 5)
(display (lookup env0 'c))
(newline)
(display (lookup env0 'd))
(set-var env0 'a 7)
(show-env env0)
(show-env (ext-env env0 '(x y z) '(0 1 2)))
|#
;; cons/car/cdr can be done by:
;; (define cons (fn (x y) (fn (p) (p x y))))
;; (define car (fn (p) (p (fn (x y) x))))
;; (define cdr (fn (p) (p (fn (x y) y))))
(repl)
| false |
f9b94bc7a80cf11e1b3aded1df7614ee45ddc2b9 | b251e000b5933025fc9a86373728b5fb6b9a8de7 | /problems/4-4-dining-philosophers.rkt | b58f1f538b233e691cdb07a80aa1d6f982bed37f | []
| no_license | bennn/little-book-of-semaphores | e46185ec2348dbd82b33cfaa24f0ef9300505ccd | 13dc1690073ae45f5ac7e4e4137d636aae1ef7c9 | refs/heads/master | 2021-01-10T14:11:41.847639 | 2019-04-11T15:55:04 | 2019-04-11T15:55:04 | 46,640,121 | 6 | 1 | null | null | null | null | UTF-8 | Racket | false | false | 1,721 | rkt | 4-4-dining-philosophers.rkt | #lang little-book-of-semaphores
;; Dining philosophers
;; - No sharing forks
;; - No deadlock
;; - No starvation
;; - Yes simultaneous eating
;; -----------------------------------------------------------------------------
(define NUM-PHILOSOPHERS 5)
(define NUM-FORKS NUM-PHILOSOPHERS)
;; Return this fork's successor
(define (next-fork id)
(modulo (+ 1 id) NUM-FORKS))
(define fork*
(for/vector ([i (in-range NUM-FORKS)])
(make-semaphore 1)))
(define (fork-wait i)
(wait (vector-ref fork* i)))
(define (fork-signal i)
(signal (vector-ref fork* i)))
;; -----------------------------------------------------------------------------
(define (think id)
(printf "Philosopher ~a is thinking...\n" id)
(sleep (random)))
;; Invariant: grab the even-numbered fork
(define (get-forks id)
(define f1 id)
(define f2 (next-fork id))
(if (even? f1)
(begin (fork-wait f1)
(fork-wait f2))
(begin (fork-wait f2)
(fork-wait f1))))
(define (eat id)
(printf "Philosopher ~a is eating\n" id)
(sleep (random)))
(define (put-forks id)
(fork-signal id)
(fork-signal (next-fork id)))
;; -----------------------------------------------------------------------------
(define-syntax make-philosopher
(syntax-parser
[(_ n:nat)
#:with id (format-id #'n "p~a" (syntax-e #'n))
#'(define-thread id
(forever
(think n)
(get-forks n)
(eat n)
(put-forks n)))]))
;; -----------------------------------------------------------------------------
(module+ test
(make-philosopher 0)
(make-philosopher 1)
(make-philosopher 2)
(make-philosopher 3)
(make-philosopher 4)
;; TODO automate philosopher-making
(run))
| true |
fd47399202d06ab4ba8204644fab5f127807e856 | f4aeaa0812ac15d5a8d2cb6da75ac335c3cf5cf4 | /racket/miruKanren/surveillance.rkt | 88a6ef23e98f506a778e6bc8b2f140701640741d | [
"MIT"
]
| permissive | orchid-hybrid/microKanren-sagittarius | 13f7916f8ef7c946cefeb87e9e52d6d4a5dfe6c9 | 9e740bbf94ed2930f88bbcf32636d3480934cfbb | refs/heads/master | 2021-01-13T01:54:20.589391 | 2015-06-13T12:40:14 | 2015-06-13T12:40:14 | 29,868,626 | 12 | 4 | null | 2015-02-12T07:11:25 | 2015-01-26T16:01:10 | Scheme | UTF-8 | Racket | false | false | 253 | rkt | surveillance.rkt | (module surveillance racket (provide variables-in-term normalize-surveillance) (require "scheme/base.rkt" "sorted-int-set.rkt" "utils.rkt" "variables.rkt" "kanren.rkt" "monad.rkt" "unification.rkt") (include (file "../../miruKanren/surveillance.scm")))
| false |
f774a298281290a2445891b65557eaf423c4e960 | f5da4884c236512f9a945100234e213e51f980d3 | /serval/x86/interp/and.rkt | d509a3ffc0535e3377d5a4955c82d675ac2592b7 | [
"MIT"
]
| permissive | uw-unsat/serval | 87574f5ec62480463ae976468d4ae7a56e06fe9f | 72adc4952a1e62330aea527214a26bd0c09cbd05 | refs/heads/master | 2022-05-12T23:19:48.558114 | 2022-01-20T18:53:26 | 2022-01-20T18:53:26 | 207,051,966 | 45 | 12 | MIT | 2022-03-21T14:05:50 | 2019-09-08T02:40:10 | Racket | UTF-8 | Racket | false | false | 3,722 | rkt | and.rkt | #lang rosette
(require
"common.rkt")
(provide
and-eax-imm32
and-rax-imm32
and-r/m32-imm32
and-r/m64-imm32
and-r/m32-imm8
and-r/m64-imm8
and-r/m32-r32
and-r/m64-r64
and-r32-r/m32
and-r64-r/m64)
(define (interpret-and cpu dst v2)
(define v1 (cpu-gpr-ref cpu dst))
(define result (bvand v1 v2))
(cpu-gpr-set! cpu dst result)
(cpu-pf+zf+sf-set! cpu result)
(cpu-flag-clear! cpu 'CF 'OF 'AF))
; 25 id
(define-insn and-eax-imm32 (imm32)
#:decode [((byte #x25) i0 i1 i2 i3)
(list (decode-imm i0 i1 i2 i3))]
#:encode (list (byte #x25) (encode-imm imm32))
(lambda (cpu imm32)
(interpret-and cpu eax imm32)))
; REX.W + 25 id
(define-insn and-rax-imm32 (imm32)
#:decode [((rex.w/r) (byte #x25) i0 i1 i2 i3)
(list (decode-imm i0 i1 i2 i3))]
#:encode (list (rex.w/r) (byte #x25) (encode-imm imm32))
(lambda (cpu imm32)
(interpret-and cpu rax (sign-extend imm32 (bitvector 64)))))
; 81 /4 id
(define-insn and-r/m32-imm32 (dst imm32)
#:decode [((byte #x81) (/4 r/m) i0 i1 i2 i3)
(list (gpr32-no-rex r/m) (decode-imm i0 i1 i2 i3))]
[((rex/r b) (byte #x81) (/4 r/m) i0 i1 i2 i3)
(list (gpr32 b r/m) (decode-imm i0 i1 i2 i3))]
#:encode (list (rex/r dst) (byte #x81) (/4 dst) (encode-imm imm32))
(lambda (cpu dst imm32)
(interpret-and cpu dst imm32)))
; REX.W + 81 /4 id
(define-insn and-r/m64-imm32 (dst imm32)
#:decode [((rex.w/r b) (byte #x81) (/4 r/m) i0 i1 i2 i3)
(list (gpr64 b r/m) (decode-imm i0 i1 i2 i3))]
#:encode (list (rex.w/r dst) (byte #x81) (/4 dst) (encode-imm imm32))
(lambda (cpu dst imm32)
(interpret-and cpu dst (sign-extend imm32 (bitvector 64)))))
; 83 /4 ib
(define-insn and-r/m32-imm8 (dst imm8)
#:decode [((byte #x83) (/4 r/m) i0)
(list (gpr32-no-rex r/m) i0)]
[((rex/r b) (byte #x83) (/4 r/m) i0)
(list (gpr32 b r/m) i0)]
#:encode (list (rex/r dst) (byte #x83) (/4 dst) (encode-imm imm8))
(lambda (cpu dst imm8)
(interpret-and cpu dst (sign-extend imm8 (bitvector 32)))))
; REX.W + 83 /4 ib
(define-insn and-r/m64-imm8 (dst imm8)
#:decode [((rex.w/r b) (byte #x83) (/4 r/m) i0)
(list (gpr64 b r/m) i0)]
#:encode (list (rex.w/r dst) (byte #x83) (/4 dst) (encode-imm imm8))
(lambda (cpu dst imm32)
(interpret-and cpu dst (sign-extend imm8 (bitvector 64)))))
; 21 /r
(define-insn and-r/m32-r32 (dst src)
#:decode [((byte #x21) (/r reg r/m))
(list (gpr32-no-rex r/m) (gpr32-no-rex reg))]
[((rex/r r b) (byte #x21) (/r reg r/m))
(list (gpr32 b r/m) (gpr32 r reg))]
#:encode (list (rex/r src dst) (byte #x21) (/r src dst))
(lambda (cpu dst src)
(interpret-and cpu dst (cpu-gpr-ref cpu src))))
; REX.W + 21 /r
(define-insn and-r/m64-r64 (dst src)
#:decode [((rex.w/r r b) (byte #x21) (/r reg r/m))
(list (gpr64 b r/m) (gpr64 r reg))]
#:encode (list (rex.w/r src dst) (byte #x21) (/r src dst))
(lambda (cpu dst src)
(interpret-and cpu dst (cpu-gpr-ref cpu src))))
; 23 /r
(define-insn and-r32-r/m32 (dst src)
#:decode [((byte #x23) (/r reg r/m))
(list (gpr32-no-rex reg) (gpr32-no-rex r/m))]
[((rex/r r b) (byte #x23) (/r reg r/m))
(list (gpr32 r reg) (gpr32 b r/m))]
#:encode (list (rex/r dst src) (byte #x23) (/r dst src))
(lambda (cpu dst src)
(interpret-and cpu dst (cpu-gpr-ref cpu src))))
; REX.W + 23 /r
(define-insn and-r64-r/m64 (dst src)
#:decode [((rex.w/r r b) (byte #x23) (/r reg r/m))
(list (gpr64 r reg) (gpr64 b r/m))]
#:encode (list (rex.w/r dst src) (byte #x23) (/r dst src))
(lambda (cpu dst src)
(interpret-and cpu dst (cpu-gpr-ref cpu src))))
| false |
6652f57cc9d4672a46f6367493a8c1e750650578 | ddcff224727303b32b9d80fa4a2ebc1292eb403d | /2. Building Abstractions with Data/2.3/2.72.rkt | 471c7d761096634e903a9a5a3c4b738150da7070 | []
| no_license | belamenso/sicp | 348808d69af6aff95b0dc5b0f1f3984694700872 | b01ea405e8ebf77842ae6a71bb72aef64a7009ad | refs/heads/master | 2020-03-22T02:01:55.138878 | 2018-07-25T13:59:18 | 2018-07-25T13:59:18 | 139,345,220 | 1 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 875 | rkt | 2.72.rkt | #lang racket
#;(define (encode-symbol s t)
(if (member s (symbols t))
(let search ([t t])
(cond
[(leaf? t) '()]
[(member s (symbols (left-branch t)))
(cons 0 (search (left-branch t)))]
[else
(cons 1 (search (right-branch t)))]))
(error "Symbol not in the tree" s t)))
#|
Given the code and constraints same as in 2.71:
Encoding the most frequent one: O(3n) = O(n)
-> check membership in the tree O(n)
-> check if leaf? O(1)
-> check membership in the left branch O(n)
-> append 1 to the result of searchig the right subtree O(1)
Encoding the least frequen one: O(n^2)
at each level we check membership in m-element list and (m-1)-element list
where m is the number of symbols at that level. On the lowest level we have
m = 3. So (n-1)(3 + 2n-1)(1/2) = n^2 - n = O(n^2)
|#
| false |
328f39f19c90313c4c62a9f9d5df43b6e16f9ac8 | 0031a2836d69c76773f63a60949c02668adfd602 | /chapter2/ex2.20-parity.rkt | 06646cba161e5586fa382c3bd42bc6151fbfd948 | []
| no_license | hitalex/SICP-solutions | 3a9be86ade702661e8965b9d730e0514be66cedf | d3c7f34fb513c197d037f99afa0abc88dbaa6a3e | refs/heads/master | 2020-06-24T17:36:18.457082 | 2017-01-08T14:49:40 | 2017-01-08T14:49:40 | 74,629,242 | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 325 | rkt | ex2.20-parity.rkt | #lang racket
(define nil '())
(define (same-parity a . l)
(define (iter items r)
(cond ((null? items) nil)
((= (remainder (car items) 2) r) (cons (car items) (iter (cdr items) r)))
(else (iter (cdr items) r))))
(let ((r (remainder a 2)))
(cons a (iter l r))))
(same-parity 2 3 4 5 6 7 8) | false |
5989d9530c1f84178bb0cb4cde65a04d12914a23 | cd9a2d11c110b6e02dae1328e23445e2871f0863 | /superc/c-loader.rkt | 848cc78f64494712c27793b63b32f4594b0cd0bf | []
| no_license | julian-becker/superc | f230aba7795e3e13e5ca79883be284b7a94861d9 | 929d3e32db7a5c69fa9e033db7b5707cff329672 | refs/heads/master | 2020-05-24T03:24:10.851047 | 2015-12-19T21:50:03 | 2015-12-19T21:50:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 1,668 | rkt | c-loader.rkt | #lang racket/base
(require ffi/unsafe
(for-syntax racket/base
racket/file
racket/system
syntax/parse))
(define-syntax (c-loader stx)
(syntax-parse
stx
[(_ this-lib-b c-flags-string:str ld-flags-string:str c-source-string:str)
(define gcc-path (find-executable-path "gcc"))
(define racket-path (make-temporary-file "superc-tmp~a.ss"))
(define c-path (path-replace-suffix racket-path #".c"))
(define o-path (path-replace-suffix racket-path #".o"))
(define so-path (path-replace-suffix racket-path #".so"))
(define (system/exit-code* s)
;; (eprintf "Running: ~a\n" s)
(system/exit-code s))
(with-output-to-file c-path
(lambda ()
(write-string (syntax->datum #'c-source-string)))
#:exists 'replace)
(if (zero?
(system/exit-code*
(string-append
(path->string gcc-path)
(syntax->datum #'c-flags-string)
" -fPIC "
" -c " (path->string c-path)
" -o " (path->string o-path))))
(if (zero?
(system/exit-code*
(string-append
(path->string gcc-path)
" -shared "
(syntax->datum #'ld-flags-string)
(path->string o-path)
" -o " (path->string so-path))))
(quasisyntax/loc stx
(set-box! this-lib-b (ffi-lib #,so-path)))
(raise-syntax-error 'c-loader (format "Error linking C object: ~e" o-path)))
(raise-syntax-error 'c-loader (format "Error compiling C code: ~e" c-path)))]))
(provide c-loader)
| true |
49915fec8d6faeda7d6975381dc9f08e06982955 | 806a2b5ff3250b40aeca25efe813691d7c6dceab | /Code/Admin/tournament-observer.rkt | 3e7d6a34c819285a71e6a2cc046eec22789847d4 | [
"Apache-2.0"
]
| permissive | mfelleisen/Tsuro | 6c52368c9bc3372bcec3d18c7adcfe23b504e5ae | 100e7d51f04ab39b7a316da878d2843a7f06163d | refs/heads/master | 2020-06-30T02:14:39.518776 | 2019-12-29T00:39:34 | 2019-12-29T00:39:34 | 200,689,777 | 1 | 1 | null | null | null | null | UTF-8 | Racket | false | false | 5,011 | rkt | tournament-observer.rkt | #lang racket/gui
(require Tsuro/Code/Admin/observer-interfaces)
(provide (contract-out [show-tournament tournament-observer/c]))
;
; ; ;
; ; ; ;
; ; ;
; ;;;; ;;; ;;;; ;;; ; ;; ;;;; ;;; ; ;; ;;; ;;; ;;; ;;;
; ;; ;; ;; ; ;; ;; ;; ; ;; ; ;; ;; ;; ; ;; ; ;; ; ; ;; ; ; ;
; ; ; ; ;; ; ; ; ;; ; ; ; ; ; ;; ; ; ; ; ; ;; ;
; ; ; ;;;;;; ; ; ;;;;;; ; ; ; ; ;;;;;; ; ; ; ; ;;;;;; ;;;
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
; ;; ;; ; ;; ;; ; ; ; ;; ;; ; ; ; ;; ; ; ; ;
; ;;;; ;;;; ;;;; ;;;; ; ; ;;;; ;;;; ; ; ;;;; ;;;;; ;;;; ;;;
; ;
; ;
; ;
(require Tsuro/Code/Lib/canvas-with-history)
(require (except-in pict table))
;
; ;
; ;
; ;
; ;;; ; ;; ;;; ; ;
; ; ; ;; ; ;; ;; ; ;
; ; ; ; ; ; ; ; ;
; ;;; ; ; ; ; ; ; ;
; ; ; ; ; ; ;; ;;
; ; ; ; ; ;; ;; ;; ;;
; ;;; ; ; ;;; ; ;
;
;
;
(define PLAYER# 20)
(define SLEEP .99)
(define INSET 1)
(define SCALE* .99)
(define COLORS '("pink" "purple" "turquoise" "sky")) ;; of game borders
;; describe the display of a player (by age)
(define FONT 22)
(define SAMPLE (text (~a 99) 'roman FONT))
(define CELL (rounded-rectangle (+ 8 (pict-width SAMPLE)) (+ 8 (pict-height SAMPLE))))
(define PWIDTH (pict-width CELL))
(define PHEIGHT (pict-height CELL))
(define SPACE 8) ;; between players, games, and rounds
(define to-int (compose inexact->exact round (curry * SCALE*)))
(define HEIGHT (to-int (+ SPACE (* (+ PLAYER# 1) (+ SPACE PHEIGHT)) SPACE)))
(define WIDTH (to-int (* PLAYER# (+ SPACE PWIDTH SPACE))))
(define EMPTY (blank 100 100))
#; (N -> [N [Listof [Listof [List N]]] -> Void])
(define (show-tournament max-age)
(define frame (new frame% [label "tournament observer"][width WIDTH][height HEIGHT]))
(define history* (make-vector PLAYER# EMPTY))
(define canvas
(new history-canvas% [parent frame] [style '(vscroll hscroll)] [inset INSET] [history history*]))
(send canvas show-scrollbars #t #t)
(send canvas init-auto-scrollbars WIDTH HEIGHT 0. 0.)
(send frame show #t)
(define history (blank 1 1))
(define (callback games)
(define next (scale (games->pict max-age games) SCALE*))
(set! history (hc-append (* 8 SPACE) history next))
(send canvas set history)
(sleep SLEEP))
callback)
#; { N [Listof [Listof N]] : sorted -> Pict }
(define (games->pict maxage games)
(define active (apply append games))
(define p0 (if (empty? games) (text "no active players left") (blank PWIDTH HEIGHT)))
(define active-players
(for*/fold ([p p0]) ([i (in-range maxage)][a (in-value (- maxage i 1))] #:when (member a active))
(pin-over p SPACE (age->height i) (player->pict a))))
(for/fold ((pict active-players)) ([1game games][1color COLORS])
(define y0 (- (age->height (- maxage (first 1game) 1)) 2))
(define y1 (+ (age->height (- maxage (last 1game))) 2))
(define gp (game->pict (- y1 y0) 1color))
(pin-over pict (/ SPACE 2) (- y0 2) gp)))
#; {N -> N}
(define (age->height i)
(+ SPACE (* i (+ PHEIGHT SPACE))))
#; {N Color -> Pict}
(define (game->pict height color)
(rounded-rectangle (+ PWIDTH SPACE) height #:border-color color #:border-width 1))
#; {N -> Pict}
(define (player->pict age)
(cc-superimpose CELL (text (~a age) 'roman 22)))
;
; ;
; ;
; ;
; ;;;; ;;; ;;;;;; ;;;
; ;; ;; ;; ; ; ; ; ;; ;;
; ; ; ; ;;; ; ; ; ;
; ; ; ;;;;;;; ; ; ; ;
; ; ; ; ; ; ; ; ;
; ;; ;; ; ; ; ; ;; ;;
; ;;;; ;;;; ; ; ; ;;;
;
;
;
(module+ picts
(provide demo)
(define (demo)
(define show (show-tournament PLAYER#))
(show '[[19 18 17 16 15] [14 13 12 11 10] [9 8 7 6 5] [4 3 2 1 0]])
(show '[[19 18 13 12 10] [9 3 2 1 0]])
(show '[[19 3 2 1]])
(show '[[19 3]]))
(demo))
| false |
d752167bb95fb29c298505bb09dcd0a42cbebcf8 | b62560d3387ed544da2bbe9b011ec5cd6403d440 | /self_hosted/program.rkt | 6ac0aff6e8d0cf2e99e5b061e8a1c7135661ad03 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"Apache-2.0"
]
| permissive | mattwparas/steel | c6fb91b20c4e613e6a8db9d9310d1e1c72313df2 | 700144a5a1aeb33cbdb2f66440bbe38cf4152458 | refs/heads/master | 2023-09-04T03:41:35.352916 | 2023-09-01T03:26:01 | 2023-09-01T03:26:01 | 241,949,362 | 207 | 10 | Apache-2.0 | 2023-09-06T04:31:21 | 2020-02-20T17:39:28 | Rust | UTF-8 | Racket | false | false | 239 | rkt | program.rkt | ; (define foo
; (lambda (x)
; (+ (if #t x 20)
; x
; (begin 10 20 30
; (set! x 30)))))
(define hello-world (lambda () (displayln "hello world!")))
(hello-world) | false |
5e7ccdf239c2c96b92787f3864eda507774a02f2 | 964bb56e1e21091cf07a49b51394d02fcdb018f7 | /ch01/1_38.rkt | 93f0cc081d95cfd7619483b6066d0708c626a189 | []
| no_license | halee99/SICP | fa7758f96c6363b3b262e3b695f11f1c1072c628 | de282c9f595b3813d3f6b162e560b0a996150bd2 | refs/heads/master | 2020-04-06T14:52:39.639013 | 2019-10-10T09:14:56 | 2019-10-10T09:14:56 | 157,557,554 | 1 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 437 | rkt | 1_38.rkt | #lang planet neil/sicp
; 迭代
(define (cont_frac_iter n d k)
(define (iter i result)
(if (= i 0)
result
(iter (- i 1)
(/ (n i) (+ (d i) result)))))
(iter k 0.0))
(define (d i)
(cond ((= (remainder i 3) 0) 1)
((= (remainder i 3) 1) 1)
(else (- (+ i 1) (/ (+ i 1) 3)))))
(define e
(+ (cont_frac_iter (lambda (i) 1)
d
100)
2))
e
| false |
b1dc2fe0495f6639ee1a0a9db8ffd980587d0c4a | d6b905b841a3c812ff1805879f681111f164e87c | /nanoxd/chapter10/tic-tac-toe.rkt | b3158f11048f36f3fe4ca9c6aeef7f7792a016a6 | [
"MIT"
]
| permissive | SeaRbSg/realm_of_racket | 40398e89ab2d39b7499bb97ee2a6b07bdb79c586 | b4383c6cab68b4cea04f514267c58397e8cc69d0 | refs/heads/master | 2021-03-12T22:50:14.935166 | 2017-11-30T23:40:10 | 2017-11-30T23:51:11 | 12,911,347 | 1 | 2 | null | null | null | null | UTF-8 | Racket | false | false | 574 | rkt | tic-tac-toe.rkt | #lang racket
(struct ttt (board moves))
(struct action (player position))
(define (generate-ttt-tree player1 player2)
(define (generate-tree board player opponent)
(ttt board (generate-moves board player opponent)))
(define (generate-moves board0 player opponent)
(define free-fields (board-find-free-fields board0))
(for/list ((f free-fields))
(define actnow (action player f))
(define board1 (board-take-field board0 player f))
(list actnow (generate-tree board1 opponent player ))))
(generate-tree the-empty-board player1 player2))
| false |
d64aee63c7ce8d081b743d9d819531b9340d09b6 | 3c8992d229b954f2920bc3e14790621a5752c511 | /examples/sort-scary.rkt | ce47256b92ad512412bf9172aeab8be6afdeb63d | []
| no_license | samth/var | 0997324b9d97f365718d9626557938b65c69dc61 | 6817f7d688bdd3ee4ae8314083e78ca72eba23da | refs/heads/master | 2016-09-05T23:25:43.533316 | 2013-02-04T20:11:48 | 2013-02-04T20:11:48 | 1,740,899 | 3 | 2 | null | null | null | null | UTF-8 | Racket | false | false | 756 | rkt | sort-scary.rkt | #lang racket
(require (prefix-in r: racket))
(define ((sorted/c c) l)
(if (null? l) #t
(let loop ([last (car l)]
[l (cdr l)])
(if (null? l)
#t
(and (memq (c last (car l)) '(lt eq))
(loop (car l) (cdr l)))))))
(define/contract (sort cmp l)
(->i ([c (integer? integer? . -> . (one-of/c 'lt 'gt 'eq))] [l (listof integer?)])
[_ (c) (and/c (listof integer?)
(sorted/c c))])
(r:sort l (λ (x y) (eq? 'lt (cmp x y)))))
(define (lt x y)
(cond [(< x y) 'lt]
[(> x y) 'gt]
[else 'eq]))
(define (gt x y)
(cond [(< x y) 'gt]
[(> x y) 'lt]
[else 'eq]))
(sort lt '(3 2 1))
(sort gt '(3 2 1))
(sort gt '(3 2 1 5)) | false |
1ed4d1e542780bced8d192f376c8688a89e79e5a | 2a59d8c57f2b4ad9a64d1c69e84516e1e5d07f42 | /satore/saturation.rkt | f344645deb70a8287c5cf62318da07f290128b5a | [
"MIT",
"Apache-2.0"
]
| permissive | sethuramanio/deepmind-research | c1feb49e52fd16535c6ec0e2342c8d3ebff57ab1 | a6ef8053380d6aa19aaae14b93f013ae9762d057 | refs/heads/master | 2023-08-28T05:51:15.062153 | 2021-10-16T10:29:09 | 2021-10-16T10:29:09 | 408,818,983 | 1 | 0 | Apache-2.0 | 2021-09-21T12:52:44 | 2021-09-21T12:52:43 | null | UTF-8 | Racket | false | false | 41,085 | rkt | saturation.rkt | #lang racket/base
;**************************************************************************************;
;**** Saturation Algorithm ****;
;**************************************************************************************;
(require bazaar/cond-else
bazaar/date
bazaar/debug
bazaar/dict
bazaar/mutation
data/heap/unsafe
data/queue
define2
global
racket/block
racket/dict
racket/format
racket/list
racket/math
racket/pretty
racket/string
satore/Clause
satore/clause-format
satore/clause
satore/interact
satore/json-output
satore/misc
satore/rewrite-tree
satore/tptp
satore/unification-tree
satore/unification)
(provide (all-defined-out))
;===============;
;=== Globals ===;
;===============;
(define-global:boolean *quiet-json?* #false
'("JSON output format and silent mode. Deactivates some verbose options."))
(define-global *memory-limit* 4096
"Memory limit in MB, including the Racket VM."
exact-positive-integer?
string->number)
(define-global:boolean *find-unit-rules-in-candidates?* #false
'("Search for unit rewrite rules in the condidate set?"
"This may speed up the search significantly, or slow it down significantly,"
"depending on how many unit rules can be generated."))
(define-global:boolean *backward-rw?* #true
'("Use binary-clause rewriting? (aka θ-equivalences)."
"The iterative mode does not use backward rewrites."))
(define-global:boolean *dynamic-rules?* #false
"Use dynamic rules? Experimental.")
(define-global:boolean *proof?* #false
"Display the proof when found?")
(define-global *age:cost* '(1 9)
"Age:cost ratio. Format: <age-freq>:<cost-freq>, e.g., '1:3'"
(λ (p) (and (list? p) (= 2 (length p)) (andmap exact-nonnegative-integer? p)))
(λ (s) (map string->number (string-split s ":"))))
(define-global:category *cost-type* 'weight-fair
'(weight-fair weight)
"Cost type.")
(define-global *cost-depth-factor* 1.5
"Cost = weight + cost-depth-factor * depth"
(λ (x) #true)
string->number)
(define-global *cost-noise* 0.
"Noise factor to add to costs"
(λ (x) (and (real? x) (>= x 0)))
string->number)
(define-global:boolean *parent-discard?* #false
"Discard clauses when at least one parent has been discarded?")
(define-global:boolean *discover-online?* #true
'("Use rewrite rules as soon as they are discovered?"
"The rules will not be made confluence until the next restart"))
(define-global:boolean *negative-literal-selection?* #true
"When resolving, if a clause has negative literals, only select one of them.")
(define-global *cpu-limit* +inf.0
"CPU limit in seconds per problem."
exact-positive-integer?
string->number)
(define-global *cpu-first-limit* +inf.0
"CPU limit in seconds per problem."
exact-positive-integer?
string->number)
(define-global *cpu-limit-factor* 3
'("Increase of cpu limit of cpu-first-limit once an iteration has failed."
"Set to 0 to avoid restarting."
"Assumes --cpu-limit.")
(λ (x) (and (real? x) (>= x 0)))
string->number)
(define-global *input-rules* #false
'("File to read rewrite rules from.")
file-exists?
values)
(define-global *output-rules* #false
'("File to write rewrite rules to. If 'auto', a unique name is chosen automatically.")
(λ (x) #true)
(λ (str)
(if (string=? str "auto")
(build-path "rules" (string-append "rules-" (date-iso-file) ".txt"))
str)))
;======================;
;=== Rule discovery ===;
;======================;
;; Finds new binary equivalences between `C` and the clauses of `utree`,
;; and adds and returns the set of resulting new rules that can be added to `rwtree`.
;;
;; rwtree-out : rewrite-tree?
;; C : Clause?
;; utree : unification-tree?
(define (discover-new-rules! rwtree-out C utree)
(cond/else
[(not rwtree-out) '()]
;; FIND UNIT REWRITE RULES
;; Unit rewrite using the binary rewrite tree
[(unit-Clause? C)
(when-debug>= steps (displayln "Found unit clause"))
;; Add the new unit clause to the set of unit rewrite rules
(rewrite-tree-add-unit-Clause! rwtree-out C #:rewrite? #false)]
[(not (binary-Clause? C))
'()]
;; FIND BINARY REWRITE RULES
#:else
(when-debug>= steps (displayln "Found binary clause"))
;; We search for the converse implication in the active set.
;; This takes care of clauses that have converse clauses but not the converse.
;; Ex: C1 = p(X) | q(X) ; C2 = ~p(a) | ~q(a)
;; C2 has a converse clause, but not C1. Hence C2 can be added as a binary rewrite rule
;; but not C1.
(define Conv (make-converse-Clause C))
(define self-conv? (Clause-subsumes C Conv))
#:cond
[self-conv?
; Self-converse Clause, so only one Clause to add (but will lead to 2 rules).
(when-debug>= steps (displayln "Self-converse"))
(rewrite-tree-add-binary-Clause! rwtree-out C C #:rewrite? #false)]
#:else
(define Subs (utree-find/any utree Conv (λ (a Conv) (and (binary-Clause? a)
(Clause-subsumes a Conv)))))
#:cond
[Subs
; We found a converse Clause in the active set, or a Clause that subsumes the
; converse Clause, so we can add selected-Clause as a rule and also its
; converse Clause.
; We can't add Subs, since Subs may not itself have a converse
; clause in the active set. Ex:
; selected-Clause = p(a) | q(a), so Conv = ~p(a) | ~q(a) and Subs = ~p(X) | ~q(X)
; Subs cannot be added as a rule because (supposedly) we haven't found a converse
; clause yet, but we can still add Conv as a rule.
; If Subs is aleardy a rule, Conv will be rewritten to a tautology and discarded.
(when-debug>= steps (printf "Found converse subsuming clause: ~a\n"
(Clause->string Subs)))
; Since C has already been rewritten, there is no need to do it again.
(rewrite-tree-add-binary-Clause! rwtree-out C Subs #:rewrite? #false)]
#:else
; Asymmetric rules.
; Even when selected-Clause is not a rule (yet?), it may still enable
; other more specific Clauses of the active set to be added as rules too.
; Eg, selected-Clause = p(X) | q(X) and some other active clause is ~p(a) | ~q(a).
(define Subsd (utree-find/all utree Conv (λ (a Conv) (and (binary-Clause? a)
(Clause-subsumes Conv a)))))
#:cond
[(not (empty? Subsd))
(when-debug>= steps
(displayln "Found converse subsumed clauses:")
(print-Clauses Subsd))
; rewrite=#true is ok here because Clause->rules already considers both directions
; of the implication. Hence if a potential rule is rewritten to a tautology,
; we know it's already redundant anyway.
; TODO: Rename this to add-asymmetric-rules ?
(rewrite-tree-add-binary-Clauses! rwtree-out Subsd C #:rewrite? #true)]
#:else '()))
;====================;
;=== Clause costs ===;
;====================;
;; Clause comparison for the cost queue.
;;
;; Clause? Clause? -> boolean?
(define (Candidate<= C1 C2)
(<= (Clause-cost C1) (Clause-cost C2)))
;; Sets the cost of a list of Clauses that all have the same parent `parent`.
;; Some noise can be added to the cost via *cost-noise*.
;;
;; Cs : (listof Clause?)
;; cost-type: symbol?
;; parent : Clause?
;; cost-depth-factor : number?
;; -> void?
(define (Clauses-calculate-cost! Cs
cost-type
parent
#:! cost-depth-factor)
(case cost-type
;; Very simple cost function that uses the weight of the Clause. May not be fair.
[(weight)
(for ([C (in-list Cs)])
(set-Clause-cost! C
(if (empty? (Clause-clause C))
-inf.0 ; empty clause should always be top of the list
(Clause-size C))))]
;; Very simple cost function that is fair
[(weight-fair)
(for ([C (in-list Cs)])
(set-Clause-cost! C
(if (empty? (Clause-clause C))
-inf.0 ; empty clause should always be top of the list
(+ (* (Clause-depth C) cost-depth-factor)
(Clause-size C)))))])
;; Add noise to the cost so as to potentially solve more later.
;; To combine with a slowly increasing step-limit-factor in iterative saturation
(unless (zero? (*cost-noise*))
(define ε (*cost-noise*))
(for ([C (in-list Cs)])
(set-Clause-cost! C
(* (+ (- 1. ε) (* ε (random)))
(Clause-cost C))))))
;==================;
;=== Saturation ===;
;==================;
;; List of possible status values. Used to prevent mistakes.
(define statuses '(refuted saturated time memory steps running))
;; Returns whether the result dictionary `res` has the status `status`.
;;
;; res : dict?
;; status : symbol?
(define (check-status res status)
(define res-status (dict-ref res 'status #false))
; To avoid silent typo bugs.
(assert (memq status statuses) status)
(assert (memq res-status statuses) res-status)
(eq? status res-status))
;; The main algorithm. Saturates the formula given by the input clauses
;; by adding new clauses (either resolutions or factors) until either
;; the empty clause is produced, or a resource limit is reached (steps, time, memory).
;;
;; input-clauses : (listof clause?)
;; step-limit : number?
;; memory-limit : number?
;; cpu-limit : number?
;; rwtree : (or/c #false rewrite-tree?)
;; rwtree-out : (or/c #false rewrite-tree?)
;; backward-rewrite? : boolean?
;; parent-discard? : boolean?
;; age:cost : (list/c exact-nonnegative-integer? exact-nonnegative-integer?)
;; cost-type : symbol?
;; disp-proof? : boolean?
;; L-resolvent-pruning : boolean?
;; find-unit-rules-in-candidates? : boolean?
;; negative-literal-selection? : boolean?
;; -> dict?
(define (saturation input-clauses
#:? [step-limit +inf.0]
#:? [memory-limit (*memory-limit*)] ; in MB
#:? [cpu-limit +inf.0] ; in seconds
; The rewrite tree holding the binary rules.
; Set it to #false to deactivate it.
#:? [rwtree (make-rewrite-tree #:atom<=> (get-atom<=>)
#:dynamic-ok? (*dynamic-rules?*)
#:rules-file (*input-rules*))]
; rewrite-tree where new rules found during saturation are stored.
; If rwtree-out is different from rwtree, new rules are not used but only stored,
; and backward rewriting is deactivated.
#:? [rwtree-out rwtree] ; or #false if don't care
; Only effective if (eq? rwtree rwtree-out)
#:? [backward-rewrite? (*backward-rw?*)]
#:? [parent-discard? (*parent-discard?*)]
#:? [age:cost (*age:cost*)] ; chooses age if (< (modulo t (+ age cost)) age)
#:? [cost-type (*cost-type*)]
#:? [disp-proof? (*proof?*)]
#:? [L-resolvent-pruning? (*L-resolvent-pruning?*)]
#:? [find-unit-rules-in-candidates? (*find-unit-rules-in-candidates?*)]
#:? [negative-literal-selection? (*negative-literal-selection?*)])
;; Do NOT reset the clause-index, in particular if rwtree is kept over several calls to saturation.
#;(reset-clause-index!)
;; Tree containing the active Clauses
(define utree (make-unification-tree))
;; Clauses are pulled from priority first, unless empty.
;; INVARIANT: active-Clauses U priority is (should be!) equisatisfiable with input-Clauses.
;; In other words, if priority is empty, then the set of active-Clauses
;; is equisatisfiable with the input-Clauses.
;; Some active clauses may be removed from utree and pushed back into priority for further
;; processing like 'backward' rewriting. In that case, the active Clauses (utree) is not
;; 'complete'.
(define priority (make-queue))
;; Both heaps contain the candidate clauses (there may be duplicates between the two,
;; but this is checked when extracting Clauses from either heap).
(define candidates (make-heap Candidate<=))
(define age-queue (make-heap Clause-age>=))
;; Frequency of extracting Clauses from either heap.
(define age-freq (first age:cost))
(define cost-freq (second age:cost))
(define age+cost-freq (+ age-freq cost-freq))
;; Add the Clauses Cs to the priority queue for priority processing.
(define (add-priority-Clauses! Cs)
(for ([C (in-list Cs)])
; Need to set candidate? to #true otherwise it may be skipped.
; (or maybe we should not skip clauses loaded from `priority`?)
(set-Clause-candidate?! C #true)
(enqueue! priority C)))
(define cost-depth-factor (*cost-depth-factor*)) ; immutable value
(define (add-candidates! parent Cs)
;; Calculate costs and add to candidate heap.
(unless (empty? Cs)
(Clauses-calculate-cost! Cs cost-type parent #:cost-depth-factor cost-depth-factor)
(for ([C (in-list Cs)])
(set-Clause-candidate?! C #true))
(unless (= 0 cost-freq) (heap-add-all! candidates Cs))
(unless (= 0 age-freq) (heap-add-all! age-queue Cs))
(when-debug>= steps
(printf "#new candidates: ~a #candidates: ~a\n"
(length Cs)
(heap-count candidates)))))
(define input-Clauses
(map (λ (c) (make-Clause c '() #:type 'in)) input-clauses))
;; This maintains the invariant: If priority is empty, then the set of active-Clauses
;; is equisatisfiable with the input-Clauses.
;; In other words active-Clauses U priority is (should be!) equisatisfiable with input-Clauses.
(add-priority-Clauses! input-Clauses)
;; We add the Clauses of the binary rules as candidates, so as to not cluter the active set
;; in case there are many rules.
;; Another option is to add them to the priority queue because they can be seen as possibly
;; useful lemmas.
(when rwtree
; A mock root clause parent of all input rules
(define C0rules (make-Clause (list ltrue) '() #:type 'rules-root))
; rewrite=#false should not be necessary (since rewriting checks if a clause is from the original
(add-candidates! C0rules (rewrite-tree-original-Clauses rwtree)))
(define step 0)
(reset-n-tautologies!)
(define n-parent-discard 0)
(define n-forward-subsumed 0)
(define n-backward-subsumed 0)
(reset-n-binary-rewrites!)
(reset-n-rule-added!)
(reset-subsumes-stats!)
(reset-n-L-resolvent-pruning!)
(define start-time (current-milliseconds))
;; TODO: Some calls are very slow...
(define (make-return-dict status [other '()])
(assert (memq status statuses) status)
(define stop-time (current-milliseconds))
`((status . ,status)
(steps . ,step)
(generated . ,clause-index) ; includes all input clauses and rules and intermediate steps
(actives . ,(length (unification-tree-Clauses utree)))
(candidates . ,(heap-count candidates))
(priority-remaining . ,(queue-length priority))
(tautologies . ,n-tautologies) ; counted in generated, (mostly) not in candidates
,@(rewrite-tree-stats rwtree)
(binary-rewrites . ,n-binary-rewrites)
(forward-subsumed . ,n-forward-subsumed)
(backward-subsumed . ,n-backward-subsumed)
(subsumes-checks . ,n-subsumes-checks)
(subsumes-steps . ,n-subsumes-steps)
(subsumes-breaks . ,n-subsumes-breaks)
(parent-discard . ,n-parent-discard)
(L-resolvent-pruning . ,n-L-resolvent-pruning)
(memory . ,(current-memory-use)) ; doesn't account for GC---this would take too much time
(time . ,(- stop-time start-time))
. ,other))
(define (make-refuted-dict C)
(define proof (Clause-ancestor-graph C)) ; no duplicates
(define flat-proof (flatten proof))
(define type-occs (occurrences flat-proof #:key Clause-type))
(when disp-proof?
(displayln "#| begin-proof")
(display-Clause-ancestor-graph C #:tab " ")
(displayln "end-proof |#"))
(make-return-dict 'refuted
`((proof-length . ,(length flat-proof)) ; doesn't account for compound rewrites
(proof-steps . ,(for/sum ([C2 (in-list flat-proof)])
(define n (length (Clause-parents C2)))
(if (< n 2) n (- n 1))))
(proof-inferences . ,(count (λ (C2) (not (empty? (Clause-parents C2))))
flat-proof))
,@(for/list ([(t o) (in-dict type-occs)])
(cons (string->symbol (format "proof-type:~a" t)) o)))))
;:::::::::::::::::::::;
;:: Saturation Loop ::;
;:::::::::::::::::::::;
(define result
(let loop ()
(++ step)
(define time-passed (- (current-milliseconds) start-time)) ; this is fast
(define mem (current-memory-use-MB)) ; mflatt says it's fast
(when-debug>= steps
(printf "\nstep: ~a generated: ~a processed/s: ~a generated/s: ~a\n"
step
clause-index
(quotient (* 1000 step) (+ 1 time-passed))
(quotient (* 1000 clause-index) (+ 1 time-passed))))
(cond/else
[(and (= 0 (heap-count candidates))
(= 0 (heap-count age-queue))
(= 0 (queue-length priority)))
(when-debug>= steps (displayln "Saturated"))
(make-return-dict 'saturated)]
[(> step step-limit) (make-return-dict 'steps)]
[(> time-passed (* 1000 cpu-limit)) (make-return-dict 'time)]
[(and (> mem memory-limit)
(block
(define pre (current-milliseconds))
;; Memory is full, but try to collect garbage first.
(unless (*quiet-json?*)
(printf "; before GC: memory-limit: ~a memory-use: ~a\n" memory-limit mem))
(collect-garbage)
(collect-garbage)
(define mem2 (current-memory-use-MB))
(define post (current-milliseconds))
(unless (*quiet-json?*)
(printf "; after GC: memory-limit: ~a memory-use: ~a gc-time: ~a\n"
memory-limit mem2 (* 0.001 (- post pre))))
(> mem2 memory-limit)))
; mem is full even after GC, so exit
(make-return-dict 'memory)]
#:else
;; Choose a queue/heap to extract the selected-Clause from.
(define queue
(cond [(> (queue-length priority) 0)
; Always has priority.
priority]
[(or (= 0 (heap-count candidates))
(and (> (heap-count age-queue) 0)
(< (modulo step age+cost-freq) age-freq)))
; TODO: This is somewhat defeated by the `priority` queue.
age-queue]
[else candidates]))
(when-debug>= steps
(printf "Selected queue: ~a\n" (cond [(eq? queue priority) "priority"]
[(eq? queue candidates) "candidates"]
[else "age queue"])))
(define selected-Clause
(if (heap? queue)
(begin0 (heap-min queue)
(heap-remove-min! queue))
(dequeue! queue)))
#:cond
;; ALREADY PROCESSED
[(not (Clause-candidate? selected-Clause))
(when-debug>= steps (displayln "Clause already processed. Skipping."))
(-- step) ; don't count this as a step
(loop)]
;; ONE PARENT DISCARDED
[(and parent-discard? (ormap Clause-discarded? (Clause-parents selected-Clause)))
(when-debug>= steps (displayln "At least one parent has been discarded. Discard too."))
(discard-Clause! selected-Clause)
(++ n-parent-discard)
(loop)]
#:else
(set-Clause-candidate?! selected-Clause #false)
;; FORWARD REWRITE
;; BINARY CLAUSE REWRITE OF SELECTED
;; NOTICE: We do binary rewrites first because if we did unit then binary
;; we would need to attempt a second unit-rewrite after that.
;; (This may lead to unnecessary binary rewrites, but it's cleaner this way.)
(define selected-Clause-brw
(if rwtree
(binary-rewrite-Clause rwtree selected-Clause)
selected-Clause))
(when-debug>= steps
(printf "|\nstep ~a: selected: ~a\n"
step (Clause->string/alone selected-Clause 'all))
(define binary-rewritten? (not (eq? selected-Clause-brw selected-Clause)))
(when binary-rewritten?
(displayln "Binary rewritten:")
(display-Clause-ancestor-graph selected-Clause-brw #:depth 1))
(unless (eq? selected-Clause-brw selected-Clause-brw)
(displayln "Unit rewritten:")
(display-Clause-ancestor-graph selected-Clause-brw #:depth 1))
(when-debug>= interact
(interact-saturation
(priority utree rwtree selected-Clause make-return-dict)
selected-Clause-brw selected-Clause-brw)))
(set! selected-Clause selected-Clause-brw)
;;; From now on, only selected-Clause should be used
(define selected-clause (Clause-clause selected-Clause))
#:cond
;; REFUTED?
[(empty-clause? selected-clause)
(make-refuted-dict selected-Clause)]
;; TAUTOLOGY?
[(clause-tautology? selected-clause)
(when-debug>= steps (displayln "Tautology."))
(discard-Clause! selected-Clause)
(loop)] ; skip clause
;; FORWARD SUBSUMPTION
[(utree-find/any utree selected-Clause Clause-subsumes)
;; TODO: Tests
=>
(λ (C2)
(++ n-forward-subsumed)
(when-debug>= steps (printf "Subsumed by ~a\n" (Clause->string C2 'all)))
(discard-Clause! selected-Clause)
(loop))] ; skip clause
#:else
;; Clause is being processed.
;; BACKWARD SUBSUMPTION
(define removed (utree-inverse-find/remove! utree selected-Clause Clause-subsumes))
(for-each discard-Clause! removed)
(+= n-backward-subsumed (length removed))
(when-debug>= steps
(define n-removed (length removed))
(when (> n-removed 0)
(printf "#backward subsumed: ~a\n" n-removed)
(when-debug>= interact
(print-Clauses removed 'all))))
;; FIND NEW REWRITE RULES
(define clause-index-before-discover clause-index)
(define new-rules (discover-new-rules! rwtree-out selected-Clause utree))
(define new-rule-Clauses (rules-original-Clauses new-rules))
;; NOTICE: We MUST add Clauses that are newly generated to the set of active rules
;; (via priority) otherwise we may miss some resolutions.
;; Only the Clauses that have been created during the discovery process need to be added.
;; Notice: To prevent the clauses from which the rules have originated to be rewritten to
;; tautologies, a test is performed in binary-rewrite-literal.
;; But this applies *only* to the `eq?`-Clause of the rule, hence beware of copies or
;; rewrites.
(add-priority-Clauses!
(filter (λ (C) (> (Clause-idx C) clause-index-before-discover))
new-rule-Clauses))
;; BACKWARD BINARY REWRITING
;; We don't need to backward rewrite if the new rules are not stored in rwtree,
;; as this means the set of used rules does not change during the whole saturation.
(when (and backward-rewrite?
rwtree
(eq? rwtree rwtree-out) ; not storing new rules in a different rwtree
(not (empty? new-rules)))
; Remove active Clauses that can be rewritten, and push them into priority.
; We must check whether the clauses we remove will be rewritten,
; otherwise we might add all the same candidates again when the removed Clause
; is popped from priority.
(define removed-active-Clauses
;; TODO: This is inefficient. We should modify utree-inverse-find/remove!
;; TODO: to handle multiple rule-C so as to take advantage of its hash/cache.
(remove-duplicates
(flatten
(for/list ([rule-C (in-list new-rule-Clauses)])
(utree-inverse-find/remove! utree rule-C
(λ (_rule-C C2)
(binary-rewrite-Clause? rwtree C2)))))
eq?))
(unless (empty? removed-active-Clauses)
(when-debug>= steps
(displayln "Some active Clauses can be backward binary rewritten:")
(print-Clauses removed-active-Clauses))
(add-priority-Clauses! removed-active-Clauses)))
;; Note that backward-rewritable Clauses are not yet discarded. They may be discarded
;; when they are pulled from priority and deemed discardable.
;;; Even if the selected Clause is a unit/binary rewrite rule, we must continue processing it
;;; and generate resolutions (because rewriting is only left-unification, not full unification)
;;; NEW CANDIDATES
(define L-resolvent-pruning-allowed?
(and L-resolvent-pruning?
; As per the invariant, if no Clause is in the priority queue,
; then the set of active Clauses of utree is equisatisfiable with the input clauses.
(= 0 (queue-length priority))))
(define new-Candidates
(if negative-literal-selection?
(utree-resolve+unsafe-factors/select utree selected-Clause
#:rewriter (λ (C) (binary-rewrite-Clause rwtree C)))
(utree-resolve+unsafe-factors utree selected-Clause
#:rewriter (λ (C) (binary-rewrite-Clause rwtree C))
#:L-resolvent-pruning? L-resolvent-pruning-allowed?)))
(when-debug>= interact
(displayln "New candidates:")
(print-Clauses new-Candidates))
;; If a clause has no resolvent with the active set (when complete)
;; then it will never resolve with anything and can thus be discarded.
#:cond
[(and L-resolvent-pruning-allowed?
(empty? new-Candidates))
(discard-Clause! selected-Clause)
(when-debug>= steps
(printf "No resolvent (L-resolvent-pruning?=~a). Clause discarded. \n"
L-resolvent-pruning?))
(loop)]
#:else
;; ADD CLAUSE TO ACTIVES
;; Rewrite the candidates with unit and binary rules, filter out tautologies,
;; calculate their costs and add them to the queues.
(add-candidates! selected-Clause new-Candidates)
;; UNIT RULE DISCOVERY IN CANDIDATES
;; Look for unit rewrite rules in the candidate set.
;; (Looking for binary rules would be too costly here)
(when find-unit-rules-in-candidates?
(when rwtree-out
(for ([C (in-list new-Candidates)])
(when (unit-Clause? C)
;; TODO: Should be calling/merged with discover-rules! to avoid inconsistencies
(rewrite-tree-add-unit-Clause! rwtree-out C #:rewrite? #false)))))
(add-Clause! utree selected-Clause)
(when-debug>= steps
(displayln "Adding clause.")
(print-active-Clauses utree #false))
(loop))))
(when-debug>= interact
(displayln "Saturation loop finished.")
(pretty-print result)
(define selected-Clause #false) ; mock up
(interact-saturation
(priority utree rwtree selected-Clause make-return-dict)))
result)
;========================;
;=== User interaction ===;
;========================;
;; Some commands to use with '--debug interact'. Type 'help' for information.
(define interact-commands '())
(define-namespace-anchor ns-anchor)
(define-syntax-rule (interact-saturation
(priority utree rwtree selected-Clause make-return-dict)
more ...)
(begin
(define what '(idx parents clause-pretty))
(interact
#:command (and (not (empty? interact-commands))
(begin0 (first interact-commands)
(rest! interact-commands)))
#:variables (priority utree rwtree what more ...)
#:namespace-anchor ns-anchor
#:readline? #true
[(list 'steps (? number? n))
"skips n steps"
(when (> n 0)
(cons! "" interact-commands)
(cons! (format "steps ~a" (- n 1)) interact-commands))]
[(list (or 'ancestors 'ancestor-graph 'graph))
"display the ancestor graph of the selected Clause."
(display-Clause-ancestor-graph selected-Clause)]
[(list (or 'ancestors 'ancestor-graph 'graph) (? number? depth))
"display the ancestor graph of the selected Clause down to the given depth."
(display-Clause-ancestor-graph selected-Clause #:depth depth)]
[(list 'what-fields)
(string-append
"Prints which fields are available for 'what,\n"
"which is used for printing clause information.")
(displayln Clause->string-all-fields)]
[(list 'selected)
"Selected clause"
(print-Clauses (list selected-Clause) what)]
[(list 'active)
"Active clauses"
(print-active-Clauses utree #true what)]
[(list (or 'binary 'rules))
"Found binary rules"
(print-binary-rules rwtree #true)]
[(list 'stats)
"Return-dictionary-like stats"
(pretty-print (make-return-dict 'running))]
[(list 'save-rules)
"Save the binary rules from the default rules-file"
(save-rules! rwtree #:rules-file (*output-rules*))])))
;; Prints the set of active Clauses (held in utree).
;;
;; utree : unification-tree?
;; long? : boolean?
;; what : (or/c 'all (listof symbol?))
;; -> void?
(define (print-active-Clauses utree long? [what 'all])
(define actives (unification-tree-Clauses utree))
(printf "#active clauses: ~a\n" (length actives))
(when long?
(displayln "Active clauses:")
(print-Clauses (sort actives < #:key Clause-idx) what)))
;; Prints the set of binary rules.
;;
;; rewrite-tree? boolean? -> void?
(define (print-binary-rules rwtree long?)
(define rules (rewrite-tree-rules rwtree))
(printf "#binary rules: ~a #original clauses: ~a\n"
(length rules)
(length (remove-duplicates (map rule-Clause rules) eq?)))
(when long?
(display-rules (rewrite-tree-rules rwtree))))
;============================;
;=== Iterative saturation ===;
;============================;
;; A struct holding information about a given input formula.
(struct problem (file name clauses [time-used #:mutable] [last-time #:mutable]))
;; file? (or/ #false string?) (listof clause?) -> problem?
(define (make-problem file name clauses)
(problem file name clauses 0 0))
;; Returns the same values as body ... but evaluates time-body ... before returning.
;; The result of time-body ... is discarded.
(define-syntax-rule (with-time-result [(cpu real gc) time-body ...] body ...)
(let-values ([(res cpu real gc) (time-apply (λ () body ...) '())])
time-body ...
(apply values res)))
;; Calls saturation for a set of problems in a loop.
;; Tries again each unsolved problem after multiplying the step-limit by step-limit-factor
;; and so on untill all problems are solved.
;; Loading time from files is *not* taken into account.
;;
;; problems : (listof problem?)
;; saturate : procedure?
;; memory-limit : number?
;; cpu-limit : number?
;; cpu-first-limit : number?
;; cpu-limit-factor? : number?
;; -> void?
(define (iterative-saturation/problem-set problems
saturate
#:! memory-limit
#:! cpu-limit ; in second
#:! cpu-first-limit ; in seconds
#:! cpu-limit-factor) ; in seconds
(define n-problems (length problems))
(define n-attempted 0)
(define n-solved 0)
(with-time-result [(cpu real gc)
(unless (*quiet-json?*)
(printf "; Total time: cpu: ~a real: ~a gc: ~a\n" cpu real gc))]
(let loop ([problems problems] [iter 0])
(define n-unsolved (length problems))
(define n-solved-iter 0)
(define n-attempted-iter 0)
(define new-unsolved
(for/fold ([unsolved '()]
[cumu-time 0]
#:result (reverse unsolved))
([prob (in-list problems)])
(define input-clauses (problem-clauses prob))
(when-debug>= init (for-each (compose displayln clause->string) input-clauses))
;; Collecting garbage can take time even when there's nothing to collect,
;; and can take a significant proportion of the time when solving is fast,
;; hence it's better to trigger GC only if needed.
(when (>= (current-memory-use-MB) (* 0.8 memory-limit))
(collect-garbage)
(collect-garbage))
;; Main call
(define cpu-limit-problem (min (max cpu-first-limit
(* cpu-limit-factor (problem-last-time prob)))
(- cpu-limit (problem-time-used prob))))
(define res (saturate input-clauses cpu-limit-problem))
(set! res (append `((name . ,(problem-name prob))
(file . ,(problem-file prob)))
res))
(++ n-attempted-iter)
(when (= 0 iter) (++ n-attempted))
(define solved? (or (check-status res 'refuted)
(check-status res 'saturated)))
(when solved?
(++ n-solved-iter)
(++ n-solved))
(define last-time (* 0.001 (dict-ref res 'time)))
(set-problem-last-time! prob last-time)
(set-problem-time-used! prob (+ (problem-time-used prob) last-time))
(set! res (dict-set res 'cumulative-time (exact-ceiling (* 1000 (problem-time-used prob)))))
(define remove-problem?
(or solved?
(check-status res 'memory) ; more time won't help if status=memory
(>= (problem-time-used prob) cpu-limit))) ; cpu exhausted for this problem
; Don't pretty-print to keep it on a single line which is simpler for parsing.
; Only print the last iteration of a problem for borg.
(cond
[(*quiet-json?*)
(when remove-problem? (displayln (saturation-result->json res)))]
[else
(pretty-write res)
(printf "; ~a/~a solved (iter: ~a/~a/~a success: ~a% avg-time: ~as ETA: ~as)\n"
n-solved n-attempted
n-solved-iter n-attempted-iter n-unsolved
(~r (* 100 (/ n-solved-iter n-attempted-iter)) #:precision '(= 1))
(~r (/ cumu-time n-attempted-iter 1000.) #:precision '(= 3))
(~r (* (/ cumu-time n-attempted-iter 1000.)
(- n-unsolved n-attempted-iter)) #:precision '(= 2)))])
(flush-output)
(values
(if remove-problem?
unsolved
(cons prob unsolved))
(+ cumu-time last-time))))
(unless (or (empty? new-unsolved)
(= cpu-limit-factor 0))
(loop new-unsolved (+ iter 1))))))
;; Calls saturate on a single set of clauses, first with a time limit of cpu-first-limit,
;; then restarts and doubles it until the cumulative time reaches cpu-limit.
;; Loading time is taken into account.
;; During a call to saturate, the new rewrite rules are saved in a separate tree,
;; which means that no new rule is introduced until the next restart—and thus the first
;; call to saturate uses no rewrite rule.
;;
;; NOTICE: In this mode the unit rewrites are gathered only for the next round, but this is
;; likely not necessary!
;;
;; saturate : procedure?
;; tptp-program : string?
;; rwtree-in : rewrite-tree?
;; discover-online? : boolean?
;; cpu-limit : number?
;; cpu-first-limit : number?
;; cpu-limit-factor? : number?
;; -> void?
(define (iterative-saturation saturate
#:! tptp-program
#:! rwtree-in
#:? [discover-online? (*discover-online?*)]
#:? [cpu-limit (*cpu-limit*)]
#:? [cpu-first-limit (*cpu-first-limit*)]
#:? [cpu-limit-factor (*cpu-limit-factor*)])
(define cpu-start (current-inexact-seconds))
; Don't make new Clauses here, they need to be created at each `saturation` call.
(define clauses (tptp-prog->clauses tptp-program))
(define quiet? (*quiet-json?*))
(define n-rules-init (rewrite-tree-count rwtree-in))
(let loop ([iter 1] [uncapped-current-cpu-limit cpu-first-limit] [rwtree-in rwtree-in])
(define remaining-cpu (- cpu-limit (- (current-inexact-seconds) cpu-start)))
(define current-cpu-limit (min remaining-cpu uncapped-current-cpu-limit))
(unless quiet?
(printf "; iter: ~a remaining-cpu: ~a current-cpu-limit: ~a\n"
iter
remaining-cpu
current-cpu-limit))
; Simplify the set of rules (only once)
(unless (and (= 1 iter)
(= 0 n-rules-init)) ; don't do this if no restarting
; Note that these steps destroy the Clause ancestry, and proofs will be incomplete.
(unless quiet?
(printf "; Rules stats: ~v\n" (rewrite-tree-stats rwtree-in))
(displayln "; Simplifying the rules via re-add-rules!"))
;; Rewrite lhs and rhs of rules, remove subsumed and tautologies.
(re-add-rules! rwtree-in)
(unless quiet?
(printf "; Rules stats: ~v\n" (rewrite-tree-stats rwtree-in))
(printf "; Confluence! bounded? = ~a\n" (*bounded-confluence?*)))
;; Unify rhs of rules to produce new rules.
(rewrite-tree-confluence! rwtree-in)
(unless quiet?
(printf "; Rules stats: ~v\n" (rewrite-tree-stats rwtree-in))
(displayln "; Simplifying the rules via re-add-rules! (again)"))
;; Rewrite and simplify again.
(re-add-rules! rwtree-in)
(unless quiet? (printf "; Rules stats: ~v\n" (rewrite-tree-stats rwtree-in))))
(flush-output)
(define rwtree-out (if discover-online? rwtree-in (rewrite-tree-shallow-copy rwtree-in)))
(define res (saturate #:clauses clauses
#:cpu-limit current-cpu-limit
#:rwtree-in rwtree-in
#:rwtree-out rwtree-out))
(define new-cumulative-cpu (- (current-inexact-seconds) cpu-start))
(set! res (dict-set res 'cumulative-time (exact-ceiling (* 1000. new-cumulative-cpu)))) ; ms
(set! res (dict-set res 'saturation-iter iter))
(define solved? (or (check-status res 'refuted)
(check-status res 'saturated)))
;; We exit also if memory limit has been reached, but we could instead restart
;; if new rules have been found.
(define finished? (or solved?
(check-status res 'memory)
(> new-cumulative-cpu cpu-limit)))
(cond
[(*quiet-json?*)
(when finished? (displayln (saturation-result->json res)))]
[else
(pretty-write res)])
(flush-output)
(cond
[finished?
(when (*output-rules*)
(unless quiet?
(printf "Saving rules to ~a\n"
(if (string? (*output-rules*))
(*output-rules*)
(path->string (*output-rules*)))))
(save-rules! rwtree-out #:rules-file (*output-rules*)))]
[else
(loop (+ iter 1)
(* uncapped-current-cpu-limit cpu-limit-factor)
rwtree-out)])))
| true |
a4105e25ec2aee6fafd7c3d70ca4b40a87fa91c9 | 6858cbebface7beec57e60b19621120da5020a48 | /15/3/3/3.rkt | e94a9b58e50ae420ba17a8e78b65829be029808d | []
| no_license | ponyatov/PLAI | a68b712d9ef85a283e35f9688068b392d3d51cb2 | 6bb25422c68c4c7717b6f0d3ceb026a520e7a0a2 | refs/heads/master | 2020-09-17T01:52:52.066085 | 2017-03-28T07:07:30 | 2017-03-28T07:07:30 | 66,084,244 | 2 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 64 | rkt | 3.rkt | (define-type Constraints
[eqCon (lhs : Term) (rhs : Term)])
| false |
220cd0082b7a853b9a3c311b0acefb9d87b5b050 | d755de283154ca271ef6b3b130909c6463f3f553 | /htdp-lib/lang/error.rkt | 82f8eed4447f8cf14eae394987cea55c29313737 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"Apache-2.0"
]
| permissive | racket/htdp | 2953ec7247b5797a4d4653130c26473525dd0d85 | 73ec2b90055f3ab66d30e54dc3463506b25e50b4 | refs/heads/master | 2023-08-19T08:11:32.889577 | 2023-08-12T15:28:33 | 2023-08-12T15:28:33 | 27,381,208 | 100 | 90 | NOASSERTION | 2023-07-08T02:13:49 | 2014-12-01T13:41:48 | Racket | UTF-8 | Racket | false | false | 3,049 | rkt | error.rkt | (module error mzscheme
(require mzlib/etc mzlib/list)
;; --------------------------------------------------------------------------
(provide
check-arg
check-arity
check-proc
check-result
check-list-list
find-non
;; --- error constants
result-error ; String[format: String[expected], Any[given]]
arg-error ; String [format: String[expected], String[position] Any[given]]
arity-error ; String [format: String[expected] Any[given]]
proc-error ; String [format: String[expected] Any[given]]
arity-error2 ; String [format: String[expected], String[position] Number[given]]
)
;; (_ -> Boolean) (listof X) -> (union X false)
(define (find-non pred? l)
(let ([r (filter (compose not pred?) l)])
(if (null? r) #f (car r))))
#| Tests ------------------------------------------------------------------
(not (find-non list? '((1 2 3) (a b c))))
(symbol? (find-non number? '(1 2 3 a)))
(symbol? (find-non list? '((1 2 3) a (b c))))
|#
;; Symbol (union true String) String X -> void
(define (check-list-list pname condition pred given)
(when (string? condition)
(error pname (string-append condition (format "\nin ~e" given)))))
;; Symbol (_ -> Boolean) String X -> X
(define (check-result pname pred? expected given)
(if (pred? given) given (error pname result-error expected given)))
;; String[format: String[expected], Any[given]
(define result-error "expected ~a result, given: ~e")
;; check-arg : sym bool str str TST -> void
(define (check-arg pname condition expected arg-posn given)
(unless condition (error pname arg-error expected arg-posn given)))
;; String [format: String[expected], String[position] Any[given]
(define arg-error "expected <~a> as ~a argument, given: ~e")
;; check-arity : sym num (list-of TST) -> void
(define (check-arity name arg# args)
(let ([x (length args)])
(if (>= x arg#) (void) (error name arity-error arg# x))))
;; String [format: String[expected] Any[given]
(define arity-error "expects at least ~a arguments, given ~e")
;; String [format: String[expected] Any[given]
(define proc-error "a function was expected as ~s argument, given ~e")
;; check-proc :
;; sym (... *->* ...) num (union sym str) (union sym str) -> void
(define (check-proc proc f exp-arity arg# arg-err)
(unless (procedure? f) (error proc proc-error arg# f))
(unless (procedure-arity-includes? f exp-arity)
(let ([arity-of-f (procedure-arity f)])
(error proc arity-error2
arg-err arg#
(cond
[(number? arity-of-f)
(if (= arity-of-f 1)
(format "1 argument")
(format "~s arguments" arity-of-f))]
[(arity-at-least? arity-of-f) (format "at least ~s arguments" (arity-at-least-value arity-of-f))]
[else (format "multiple arities (~s)" arity-of-f)])))))
;; String [format: String[expected], String[position] Number[given]
(define arity-error2 "a function that expects ~a expected as ~s argument, given a function that expects ~a ")
)
| false |
57a4a16c85b72fd266ecb49e8f09f10977291605 | 5f83eb0c32f15aeed5993a3ad5ededb6f31fe7aa | /racket/x86/common.rkt | 9704d65ec45cf283477d97da21cf320194caa422 | []
| no_license | uw-unsat/jitterbug | 45b54979b156c0f5330012313052f8594abd6f14 | 78d1e75ad506498b585fbac66985ff9d9d05952d | refs/heads/master | 2023-07-11T09:15:21.433725 | 2023-06-18T04:10:48 | 2023-07-03T20:12:41 | 244,440,882 | 46 | 5 | null | null | null | null | UTF-8 | Racket | false | false | 418 | rkt | common.rkt | #lang rosette
(require
(prefix-in core: serval/lib/core))
(provide (all-defined-out))
; Ensure that expr is concretely true.
(define (static-assert expr msg)
(unless expr
(eprintf "static assertion failed: ~a" msg)
(exit 1)))
; Simplify e1 with e2 and return e2.
; This is used to rewrite REX and ModR/M bytes.
(define (simplify-with e1 e2 #:msg msg)
(core:bug-on (! (equal? e1 e2)) #:msg msg)
e2)
| false |
9494d579b750f768aac63c494058adb9d260fee2 | f07e5e2d974bef9f157e58954e48e4711b29a038 | /Ex3.81.rkt | 19259069622bf302d1923c5abf5a9120e391c0a2 | []
| no_license | ayushgoel/SICP-Excercises | 92cb99b7ac84aead36b7f4237c84131f49a97367 | 2214bb28758c3eed14568c97367f1e6ab8c28210 | refs/heads/master | 2016-09-06T14:38:05.284230 | 2014-05-22T07:46:16 | 2014-05-22T07:46:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Racket | false | false | 758 | rkt | Ex3.81.rkt | #lang racket
(require "stream-memoized.rkt")
(define random-init 11)
(define (random-update x)
(remainder (+ (* 13 x) 5) 24))
(define (random-number-generator req)
(define (f x y)
(if (= x 0)
(random-update y)
(random-update random-init)))
(define seq
(cons-stream random-init
(stream-map f
req
seq)))
seq)
(define ones (cons-stream 1 ones))
(define zeroes (cons-stream 0 zeroes))
(define (interleave s1 s2)(if (stream-null? s1)
s2
(cons-stream (stream-car s1)
(interleave s2 (stream-cdr s1)))))
(define in (interleave (interleave ones zeroes) zeroes))
(define out (random-number-generator in))
(stream-take out 10) | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.