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
186d6f5ebbaaa3dad99dc54a7799fac7f9f51113
c852b3f8e53b2a515abc4e45f53e4f7fa2e13613
/anf-mut/fib.scm
dec950d7032531b907327b776a8542c43c4335d2
[]
no_license
acieroid/abstract-benchmarks
81d988aa5e65a1c2601244f8bedbf2d29563ff35
f4abc6550d121b2fd1618ff20f476b97e565aed9
refs/heads/master
2020-04-04T15:07:56.682077
2014-12-01T16:00:32
2014-12-01T16:00:32
26,171,263
0
1
null
null
null
null
UTF-8
Scheme
false
false
322
scm
fib.scm
;; Expected result: 21 (let ((fib (lambda (n) (let ((a 0)) (let ((b 1)) (letrec ((loop (lambda (x) (let ((_16 (= x n))) (if _16 a (let ((olda a)) (let ((_17 (set! a b))) (let ((_20 (+ olda b))) (let ((_19 _20)) (let ((_18 (set! b _19))) (let ((_21 (+ x 1))) (let ((_22 (loop _21))) _22)))))))))))) (loop 0))))))) (fib 8))
false
54d0018705edede74da94c997d7b466bcb739d4e
b1b1e288efe8621f2bf2c8bc3eea9e30fc251501
/experiments/lift.ss
d1efed279c2eedfcb205f1db76555b4a62819b5e
[ "ISC" ]
permissive
lojikil/hydra
37e32a43afc2443e29a73387fe796b559756a957
366cae2e155c6e4d5e27ad19d3183687a40c82a3
refs/heads/master
2020-05-30T08:41:19.374996
2014-11-13T03:10:22
2014-11-13T03:10:22
58,539,402
5
0
null
null
null
null
UTF-8
Scheme
false
false
934
ss
lift.ss
#!/usr/bin/env vesta ;; simple test of lambda lifting ;; uses everything defined in free.ss ;; to determine which items to add to ;; lifted lambda, and which calls to ;; rewrite (load 'free.ss) (define (walk-lambda! code lambda-info bounds) "walks a define object for lambdas to lift" (if (null? code) #v (let* ((obj (car code)) ;; really need an check here to see if this is actually a lambda (ret (collect-free-vars obj bounds '() '()))A (nu-bounds (append (car ret) bounds))) (cset! lambda-info name ret) (walk-lambda! (cdr code) lambda-info nu-bounds)))) (define (lift-lambda code lm) "does the actual work of lifting a lambda" #f) (define (rewrite-call code lms) "returns a call rewritten with all parameters filled" ;; lifted lambda: foo, params: x,y, free: z ;; original code: (foo x y) ;; new code: (foo x y z) #f)
false
bd78e25be75d4eca12efff91895826bf948ad76e
acc632afe0d8d8b94b781beb1442bbf3b1488d22
/deps/sdl2/lib/sdl2-internals/extras/rect.scm
2d969990a61955376847befaf953587e4124fd15
[ "BSD-2-Clause", "BSD-3-Clause" ]
permissive
kdltr/life-is-so-pretty
6cc6e6c6e590dda30c40fdbfd42a5a3a23644794
5edccf86702a543d78f8c7e0f6ae544a1b9870cd
refs/heads/master
2021-01-20T21:12:00.963219
2016-05-13T12:19:02
2016-05-13T12:19:02
61,128,206
1
0
null
null
null
null
UTF-8
Scheme
false
false
8,345
scm
rect.scm
;; ;; chicken-sdl2: CHICKEN Scheme bindings to Simple DirectMedia Layer 2 ;; ;; Copyright © 2013, 2015-2016 John Croisant. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions ;; are met: ;; ;; - Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; ;; - Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in ;; the documentation and/or other materials provided with the ;; distribution. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS ;; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ;; COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, ;; INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ;; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, ;; STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED ;; OF THE POSSIBILITY OF SUCH DAMAGE. (export make-rect make-rect* rect-set! rect->list rect->values rect-copy! rect-copy copy-rect copy-rect* rect-scale! rect-scale rect-unscale! rect-unscale rect-move! rect-move rect-add-point! rect-add-point rect-sub-point! rect-sub-point rect-grow! rect-grow rect-grow/center! rect-grow/center rect-lerp! rect-lerp rect-lerp-xy! rect-lerp-xy) (define %%rect-set! (foreign-lambda* void ((SDL_Rect* r) (Sint32 x) (Sint32 y) (Sint32 w) (Sint32 h)) "r->x = x; r->y = y; r->w = w; r->h = h;")) (: %rect-set! (sdl2:rect* fixnum fixnum fixnum fixnum -> void)) (define (%rect-set! rect x y w h) (%%rect-set! rect (%rect-x-guard x) (%rect-y-guard y) (%rect-w-guard w) (%rect-h-guard h))) (: make-rect (#!optional fixnum fixnum fixnum fixnum -> sdl2:rect)) (define (make-rect #!optional (x 0) (y 0) (w 0) (h 0)) (let ((rect (alloc-rect))) (%rect-set! rect x y w h) rect)) (: make-rect* (#!optional fixnum fixnum fixnum fixnum -> sdl2:rect)) (define (make-rect* #!optional (x 0) (y 0) (w 0) (h 0)) (let ((rect (alloc-rect*))) (%rect-set! rect x y w h) rect)) (: rect-set! (sdl2:rect* #!optional fixnum fixnum fixnum fixnum -> sdl2:rect*)) (define (rect-set! rect #!optional x y w h) (if (and x y w h) (%rect-set! rect x y w h) (begin (when x (rect-x-set! rect x)) (when y (rect-y-set! rect y)) (when w (rect-w-set! rect w)) (when h (rect-h-set! rect h)))) rect) (: rect->list (sdl2:rect* -> (list fixnum fixnum fixnum fixnum))) (define (rect->list rect) (list (rect-x rect) (rect-y rect) (rect-w rect) (rect-h rect))) (: rect->values (sdl2:rect* -> fixnum fixnum fixnum fixnum)) (define (rect->values rect) (values (rect-x rect) (rect-y rect) (rect-w rect) (rect-h rect))) (define %rect-copy! (foreign-lambda* void ((SDL_Rect* src) (SDL_Rect* dest)) "*dest = *src;")) (define (rect-copy! src dest) (%rect-copy! src dest) dest) (define (rect-copy rect) (rect-copy! rect (alloc-rect))) ;;; Deprecated, backward compatibility alias. (define copy-rect rect-copy) ;;; Deprecated. (define (copy-rect* rect) (rect-copy! rect (alloc-rect*))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; RECT MATH (define-function-binding chickenSDL2_RectScale_i args: ((SDL_Rect* r) (Sint32 scale) (SDL_Rect* dest))) (define-function-binding chickenSDL2_RectScale_d args: ((SDL_Rect* r) (double scale) (SDL_Rect* dest))) (: rect-scale! (sdl2:rect* number #!optional sdl2:rect* -> sdl2:rect*)) (define (rect-scale! r scale #!optional (dest r)) (if (integer? scale) (chickenSDL2_RectScale_i r scale dest) (chickenSDL2_RectScale_d r scale dest)) dest) (: rect-scale (sdl2:rect* number -> sdl2:rect*)) (define (rect-scale r scale) (rect-scale! r scale (alloc-rect))) (define-function-binding chickenSDL2_RectUnscale_i args: ((SDL_Rect* r) (Sint32 scale) (SDL_Rect* dest))) (define-function-binding chickenSDL2_RectUnscale_d args: ((SDL_Rect* r) (double scale) (SDL_Rect* dest))) (: rect-unscale! (sdl2:rect* number #!optional sdl2:rect* -> sdl2:rect*)) (define (rect-unscale! r scale #!optional (dest r)) (when (zero? scale) (error 'rect-unscale! "Division by 0")) (if (integer? scale) (chickenSDL2_RectUnscale_i r scale dest) (chickenSDL2_RectUnscale_d r scale dest)) dest) (: rect-unscale (sdl2:rect* number -> sdl2:rect*)) (define (rect-unscale r scale) (when (zero? scale) (error 'rect-unscale "Division by 0")) (rect-unscale! r scale (alloc-rect))) (define-function-binding chickenSDL2_RectMove args: ((SDL_Rect* r) (Sint32 dx) (Sint32 dy) (SDL_Rect* dest))) (: rect-move! (sdl2:rect* fixnum fixnum #!optional sdl2:rect* -> sdl2:rect*)) (define (rect-move! r dx dy #!optional (dest r)) (chickenSDL2_RectMove r dx dy dest) dest) (: rect-move (sdl2:rect* fixnum fixnum -> sdl2:rect*)) (define (rect-move r x y) (rect-move! r x y (alloc-rect))) (define-function-binding chickenSDL2_RectAddPoint args: ((SDL_Rect* r) (SDL_Point* p) (SDL_Rect* dest))) (: rect-add-point! (sdl2:rect* sdl2:point* #!optional sdl2:rect* -> sdl2:rect*)) (define (rect-add-point! r p #!optional (dest r)) (chickenSDL2_RectAddPoint r p dest) dest) (: rect-add-point (sdl2:rect* sdl2:point* -> sdl2:rect*)) (define (rect-add-point r p) (rect-add-point! r p (alloc-rect))) (define-function-binding chickenSDL2_RectSubPoint args: ((SDL_Rect* r) (SDL_Point* p) (SDL_Rect* dest))) (: rect-sub-point! (sdl2:rect* sdl2:point* #!optional sdl2:rect* -> sdl2:rect*)) (define (rect-sub-point! r p #!optional (dest r)) (chickenSDL2_RectSubPoint r p dest) dest) (: rect-sub-point (sdl2:rect* sdl2:point* -> sdl2:rect*)) (define (rect-sub-point r p) (rect-sub-point! r p (alloc-rect))) (define-function-binding chickenSDL2_RectGrow args: ((SDL_Rect* r) (Sint32 dw) (Sint32 dh) (SDL_Rect* dest))) (: rect-grow! (sdl2:rect* fixnum fixnum #!optional sdl2:rect* -> sdl2:rect*)) (define (rect-grow! r dw dh #!optional (dest r)) (chickenSDL2_RectGrow r dw dh dest) dest) (: rect-grow (sdl2:rect* fixnum fixnum -> sdl2:rect*)) (define (rect-grow r w h) (rect-grow! r w h (alloc-rect))) (define-function-binding chickenSDL2_RectGrowCenter args: ((SDL_Rect* r) (Sint32 dw) (Sint32 dh) (SDL_Rect* dest))) (: rect-grow! (sdl2:rect* fixnum fixnum #!optional sdl2:rect* -> sdl2:rect*)) (define (rect-grow/center! r w h #!optional (dest r)) (chickenSDL2_RectGrowCenter r w h dest) dest) (: rect-grow/center (sdl2:rect* fixnum fixnum -> sdl2:rect*)) (define (rect-grow/center r w h) (rect-grow/center! r w h (alloc-rect))) (define-function-binding chickenSDL2_RectLerp args: ((SDL_Rect* r1) (SDL_Rect* r2) (double t) (SDL_Rect* dest))) (: rect-lerp! (sdl2:rect* sdl2:rect* float #!optional sdl2:rect* -> sdl2:rect*)) (define (rect-lerp! r1 r2 t #!optional (dest r1)) (chickenSDL2_RectLerp r1 r2 t dest) dest) (: rect-lerp (sdl2:rect* sdl2:rect* float -> sdl2:rect*)) (define (rect-lerp r1 r2 t) (rect-lerp! r1 r2 t (alloc-rect))) (define-function-binding chickenSDL2_RectLerpXY args: ((SDL_Rect* r1) (SDL_Rect* r2) (double t) (SDL_Rect* dest))) (: rect-lerp-xy! (sdl2:rect* sdl2:rect* float #!optional sdl2:rect* -> sdl2:rect*)) (define (rect-lerp-xy! r1 r2 t #!optional (dest r1)) (chickenSDL2_RectLerpXY r1 r2 t dest) dest) (: rect-lerp-xy (sdl2:rect* sdl2:rect* float -> sdl2:rect*)) (define (rect-lerp-xy r1 r2 t) (rect-lerp-xy! r1 r2 t (alloc-rect)))
false
d1adeeeb4d82f6303e2e4f4479b48bffb93c27b8
a9d1a0e915293c3e6101e598b3f8fc1d8b8647a9
/scheme/chapter16.scm
52952fc1a2964a1bb3c5b4fb71222d530d13a339
[]
no_license
mbillingr/raytracing
a3b5b988007536a7065e51ef2fc17e6b5ac44d43
9c786e5818080cba488d3795bc6777270c505e5e
refs/heads/master
2021-04-16T17:10:40.435285
2020-11-11T07:02:18
2020-11-11T07:02:18
249,372,261
2
4
null
null
null
null
UTF-8
Scheme
false
false
1,330
scm
chapter16.scm
(import (scheme base) (scheme write) (scheme file) (raytrace tuple) (raytrace canvas) (raytrace shapes) (raytrace matrix) (raytrace lights) (raytrace material) (raytrace transformations) (raytrace constants) (raytrace camera) (raytrace world) (raytrace csg)) (define floor-material (material (color 1 0.9 0.9) 0.3 0.9 0.0 100.0)) (define floor (plane)) (floor 'set-material! floor-material) (define a (cube)) (a 'set-material! (material (color 0.2 0.5 1) 0.3 0.9 0.2 50)) (define b (sphere)) (b 'set-material! (material (color 1 0.5 0.2) 0.3 0.9 0.2 50)) (b 'set-transform! (translation 0.5 0.5 -0.5)) (define c (csg csg-difference a b)) (c 'set-transform! (translation 0 1 0)) (define world (make-world (list floor c) (list (point-light (point -8 10 -9) (color 1 1 1))))) (define camera (make-camera 320 160 (/ PI 3))) (camera 'set-transform! (view-transform (point -1.5 4 -5) (point 0 1 0) (vec 0 1 0))) (define image (camera 'render world)) (call-with-output-file "chapter16.ppm" (lambda (f) (display (canvas->ppm image) f)))
false
6e8ee592bea65ced5fd5e3090e9f8c8ecf45b24f
d881dacf2327ecd474f11318ea8e2b9536fe3e73
/admin/back-up-srfi-email.scm
fc80e241b28ebfb458a4bd87122342a336197074
[ "MIT" ]
permissive
scheme-requests-for-implementation/srfi-common
a84c7eaa6a40a4d1b80ef723759c2d3aed480177
78b45ab8028cfbd462fb1231cafec4ff4c5c5d30
refs/heads/master
2023-07-19T23:14:26.615668
2023-07-14T18:03:06
2023-07-14T18:03:06
37,961,335
31
7
MIT
2023-05-11T13:57:14
2015-06-24T04:00:50
HTML
UTF-8
Scheme
false
false
6,200
scm
back-up-srfi-email.scm
;; <> Automate extracting these numbers from the <option> lists on ;; <https://www.simplelists.com/members/managelists.php>. (define srfi-lists '((44023 schemecomm) (40839 schemedoc) (55556 schemeorg) (43635 schemepersist) (52770 schemeregistry) (53612 schemetest) (40711 schemeweb) (13735 srfi-0) (13813 srfi-1) (13815 srfi-2) (13823 srfi-3) (13825 srfi-4) (13827 srfi-5) (13829 srfi-6) (13831 srfi-7) (13833 srfi-8) (13835 srfi-9) (13837 srfi-10) (13839 srfi-11) (13841 srfi-12) (13843 srfi-13) (13845 srfi-14) (13847 srfi-15) (13849 srfi-16) (13851 srfi-17) (13853 srfi-18) (13855 srfi-19) (13857 srfi-20) (13859 srfi-21) (13861 srfi-22) (13863 srfi-23) (13865 srfi-24) (13867 srfi-25) (13869 srfi-26) (13871 srfi-27) (13873 srfi-28) (13875 srfi-29) (13877 srfi-30) (13879 srfi-31) (13881 srfi-32) (13883 srfi-33) (13885 srfi-34) (13887 srfi-35) (13889 srfi-36) (13891 srfi-37) (13893 srfi-38) (13895 srfi-39) (13897 srfi-40) (13899 srfi-41) (13901 srfi-42) (13903 srfi-43) (13905 srfi-44) (13907 srfi-45) (13909 srfi-46) (13911 srfi-47) (13913 srfi-48) (13915 srfi-49) (13917 srfi-50) (13919 srfi-51) (13921 srfi-52) (13923 srfi-53) (13925 srfi-54) (13927 srfi-55) (13929 srfi-56) (13931 srfi-57) (13933 srfi-58) (13935 srfi-59) (13937 srfi-60) (13939 srfi-61) (13941 srfi-62) (13943 srfi-63) (13945 srfi-64) (13947 srfi-65) (13949 srfi-66) (13951 srfi-67) (13953 srfi-68) (13955 srfi-69) (13957 srfi-70) (13959 srfi-71) (13961 srfi-72) (13963 srfi-73) (13965 srfi-74) (13967 srfi-75) (13969 srfi-76) (13971 srfi-77) (13973 srfi-78) (13975 srfi-79) (13977 srfi-80) (13979 srfi-81) (13981 srfi-82) (13983 srfi-83) (13985 srfi-84) (13987 srfi-85) (13989 srfi-86) (13991 srfi-87) (13993 srfi-88) (13995 srfi-89) (13997 srfi-90) (13999 srfi-91) (14001 srfi-92) (14003 srfi-93) (14005 srfi-94) (14007 srfi-95) (14009 srfi-96) (14011 srfi-97) (14013 srfi-98) (14015 srfi-99) (14017 srfi-100) (14019 srfi-101) (14021 srfi-102) (14023 srfi-103) (14025 srfi-104) (14027 srfi-105) (14029 srfi-106) (14031 srfi-107) (14033 srfi-108) (14035 srfi-109) (14037 srfi-110) (14039 srfi-111) (14041 srfi-112) (14043 srfi-113) (14045 srfi-114) (14047 srfi-115) (14049 srfi-116) (14051 srfi-117) (14053 srfi-118) (14055 srfi-119) (14057 srfi-120) (14059 srfi-121) (15299 srfi-122) (15499 srfi-123) (15771 srfi-124) (15777 srfi-125) (15781 srfi-126) (16753 srfi-127) (17463 srfi-128) (17941 srfi-129) (17985 srfi-130) (17999 srfi-131) (18043 srfi-132) (18079 srfi-133) (18081 srfi-134) (20057 srfi-135) (20281 srfi-136) (20433 srfi-137) (20559 srfi-138) (20577 srfi-139) (20653 srfi-140) (21241 srfi-141) (21447 srfi-142) (21449 srfi-143) (21451 srfi-144) (22997 srfi-145) (22999 srfi-146) (23079 srfi-147) (23137 srfi-148) (23139 srfi-149) (23165 srfi-150) (24685 srfi-151) (25085 srfi-152) (25413 srfi-153) (25457 srfi-154) (25465 srfi-155) (25561 srfi-156) (25633 srfi-157) (25937 srfi-158) (26029 srfi-159) (35121 srfi-160) (36607 srfi-161) (36665 srfi-162) (37765 srfi-163) (37805 srfi-164) (39919 srfi-165) (40603 srfi-166) (40815 srfi-167) (40817 srfi-168) (40819 srfi-169) (41295 srfi-170) (42231 srfi-171) (42459 srfi-172) (42843 srfi-173) (43709 srfi-174) (43745 srfi-175) (44027 srfi-176) (44167 srfi-177) (46109 srfi-178) (46415 srfi-179) (46727 srfi-180) (47333 srfi-181) (47449 srfi-182) (47451 srfi-183) (47453 srfi-184) (47543 srfi-185) (47805 srfi-186) (47841 srfi-187) (48575 srfi-188) (48693 srfi-189) (48719 srfi-190) (49033 srfi-191) (49039 srfi-192) (49141 srfi-193) (49452 srfi-194) (49454 srfi-195) (49762 srfi-196) (50622 srfi-197) (50842 srfi-198) (51884 srfi-199) (51886 srfi-200) (51888 srfi-201) (51890 srfi-202) (52098 srfi-203) (52192 srfi-204) (52340 srfi-205) (52864 srfi-206) (52900 srfi-207) (53576 srfi-208) (53578 srfi-209) (53588 srfi-210) (53856 srfi-211) (54100 srfi-212) (54280 srfi-213) (54396 srfi-214) (54940 srfi-215) (54964 srfi-216) (55606 srfi-217) (55608 srfi-218) (56616 srfi-219) (56676 srfi-220) (56800 srfi-221) (57160 srfi-222) (58492 srfi-223) (58792 srfi-224) (65946 srfi-225) (67074 srfi-226) (67500 srfi-227) (67590 srfi-228) (67592 srfi-229) (67618 srfi-230) (71128 srfi-231) (71130 srfi-232) (83992 srfi-233) (83994 srfi-234) (83996 srfi-235) (84784 srfi-236) (84916 srfi-237) (85612 srfi-238) (85652 srfi-239) (85660 srfi-240) (85740 srfi-241) (85814 srfi-242) (85880 srfi-243) (86070 srfi-244) (13631 srfi-announce) (13133 srfi-discuss) (13633 srfi-editors) (42845 stickers))) (define (back-up-list id name session) (define (cookie token) `("Cookie" . ,(format #f "simplelists.session=~A" session))) (define (mbox name) (format #f "~A.mbox" name)) (define (url id) (format #f "https://www.simplelists.com/members/listsettings.php?download=~A" id)) (newline) (display name) (curl-http-get (list (cookie session)) (url id) (mbox name))) ; Extract the <simplelists.session> cookie value by logging into the Simplelists ; site and extracting the cookie from the browser. Pass it to ; `back-up-srfi-email'. Make sure that you're in the destination directory ; before running this. (define (back-up-srfi-email session) (for-each (lambda (l) (back-up-list (car l) (cadr l) session)) srfi-lists))
false
84b269e07e630975e2f54655bc16190654bfea82
6b961ef37ff7018c8449d3fa05c04ffbda56582b
/bbn_cl/mach/cl/arith.scm
02259e6400b845351af944d15f1795329ba206f5
[]
no_license
tinysun212/bbn_cl
7589c5ac901fbec1b8a13f2bd60510b4b8a20263
89d88095fc2a71254e04e57cf499ae86abf98898
refs/heads/master
2021-01-10T02:35:18.357279
2015-05-26T02:44:00
2015-05-26T02:44:00
36,267,589
4
3
null
null
null
null
UTF-8
Scheme
false
false
15,549
scm
arith.scm
;;; ******** ;;; ;;; Copyright 1992 by BBN Systems and Technologies, A division of Bolt, ;;; Beranek and Newman Inc. ;;; ;;; Permission to use, copy, modify and distribute this software and its ;;; documentation is hereby granted without fee, provided that the above ;;; copyright notice and this permission appear in all copies and in ;;; supporting documentation, and that the name Bolt, Beranek and Newman ;;; Inc. not be used in advertising or publicity pertaining to distribution ;;; of the software without specific, written prior permission. In ;;; addition, BBN makes no respresentation about the suitability of this ;;; software for any purposes. It is provided "AS IS" without express or ;;; implied warranties including (but not limited to) all implied warranties ;;; of merchantability and fitness. In no event shall BBN be liable for any ;;; special, indirect or consequential damages whatsoever resulting from ;;; loss of use, data or profits, whether in an action of contract, ;;; negligence or other tortuous action, arising out of or in connection ;;; with the use or performance of this software. ;;; ;;; ******** ;;; ;;; ;;; Access to common lisp generic arithmetic primitives. (export '(* + - / /= 1+ 1- < <= = > >= abs acos acosh asin asinh atan atanh ceiling cis conjugate cos cosh complex denominator evenp exp expt fceiling ffloor floor fround ftruncate gcd imagpart isqrt log lcm max min minusp mod numerator oddp phase plusp rational rationalize realpart rem round signum sin sinh sqrt tan tanh truncate zerop)) (cl-define complex (make-primitive-procedure 'make-complex)) (cl-define realpart (make-primitive-procedure 'realpart)) (cl-define imagpart (make-primitive-procedure 'imagpart)) (cl-define numerator (make-primitive-procedure 'ratio-numerator)) (cl-define denominator (make-primitive-procedure 'ratio-denominator)) (cl-define zerop (make-primitive-procedure 'generic-zerop)) (cl-define plusp (make-primitive-procedure 'generic-plusp)) (cl-define minusp (make-primitive-procedure 'generic-minusp)) (cl-define oddp (make-primitive-procedure 'generic-oddp)) (cl-define evenp (make-primitive-procedure 'generic-evenp)) (cl-define = (make-primitive-procedure 'generic-=)) (cl-define /= (make-primitive-procedure 'generic-/=)) (cl-define < (make-primitive-procedure 'generic-<)) (cl-define > (make-primitive-procedure 'generic->)) (cl-define <= (make-primitive-procedure 'generic-<=)) (cl-define >= (make-primitive-procedure 'generic->=)) (cl-define max (make-primitive-procedure 'generic-max)) (cl-define min (make-primitive-procedure 'generic-min)) (cl-define + (make-primitive-procedure 'generic-+)) (cl-define - (make-primitive-procedure 'generic--)) (cl-define * (make-primitive-procedure 'generic-*)) (cl-define / (make-primitive-procedure 'generic-/)) (cl-define 1+ (make-primitive-procedure 'generic-1+)) (cl-define 1- (make-primitive-procedure 'generic-1-)) (cl-define conjugate (make-primitive-procedure 'generic-conjugate)) (cl-define gcd (make-primitive-procedure 'generic-gcd)) (cl-define lcm (make-primitive-procedure 'generic-lcm)) (cl-define exp (make-primitive-procedure 'generic-exp)) (cl-define expt (make-primitive-procedure 'generic-expt)) (cl-define log (make-primitive-procedure 'generic-log)) (cl-define sqrt (make-primitive-procedure 'generic-sqrt)) (cl-define isqrt (make-primitive-procedure 'generic-isqrt)) (cl-define abs (make-primitive-procedure 'generic-abs)) (cl-define phase (make-primitive-procedure 'generic-phase)) (cl-define signum (make-primitive-procedure 'generic-signum)) (cl-define sin (make-primitive-procedure 'generic-sin)) (cl-define cos (make-primitive-procedure 'generic-cos)) (cl-define tan (make-primitive-procedure 'generic-tan)) (cl-define cis (make-primitive-procedure 'generic-cis)) (cl-define asin (make-primitive-procedure 'generic-asin)) (cl-define acos (make-primitive-procedure 'generic-acos)) (cl-define atan (make-primitive-procedure 'generic-atan)) (cl-define sinh (make-primitive-procedure 'generic-sinh)) (cl-define cosh (make-primitive-procedure 'generic-cosh)) (cl-define tanh (make-primitive-procedure 'generic-tanh)) (cl-define asinh (make-primitive-procedure 'generic-asinh)) (cl-define acosh (make-primitive-procedure 'generic-acosh)) (cl-define atanh (make-primitive-procedure 'generic-atanh)) ;;; Defined with coerce ;;; (cl-define float (make-primitive-procedure 'generic-float)) (cl-define rational (make-primitive-procedure 'generic-rational)) (cl-define rationalize (make-primitive-procedure 'generic-rationalize)) (cl-define floor (make-primitive-procedure 'generic-floor)) (cl-define ceiling (make-primitive-procedure 'generic-ceiling)) (cl-define truncate (make-primitive-procedure 'generic-truncate)) (cl-define round (make-primitive-procedure 'generic-round)) ;;; These should be redone in microcode (cl-define (ffloor x) (float (floor x))) (cl-define (fceiling x) (float (ceiling x))) (cl-define (ftruncate x) (float (truncate x))) (cl-define (fround x) (float (round x))) (cl-define (mod number divisor) (prim-with-values (lambda () (floor number divisor)) (lambda (f remainder) remainder))) (cl-define (rem number divisor) (prim-with-values (lambda () (truncate number divisor)) (lambda (f remainder) remainder))) ;;;; Arithmetic optimizers ;;; Needed primitives (cl-define plus-fixnum (make-primitive-procedure 'plus-fixnum)) (cl-define minus-fixnum (make-primitive-procedure 'minus-fixnum)) (cl-define multiply-fixnum (make-primitive-procedure 'multiply-fixnum)) (cl-define divide-flonum (make-primitive-procedure 'divide-flonum)) (cl-define plus-flonum (make-primitive-procedure 'plus-flonum)) (cl-define minus-flonum (make-primitive-procedure 'minus-flonum)) (cl-define multiply-flonum (make-primitive-procedure 'multiply-flonum)) (cl-define one-plus-fixnum (make-primitive-procedure 'one-plus-fixnum)) (cl-define minus-one-plus-fixnum (make-primitive-procedure 'minus-one-plus-fixnum)) (cl-define zero-fixnum? (make-primitive-procedure 'zero-fixnum?)) (cl-define negative-fixnum? (make-primitive-procedure 'negative-fixnum?)) (cl-define positive-fixnum? (make-primitive-procedure 'positive-fixnum?)) (cl-define equal-fixnum? (make-primitive-procedure 'equal-fixnum?)) (cl-define less-than-fixnum? (make-primitive-procedure 'less-than-fixnum?)) (cl-define greater-than-fixnum? (make-primitive-procedure 'greater-than-fixnum?)) (cl-define zero-flonum? (make-primitive-procedure 'zero-flonum?)) (cl-define negative-flonum? (make-primitive-procedure 'negative-flonum?)) (cl-define positive-flonum? (make-primitive-procedure 'positive-flonum?)) (cl-define less-than-flonum? (make-primitive-procedure 'less-than-flonum?)) (cl-define greater-than-flonum? (make-primitive-procedure 'greater-than-flonum?)) (cl-define equal-flonum? (make-primitive-procedure 'equal-flonum?)) (cl-define exp-flonum (make-primitive-procedure 'exp-flonum)) (cl-define sine-flonum (make-primitive-procedure 'sine-flonum)) (cl-define cosine-flonum (make-primitive-procedure 'cosine-flonum)) ;;; Binary arithmetic ops (generate-type-optimizer (+ a b) (#t #t) ((((fixnum a) (fixnum b)) fixnum fixnum (plus-fixnum a b) #t) (((float a) (float b)) * float (plus-flonum a b) #t) ((((complex float) a) ((complex float) b)) * (complex float) (let (((:gensym the-a) a) ((:gensym the-b) b)) (declare (type (complex float) (:gensym the-a) (:gensym the-b))) (complex (+ (realpart (:gensym the-a)) (realpart (:gensym the-b))) (+ (imagpart (:gensym the-a)) (imagpart (:gensym the-b))))) #t))) (generate-type-optimizer (- a b) (#t #t) ((((fixnum a) (fixnum b)) fixnum fixnum (minus-fixnum a b) #t) (((float a) (float b)) * float (minus-flonum a b) #t) ((((complex float) a) ((complex float) b)) * (complex float) (let (((:gensym the-a) a) ((:gensym the-b) b)) (declare (type (complex float) (:gensym the-a) (:gensym the-b))) (complex (- (realpart (:gensym the-a)) (realpart (:gensym the-b))) (- (imagpart (:gensym the-a)) (imagpart (:gensym the-b))))) #t))) (generate-type-optimizer (* a b) (#t #t) ((((fixnum a) (fixnum b)) fixnum fixnum (multiply-fixnum a b) #t) (((float a) (float b)) * float (multiply-flonum a b) #t) ((((imaginary float) a) (real b)) * (imaginary float) (optimize-*-imag-real a b) #t) (((real a) ((imaginary float) b)) * (imaginary float) (optimize-*-imag-real b a) #t) ((((imaginary float) a) ((imaginary float) b)) * float (- (* (imagpart a) (imagpart b))) #t) ((((complex float) a) (real b)) * (complex float) (optimize-*-real-complex b a) #t) (((real a) ((complex float) b)) * (complex float) (optimize-*-real-complex a b) #t) ((((complex float) a) ((complex float) b)) * (complex float) (let* (((:gensym the-a) a) ((:gensym the-b) b) ((:gensym ra) (realpart (:gensym the-a))) ((:gensym ia) (imagpart (:gensym the-a))) ((:gensym rb) (realpart (:gensym the-b))) ((:gensym ib) (imagpart (:gensym the-b)))) (declare (float (:gensym ra) (:gensym ia) (:gensym rb) (:gensym ib)) (type (complex float) (:gensym the-a) (:gensym the-b))) (complex (- (* (:gensym ra) (:gensym rb)) (* (:gensym ia) (:gensym ib))) (+ (* (:gensym ra) (:gensym ib)) (* (:gensym ia) (:gensym rb))))) #t))) (define-macro (optimize-*-real-complex xreal xcomplex) (let ((the-real (gensym))) `(let ((,the-real (float ,xreal))) (declare (float ,the-real)) (complex (* ,the-real (realpart ,xcomplex)) (* ,the-real (imagpart ,xcomplex)))))) (define float-zero ((make-primitive-procedure 'coerce-integer-to-flonum) 0)) (define-macro (optimize-*-imag-real ximag xreal) `(complex ,float-zero (* (imagpart ,ximag) ,xreal))) (generate-type-optimizer (/ a b) (#t #t) ((((float a) (float b)) * float (divide-flonum a b) #t))) (generate-type-optimizer (complex a b) (#t #t) (((((and float (satisfies zerop)) a) (float b)) * (imaginary float) (optimize-complex-float a b) #t) (((float a) (float b)) * (complex float) (optimize-complex-float a b) #t))) (define complex-tag (microcode-type 'complex)) (define-macro (optimize-complex-float a b) `(locally (declare (function system-pair-cons (#t #t #t) (complex float))) (system-pair-cons ,complex-tag ,a ,b))) ;;; Unary arithmentic ops (generate-type-optimizer (1+ a) (#t) ((((fixnum a)) fixnum fixnum (one-plus-fixnum a) #t))) (generate-type-optimizer (1- a) (#t) ((((fixnum a)) fixnum fixnum (minus-one-plus-fixnum a) #t))) ;; Catch some of the SCHEME cases (generate-type-optimizer (-1+ a) (#t) ((((fixnum a)) fixnum fixnum (minus-one-plus-fixnum a) #t))) (generate-type-optimizer (realpart a) (#t) (((((complex float) a)) * float (system-pair-car a) #t) (((complex a)) * :required-type (system-pair-car a) #t))) (generate-type-optimizer (imagpart a) (#t) (((((complex float) a)) * float (system-pair-cdr a) #t) (((complex a)) * :required-type (system-pair-cdr a) #t))) (generate-type-optimizer (float a) (#t) ((((float a)) * float a #t) (((fixnum a)) * float ((no-fundefsym coerce-fixnum-to-flonum) a) #t) (((integer a)) * float (coerce a 'float) #t))) ;;; Unary arithmetic predicates (define-macro (std-unary-arith-pred-optimizer name fixnum-prim-name flonum-prim-name) (let ((temp (generate-uninterned-symbol 'g))) `(generate-type-optimizer (,name a) (#t) ((((fixnum a)) * (member t nil) (let ((,temp (the fixnum a))) (,fixnum-prim-name (the fixnum ,temp))) #t) (((float a)) * (member t nil) (let ((,temp (the float a))) (,flonum-prim-name (the float ,temp))) #t))))) (std-unary-arith-pred-optimizer zerop zero-fixnum? zero-flonum?) (std-unary-arith-pred-optimizer plusp positive-fixnum? positive-flonum?) (std-unary-arith-pred-optimizer minusp negative-fixnum? negative-flonum?) ;;; Binary arithmetic predicates (define-macro (std-binary-arith-pred-optimizer name fixnum-prim-name flonum-prim-name negate?) (let ((temp1 (generate-uninterned-symbol 'g)) (temp2 (generate-uninterned-symbol 'g))) (if negate? `(generate-type-optimizer (,name a b) (#t #t) ((((fixnum a) (fixnum b)) * (member t nil) (let ((,temp1 (the fixnum a)) (,temp2 (the fixnum b))) (not (the (member t nil) (,fixnum-prim-name (the fixnum ,temp1) (the fixnum ,temp2))))) #t) (((float a) (float b)) * (member t nil) (let ((,temp1 (the float a)) (,temp2 (the float b))) (not (the (member t nil) (,flonum-prim-name (the float ,temp1) (the float ,temp2))))) #t))) `(generate-type-optimizer (,name a b) (#t #t) ((((fixnum a) (fixnum b)) * (member t nil) (let ((,temp1 (the fixnum a)) (,temp2 (the fixnum b))) (,fixnum-prim-name (the fixnum ,temp1) (the fixnum ,temp2))) #t) (((float a) (float b)) * (member t nil) (let ((,temp1 (the float a)) (,temp2 (the float b))) (,flonum-prim-name (the float ,temp1) (the float ,temp2))) #t)))))) (std-binary-arith-pred-optimizer < less-than-fixnum? less-than-flonum? #f) (std-binary-arith-pred-optimizer >= less-than-fixnum? less-than-flonum? #t) (std-binary-arith-pred-optimizer > greater-than-fixnum? greater-than-flonum? #f) (std-binary-arith-pred-optimizer <= greater-than-fixnum? greater-than-flonum? #t) (std-binary-arith-pred-optimizer = equal-fixnum? equal-flonum? #f) (std-binary-arith-pred-optimizer /= equal-fixnum? equal-flonum? #t) ;;; Trancendental ops (generate-type-optimizer (exp arg) (#t) ((((float arg)) * float (exp-flonum arg) #t) ((((imaginary float) arg)) * (complex float) (let (((:gensym theta) (imagpart arg))) (declare (float (:gensym theta))) (complex (cos (:gensym theta)) (sin (:gensym theta)))) #t) ((((complex float) arg)) * (complex float) (let (((:gensym real-part) (realpart arg)) ((:gensym imag-part) (imagpart arg))) (declare (float (:gensym real-part) (:gensym imag-part))) (let (((:gensym multiplier) (exp (:gensym real-part)))) (declare (float (:gensym multiplier))) (complex (* (cos (:gensym imag-part)) (:gensym multiplier)) (* (sin (:gensym imag-part)) (:gensym multiplier))))) #t))) (generate-type-optimizer (cis arg) (#t) ((((float arg)) * (complex float) (complex (the float (cos arg)) (the float (sin arg))) #t))) (generate-type-optimizer (sin a) (#t) ((((float a)) * float (sine-flonum a) #t))) (generate-type-optimizer (cos a) (#t) ((((float a)) * float (cosine-flonum a) #t)))
false
d2ad2be1eeecf840f0096e3acb884638828cd233
0011048749c119b688ec878ec47dad7cd8dd00ec
/src/spoilers/816/solution.scm
9e1d9238135dd12a58e435531f04fcf1854c2da5
[ "0BSD" ]
permissive
turquoise-hexagon/euler
e1fb355a44d9d5f9aef168afdf6d7cd72bd5bfa5
852ae494770d1c70cd2621d51d6f1b8bd249413c
refs/heads/master
2023-08-08T21:01:01.408876
2023-07-28T21:30:54
2023-07-28T21:30:54
240,263,031
8
0
null
null
null
null
UTF-8
Scheme
false
false
1,011
scm
solution.scm
(import (chicken flonum) (chicken format) (chicken sort) (euler)) (define (make-generator) (set! i 290797) (define (generator) (let ((_ i)) (set! i (modulo (* i i) 50515093)) _)) generator) (define (generate n) (let ((generator (make-generator))) (let loop ((i 1) (acc '())) (if (> i n) acc (loop (+ i 1) (cons (list (generator) (generator)) acc)))))) (define (distance a b) (sqrt (apply + (map (lambda (i) (* i i)) (map - a b))))) (define (solve n) (let ((l (map car (sort (map (lambda (i) (cons i (distance i '(0 0)))) (generate n)) (lambda (a b) (< (cdr a) (cdr b))))))) (foldl min +inf.0 (map distance l (cdr l))))) (define (output n) (flonum-print-precision 11) (format "~a" n)) (let ((_ (output (solve #e2e6)))) (print _) (assert (string=? _ "20.880613018")))
false
ac908b175daaef1875fa0ad673ad3340b7951f9b
185024f40e1ceed452781a1f3f57e6d16f57d799
/api-sig.ss
fa88b66c562a867607cc05f54ab09de4a33f66ce
[]
no_license
noelwelsh/numeric
b82cd4ca9e4afb18df0129ec2231fc03f9b66450
ac4488cf8cc6f0558f74ca9b8faad0f198e76a84
refs/heads/master
2021-01-18T21:32:27.393991
2010-02-22T14:05:19
2010-02-22T14:05:19
275,898
1
0
null
null
null
null
UTF-8
Scheme
false
false
421
ss
api-sig.ss
#lang scheme/base (require (for-syntax scheme/base "api.ss") (planet untyped/unlib:3/syntax)) (require scheme/unit) (define-syntax (define-api-sig stx) (syntax-case stx () [(define-api-sig id) (with-syntax ([exported-names (names->ids names stx 'vector)]) (syntax (define-signature id exported-names)))])) (define-api-sig vector^) (provide vector^)
true
110e36df50305638d802ccc95de8b0b5b0180b54
fb9a1b8f80516373ac709e2328dd50621b18aa1a
/ch3/3-5-2_Infinite_Streams.scm
98a367efdd6f0766a5460e45c34a4e44e4bfc668
[]
no_license
da1/sicp
a7eacd10d25e5a1a034c57247755d531335ff8c7
0c408ace7af48ef3256330c8965a2b23ba948007
refs/heads/master
2021-01-20T11:57:47.202301
2014-02-16T08:57:55
2014-02-16T08:57:55
null
0
0
null
null
null
null
UTF-8
Scheme
false
false
2,532
scm
3-5-2_Infinite_Streams.scm
;; 3.5.2 無限ストリーム ;; 無限の長さをもったストリームを扱う (load "./ch3/exercise3-50.scm") (define (integers-starting-from n) (cons-stream n (integers-starting-from (+ n 1)))) (define integers (integers-starting-from 1)) (stream-car integers) (stream-cdr integers) ;; 7で割り切れない整数のStream (define (divisible? x y) (= (remainder x y) 0)) (define no-sevens (stream-filter (lambda (x) (not (divisible? x 7))) integers)) (stream-ref no-sevens 100) ;; フィボナッチ数の無限ストリーム (define (fibgen a b) (cons-stream a (fibgen b (+ a b)))) (define fibs (fibgen 0 1)) ;; (0, fib(1,1)) ;; (0, (1, fib(1,2))) ;; (0, (1, (1, fib(2, 3)))) ;; (0, (1, (1, (2, fib(3, 5))))) ;; no-sevensを一般化する ;; エラトステネスの篩 素数の無限ストリーム (define (sieve stream) (cons-stream (stream-car stream) (sieve (stream-filter (lambda (x) (not (divisible? x (stream-car stream)))) (stream-cdr stream))))) (define primes (sieve (integers-starting-from 2))) (stream-ref primes 50) ;; ストリームの暗黙の定義 ;; 無限ストリームを暗黙に定義する ;; 1の無限ストリーム (define ones (cons-stream 1 ones)) ;; 2つのストリームの和 (define (add-streams s1 s2) (stream-map + s1 s2)) (define integers (cons-stream 1 (add-streams ones integers))) (stream-ref integers 10) ;; フィボナッチ数 (define fibs (cons-stream 0 (cons-stream 1 (add-streams (stream-cdr fibs) fibs)))) (define (show-stream stream n m) (if (< n m) (begin (display (stream-ref stream n)) (newline) (show-stream stream (+ n 1) m)) (stream-ref stream n))) (show-stream fibs 0 5) ;; 2のべき乗のストリーム (define (scale-stream stream factor) (stream-map (lambda (x) (* x factor)) stream)) (define double (cons-stream 1 (scale-stream double 2))) (show-stream double 0 10) ;; 素数 (define primes (cons-stream 2 (stream-filter prime? (integers-starting-from 3)))) (define (prime? n) (define (iter ps) (cond ((> (square (stream-car ps)) n) #t) ((divisible? n (stream-car ps)) #f) (else (iter (stream-cdr ps))))) (iter primes)) ;; psのリストから順に素数を取り出していって,nが素数で割り切れたらfalse ;; 素数がroot nより大きくなったらおしまい.trueを返す. (show-stream primes 0 10)
false
2c8e4a18be1c49e814e92dc9ed3fe8d79f9887ed
660d4aad58a5dd8a304ead443a4f915b0047a579
/qeval-test.scm
48f6f691d8fbb8616eeb33b1061dcd503552c574
[]
no_license
prophet-on-that/sicp
d9642ceebb8e885d85053ceba930282f30100879
cdb742646464f21a3c1c27c753d35f20cf0e754d
refs/heads/master
2021-07-05T12:53:14.263137
2020-08-21T08:20:27
2020-08-21T08:20:27
162,593,828
0
0
null
null
null
null
UTF-8
Scheme
false
false
8,325
scm
qeval-test.scm
(define-module (sicp qeval-test)) (use-modules (srfi srfi-64) (srfi srfi-41) (srfi srfi-1) (sicp qeval)) ;;; Test data (define ben '(Bitdiddle Ben)) (define alyssa '(Hacker Alyssa P)) (define alyssa-address '(Cambridge (Mass Ave) 78)) (define cy '(Fect Cy D)) (define cy-address '(Cambridge (Ames Street) 3)) (define lem '(Tweakit Lem E)) (define louis '(Reasoner Louis)) (define oliver '(Warbucks Oliver)) (define oliver-salary 150000) (define eben '(Scrooge Eben)) (define eben-salary 75000) (define bob '(Cratchet Robert)) (define deWitt '(Aull DeWitt)) (define computer-programmer '(computer programmer)) (define computer-wizard '(computer wizard)) (define computer-technician '(computer technician)) (define computer-programmer-trainee '(computer programmer trainee)) (define chief-accountant '(accounting chief accountant)) (define assertions `((address ,ben (Slumerville (Ridge Road) 10)) (job ,ben ,computer-wizard) (salary ,ben 60000) (address ,alyssa ,alyssa-address) (job ,alyssa ,computer-programmer) (salary ,alyssa 40000) (supervisor ,alyssa ,ben) (address ,cy ,cy-address) (job ,cy ,computer-programmer) (salary ,cy 35000) (supervisor ,cy ,ben) (address ,lem (Boston (Bay State Road) 22)) (job ,lem ,computer-technician) (salary ,lem 25000) (supervisor ,lem ,ben) (address ,louis (Slumerville (Pine Tree Road) 80)) (job ,louis ,computer-programmer-trainee) (salary ,louis 30000) (supervisor ,louis ,alyssa) (supervisor ,ben ,oliver) (address ,oliver (Swellesley (Top Heap Road))) (job ,oliver (administration big wheel)) (salary ,oliver ,oliver-salary) (address ,eben (Weston (Shady Lane) 10)) (job ,eben ,chief-accountant) (salary ,eben ,eben-salary) (supervisor ,eben ,oliver) (address ,bob (Allston (N Harvard Street) 16)) (job ,bob (accounting scrivener)) (salary ,bob 18000) (supervisor ,bob ,eben) (address ,deWitt (Slumerville (Onion Square) 5)) (job ,deWitt (administration secretary)) (salary ,deWitt 25000) (supervisor ,deWitt ,oliver) (can-do-job ,computer-wizard ,computer-programmer) (can-do-job ,computer-wizard ,computer-technician) (can-do-job ,computer-programmer ,computer-programmer-trainee) (can-do-job (administration secretary) (administration big wheel)))) (define rules `((rule (same ?x ?x)) (rule (lives-near ?person-1 ?person-2) (and (address ?person-1 (?town . ?rest-1)) (address ?person-2 (?town . ?rest-2)) (not (same ?person-1 ?person-2)))) (rule (outranked-by ?staff-person ?boss) (or (supervisor ?staff-person ?boss) (and (supervisor ?staff-person ?middle-manager) (outranked-by ?middle-manager ?boss)))) (rule (wheel ?person) (and (supervisor ?middle-manager ?person) (supervisor ?x ?middle-manager))) (rule (can-replace ?person-1 ?person-2) (and (job ?person-1 ?job-1) (job ?person-2 ?job-2) (or (same ?job-1 ?job-2) (can-do-job ?job-1 ?job-2)) (not (same ?person-1 ?person-2)))) (rule (big-shot ?person) (and (job ?person (?division . ?rest)) (not (and (supervisor ?person ?boss) (job ?boss (?division . ?rest2)))))))) (define (load-db) (map add-rule-or-assertion! assertions) (map (lambda (rule) (add-rule-or-assertion! (query-syntax-process rule))) rules)) ;;; Test suite (define (assert-query-results query expected) (let ((actual (stream->list (evaluate-and-instantiate query)))) (test-assert (format #f "~a" query) (and (eq? (length actual) (length expected)) (every (lambda (e) (member e actual)) expected))))) ;; Reset the current test runner (test-runner-current (test-runner-simple)) (test-begin "qeval") ;;; Setup (clear-database) (load-db) (test-begin "patterns") (assert-query-results `(job ,ben ,computer-wizard) `((job ,ben ,computer-wizard))) (assert-query-results `(job ?x ,computer-programmer) `((job ,alyssa ,computer-programmer) (job ,cy ,computer-programmer))) (assert-query-results '(supervisor ?x ?x) '()) (assert-query-results '(job ?x (computer ?type)) `((job ,ben ,computer-wizard) (job ,alyssa ,computer-programmer) (job ,cy ,computer-programmer) (job ,lem ,computer-technician))) (assert-query-results '(job ?x (computer . ?type)) `((job ,ben ,computer-wizard) (job ,alyssa ,computer-programmer) (job ,cy ,computer-programmer) (job ,lem ,computer-technician) (job ,louis ,computer-programmer-trainee))) (assert-query-results `(and (job ?person ,computer-programmer) (address ?person ?where)) `((and (job ,alyssa ,computer-programmer) (address ,alyssa ,alyssa-address)) (and (job ,cy ,computer-programmer) (address ,cy ,cy-address)))) (assert-query-results `(or (supervisor ?x ,ben) (supervisor ?x ,alyssa)) `((or (supervisor ,alyssa ,ben) (supervisor ,alyssa ,alyssa)) (or (supervisor ,cy ,ben) (supervisor ,cy ,alyssa)) (or (supervisor ,lem ,ben) (supervisor ,lem ,alyssa)) (or (supervisor ,louis ,ben) (supervisor ,louis ,alyssa)))) (assert-query-results `(and (supervisor ?x ,ben) (not (job ?x ,computer-programmer))) `((and (supervisor ,lem ,ben) (not (job ,lem ,computer-programmer))))) (define min-salary 60000) (assert-query-results `(and (lisp-value > ?amount ,min-salary) (salary ?person ?amount)) `((and (lisp-value > ,eben-salary ,min-salary) (salary ,eben ,eben-salary)) (and (lisp-value > ,oliver-salary ,min-salary) (salary ,oliver ,oliver-salary)))) (assert-query-results `(unique (job ,ben ,computer-wizard)) `((unique (job ,ben ,computer-wizard)))) (assert-query-results `(unique (job ?x ,computer-programmer)) '()) (assert-query-results `(and (unique (supervisor ?person ?boss)) (job ?boss ?j)) `((and (unique (supervisor ?person ,eben)) (job ,eben ,chief-accountant)) (and (unique (supervisor ?person ,alyssa)) (job ,alyssa ,computer-programmer)))) (test-begin "rules") (assert-query-results `(same ,ben ,ben) `((same ,ben ,ben))) (assert-query-results `(same ,ben ,alyssa) '()) (assert-query-results `(lives-near ?x ,ben) `((lives-near ,louis ,ben) (lives-near ,deWitt ,ben))) (assert-query-results `(and (job ?x (computer . ?rest)) (lives-near ?x ,ben)) `((and (job ,louis ,computer-programmer-trainee) (lives-near ,louis ,ben)))) (assert-query-results `(outranked-by ,louis ?x) `((outranked-by ,louis ,alyssa) (outranked-by ,louis ,ben) (outranked-by ,louis ,oliver))) (assert-query-results `(can-replace ?x ,cy) `((can-replace ,ben ,cy) (can-replace ,alyssa ,cy))) (assert-query-results '(big-shot ?x) `((big-shot ,eben) (big-shot ,oliver) (big-shot ,ben))) (test-end "rules") (test-end "patterns") (test-end "qeval")
false
a484de9e6892e810e7eb7b0d8515ba541e7071bb
fba55a7038615b7967256306ee800f2a055df92f
/vvalkyrie/1.2/ex-1-16.scm
f32c7674822c5fe0f827f9e6c1dac6214fc3912b
[]
no_license
lisp-korea/sicp2014
7e8ccc17fc85b64a1c66154b440acd133544c0dc
9e60f70cb84ad2ad5987a71aebe1069db288b680
refs/heads/master
2016-09-07T19:09:28.818346
2015-10-17T01:41:13
2015-10-17T01:41:13
26,661,049
2
3
null
null
null
null
UTF-8
Scheme
false
false
926
scm
ex-1-16.scm
#lang planet neil/sicp ;; b^n = (b^(n/2))^2 n == even ;; = b.b^(n-1) n == odd ;;(define (fast-expt b n) ;; (cond ((= n 0) 1) ;; ((even? n) (square (fast-expt b (/ n 2)))) ;; (else (* b (fast-expt b (- n 1)))))) ;; iterative version of fast-expt ;; b^4 (square (square b)) ;; b^5 (square (square b)).b ;; b^6 (square (square b)).(square b) (define (square x) (* x x)) (define (fast-expt b n) (fast-expt-iter 1 b n)) (define (fast-expt-iter product b n) (cond ((= n 0) product) ((even? n) (fast-expt-iter product (square b) (/ n 2))) (else (fast-expt-iter (* product b) b (- n 1))))) ;;-- (define (pwr2 n) (pwr2-iter 1 1 n)) (define (pwr2-iter val cnt n) (if (> cnt n) val (pwr2-iter (* val 2) (+ cnt 1) n))) (runtime) ;; 1415795864485388 (fast-expt 2 65536) ;; 31,516us (runtime) ;; 1415795864516904 (pwr2 65536) ;; 157,633us (runtime) ;; 1415795864674537
false
2db1e95c8225d8539ace0b758ee4c73b003de6ed
1f48fb14898799bf9ee1118bf691586b430c5e9e
/369.scm
a98068a17c2307b7533e503b0a28c927361aa8fc
[]
no_license
green-93-nope/sicp
0fa79dd59414808a9cdcbfa18bd3a1c7f0b8191c
59241b6c42621c2ef967efebdd281b845f98e923
refs/heads/master
2021-01-10T10:51:22.328123
2017-05-21T08:33:25
2017-05-21T08:33:25
48,210,972
0
0
null
null
null
null
UTF-8
Scheme
false
false
534
scm
369.scm
(define (triples S T U) (cons-stream (list (stream-car S) (stream-car T) (stream-car U)) (interleave (stream-map (lambda (x) (append (list (stream-car S)) x)) (pairs (stream-cdr T) (stream-cdr U))) (triples (stream-cdr S) (stream-cdr T) (stream-cdr U))))) (define (bida? x y z) (= (square z) (+ (square x) (square y)))) (define (square x) (* x x)) (define (bida-triples S T U) (stream-filter (lambda (l) (apply bida? l)) (triples S T U)))
false
25be41af7c6e8c4131d8ef9a75bb01c8b618042b
1f48fb14898799bf9ee1118bf691586b430c5e9e
/241.scm
7e7992aff91a74baf6bf373f9131630d6c59d433
[]
no_license
green-93-nope/sicp
0fa79dd59414808a9cdcbfa18bd3a1c7f0b8191c
59241b6c42621c2ef967efebdd281b845f98e923
refs/heads/master
2021-01-10T10:51:22.328123
2017-05-21T08:33:25
2017-05-21T08:33:25
48,210,972
0
0
null
null
null
null
UTF-8
Scheme
false
false
792
scm
241.scm
(load "239.scm") (define (three-pair n) (flatmap (lambda (x) (flatmap (lambda (y) (map (lambda (z) (list x y z)) (enumerate-interval 1 n))) (enumerate-interval 1 n))) (enumerate-interval 1 n))) (define (three-sum-equal-to pair s) (= (+ (car pair) (cadr pair) (caddr pair)) s)) (define (three-pair-not-equal pair) (let ((first (car pair)) (second (cadr pair)) (third (caddr pair))) (not (or (= first second) (= second third) (= first third))))) (define (three-unequal-sums n s) (filter three-pair-not-equal (filter (lambda (x) (three-sum-equal-to x s)) (three-pair n))))
false
d3827b4e4030724015619c711099a3e6e381c602
b62560d3387ed544da2bbe9b011ec5cd6403d440
/crates/steel-core/src/tests/success/close_upvalue.scm
5bd1b6ff97843fd73ff95a27935292b24eaae334
[ "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
Scheme
false
false
184
scm
close_upvalue.scm
(define value ((((lambda (x) (lambda (y) (lambda (z) (+ x y z)))) 10) 20) 30)) (assert! (equal? 60 value))
false
489406be68f9bbc382d13a5f1c8f71824592f2fa
4478a6db6f759add823da6436842ff0b1bf82aa8
/osc_mrmr_touch_setup.scm
a21169d9ddcc1c1c9bf33b7d580167099acb4ce6
[]
no_license
gaborpapp/LDS-fluxus
2c06508f9191d52f784c2743c4a92e8cadf116ea
44d90d9f1e3217b3879c496b2ddd4d34237935d1
refs/heads/master
2016-09-05T13:29:09.695559
2013-04-05T05:33:10
2013-04-05T05:33:10
7,058,302
1
1
null
null
null
null
UTF-8
Scheme
false
false
4,695
scm
osc_mrmr_touch_setup.scm
(clear) ;osc setup iOS mrmr apphoz ;mrmr-en belül a performance.mmr default setupra működik ez ;mrmr/prefs/player név Gas ;BANK1 buttons/switches (a nagy + legalso utolsoelottisor button és legalso switchek csak) (define bn 0) ;Nagy gomb (define b1 0) (define b2 0) (define b3 0) (define b4 0) (define s1 0) (define s2 0) (define s3 0) (define s4 0) ;BANK2 sliders (define slide1 0) (define slide2 0) (define slide3 0) (define slide4 0) (define slide5 0) (define slide6 0) (define slide7 0) (define slide8 0) ;BANK3 tactile-zones (define tactile1 (vector 0 0 0)) (define tactile2 (vector 0 0 0)) (define tactile3 (vector 0 0 0)) (define tactile4 (vector 0 0 0)) ;BANK4 3d -(2 ujjal!) (define tac3d (vector 0 0 0)) (define acc (vector 0 0 0)) (define (osc-drain path [value #f]) (if (osc-msg path) (osc-drain path (osc 0)) value)) (define (osc_recieve) (let ([cbn (osc-drain "/mrmr/pushbutton/1/Gas")]) (when cbn (set! bn cbn))) (let ([cb1 (osc-drain "/mrmr/pushbutton/13/Gas")]) (when cb1 (set! b1 cb1))) (let ([cb2 (osc-drain "/mrmr/pushbutton/14/Gas")]) (when cb2 (set! b2 cb2))) (let ([cb3 (osc-drain "/mrmr/pushbutton/15/Gas")]) (when cb3 (set! b3 cb3))) (let ([cb4 (osc-drain "/mrmr/pushbutton/16/Gas")]) (when cb4 (set! b4 cb4))) (let ([cs1 (osc-drain "/mrmr/pushbutton/17/Gas")]) (when cs1 (set! s1 cs1))) (let ([cs2 (osc-drain "/mrmr/pushbutton/18/Gas")]) (when cs2 (set! s2 cs2))) (let ([cs3 (osc-drain "/mrmr/pushbutton/19/Gas")]) (when cs3 (set! s3 cs3))) (let ([cs4 (osc-drain "/mrmr/pushbutton/20/Gas")]) (when cs4 (set! s4 cs4))) (let ([sl1 (osc-drain "/mrmr/slider/horizontal/21/Gas")]) (when sl1 (set! slide1 sl1) )) (let ([sl2 (osc-drain "/mrmr/slider/horizontal/22/Gas")]) (when sl2 (set! slide2 sl2) )) (let ([sl3 (osc-drain "/mrmr/slider/horizontal/23/Gas")]) (when sl3 (set! slide3 sl3) )) (let ([sl4 (osc-drain "/mrmr/slider/horizontal/24/Gas")]) (when sl4 (set! slide4 sl4) )) (let ([sl5 (osc-drain "/mrmr/slider/horizontal/25/Gas")]) (when sl5 (set! slide5 sl5))) (let ([sl6 (osc-drain "/mrmr/slider/horizontal/26/Gas")]) (when sl6 (set! slide6 sl6))) (let ([sl7 (osc-drain "/mrmr/slider/horizontal/27/Gas")]) (when sl7 (set! slide7 sl7))) (let ([sl8 (osc-drain "/mrmr/slider/horizontal/28/Gas")]) (when sl8 (set! slide8 sl8))) (let* ([tac1x (osc-drain "/mrmr/tactilezoneX/29/Gas")] [tac1y (osc-drain "/mrmr/tactilezoneY/29/Gas")]) (when tac1x (vector-set! tactile1 0 tac1x)) (when tac1y (vector-set! tactile1 1 tac1y)) ) (let* ([tac2x (osc-drain "/mrmr/tactilezoneX/30/Gas")] [tac2y (osc-drain "/mrmr/tactilezoneY/30/Gas")]) (when tac2x (vector-set! tactile2 0 tac2x)) (when tac2y (vector-set! tactile2 1 tac2y)) ) (let* ([tac3x (osc-drain "/mrmr/tactilezoneX/31/Gas")] [tac3y (osc-drain "/mrmr/tactilezoneY/31/Gas")]) (when tac3x (vector-set! tactile3 0 tac3x)) (when tac3y (vector-set! tactile3 1 tac3y)) ) (let* ([tac4x (osc-drain "/mrmr/tactilezoneX/32/Gas")] [tac4y (osc-drain "/mrmr/tactilezoneY/32/Gas")]) (when tac4x (vector-set! tactile4 0 tac4x)) (when tac4y (vector-set! tactile4 1 tac4y)) ) (let* ([accelx (osc-drain "/mrmr/accelerometerX/33/Gas")] [accely (osc-drain "/mrmr/accelerometerY/33/Gas")] [accelz (osc-drain "/mrmr/accelerometerZ/33/Gas")] ) (when accelx (vector-set! acc 0 accelx)) (when accely (vector-set! acc 1 accely)) (when accelz (vector-set! acc 2 accelz)) ) (let* ([tac3dx (osc-drain "/mrmr/tactile3DX/34/Gas")] [tac3dy (osc-drain "/mrmr/tactile3DY/34/Gas")] [tac3dz (osc-drain "/mrmr/tactile3DZ/34/Gas")] ) (when tac3dx (vector-set! tac3d 0 tac3dx)) (when tac3dy (vector-set! tac3d 1 tac3dy)) (when tac3dz (vector-set! tac3d 2 tac3dz)) ) ) (osc-source "1337") (every-frame (osc_recieve))
false
de70b5aea56d36174eff375ce59f2ce34f07ffae
4bd59493b25febc53ac9e62c259383fba410ec0e
/Scripts/Task/infinity/scheme/infinity.ss
9f6d4ed2c89991722cc7c713a91cdf5edc8a88d9
[]
no_license
stefanos1316/Rosetta-Code-Research
160a64ea4be0b5dcce79b961793acb60c3e9696b
de36e40041021ba47eabd84ecd1796cf01607514
refs/heads/master
2021-03-24T10:18:49.444120
2017-08-28T11:21:42
2017-08-28T11:21:42
88,520,573
5
1
null
null
null
null
UTF-8
Scheme
false
false
109
ss
infinity.ss
+inf.0 ; positive infinity (define (finite? x) (< -inf.0 x +inf.0)) (define (infinite? x) (not (finite? x)))
false
65f7aa1d6be03261738870e3c958d32d059dd1aa
3604661d960fac0f108f260525b90b0afc57ce55
/SICP-solutions/3.47-n-mutex-a.scm
a78e3001bf3ee0a0d8a926ab09becf5a9e8b2ba1
[]
no_license
rythmE/SICP-solutions
b58a789f9cc90f10681183c8807fcc6a09837138
7386aa8188b51b3d28a663958b807dfaf4ee0c92
refs/heads/master
2021-01-13T08:09:23.217285
2016-09-27T11:33:11
2016-09-27T11:33:11
69,350,592
0
0
null
null
null
null
UTF-8
Scheme
false
false
401
scm
3.47-n-mutex-a.scm
(define (make-n-mutex) (let ((pass 0)) (if (test-pass! pass) (let ((mutex (make-mutex))) (lambda (p) (define (n-mutex-p . args) (mutex 'acquire) (let ((val (apply p args))) (mutex 'release) (set! pass (- pass 1)) val)) n-mutex-p))))) (define (test-pass! pass) (if (= pass n) true (begin (set! pass (+ pass 1)) false)))
false
ef47111709a038305cef8e1bf858355646b17219
95b65c399510a7a52b7152b821b538b7a8046b3b
/2020/04/graphics.scm
ea326b27041ab040d6c7bdd6d838a25d835a16e0
[]
no_license
HugoNikanor/Advent-of-code
168d708092f7a54805e93a249877add418f24f95
ff6f7c8cb2ab3e6e1fbdf9ff3ca993ef37552857
refs/heads/master
2023-04-27T16:00:15.677315
2023-04-24T09:52:38
2023-04-24T09:52:38
225,194,365
0
0
null
null
null
null
UTF-8
Scheme
false
false
5,377
scm
graphics.scm
(use-modules (cairo) (srfi srfi-9) ((rnrs base) :select (mod)) (ice-9 format) ) ;; H := [0, 360) ;; S := [0, 1] ; hur mättad (lågt == blekt) ;; V := [0, 1] ; "ljus" (lågt == mörkt) (define-record-type <hsv> (hsv h s v) hsv? (h h) (s s) (v v)) (define-record-type <rgb> (rgb r g b) rgb? (r r) (g g) (b b)) (define (hsv->rgb hsv) (define c (* (v hsv) (s hsv))) (define x (* c (- 1 (abs (- (mod (/ (h hsv) 60) 2) 1))))) (define m (- (v hsv) c)) (call-with-values (lambda () (cond ((< (h hsv) 60) (values c x 0)) ((< (h hsv) 120) (values x c 0)) ((< (h hsv) 180) (values 0 c x)) ((< (h hsv) 240) (values 0 x c)) ((< (h hsv) 300) (values x 0 c)) ((< (h hsv) 360) (values c 0 x)))) (lambda (r* g* b*) (rgb (* #xFF (+ r* m)) (* #xFF (+ g* m)) (* #xFF (+ b* m)))))) (define (rgb->hsv rgb) (define r* (/ (r rgb) #xFF)) (define g* (/ (g rgb) #xFF)) (define b* (/ (b rgb) #xFF)) (define c-max (max r* g* b*)) (define delta (- c-max (min r* g* b*))) (define h (* 60 (cond ((= 0 delta) 0) ((= r* c-max) (mod (/ (- g* b*) delta) 6)) ((= g* c-max) (+ 2 (/ (- b* r*) delta))) ((= b* c-max) (+ 4 (/ (- r* g*) delta)))))) (define s (if (= 0 c-max) 0 (/ delta c-max))) (define v c-max) (hsv h s v)) (define (rgb->fractionals rgb) (map (lambda (x) (exact->inexact (/ x #xFF))) (list (r rgb) (g rgb) (b rgb)))) (define fl (compose exact->inexact floor )) (define height 1000) (define phi 1.61803) (define width (inexact->exact (floor (* height phi)))) (define surf (cairo-image-surface-create 'argb32 width height)) (define cr (cairo-create surf)) ;; context ;; make source (cairo-select-font-face cr "Bitstream Vera Sans" 'normal 'normal) ;; (cairo-scale cr height height) (define background (rgb->hsv (rgb #xB2 #x9F #x90))) (apply cairo-set-source-rgb cr (rgb->fractionals (hsv->rgb background))) (cairo-rectangle cr 0 0 (* width 2) (* height 2)) ;; (cairo-paint cr) (cairo-fill cr) ;; (cairo-new-path cr) (cairo-rectangle cr (fl (/ height 20)) (fl (/ height 20)) (fl (* 7 (/ height 10))) (fl (* 9 (/ height 10))) ) (apply cairo-set-source-rgb cr (rgb->fractionals (hsv->rgb (hsv (h background) (max (- (s background) 0.0) 0) (max (- (v background) 0.2) 0) )))) (cairo-fill cr) ;; (cairo-mask cr pat) ;; (cairo-paint cr) ;; make mask (define fields `((byr 1998) (iyr 2015) (eyr 2025) (hgt (cm . 170)) (hcl ,(rgb #x00 #xCC #x00)) (ecl "brn") (cid "SE"))) (define pid 123456789) (define fieldnames `((byr "Födelseår") (iyr "Utfärdat") (eyr "Går ut") (hgt "Höjd") (hcl "Hårfärg") (ecl "Ögonfärg") ;; (pid "Passnummer") (cid "Landskod"))) (define pat (cairo-pattern-create-linear 0 0 1000 1000)) (cairo-pattern-add-color-stop-rgba pat 1000 1 0 0 1) (cairo-pattern-add-color-stop-rgba pat 0 0 0 1 1) (cairo-set-source cr pat) ;; (cairo-set-font-size cr (/ height 2)) (cairo-set-font-size cr 60) (for-each (lambda (field i) (define key (car field)) (define value (cadr field)) (define str (car (assoc-ref fieldnames key))) (define line (* i (/ (* 9/10 height) (length fields)))) (cairo-move-to cr (/ width 2) line) (cairo-show-text cr str) (cairo-move-to cr (+ (/ width 2) (/ width 4)) line) (cairo-show-text cr (case key ((byr iyr eyr) (number->string value)) ((hgt) (format #f "~a~a" (cdr value) (car value))) ;; ((pid) (format #f "~9,'0d" value)) ((hcl) (format #f "~2,'0X, ~2,'0X, ~2,'0X" (r value) (g value) (b value))) ((ecl) (case (string->symbol value) ((amb) "Bärnsten") ((blu) "Blå") ((brn) "Brun") ((gry) "Grå") ((grn) "Grön") ((hzl) "Hasell") ((oth) "Annan"))) ((cid) (format #f "~a" value))))) fields (iota (length fields))) (cairo-set-font-size cr 40) (cairo-set-source-rgb cr 0 0 0) (cairo-move-to cr (/ width 2) (- height (* height 1/20))) (define pidstr (let ((str (format #f "~9,'0d" pid))) (string-join (list (substring str 0 3) (substring str 3 6) (substring str 6 9)) " " 'infix))) (cairo-show-text cr pidstr) (cairo-set-font-size cr 100) ;; TODO replace with wax noice (cairo-set-source-rgb cr 1 0 0) (cairo-move-to cr 100 100) (cairo-rotate cr (* 3.141592653589793 0.25)) (cairo-show-text cr "DENIED") ;; write out (cairo-surface-write-to-png surf "guile-cairo.png") ;; byr - födelseår ;; iyr - utfärdat ;; eyr - går ut ;; hgt - längd ;; hcl - hårfärg ;; ecl - ögonfärg ;; pid - pass # ;; cid - landskod
false
7f3e8a1c04609c98d095d06b8fa19240c8e18aed
92b8d8f6274941543cf41c19bc40d0a41be44fe6
/gnu/kawa/javafx/GroupObjectBuilder.scm
39c305d387cdd2883e657181c92c3c41bfc1acc0
[ "MIT" ]
permissive
spurious/kawa-mirror
02a869242ae6a4379a3298f10a7a8e610cf78529
6abc1995da0a01f724b823a64c846088059cd82a
refs/heads/master
2020-04-04T06:23:40.471010
2017-01-16T16:54:58
2017-01-16T16:54:58
51,633,398
6
0
null
null
null
null
UTF-8
Scheme
false
false
727
scm
GroupObjectBuilder.scm
(define-simple-class GroupObjectBuilder (gnu.kawa.reflect.CompileBuildObject) ((hasAddChildMethod) #t) ((getChildrenMethod) (let ((ct ((getResultType):getName))) (cond ((equal? ct "javafx.animation.Timeline") "getKeyFrames") ((equal? ct "javafx.scene.shape.Path") "getElements") (else "getChildren")))) ((buildAddChild target child) (gnu.expr.ApplyExp gnu.kawa.reflect.Invoke:invoke (gnu.expr.ApplyExp gnu.kawa.reflect.Invoke:invoke (gnu.expr.ReferenceExp target) (gnu.expr.QuoteExp (getChildrenMethod))) (gnu.expr.QuoteExp "add") child)))
false
1a0a775e114a966911a8558a7459480c6c5633a9
d0964c947dd6809ad0f67dd243ae1d6de8103df7
/fizzbuzz.scm
235cb7657816d939a459ba53356636cc5982d5e0
[]
no_license
kvalle/learning-scheme
1eaf59c53cb52bfce87a8a92e4cc0ee2983419e5
28174c859e35fe694a6e3c77b11f1bbbbe9cb6a6
refs/heads/master
2021-01-15T17:46:54.913091
2015-05-03T18:17:33
2015-05-03T18:20:48
10,746,185
0
0
null
null
null
null
UTF-8
Scheme
false
false
246
scm
fizzbuzz.scm
(define (fb n) (let ((fizz (= 0 (modulo n 3))) (buzz (= 0 (modulo n 5)))) (cond ((and fizz buzz) "fizzbuzz") (fizz "fizz") (buzz "buzz") (else n)))) (define (fizzbuzz n) (map fb (cdr (iota (+ 1 n))))) (display (fizzbuzz 20))
false
f28752a8477ed26fd0ec785a51022f5058921f43
665da87f9fefd8678b0635e31df3f3ff28a1d48c
/srfi/sorting/merge.scm
37335a87c153e3478bc0b34bc63db55319ccc827
[ "MIT" ]
permissive
justinethier/cyclone
eeb782c20a38f916138ac9a988dc53817eb56e79
cc24c6be6d2b7cc16d5e0ee91f0823d7a90a3273
refs/heads/master
2023-08-30T15:30:09.209833
2023-08-22T02:11:59
2023-08-22T02:11:59
31,150,535
862
64
MIT
2023-03-04T15:15:37
2015-02-22T03:08:21
Scheme
UTF-8
Scheme
false
false
7,985
scm
merge.scm
;;; This file extracts four merge procedures from lmsort.scm and vmsort.scm ;;; files written by Olin Shivers. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Start of code extracted from Olin's lmsort.scm file. ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; list merge & list merge-sort -*- Scheme -*- ;;; Copyright (c) 1998 by Olin Shivers. ;;; This code is open-source; see the end of the file for porting and ;;; more copyright information. ;;; Olin Shivers ;;; Exports: ;;; (list-merge < lis lis) -> list ;;; (list-merge! < lis lis) -> list ;;; Merge ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; These two merge procedures are stable -- ties favor list A. (define (list-merge < a b) (cond ((not (pair? a)) b) ((not (pair? b)) a) (else (let recur ((x (car a)) (a a) ; A is a pair; X = (CAR A). (y (car b)) (b b)) ; B is a pair; Y = (CAR B). (if (< y x) (let ((b (cdr b))) (if (pair? b) (cons y (recur x a (car b) b)) (cons y a))) (let ((a (cdr a))) (if (pair? a) (cons x (recur (car a) a y b)) (cons x b)))))))) ;;; This destructive merge does as few SET-CDR!s as it can -- for example, if ;;; the list is already sorted, it does no SET-CDR!s at all. It is also ;;; iterative, running in constant stack. (define (list-merge! < a b) ;; The logic of these two loops is completely driven by these invariants: ;; SCAN-A: (CDR PREV) = A. X = (CAR A). Y = (CAR B). ;; SCAN-B: (CDR PREV) = B. X = (CAR A). Y = (CAR B). (letrec ((scan-a (lambda (prev a x b y) ; Zip down A doing (if (< y x) ; no SET-CDR!s until (let ((next-b (cdr b))) ; we hit a B elt that (set-cdr! prev b) ; has to be inserted. (if (pair? next-b) (scan-b b a x next-b (car next-b)) (set-cdr! b a))) (let ((next-a (cdr a))) (if (pair? next-a) (scan-a a next-a (car next-a) b y) (set-cdr! a b)))))) (scan-b (lambda (prev a x b y) ; Zip down B doing (if (< y x) ; no SET-CDR!s until (let ((next-b (cdr b))) ; we hit an A elt that (if (pair? next-b) ; has to be (scan-b b a x next-b (car next-b)) ; inserted. (set-cdr! b a))) (let ((next-a (cdr a))) (set-cdr! prev a) (if (pair? next-a) (scan-a a next-a (car next-a) b y) (set-cdr! a b))))))) (cond ((not (pair? a)) b) ((not (pair? b)) a) ;; B starts the answer list. ((< (car b) (car a)) (let ((next-b (cdr b))) (if (null? next-b) (set-cdr! b a) (scan-b b a (car a) next-b (car next-b)))) b) ;; A starts the answer list. (else (let ((next-a (cdr a))) (if (null? next-a) (set-cdr! a b) (scan-a a next-a (car next-a) b (car b)))) a)))) ;;; Copyright ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; This code is ;;; Copyright (c) 1998 by Olin Shivers. ;;; The terms are: You may do as you please with this code, as long as ;;; you do not delete this notice or hold me responsible for any outcome ;;; related to its use. ;;; ;;; Blah blah blah. ;;; Code tuning & porting ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; This is very portable code. It's R4RS with the following exceptions: ;;; - The R5RS multiple-value VALUES & CALL-WITH-VALUES procedures for ;;; handling multiple-value return. ;;; ;;; This code is *tightly* bummed as far as I can go in portable Scheme. ;;; ;;; - The fixnum arithmetic in LIST-MERGE-SORT! and COUNTED-LIST-MERGE! ;;; that could be safely switched over to unsafe, fixnum-specific ops, ;;; if you're sure that 2*maxlen is a fixnum, where maxlen is the length ;;; of the longest list you could ever have. ;;; ;;; - I typically write my code in a style such that every CAR and CDR ;;; application is protected by an upstream PAIR?. This is the case in this ;;; code, so all the CAR's and CDR's could safely switched over to unsafe ;;; versions. But check over the code before you do it, in case the source ;;; has been altered since I wrote this. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; End of code extracted from Olin's lmsort.scm file. ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Start of code extracted from Olin's vmsort.scm file. ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; The sort package -- stable vector merge & merge sort -*- Scheme -*- ;;; Copyright (c) 1998 by Olin Shivers. ;;; This code is open-source; see the end of the file for porting and ;;; more copyright information. ;;; Olin Shivers 10/98. ;;; Exports: ;;; (vector-merge < v1 v2 [start1 end1 start2 end2]) -> vector ;;; (vector-merge! < v v1 v2 [start0 start1 end1 start2 end2]) -> unspecific ;;; ;;; (vector-merge-sort < v [start end temp]) -> vector ;;; (vector-merge-sort! < v [start end temp]) -> unspecific ;;; Merge ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; (vector-merge < v1 v2 [start1 end1 start2 end2]) -> vector ;;; (vector-merge! < v v1 v2 [start start1 end1 start2 end2]) -> unspecific ;;; ;;; Stable vector merge -- V1's elements come out ahead of equal V2 elements. (define (vector-merge < v1 v2 . maybe-starts+ends) (call-with-values (lambda () (vectors-start+end-2 v1 v2 maybe-starts+ends)) (lambda (start1 end1 start2 end2) (let ((ans (make-vector (+ (- end1 start1) (- end2 start2))))) (%vector-merge! < ans v1 v2 0 start1 end1 start2 end2) ans)))) (define (vector-merge! < v v1 v2 . maybe-starts+ends) (call-with-values (lambda () (if (pair? maybe-starts+ends) (values (car maybe-starts+ends) (cdr maybe-starts+ends)) (values 0 '()))) (lambda (start rest) (call-with-values (lambda () (vectors-start+end-2 v1 v2 rest)) (lambda (start1 end1 start2 end2) (%vector-merge! < v v1 v2 start start1 end1 start2 end2)))))) ;;; This routine is not exported. The code is tightly bummed. ;;; ;;; If these preconditions hold, the routine can be bummed to run with ;;; unsafe vector-indexing and fixnum arithmetic ops: ;;; - V V1 V2 are vectors. ;;; - START START1 END1 START2 END2 are fixnums. ;;; - (<= 0 START END0 (vector-length V), ;;; where end0 = start + (end1 - start1) + (end2 - start2) ;;; - (<= 0 START1 END1 (vector-length V1)) ;;; - (<= 0 START2 END2 (vector-length V2)) ;;; If you put these error checks in the two client procedures above, you can ;;; safely convert this procedure to use unsafe ops -- which is why it isn't ;;; exported. This will provide *huge* speedup. (define (%vector-merge! elt< v v1 v2 start start1 end1 start2 end2) (letrec ((vblit (lambda (fromv j i end) ; Blit FROMV[J,END) to V[I,?]. (let lp ((j j) (i i)) (vector-set! v i (vector-ref fromv j)) (let ((j (+ j 1))) (if (< j end) (lp j (+ i 1)))))))) (cond ((<= end1 start1) (if (< start2 end2) (vblit v2 start2 start end2))) ((<= end2 start2) (vblit v1 start1 start end1)) ;; Invariants: I is next index of V to write; X = V1[J]; Y = V2[K]. (else (let lp ((i start) (j start1) (x (vector-ref v1 start1)) (k start2) (y (vector-ref v2 start2))) (let ((i1 (+ i 1))) ; "i+1" is a complex number in R4RS! (if (elt< y x) (let ((k (+ k 1))) (vector-set! v i y) (if (< k end2) (lp i1 j x k (vector-ref v2 k)) (vblit v1 j i1 end1))) (let ((j (+ j 1))) (vector-set! v i x) (if (< j end1) (lp i1 j (vector-ref v1 j) k y) (vblit v2 k i1 end2)))))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; End of code extracted from Olin's vmsort.scm file. ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
false
ebe3a3e0a5d8d35f271ef8effcef08b306f495b9
7bb46aae01373511eabd2cef8ddcb81d3abd7c7d
/while.ss
afd9d793883a068da3729b1934a9fca5f26411ef
[]
no_license
liutanyu/BlogCode
13959dbd9d435a67379f871e4fc0297cfeb7cffd
2039f1ca4f3f383c4e78e7dfd6abef95cefb586f
refs/heads/master
2021-01-19T15:29:04.195514
2013-07-12T09:39:37
2013-07-12T09:39:37
8,969,089
2
0
null
null
null
null
UTF-8
Scheme
false
false
542
ss
while.ss
#lang scheme ;; Define new syntax: while ;; Tan-Yu Liu 2013.3.2 ;; Test in racket5.3 ;; Note the real while implimetation do not need the "hello contiunation" string. (define-syntax while (syntax-rules () ((_ pred b1 ...) (call/cc (lambda (break) (let loop () (if pred (begin b1 ...) (break "hello continuation")) (loop))))))) ;; Test (define a 1) (while (< a 12) (display a) (set! a (+ 1 a)) (newline))
true
f6063e6dfb92d743a39307548209c567c15e112f
abc7bd420c9cc4dba4512b382baad54ba4d07aa8
/src/ws/util/hashtab.sls
f0a3bf955726ccbbfa77b020e5e154cae40565b8
[ "BSD-3-Clause" ]
permissive
rrnewton/WaveScript
2f008f76bf63707761b9f7c95a68bd3e6b9c32ca
1c9eff60970aefd2177d53723383b533ce370a6e
refs/heads/master
2021-01-19T05:53:23.252626
2014-10-08T15:00:41
2014-10-08T15:00:41
1,297,872
10
2
null
null
null
null
UTF-8
Scheme
false
false
1,124
sls
hashtab.sls
#!r6rs ;;;; [2008.04.24] R6RS has hash tables. But WS is already ;;;; standardized across a particular interface, so here we wrap R6RS ;;;; hash tables. (library (ws util hashtab) (export make-default-hash-table hashtab? hashtab-get hashtab-set! hashtab-for-each hashtab-remove!) (import (except (rnrs (6)) error)) (define (void) (if #f #t)) ;; Equal? based by default: ;(define (make-default-hash-table . _) (make-hashtable equal-hash equal?)) ;; Eq? based by default: (define make-default-hash-table (case-lambda [() (make-eq-hashtable)] [(n) (make-eq-hashtable n)])) (begin (define hashtab? hashtable?) (define hashtab-remove! hashtable-delete!) (define (hashtab-for-each f ht) (call-with-values (lambda () (hashtable-entries ht)) (lambda (keys vals) (define bound (vector-length keys)) (let loop ([i 0]) (if (fx=? i bound) (void) (begin (f (vector-ref keys i) (vector-ref vals i)) (loop (fx+ 1 i)))))))) (define (hashtab-get ht k) (hashtable-ref ht k #f)) (define hashtab-set! hashtable-set!)) ) ;; End library
false
ee33454ce5417d04b0566b0d0ab0da63b9221f84
a09ad3e3cf64bc87282dea3902770afac90568a7
/4/12.scm
5e7fd6a077858f4da1a98571ffcfa3b0c2715767
[]
no_license
lockie/sicp-exercises
aae07378034505bf2e825c96c56cf8eb2d8a06ae
011b37387fddb02e59e05a70fa3946335a0b5b1d
refs/heads/master
2021-01-01T10:35:59.759525
2018-11-30T09:35:35
2018-11-30T09:35:35
35,365,351
0
0
null
null
null
null
UTF-8
Scheme
false
false
2,721
scm
12.scm
#lang sicp (define (enclosing-environment env) (cdr env)) (define (first-frame env) (car env)) (define the-empty-environment '()) (define (extend-environment vars vals base-env) (if (= (length vars) (length vals)) (cons (make-frame vars vals) base-env) (if (< (length vars) (length vals)) (error "Получено слишком много аргументов" vars vals) (error "Получено слишком мало аргументов" vars vals)))) (define (make-frame variables values) (cons variables values)) (define (frame-variables frame) (car frame)) (define (frame-values frame) (cdr frame)) (define (add-binding-to-frame! var val frame) (set-car! frame (cons var (car frame))) (set-cdr! frame (cons val (cdr frame)))) (define (env-scan var vars vals recurse) (cond ((null? vars) (recurse)) ((eq? var (car vars)) vals) (else (env-scan var (cdr vars) (cdr vals) recurse)))) (define (lookup-variable-value var env) (define (env-loop env) (if (eq? env the-empty-environment) (error "Несвязанная переменная" var) (let ((frame (first-frame env))) (car (env-scan var (frame-variables frame) (frame-values frame) (lambda () (env-loop (enclosing-environment env)))))))) (env-loop env)) (define (set-variable-value! var val env) (define (env-loop env) (if (eq? env the-empty-environment) (error "Несвязанная переменная -- SET!" var) (let ((frame (first-frame env))) (set-car! (env-scan var (frame-variables frame) (frame-values frame) (lambda () (env-loop (enclosing-environment env)))) val)))) (env-loop env)) (define (define-variable! var val env) (let ((frame (first-frame env))) (set-car! (env-scan var (frame-variables frame) (frame-values frame) (lambda () (add-binding-to-frame! var val frame) (cons 'ok nil))) val))) (define test-env the-empty-environment) (set! test-env (extend-environment '(b) '(42) test-env)) (define-variable! 'a 1 test-env) (lookup-variable-value 'a test-env) (set-variable-value! 'a 42 test-env) (lookup-variable-value 'a test-env)
false
6d3c1946be36d5052ed1ee501866691738540bb0
6b961ef37ff7018c8449d3fa05c04ffbda56582b
/bbn_cl/mach/runtime/vector.scm
bc4fe0615d395d9944bf8c60c0b47ba535ef3722
[]
no_license
tinysun212/bbn_cl
7589c5ac901fbec1b8a13f2bd60510b4b8a20263
89d88095fc2a71254e04e57cf499ae86abf98898
refs/heads/master
2021-01-10T02:35:18.357279
2015-05-26T02:44:00
2015-05-26T02:44:00
36,267,589
4
3
null
null
null
null
UTF-8
Scheme
false
false
5,489
scm
vector.scm
;;; -*-Scheme-*- ;;; ;;; ;;; Copyright (c) 1987 Massachusetts Institute of Technology ;;; ;;; This material was developed by the Scheme project at the ;;; Massachusetts Institute of Technology, Department of ;;; Electrical Engineering and Computer Science. Permission to ;;; copy this software, to redistribute it, and to use it for any ;;; purpose is granted, subject to the following restrictions and ;;; understandings. ;;; ;;; 1. Any copy made of this software must include this copyright ;;; notice in full. ;;; ;;; 2. Users of this software agree to make their best efforts (a) ;;; to return to the MIT Scheme project any improvements or ;;; extensions that they make, so that these may be included in ;;; future releases; and (b) to inform MIT of noteworthy uses of ;;; this software. ;;; ;;; 3. All materials developed as a consequence of the use of this ;;; software shall duly acknowledge such use, in accordance with ;;; the usual standards of acknowledging credit in academic ;;; research. ;;; ;;; 4. MIT has made no warrantee or representation that the ;;; operation of this software will be error-free, and MIT is ;;; under no obligation to provide any services, by way of ;;; maintenance, update, or otherwise. ;;; ;;; 5. In conjunction with products arising from the use of this ;;; material, there shall be no use of the name of the ;;; Massachusetts Institute of Technology nor of any adaptation ;;; thereof in any advertising, promotional, or sales literature ;;; without prior written consent from MIT in each case. ;;; ;;;; Operations on Vectors (declare (usual-integrations)) ;;; Standard Procedures (let-syntax () (define-macro (define-primitives . names) `(BEGIN ,@(map (lambda (name) `(LOCAL-ASSIGNMENT system-global-environment ',name ,(make-primitive-procedure name))) names))) (define-primitives vector-length vector-ref vector-set! list->vector vector vector-cons subvector->list subvector-move-right! subvector-move-left! subvector-fill!)) (let-syntax () (define-macro (define-type-predicate name type-name) `(DEFINE (,name OBJECT) (PRIMITIVE-TYPE? ,(microcode-type type-name) OBJECT))) (define-type-predicate vector? vector)) (define (make-vector size #!optional fill) (if (unassigned? fill) (set! fill false)) (vector-cons size fill)) (define (vector->list vector) (subvector->list vector 0 (vector-length vector))) (define (vector-fill! vector value) (subvector-fill! vector 0 (vector-length vector) value)) #| ;;; Nonstandard Primitives (let-syntax ((check-type (let ((type (microcode-type 'VECTOR))) (macro (object) `(IF (NOT (PRIMITIVE-TYPE? ,type ,object)) (ERROR "Wrong type argument" ,object))))) (check-target (macro (object index) `(BEGIN (CHECK-TYPE ,object) (IF (NOT (AND (NOT (NEGATIVE? ,index)) (<= ,index (VECTOR-LENGTH ,object)))) (ERROR "Index out of range" ,index))))) (check-subvector (macro (object start end) `(BEGIN (CHECK-TYPE ,object) (IF (NOT (AND (NOT (NEGATIVE? ,start)) (<= ,start ,end) (<= ,end (VECTOR-LENGTH ,object)))) (ERROR "Indices out of range" ,start ,end)))))) (define (subvector-move-right! vector1 start1 end1 vector2 start2) (define (loop index1 index2) (if (<= start1 index1) (begin (vector-set! vector2 index2 (vector-ref vector1 index1)) (loop (-1+ index1) (-1+ index2))))) (check-subvector vector1 start1 end1) (check-target vector2 start2) (loop (-1+ end1) (-1+ (+ start2 (- end1 start1))))) (define (subvector-move-left! vector1 start1 end1 vector2 start2) (define (loop index1 index2) (if (< index1 end1) (begin (vector-set! vector2 index2 (vector-ref vector1 index1)) (loop (1+ index1) (1+ index2))))) (check-subvector vector1 start1 end1) (check-target vector2 start2) (loop start1 start2)) (define (subvector-fill! vector start end value) (define (loop index) (if (< index end) (begin (vector-set! vector index value) (loop (1+ index))))) (check-subvector vector start end) (loop start)) )|# ;;; Nonstandard Procedures (define (vector-copy vector) (let ((length (vector-length vector))) (let ((new-vector (make-vector length))) (subvector-move-right! vector 0 length new-vector 0) new-vector))) (define (make-initialized-vector length initialization) (let ((vector (make-vector length))) (define (loop n) (if (= n length) vector (begin (vector-set! vector n (initialization n)) (loop (1+ n))))) (loop 0))) (define (vector-map vector procedure) (let ((length (vector-length vector))) (if (zero? length) vector (let ((result (make-vector length))) (define (loop i) (vector-set! result i (procedure (vector-ref vector i))) (if (zero? i) result (loop (-1+ i)))) (loop (-1+ length)))))) (define (vector-grow vector length) (let ((new-vector (make-vector length))) (subvector-move-right! vector 0 (vector-length vector) new-vector 0) new-vector)) (define (vector-first vector) (vector-ref vector 0)) (define (vector-second vector) (vector-ref vector 1)) (define (vector-third vector) (vector-ref vector 2)) (define (vector-fourth vector) (vector-ref vector 3)) (define (vector-fifth vector) (vector-ref vector 4)) (define (vector-sixth vector) (vector-ref vector 5)) (define (vector-seventh vector) (vector-ref vector 6)) (define (vector-eighth vector) (vector-ref vector 7))
false
6fb2604d4e81a6959a86f987564f1fc712b30fe9
4da2fdf33d85021ce3c5aa459ccc998cc3a6b95d
/c1-tests.scm
ae877546fd9b0317e7fde0f9ca5c94b1c1f6c7b6
[]
no_license
pzel/sicp
7bdd9e5fa8648eff8fabdc80aad4df67d2c12618
99bace346cc1224724fe715644704f8889b2f6a9
refs/heads/master
2022-08-30T21:02:26.948669
2016-05-28T17:40:05
2016-05-28T17:40:05
7,996,775
0
1
null
null
null
null
UTF-8
Scheme
false
false
1,277
scm
c1-tests.scm
(load "./c1.scm") (load "./test.scm") (run-tests '( (=? '(abs -2) 2) (=? '(abs 2) 2) (=? '(abs 0) 0) (=?~ '(half-interval-method sin 2.0 4.0) 3.1415) (=?~ '(half-interval-method (lambda(x) (- (* x x x) (* 2 x) 3)) 1.0 2.0) 1.8930) (=?~ '(fixed-point cos 0.1) 0.73908) (=?~ '(fixed-point (lambda(y) (+ (sin y) (cos y))) 1.0) 1.2587) (=?~ '(sqrt 25) 5.0) (=?~ '(fixed-point (lambda(y) (+ 1 (/ 1 y))) 0.1) golden-mean) (=?~ '(f136-damp) 4.55554) ; Thanks, Wolfram Alpha! (=?~ '(f136-nodamp) 4.55554) (=?~ '(cont-frac (lambda(i) 1.0) (lambda(i) 1.0) + 8) (/ 1 golden-mean)) (=?~ '(cont-fracc (lambda(i) 1.0) (lambda(i) 1.0) + 8) (/ 1 golden-mean)) (=?~ '(cont-frac (lambda(i) 1.0) euler-denom + 8) (- E 2)) (=?~ '(tan-cf 1 5) 1.5574) (=?~ '(tan-cf 2 10) -2.185) (=?~ '(tan-cf 3 15) -0.1425) (=?~ '(newtons-method (cubic 1 2 3) 0.1) -1.27568) (=?~ '(newtons-method (cubic 3 7 11) 0.1) -2.13473) (=? '((double incr) 0) 2) (=? '(((double (double double)) incr) 0) 16) (=? '(((double (double (double double))) incr) 0) 256) (=? '((compose square incr) 2) 9) (=? '((repeated square 0) 2) 2) (=? '((repeated square 1) 2) 4) (=? '((repeated square 3) 2) 256) ))
false
df717021d1af90264311129584063c11943c066e
6b961ef37ff7018c8449d3fa05c04ffbda56582b
/bbn_cl/mach/cl/clchap16-a-1.scm
4b9343105d2492386ad4a3a9a74c1e701ec620ce
[]
no_license
tinysun212/bbn_cl
7589c5ac901fbec1b8a13f2bd60510b4b8a20263
89d88095fc2a71254e04e57cf499ae86abf98898
refs/heads/master
2021-01-10T02:35:18.357279
2015-05-26T02:44:00
2015-05-26T02:44:00
36,267,589
4
3
null
null
null
null
UTF-8
Scheme
false
false
4,743
scm
clchap16-a-1.scm
;;; ******** ;;; ;;; Copyright 1992 by BBN Systems and Technologies, A division of Bolt, ;;; Beranek and Newman Inc. ;;; ;;; Permission to use, copy, modify and distribute this software and its ;;; documentation is hereby granted without fee, provided that the above ;;; copyright notice and this permission appear in all copies and in ;;; supporting documentation, and that the name Bolt, Beranek and Newman ;;; Inc. not be used in advertising or publicity pertaining to distribution ;;; of the software without specific, written prior permission. In ;;; addition, BBN makes no respresentation about the suitability of this ;;; software for any purposes. It is provided "AS IS" without express or ;;; implied warranties including (but not limited to) all implied warranties ;;; of merchantability and fitness. In no event shall BBN be liable for any ;;; special, indirect or consequential damages whatsoever resulting from ;;; loss of use, data or profits, whether in an action of contract, ;;; negligence or other tortuous action, arising out of or in connection ;;; with the use or performance of this software. ;;; ;;; ******** ;;; ;;; (eval-when (compile) (load "clchap16-macros.bin") (load "clchap16-comm.bin")) (export '(hash-table hash-table-p make-hash-table gethash remhash maphash clrhash hash-table-count sxhash)) (cl-define sxhash-simple-string (make-primitive-procedure 'sx-hash-simple-string)) ;;; A hash-table-table is a vector of association lists. When an ;;; entry is made in a hash table, a pair of (key . value) is consed onto ;;; the element in the vector arrived at by hashing. ;;; How to print one: (defvar *print-base*) (defvar *print-radix*) (defun %print-hash-table (structure stream depth) depth (write-string "#<" stream) (write-string (symbol-name (hash-table-kind structure)) stream) (write-string " Hash Table, " stream) (let ((n (hash-table-number-entries structure))) (write n :stream stream) (write-string (if (= n 1) " entry, " " entries, ") stream)) (let ((*print-base* 16) (*print-radix* t)) (write (primitive-datum structure) :stream stream)) (write-string ">")) ;;; Rehashing functions: (defun almost-primify (num) (declare (fixnum num)) "Almost-Primify returns an almost prime number greater than or equal to NUM." (if (= (rem num 2) 0) (setq num (+ 1 num))) (if (= (rem num 3) 0) (setq num (+ 2 num))) (if (= (rem num 7) 0) (setq num (+ 4 num))) num) (defun rehash (structure hash-vector new-length) (declare (simple-vector hash-vector)) (declare (fixnum new-length)) "Rehashes a hash table and replaces the TABLE entry in the structure if someone hasn't done so already. New vector is of NEW-LENGTH." (do ((new-vector (make-array new-length)) (i 0 (1+ i)) (size (hash-table-size structure)) (hashing-function (case (hash-table-kind structure) (eq #'(lambda (x) (eq-hash x))) (eql #'(lambda (x) (eql-hash x))) (equal #'(lambda (x) (equal-hash x)))))) ((= i size) (cond ((eq hash-vector (hash-table-table structure)) (cond ((> new-length size) (setf (hash-table-table structure) new-vector) (setf (hash-table-rehash-threshold structure) (grow-rehash-threshold structure new-length)) (setf (hash-table-size structure) new-length)) (t (setf (hash-table-table structure) new-vector))) ;;don't think this is needed for bfly lisp (dca), since scheme "hash" ;;is gc-independent ;; (if (not (eq (hash-table-kind structure) 'equal)) ;; (%sp-set-vector-subtype new-vector ;; (+ 2 (%sp-get-newspace-bit)))) ))) (declare (fixnum i size)) (do ((bucket (aref hash-vector i) (cdr bucket))) ((null bucket)) (hash-set new-vector (caar bucket) (cdar bucket) new-length hashing-function)))) ;;; Making hash tables: (defun make-hash-table (&key (test 'eql) (size 65) (rehash-size 101) rehash-threshold) "Creates and returns a hash table. See manual for details." (declare (fixnum size)) (cond ((eq test #'eq) (setq test 'eq)) ((eq test #'eql) (setq test 'eql)) ((eq test #'equal) (setq test 'equal))) (if (not (memq test '(eq eql equal))) (error "~S is an illegal :Test for hash tables." test)) (setq size (if (<= size 37) 37 (almost-primify size))) (cond ((null rehash-threshold) (setq rehash-threshold size)) ((floatp rehash-threshold) (setq rehash-threshold (ceiling (* rehash-threshold size))))) (make-hash-table-structure :size size :rehash-size rehash-size :rehash-threshold rehash-threshold :table (make-array size) :kind test))
false
dc136dfe842d038a84665899494bce01435d42eb
86421b0c61e7771ff4d88058cbeaf89a3ec7c01d
/exercises/2.77-2.97.scm
e5f49d9649a0cada1a6cb6dc3ba26a4781f20942
[]
no_license
manhtai/sicp
1b354c89795dff516264687c473daadc9e867c56
7730c6bbf537341d8781ede7d8f6b35384d5a802
refs/heads/master
2021-01-18T14:11:28.706888
2015-04-25T03:51:10
2015-04-25T03:51:10
40,075,797
0
0
null
null
null
null
UTF-8
Scheme
false
false
19,938
scm
2.77-2.97.scm
;; ========================================================================== ;; GENERIC OPERATIONS ;; ========================================================================== (define (add x y) (apply-generic 'add x y)) (define (sub x y) (apply-generic 'sub x y)) (define (mul x y) (apply-generic 'mul x y)) (define (div x y) (apply-generic 'div x y)) (define (install-scheme-number-package) (define (tag x) (attach-tag 'scheme-number x)) (put 'add '(scheme-number scheme-number) (lambda (x y) (tag (+ x y)))) (put 'sub '(scheme-number scheme-number) (lambda (x y) (tag (- x y)))) (put 'mul '(scheme-number scheme-number) (lambda (x y) (tag (* x y)))) (put 'div '(scheme-number scheme-number) (lambda (x y) (tag (/ x y)))) (put 'make 'scheme-number (lambda (x) (tag x))) 'done) (install-scheme-number-package) (define (make-scheme-number n) ((get 'make 'scheme-number) n)) (define (install-rational-package) ;; internal procedures (define (numer x) (car x)) (define (denom x) (cdr x)) (define (make-rat n d) (let ((g (gcd n d))) (cons (/ n g) (/ d g)))) (define (add-rat x y) (make-rat (+ (* (numer x) (denom y)) (* (numer y) (denom x))) (* (denom x) (denom y)))) (define (sub-rat x y) (make-rat (- (* (numer x) (denom y)) (* (numer y) (denom x))) (* (denom x) (denom y)))) (define (mul-rat x y) (make-rat (* (numer x) (numer y)) (* (denom x) (denom y)))) (define (div-rat x y) (make-rat (* (numer x) (denom y)) (* (denom x) (numer y)))) ;; interface to rest of the system (define (tag x) (attach-tag 'rational x)) (put 'add '(rational rational) (lambda (x y) (tag (add-rat x y)))) (put 'sub '(rational rational) (lambda (x y) (tag (sub-rat x y)))) (put 'mul '(rational rational) (lambda (x y) (tag (mul-rat x y)))) (put 'div '(rational rational) (lambda (x y) (tag (div-rat x y)))) (put 'make '(rational) (lambda (n d) (tag (make-rat n d)))) 'done) (define (make-rational n d) ((get 'make 'rational) n d)) (install-rational-package) ;; EXERCISE 2.77 ;; Required packages (define (install-rectangular-package) ;; internal procedures (define (real-part z) (car z)) (define (imag-part z) (cdr z)) (define (make-from-real-imag x y) (cons x y)) (define (magnitude z) (sqrt (+ (square (real-part z)) (square (imag-part z))))) (define (angle z) (atan (imag-part z) (real-part z))) (define (make-from-mag-ang r a) (cons (* r (cos a)) (* r (sin a)))) ;; interface to the rest of the system (define (tag x) (attach-tag 'rectangular x)) (put 'real-part '(rectangular) real-part) (put 'imag-part '(rectangular) imag-part) (put 'magnitude '(rectangular) magnitude) (put 'angle '(rectangular) angle) (put 'make-from-real-imag 'rectangular (lambda (x y) (tag (make-from-real-imag x y)))) (put 'make-from-mag-ang 'rectangular (lambda (r a) (tag (make-from-mag-ang r a)))) 'done) (define (install-polar-package) ;; internal procedures (define (magnitude z) (car z)) (define (angle z) (cdr z)) (define (make-from-mag-ang r a) (cons r a)) (define (real-part z) (* (magnitude z) (cos (angle z)))) (define (imag-part z) (* (magnitude z) (sin (angle z)))) (define (make-from-real-imag x y) (cons (sqrt (+ (square x) (square y))) (atan y x))) ;; interface to the rest of the system (define (tag x) (attach-tag 'polar x)) (put 'real-part '(polar) real-part) (put 'imag-part '(polar) imag-part) (put 'magnitude '(polar) magnitude) (put 'angle '(polar) angle) (put 'make-from-real-imag 'polar (lambda (x y) (tag (make-from-real-imag x y)))) (put 'make-from-mag-ang 'polar (lambda (r a) (tag (make-from-mag-ang r a)))) 'done) ;; Build complex package (define (install-complex-package) ;; imported procedures from rectangular and polar packages (define (make-from-real-imag x y) ((get 'make-from-real-imag 'rectangular) x y)) (define (make-from-mag-ang r a) ((get 'make-from-mag-ang 'polar) r a)) ;; internal procedures (define (add-complex z1 z2) (make-from-real-imag (+ (real-part z1) (real-part z2)) (+ (imag-part z1) (imag-part z2)))) (define (sub-complex z1 z2) (make-from-real-imag (- (real-part z1) (real-part z2)) (- (imag-part z1) (imag-part z2)))) (define (mul-complex z1 z2) (make-from-mag-ang (* (magnitude z1) (magnitude z2)) (+ (angle z1) (angle z2)))) (define (div-complex z1 z2) (make-from-mag-ang (/ (magnitude z1) (magnitude z2)) (- (angle z1) (angle z2)))) ;; interface to rest of the system (define (tag z) (attach-tag 'complex z)) (put 'add '(complex complex) (lambda (z1 z2) (tag (add-complex z1 z2)))) (put 'sub '(complex complex) (lambda (z1 z2) (tag (sub-complex z1 z2)))) (put 'mul '(complex complex) (lambda (z1 z2) (tag (mul-complex z1 z2)))) (put 'div '(complex complex) (lambda (z1 z2) (tag (div-complex z1 z2)))) (put 'make-from-real-imag 'complex (lambda (x y) (tag (make-from-real-imag x y)))) (put 'make-from-mag-ang 'complex (lambda (r a) (tag (make-from-mag-ang r a)))) ;; Alyssa idea (put 'real-part '(complex) real-part) (put 'imag-part '(complex) imag-part) (put 'magnitude '(complex) magnitude) (put 'angle '(complex) angle) 'done) ;; Install package to system (install-rectangular-package) (install-polar-package) (install-complex-package) ;; Add some new operations (define (make-complex-from-real-imag x y) ((get 'make-from-real-imag 'complex) x y)) (define (make-complex-from-mag-ang r a) ((get 'make-from-mag-ang 'complex) r a)) ;; Add new generic operation (define (magnitude x) (apply-generic 'magnitude x)) ;; Test z (define z (make-complex-from-real-imag 3 4)) (magnitude z) ; 5 ;; z = '(complex rectangular 3 . 4) ;; (magnitude z) ;; (apply-generic 'magnitude z) ;; type-tags = (type-tag z) = 'complex ;; proc = (get 'magnitude 'complex) ;; If we don't put magnitude operation into complex type it will raise an error ;; If we put magnitude into complex type then: ;; proc = magnitude ;; (contents z) = (rectangular 3 . 4) ;; We apply magnitude operation to content of z ;; (magnitude (rectangular 3 . 4)) ;; (apply-generic 'magnitude (rectangular 3 . 4)) ;; type-tags = 'rectangular ;; proc = (get 'magnitude 'rectangular) = (sqrt ...) ;; Now the proc is evaluate directly and give us result 5 ;; => Two times 'apply-generic' invoked ;; EXERCISE 2.78: ;; New tag system (define (attach-tag type-tag contents) (if (number? contents) contents (cons type-tag contents))) (define (type-tag datum) (cond ((pair? datum) (car datum)) ((number? datum) 'scheme-number) (error "Bad tagged datum -- TYPE-TAG" datum))) (define (contents datum) (cond ((pair? datum) (cdr datum)) ((number? datum) datum) (error "Bad tagged datum -- CONTENTS" datum))) (make-scheme-number 8) ;; EXERCISE 2.79 ;; 'equ?' generic predicate (define (equ? a b) (apply-generic 'equ? a b)) (define (install-equ-package) ;; Update for ordinary numbers (define ordinary-equ? =) ;; Update for rational numbers (define numer car) (define denom cdr) (define (rational-equ? x y) (= (* (numer x) (denom y)) (* (numer y) (denom x)))) ;; Update complex package (define (complex-equ? a b) (and (= (real-part a) (real-part b)) (= (imag-part a) (imag-part b)))) ;; Put (put 'equ? '(scheme-number scheme-number) ordinary-equ?) (put 'equ? '(rational rational) rational-equ?) (put 'equ? '(complex complex) complex-equ?)) (install-equ-package) ;; Helper (define (real-part x) (apply-generic 'real-part x)) (define (imag-part x) (apply-generic 'imag-part x)) ;; Test (equ? (make-complex-from-real-imag 3 4) (make-complex-from-real-imag 3 4)) (equ? (make-scheme-number 10) (make-scheme-number 10)) (equ? (make-rational 10 5) (make-rational 2 1)) (equ? (make-rational 10 5) (make-rational 3 1)) ;; EXERCISE 2.80 ;; '=zero?' generic predicate (define (=zero? x) (apply-generic '=zero? x)) (define (install-zero-package) ;; Update for ordinary numbers (put '=zero? '(scheme-number) zero?) ;; Update for rational numbers (put '=zero? '(rational) (lambda (x) (zero? (car x)))) ;; Update complex package (put '=zero? '(complex) (lambda (x) (= (real-part x) (imag-part x) 0)))) (install-zero-package) ;; Test (=zero? (make-complex-from-real-imag 0 0)) (=zero? (make-scheme-number 0)) (=zero? (make-rational 0 1)) (=zero? (make-rational 1 1)) ;; => Think about 2.76: ;; When new operation arrives, with data-directed approach we must write a package to update ;; it to all old correspoding data types ;; We will talk about this more latter ;) ;; ========================================================================== ;; COERCION ;; ========================================================================== ;; EXERCISE 2.81 (define (scheme-number->scheme-number n) n) (define (complex->complex z) z) (put-coercion 'scheme-number 'scheme-number scheme-number->scheme-number) (put-coercion 'complex 'complex complex->complex) ;; a) ;; If we call exp with two complex numbers: ;; (exp (complex a) (complex b)) ;; Since there is no 'exp' procedure for 'complex' type in the table, apply-generic ;; will look up in coercion table and find out 'complex->complex' coercion, it will try ;; to apply it, and the expression becomes ;; (exp (complex a) (complex b)) ;; which is same as before => This will cause an infinite loop. ;; b) ;; 'apply-generic' works correctly as it does. We don't need to add anything, but if ;; we still want it doesn't try coercion if 2 arguments have the same type, we can do c) ;; 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) ;; Test for type, if they are same, raise error (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))))))) ;; EXERCISE 2.82 ;; Multiple arguments version ;; Idea: attempt to coerce all the arguments to the type of the first argument, ;; then to the type of the second argument, and so on. ;; I leave it here as a challenge ;; EXERCISE 2.83 ;; Define generic raise (define (raise x) (apply-generic 'raise x)) ;; complex ;; ^ ;; real ;; ^ ;; rational ;; ^ ;; integer ;; Make a dispatched package (define (install-raise-package) (put 'raise '(integer) (lambda (x) (make-rational x 1))) (put 'raise '(rational) (lambda (x) (make-real (/ (numer x) (denom x))))) (put 'raise '(real) (lambda (x) (make-from-real-imag x 0)))) (install-raise-package) ;; Note: to use this pacakge you need to build integer and real package beside complex package ;; which we've developed ;; EXERCISE 2.84 ;; Raise type in a tower (define (apply-generic op . args) ;; raise l to h (define (raise-to l h) (let ((l-type (type-tag l)) (h-type (type-tag h))) (cond ((equal? l-type h-type) l) ((get 'raise (list l-type)) (raise-to ((get 'raise (list l-type))) (contents l)) h) (else #f)))) ;; from now on it is same as 2.81 ;; so everything is work consistent with the rest (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) ;; Test for type, if they are same, raise error (error "No method for these types" (list op type-tags)) (let ((t1->t2 (raise-to type1 type2)) (t2->t1 (raise-to 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))))))) ;; EXERCISE 2.85 ;; Define generic drop (define (drop x) (apply-generic 'drop x)) ;; complex ;; 𝈍 ;; real ;; 𝈍 ;; rational ;; 𝈍 ;; integer ;; Make a dispatched package (define (install-drop-pacakge) (put 'drop '(complex) (lambda (x) (make-real (real-part x)))) (put 'drop '(real) (lambda (x) (make-integer (floor x)))) (put 'drop '(rational) (lambda (x) (make-integer (floor (/ (numer x) (denom x))))))) (install-drop-package) ;; Note: to use this pacakge you need to build integer and real package beside complex package ;; which we've developed ;; Now we use in to rewrite apply-generic (define (apply-generic op . args) ;; raise l to h (define (raise-to l h) (let ((l-type (type-tag l)) (h-type (type-tag h))) (cond ((equal? l-type h-type) l) ((get 'raise (list l-type)) (raise-to ((get 'raise (list l-type))) (contents l)) h) (else #f)))) ;; drop h to l (define (drop-to h l) (let ((l-type (type-tag l)) (h-type (type-tag h))) (cond ((equal? l-type h-type) l) ((get 'drop (list h-type)) (drop-to ((get 'drop (list h-type))) (contents h)) l) (else #f)))) ;; dropable? (define (dropable? h l) (equ? h (raise-to (drop-to h l) h))) ;; from now on it is same as 2.81 ;; so everything is work consistent with the rest (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) ;; Test for type, if they are same, raise error (error "No method for these types" (list op type-tags)) (let ((t1->t2? (dropable? type1 type2)) (t2->t1? (dropable? type2 type1)) (t1->t2 (raise-to type1 type2)) (t2->t1 (raise-to type2 type1))) (cond (t1->t2? (apply-generic op ((drop-to type1 type2) a1) a2)) (t2->t1? (apply-generic op a1 ((drop-to type2 type1) a2))) (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))))))) ;; EXERCISE 2.86 ;; To accomodate the changes: ;; - We need to change +, -, *, / to add, sub, mul, div generic operations ;; - We need to implement square, square-root, sine, cosine, arctan generic operations ;; And apply that to 3 packages: rectangular, polar, complex (define (cosine x) (apply-generic 'cosine x)) (define (sine x) (apply-generic 'sine x)) (define (arctan x) (apply-generic 'arctan x)) (define (square-root x) (apply-generic 'square-root x)) (define (square x) (apply-generic 'square x)) ;; I leaves implementation details to Geogre ;; ========================================================================== ;; SYMBOLIC ALGEBRA ;; WARNING: UNDONE JOB!!! ;; ========================================================================== ;; EXERCISE 2.87 ;; Conditions: ;; - All terms must be zero ;; - Term is considered zero when its coefficient is zero (define (install-poly-zero-package) (define (zero-poly? poly) (define (zero-term? termlist) (or (empty-termlist? termlist) (and (=zero? (coeff (first-term termlist))) (zero-term? (rest-terms termlist))))) (zero-term? (term-list poly))) ;; Update for polynomials numbers (put '=zero? '(polynomials) 'zero-poly?)) (install-zero-package) ;; EXERCISE 2.88 ;; Works: ;; - Build generic 'negate' for scheme-number, rational, complex and polynomial type ;; - Build 'sub' for polynomial type (defie (negate x) (apply-generic 'negate x)) (define (install-negate-package) (put 'negate 'scheme-number (lambda (x) (tag (- x)))) (put 'negate 'rational (lambda (rat) (make-rat (- (numer rat)) (- (denom rat))))) (put 'negate 'complex (lambda (comp) (make-from-real-imag (- (real-part comp)) (- (imag-part comp))))) (define (negate-terms termlist) ;; Negate procedure for termlist ) (put 'negate '(polynomial) (lambda (poly) (make-polynomial (variable poly) (negate-terms (term-list poly)))))) (define (install-sub-poly-package) (put 'sub '(polynomial polynomial) (lambda (x y) (tag (add-poly x (negate y)))))) (install-negate-package) (install-sub-poly-package) ;; EXERCISE 2.89 ;; EXERCISE 2.90 ;; EXERCISE 2.91 (define (div-terms L1 L2) (if (empty-termlist? L1) (list (the-empty-termlist) (the-empty-termlist)) (let ((t1 (first-term L1)) (t2 (first-term L2))) (if (> (order t2) (order t1)) (list (the-empty-termlist) L1) (let ((new-c (div (coeff t1) (coeff t2))) (new-o (- (order t1) (order t2)))) (let ((rest-of-result ??FILL-THIS-IN?? ;compute rest of result recursively )) ??FILL-THIS-IN?? ;form complete result )))))) ;; EXERCISE 2.93 ;: (define p1 (make-polynomial 'x '((2 1)(0 1)))) ;: (define p2 (make-polynomial 'x '((3 1)(0 1)))) ;: (define rf (make-rational p2 p1)) ;; Rational functions (define (gcd a b) (if (= b 0) a (gcd b (remainder a b)))) (define (gcd-terms a b) (if (empty-termlist? b) a (gcd-terms b (remainder-terms a b)))) ;; EXERCISE 2.94 ;: (define p1 (make-polynomial 'x '((4 1) (3 -1) (2 -2) (1 2)))) ;: (define p2 (make-polynomial 'x '((3 1) (1 -1)))) ;: (greatest-common-divisor p1 p2) ;; EXERCISE 2.97 (define (reduce-integers n d) (let ((g (gcd n d))) (list (/ n g) (/ d g)))) ;: (define p1 (make-polynomial 'x '((1 1)(0 1)))) ;: (define p2 (make-polynomial 'x '((3 1)(0 -1)))) ;: (define p3 (make-polynomial 'x '((1 1)))) ;: (define p4 (make-polynomial 'x '((2 1)(0 -1)))) ;: (define rf1 (make-rational p1 p2)) ;: (define rf2 (make-rational p3 p4)) ;: (add rf1 rf2)
false
f8cd82a52527c2bd417a0b6ec69cf8e4cef712aa
2e4afc99b01124a1d69fa4f44126ef274f596777
/apng/resources/dracula/drscheme/proof-state.ss
20b8c6a35783b417368dcf09bfc719e6f9a82df9
[]
no_license
directrix1/se2
8fb8204707098404179c9e024384053e82674ab8
931e2e55dbcc55089d9728eb4194ebc29b44991f
refs/heads/master
2020-06-04T03:10:30.843691
2011-05-05T03:32:54
2011-05-05T03:32:54
1,293,430
0
0
null
null
null
null
UTF-8
Scheme
false
false
11,883
ss
proof-state.ss
#lang scheme (require scheme/pretty "../proof/proof.ss" "../acl2/acl2.ss" "../acl2/rep.ss" "../private/hash.ss" "term-state.ss") ;; A ProofState is: ;; (make-proof-state Loc Nat (Or Nat #f) (Hash Nat TermState)) (define-struct proof-state (loc size index terms) #:prefab) ;; ====================================================================== ;; ;; IMPLEMENTATION ;; ;; ====================================================================== ;; ================================================== ;; ;; Constructors. ;; ;; ================================================== (define (initial-proof-state part) (let* ([loc0 (part-loc part)] [loc1 (make-loc (loc-source loc0) (loc-start loc0) (loc-start loc0))] [terms (make-immutable-hash null)] [terms (hash-set terms 0 (empty-term-state loc1))] [terms (for/fold ([terms terms]) ([n (in-range (part-length part))]) (hash-set terms (+ n 1) (initial-term-state (part-nth part n))))]) (make-proof-state loc0 (+ (part-length part) 1) #f terms))) (define (proof-state-populate old-state new-part) (let* ([new-state (initial-proof-state new-part)]) (match (list old-state new-state) [(list (struct proof-state [_ _ #f _]) _) new-state] [(list (struct proof-state [old-loc old-size old-index old-terms]) (struct proof-state [new-loc new-size new-index new-terms])) (make-proof-state new-loc new-size old-index (for/fold ([terms new-terms]) ([n (in-range 0 (+ old-index 1))]) (hash-set terms n (term-state-populate (hash-ref/check old-terms n) (hash-ref/check new-terms n)))))]))) (define (proof-state-start-term state acl2-state index saved) (make-proof-state (proof-state-loc state) (proof-state-size state) index (hash-update (proof-state-terms state) index (lambda (term) (term-state-start-acl2 term acl2-state saved))))) (define (proof-state-start-acl2 state acl2-state) (proof-state-start-term state acl2-state 0 #t)) (define (proof-state-update-acl2 state acl2-state) (struct-copy proof-state state [terms (hash-update (proof-state-terms state) (proof-state-index state) (lambda (term) (term-state-update-acl2 term acl2-state)))])) (define (proof-state-advance state acl2-state saved) (proof-state-start-term state acl2-state (+ (proof-state-index state) 1) saved)) (define (proof-state-rewind state) (make-proof-state (proof-state-loc state) (proof-state-size state) (- (proof-state-index state) 1) (hash-update (proof-state-terms state) (proof-state-index state) (lambda (term) (term-state-stop-acl2 term))))) (define (proof-state-edit state) (if (proof-state-admitted? state) (error 'proof-state-edit "Attempted to edit an admitted term") (make-proof-state (proof-state-loc state) (proof-state-size state) (proof-state-index state) (hash-update (proof-state-terms state) (proof-state-index state) (lambda (term) (term-state-edit term)))))) (define (proof-state-stop-acl2 state) (make-proof-state (proof-state-loc state) (proof-state-size state) #f (for/fold ([terms (proof-state-terms state)]) ([n (in-range 0 (+ (proof-state-index state) 1))]) (hash-update terms n term-state-stop-acl2)))) ;; ================================================== ;; ;; ACL2 text. ;; ;; ================================================== (define (proof-state-initial-prompt state) (term-state-initial-prompt (proof-state-current-term state))) (define (proof-state-acl2-input state) (term-state-acl2-input (proof-state-current-term state))) (define (proof-state-acl2-output state) (term-state-acl2-output (proof-state-current-term state))) (define (proof-state-final-prompt state) (term-state-final-prompt (proof-state-current-term state))) (define (proof-state-proof-tree state) (term-state-proof-tree (proof-state-current-term state))) (define (proof-state-total-output state) (let loop ([i 0]) (let* ([term-state (hash-ref/default (proof-state-terms state) i #f)]) (if (term-state-active? term-state) (string-append (term-state-total-output term-state) "\n" (loop (add1 i))) "\n")))) ;; ================================================== ;; ;; Predicates. ;; ;; ================================================== (define (proof-state-acl2-open? v) (and (proof-state? v) (integer? (proof-state-index v)))) (define (proof-state-start-of-proof? state) (or (= (proof-state-index state) 0) (and (= (proof-state-index state) 1) (not (proof-state-admitted? state))))) (define (proof-state-end-of-proof? state) (and (= (proof-state-index state) (- (proof-state-size state) 1)) (proof-state-admitted? state))) (define (proof-state-at-first-term? state) (= (proof-state-index state) 0)) (define (proof-state-at-last-term? state) (= (proof-state-index state) (- (proof-state-size state) 1))) (define (proof-state-finished? state) (term-state-finished? (proof-state-current-term state))) (define (proof-state-admitted? state) (term-state-admitted? (proof-state-current-term state))) (define (proof-state-edited? state) (term-state-edited? (proof-state-current-term state))) ;; ================================================== ;; ;; Highlighting positions. ;; ;; ================================================== (define (proof-state-first-admitted-position state) (loc-start (proof-state-loc state))) (define (proof-state-last-admitted-position state) (match state [(struct proof-state [loc size index terms]) (let* ([term-state (hash-ref/check terms index)]) (if (term-state-admitted? term-state) (if (= index (sub1 size)) (loc-end loc) (loc-end (term-state-loc term-state))) (if (= index 0) (loc-start loc) (loc-end (term-state-loc (hash-ref/check terms (sub1 index)))))))])) (define (proof-state-last-attempted-position state) (let* ([term-state (proof-state-current-term state)]) (if (term-state-admitted? term-state) (proof-state-last-admitted-position state) (if (term-state-has-input? term-state) (loc-end (term-state-loc term-state)) (proof-state-last-admitted-position state))))) ;; ================================================== ;; ;; Cursor search. ;; ;; ================================================== ;; proof-state-index-before-pos : ProofState Nat -> Nat (define (proof-state-index-before-pos state pos) (let loop ([index (proof-state-index state)]) (if (or (= (add1 index) (proof-state-size state)) (<= pos (loc-start (term-state-loc (hash-ref/check (proof-state-terms state) (add1 index)))))) index (loop (add1 index))))) ;; proof-state-index-after-pos : ProofState Nat -> Nat (define (proof-state-index-after-pos state pos) (let loop ([index (add1 (proof-state-index state))]) (if (or (= index 1) (>= pos (loc-end (term-state-loc (hash-ref/check (proof-state-terms state) (sub1 index)))))) index (loop (sub1 index))))) (define (proof-state-next-sexp state) (term-state-sexp (proof-state-next-term state))) (define (proof-state-save-before-next-sexp state) (term-state-save-before-sexp (proof-state-next-term state))) (define (proof-state-restore-saved-sexp state) (term-state-restore-saved-sexp (proof-state-current-term state))) ;; ===================================================================== ;; ;; HELPERS ;; ;; ====================================================================== (define (proof-state-term-index state) (proof-state-index state)) (define (proof-state-current-term state) (hash-ref/check (proof-state-terms state) (proof-state-index state))) (define (proof-state-next-term state) (hash-ref/check (proof-state-terms state) (add1 (proof-state-index state)))) ;; ====================================================================== ;; ;; CONTRACTS ;; ;; ====================================================================== (define (state-pos/c state) (and/c exact-nonnegative-integer? (>=/c (loc-start (proof-state-loc state))) (<=/c (loc-end (proof-state-loc state))))) (define (state-index/c state) (and/c exact-nonnegative-integer? (>=/c 0) (<=/c (proof-state-size state)))) (provide/contract [proof-state? (-> any/c boolean?)] [proof-state-acl2-open? (-> any/c boolean?)] [initial-proof-state (-> part? proof-state?)] [proof-state-populate (-> proof-state? part? proof-state?)] [proof-state-start-acl2 (-> (and/c proof-state? (not/c proof-state-acl2-open?)) acl2? proof-state-acl2-open?)] [proof-state-update-acl2 (-> proof-state-acl2-open? acl2? proof-state-acl2-open?)] [proof-state-advance (-> (and/c proof-state-acl2-open? (not/c proof-state-at-last-term?)) acl2? (or/c sexp/c #f) proof-state-acl2-open?)] [proof-state-rewind (-> (and/c proof-state-acl2-open? (not/c proof-state-at-first-term?)) proof-state-acl2-open?)] [proof-state-edit (-> proof-state-acl2-open? proof-state-acl2-open?)] [proof-state-stop-acl2 (-> proof-state-acl2-open? (and/c proof-state? (not/c proof-state-acl2-open?)))] [proof-state-start-of-proof? (-> proof-state-acl2-open? boolean?)] [proof-state-end-of-proof? (-> proof-state-acl2-open? boolean?)] [proof-state-at-first-term? (-> proof-state-acl2-open? boolean?)] [proof-state-at-last-term? (-> proof-state-acl2-open? boolean?)] [proof-state-finished? (-> proof-state-acl2-open? boolean?)] [proof-state-admitted? (-> proof-state-acl2-open? boolean?)] [proof-state-edited? (-> proof-state-acl2-open? boolean?)] [proof-state-proof-tree (-> proof-state-acl2-open? string?)] [proof-state-total-output (-> proof-state-acl2-open? string?)] [proof-state-initial-prompt (-> proof-state-acl2-open? string?)] [proof-state-acl2-input (-> proof-state-acl2-open? string?)] [proof-state-acl2-output (-> proof-state-acl2-open? string?)] [proof-state-final-prompt (-> proof-state-acl2-open? string?)] [proof-state-next-sexp (-> (and/c proof-state-acl2-open? (not/c proof-state-at-last-term?)) sexp/c)] [proof-state-save-before-next-sexp (-> (and/c proof-state-acl2-open? (not/c proof-state-at-last-term?)) sexp/c)] [proof-state-restore-saved-sexp (-> (and/c proof-state-admitted? (not/c proof-state-at-first-term?)) sexp/c)] [proof-state-size (-> proof-state? exact-positive-integer?)] [proof-state-term-index (->d ([state proof-state-acl2-open?]) () [_ (state-index/c state)])] [proof-state-index-before-pos (->d ([state proof-state-acl2-open?] [pos exact-nonnegative-integer?]) () [_ (state-index/c state)])] [proof-state-index-after-pos (->d ([state proof-state-acl2-open?] [pos exact-nonnegative-integer?]) () [_ (state-index/c state)])] [proof-state-first-admitted-position (->d ([state proof-state-acl2-open?]) () [_ (state-pos/c state)])] [proof-state-last-admitted-position (->d ([state proof-state-acl2-open?]) () [_ (state-pos/c state)])] [proof-state-last-attempted-position (->d ([state proof-state-acl2-open?]) () [_ (state-pos/c state)])] )
false
a2d671d83a4bf190139f8e24cf6aeaff714b8ebc
d755de283154ca271ef6b3b130909c6463f3f553
/htdp-lib/teachpack/htdp/show-queen.rkt
418d2f03ec2c4873d2bece17f3385eeffac79e9b
[ "Apache-2.0", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
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
Scheme
false
false
85
rkt
show-queen.rkt
#lang racket/base (require htdp/show-queen) (provide (all-from-out htdp/show-queen))
false
d74e771245ad45b1250929027bd5eba6ce990c93
ae0ff579f083fd4a0aa5ce7081132a37815ca943
/servlet.ss
58439e210a7afe88e4c9d3136149e4cc70a10f73
[]
no_license
holdenk/web2.0collage
5a54215770b5d9db46b472917b9828aa06f7fc70
aaded3074b6f36fe810c037195db914388341c92
refs/heads/master
2021-01-20T02:20:38.843022
2013-01-18T04:34:12
2013-01-18T04:34:12
3,979,410
1
0
null
null
null
null
UTF-8
Scheme
false
false
566
ss
servlet.ss
#lang scheme/base (require net/url web-server/servlet/web-cells web-server/http/bindings web-server/http web-server/dispatch web-server/servlet/servlet-structs web-server/servlet/web) (provide (all-from-out net/url web-server/servlet/web-cells web-server/http/bindings web-server/dispatch web-server/http web-server/servlet/servlet-structs web-server/servlet/web))
false
0f60fba1a838acd2ef0e9c7d1ed9361bc146cb15
2fc7c18108fb060ad1f8d31f710bcfdd3abc27dc
/lib/remove.scm
bf558ea10df584775680ada119b67e19f8475f52
[ "LicenseRef-scancode-public-domain", "LicenseRef-scancode-warranty-disclaimer", "CC0-1.0" ]
permissive
bakul/s9fes
97a529363f9a1614a85937a5ef9ed6685556507d
1d258c18dedaeb06ce33be24366932143002c89f
refs/heads/master
2023-01-24T09:40:47.434051
2022-10-08T02:11:12
2022-10-08T02:11:12
154,886,651
68
10
NOASSERTION
2023-01-25T17:32:54
2018-10-26T19:49:40
Scheme
UTF-8
Scheme
false
false
1,277
scm
remove.scm
; Scheme 9 from Empty Space, Function Library ; By Nils M Holm, 2009 ; Placed in the Public Domain ; ; (remove obj list) ==> list ; (remp procedure^1 list) ==> list ; (remq obj list) ==> list ; (remv obj list) ==> list ; ; (load-from-library "remove.scm") ; ; Remove elements from a list. REMP uses the unary predicate ; PROCEDURE^1 to describe the property of the elements to be ; removed. REMOVE uses EQUAL?, REMV uses EQV?, and REMQ uses ; EQ? to compare each element of LIST to OBJ. ; ; Example: (remp number? '(a 1 b 2 c 3)) ==> (a b c) ; (remove '(b) '(a (b) (c) (b))) ==> (a (c)) ; (remq 'b '(a b c b d)) ==> (a c d) ; (remv 3 '(3 1 2 3 1)) ==> (1 2 1) (load-from-library "filter.scm") (define (remp p a) (filter (lambda (x) (not (p x))) a)) (define (make-remover pred) (lambda (x a) (letrec ((rem (lambda (a r) (cond ((null? a) (reverse! r)) ((pred x (car a)) (rem (cdr a) r)) (else (rem (cdr a) (cons (car a) r))))))) (rem a '())))) (define remq (make-remover eq?)) (define remv (make-remover eqv?)) (define remove (make-remover equal?))
false
ca9de494445417c23dd5131831b8e9c49220c59b
3e5594562f270a743ffb80ac6ebbdf7b800816ec
/src/text/json/select/parser.sls
8c92cb9d3f9e38b835f912ccac6391c113b037a2
[]
no_license
ktakashi/json-tools
1a882ab5320ba33898f95b1fa8d42fe08bce9a3b
a8b5e100311b070e4e0fc8a585d5cdac19adc84d
refs/heads/master
2022-06-14T03:25:01.110629
2022-06-08T18:16:46
2022-06-08T18:16:46
16,772,242
7
0
null
null
null
null
UTF-8
Scheme
false
false
11,710
sls
parser.sls
;;; -*- mode:scheme; coding:utf-8; -*- ;;; ;;; text/json/select/parser.scm - JSONSelect grammer parser library ;;; ;;; Copyright (c) 2014 Takashi Kato <[email protected]> ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; ;;; 1. Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; ;;; 2. Redistributions in binary form must reproduce the above copyright ;;; notice, this list of conditions and the following disclaimer in the ;;; documentation and/or other materials provided with the distribution. ;;; ;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ;;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ;;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ;;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ;;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ;;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ;;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ;;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;;; #!r6rs (library (text json select parser) (export json:parse-selector) (import (rnrs) (packrat) (srfi :14)) (define json:parse-selector (let () (define parser (packrat-parser (begin (define (white results) (let ((ch (parse-results-token-value results))) (if (and ch (char-whitespace? ch)) (white (parse-results-next results)) (comment results) ))) (define (skip-comment-char results) (comment-body (parse-results-next results))) (define (skip-to-newline results) (if (memv (parse-results-token-value results) '(#\newline #\return)) (white results) (skip-to-newline (parse-results-next results)))) (define (token str) (lambda (starting-results) (let loop ((pos 0) (results starting-results)) (if (= pos (string-length str)) (make-result str results) (let ((ch (parse-results-token-value results))) (if (and ch (char=? ch (string-ref str pos))) (loop (+ pos 1) (parse-results-next results)) (make-expected-result (parse-results-position starting-results) str))))))) (define (interpret-string-unicode-escape results k) (let loop ((i 0) (acc '()) (results results)) (let ((ch (parse-results-token-value results))) (cond ((= i 4) (k (integer->char (string->number (list->string (reverse acc)) 16)) results)) ((memv ch '(#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F)) (loop (+ i 1) (cons ch acc) (parse-results-next results))) (else (error 'json-read "JSON Parse Error")))))) (define (interpret-string-escape results k) (let ((ch (parse-results-token-value results))) (cond ((assv ch '((#\b . #\backspace) (#\n . #\newline) (#\f . #\page) (#\r . #\return) (#\t . #\tab))) => (lambda(x)(k (cdr x) (parse-results-next results)))) ((eqv? #\u ch) (interpret-string-unicode-escape (parse-results-next results) k)) (else (k ch (parse-results-next results)))))) (define (jstring-body results) (let loop ((acc '()) (results results)) (let ((ch (parse-results-token-value results))) (case ch ((#\\) (interpret-string-escape (parse-results-next results) (lambda (val results) (loop (cons val acc) results)))) ((#\") (make-result (list->string (reverse acc)) results)) (else (loop (cons ch acc) (parse-results-next results))))))) (define (jnumber-body starting-results) (let loop ((acc '()) (results starting-results)) (let ((ch (parse-results-token-value results))) (if (memv ch '(#\- #\+ #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\. #\e #\E)) (loop (cons ch acc) (parse-results-next results)) (let ((n (string->number (list->string (reverse acc))))) (if n (make-result n results) (make-expected-result (parse-results-position starting-results) 'number))))))) #| name : nmstart nmchar* ; nmstart : escape | [_a-zA-Z] | nonascii ; nmchar : [_a-zA-Z0-9-] | escape | nonascii ; escape : \\[^\r\n\f0-9a-fA-F] ; nonascii : [^\0-0177] ; |# (define (name results) (define name-sets (char-set-union char-set:letter+digit (string->char-set "_-") (char-set-complement char-set:ascii))) (let loop ((acc '()) (results results)) (let ((ch (parse-results-token-value results))) (cond ((and ch (char=? ch #\\)) ;; handle escape first (interpret-string-escape (parse-results-next results) (lambda (val results) (loop (cons val acc) results)))) ((and ch (char-set-contains? name-sets ch)) (loop (cons ch acc) (parse-results-next results))) (else (make-result (list->string (reverse acc)) results)))))) selectors-group) #| selectors_group : selector [ `,` selector ]* ; |# (selectors-group ((s <- selector g <- selector-group*) ;; make 'or flat (cond ((null? g) s ) ((eq? (car g) 'or) (cons* 'or s (cdr g))) (else (list 'or s g))))) (or-select ((white '#\, white) 'or)) (selector-group* ((or-select s <- selector g <- selector-group*) (if (null? g) s (list 'or s g))) (() '())) #| selector : simple_selector_sequence [ combinator simple_selector_sequence ]* ; |# (selector ((s <- simple-selector-sequence s* <- simple-selector-sequence*) (cons s s*))) #| combinator : `>` | \s+ ; |# (combinator ((white '#\> white) '>) ;; parent ((white '#\~ white) '~) ;; siblings ((white) '>>));; ancesstor #| simple_selector_sequence : [ type_selector | universal ] [ class | pseudo ]* | [ class | pseudo ]+ ; |# (simple-selector-sequence ((tu <- type-select/universal cp* <- class/psuedo*) (if (null? cp*) tu (cons tu (list cp*)))) ((cp+ <- class/psuedo+) cp+)) ;; auxilities (type-select/universal ((t <- type-selector) t) ((u <- universal) u)) (class/psuedo+ ((cp <- class/psuedo cp* <- class/psuedo*) (if (null? cp*) cp (list cp cp*)))) (class/psuedo* ((cp* <- class/psuedo+) cp*) (() '())) (class/psuedo ((c <- class) c) ((p <- pseudo) p)) (simple-selector-sequence* ((c <- combinator s* <- selector) (cons c s*)) (() '())) #| type_selector : `object` | `array` | `number` | `string` | `boolean` | `null` ; |# (type-selector ((o <- (token "object")) (string->symbol o)) ((a <- (token "array")) (string->symbol a)) ((n <- (token "number")) (string->symbol n)) ((s <- (token "string")) (string->symbol s)) ((b <- (token "boolean")) (string->symbol b)) ((n <- (token "null")) (string->symbol n)) ((b <- (token "binary")) (string->symbol b))) #| universal : '*' ; |# (universal (('#\*) '*)) #| class : `.` name | `.` json_string ; |# (class (('#\. n <- json-string) n) (('#\. n <- name) n)) #| pseudo : `:` pseudo_class_name | `:` nth_function_name `(` nth_expression `)` | `:has` `(` selectors_group `)` | `:expr` `(` expr `)` | `:contains` `(` json_string `)` | `:val` `(` val `)` ; |# (pseudo (('#\: pc <- pseudo-class-name) pc) (('#\: nth <- nth-function-name '#\( n <- nth-expression '#\)) (cons nth (list n))) ;; TODO should we use keyword? (((token ":has") '#\( s <- selectors-group '#\)) (list 'has s)) (((token ":expr") '#\( e <- expr '#\)) (list 'expr e)) (((token ":contains") '#\( s <- json-string '#\)) (list 'contains s)) (((token ":val") '#\( v <- val '#\)) ;; well BNF says val but it's actually string or number... (unless (or (string? v) (number? v)) (error 'parse-json-selector ":val requires string or number")) ;; may be too long but for safety ;; we'll make S-expr compiler accept (("class" "value")) ;; structor. (list 'val v))) #| pseudo_class_name : `root` | `first-child` | `last-child` | `only-child` | `empty` |# (pseudo-class-name (((token "root")) 'root) (((token "first-child")) 'first-child) (((token "last-child")) 'last-child) (((token "only-child")) 'only-child) (((token "empty")) 'empty)) #| nth_function_name : `nth-child` | `nth-last-child` |# (nth-function-name (((token "nth-child")) 'nth-child) (((token "nth-last-child")) 'nth-last-child)) #| nth_expression : TODO ... wtf? for now only number ; |# (nth-expression ((n <- json-number) n)) #| expr : expr binop expr | '(' expr ')' | val ; |# (expr ((e1 <- expr1 op <- binop e2 <- expr1) (list op e1 e2)) ((e <- expr1) e)) (expr1((white '#\( e <- expr '#\) white) e) ((v <- val) v)) #| binop : '*' | '/' | '%' | '+' | '-' | '<=' | '>=' | '$=' | '^=' | '*=' | '>' | '<' | '=' | '!=' | '&&' | '||' ; |# (binop (((token "<=")) '<=) (((token ">=")) '>=) (((token "$=")) '$=) (((token "^=")) '^=) (((token "*=")) '*=) (((token "!=")) '!=) (((token "&&")) 'and) ;; for consistancy of 'or (((token "||")) 'or) ;; to avoid escape symbol (('#\*) '*) (('#\/) '/) (('#\%) '%) (('#\+) '+) (('#\-) '-) (('#\>) '>) (('#\<) '<) (('#\=) '=)) #| val : json_number | json_string | 'true' | 'false' | 'null' | 'x' ; |# (val ((white n <- json-number white) n) ((white s <- json-string white) s) ((white (token "true") white) #t) ((white (token "false") white) #f) ((white (token "null") white) 'null) ((white '#\x white) 'x)) ;; from (json) (json-string ((white '#\" body <- jstring-body '#\") body)) ;; from (json) (json-number ((white body <- jnumber-body) body)) ;; misc for my sake (comment (((token "/*") b <- comment-body) b) (((token "//") b <- skip-to-newline) b) (() 'whitespace)) (comment-body (((token "*/") w <- white) w) ((skip-comment-char) 'skipped-comment-char)) )) (define (generator p) (let ((ateof #f) (pos (top-parse-position "<?>"))) (lambda () (if ateof (values pos #f) (let ((x (read-char p))) (if (eof-object? x) (begin (set! ateof #t) (values pos #f)) (let ((old-pos pos)) (set! pos (update-parse-position pos x)) (values old-pos (cons x x))))))))) (define (read-selector p) (let ((result (parser (base-generator->results (generator p))))) (if (parse-result-successful? result) (parse-result-semantic-value result) (error 'parse-json-selector "JSONSelector parse error" (let ((e (parse-result-error result))) (list 'parse-json-selector-error (parse-position->string (parse-error-position e)) (parse-error-expected e) (parse-error-messages e))))))) (lambda maybe-port (read-selector (if (pair? maybe-port) (car maybe-port) (current-input-port)))))) )
false
7679a4aa349c8260245dc5b10282f0eefccebd00
98fd12cbf428dda4c673987ff64ace5e558874c4
/sicp/v1/chapter-2.2/inaimathi.scm
060b5c91374b3473eca343256d77703c87dc74c3
[ "Unlicense" ]
permissive
CompSciCabal/SMRTYPRTY
397645d909ff1c3d1517b44a1bb0173195b0616e
a8e2c5049199635fecce7b7f70a2225cda6558d8
refs/heads/master
2021-12-30T04:50:30.599471
2021-12-27T23:50:16
2021-12-27T23:50:16
13,666,108
66
11
Unlicense
2019-05-13T03:45:42
2013-10-18T01:26:44
Racket
UTF-8
Scheme
false
false
5,981
scm
inaimathi.scm
;; STILL using Chicken. What the fuck is wrong with me? ;;; 2.17 (define (last-pair a-list) (unless (null? a-list) (if (null? (cdr a-list)) a-list (last-pair (cdr a-list))))) ;;; 2.18 (define (my-reverse a-list) (define (rec lst acc) (if (null? lst) acc (rec (cdr lst) (cons (car lst) acc)))) (rec a-list '())) ;;; 2.19 ;; Coin values is a list, so you can simply (define first-denomination car) (define except-first-denomination cdr) (define no-more? null?) ;; or, if you want to be yappy about it, I guess ... (define (first-denomination denoms) (car denoms)) (define (except-first-denominations denoms) (cdr denoms)) (define (no-more? denoms) (null? denoms)) ;;; 2.20 (define (filter predicate a-list) (define (rec lst acc) (cond ((null? lst) (my-reverse acc)) ((predicate (car lst)) (rec (cdr lst) (cons (car lst) acc))) (else (rec (cdr lst) acc)))) (rec a-list '())) (define (same-parity . nums) (if (even? (car nums)) (filter even? nums) (filter odd? nums))) ;;; 2.21 (define (square n) (expt n 2)) (define (square-list items) (if (null? items) '() (cons (square (car items)) (square-list (cdr items))))) (define (square-list items) (map square items)) ;;; 2.22 ;; Because we're consing each element onto the accumulator, which adds it to ;; the front of the list. ;; The second approach will cons the old list of results onto the new element. ;; That'll create a pair whose first element is the old accumulator and whose ;; second element is the new result. ;; What you'd actually want is either to `append` the new result to the end of the ;; list (which performs very shittily for singly-linked lists) ;; -- or -- ;; Reverse your result when returning the accumulator ;; -- or -- ;; Hang onto a pointer to the last cons in your list and push to it each time ;; instead of consing to the front. ;;; 2.23 (define (for-each fn lst) (if (null? lst) #t (begin (fn (car lst)) (for-each fn (cdr lst))))) ;;; 2.24 ;; (1 (2 (3 4))) ;; [ | ] -> [ | ] -> NIL ;; | | ;; 1 [ | ] -> [ | ] -> NIL ;; | | ;; 2 [ | ] -> [ | ] -> NIL ;; | | ;; 3 4 ;; (1 (2 (3 4))) ;; / \ ;; 1 (2 (3 4)) ;; / \ ;; 2 (3 4) ;; / \ ;; 3 4 ;;; 2.25 ;; > (car (cdr (car (cdr (cdr '(1 2 (5 7) 9)))))) ;; 7 ;; > (car (car '((7)))) ;; 7 ;; > (car (cdr (car (cdr (car (cdr (car (cdr (car (cdr (car (cdr '(1 (2 (3 (4 (5 (6 7)))))))))))))))))) ;; 7 ;;; 2.26 ;; > (append x y) ;; (1 2 3 4 5 6) ;; > (cons x y) ;; ((1 2 3) 4 5 6) ;; > (list x y) ;; ((1 2 3) (4 5 6)) ;;; 2.27 (define (deep-reverse a-tree) (define (rec tree acc) (cond ((null? tree) acc) ((pair? (car tree)) (rec (cdr tree) (cons (rec (car tree) '()) acc))) (else (rec (cdr tree) (cons (car tree) acc))))) (rec a-tree '())) ;;; 2.28 (define (fringe tree) (cond ((null? tree) '()) ((pair? (car tree)) (append (fringe (car tree)) (fringe (cdr tree)))) (else (cons (car tree) (fringe (cdr tree)))))) ;;; 2.29 ;; a) (define (left-branch mobile) (car mobile)) (define (right-branch mobile) (car (cdr mobile))) (define (branch-length branch) (car branch)) (define (branch-structure branch) (car (cdr branch))) ;; b) (define (branch-weight branch) (total-weight (branch-structure branch))) (define (total-weight structure) (if (number? structure) structure (+ (branch-weight (left-branch structure)) (branch-weight (right-branch structure))))) ;; c) (define (torque branch) (* (branch-length branch) (branch-weight branch))) (define (balanced? structure) (let ((l (left-branch structure)) (r (right-branch structure))) (if (number? structure) #t (and (= (torque l) (torque r)) (balanced? (branch-structure l)) (balanced? (branch-structure r)))))) ;; d) ;; It depends on how honest you were about not reaching beneath the selector abstraction. ;; If you were, you'll need to change the basic selectors. ;; If you weren't, you'll need to change any function that resorted directly to representation-specific selectors. ;; If you were asking about me specifically, I was honest so I won't have to change much. ;;; 2.30 (define (square-tree tree) (cond ((null? tree) '()) ((atom? tree) (square tree)) (else (cons (square-tree (car tree)) (square-tree (cdr tree)))))) (define (square-tree-too tree) (map (lambda (t) ;;godDAMN it feels good to do that. I think I'll do it again; ;; (lambda (t) ;; (print t) ;; (print "That variable was named 't'") ;; (print "U Jelly, Common Lisp?")) (if (pair? t) (square-tree t) (square t))) tree)) ;;; 2.31 (define (tree-map fn tree) (map (lambda (t) (if (pair? t) (tree-map fn t) (fn t))) tree)) ;;; 2.32 ;; The template they hand us is ;; (define (subsets s) ;; (if (null? s) ;; (list nil) ;; (let ((rest (subsets (cdr s)))) ;; (append rest (map ?? rest))))) ;; Which I have to mildly modify for Chicken ;; (define (subsets s) ;; (if (null? s) ;; (list '()) ;; <- that right there ;; (let ((rest (subsets (cdr s)))) ;; (append rest (map ?? rest))))) (define (subsets s) (if (null? s) (list '()) (let ((rest (subsets (cdr s)))) (append rest (map (lambda (elem) (cons (car s) elem)) rest))))) ;; You want to append all the subsets of s not containing (car s) ;; to the set of all subsets that do include (car s)
false
ee15e1dcab1ad1041e5137ad8cfb938fc0ceb38d
46244bb6af145cb393846505f37bf576a8396aa0
/eopl/ch3/3.08/3.08.scm
e1df1066b1402c72b5b8b2012b43e333193b018b
[]
no_license
aoeuidht/homework
c4fabfb5f45dbef0874e9732c7d026a7f00e13dc
49fb2a2f8a78227589da3e5ec82ea7844b36e0e7
refs/heads/master
2022-10-28T06:42:04.343618
2022-10-15T15:52:06
2022-10-15T15:52:06
18,726,877
4
3
null
null
null
null
UTF-8
Scheme
false
false
3,331
scm
3.08.scm
#lang eopl (require eopl/tests/private/utils) (require "data-structures.rkt") ; for expval constructors (require "lang.rkt") ; for scan&parse (require "interp.rkt") ; for value-of-program ;; run : String -> ExpVal ;; Page: 71 (define run (lambda (string) (value-of-program (scan&parse string)))) (define equal-answer? (lambda (ans correct-ans) (equal? ans (sloppy->expval correct-ans)))) (define sloppy->expval (lambda (sloppy-val) (cond ((number? sloppy-val) (num-val sloppy-val)) ((boolean? sloppy-val) (bool-val sloppy-val)) (else (eopl:error 'sloppy->expval "Can't convert sloppy value to expval: ~s" sloppy-val))))) (define-syntax-rule (check-run (name str res) ...) (begin (cond [(eqv? 'res 'error) (check-exn always? (lambda () (run str)))] [else (check equal-answer? (run str) 'res (symbol->string 'name))]) ...)) ;;;;;;;;;;;;;;;; tests ;;;;;;;;;;;;;;;; (check-run ;; simple arithmetic (positive-const "11" 11) (negative-const "-33" -33) (simple-arith-1 "-(44,33)" 11) (simple-arith-2 "minus(-1)" 1) (simple-arith-3 "minus(1)" -1) (simple-arith-4 "+(1,2)" 3) (simple-arith-5 "*(1,2)" 2) (simple-arith-6 "/(2, 2)" 1) (simple-arith-comp-1 "equal?(1, 1)" #t) (simple-arith-comp-2 "equal?(2, 1)" #f) (simple-arith-comp-3 "equal?(1, 2)" #f) (simple-arith-comp-1 "greater?(1, 1)" #f) (simple-arith-comp-2 "greater?(2, 1)" #t) (simple-arith-comp-3 "greater?(1, 2)" #f) (simple-arith-comp-1 "less?(1, 1)" #f) (simple-arith-comp-2 "less?(2, 1)" #f) (simple-arith-comp-3 "less?(1, 2)" #t) (308-in-if-1 "if less?(1, 2) then 2 else 1" 2) (308-in-if-2 "if equal?(1, 2) then 2 else 1" 1) (308-in-if-3 "if greater?(1, 2) then 2 else 1" 1) ;; nested arithmetic (nested-arith-left "-(-(44,33),22)" -11) (nested-arith-right "-(55, -(22,11))" 44) ;; simple variables (test-var-1 "x" 10) (test-var-2 "-(x,1)" 9) (test-var-3 "-(1,x)" -9) ;; simple unbound variables (test-unbound-var-1 "foo" error) (test-unbound-var-2 "-(x,foo)" error) ;; simple conditionals (if-true "if zero?(0) then 3 else 4" 3) (if-false "if zero?(1) then 3 else 4" 4) ;; test dynamic typechecking (no-bool-to-diff-1 "-(zero?(0),1)" error) (no-bool-to-diff-2 "-(1,zero?(0))" error) (no-int-to-if "if 1 then 2 else 3" error) ;; make sure that the test and both arms get evaluated ;; properly. (if-eval-test-true "if zero?(-(11,11)) then 3 else 4" 3) (if-eval-test-false "if zero?(-(11, 12)) then 3 else 4" 4) ;; and make sure the other arm doesn't get evaluated. (if-eval-test-true-2 "if zero?(-(11, 11)) then 3 else foo" 3) (if-eval-test-false-2 "if zero?(-(11,12)) then foo else 4" 4) ;; simple let (simple-let-1 "let x = 3 in x" 3) ;; make sure the body and rhs get evaluated (eval-let-body "let x = 3 in -(x,1)" 2) (eval-let-rhs "let x = -(4,1) in -(x,1)" 2) ;; check nested let and shadowing (simple-nested-let "let x = 3 in let y = 4 in -(x,y)" -1) (check-shadowing-in-body "let x = 3 in let x = 4 in x" 4) (check-shadowing-in-rhs "let x = 3 in let x = -(x,1) in x" 2) ;; minus in simple let (minus-in-let "let x = 3 in minus(x)" -3) (minus-in-let-rhs "let x = minus(3) in -(x, -5)" 2) ) (newline) (display (run "equal?(3, 5)"))
true
3a3a9d198f08858655cc83b33399a53102cb6550
7b0df9640ae1b8e1172f0f90c5428b0802df8ed6
/amixer.scm
59718d9ccc568869b15be59f7c5fc0451764a4ac
[]
no_license
erosness/sm-server
5954edfc441e773c605d2ac66df60bb983be01a3
cc302551e19f6d2b889a41ec28801004b0b28446
refs/heads/master
2020-08-31T13:23:03.670076
2016-02-18T19:10:55
2016-02-18T19:10:55
218,699,588
0
0
null
null
null
null
UTF-8
Scheme
false
false
6,640
scm
amixer.scm
;;; simple interface to amixer ;;; set/get volume and EQ using the command-line (eg. `amixer sget Master playback 20%`) (module amixer * (import chicken scheme extras) (use posix test data-structures irregex srfi-1 srfi-13 srfi-18 matchable looper clojurian-syntax) (import process-cli notify) ;; parse the output of amixer cget and cget commands. (define (amixer-parse/values str) (let ((regex '(: ":" (* space) "values=" (=> vals (+ ;; multiple values (? "-") ;; negative number (+ num) ;; single value (or "," "\n") ;; terminator ))))) (cond ((irregex-search regex str) => (lambda (m) (map string->number (string-split (irregex-match-substring m 'vals) ",\n")))) (else (error "could not parse" str))))) ;; parse simple-control get output. it's different from values. values ;; seems to be general, where sget gives you percentages and ;; left/right explicitly. values (define (amixer-parse/sget str) (cond ((irregex-search '(: ":" (* space) (or "" "Capture" "Playback") (* space) (+ num) (* space) "[" (=> L% (+ num)) "%]" ;; percentage (* space) (or "" "Capture" "Playback") ;; todo remove capture (* space) (=> L-mute (or "[on]" "[off]")) ;;"Front Right: Playback " (* space) (+ num) (* space) ;;"[" (=> %r (+ num)) "%]" ) str) => (lambda (m) (list (string->number (irregex-match-substring m 'L%))))) (else ;; pp str too because error truncates it. (pp `(error amixer-parse/sget ,str)) (error "could not parse amixer output" str) ))) ;; helper for constructing amixer getter and setter command-line ;; strings. returns a procedure which returns the command to use: get ;; if vals if false or set if vals is true with vals appended at the ;; end. (define (cmd/getter-setter prefix get set postfix) (define (eq->string vals) (string-join (map number->string vals) ",")) (lambda (#!optional vals) (if vals (conc prefix " " set " " postfix " " (eq->string vals)) (conc prefix " " get " " postfix)))) ;; construct a proc which can get and set using the ;; command-line-strings given by cmd-proc. everything is parsed with ;; amixer-parse/values (define (make-amixer-getter/setter cmd-proc parser) (lambda (#!optional vals) (assert (or (eq? #f vals) (and (list? vals)))) (let ((cmdstring (if vals (cmd-proc vals) (cmd-proc)))) (pp `(debug shell ,cmdstring)) (parser (call-with-input-pipe cmdstring (lambda (p) ;; wait for i/o in case amixer is slow ;; to respond. (thread-wait-for-i/o! (port->fileno p)) (read-string 2048 p))))))) (define (make-amixer-eq band-index) (assert (number? band-index)) ;; we don't have amixer getters for EQ Stages because we can only ;; get coefficients back. so we cache EQ values (should be fixed in ;; interface for kernel) ;; TODO: make thread-safe or replace with a real cmdline getter (define cached-value 50) (define amixer-setter (make-amixer-getter/setter (cmd/getter-setter "alsa_amixer" "cget" "cset" (conc "name=\"Tone Control " band-index " Gain\" -- ")) amixer-parse/values)) ;; EQ range is now -2000 ~ 2000. (define (%->range %) (* (- % 50) 1/50 2000)) ;; (map %->range '(0 10 20 50 100)) (lambda (#!optional val) (if (and val (not (eq? cached-value val))) ;; set if present and changed (begin (set! cached-value val) (amixer-setter (list (%->range val))))) cached-value)) (define amixer-eq/cube (let () ;; allocate 5 getter/setters with cached EQ-values (define amixer-eqs (list-tabulate 5 (lambda (idx) (make-amixer-eq idx)))) ;; (or #f (fp fp fp ...)) (lambda (#!optional gains) (map (lambda (getter/setter-proc gain) (getter/setter-proc gain)) amixer-eqs (or gains '(#f #f #f #f #f)))))) ;; returns a procedure which: ;; ;; with no arguments, returns the last read value ;; with 1 argument, writes using writer ;; ;; should currently be thread-safe as file-write on port pop is ;; atomic, but this could be cleaned up. (define (make-cmixer-interface reader #!optional (writer display) (cmds '("cmixer" "Master Volume"))) (define last-read #f) (receive (pip pop pid) (spawn* (car cmds) (cdr cmds)) (define (cleanup!) ;; obs: errors if process already exited (process-wait pid)) (define reader-thunk (->> (lambda () (set! last-read (reader pip)) (pp `(info amixer ,(current-thread) read ,last-read)) (if (eof-object? last-read) #f #t)) (loop/exceptions (lambda (e) (pp `(error cmixer-thread ,(condition->list e))) #f)) (loop) ((lambda (h) (lambda () (h) (cleanup!)))))) (thread-start! (make-thread reader-thunk "cmixer-reader")) (match-lambda* (( '#:quit) (process-signal pid)) (( x ) (set! last-read (writer x pop))) ;; <-- TODO: this is not good (( ) last-read)))) (begin (handle-exceptions e (void) (amixer-volume #:quit)) (define amixer-volume (let () (define (notify volume) (send-notification "/v1/player/volume" `((value . ,volume)))) (make-cmixer-interface ;; read line-by-line from port p and convert to numberical value (lambda (p) (let* ((line (read-line p 1024)) (volume (string->number (string-trim line)))) (cond ((eof-object? line) line) (else (notify volume) volume)))) ;; write number x to p with appending newline (lambda (x p) (write `("setting volume to" ,x)) (notify x) (display x p) (display #\newline p) x))))) ;; (amixer-volume) ;; (amixer-volume 55) (define amixer-eq amixer-eq/cube) (include "amixer.test.scm") )
false
a2201541baf68ae8f0477cc20b123661c88ef728
af3b4c56ca4b1b891cb10f08bd71555181f256d5
/a10.scm
32f754f0f24810534095e857eab6e0f33541a914
[]
no_license
fangyuchen86/c311
7a9cd8b86072cc041b94e510faf33ff4c0075592
7da206f36922d876264f5f194a7a7dba789bde71
refs/heads/master
2020-12-28T21:39:56.087636
2014-12-05T06:17:21
2014-12-05T06:17:21
28,654,072
0
2
null
null
null
null
UTF-8
Scheme
false
false
5,063
scm
a10.scm
(define unit_state (lambda (a) (lambda (s) ;; <-------------------- this lambda is a Ma `(,a . ,s)))) (define star_state (lambda (sequel) (lambda (ma) (lambda (s) ;; <-------------------- this lambda is a Mb (let ((p (ma s))) (let ((new-a (car p)) (new-s (cdr p))) (let ((mb (sequel new-a))) (mb new-s)))))))) (define rember*evenXhowmanyeven (lambda (l) (cond ((null? l) (unit_state '())) ((pair? (car l)) ((star_state (lambda (a) ((star_state (lambda (d) (unit_state (cons a d)))) (rember*evenXhowmanyeven (cdr l))))) (rember*evenXhowmanyeven (car l)))) ((odd? (car l)) ((star_state (lambda (d) (unit_state (cons (car l) d)))) (rember*evenXhowmanyeven (cdr l)))) (else ((star_state (lambda (__) (rember*evenXhowmanyeven (cdr l)))) (lambda (s) `(__ . ,(add1 s)))))))) ;1 (define rember*noneXhowmanyeven (lambda (l) (cond [(null? l) (unit_state '())] [(pair? (car l)) ((star_state (lambda (a) ((star_state (lambda (d) (unit_state (cons a d)))) (rember*noneXhowmanyeven (cdr l))))) (rember*noneXhowmanyeven (car l)))] [(odd? (car l)) ((star_state (lambda (d) (unit_state (cons (car l) d)))) (rember*noneXhowmanyeven (cdr l)))] [else ((star_state (lambda (d) (lambda (s) `(,(cons (car l) d) . ,(add1 s))))) (rember*noneXhowmanyeven (cdr l)))] ;[else ;((star_state (lambda (d) (rember*evenXhowmanyeven (cdr l)))) ;(lambda (s) `(d . ,(add1 s))))] ))) ;2 (define rember*evenXhowmanyodd (lambda (l) (cond [(null? l) (unit_state '())] [(pair? (car l)) ((star_state (lambda (a) ((star_state (lambda (d) (unit_state (cons a d)))) (rember*evenXhowmanyodd (cdr l))))) (rember*evenXhowmanyodd (car l)))] [(even? (car l)) ((star_state (lambda (d) (unit_state d))) (rember*evenXhowmanyodd (cdr l)))] [else ((star_state (lambda (d) (lambda (s) `(,(cons (car l) d) . ,(add1 s))))) (rember*evenXhowmanyodd (cdr l)))] ))) ; 3. (define rember*oddXhowmanyeven (lambda (l) (cond [(null? l) (unit_state '())] [(pair? (car l)) ((star_state (lambda (a) ((star_state (lambda (d) (unit_state (cons a d)))) (rember*oddXhowmanyeven (cdr l))))) (rember*oddXhowmanyeven (car l)))] [(odd? (car l)) ((star_state (lambda (d) (unit_state d))) (rember*oddXhowmanyeven (cdr l)))] [else ((star_state (lambda (d) (lambda (s) `(,(cons (car l) d) . ,(add1 s))))) (rember*oddXhowmanyeven (cdr l)))] ))) (define num3 rember*oddXhowmanyeven) ;4 (define rember*evenXsumofeven (lambda (l) (cond [(null? l) (unit_state '())] [(pair? (car l)) ((star_state (lambda (a) ((star_state (lambda (d) (unit_state (cons a d)))) (rember*evenXsumofeven (cdr l))))) (rember*evenXsumofeven (car l)))] [(even? (car l)) ((star_state (lambda (d) ;(unit_state d) (lambda (s) `(,d . ,(+ (car l) s))) )) (rember*evenXsumofeven (cdr l)))] [else ( (star_state (lambda (d) ;(lambda (s) ;`(,(cons (car l) d) . ,s)) (unit_state (cons (car l) d)) )) (rember*evenXsumofeven (cdr l)))] ))) (define num4 rember*evenXsumofeven) ;5 (define rember*evenXdifferenceofoddsandevens (lambda (l) (cond [(null? l) (unit_state '())] [(pair? (car l)) ((star_state (lambda (a) ((star_state (lambda (d) (unit_state (cons a d)))) (rember*evenXdifferenceofoddsandevens (cdr l))))) (rember*evenXdifferenceofoddsandevens (car l)))] [(even? (car l)) ((star_state (lambda (d) ;(unit_state d) (lambda (s) `(,d . ,(- s (car l)))) )) (rember*evenXdifferenceofoddsandevens (cdr l)))] [else ( (star_state (lambda (d) (lambda (s) `(,(cons (car l) d) . ,(+ s (car l)))) ;(unit_state (cons (car l) d)) )) (rember*evenXdifferenceofoddsandevens (cdr l)))] ))) ;6 (define zeroXfact (lambda (x) (cond [(zero? x) (unit_state 0)] [else ((star_state (lambda (d) (lambda (s) `(0 . ,(* s x)))) ) (zeroXfact (sub1 x)) )] ))) ;7 (define binaryXdecimal (lambda (l) (cond [(null? l) (unit_state '())] [else;(zero? (car l)) ((star_state (lambda (d) (lambda (s) `(,(cons (car l) d) . ,(+ (car l) (* 2 s))) ))) (binaryXdecimal (cdr l)))] ;[else] ))) ;8
false
c8f94fa3802a2bba4620b65cb669adcc4ccd305e
a4ae964ae4cf4b5dc4474b60b81805fb39a579d9
/Scheme/sicp3.3-solution.scm
9b78344f5482724ed1d30b80e3d0ba182a46d03a
[]
no_license
bendardenne/paradigms-exercises
27c2e8e9e703bcd2d9528dd5361f4cd1a8c66aec
24cd0ee2a229c6e1dd9c1d8cdd9686d3379d16ed
refs/heads/master
2020-04-06T07:07:07.925214
2016-09-13T15:37:44
2016-09-13T15:37:44
64,228,255
1
0
null
null
null
null
UTF-8
Scheme
false
false
31,490
scm
sicp3.3-solution.scm
;;; 3.3 Modeling with Mutable Data ;;; 3.3.1 Mutable List Structure (define (cons x y) (let ((new (get-new-pair))) (set-car! new x) (set-cdr! new y) new)) ;; EXERCISE 3.12 (define (append x y) (if (null? x) y (cons (car x) (append (cdr x) y)))) (define (append! x y) (set-cdr! (last x) y) x) (define (last x) (if (null? (cdr x)) x (last (cdr x)))) >>> (define x '(a b)) x >>> (define y '(c d)) y >>> (define z (append x y)) z >>> z (a b c d) >>> (cdr x) (b) >>> (define w (append! x y)) w >>> w (a b c d) >>> (cdr x) (b c d) ;; EXERCISE 3.13 (define (make-cycle x) (set-cdr! (last x) x) x) (define z (make-cycle '(a b c))) >>> (last z) => de interpreter blijft oneindig lang bezig >>> z (a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a b c a ... enz... ) ;; EXERCISE 3.14 (define (mystery x) (define (loop x y) (if (null? x) y (let ((temp (cdr x))) (set-cdr! x y) (loop temp x)))) (loop x '())) >>> (define v '(a b c d)) v >>> (define w (mystery v)) w >>> w (d c b a) >>> v (a) ;;; Sharing and identity (define (set-to-wow! x) (set-car! (car x) 'wow) x) ;; EXERCISE 3.16 (define (count-pairs x) (if (atom? x) 0 (+ (count-pairs (car x)) (count-pairs (cdr x)) 1))) ; Voorbeeld 1 : Aantal pairs = 3 , en count-pairs = 3 >>> (define voorbeeld1 '(a b c)) voorbeeld1 >>> voorbeeld1 (a b c) >>> (count-pairs voorbeeld1) 3 ; Voorbeeld 2 : Aantal pairs = 3 , en count-pairs = 4 >>> (define x '(b)) x >>> x (b) >>> (define y (cons x x)) y >>> y ((b) b) >>> (define voorbeeld2 (cons 'a y)) voorbeeld2 >>> voorbeeld2 (a (b) b) >>> (count-pairs voorbeeld2) 4 ; Voorbeeld 3 : Aantal pairs = 3 , en count-pairs = 7 >>> (define x '(b)) x >>> x (b) >>> (define y (cons x x)) y >>> y ((b) b) >>> (define voorbeeld3 (cons y y)) voorbeeld3 >>> voorbeeld3 (((b) b) (b) b) >>> (count-pairs voorbeeld3) 7 ; Voorbeeld 4 : Aantal pairs = 3 , en count-pairs stopt nooit >>> (define voorbeeld4 (make-cycle '(a b c))) -> oneidige lus (zie oefening 3.13) ;; EXERCISE 3.17 (define (count-pairs structure) (define counted-pairs-list '()) (define first structure) (letrec ((count-distinct-pairs (lambda (current-pair) (let ((already-counted? (lambda (pair) (memq pair counted-pairs-list)))) (let ((add-current (if (already-counted? current-pair) 0 (begin (set! counted-pairs-list (cons current-pair counted-pairs-list)) 1)))) (if (or (atom? current-pair) (eq? current-pair first)) 0 (+ (count-distinct-pairs (car current-pair)) (count-distinct-pairs (cdr current-pair)) add-current))))))) (count-distinct-pairs structure))) ; Als we met deze versie kijken naar voorbeeld1, voorbeeld2, voorbeeld3 en ; voorbeeld4 uit vorige oefening vinden we : >>> (count-pairs voorbeeld1) 3 >>> (count-pairs voorbeeld2) 3 >>> (count-pairs voorbeeld3) 3 >>> (count-pairs voorbeeld4) => interpreter blijft oneindig lang bezig ... ; Deze versie werkt dus exact voor willekeurige structuren, zolang het geen ; lussen zijn. Dit geval kan echter ook opgelost worden, op de volgende ; manier : (define (count-pairs structure) (define counted-pairs-list '()) (define first structure) (define counter 0) (letrec ((count-distinct-pairs (lambda (current-pair) (let ((already-counted? (lambda (pair) (memq pair counted-pairs-list)))) (let ((add-current (if (already-counted? current-pair) 0 (begin (set! counted-pairs-list (cons current-pair counted-pairs-list)) 1)))) (set! counter (add1 counter)) (if (or (atom? current-pair) (and (> counter 1) (eq? current-pair first))) 0 (+ (count-distinct-pairs (car current-pair)) (count-distinct-pairs (cdr current-pair)) add-current))))))) (count-distinct-pairs first))) ; Verklaring : behalve dat we gaan testen of we een paar al tegengekomen ; zijn of niet, gaan we nu ook testen of het paar dat we tegenkomen niet ; het eerste paar van de cyclus is waarmee we zijn begonnen. Zo ja, dan ; stoppen we. Natuurlijk moeten we dan ook een counter bijhouden, omdat ; deze test pas mag beginnen vanaf de tweede stap, aangezien in de eerste ; stap vanzelfsprekend het eerste paar wordt getest (en anders zou het ; algoritme al stoppen bij de eerste stap.) >>> (count-pairs voorbeeld1) 3 >>> (count-pairs voorbeeld2) 3 >>> (count-pairs voorbeeld3) 3 >>> (count-pairs voorbeeld4) 3 ;; EXERCISE 3.18 (define (cycle? list) (define first list) (define counter 0) (letrec ((cycleer (lambda (current-pair) (set! counter (add1 counter)) (cond ((atom? current-pair) 'no-cycle) ((and (> counter 1) (eq? current-pair first)) 'cycle) (else (begin (cycleer (car current-pair)) (cycleer (cdr current-pair)))))))) (cycleer first))) >>> (cycle? voorbeeld1) no-cycle >>> (cycle? voorbeeld2) no-cycle >>> (cycle? voorbeeld3) no-cycle >>> (cycle? voorbeeld4) cycle ;;; Mutation is just assignment (define (cons x y) (define (dispatch m) (cond ((eq? m 'car) x) ((eq? m 'cdr) y) (else (error "Undefined operation -- CONS" m)))) dispatch) (define (car z) (z 'car)) (define (cdr z) (z 'cdr)) (define (cons x y) (define (set-x! v) (set! x v)) (define (set-y! v) (set! y v)) (define (dispatch m) (cond ((eq? m 'car) x) ((eq? m 'cdr) y) ((eq? m 'set-car!) set-x!) ((eq? m 'set-cdr!) set-y!) (else error "Undefined operation -- CONS" m)))) (define (car z) (z 'car)) (define (cdr z) (z 'cdr)) (define (set-car! z new-value) ((z 'set-car!) new-value) z) (define (set-car! z new-value) ((z 'set-cdr!) new-value) z) ;;; 3.3.2 Representing Queues (define (front-ptr queue) (car queue)) (define (rear-ptr queue) (cdr queue)) (define (set-front-ptr! queue item) (set-car! queue item)) (define (set-rear-ptr! queue item) (set-cdr! queue item)) (define (empty-queue? queue) (null? (front-ptr queue))) (define (make-queue) (cons '() '())) (define (front queue) (if (empty-queue? queue) (error "FRONT called with an empty queue" queue) (car (front-ptr queue)))) (define (insert-queue! queue item) (let ((new-pair (cons item '()))) (cond ((empty-queue? queue) (set-front-ptr! queue new-pair) (set-rear-ptr! queue new-pair) queue) (else (set-cdr! (rear-ptr queue) new-pair) (set-rear-ptr! queue new-pair) queue)))) (define (delete-queue! queue) (cond ((empty-queue? queue) (error "Delete called with an empty queue" queue)) (else (set-front-ptr! queue (cdr (front-ptr queue))) queue))) ;; EXERCISE 3.21 >>> (define q1 (make-queue)) q1 >>> (insert-queue! q1 'a) ((a) a) >>> (insert-queue! q1 'b) ((a b) b) >>> (delete-queue! q1) ((b) b) >>> (delete-queue! q1) (() b) ; Verklaring van deze resultaten : >>> (define q1 (make-queue)) q1 >>> q1 (()) ; Een niewe queue bestaat uit een lijst met front-ptr (= car van de lijst) ; gelijk aan de lege lijst '() en next-ptr (= cdr van de lijst) ook gelijk ; aan de lege lijst. M.a.w. q1 = (cons '() '()) = (()) >>> (insert-queue! q1 'a) ((a) a) ; Als we een element 'a toevoegen aan de lege queue maken we van dit nieuwe ; element een paar (cons 'a '()) = (a) en laten we zowel de front-ptr als de ; rear-ptr van de queue naar dit paar verwijzen. ; M.a.w. q1 = (cons '(a) '(a)) = ((a) a) >>> (insert-queue! q1 'b) ((a b) b) ; Wanneer we nu nog een extra element 'b toevoegen, maken we een nieuw paar ; (cons 'b '()) = (b) en hangen dit achteraan de lijst '(a) die we reeds ; hadden. Bovendien wordt '(b) dan het einde van de lijst en moet de ; rear-ptr dus hiernaar verwijzen. Zo krijgen we dus : ((a b) b) >>> (delete-queue! q1) ((b) b) ; Bij een delete wordt het eerste element uit de queue gehaald. De ; verwijzing naar het laatste element verandert dus niet, dus de rear-ptr ; blijft ongewijzigd. Het eerste element van de queue moet echter weggeknipt ; worden. Zodoende verandert ((a b) b) in ((b) b) >>> (delete-queue! q1) (() b) ; Bij een delete wordt het eerste element uit de queue gehaald. De ; verwijzing naar het laatste element verandert dus niet, dus de rear-ptr ; blijft ongewijzigd. Het eerste element van de queue moet echter weggeknipt ; worden. Zodoende verandert ((b) b) in (() b) ; Afdrukken van een queue : (define (print-queue queue) (front-ptr queue)) ;; EXERCISE 3.22 (define (make-queue) (let ((front-ptr '()) (rear-ptr '())) (define (empty?) (null? front-ptr)) (define (insert item) (let ((new-pair (cons item '()))) (if (empty?) (begin (set! rear-ptr new-pair) (set! front-ptr new-pair)) (begin (set-cdr! rear-ptr new-pair) (set! rear-ptr new-pair) front-ptr)))) (define (dispatch m) (cond ((eq? m 'empty?) (empty?)) ((eq? m 'front) (if (empty?) (error "FRONT called with an empty queue") (car front-ptr))) ((eq? m 'insert) insert) ((eq? m 'delete) (if (empty?) (error "DELETE called with an empty queue") (set! front-ptr (cdr front-ptr)))) (else (error "Undefined operation -- MAKE-QUEUE")))) dispatch)) (define (empty-queue? queue) (queue 'empty?)) (define (front queue) (queue 'front)) (define (insert-queue! queue item) ((queue 'insert) item)) (define (delete-queue! queue) (queue 'delete)) (define (print-queue queue) (queue 'print)) ; Voorbeeld : >>> (define q1 (make-queue)) q1 >>> (insert-queue! q1 'a) (a) >>> (insert-queue! q1 'b) (a b) >>> (print-queue q1) (a b) >>> (delete-queue! q1) (b) >>> (delete-queue! q1) () ;; EXERCISE 3.23 (define (make-deque) (cons '() '())) (define (front-ptr deque) (car deque)) (define (set-front-ptr! deque item) (set-car! deque item)) (define (rear-ptr deque) (cdr deque)) (define (set-rear-ptr! deque item) (set-cdr! deque item)) (define (previous deque-node) (caar deque-node)) (define (set-previous! deque-node previous-node) (set-car! (car deque-node) previous-node)) (define (next deque-node) (cdr deque-node)) (define (set-next! deque-node next-node) (set-cdr! deque-node next-node)) (define (value deque-node) (cdar deque-node)) (define (empty-deque? deque) (and (null? (front-ptr deque)) (null? (rear-ptr deque)))) (define (front-deque deque) (if (empty-deque? deque) (error "FRONT-DEQUE called with an empty deque" deque) (value (front-ptr deque)))) (define (rear-deque deque) (if (empty-deque? deque) (error "REAR-DEQUE called with an empty deque" deque) (value (rear-ptr deque)))) (define (front-insert-deque! deque item) (letrec ((new-value-pair (cons '() item)) (new-node (cons new-value-pair '()))) (if (empty-deque? deque) (begin (set-front-ptr! deque new-node) (set-rear-ptr! deque new-node)) (begin (set-previous! (front-ptr deque) new-node) (set-next! new-node (front-ptr deque)) (set-front-ptr! deque new-node))) (print-deque deque))) (define (rear-insert-deque! deque item) (letrec ((new-value-pair (cons '() item)) (new-node (cons new-value-pair '()))) (if (empty-deque? deque) (begin (set-front-ptr! deque new-node) (set-rear-ptr! deque new-node)) (begin (set-next! (rear-ptr deque) new-node) (set-previous! new-node (rear-ptr deque)) (set-rear-ptr! deque new-node))) (print-deque deque))) (define (front-delete-deque! deque) (cond ((empty-deque? deque) (error "FRONT-DELETE-DEQUE called with an empty deque" deque)) ((eq? (front-ptr deque) (rear-ptr deque)) (set-front-ptr! deque '()) (set-rear-ptr! deque '())) (else (let ((next-node (next (front-ptr deque)))) (set-front-ptr! deque next-node) (if (not (null? next-node)) (set-previous! (front-ptr deque) '()))))) (print-deque deque)) (define (rear-delete-deque! deque) (cond ((empty-deque? deque) (error "REAR-DELETE-DEQUE called with an empty deque" deque)) ((eq? (front-ptr deque) (rear-ptr deque)) (set-front-ptr! deque '()) (set-rear-ptr! deque '())) (else (let ((previous-node (previous (rear-ptr deque)))) (set-rear-ptr! deque previous-node) (if (not (null? previous-node)) (set-next! (rear-ptr deque) '()))))) (print-deque deque)) (define (print-deque deque) (letrec ((print-list-of-deque-nodes (lambda (first-node) (display (value first-node)) (display " ") (let ((next-node (next first-node))) (if (not (null? next-node)) (print-list-of-deque-nodes next-node) (display "]")))))) (if (empty-deque? deque) (display "Deque is empty !") (begin (display "Deque : [ ") (print-list-of-deque-nodes (front-ptr deque)))))) ; Voorbeeld : >>> (define d (make-deque)) d >>> (print-deque d) Deque is empty ! >>> (front-insert-deque! d 1) Deque : [ 1 ] >>> (front-insert-deque! d 2) Deque : [ 2 1 ] >>> (rear-insert-deque! d 3) Deque : [ 2 1 3 ] >>> (front-delete-deque! d) Deque : [ 1 3 ] >>> (empty-deque? d) #f >>> (print-deque d) Deque : [ 1 3 ] >>> (front-deque d) 1 >>> (rear-deque d) 3 >>> (rear-delete-deque! d) Deque : [ 1 ] >>> (rear-insert-deque! d 2) Deque : [ 1 2 ] >>> (rear-delete-deque! d) Deque : [ 1 ] >>> (rear-delete-deque! d) Deque is empty ! () ;3.3.3 Representing Tables (define (lookup key table) (let ((record (assq key (cdr table)))) (if (null? record) '() (cdr record)))) (define (assq key records) (cond ((null? records) '()) ((eq? key (caar records)) (car records)) (else (assq key (cdr records))))) (define (insert! key value table) (let ((record (assq key (cdr table)))) (if (null? record) (set-cdr! table (cons (cons key value) (cdr table))) (set-cdr! record value))) 'ok) (define (make-table) (list '*table*)) ;;; Two-dimensional tables (define (lookup key-1 key-2 table) (let ((subtable (assq key-1 (cdr table)))) (if (null? subtable) '() (let ((record (assq key-2 (cdr subtable)))) (if (null? record) '() (cdr record)))))) (define (insert! key-1 key-2 value table) (let ((subtable (assq key-1 (cdr table)))) (if (null? subtable) (set-cdr! table (cons (list key-1 (cons key-2 value)) (cdr table))) (let ((record (assq key-2 (cdr subtable)))) (if (null? record) (set-cdr! subtable (cons (cons key-2 value) (cdr subtable))) (set-cdr! record value))))) 'ok) ;;; Creating local tables (define (make-table) (let ((local-table (list '*table*))) (define (lookup key-1 key-2) (let ((subtable (assq key-1 (cdr local-table)))) (if (null? subtable) '() (let ((record (assq key-2 (cdr subtable)))) (if (null? record) '() (cdr record)))))) (define (insert! key-1 key-2 value) (let ((subtable (assq key-1 (cdr local-table)))) (if (null? subtable) (set-cdr! local-table (cons (list key-1 (cons key-2 value)) (cdr local-table))) (let ((record (assq key-2 (cdr subtable)))) (if (null? record) (set-cdr! subtable (cons (cons key-2 value) (cdr subtable))) (set-cdr! record value))))) 'ok) (define (dispatch m) (cond ((eq? m 'lookup-proc) lookup) ((eq? m 'insert-proc!) insert!) (else (error "Unknown operation -- TABLE" m)))) dispatch)) (define operation-table (make-table)) (define get (operation-table 'lookup-proc)) (define put (operation-table 'insert-proc!)) ;; EXERCISE 3.24 (define (association same-key?) (lambda (key-records) (cond ((null? records) '()) ((same-key? key (caar records)) (car records)) (else ((association same-key?) key (cdr records)))))) (define (make-table same-key?) (let ((local-table (list '*table*)) (assoc (association same-key?))) (define (lookup key-1 key-2) (let ((subtable (assoc key-1 (cdr local-table)))) (if (null? subtable) '() (let ((record (assoc key-2 (cdr subtable)))) (if (null? record) '() (cdr record)))))) (define (insert! key-1 key-2 value) (let ((subtable (assoc key-1 (cdr local-table)))) (if (null? subtable) (set-cdr! local-table (cons (list key-1 (cons key-2 value)) (cdr local-table))) (let ((record (assoc key-2 (cdr subtable)))) (if (null? record) (set-cdr! subtable (cons (cons key-2 value) (cdr subtable))) (set-cdr! record value))))) 'ok) (define (dispatch m) (cond ((eq? m 'lookup-proc) lookup) ((eq? m 'insert-proc!) insert!) (else (error "Unknown operation -- TABLE" m)))) dispatch)) ;; EXERCISE 3.25 (define same-key? =?) (define (association key records) (cond ((null? records) '()) ((same-key? key (caar records)) (car records)) (else (association key (cdr records))))) (define (make-table) (list '*table*)) (define (make-record key datum) (cons key datum)) (define (record? item) (if (pair? item) (string? (cdr item)) #f)) (define (lookup list-of-keys table) (letrec ((lookup-proc (lambda (first-key rest-of-keys table) (let ((subtable (association first-key (cdr table)))) (if (null? subtable) '() (if (null? rest-of-keys) (let ((possible-record (cdr subtable))) (if (record? possible-record) possible-record (error "There is more than one record matching the specified keys -- LOOKUP"))) (lookup-proc (car rest-of-keys) (cdr rest-of-keys) subtable))))))) (if (null? list-of-keys) (error "No keys specified in LOOKUP procedure") (lookup-proc (car list-of-keys) (cdr list-of-keys) table)))) (define (insert! list-of-keys value table) (letrec ((insert-proc (lambda (first-key rest-of-keys table) (let ((subtable (association first-key (cdr table)))) (display "subtable") (if (null? subtable) (set-cdr! table (cons (make-subtable first-key rest-of-keys value) (cdr table))) (if (null? rest-of-keys) (let ((possible-record (cdr subtable))) (if (record? possible-record) (set-cdr! subtable (cons (cons first-key value) (cdr subtable))) (error "There is more than one record matching the specified keys -- LOOKUP"))) (insert-proc (car rest-of-keys) (cdr rest-of-keys) subtable))))))) (if (null? list-of-keys) (error "No keys specified in INSERT procedure") (insert-proc (car list-of-keys) (cdr list-of-keys) table)))) (define (make-subtable first-key rest-of-keys value) (if (null? rest-of-keys) (cons first-key value) (list first-key (make-subtable (car rest-of-keys) (cdr rest-of-keys) value)))) ;; EXERCISE 3.27 (define (fib n) (cond ((= n 0) 0) ((= n 1) 1) (else (+ (fib (- n 1)) (fib (- n 2)))))) (define memo-fib (memoize (lambda (n) (cond ((= n 0) 0) ((= n 1) 1) (else (+ (memo-fib (- n 1)) (memo-fib (- n 2)))))))) (define (memoize f) (let ((table (make-table))) (lambda (x) (let ((previously-computed-result (lookup x table))) (if (not (null? previously-computed-result)) previously-computed-result (let ((result (f x))) (insert! x result table) result)))))) ;; 3.3.4 A Simulator for Digital Circuits (define a (make-wire)) (define b (make-wire)) (define c (make-wire)) (define d (make-wire)) (define e (make-wire)) (define s (make-wire)) (define (half-adder a b s c) (let ((d (make-wire)) (e (make-wire))) (or-gate a b d) (and-gate a b c) (inverter c e) (and-gate d e s))) (define (full-adder a b c-in sum c-out) (let ((s (make-wire)) (c1 (make-wire)) (c2 (make-wire))) (half-adder b c-in s c1) (half-adder a s sum c2) (or-gate c1 c2 c-out))) ;;; Primitive function boxes (define (inverter input output) (define (invert-input) (let ((new-value (logical-not (get-signal input)))) (after-delay inverter-delay (lambda () (set-signal! output new-value))))) (add-action! input invert-input)) (define (logical-not s) (cond ((= s 0) 1) ((= s 1) 0) (else (error "Invalid signal" s)))) (define (and-gate a1 a2 output) (define (and-action-procedure) (let ((new-value (logical-and (get-signal a1) (get-signal a2)))) (after-delay and-gate-delay (lambda () (set-signal! output new-value))))) (add-action! a1 and-action-procedure) (add-action! a2 and-action-procedure)) ;; EXERCISE 3.28 (define (logical-and a1 a2) (cond ((and (= a1 1) (= a2 1)) 1) ((and (or (= a1 1) (= a1 0)) (or (= a2 1) (= a2 0))) 0) (else (error "One of the signals is invalid" a1 a2)))) (define (logical-or a1 a2) (cond ((and (= a1 0) (= a2 0)) 0) ((and (or (= a1 1) (= a1 0)) (or (= a2 1) (= a2 0))) 1) (else (error "One of the signals is invalid" a1 a2)))) (define (or-gate a1 a2 output) (define (or-action-procedure) (let ((new-value (logical-or (get-signal a1) (get-signal a2)))) (after-delay or-gate-delay (lambda () (set-signal! output new-value))))) (add-action! a1 or-action-procedure) (add-action! a2 or-action-procedure)) ;; EXERCISE 3.29 ; maak gebruik van het feit dat ; (a OR b) = { NOT [ (NOT A) AND (NOT B) ] } (define (or-gate a1 a2 output) (let ((not-a (make-wire)) (not-b (make-wire)) (not-a-and-not-b (make-wire))) (inverter a not-a) (inverter b not-b) (and-gate not-a not-b not-a-and-not-b) (inverter not-a-and-not-b output))) ; delay time van de or-gate : ; delay-time van een inverter (wire a of wire b) ; + delay-time van een and-gate (op wires not-a en not-b) ; + delay-time van een inverter (wire not-a-and-not-b) ; = 2*delay-time-inverter + delay-time-and-gate ;; EXERCISE 3.30 (define (ripple-carry-adder list-a list-b list-s c) (if (not (null list-a)) (begin (full-adder c (car list-a) (car list-b) (car list-c) (car list-s)) (ripple-carry-adder (cdr list-a) (cdr list-b) (cdr list-c) (car list-c))))) ; opm : list-a, list-b en list-c moeten zelfde lengte hebben ; delay-time = n*delay-time-full-adder ; delay-time-full-adder (zie figuur 3.25) ; = 2*delay-time-half-adder + delay-time-or-gate ; delay-time-half-adder (zie figuur 3.24) ; = (max (delay-time-or-gate , (delay-time-and-gate + ; delay-time-inverter) ) ) ; + delay-time-and-gate ;;; Representing wires (define (make-wire) (let ((signal-value 0) (action-procedures '())) (define (set-my-signal! new-value) ; set-my-signal! verandert de signal-value naar een nieuwe opgegeven ; waarde new-value (if (not (= signal-value new-value)) (begin (set! signal-value new-value) (call-each action-procedures)) 'done)) (define (accept-action-procedure proc) ; accept-action-procedures plaatst een nieuwe actie op een draad, en ; voert die ene aktie ook onmiddellijk uit (set! action-procedures (cons proc action-procedures)) (proc)) (define (dispatch m) (cond ((eq? m 'get-signal) signal-value) ((eq? m 'set-signal!) set-my-signal!) ((eq? m 'add-action!) accept-action-procedure) (else (error "Unknown operation -- WIRE" m)))) dispatch)) (define (call-each procedures) (if (null? procedures) 'done (begin ((car procedures)) (call-each (cdr procedures))))) (define (get-signal wire) (wire 'get-signal)) (define (set-signal! wire new-value) ((wire 'set-signal!) new-value)) (define (add-action! wire action-procedure) ((wire 'add-action!) action-procedure)) ;;; The agenda (define (after-delay delay action) (add-to-agenda! (+ delay (current-time the-agenda)) action the-agenda)) (define (propagate) (if (empty-agenda? the-agenda) 'done (let ((first-item (first-agenda-item the-agenda))) (first-item) (remove-first-agenda-item! the-agenda) (propagate)))) ;;; A sample simulation (define (probe name wire) (add-action! wire (lambda () (display name) (display " ") (display (current-time the-agenda)) (display " New-value = ") (display (get-signal wire)) (newline)))) (define the-agenda (make-agenda)) (define inverter-delay 2) (define and-gate-delay 3) (define or-gate-delay 5) (define input-1 (make-wire)) (define input-2 (make-wire)) (define sum (make-wire)) (define carry (make-wire)) (probe 'sum sum) (probe 'carry carry) (half-adder input-1 input-2 sum carry) (set-signal! input-1 1) (propagate) (set-signal! input-2 1) (propagate) ;;; Implementing the agenda (define (make-time-segment time queue) (cons time queue)) (define (segment-time s) (car s)) (define (segment-queue s) (cdr s)) (define (make-agenda) (list '*agenda* (make-time-segment 0 (make-queue)))) (define (segments agenda) (cdr agenda)) (define (first-segment agenda) (car (segments agenda))) (define (rest-segments agenda) (cdr (segments agenda))) (define (set-segments! agenda segments) (set-cdr! agenda segments)) (define (current-time agenda) (segment-time (first-segment agenda))) (define (empty-agenda? agenda) (and (empty-queue? (segment-queue (first-segment agenda))) (null? (rest-segments agenda)))) (define (add-to-agenda! time action agenda) (define (add-to-segments! segments) (if (= (segment-time (car segments)) time) (insert-queue! (segment-queue (car segments)) action) (let ((rest (cdr segments))) (cond ((null? rest) (insert-new-time! time action segments)) ((> (segment-time (car rest)) time) (insert-new-time! time action segments)) (else (add-to-segments! rest)))))) (add-to-segments! (segments agenda))) (define (insert-new-time! time action segments) (let ((q (make-queue))) (insert-queue! q action) (set-cdr! segments (cons (make-time-segment time q) (cdr segments))))) (define (remove-first-agenda-item! agenda) (delete-queue! (segment-queue (first-segment agenda)))) (define (first-agenda-item agenda) (let ((q (segment-queue (first-segment agenda)))) (if (empty-queue? q) (begin (set-segments! agenda (rest-segments agenda)) (first-agenda-item agenda)) (front q))))
false
ee58af019212f52cb51da695bfc4ac56c6f87f82
a97e1f9075df3f8eda040e0018eac5e2497f9e16
/share/textbook/lib/textbook/trie.sld
171fbba274d99706d5ad36634f893a77a8eaddc0
[ "MIT", "BSD-3-Clause", "BSL-1.0" ]
permissive
hvellyr/textbook
9eefeded45dce203a51419acaeb47864f7a73810
3b7b797c71384222d58b67bded24ee5b5cc6aa2a
refs/heads/master
2023-03-03T20:41:45.450236
2021-01-24T11:18:00
2021-01-24T11:18:32
31,146,671
0
1
null
2018-01-29T10:59:46
2015-02-22T00:17:16
C++
UTF-8
Scheme
false
false
367
sld
trie.sld
;; -*-scheme-*- ;; Copyright (c) 2019 by Gregor Klinke ;; All rights reserved. (define-library (textbook trie) (import (chibi)) (export make-trie trie? trie-empty? trie-insert trie-ref trie-contains trie-prefix? trie-fold trie-keys trie-values trie-empty-value? ) (include "trie.scm") )
false
f459d4900894c1c97c4e8a2845d9d555936fb30d
bdcc255b5af12d070214fb288112c48bf343c7f6
/scheme/eval.sls
97837cc96a4a345c12b0b3f8bc8d709a99bda746
[]
no_license
xaengceilbiths/chez-lib
089af4ab1d7580ed86fc224af137f24d91d81fa4
b7c825f18b9ada589ce52bf5b5c7c42ac7009872
refs/heads/master
2021-08-14T10:36:51.315630
2017-11-15T11:43:57
2017-11-15T11:43:57
109,713,952
5
1
null
null
null
null
UTF-8
Scheme
false
false
150
sls
eval.sls
#!chezscheme (library (scheme eval) (export environment eval null-environment scheme-report-environment) (import (r7b-impl eval)))
false
85f9ee8d1490ea4d318f6b1eab7711d3b50e11aa
382706a62fae6f24855ab689b8b2d87c6a059fb6
/0.3/vm/src/stack.scm
93c39070635c7edf2a41c0057a7b190557f15631
[ "Apache-2.0" ]
permissive
mstram/bard
ddb1e72a78059617403bea1842840bb9e979198e
340d6919603a30c7944fb66e04df0562180bc0bb
refs/heads/master
2021-01-21T00:12:27.174597
2014-07-10T13:20:39
2014-07-10T13:20:39
null
0
0
null
null
null
null
UTF-8
Scheme
false
false
1,650
scm
stack.scm
;;;; *********************************************************************** ;;;; FILE IDENTIFICATION ;;;; ;;;; Name: stack.scm ;;;; Project: Bard ;;;; Purpose: VM value stack ;;;; Author: mikel evins ;;;; Copyright: 2013 by mikel evins ;;;; ;;;; *********************************************************************** (define-type stack id: 99CC6B45-1C30-46A9-ACDC-D4B8519FB38A constructor: %make-stack elements pointer) (define $default-stack-depth 256) (define (make-stack #!optional (depth $default-stack-depth)) (let ((elts (make-vector depth #f))) (%make-stack elts 0))) (define (push! v stack) (let ((ptr (stack-pointer stack))) (vector-set! (stack-elements stack) ptr v) (stack-pointer-set! stack (+ ptr 1)) stack)) (define (npush! vals stack) (let* ((elts (list->vector vals)) (eltcount (vector-length elts)) (ptr (stack-pointer stack))) (subvector-move! elts 0 eltcount (stack-elements stack) ptr) (stack-pointer-set! stack (+ ptr eltcount)) stack)) (define (pop! stack) (let* ((ptr (- (stack-pointer stack) 1))) (stack-pointer-set! stack ptr) (vector-ref (stack-elements stack) ptr))) (define (top stack) (vector-ref (stack-elements stack) (- (stack-pointer stack) 1))) (define (next stack) (vector-ref (stack-elements stack) (- (stack-pointer stack) 2))) (define (npop! n stack) (let* ((ptr (stack-pointer stack)) (elts (subvector (stack-elements stack) (- ptr n) ptr))) (stack-pointer-set! stack (- ptr n)) (vector->list elts))) (define (depth stack)(stack-pointer stack))
false
6b4808c2ef11f101fb8468d1d64f1626c4a74fd6
e5c8d22db6c9c9ed8b87b76e6bc196237a36e7e7
/lib/xml.ss
6793f7bb79edacf4d7d7dd71920ff3939316c537
[]
no_license
jeapostrophe/youchart
96b78f8f85119032c7a683d043cf8e1a713c7647
ae31588a6b2b9aaa5653a72235d65e01ce1163be
refs/heads/master
2016-09-10T22:13:28.670932
2013-10-31T01:30:23
2013-10-31T01:30:23
618,117
1
0
null
null
null
null
UTF-8
Scheme
false
false
1,776
ss
xml.ss
#lang scheme/base (require (lib "list.ss") (lib "contract.ss") (lib "xml.ss" "xml") (lib "private/response-structs.ss" "web-server") (planet "syntax/sexp.ss" ("dherman" "javascript.plt" 5)) (planet "syntax/pretty-print.ss" ("dherman" "javascript.plt" 5))) (define svg? xexpr?) (provide/contract [js-id (symbol? . -> . symbol?)] [javascript/string (list? . -> . string?)] [javascript (list? . -> . xexpr?)] [svg? (any/c . -> . boolean?)] [xhtml-response (xexpr? . -> . response/full?)] [write-svg! (svg? . -> . void)] [write-xhtml! (xexpr? . -> . void)]) (define (js-id s) (string->symbol (regexp-replace* "-" (symbol->string s) "_"))) (define (javascript/string s) (pretty-format (sexp->SourceElement s))) (define (javascript s) (make-cdata #f #f (javascript/string s))) (define (xhtml-response xe) (define ob (open-output-bytes)) (parameterize ([current-output-port ob]) (write-xhtml! xe)) (make-response/full 200 "Okay" (current-seconds) #"application/xhtml+xml" empty (list (get-output-bytes ob)))) (define (write-svg! xe) (write-xml (make-document (make-prolog empty (make-document-type 'svg (make-external-dtd/public "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" "-//W3C//DTD SVG 1.1//EN" ) #f)) (xexpr->xml xe) empty))) (define (write-xhtml! xe) (parameterize ([empty-tag-shorthand 'never]) (write-xml (make-document (make-prolog empty (make-document-type 'html (make-external-dtd/public "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" "-//W3C//DTD XHTML 1.0 Strict//EN") #f)) (xexpr->xml xe) empty))))
false
efef8c5416021c7a77cb64f8c18e3df1d01a4a10
120324bbbf63c54de0b7f1ca48d5dcbbc5cfb193
/packages/srfi/%3a38/with-shared-structure.larceny.sls
cd88bbdfd718d6b72aa39aeeea930669cdfb59c9
[ "X11-distribute-modifications-variant", "MIT" ]
permissive
evilbinary/scheme-lib
a6d42c7c4f37e684c123bff574816544132cb957
690352c118748413f9730838b001a03be9a6f18e
refs/heads/master
2022-06-22T06:16:56.203827
2022-06-16T05:54:54
2022-06-16T05:54:54
76,329,726
609
71
MIT
2022-06-16T05:54:55
2016-12-13T06:27:36
Scheme
UTF-8
Scheme
false
false
116,256
sls
with-shared-structure.larceny.sls
;;; SRFI 38: External Representation of Data With Shared Structure ;;; ;;; $Id: %3a38.sls 6149 2009-03-19 02:41:56Z will $ ;;; ;;; See <http://srfi.schemers.org/srfi-38/srfi-38.html> for the full document. ;;; ;;; This file contains code that is copyrighted by two separate ;;; SRFI-style copyrights. ;;; ;;; The code for write-with-shared-structure is attributed to ;;; Al Petrovsky and copyrighted by Ray Dillinger. ;;; ;;; All other code was written by William D Clinger. (library (srfi :38 with-shared-structure) (export write-with-shared-structure write/ss read-with-shared-structure read/ss) (import (rnrs base) (rnrs unicode) (rnrs bytevectors) (only (rnrs lists) memq) (rnrs control) (only (rnrs io ports) port? textual-port?) (rnrs io simple) (rnrs hashtables) (rnrs mutable-strings) (rnrs mutable-pairs) (srfi :99 records procedural) (only (srfi :99 records inspection) record?)) ;;; Copyright (C) Ray Dillinger 2003. All Rights Reserved. ;;; ;;; This document and translations of it may be copied and furnished to ;;; others, and derivative works that comment on or otherwise explain it ;;; or assist in its implementation may be prepared, copied, published and ;;; distributed, in whole or in part, without restriction of any kind, ;;; provided that the above copyright notice and this paragraph are ;;; included on all such copies and derivative works. However, this ;;; document itself may not be modified in any way, such as by removing ;;; the copyright notice or references to the Scheme Request For ;;; Implementation process or editors, except as needed for the purpose of ;;; developing SRFIs in which case the procedures for copyrights defined ;;; in the SRFI process must be followed, or as required to translate it ;;; into languages other than English. ;;; ;;; The limited permissions granted above are perpetual and will not be ;;; revoked by the authors or their successors or assigns. ;;; ;;; This document and the information contained herein is provided on an ;;; "AS IS" basis and THE AUTHOR AND THE SRFI EDITORS DISCLAIM ALL ;;; WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY ;;; WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY ;;; RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A ;;; PARTICULAR PURPOSE. ;;; A printer that shows all sharing of substructures. Uses the Common ;;; Lisp print-circle notation: #n# refers to a previous substructure ;;; labeled with #n=. Takes O(n^2) time. ;;; Code attributed to Al* Petrofsky, modified by Dillinger. ;;; ;;; Modified December 2008 by Will Clinger to use R6RS-style hashtables ;;; and to recognize R6RS data structures. Now runs in O(n) time if ;;; the hashtable accesses are O(1). (define (write-with-shared-structure obj . optional-port) (define (lookup key state) (hashtable-ref state key #f)) (define (present? key state) (hashtable-contains? state key)) (define (updated-state key val state) (hashtable-set! state key val) state) ;; An object is interesting if it might have a mutable state. ;; An interesting object is especially interesting if it has ;; a standard external representation (according to SRFI 38) ;; that might contain the object itself. The interesting ;; objects described by the R5RS or R6RS are: ;; ;; pairs (especially interesting) ;; vectors (especially interesting) ;; strings ;; bytevectors ;; records ;; ports ;; hashtables ;; ;; We treat zero-length vectors, strings, and bytevectors ;; as uninteresting because they don't have a mutable state ;; and the reference implementation for SRFI 38 also treated ;; them as uninteresting. (define (interesting? obj) (or (pair? obj) (and (vector? obj) (not (zero? (vector-length obj)))) (and (string? obj) (not (zero? (string-length obj)))) (bytevector? obj) (record? obj) (port? obj) (hashtable? obj))) ;; The state has an entry for each interesting part of OBJ. The ;; associated value will be: ;; -- a number if the part has been given one, ;; -- #t if the part will need to be assigned a number but has not been yet, ;; -- #f if the part will not need a number. ;; The state also associates a symbol (counter) with the most ;; recently assigned number. ;; Returns a state with new entries for any parts that had ;; numbers assigned. (define (write-obj obj state outport) (define (write-interesting state) (cond ((pair? obj) (display "(" outport) (let write-cdr ((obj (cdr obj)) (state (write-obj (car obj) state outport))) (cond ((and (pair? obj) (not (lookup obj state))) (display " " outport) (write-cdr (cdr obj) (write-obj (car obj) state outport))) ((null? obj) (display ")" outport) state) (else (display " . " outport) (let ((state (write-obj obj state outport))) (display ")" outport) state))))) ((vector? obj) (display "#(" outport) (let ((len (vector-length obj))) (let write-vec ((i 1) (state (write-obj (vector-ref obj 0) state outport))) (cond ((= i len) (display ")" outport) state) (else (display " " outport) (write-vec (+ i 1) (write-obj (vector-ref obj i) state outport))))))) ;; else it's a string or something (else (write obj outport) state))) (cond ((interesting? obj) (let ((val (lookup obj state))) (cond ((not val) (write-interesting state)) ((number? val) (begin (display "#" outport) (write val outport) (display "#" outport) state)) (else (let* ((n (+ 1 (lookup 'counter state))) (state (updated-state 'counter n state))) (begin (display "#" outport) (write n outport) (display "=" outport)) (write-interesting (updated-state obj n state))))))) (else (write obj outport) state))) ;; Scan computes the initial value of the state, which maps each ;; interesting part of the object to #t if it occurs multiple times, ;; #f if only once. (define (scan obj state) (cond ((not (interesting? obj)) state) ((present? obj state) (updated-state obj #t state)) (else (let ((state (updated-state obj #f state))) (cond ((pair? obj) (scan (car obj) (scan (cdr obj) state))) ((vector? obj) (let ((len (vector-length obj))) (do ((i 0 (+ 1 i)) (state state (scan (vector-ref obj i) state))) ((= i len) state)))) (else state)))))) (let* ((state (make-eq-hashtable)) (state (scan obj state)) (state (updated-state 'counter 0 state)) (outport (if (eq? '() optional-port) (current-output-port) (car optional-port)))) (write-obj obj state outport) ;; We don't want to return the big state that write-obj just returned. (if #f #f))) ;;; Copyright (C) William D Clinger (2008). All Rights Reserved. ;;; ;;; Permission is hereby granted, free of charge, to any ;;; person obtaining a copy of this software and associated ;;; documentation files (the "Software"), to deal in the ;;; Software without restriction, including without ;;; limitation the rights to use, copy, modify, merge, ;;; publish, distribute, sublicense, and/or sell copies of ;;; the Software, and to permit persons to whom the Software ;;; is furnished to do so, subject to the following ;;; conditions: ;;; ;;; The above copyright notice and this permission notice ;;; shall be included in all copies or substantial portions ;;; of the Software. ;;; ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ;;; ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ;;; TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ;;; PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ;;; SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ;;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ;;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ;;; IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ;;; DEALINGS IN THE SOFTWARE. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; read-with-shared-structure ; ; Based on Clinger's reference implementation of get-datum. ; ; The scanner's state machine and the recursive descent parser ; were generated by Will Clinger's LexGen and ParseGen, so the ; parser can be extended or customized by regenerating those ; parts. ; ; LexGen and ParseGen are available at ; http://www.ccs.neu.edu/home/will/Research/SW2006/*.tar.gz ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Fixup objects are used to implement SRFI 38. (define rtd:fixup-object (make-rtd 'fixup-object '#((immutable index) (mutable ready) (mutable value)))) (define make-raw-fixup-object (rtd-constructor rtd:fixup-object)) (define (make-fixup-object index) (make-raw-fixup-object index #f #f)) (define fixup-object? (rtd-predicate rtd:fixup-object)) (define fixup-ready? (rtd-accessor rtd:fixup-object 'ready)) (define fixup-index (rtd-accessor rtd:fixup-object 'index)) (define fixup-value (rtd-accessor rtd:fixup-object 'value)) (define (fixup-ready! fixup obj) (raw-fixup-value! fixup obj) (raw-fixup-ready! fixup #t)) (define raw-fixup-ready! (rtd-mutator rtd:fixup-object 'ready)) (define raw-fixup-value! (rtd-mutator rtd:fixup-object 'value)) ; The exported entry point. (define (read-with-shared-structure . rest) (cond ((null? rest) (read-with-shared-structure-local (current-input-port))) ((and (null? (cdr rest)) (input-port? (car rest)) (textual-port? (car rest))) (read-with-shared-structure-local (car rest))) (else (assertion-violation 'read-with-shared-structure "illegal argument(s)" rest)))) (define (read-with-shared-structure-local input-port) ; Constants and local variables. (let* (; Constants. ; initial length of string_accumulator (initial_accumulator_length 64) ; Encodings of error messages. (errLongToken 1) ; extremely long token (errIncompleteToken 2) ; any lexical error, really (errIllegalHexEscape 3) ; illegal \x... (errIllegalNamedChar 4) ; illegal #\... (errIllegalString 5) ; illegal string (errIllegalSymbol 6) ; illegal symbol (errNoDelimiter 7) ; missing delimiter after token (errSRFI38 8) ; illegal #...# (errBug 9) ; bug in reader, shouldn't happen (errLexGenBug 10) ; can't happen ; Important but unnamed non-Ascii characters. (char:nel (integer->char #x85)) (char:ls (integer->char #x2028)) ; State for one-token buffering in lexical analyzer. (kindOfNextToken 'z1) ; valid iff nextTokenIsReady (nextTokenIsReady #f) (tokenValue "") ; string associated with current token ; A string buffer for the characters of the current token. ; Resized as necessary. (string_accumulator (make-string initial_accumulator_length)) ; Number of characters in string_accumulator. (string_accumulator_length 0) ; Hook for recording source locations. (locationStart #f) ; Hash table for SRFI 38, or #f. (shared-structures #f) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Hand-coding scanner0 makes a small but worthwhile difference. ; ; The most common characters are spaces, parentheses, newlines, ; semicolons, and lower case Ascii letters. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Scanning for the start of a token. (define (scanner0) (define (loop c) (cond ((not (char? c)) (accept 'eofobj)) ((or (char=? c #\space) (char=? c #\newline)) (read-char input-port) (loop (peek-char input-port))) (else (state0 c)))) (loop (peek-char input-port))) ; Consuming a semicolon comment. (define (scanner1) (define (loop c) (cond ((not (char? c)) (accept 'eofobj)) ((char=? c #\newline) (scanner0)) (else (loop (read-char input-port))))) (loop (read-char input-port))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; LexGen generated the code for the state machine. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (state0 c) (case c ((#\`) (consumeChar) (accept 'backquote)) ((#\') (consumeChar) (accept 'quote)) ((#\]) (consumeChar) (accept 'rbracket)) ((#\[) (consumeChar) (accept 'lbracket)) ((#\)) (consumeChar) (accept 'rparen)) ((#\() (consumeChar) (accept 'lparen)) ((#\tab #\newline #\vtab #\page #\return #\space) (consumeChar) (begin (set! string_accumulator_length 0) (state0 (scanChar)))) ((#\;) (consumeChar) (state213 (scanChar))) ((#\#) (consumeChar) (state212 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state141 (scanChar))) ((#\a #\b #\c #\d #\e #\f #\g #\h #\i #\j #\k #\l #\m #\n #\o #\p #\q #\r #\s #\t #\u #\v #\w #\x #\y #\z #\A #\B #\C #\D #\E #\F #\G #\H #\I #\J #\K #\L #\M #\N #\O #\P #\Q #\R #\S #\T #\U #\V #\W #\X #\Y #\Z #\! #\$ #\% #\& #\* #\/ #\: #\< #\= #\> #\? #\^ #\_ #\~) (consumeChar) (state13 (scanChar))) ((#\\) (consumeChar) (state12 (scanChar))) ((#\-) (consumeChar) (state9 (scanChar))) ((#\+) (consumeChar) (state8 (scanChar))) ((#\.) (consumeChar) (state7 (scanChar))) ((#\") (consumeChar) (state5 (scanChar))) ((#\,) (consumeChar) (state1 (scanChar))) (else (if ((lambda (c) (and (char? c) (> (char->integer c) 127) (let ((cat (char-general-category c))) (memq cat '(Lu Ll Lt Lm Lo Mn Nl No Pd Pc Po Sc Sm Sk So Co))))) c) (begin (consumeChar) (state13 (scanChar))) (if (eof-object? c) (begin (consumeChar) (accept 'eofobj)) (if ((lambda (c) (and (char? c) (char-whitespace? c))) c) (begin (consumeChar) (begin (set! string_accumulator_length 0) (state0 (scanChar)))) (if ((lambda (c) (and (char? c) (char=? c (integer->char 133)))) c) (begin (consumeChar) (begin (set! string_accumulator_length 0) (state0 (scanChar)))) (scannerError errIncompleteToken)))))))) (define (state1 c) (case c ((#\@) (consumeChar) (accept 'splicing)) (else (accept 'comma)))) (define (state2 c) (case c ((#\") (consumeChar) (accept 'string)) ((#\newline #\return) (consumeChar) (state5 (scanChar))) ((#\\) (consumeChar) (state4 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state2 (scanChar))) (else (if (char? c) (begin (consumeChar) (state5 (scanChar))) (if ((lambda (c) (and (char? c) (char=? c (integer->char 8232)))) c) (begin (consumeChar) (state5 (scanChar))) (if ((lambda (c) (and (char? c) (char=? c (integer->char 133)))) c) (begin (consumeChar) (state5 (scanChar))) (scannerError errIncompleteToken))))))) (define (state3 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state2 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state4 c) (case c ((#\a #\b #\t #\n #\v #\f #\r #\" #\\ #\newline #\return #\space) (consumeChar) (state5 (scanChar))) ((#\x) (consumeChar) (state3 (scanChar))) (else (if ((lambda (c) (and (char? c) (char=? c (integer->char 8232)))) c) (begin (consumeChar) (state5 (scanChar))) (if ((lambda (c) (and (char? c) (char=? c (integer->char 133)))) c) (begin (consumeChar) (state5 (scanChar))) (scannerError errIncompleteToken)))))) (define (state5 c) (case c ((#\") (consumeChar) (accept 'string)) ((#\newline #\return) (consumeChar) (state5 (scanChar))) ((#\\) (consumeChar) (state4 (scanChar))) (else (if (char? c) (begin (consumeChar) (state5 (scanChar))) (if ((lambda (c) (and (char? c) (char=? c (integer->char 8232)))) c) (begin (consumeChar) (state5 (scanChar))) (if ((lambda (c) (and (char? c) (char=? c (integer->char 133)))) c) (begin (consumeChar) (state5 (scanChar))) (scannerError errIncompleteToken))))))) (define (state6 c) (case c ((#\.) (consumeChar) (accept 'id)) (else (scannerError errIncompleteToken)))) (define (state7 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state130 (scanChar))) ((#\.) (consumeChar) (state6 (scanChar))) (else (accept 'period)))) (define (state8 c) (case c ((#\I) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state203 (scanChar))) ((#\.) (consumeChar) (state149 (scanChar))) ((#\n) (consumeChar) (state148 (scanChar))) ((#\i) (consumeChar) (state143 (scanChar))) (else (accept 'id)))) (define (state9 c) (case c ((#\I) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state203 (scanChar))) ((#\.) (consumeChar) (state149 (scanChar))) ((#\n) (consumeChar) (state148 (scanChar))) ((#\i) (consumeChar) (state143 (scanChar))) ((#\>) (consumeChar) (state13 (scanChar))) (else (accept 'id)))) (define (state10 c) (case c ((#\;) (consumeChar) (state13 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state10 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state11 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state10 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state12 c) (case c ((#\x) (consumeChar) (state11 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state13 c) (case c ((#\a #\b #\c #\d #\e #\f #\g #\h #\i #\j #\k #\l #\m #\n #\o #\p #\q #\r #\s #\t #\u #\v #\w #\x #\y #\z #\A #\B #\C #\D #\E #\F #\G #\H #\I #\J #\K #\L #\M #\N #\O #\P #\Q #\R #\S #\T #\U #\V #\W #\X #\Y #\Z #\! #\$ #\% #\& #\* #\/ #\: #\< #\= #\> #\? #\^ #\_ #\~ #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\+ #\- #\. #\@) (consumeChar) (state13 (scanChar))) ((#\\) (consumeChar) (state12 (scanChar))) (else (if ((lambda (c) (and (char? c) (let ((cat (char-general-category c))) (memq cat '(Nd Mc Me))))) c) (begin (consumeChar) (state13 (scanChar))) (if ((lambda (c) (and (char? c) (> (char->integer c) 127) (let ((cat (char-general-category c))) (memq cat '(Lu Ll Lt Lm Lo Mn Nl No Pd Pc Po Sc Sm Sk So Co))))) c) (begin (consumeChar) (state13 (scanChar))) (accept 'id)))))) (define (state14 c) (case c ((#\#) (consumeChar) (accept 'sharinguse)) ((#\=) (consumeChar) (accept 'sharingdef)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state14 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state15 c) (case c ((#\@) (consumeChar) (accept 'unsyntaxsplicing)) (else (accept 'unsyntax)))) (define (state16 c) (case c ((#\() (consumeChar) (accept 'bvecstart)) (else (scannerError errIncompleteToken)))) (define (state17 c) (case c ((#\8) (consumeChar) (state16 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state18 c) (case c ((#\u) (consumeChar) (state17 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state19 c) (case c ((#\a #\b #\c #\d #\e #\f #\g #\h #\i #\j #\k #\l #\m #\n #\o #\p #\q #\r #\s #\t #\u #\v #\w #\x #\y #\z #\A #\B #\C #\D #\E #\F #\G #\H #\I #\J #\K #\L #\M #\N #\O #\P #\Q #\R #\S #\T #\U #\V #\W #\X #\Y #\Z) (consumeChar) (state19 (scanChar))) (else (accept 'character)))) (define (state20 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state20 (scanChar))) (else (accept 'character)))) (define (state21 c) (case c ((#\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state21 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state20 (scanChar))) ((#\g #\h #\i #\j #\k #\l #\m #\n #\o #\p #\q #\r #\s #\t #\u #\v #\w #\x #\y #\z #\G #\H #\I #\J #\K #\L #\M #\N #\O #\P #\Q #\R #\S #\T #\U #\V #\W #\X #\Y #\Z) (consumeChar) (state19 (scanChar))) (else (accept 'character)))) (define (state22 c) (case c ((#\x) (consumeChar) (state21 (scanChar))) ((#\a #\b #\c #\d #\e #\f #\g #\h #\i #\j #\k #\l #\m #\n #\o #\p #\q #\r #\s #\t #\u #\v #\w #\y #\z #\A #\B #\C #\D #\E #\F #\G #\H #\I #\J #\K #\L #\M #\N #\O #\P #\Q #\R #\S #\T #\U #\V #\W #\X #\Y #\Z) (consumeChar) (state19 (scanChar))) (else (if (char? c) (begin (consumeChar) (accept 'character)) (scannerError errIncompleteToken))))) (define (state23 c) (case c ((#\i #\I #\e #\E) (consumeChar) (state58 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state24 c) (case c ((#\+ #\-) (consumeChar) (state57 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state33 (scanChar))) ((#\#) (consumeChar) (state23 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state25 c) (case c ((#\i #\I #\e #\E) (consumeChar) (state88 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state26 c) (case c ((#\+ #\-) (consumeChar) (state87 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state63 (scanChar))) ((#\#) (consumeChar) (state25 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state27 c) (case c ((#\i #\I #\e #\E) (consumeChar) (state126 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state28 c) (case c ((#\+ #\-) (consumeChar) (state125 (scanChar))) ((#\0 #\1) (consumeChar) (state93 (scanChar))) ((#\#) (consumeChar) (state27 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state29 c) (case c ((#\@) (consumeChar) (state51 (scanChar))) ((#\+ #\-) (consumeChar) (state45 (scanChar))) ((#\#) (consumeChar) (state29 (scanChar))) (else (accept 'number)))) (define (state30 c) (case c ((#\@) (consumeChar) (state51 (scanChar))) ((#\+ #\-) (consumeChar) (state45 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state30 (scanChar))) ((#\#) (consumeChar) (state29 (scanChar))) (else (accept 'number)))) (define (state31 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state30 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state32 c) (case c ((#\@) (consumeChar) (state51 (scanChar))) ((#\+ #\-) (consumeChar) (state45 (scanChar))) ((#\#) (consumeChar) (state32 (scanChar))) ((#\/) (consumeChar) (state31 (scanChar))) (else (accept 'number)))) (define (state33 c) (case c ((#\@) (consumeChar) (state51 (scanChar))) ((#\+ #\-) (consumeChar) (state45 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state33 (scanChar))) ((#\#) (consumeChar) (state32 (scanChar))) ((#\/) (consumeChar) (state31 (scanChar))) (else (accept 'number)))) (define (state34 c) (case c ((#\f) (consumeChar) (state38 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state35 c) (case c ((#\n) (consumeChar) (state34 (scanChar))) (else (accept 'number)))) (define (state36 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\@) (consumeChar) (state51 (scanChar))) ((#\+ #\-) (consumeChar) (state45 (scanChar))) (else (accept 'number)))) (define (state37 c) (case c ((#\0) (consumeChar) (state36 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state38 c) (case c ((#\.) (consumeChar) (state37 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state39 c) (case c ((#\n) (consumeChar) (state38 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state40 c) (case c ((#\a) (consumeChar) (state39 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state41 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state108 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state41 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state42 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state41 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state43 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state43 (scanChar))) ((#\/) (consumeChar) (state42 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state44 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state44 (scanChar))) ((#\#) (consumeChar) (state43 (scanChar))) ((#\/) (consumeChar) (state42 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state45 c) (case c ((#\n) (consumeChar) (state107 (scanChar))) ((#\i) (consumeChar) (state102 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state44 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state46 c) (case c ((#\#) (consumeChar) (state192 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state46 (scanChar))) (else (accept 'number)))) (define (state47 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state46 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state48 c) (case c ((#\#) (consumeChar) (state48 (scanChar))) ((#\/) (consumeChar) (state47 (scanChar))) (else (accept 'number)))) (define (state49 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state49 (scanChar))) ((#\#) (consumeChar) (state48 (scanChar))) ((#\/) (consumeChar) (state47 (scanChar))) (else (accept 'number)))) (define (state50 c) (case c ((#\n) (consumeChar) (state183 (scanChar))) ((#\i) (consumeChar) (state179 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state49 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state51 c) (case c ((#\+ #\-) (consumeChar) (state50 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state49 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state52 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state52 (scanChar))) ((#\@) (consumeChar) (state51 (scanChar))) ((#\+ #\-) (consumeChar) (state45 (scanChar))) (else (accept 'number)))) (define (state53 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state53 (scanChar))) ((#\#) (consumeChar) (state52 (scanChar))) ((#\@) (consumeChar) (state51 (scanChar))) ((#\+ #\-) (consumeChar) (state45 (scanChar))) (else (accept 'number)))) (define (state54 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state53 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state55 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state55 (scanChar))) ((#\/) (consumeChar) (state54 (scanChar))) ((#\@) (consumeChar) (state51 (scanChar))) ((#\+ #\-) (consumeChar) (state45 (scanChar))) (else (accept 'number)))) (define (state56 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state56 (scanChar))) ((#\#) (consumeChar) (state55 (scanChar))) ((#\/) (consumeChar) (state54 (scanChar))) ((#\@) (consumeChar) (state51 (scanChar))) ((#\+ #\-) (consumeChar) (state45 (scanChar))) (else (accept 'number)))) (define (state57 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state56 (scanChar))) ((#\n) (consumeChar) (state40 (scanChar))) ((#\i) (consumeChar) (state35 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state58 c) (case c ((#\+ #\-) (consumeChar) (state57 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\a #\b #\c #\d #\e #\f #\A #\B #\C #\D #\E #\F) (consumeChar) (state33 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state59 c) (case c ((#\@) (consumeChar) (state81 (scanChar))) ((#\+ #\-) (consumeChar) (state75 (scanChar))) ((#\#) (consumeChar) (state59 (scanChar))) (else (accept 'number)))) (define (state60 c) (case c ((#\@) (consumeChar) (state81 (scanChar))) ((#\+ #\-) (consumeChar) (state75 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state60 (scanChar))) ((#\#) (consumeChar) (state59 (scanChar))) (else (accept 'number)))) (define (state61 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state60 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state62 c) (case c ((#\@) (consumeChar) (state81 (scanChar))) ((#\+ #\-) (consumeChar) (state75 (scanChar))) ((#\#) (consumeChar) (state62 (scanChar))) ((#\/) (consumeChar) (state61 (scanChar))) (else (accept 'number)))) (define (state63 c) (case c ((#\@) (consumeChar) (state81 (scanChar))) ((#\+ #\-) (consumeChar) (state75 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state63 (scanChar))) ((#\#) (consumeChar) (state62 (scanChar))) ((#\/) (consumeChar) (state61 (scanChar))) (else (accept 'number)))) (define (state64 c) (case c ((#\f) (consumeChar) (state68 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state65 c) (case c ((#\n) (consumeChar) (state64 (scanChar))) (else (accept 'number)))) (define (state66 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\@) (consumeChar) (state81 (scanChar))) ((#\+ #\-) (consumeChar) (state75 (scanChar))) (else (accept 'number)))) (define (state67 c) (case c ((#\0) (consumeChar) (state66 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state68 c) (case c ((#\.) (consumeChar) (state67 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state69 c) (case c ((#\n) (consumeChar) (state68 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state70 c) (case c ((#\a) (consumeChar) (state69 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state71 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state108 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state71 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state72 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state71 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state73 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state73 (scanChar))) ((#\/) (consumeChar) (state72 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state74 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state74 (scanChar))) ((#\#) (consumeChar) (state73 (scanChar))) ((#\/) (consumeChar) (state72 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state75 c) (case c ((#\n) (consumeChar) (state107 (scanChar))) ((#\i) (consumeChar) (state102 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state74 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state76 c) (case c ((#\#) (consumeChar) (state192 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state76 (scanChar))) (else (accept 'number)))) (define (state77 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state76 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state78 c) (case c ((#\#) (consumeChar) (state78 (scanChar))) ((#\/) (consumeChar) (state77 (scanChar))) (else (accept 'number)))) (define (state79 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state79 (scanChar))) ((#\#) (consumeChar) (state78 (scanChar))) ((#\/) (consumeChar) (state77 (scanChar))) (else (accept 'number)))) (define (state80 c) (case c ((#\n) (consumeChar) (state183 (scanChar))) ((#\i) (consumeChar) (state179 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state79 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state81 c) (case c ((#\+ #\-) (consumeChar) (state80 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state79 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state82 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state82 (scanChar))) ((#\@) (consumeChar) (state81 (scanChar))) ((#\+ #\-) (consumeChar) (state75 (scanChar))) (else (accept 'number)))) (define (state83 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state83 (scanChar))) ((#\#) (consumeChar) (state82 (scanChar))) ((#\@) (consumeChar) (state81 (scanChar))) ((#\+ #\-) (consumeChar) (state75 (scanChar))) (else (accept 'number)))) (define (state84 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state83 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state85 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state85 (scanChar))) ((#\/) (consumeChar) (state84 (scanChar))) ((#\@) (consumeChar) (state81 (scanChar))) ((#\+ #\-) (consumeChar) (state75 (scanChar))) (else (accept 'number)))) (define (state86 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state86 (scanChar))) ((#\#) (consumeChar) (state85 (scanChar))) ((#\/) (consumeChar) (state84 (scanChar))) ((#\@) (consumeChar) (state81 (scanChar))) ((#\+ #\-) (consumeChar) (state75 (scanChar))) (else (accept 'number)))) (define (state87 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state86 (scanChar))) ((#\n) (consumeChar) (state70 (scanChar))) ((#\i) (consumeChar) (state65 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state88 c) (case c ((#\+ #\-) (consumeChar) (state87 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7) (consumeChar) (state63 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state89 c) (case c ((#\@) (consumeChar) (state119 (scanChar))) ((#\+ #\-) (consumeChar) (state113 (scanChar))) ((#\#) (consumeChar) (state89 (scanChar))) (else (accept 'number)))) (define (state90 c) (case c ((#\@) (consumeChar) (state119 (scanChar))) ((#\+ #\-) (consumeChar) (state113 (scanChar))) ((#\0 #\1) (consumeChar) (state90 (scanChar))) ((#\#) (consumeChar) (state89 (scanChar))) (else (accept 'number)))) (define (state91 c) (case c ((#\0 #\1) (consumeChar) (state90 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state92 c) (case c ((#\@) (consumeChar) (state119 (scanChar))) ((#\+ #\-) (consumeChar) (state113 (scanChar))) ((#\#) (consumeChar) (state92 (scanChar))) ((#\/) (consumeChar) (state91 (scanChar))) (else (accept 'number)))) (define (state93 c) (case c ((#\@) (consumeChar) (state119 (scanChar))) ((#\+ #\-) (consumeChar) (state113 (scanChar))) ((#\0 #\1) (consumeChar) (state93 (scanChar))) ((#\#) (consumeChar) (state92 (scanChar))) ((#\/) (consumeChar) (state91 (scanChar))) (else (accept 'number)))) (define (state94 c) (case c ((#\f) (consumeChar) (state98 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state95 c) (case c ((#\n) (consumeChar) (state94 (scanChar))) (else (accept 'number)))) (define (state96 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\@) (consumeChar) (state119 (scanChar))) ((#\+ #\-) (consumeChar) (state113 (scanChar))) (else (accept 'number)))) (define (state97 c) (case c ((#\0) (consumeChar) (state96 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state98 c) (case c ((#\.) (consumeChar) (state97 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state99 c) (case c ((#\n) (consumeChar) (state98 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state100 c) (case c ((#\a) (consumeChar) (state99 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state101 c) (case c ((#\f) (consumeChar) (state105 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state102 c) (case c ((#\n) (consumeChar) (state101 (scanChar))) (else (accept 'number)))) (define (state103 c) (case c ((#\i) (consumeChar) (accept 'number)) (else (scannerError errIncompleteToken)))) (define (state104 c) (case c ((#\0) (consumeChar) (state103 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state105 c) (case c ((#\.) (consumeChar) (state104 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state106 c) (case c ((#\n) (consumeChar) (state105 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state107 c) (case c ((#\a) (consumeChar) (state106 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state108 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state108 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state109 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\0 #\1) (consumeChar) (state109 (scanChar))) ((#\#) (consumeChar) (state108 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state110 c) (case c ((#\0 #\1) (consumeChar) (state109 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state111 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state111 (scanChar))) ((#\/) (consumeChar) (state110 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state112 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\0 #\1) (consumeChar) (state112 (scanChar))) ((#\#) (consumeChar) (state111 (scanChar))) ((#\/) (consumeChar) (state110 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state113 c) (case c ((#\0 #\1) (consumeChar) (state112 (scanChar))) ((#\n) (consumeChar) (state107 (scanChar))) ((#\i) (consumeChar) (state102 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state114 c) (case c ((#\#) (consumeChar) (state192 (scanChar))) ((#\0 #\1) (consumeChar) (state114 (scanChar))) (else (accept 'number)))) (define (state115 c) (case c ((#\0 #\1) (consumeChar) (state114 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state116 c) (case c ((#\#) (consumeChar) (state116 (scanChar))) ((#\/) (consumeChar) (state115 (scanChar))) (else (accept 'number)))) (define (state117 c) (case c ((#\0 #\1) (consumeChar) (state117 (scanChar))) ((#\#) (consumeChar) (state116 (scanChar))) ((#\/) (consumeChar) (state115 (scanChar))) (else (accept 'number)))) (define (state118 c) (case c ((#\n) (consumeChar) (state183 (scanChar))) ((#\i) (consumeChar) (state179 (scanChar))) ((#\0 #\1) (consumeChar) (state117 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state119 c) (case c ((#\+ #\-) (consumeChar) (state118 (scanChar))) ((#\0 #\1) (consumeChar) (state117 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state120 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state120 (scanChar))) ((#\@) (consumeChar) (state119 (scanChar))) ((#\+ #\-) (consumeChar) (state113 (scanChar))) (else (accept 'number)))) (define (state121 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\0 #\1) (consumeChar) (state121 (scanChar))) ((#\#) (consumeChar) (state120 (scanChar))) ((#\@) (consumeChar) (state119 (scanChar))) ((#\+ #\-) (consumeChar) (state113 (scanChar))) (else (accept 'number)))) (define (state122 c) (case c ((#\0 #\1) (consumeChar) (state121 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state123 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state123 (scanChar))) ((#\/) (consumeChar) (state122 (scanChar))) ((#\@) (consumeChar) (state119 (scanChar))) ((#\+ #\-) (consumeChar) (state113 (scanChar))) (else (accept 'number)))) (define (state124 c) (case c ((#\i) (consumeChar) (accept 'number)) ((#\0 #\1) (consumeChar) (state124 (scanChar))) ((#\#) (consumeChar) (state123 (scanChar))) ((#\/) (consumeChar) (state122 (scanChar))) ((#\@) (consumeChar) (state119 (scanChar))) ((#\+ #\-) (consumeChar) (state113 (scanChar))) (else (accept 'number)))) (define (state125 c) (case c ((#\0 #\1) (consumeChar) (state124 (scanChar))) ((#\n) (consumeChar) (state100 (scanChar))) ((#\i) (consumeChar) (state95 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state126 c) (case c ((#\+ #\-) (consumeChar) (state125 (scanChar))) ((#\0 #\1) (consumeChar) (state93 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state127 c) (case c ((#\d #\D) (consumeChar) (state205 (scanChar))) ((#\b #\B) (consumeChar) (state126 (scanChar))) ((#\o #\O) (consumeChar) (state88 (scanChar))) ((#\x #\X) (consumeChar) (state58 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state128 c) (case c ((#\+ #\-) (consumeChar) (state204 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state141 (scanChar))) ((#\.) (consumeChar) (state129 (scanChar))) ((#\#) (consumeChar) (state127 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state129 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state130 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state130 c) (case c ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\#) (consumeChar) (state136 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state135 (scanChar))) ((#\|) (consumeChar) (state132 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state130 (scanChar))) (else (accept 'number)))) (define (state131 c) (case c ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state131 (scanChar))) (else (accept 'number)))) (define (state132 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state131 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state133 c) (case c ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state133 (scanChar))) ((#\|) (consumeChar) (state132 (scanChar))) (else (accept 'number)))) (define (state134 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state133 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state135 c) (case c ((#\+ #\-) (consumeChar) (state134 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state133 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state136 c) (case c ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\#) (consumeChar) (state136 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state135 (scanChar))) ((#\|) (consumeChar) (state132 (scanChar))) (else (accept 'number)))) (define (state137 c) (case c ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\#) (consumeChar) (state137 (scanChar))) (else (accept 'number)))) (define (state138 c) (case c ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state138 (scanChar))) ((#\#) (consumeChar) (state137 (scanChar))) (else (accept 'number)))) (define (state139 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state138 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state140 c) (case c ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\#) (consumeChar) (state140 (scanChar))) ((#\/) (consumeChar) (state139 (scanChar))) ((#\.) (consumeChar) (state136 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state135 (scanChar))) ((#\|) (consumeChar) (state132 (scanChar))) (else (accept 'number)))) (define (state141 c) (case c ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state141 (scanChar))) ((#\#) (consumeChar) (state140 (scanChar))) ((#\/) (consumeChar) (state139 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state135 (scanChar))) ((#\|) (consumeChar) (state132 (scanChar))) ((#\.) (consumeChar) (state130 (scanChar))) (else (accept 'number)))) (define (state142 c) (case c ((#\f) (consumeChar) (state146 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state143 c) (case c ((#\n) (consumeChar) (state142 (scanChar))) (else (accept 'number)))) (define (state144 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) (else (accept 'number)))) (define (state145 c) (case c ((#\0) (consumeChar) (state144 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state146 c) (case c ((#\.) (consumeChar) (state145 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state147 c) (case c ((#\n) (consumeChar) (state146 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state148 c) (case c ((#\a) (consumeChar) (state147 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state149 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state150 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state150 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\#) (consumeChar) (state156 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state155 (scanChar))) ((#\|) (consumeChar) (state152 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state150 (scanChar))) (else (accept 'number)))) (define (state151 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state151 (scanChar))) (else (accept 'number)))) (define (state152 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state151 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state153 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state153 (scanChar))) ((#\|) (consumeChar) (state152 (scanChar))) (else (accept 'number)))) (define (state154 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state153 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state155 c) (case c ((#\+ #\-) (consumeChar) (state154 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state153 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state156 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\#) (consumeChar) (state156 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state155 (scanChar))) ((#\|) (consumeChar) (state152 (scanChar))) (else (accept 'number)))) (define (state157 c) (case c ((#\f) (consumeChar) (state161 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state158 c) (case c ((#\n) (consumeChar) (state157 (scanChar))) (else (accept 'number)))) (define (state159 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) (else (scannerError errIncompleteToken)))) (define (state160 c) (case c ((#\0) (consumeChar) (state159 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state161 c) (case c ((#\.) (consumeChar) (state160 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state162 c) (case c ((#\n) (consumeChar) (state161 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state163 c) (case c ((#\a) (consumeChar) (state162 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state164 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state165 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state165 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state171 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state170 (scanChar))) ((#\|) (consumeChar) (state167 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state165 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state166 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state166 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state167 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state166 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state168 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state168 (scanChar))) ((#\|) (consumeChar) (state167 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state169 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state168 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state170 c) (case c ((#\+ #\-) (consumeChar) (state169 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state168 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state171 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state171 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state170 (scanChar))) ((#\|) (consumeChar) (state167 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state172 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state172 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state173 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state173 (scanChar))) ((#\#) (consumeChar) (state172 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state174 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state173 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state175 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state175 (scanChar))) ((#\/) (consumeChar) (state174 (scanChar))) ((#\.) (consumeChar) (state171 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state170 (scanChar))) ((#\|) (consumeChar) (state167 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state176 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state176 (scanChar))) ((#\#) (consumeChar) (state175 (scanChar))) ((#\/) (consumeChar) (state174 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state170 (scanChar))) ((#\|) (consumeChar) (state167 (scanChar))) ((#\.) (consumeChar) (state165 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state177 c) (case c ((#\I) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state176 (scanChar))) ((#\.) (consumeChar) (state164 (scanChar))) ((#\n) (consumeChar) (state163 (scanChar))) ((#\i) (consumeChar) (state158 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state178 c) (case c ((#\f) (consumeChar) (state181 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state179 c) (case c ((#\n) (consumeChar) (state178 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state180 c) (case c ((#\0) (consumeChar) (accept 'number)) (else (scannerError errIncompleteToken)))) (define (state181 c) (case c ((#\.) (consumeChar) (state180 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state182 c) (case c ((#\n) (consumeChar) (state181 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state183 c) (case c ((#\a) (consumeChar) (state182 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state184 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state185 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state185 c) (case c ((#\#) (consumeChar) (state191 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state190 (scanChar))) ((#\|) (consumeChar) (state187 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state185 (scanChar))) (else (accept 'number)))) (define (state186 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state186 (scanChar))) (else (accept 'number)))) (define (state187 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state186 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state188 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state188 (scanChar))) ((#\|) (consumeChar) (state187 (scanChar))) (else (accept 'number)))) (define (state189 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state188 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state190 c) (case c ((#\+ #\-) (consumeChar) (state189 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state188 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state191 c) (case c ((#\#) (consumeChar) (state191 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state190 (scanChar))) ((#\|) (consumeChar) (state187 (scanChar))) (else (accept 'number)))) (define (state192 c) (case c ((#\#) (consumeChar) (state192 (scanChar))) (else (accept 'number)))) (define (state193 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state193 (scanChar))) ((#\#) (consumeChar) (state192 (scanChar))) (else (accept 'number)))) (define (state194 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state193 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state195 c) (case c ((#\#) (consumeChar) (state195 (scanChar))) ((#\/) (consumeChar) (state194 (scanChar))) ((#\.) (consumeChar) (state191 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state190 (scanChar))) ((#\|) (consumeChar) (state187 (scanChar))) (else (accept 'number)))) (define (state196 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state196 (scanChar))) ((#\#) (consumeChar) (state195 (scanChar))) ((#\/) (consumeChar) (state194 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state190 (scanChar))) ((#\|) (consumeChar) (state187 (scanChar))) ((#\.) (consumeChar) (state185 (scanChar))) (else (accept 'number)))) (define (state197 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state196 (scanChar))) ((#\.) (consumeChar) (state184 (scanChar))) ((#\n) (consumeChar) (state183 (scanChar))) ((#\i) (consumeChar) (state179 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state198 c) (case c ((#\+ #\-) (consumeChar) (state197 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state196 (scanChar))) ((#\.) (consumeChar) (state184 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state199 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state199 (scanChar))) ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) (else (accept 'number)))) (define (state200 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state200 (scanChar))) ((#\#) (consumeChar) (state199 (scanChar))) ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) (else (accept 'number)))) (define (state201 c) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state200 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state202 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\#) (consumeChar) (state202 (scanChar))) ((#\/) (consumeChar) (state201 (scanChar))) ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\.) (consumeChar) (state156 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state155 (scanChar))) ((#\|) (consumeChar) (state152 (scanChar))) (else (accept 'number)))) (define (state203 c) (case c ((#\i #\I) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state203 (scanChar))) ((#\#) (consumeChar) (state202 (scanChar))) ((#\/) (consumeChar) (state201 (scanChar))) ((#\@) (consumeChar) (state198 (scanChar))) ((#\+ #\-) (consumeChar) (state177 (scanChar))) ((#\e #\E #\s #\S #\f #\F #\d #\D #\l #\L) (consumeChar) (state155 (scanChar))) ((#\|) (consumeChar) (state152 (scanChar))) ((#\.) (consumeChar) (state150 (scanChar))) (else (accept 'number)))) (define (state204 c) (case c ((#\I) (consumeChar) (accept 'number)) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state203 (scanChar))) ((#\.) (consumeChar) (state149 (scanChar))) ((#\n) (consumeChar) (state148 (scanChar))) ((#\i) (consumeChar) (state143 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state205 c) (case c ((#\+ #\-) (consumeChar) (state204 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state141 (scanChar))) ((#\.) (consumeChar) (state129 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state206 c) (case c ((#\i #\I #\e #\E) (consumeChar) (state205 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state207 c) (case c ((#\#) (consumeChar) (state206 (scanChar))) ((#\+ #\-) (consumeChar) (state204 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state141 (scanChar))) ((#\.) (consumeChar) (state129 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state208 c) (case c ((#\s) (consumeChar) (accept 'miscflag)) (else (scannerError errIncompleteToken)))) (define (state209 c) (case c ((#\r) (consumeChar) (state208 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state210 c) (case c ((#\6) (consumeChar) (state209 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state211 c) (case c ((#\r) (consumeChar) (state210 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state212 c) (case c ((#\`) (consumeChar) (accept 'quasisyntax)) ((#\') (consumeChar) (accept 'syntax)) ((#\() (consumeChar) (accept 'vecstart)) ((#\t #\T #\f #\F) (consumeChar) (accept 'boolean)) ((#\;) (consumeChar) (accept 'commentdatum)) ((#\|) (consumeChar) (accept 'comment)) ((#\!) (consumeChar) (state211 (scanChar))) ((#\d #\D) (consumeChar) (state207 (scanChar))) ((#\i #\I #\e #\E) (consumeChar) (state128 (scanChar))) ((#\b #\B) (consumeChar) (state28 (scanChar))) ((#\o #\O) (consumeChar) (state26 (scanChar))) ((#\x #\X) (consumeChar) (state24 (scanChar))) ((#\\) (consumeChar) (state22 (scanChar))) ((#\v) (consumeChar) (state18 (scanChar))) ((#\,) (consumeChar) (state15 (scanChar))) ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (consumeChar) (state14 (scanChar))) (else (scannerError errIncompleteToken)))) (define (state213 c) (case c (else (if ((lambda (c) (and (char? c) (not (char=? c (integer->char 10))))) c) (begin (consumeChar) (state213 (scanChar))) (begin (set! string_accumulator_length 0) (state0 (scanChar))))))) (define (state214 c) (case c (else (begin (set! string_accumulator_length 0) (state0 (scanChar)))))) (define (state215 c) (case c (else (accept 'comment)))) (define (state216 c) (case c (else (accept 'commentdatum)))) (define (state217 c) (case c (else (accept 'miscflag)))) (define (state218 c) (case c (else (accept 'boolean)))) (define (state219 c) (case c (else (accept 'number)))) (define (state220 c) (case c (else (accept 'character)))) (define (state221 c) (case c (else (accept 'vecstart)))) (define (state222 c) (case c (else (accept 'bvecstart)))) (define (state223 c) (case c (else (accept 'syntax)))) (define (state224 c) (case c (else (accept 'quasisyntax)))) (define (state225 c) (case c (else (accept 'unsyntaxsplicing)))) (define (state226 c) (case c (else (accept 'sharingdef)))) (define (state227 c) (case c (else (accept 'sharinguse)))) (define (state228 c) (case c (else (accept 'eofobj)))) (define (state229 c) (case c (else (accept 'id)))) (define (state230 c) (case c (else (accept 'string)))) (define (state231 c) (case c (else (accept 'lparen)))) (define (state232 c) (case c (else (accept 'rparen)))) (define (state233 c) (case c (else (accept 'lbracket)))) (define (state234 c) (case c (else (accept 'rbracket)))) (define (state235 c) (case c (else (accept 'quote)))) (define (state236 c) (case c (else (accept 'backquote)))) (define (state237 c) (case c (else (accept 'splicing)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; End of state machine generated by LexGen. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ParseGen generated the code for the strong LL(1) parser. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (parse-outermost-datum) (case (next-token) ((unsyntaxsplicing unsyntax quasisyntax syntax splicing comma backquote quote lbracket lparen vecstart bvecstart miscflag id string character number boolean sharingdef sharinguse) (let ((ast1 (parse-datum))) (identity ast1))) ((eofobj) (begin (consume-token!) (makeEOF))) (else (parse-error '<outermost-datum> '(backquote boolean bvecstart character comma eofobj id lbracket lparen miscflag number quasisyntax quote sharingdef sharinguse splicing string syntax unsyntax unsyntaxsplicing vecstart))))) (define (parse-datum) (case (next-token) ((sharinguse) (let ((ast1 (parse-sharinguse))) (makeSharingUse ast1))) ((sharingdef) (let ((ast1 (parse-sharingdef))) (let ((ast2 (parse-udatum))) (makeSharingDef ast1 ast2)))) ((boolean number character string id miscflag bvecstart vecstart lparen lbracket quote backquote comma splicing syntax quasisyntax unsyntax unsyntaxsplicing) (let ((ast1 (parse-udatum))) (identity ast1))) (else (parse-error '<datum> '(backquote boolean bvecstart character comma id lbracket lparen miscflag number quasisyntax quote sharingdef sharinguse splicing string syntax unsyntax unsyntaxsplicing vecstart))))) (define (parse-udatum) (case (next-token) ((unsyntaxsplicing unsyntax quasisyntax syntax splicing comma backquote quote lbracket lparen vecstart bvecstart) (let ((ast1 (parse-location))) (let ((ast2 (parse-structured))) (makeStructured ast1 ast2)))) ((miscflag) (begin (consume-token!) (makeFlag))) ((id) (begin (consume-token!) (makeSym))) ((string) (begin (consume-token!) (makeString))) ((character) (begin (consume-token!) (makeChar))) ((number) (begin (consume-token!) (makeNum))) ((boolean) (begin (consume-token!) (makeBool))) (else (parse-error '<udatum> '(backquote boolean bvecstart character comma id lbracket lparen miscflag number quasisyntax quote splicing string syntax unsyntax unsyntaxsplicing vecstart))))) (define (parse-structured) (case (next-token) ((bvecstart) (let ((ast1 (parse-bytevector))) (identity ast1))) ((vecstart) (let ((ast1 (parse-vector))) (identity ast1))) ((lparen lbracket quote backquote comma splicing syntax quasisyntax unsyntax unsyntaxsplicing) (let ((ast1 (parse-list))) (identity ast1))) (else (parse-error '<structured> '(backquote bvecstart comma lbracket lparen quasisyntax quote splicing syntax unsyntax unsyntaxsplicing vecstart))))) (define (parse-string) (case (next-token) ((string) (begin (consume-token!) (makeString))) (else (parse-error '<string> '(string))))) (define (parse-symbol) (case (next-token) ((id) (begin (consume-token!) (makeSym))) (else (parse-error '<symbol> '(id))))) (define (parse-list) (case (next-token) ((unsyntaxsplicing unsyntax quasisyntax syntax splicing comma backquote quote) (let ((ast1 (parse-abbreviation))) (identity ast1))) ((lbracket) (begin (consume-token!) (let ((ast1 (parse-blst2))) (identity ast1)))) ((lparen) (begin (consume-token!) (let ((ast1 (parse-list2))) (identity ast1)))) (else (parse-error '<list> '(backquote comma lbracket lparen quasisyntax quote splicing syntax unsyntax unsyntaxsplicing))))) (define (parse-list2) (case (next-token) ((unsyntaxsplicing unsyntax quasisyntax syntax splicing comma backquote quote lbracket lparen vecstart bvecstart miscflag id string character number boolean sharingdef sharinguse) (let ((ast1 (parse-datum))) (let ((ast2 (parse-list3))) (cons ast1 ast2)))) ((rparen) (begin (consume-token!) (emptyList))) (else (parse-error '<list2> '(backquote boolean bvecstart character comma id lbracket lparen miscflag number quasisyntax quote rparen sharingdef sharinguse splicing string syntax unsyntax unsyntaxsplicing vecstart))))) (define (parse-list3) (case (next-token) ((rparen period sharinguse sharingdef boolean number character string id miscflag bvecstart vecstart lparen lbracket quote backquote comma splicing syntax quasisyntax unsyntax unsyntaxsplicing) (let ((ast1 (parse-data))) (let ((ast2 (parse-list4))) (pseudoAppend ast1 ast2)))) (else (parse-error '<list3> '(backquote boolean bvecstart character comma id lbracket lparen miscflag number period quasisyntax quote rparen sharingdef sharinguse splicing string syntax unsyntax unsyntaxsplicing vecstart))))) (define (parse-list4) (case (next-token) ((period) (begin (consume-token!) (let ((ast1 (parse-datum))) (if (eq? (next-token) 'rparen) (begin (consume-token!) (identity ast1)) (parse-error '<list4> '(rparen)))))) ((rparen) (begin (consume-token!) (emptyList))) (else (parse-error '<list4> '(period rparen))))) (define (parse-blst2) (case (next-token) ((unsyntaxsplicing unsyntax quasisyntax syntax splicing comma backquote quote lbracket lparen vecstart bvecstart miscflag id string character number boolean sharingdef sharinguse) (let ((ast1 (parse-datum))) (let ((ast2 (parse-blst3))) (cons ast1 ast2)))) ((rbracket) (begin (consume-token!) (emptyList))) (else (parse-error '<blst2> '(backquote boolean bvecstart character comma id lbracket lparen miscflag number quasisyntax quote rbracket sharingdef sharinguse splicing string syntax unsyntax unsyntaxsplicing vecstart))))) (define (parse-blst3) (case (next-token) ((rbracket period sharinguse sharingdef boolean number character string id miscflag bvecstart vecstart lparen lbracket quote backquote comma splicing syntax quasisyntax unsyntax unsyntaxsplicing) (let ((ast1 (parse-data))) (let ((ast2 (parse-blst4))) (pseudoAppend ast1 ast2)))) (else (parse-error '<blst3> '(backquote boolean bvecstart character comma id lbracket lparen miscflag number period quasisyntax quote rbracket sharingdef sharinguse splicing string syntax unsyntax unsyntaxsplicing vecstart))))) (define (parse-blst4) (case (next-token) ((period) (begin (consume-token!) (let ((ast1 (parse-datum))) (if (eq? (next-token) 'rbracket) (begin (consume-token!) (identity ast1)) (parse-error '<blst4> '(rbracket)))))) ((rbracket) (begin (consume-token!) (emptyList))) (else (parse-error '<blst4> '(period rbracket))))) (define (parse-abbreviation) (case (next-token) ((quote backquote comma splicing syntax quasisyntax unsyntax unsyntaxsplicing) (let ((ast1 (parse-abbrev-prefix))) (let ((ast2 (parse-datum))) (list ast1 ast2)))) (else (parse-error '<abbreviation> '(backquote comma quasisyntax quote splicing syntax unsyntax unsyntaxsplicing))))) (define (parse-abbrev-prefix) (case (next-token) ((unsyntaxsplicing) (begin (consume-token!) (symUnsyntax-splicing))) ((unsyntax) (begin (consume-token!) (symUnsyntax))) ((quasisyntax) (begin (consume-token!) (symQuasisyntax))) ((syntax) (begin (consume-token!) (symSyntax))) ((splicing) (begin (consume-token!) (symSplicing))) ((comma) (begin (consume-token!) (symUnquote))) ((backquote) (begin (consume-token!) (symBackquote))) ((quote) (begin (consume-token!) (symQuote))) (else (parse-error '<abbrev-prefix> '(backquote comma quasisyntax quote splicing syntax unsyntax unsyntaxsplicing))))) (define (parse-vector) (case (next-token) ((vecstart) (begin (consume-token!) (let ((ast1 (parse-data))) (if (eq? (next-token) 'rparen) (begin (consume-token!) (list2vector ast1)) (parse-error '<vector> '(rparen)))))) (else (parse-error '<vector> '(vecstart))))) (define (parse-bytevector) (case (next-token) ((bvecstart) (begin (consume-token!) (let ((ast1 (parse-octets))) (if (eq? (next-token) 'rparen) (begin (consume-token!) (list2bytevector ast1)) (parse-error '<bytevector> '(rparen)))))) (else (parse-error '<bytevector> '(bvecstart))))) (define (parse-data) (case (next-token) ((unsyntaxsplicing unsyntax quasisyntax syntax splicing comma backquote quote lbracket lparen vecstart bvecstart miscflag id string character number boolean sharingdef sharinguse) (let ((ast1 (parse-datum))) (let ((ast2 (parse-data))) (cons ast1 ast2)))) ((rparen period rbracket) (emptyList)) (else (parse-error '<data> '(backquote boolean bvecstart character comma id lbracket lparen miscflag number period quasisyntax quote rbracket rparen sharingdef sharinguse splicing string syntax unsyntax unsyntaxsplicing vecstart))))) (define (parse-octets) (case (next-token) ((number) (let ((ast1 (parse-octet))) (let ((ast2 (parse-octets))) (cons ast1 ast2)))) ((rparen) (emptyList)) (else (parse-error '<octets> '(number rparen))))) (define (parse-octet) (case (next-token) ((number) (begin (consume-token!) (makeOctet))) (else (parse-error '<octet> '(number))))) (define (parse-location) (case (next-token) ((unsyntaxsplicing unsyntax quasisyntax syntax splicing comma backquote quote lbracket lparen vecstart bvecstart) (sourceLocation)) (else (parse-error '<location> '(backquote bvecstart comma lbracket lparen quasisyntax quote splicing syntax unsyntax unsyntaxsplicing vecstart))))) (define (parse-sharingdef) (case (next-token) ((sharingdef) (begin (consume-token!) (sharingDef))) (else (parse-error '<sharingdef> '(sharingdef))))) (define (parse-sharinguse) (case (next-token) ((sharinguse) (begin (consume-token!) (sharingUse))) (else (parse-error '<sharinguse> '(sharinguse))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; End of LL(1) parser generated by ParseGen. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Lexical analyzer. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; next-token and consume-token! are called by the parser. ; Returns the current token. (define (next-token) (if nextTokenIsReady kindOfNextToken (begin (set! string_accumulator_length 0) (scanner0)))) ; Consumes the current token. (define (consume-token!) (set! nextTokenIsReady #f)) ; Called by the lexical analyzer's state machine. (define (scannerError msg) (define msgtxt (cond ((= msg errLongToken) "Amazingly long token") ((= msg errIncompleteToken) "Incomplete or illegal token") ((= msg errIllegalHexEscape) "Illegal hex escape") ((= msg errIllegalNamedChar) "Illegal character syntax") ((= msg errIllegalString) "Illegal string syntax") ((= msg errIllegalSymbol) "Illegal symbol syntax") ((= msg errSRFI38) "Illegal SRFI 38 syntax") ((= msg errNoDelimiter) "Missing delimiter") ((= msg errLexGenBug) "Bug in lexical analyzer (generated)") (else "Bug in lexical analyzer"))) (let* ((c (scanChar)) (next (if (char? c) (string c) "")) (msgtxt (string-append msgtxt ": " (substring string_accumulator 0 string_accumulator_length) next))) ; must avoid infinite loop on current input port (consumeChar) (error 'get-datum (string-append "Lexical Error: " msgtxt " ") input-port)) (next-token)) ; Accepts a token of the given kind, returning that kind. ; ; For some kinds of tokens, a value for the token must also ; be recorded in tokenValue. Most of those tokens must be ; followed by a delimiter. ; ; Some magical tokens require special processing. (define (accept t) (case t ((comment) ; The token is #|, which starts a nested comment. (scan-nested-comment) (next-token)) ((commentdatum) ; The token is #; so parse and ignore the next datum. (parse-datum) (next-token)) ((id boolean number character string miscflag period sharingdef sharinguse) (set! tokenValue (substring string_accumulator 0 string_accumulator_length)) (cond ((and (eq? t 'miscflag) (string=? tokenValue "#!r6rs")) (next-token)) ((or (delimiter? (scanChar)) (eq? t 'string) (eq? t 'sharingdef) ; SRFI 38 (eq? t 'sharinguse)) ; SRFI 38 (set! kindOfNextToken t) (set! nextTokenIsReady #t) t) (else (scannerError errNoDelimiter)))) (else (set! kindOfNextToken t) (set! nextTokenIsReady #t) t))) ; Having seen a #| token, scans and discards the entire comment. (define (scan-nested-comment) (define (loop depth) (let ((c (scanChar))) (cond ((= depth 0) #t) ((eof-object? c) (scannerError errIncompleteToken)) ((char=? c #\#) (consumeChar) (if (char=? (scanChar) #\|) (begin (consumeChar) (loop (+ depth 1))) (loop depth))) ((char=? c #\|) (consumeChar) (if (char=? (scanChar) #\#) (begin (consumeChar) (loop (- depth 1))) (loop depth))) (else (consumeChar) (loop depth))))) (loop 1)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Character i/o, so to speak. ; Uses the input-port as input. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (scanChar) (peek-char input-port)) ; Consumes the current character. Returns unspecified values. (define (consumeChar) (if (< string_accumulator_length (string-length string_accumulator)) (let ((c (read-char input-port))) (if (char? c) (begin (string-set! string_accumulator string_accumulator_length c) (set! string_accumulator_length (+ string_accumulator_length 1))))) (begin (expand-accumulator) (consumeChar)))) ; Doubles the size of string_accumulator while ; preserving its contents. (define (expand-accumulator) (let* ((n (string-length string_accumulator)) (new (make-string (* 2 n)))) (do ((i 0 (+ i 1))) ((= i n)) (string-set! new i (string-ref string_accumulator i))) (set! string_accumulator new))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Miscellaneous utility routines. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Determines whether its argument is a <delimiter>. (define (delimiter? c) (case c ((#\( #\) #\[ #\] #\" #\; #\#) #t) (else (or (not (char? c)) (char-whitespace? c))))) ; Given the integer parsed from a hex escape, ; returns the corresponding Unicode character. (define (checked-integer->char n) (if (or (< n #xd800) (<= #xe000 n #x10ffff)) (integer->char n) (scannerError errIllegalHexEscape))) ; Given a string and the index at the beginning of nonempty ; sequence of hexadecimal characters followed by a semicolon, ; returns two values: ; the numerical value of the hex characters ; the index following the semicolon (define (hex-escape s i) (let ((n (string-length s))) (define (loop i val) (if (>= i n) (scannerError errIllegalHexEscape) (let ((c (string-ref s i))) (case c ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9) (loop (+ i 1) (+ (* 16 val) (- (char->integer c) (char->integer #\0))))) ((#\a #\b #\c #\d #\e #\f) (loop (+ i 1) (+ (* 16 val) 10 (- (char->integer c) (char->integer #\a))))) ((#\A #\B #\C #\D #\E #\F) (loop (+ i 1) (+ (* 16 val) 10 (- (char->integer c) (char->integer #\A))))) ((#\;) (values val (+ i 1))) (else (scannerError errIllegalHexEscape)))))) (loop i 0))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Action procedures called by the parser. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Hook for recording source locations. ; Called by some action routines. (define (record-source-location x loc) x) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (emptyList) '()) (define (identity x) x) (define (list2bytevector octets) (u8-list->bytevector octets)) (define (list2vector vals) (list->vector vals)) (define (makeBool) (let ((x (case (string-ref tokenValue 1) ((#\t #\T) #t) ((#\f #\F) #f) (else (scannerError errBug))))) (record-source-location x locationStart))) (define (makeChar) (let* ((n (string-length tokenValue)) (x (cond ((= n 3) (string-ref tokenValue 2)) ((char=? #\x (string-ref tokenValue 2)) (checked-integer->char (string->number (substring tokenValue 3 n) 16))) (else (let* ((s (substring tokenValue 2 n)) (sym (string->symbol s))) (case sym ((nul) #\nul) ((alarm) #\alarm) ((backspace) #\backspace) ((tab) #\tab) ((linefeed newline) #\linefeed) ((vtab) #\vtab) ((page) #\page) ((return) #\return) ((esc) #\esc) ((space) #\space) ((delete) #\delete) (else (scannerError errIllegalNamedChar)))))))) (record-source-location x locationStart))) (define (makeEOF) (eof-object)) (define (makeFlag) ; The draft R6RS allows implementation-specific extensions ; of the form #!..., which are processed here. ; Note that the #!r6rs flag is a comment, handled by accept, ; so that flag will never be seen here. (accept 'miscflag) (parse-error '<miscflag> '(miscflag))) (define (makeNum) (let ((x (string->number tokenValue))) (if x (record-source-location x locationStart) (begin (accept 'number) (parse-error '<number> '(number)))))) (define (makeOctet) (let ((n (string->number tokenValue))) (if (and (exact? n) (integer? n) (<= 0 n 255)) (record-source-location n locationStart) (begin (accept 'octet) (parse-error '<octet> '(octet)))))) (define (makeString) ; Must strip off outer double quotes and deal with escapes. ; ; i is the next index into tokenValue ; n is the exclusive upper bound for i ; newstring is a string that might become the result ; j is the next index into newstring (define (loop i n newstring j) (if (>= i n) (if (= j (string-length newstring)) newstring (substring newstring 0 j)) (let ((c (string-ref tokenValue i))) (cond ((or (char=? c #\return) (char=? c #\linefeed) (char=? c char:nel) (char=? c char:ls)) (string-set! newstring j #\linefeed) (let* ((i+1 (+ i 1)) (i+1 (if (and (char=? c #\return) (< i+1 n)) (let ((c2 (string-ref tokenValue i+1))) (if (or (char=? c2 #\linefeed) (char=? c2 char:nel)) (+ i 2) i+1)) i+1))) (loop i+1 n newstring (+ j 1)))) ((char=? c #\\) (if (< (+ i 1) n) (let ((c2 (string-ref tokenValue (+ i 1)))) (case c2 ((#\a) (string-set! newstring j #\alarm) (loop (+ i 2) n newstring (+ j 1))) ((#\b) (string-set! newstring j #\backspace) (loop (+ i 2) n newstring (+ j 1))) ((#\t) (string-set! newstring j #\tab) (loop (+ i 2) n newstring (+ j 1))) ((#\n) (string-set! newstring j #\linefeed) (loop (+ i 2) n newstring (+ j 1))) ((#\v) (string-set! newstring j #\vtab) (loop (+ i 2) n newstring (+ j 1))) ((#\f) (string-set! newstring j #\page) (loop (+ i 2) n newstring (+ j 1))) ((#\r) (string-set! newstring j #\return) (loop (+ i 2) n newstring (+ j 1))) ((#\" #\\) (string-set! newstring j c2) (loop (+ i 2) n newstring (+ j 1))) ((#\x) (call-with-values (lambda () (hex-escape tokenValue (+ i 2))) (lambda (sv i) (string-set! newstring j (checked-integer->char sv)) (loop i n newstring (+ j 1))))) (else (ignore-escaped-line-ending (+ i 1) n newstring j #f)))) (scannerError errIllegalString))) (else (string-set! newstring j c) (loop (+ i 1) n newstring (+ j 1))))))) ; Ignores <intraline whitespace>* <line ending> <intraline whitespace>* ; after? is true iff the <line ending> has already been ignored. ; The other arguments are the same as for loop above. (define (ignore-escaped-line-ending i n newstring j after?) (cond ((< i n) (let ((c (string-ref tokenValue i))) (cond ((or (char=? c #\tab) (eq? 'Zs (char-general-category c))) (ignore-escaped-line-ending (+ i 1) n newstring j after?)) (after? (loop i n newstring j)) ((or (char=? c #\return) (char=? c #\linefeed) (char=? c char:nel) (char=? c char:ls)) (let* ((i+1 (+ i 1)) (i+1 (if (and (char=? c #\return) (< i+1 n)) (let ((c2 (string-ref tokenValue i+1))) (if (or (char=? c2 #\linefeed) (char=? c2 char:nel)) (+ i 2) i+1)) i+1))) (ignore-escaped-line-ending i+1 n newstring j #t))) (else (scannerError errIllegalString))))) (after? (loop i n newstring j)) (else (scannerError errIllegalString)))) (let* ((n (string-length tokenValue)) (s (loop 1 (- n 1) (make-string (- n 2)) 0))) (record-source-location s locationStart))) (define (makeStructured loc0 x) (record-source-location x loc0)) (define (makeSym) (let ((n (string-length tokenValue))) (define (return sym) sym) (define (loop i) (if (= i n) (return (string->symbol tokenValue)) (let ((c (string-ref tokenValue i))) (cond ((or (char=? c #\\) (char=? c #\#)) (slow-loop i (reverse (string->list (substring tokenValue 0 i))))) (else (loop (+ i 1))))))) (define (slow-loop i chars) (if (= i n) (return (string->symbol (list->string (reverse chars)))) (let ((c (string-ref tokenValue i))) (cond ((char=? c #\\) (cond ((and (< (+ i 1) n) (char=? (string-ref tokenValue (+ i 1)) #\x)) (call-with-values (lambda () (hex-escape tokenValue (+ i 2))) (lambda (sv i) (slow-loop i (cons (checked-integer->char sv) chars))))) (else (scannerError errIllegalSymbol)))) (else (slow-loop (+ i 1) (cons c chars))))))) (loop 0))) ; Like append, but allows the last argument to be a non-list. (define (pseudoAppend vals terminus) (if (null? vals) terminus (cons (car vals) (pseudoAppend (cdr vals) terminus)))) ; Hook for associating source locations with tokens. (define (sourceLocation) 0) (define (symBackquote) 'quasiquote) (define (symQuasisyntax) 'quasisyntax) (define (symQuote) 'quote) (define (symSplicing) 'unquote-splicing) (define (symSyntax) 'syntax) (define (symUnquote) 'unquote) (define (symUnsyntax) 'unsyntax) (define (symUnsyntax-splicing) 'unsyntax-splicing) ; Action routines for SRFI 38. ; ; The shared-structures hashtable defines a mapping from ; indexes to fixup objects. ; ; A fixup object is a record with two mutable fields: ; ready: #t if the object field is ready, else #f ; value: if ready, the object that will replace the ; fixup object during a post-pass (define (sharingDef) (let* ((index (string->number (substring tokenValue 1 (- (string-length tokenValue) 1)))) (fixup (make-fixup-object index))) (if (not shared-structures) (set! shared-structures (make-hashtable values =))) (hashtable-set! shared-structures index fixup) fixup)) (define (sharingUse) (let* ((index (string->number (substring tokenValue 1 (- (string-length tokenValue) 1))))) (if (not shared-structures) (scannerError errSRFI38)) (let ((fixup (hashtable-ref shared-structures index #f))) (if (not fixup) (scannerError errSRFI38)) fixup))) (define (makeSharingDef fixup datum) (fixup-ready! fixup datum) datum) (define (makeSharingUse fixup) fixup) ;; After everything has been read, a second pass prepares ;; and then executes the side effects needed to recreate ;; the shared structure. (define (srfi38-postpass x) (let ((fixups '())) (define (add-fixup! fixup-object kind . rest) (if (fixup-ready? fixup-object) (set! fixups (cons (cons (fixup-value fixup-object) (cons kind rest)) fixups)) (assertion-violation 'read-with-shared-structure "undefined index" (fixup-index fixup-object)))) (define (postpass x) (cond ((pair? x) (if (fixup-object? (car x)) (add-fixup! (car x) 'set-car! x) (postpass (car x))) (if (fixup-object? (cdr x)) (add-fixup! (cdr x) 'set-cdr! x) (postpass (cdr x)))) ((vector? x) (do ((n (vector-length x)) (i 0 (+ i 1))) ((= i n)) (let ((y (vector-ref x i))) (if (fixup-object? y) (add-fixup! y 'vector-set! x i) (postpass y))))) (else #f))) (define (fixup! fixup) (let ((value (car fixup)) (kind (cadr fixup)) (container (caddr fixup)) (rest (cdddr fixup))) (case kind ((set-car!) (set-car! container value)) ((set-cdr!) (set-cdr! container value)) ((vector-set!) (vector-set! container (car rest) value)) (else (assert #f))))) (if shared-structures (begin (postpass x) (for-each fixup! fixups) (if (fixup-object? x) (fixup-value x) x)) x))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Error procedure called by the parser. ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (parse-error nonterminal expected-terminals) (let* ((culprit (next-token)) (culprit-as-string (symbol->string culprit)) (culprit-as-string (if (memq culprit expected-terminals) (string-append "illegal " culprit-as-string) culprit-as-string)) (msg (string-append "Syntax error while parsing " (symbol->string nonterminal) (string #\newline) " Encountered " culprit-as-string " while expecting " (case nonterminal ((<datum> <outermost-datum> <data>) "a datum") (else (string-append (string #\newline) " " (apply string-append (map (lambda (terminal) (string-append " " (symbol->string terminal))) expected-terminals))))) (string #\newline)))) (error 'get-datum msg input-port))) ; The list of tokens that can start a datum in R6RS mode. (define datum-starters '(backquote boolean bvecstart character comma id lbracket lparen miscflag number quasisyntax quote splicing string syntax unsyntax unsyntaxsplicing vecstart)) (srfi38-postpass (parse-outermost-datum)))) (define write/ss write-with-shared-structure) (define read/ss read-with-shared-structure) )
false
32c7c01a0af2a53a396b7c67849d6f9ecc9db415
2c291b7af5cd7679da3aa54fdc64dc006ee6ff9b
/ch2/prob.2.69.scm
1ceb043c7b8146504065b08cf7e926b7a50b6fc1
[]
no_license
etscrivner/sicp
caff1b3738e308c7f8165fc65a3f1bc252ce625a
3b45aaf2b2846068dcec90ea0547fd72b28f8cdc
refs/heads/master
2021-01-10T12:08:38.212403
2015-08-22T20:01:44
2015-08-22T20:01:44
36,813,957
1
0
null
null
null
null
UTF-8
Scheme
false
false
564
scm
prob.2.69.scm
(load "prob.2.68.scm") (define (generate-huffman-tree pairs) (successive-merge (make-leaf-set pairs))) (define (make-tree elem1 elem2) (if (leaf? elem1) (make-code-tree elem1 elem2) (make-code-tree elem2 elem1))) (define (successive-merge leaves) (if (null? leaves) '() (let ((first (car leaves)) (rest (cdr leaves))) (cond ((null? rest) first) (else (let ((partial-tree (make-tree (car rest) first))) (successive-merge (adjoin-set partial-tree (cdr rest)))))))))
false
56425049876535e82803d62fd1ef0ae4fb410dce
fb9a1b8f80516373ac709e2328dd50621b18aa1a
/ch2/exercise2-9.scm
1ffe221587d60d0aa44b5365b348066294f03b74
[]
no_license
da1/sicp
a7eacd10d25e5a1a034c57247755d531335ff8c7
0c408ace7af48ef3256330c8965a2b23ba948007
refs/heads/master
2021-01-20T11:57:47.202301
2014-02-16T08:57:55
2014-02-16T08:57:55
null
0
0
null
null
null
null
UTF-8
Scheme
false
false
515
scm
exercise2-9.scm
;; 問題2.9 ; http://www.serendip.ws/archives/526 ; 区間aの幅を返す手続き (define (width-of-interval a) (/ (- (upper-bound a) (lower-bound a)) 2.0)) ; (+ x y)の幅 (/ (- (+ (upper-bound x) (upper-bound y)) (+ (lower-bound x) (lower-bound y)) 2) (/ (+ (- (upper-bound x) (lower-bound x)) (- (upper-bound y) (lower-bound y))) 2) ; http://d.hatena.ne.jp/awacio/20100329/1269869969 ;; 上のURLから引用 ;; 区間の幅 = (x_u * y_u) - (x_l * y_l) ; 幅の関数にできない
false
88cc88b66052db1b7332765cf2677af169a8f99d
b14c18fa7a4067706bd19df10f846fce5a24c169
/Chapter2/2.22.scm
3a066b06b5a10d832d5f711eace25256a105d8f8
[]
no_license
silvesthu/LearningSICP
eceed6267c349ff143506b28cf27c8be07e28ee9
b5738f7a22c9e7967a1c8f0b1b9a180210051397
refs/heads/master
2021-01-17T00:30:29.035210
2016-11-29T17:57:16
2016-11-29T17:57:16
19,287,764
3
0
null
null
null
null
UTF-8
Scheme
false
false
1,068
scm
2.22.scm
#lang scheme ; (include "2.18.scm") (define (square-list-map items) (map (lambda (x) (* x x)) items) ) (square-list-map (list 1 2 3 4 5)) ; --------------------------------- (define (square x) (* x x)) (define (square-list-22v1 items) (define (iter things answer) (if (null? things) answer (iter (cdr things) (cons (square (car things)) answer)))) (iter items null)) (square-list-22v1 (list 1 2 3 4 5)) ; error -> produce reverse order (25 16 9 4 1) (define (square-list-22v2 items) (define (iter things answer) (if (null? things) answer (iter (cdr things) (cons answer (square (car things)))))) (iter items null)) (square-list-22v2 (list 1 2 3 4 5)) ; error -> (((((() . 1) . 4) . 9) . 16) . 25) ; Correction (define (square-list-22v3 items) (reverse (square-list-22v1 items)) ) (square-list-22v3 (list 1 2 3 4 5)) ; POSSIBLE ANSWER ? ; list is constructed as a stack with cons ; while getting iterative process requires access to the inner-most element first ; so a reverse before or after is necessary
false
96a567781f5ca9bada16051ba5bbd5203fedd453
d51c8c57288cacf9be97d41079acc7c9381ed95a
/scsh/scheme/thread-fluid.scm
9cab89b2f0221e00a8f4d75ff5ded7da8d4ed620
[]
no_license
yarec/svm
f926315fa5906bd7670ef77f60b7ef8083b87860
d99fa4d3d8ecee1353b1a6e9245d40b60f98db2d
refs/heads/master
2020-12-13T08:48:13.540156
2020-05-04T06:42:04
2020-05-04T06:42:04
19,306,837
2
0
null
null
null
null
UTF-8
Scheme
false
false
4,899
scm
thread-fluid.scm
; Copyright (c) 1993-2001 by Richard Kelsey and Jonathan Rees. See file COPYING. ;;; This is based on code from the scsh 0.6 distribution. There was not much ;;; documentation behind the implementation or uses of thread-fluids, but ;;; I tried to make sure that this emulates the original behavior. Unfortunately, ;;; at the moment, this implementation is very dangerous and space inefficient. ;;; It'll be used for now however, just to get things rolling. ;;; ;;; When a thread-fluid is made with MAKE-THREAD-FLUID, the given value is set ;;; as the default. Setting new values to the thread-fluid will not change ;;; the default's value. When a new thread is created using SPAWN, the ;;; thread-fluid's value will be the default, reguardless of what that ;;; thread-fluid's value was set to in any other thread. A thread-fluid's value ;;; can only be preserved across threads if it is created with ;;; MAKE-PRESERVED-THREAD-FLUID, and the child thread is created with ;;; FORK-THREAD or SPOON. ;;; ;;; Thread cells were a part of the implementation of thread-fluids in scsh, ;;; but they were actually a field in the thread record type, and so unique ;;; to that thread and safe to update. They are replaced here with a global ;;; list associating thread uids with values. These values are never collected ;;; because the global list can't be automatically updated once a thread dies. ;;; There is no mechanism used to keep the list safe for use by multiple ;;; threads either. I'm not spending time thinking of a better solution for now, ;;; because I'd like to have scsh stop using thread-fluids altogether if I can ;;; later. ;;; ;;; -Roderic (define-record-type :thread-fluid (really-make-thread-fluid cell) thread-fluid? (cell thread-fluid-cell set-thread-fluid-cell!)) (define *no-fluid-value* (list 'no-fluid-value)) (define (thread-fluid thread-fluid) (thread-cell-ref (thread-fluid-cell thread-fluid))) (define (set-thread-fluid! thread-fluid val) (thread-cell-set! (thread-fluid-cell thread-fluid) val)) (define (let-thread-fluid t-fluid val thunk) (let ((old-val (thread-fluid t-fluid))) (dynamic-wind (lambda () (set-thread-fluid! t-fluid val)) thunk (lambda () (set-thread-fluid! t-fluid old-val))))) (define (let-thread-fluids . args) (call-with-values (lambda () (let loop ((args args) (rev-old-vals '())) (if (null? (cdr args)) (values (car args) (reverse rev-old-vals)) (loop (cddr args) (cons (thread-fluid (car args)) rev-old-vals))))) (lambda (thunk old-vals) (dynamic-wind (lambda () (let loop ((args args)) (if (not (null? (cdr args))) (begin (set-thread-fluid! (car args) (cadr args)) (loop (cddr args)))))) thunk (lambda () (let loop ((args args) (old-vals old-vals)) (if (not (null? (cdr args))) (begin (set-thread-fluid! (car args) (car old-vals)) (loop (cddr args) (cdr old-vals)))))))))) (define (make-thread-fluid top) (really-make-thread-fluid (make-thread-cell top))) (define *preserved-fluids* (make-population)) (define (make-preserved-thread-fluid top) (let* ((t-fluid (make-thread-fluid top))) (add-to-population! t-fluid *preserved-fluids*) t-fluid)) (define (preserve-thread-fluids thunk) (let ((args (list thunk))) (walk-population (lambda (t-fluid) (set! args (cons t-fluid (cons (thread-fluid t-fluid) args)))) *preserved-fluids*) (lambda () (apply let-thread-fluids args)))) (define (fork-thread thunk . rest) (apply spawn (preserve-thread-fluids thunk) rest)) (define spoon fork-thread) ;;; Thread cells (define-record-type :thread-cell (make-thread-cell default) (default thread-cell-default)) (define *thread-cell-envs* '()) (define (get-thread-cell-env) (cond ((assq (thread-uid (current-thread)) *thread-cell-envs*) => cdr) (else '()))) (define (set-thread-cell-env! value) (let ((probe (assq (thread-uid (current-thread)) *thread-cell-envs*))) (if probe (set-cdr! probe value) (set! *thread-cell-envs* (cons (cons (thread-uid (current-thread)) value) *thread-cell-envs*))))) (define (empty-thread-cell-env) '()) (define (thread-cell-ref thread-cell) (let ((probe (assq thread-cell (get-thread-cell-env)))) (if probe (cdr probe) (thread-cell-default thread-cell)))) (define (thread-cell-set! thread-cell value) (let ((probe (assq thread-cell (get-thread-cell-env)))) (if probe (set-cdr! probe value) (set-thread-cell-env! (cons (cons thread-cell value) (get-thread-cell-env))))))
false
ba13d8e84805bcf72d2c2440e3657e5c9c2977da
b62560d3387ed544da2bbe9b011ec5cd6403d440
/cogs/r5rs.scm
4113257e6a51279a24b9990fcfce9e898a85e4e1
[ "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
Scheme
false
false
20,247
scm
r5rs.scm
;; Adapted from https://github.com/ashinn/chibi-scheme/blob/master/tests/r5rs-tests.scm ;; with the following copyright notice: ;; ;; ------------------------------------------------------------------- ;; ;; Copyright (c) 2009-2021 Alex Shinn ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions ;; are met: ;; 1. Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; 2. Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; 3. The name of the author may not be used to endorse or promote products ;; derived from this software without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ;; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ;; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ;; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ;; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;; ;; ------------------------------------------------------------------- ;; ;; Modified by Matt Paras for use within the Steel test suite (require "tests/unit-test.scm" (for-syntax "tests/unit-test.scm")) (set-test-mode!) (check-equal? "addition" 8 ((lambda (x) (+ x x)) 4)) (check-equal? "Variable arity function call" '(3 4 5 6) ((lambda x x) 3 4 5 6)) (check-equal? "Rest arguments" '(5 6) ((lambda (x y . z) z) 3 4 5 6)) (check-equal? "Branching with >" 'yes (if (> 3 2) 'yes 'no)) (check-equal? "Branch with <" 'no (if (> 2 3) 'yes 'no)) (check-equal? "Numeric operations with if" 1 (if (> 3 2) (- 3 2) (+ 3 2))) (check-equal? "Cond with >" 'greater (cond [(> 3 2) 'greater] [(< 3 2) 'less])) (check-equal? "Cond with equal" 'equal (cond [(> 3 3) 'greater] [(< 3 3) 'less] [else 'equal])) (check-equal? "Case macro" 'composite (case (* 2 3) [(2 3 5 7) 'prime] [(1 4 6 8 9) 'composite])) (check-equal? "Case with chars" 'consonant (case (car '(c d)) [(a e i o u) 'vowel] [(w y) 'semivowel] [else 'consonant])) (check-equal? "and true" #t (and (= 2 2) (> 2 1))) (check-equal? "and false" #f (and (= 2 2) (< 2 1))) (check-equal? "and returns last in the list" '(f g) (and 1 2 'c '(f g))) (check-equal? "and defaults to true" #t (and)) (check-equal? "or true on the first" #t (or (= 2 2) (> 2 1))) (check-equal? "or true on the first, second not true" #t (or (= 2 2) (< 2 1))) ;; TODO (skip-compile (check-equal? '(b c) (or (memq 'b '(a b c)) (/ 3 0)))) (check-equal? "basic let" 6 (let ([x 2] [y 3]) (* x y))) (check-equal? "basic let with multiple levels" 35 (let ([x 2] [y 3]) (let ([x 7] [z (+ x y)]) (* z x)))) (check-equal? "basic let*" 70 (let ([x 2] [y 3]) (let* ([x 7] [z (+ x y)]) (* z x)))) (check-equal? "interior define" -2 (let () (define x 2) (define f (lambda () (- x))) (f))) (define let*-def 1) (let* () (define let*-def 2) #f) (check-equal? "Redefine top level with interior define, stays the same" 1 let*-def) ;; TODO: `do` macro (skip-compile (check-equal '#(0 1 2 3 4) (do ((vec (make-vector 5)) (i 0 (+ i 1))) ((= i 5) vec) (vector-set! vec i i))) (check-equal 25 (let ([x '(1 3 5 7 9)]) (do ((x x (cdr x)) (sum 0 (+ sum (car x)))) ((null? x) sum)))) ;; TODO named `let` ; (check-equal '((6 1 3) (-5 -2)) ; (let loop ([numbers '(3 -2 1 6 -5)] [nonneg '()] [neg '()]) ; (cond ; [(null? numbers) (list nonneg neg)] ; [(>= (car numbers) 0) (loop (cdr numbers) (cons (car numbers) nonneg) neg)] ; [(< (car numbers) 0) (loop (cdr numbers) nonneg (cons (car numbers) neg))]))) ) (check-equal? "simple quasiquote and unquote" '(list 3 4) `(list ,(+ 1 2) 4)) (check-equal? "quasiquote and unquote with more" '(list a 'a) (let ([name 'a]) `(list ,name ',name))) (check-equal? "unquote splicing" '(a 3 4 5 6 b) `(a ,(+ 1 2) ,@(map abs '(4 -5 6)) b)) (check-equal? "unquote splicing inside quasiquote" '(a 3 `(list ,@(map abs '(4 -5 6)) b)) `(a ,(+ 1 2) `(list ,@(map abs '(4 -5 6)) b))) (check-equal? "unquote splicing with unquote" '(10 5 4 16 9 8) `(10 5 ,(expt 2 2) ,@(map (lambda (n) (expt n 2)) '(4 3)) 8)) (check-equal? "more complex unquote" '(a `(b ,(+ 1 2) ,(foo 4 d) e) f) `(a `(b ,(+ 1 2) ,(foo ,(+ 1 3) d) e) f)) (check-equal? "double unquote and quote" '(a `(b ,x ,'y d) e) (let ([name1 'x] [name2 'y]) `(a `(b ,,name1 ,',name2 d) e))) (check-equal? "named quasiquote" '(list 3 4) (quasiquote (list (unquote (+ 1 2)) 4))) ;; TODO: Add eqv? (skip-compile (check-equal? #t (eqv? 'a 'a)) (check-equal #f (eqv? 'a 'b)) (check-equal #t (eqv? '() '())) (check-equal #f (eqv? (cons 1 2) (cons 1 2))) (check-equal #f (eqv? (lambda () 1) (lambda () 2))) (check-equal #t (let ([p (lambda (x) x)]) (eqv? p p)))) (check-equal? "Symbols are interned" #t (eq? 'a 'a)) ;; TODO: With constant evaluation, these do end up being the same thing (check-equal? "lists don't get interned" #f (eq? (list 'a) (list 'a))) ;; Empty lists are interned (check-equal? "Empty lists are interned" #t (eq? '() '())) (check-equal? "functions are equal" #t (eq? car car)) (check-equal? "Local vars that are constant point to the same object" #t (let ([x '(a)]) (eq? x x))) (check-equal? "Function objects are eq? via pointer equality" #t (let ([p (lambda (x) x)]) (eq? p p))) (check-equal? "Value equality for interned symbols" #t (equal? 'a 'a)) (check-equal? "Value equality for interned lists" #t (equal? '(a) '(a))) (check-equal? "Value equality for nested interned lists" #t (equal? '(a (b) c) '(a (b) c))) (check-equal? "String equality" #t (equal? "abc" "abc")) (check-equal? "String inequality" #f (equal? "abc" "abcd")) (check-equal? "String inequality, first char" #f (equal? "a" "b")) (check-equal? "Integer equality" #t (equal? 2 2)) ;; TODO: Figure these comments ones out (check-equal? "equality with float and int" #f (equal? 2.0 2)) (skip-compile (check-equal #f (eqv? 2 2.0)) ;; TODO: Add make-vector function (check-equal #t (equal? (make-vector 5 'a) (make-vector 5 'a)))) (check-equal? "max over ints" 4 (max 3 4)) (check-equal? "max with float and int" 4 (max 3.9 4)) (check-equal? "Addition binop" 7 (+ 3 4)) (check-equal? "Addition unary op" 3 (+ 3)) (check-equal? "Addition no args" 0 (+)) (check-equal? "Multiplication one arg, int" 4 (* 4)) (check-equal? "Multiplication no args, int " 1 (*)) (check-equal? "Subtraction binop" -1 (- 3 4)) (check-equal? "Subtract three args" -6 (- 3 4 5)) (check-equal? "Subtraction unary op" -3 (- 3)) (check-equal? "Subtraction, floating point and int" -1.0 (- 3.0 4)) (check-equal? "abs int" 7 (abs -7)) (check-equal? "basic string->number" 100 (string->number "100")) (check-equal? "string->number with radix" 256 (string->number "100" 16)) (check-equal? "string->number with different base" 127 (string->number "177" 8)) (check-equal? "string->number base 2" 5 (string->number "101" 2)) (check-equal? "string->number with scientific notation" 100.0 (string->number "1e2")) (check-equal? "basic number->string" "100" (number->string 100)) (check-equal? "number->string with different base" "100" (number->string 256 16)) (check-equal? "number->string base 16 doesn't work" "ff" (number->string 255 16)) (check-equal? "number->string base 8" "177" (number->string 127 8)) (check-equal? "number->string base 2" "101" (number->string 5 2)) ;; TODO: Adjust the below check-equals (skip-compile (check-equal 1 (modulo 13 4)) (check-equal 1 (remainder 13 4)) (check-equal 3 (modulo -13 4)) (check-equal -1 (remainder -13 4)) (check-equal -3 (modulo 13 -4)) (check-equal 1 (remainder 13 -4)) (check-equal -1 (modulo -13 -4)) (check-equal -1 (remainder -13 -4)) (check-equal 4 (gcd 32 -36)) (check-equal 288 (lcm 32 -36))) (check-equal? "integers are truthy" #f (not 3)) (check-equal? "lists are truthy" #f (not (list 3))) (check-equal? "empty lists are true" #f (not '())) (check-equal? "empty lists are true, constructor" #f (not (list))) (check-equal? "ints are not bools" #f (boolean? 0)) (check-equal? "empty list is not a boolean" #f (boolean? '())) ; (check-equal #t (pair? '(a . b))) (check-equal? "lists are considered pairs" #t (pair? '(a b c))) (check-equal? "cons onto empty list" '(a) (cons 'a '())) (check-equal? "cons list onto list" '((a) b c d) (cons '(a) '(b c d))) (check-equal? "cons string onto list of symbols" '("a" b c) (cons "a" '(b c))) ; (check-equal '(a . 3) (cons 'a 3)) ; (check-equal '((a b) . c) (cons '(a b) 'c)) (check-equal? "take the car of a list of symbols" 'a (car '(a b c))) (check-equal? "take the car, where the car is a list" '(a) (car '((a) b c d))) ; (check-equal 1 (car '(1 . 2))) (check-equal? "take the cdr of a list" '(b c d) (cdr '((a) b c d))) ; (check-equal 2 (cdr '(1 . 2))) (check-equal? "Check list predicate" #t (list? '(a b c))) (check-equal? "Empty list is a list" #t (list? '())) ; (check-equal #f (list? '(a . b))) ; (check-equal #f ; (let ([x (list 'a)]) ; (set-cdr! x x) ; (list? x))) (check-equal? "List constructor" '(a 7 c) (list 'a (+ 3 4) 'c)) (check-equal? "empty list constructor" '() (list)) (check-equal? "length of a flat list" 3 (length '(a b c))) (check-equal? "length of a non flat list" 3 (length '(a (b) (c d e)))) (check-equal? "empty list has a length of 0" 0 (length '())) (check-equal? "append two lists" '(x y) (append '(x) '(y))) (check-equal? "append big list to small list" '(a b c d) (append '(a) '(b c d))) (check-equal? "append nested lists" '(a (b) (c)) (append '(a (b)) '((c)))) ; (check-equal '(a b c . d) (append '(a b) '(c . d))) ;; NOTE: Improper lists are not supported, so this should fail and we should note this in ;; in the test suite ; (check-equal? "append to empty list" 'a (append '() 'a)) (check-equal? "reverse list" '(c b a) (reverse '(a b c))) (check-equal? "reverse nested list" '((e (f)) d (b c) a) (reverse '(a (b c) d (e (f))))) (check-equal? "simple list-ref" 'c (list-ref '(a b c d) 2)) (skip-compile (check-equal '(a b c) (memq 'a '(a b c))) (check-equal '(b c) (memq 'b '(a b c))) (check-equal #f (memq 'a '(b c d))) (check-equal #f (memq (list 'a) '(b (a) c)))) (check-equal? "simple member" '((a) c) (member (list 'a) '(b (a) c))) (skip-compile (check-equal '(101 102) (memv 101 '(100 101 102))) (check-equal #f (assq (list 'a) '(((a)) ((b)) ((c))))) (check-equal '(5 7) (assv 5 '((2 3) (5 7) (11 13))))) (check-equal? "assoc" '((a)) (assoc (list 'a) '(((a)) ((b)) ((c))))) (check-equal? "symbol predicate" #t (symbol? 'foo)) (check-equal? "symbol predicate from constant list" #t (symbol? (car '(a b)))) (check-equal? "symbol predicate fails on string" #f (symbol? "bar")) (check-equal? "nil symbol is symbol" #t (symbol? 'nil)) (check-equal? "empty list is not a symbol" #f (symbol? '())) (check-equal? "symbol->string basic case" "flying-fish" (symbol->string 'flying-fish)) (check-equal? "symbol-string works" "Martin" (symbol->string 'Martin)) (check-equal? "string losslessly moves into symbol and back" "Malvina" (symbol->string (string->symbol "Malvina"))) (check-equal? "string predicate correctly identifies a string" #t (string? "a")) (check-equal? "string predicate fails on a symbol" #f (string? 'a)) (check-equal? "empty string has a length of 0" 0 (string-length "")) (check-equal? "string length correctly reported for standard string" 3 (string-length "abc")) (check-equal? "string indexing into first character" #\a (string-ref "abc" 0)) (check-equal? "string indexing into last character" #\c (string-ref "abc" 2)) (check-equal? "empty substring" "" (substring "abc" 0 0)) (check-equal? "substring just the first character" "a" (substring "abc" 0 1)) (check-equal? "substring a larger chunk" "bc" (substring "abc" 1 3)) (check-equal? "string-equality with constructor, equal" #t (string=? "a" (string #\a))) (check-equal? "string-equality with constructor, not equal" #f (string=? "a" (string #\b))) (check-equal? "string<, true" #t (string<? "a" "aa")) (check-equal? "string<, false" #f (string<? "aa" "a")) (check-equal? "string<, same strings" #f (string<? "a" "a")) (check-equal? "string <=, true" #t (string<=? "a" "aa")) (check-equal? "string <=, same string" #t (string<=? "a" "a")) (skip-compile (check-equal #t (string=? "a" (make-string 1 #\a))) (check-equal #f (string=? "a" (make-string 1 #\b)))) (check-equal? "string-append with empty string" "abc" (string-append "abc" "")) (check-equal? "string-append with empty string on the lhs" "abc" (string-append "" "abc")) (check-equal? "string-append with two non empty strings" "abc" (string-append "a" "bc")) (skip-compile (check-equal '#(0 ("Sue" "Sue") "Anna") (let ([vec (vector 0 '(2 2 2 2) "Anna")]) (vector-set! vec 1 '("Sue" "Sue")) vec)) (check-equal '(dah dah didah) (vector->list '#(dah dah didah))) (check-equal '#(dididit dah) (list->vector '(dididit dah)))) (check-equal? "function correctly identified as a procedure" #t (procedure? car)) (check-equal? "symbol correctly identified as NOT as a procedure" #f (procedure? 'car)) (check-equal? "user defined function correctly identified as a procedure" #t (procedure? (lambda (x) (* x x)))) (check-equal? "quoted expression correctly identified as NOT as procedure" #f (procedure? '(lambda (x) (* x x)))) (check-equal? "basic call/cc with native predicate" #t (call-with-current-continuation procedure?)) (check-equal? "basic call/cc with user defined function" 7 (call-with-current-continuation (lambda (k) (+ 2 5)))) (check-equal? "more complex call/cc with user defined function" 3 (call-with-current-continuation (lambda (k) (+ 2 5 (k 3))))) (check-equal? "apply with native function" 7 (apply + (list 3 4))) (check-equal? "map with user defined function" '(b e h) (map cadr '((a b) (d e) (g h)))) (check-equal? "map with numeric op" '(1 4 27 256 3125) (map (lambda (n) (expt n n)) '(1 2 3 4 5))) (check-equal? "map with multiple list arguments" '(5 7 9) (map + '(1 2 3) '(4 5 6))) (check-equal? "force and delay" 3 (force (delay (+ 1 2)))) (check-equal? "force and delay with local variable" '(3 3) (let ([p (delay (+ 1 2))]) (list (force p) (force p)))) (skip-compile (check-equal '#(0 1 4 9 16) (let ([v (make-vector 5)]) (for-each (lambda (i) (vector-set! v i (* i i))) '(0 1 2 3 4)) v))) (check-equal? "using else as a variable" 'ok (let ([else 1]) (cond [else 'ok] [#t 'bad]))) (check-equal? "Using an arrow as a variable" 'ok (let ([=> 1]) (cond [#t => 'ok]))) ; (check-equal '(,foo) (let ([unquote 1]) `(,foo))) (skip-compile (check-equal? "Override unquote in a local context" '(,foo) (let ([unquote 1]) `(,foo))) (check-equal '(,@foo) (let ([unquote-splicing 1]) `(,@foo))) ; (check-equal 'ok ; (let ([... 2]) ; (let-syntax ([s (syntax-rules () ; [(_ x ...) 'bad] ; [(_ . r) 'ok])]) ; (s a b c)))) (check-equal 'ok (let () (let-syntax () (define internal-def 'ok)) internal-def)) (check-equal 'ok (let () (letrec-syntax () (define internal-def 'ok)) internal-def))) ; TODO: This causes a free identifier error (check-equal? "mutation within local function" '(2 1) ((lambda () (let ([x 1]) (let ([y x]) (set! x 2) (list x y)))))) ; TODO: This causes a free identifier error (check-equal? "multiple levels of let with mutation" '(2 2) ((lambda () (let ([x 1]) (set! x 2) (let ([y x]) (list x y)))))) ; TODO: This causes a free identifier error (check-equal? "local mutation" '(1 2) ((lambda () (let ([x 1]) (let ([y x]) (set! y 2) (list x y)))))) ;; TODO: This causes a free identifier error (check-equal? "Multiple mutations inside local context" '(2 3) ((lambda () (let ([x 1]) (let ([y x]) (set! x 2) (set! y 3) (list x y)))))) (skip-compile (check-equal '(a b c) (let* ([path '()] [add (lambda (s) (set! path (cons s path)))]) (dynamic-wind (lambda () (add 'a)) (lambda () (add 'b)) (lambda () (add 'c))) (reverse path))) (check-equal '(connect talk1 disconnect connect talk2 disconnect) (let ([path '()] [c #f]) (let ([add (lambda (s) (set! path (cons s path)))]) (dynamic-wind (lambda () (add 'connect)) (lambda () (add (call-with-current-continuation (lambda (c0) (set! c c0) 'talk1)))) (lambda () (add 'disconnect))) (if (< (length path) 4) (c 'talk2) (reverse path))))) ; (check-equal 2 ; (let-syntax ([foo (syntax-rules ::: ; [] ; [(foo ... args :::) (args ::: ...)])]) ; (foo 3 - 5))) ; (check-equal ; '(5 4 1 2 3) ; (let-syntax ([foo (syntax-rules () ; [(foo args ... penultimate ultimate) (list ultimate penultimate args ...)])]) ; (foo 1 2 3 4 5))) ) ;; -------------- Report ------------------ (require "lists/lists.scm") (define r5rs-test-stats (get-test-stats)) (displayln "Passed: " (hash-ref r5rs-test-stats 'success-count)) (displayln "Skipped compilation (expected failure): " (hash-ref r5rs-test-stats 'failed-to-compile)) (displayln "Failed: " (hash-ref r5rs-test-stats 'failure-count)) (for-each (lambda (x) (displayln " > " x)) (hash-ref r5rs-test-stats 'failures))
false
5e485163c61157d3324bb1465a4d24632eb0833d
61fb743a214685f6637e01c913dac7c3bc65fe6e
/miniKanren/miniKanren.scm
c15d1b70138d0f6562f3f3154a72c688672c2dc7
[]
no_license
niitsuma/Racket-miniKanren
95d90300f9a3b8a46dd5df8ed8a9ed961b303edb
e5b82d62cc25148ff4e2b36120c7bc6225c4e6d1
refs/heads/master
2020-04-05T23:44:57.973148
2014-08-30T17:41:56
2014-08-30T17:41:56
10,995,442
14
1
null
null
null
null
UTF-8
Scheme
false
false
7,562
scm
miniKanren.scm
#lang racket ;; In order to use "basic" miniKanren (require "mk.rkt" ;"mk.scm" ;; "ck.scm" ;; "tree-unify.scm" ) (provide (all-defined-out)) (define-syntax run1 (syntax-rules () ((_ (x) g0 g ...) (run 1 (x) g0 g ...)))) (define-syntax run2 (syntax-rules () ((_ (x) g0 g ...) (run 2 (x) g0 g ...)))) (define-syntax run3 (syntax-rules () ((_ (x) g0 g ...) (run 3 (x) g0 g ...)))) (define-syntax run4 (syntax-rules () ((_ (x) g0 g ...) (run 4 (x) g0 g ...)))) (define-syntax run5 (syntax-rules () ((_ (x) g0 g ...) (run 5 (x) g0 g ...)))) (define-syntax run6 (syntax-rules () ((_ (x) g0 g ...) (run 6 (x) g0 g ...)))) (define-syntax run7 (syntax-rules () ((_ (x) g0 g ...) (run 7 (x) g0 g ...)))) (define-syntax run8 (syntax-rules () ((_ (x) g0 g ...) (run 8 (x) g0 g ...)))) (define-syntax run9 (syntax-rules () ((_ (x) g0 g ...) (run 9 (x) g0 g ...)))) (define-syntax run10 (syntax-rules () ((_ (x) g0 g ...) (run 10 (x) g0 g ...)))) (define-syntax run11 (syntax-rules () ((_ (x) g0 g ...) (run 11 (x) g0 g ...)))) (define-syntax run12 (syntax-rules () ((_ (x) g0 g ...) (run 12 (x) g0 g ...)))) (define-syntax run13 (syntax-rules () ((_ (x) g0 g ...) (run 13 (x) g0 g ...)))) (define-syntax run14 (syntax-rules () ((_ (x) g0 g ...) (run 14 (x) g0 g ...)))) (define-syntax run15 (syntax-rules () ((_ (x) g0 g ...) (run 15 (x) g0 g ...)))) (define-syntax run16 (syntax-rules () ((_ (x) g0 g ...) (run 16 (x) g0 g ...)))) (define-syntax run17 (syntax-rules () ((_ (x) g0 g ...) (run 17 (x) g0 g ...)))) (define-syntax run18 (syntax-rules () ((_ (x) g0 g ...) (run 18 (x) g0 g ...)))) (define-syntax run19 (syntax-rules () ((_ (x) g0 g ...) (run 19 (x) g0 g ...)))) (define-syntax run20 (syntax-rules () ((_ (x) g0 g ...) (run 20 (x) g0 g ...)))) (define-syntax run21 (syntax-rules () ((_ (x) g0 g ...) (run 21 (x) g0 g ...)))) (define-syntax run22 (syntax-rules () ((_ (x) g0 g ...) (run 22 (x) g0 g ...)))) (define-syntax run23 (syntax-rules () ((_ (x) g0 g ...) (run 23 (x) g0 g ...)))) (define-syntax run24 (syntax-rules () ((_ (x) g0 g ...) (run 24 (x) g0 g ...)))) (define-syntax run25 (syntax-rules () ((_ (x) g0 g ...) (run 25 (x) g0 g ...)))) (define-syntax run26 (syntax-rules () ((_ (x) g0 g ...) (run 26 (x) g0 g ...)))) (define-syntax run27 (syntax-rules () ((_ (x) g0 g ...) (run 27 (x) g0 g ...)))) (define-syntax run28 (syntax-rules () ((_ (x) g0 g ...) (run 28 (x) g0 g ...)))) (define-syntax run29 (syntax-rules () ((_ (x) g0 g ...) (run 29 (x) g0 g ...)))) (define-syntax run30 (syntax-rules () ((_ (x) g0 g ...) (run 30 (x) g0 g ...)))) (define-syntax run31 (syntax-rules () ((_ (x) g0 g ...) (run 31 (x) g0 g ...)))) (define-syntax run32 (syntax-rules () ((_ (x) g0 g ...) (run 32 (x) g0 g ...)))) (define-syntax run33 (syntax-rules () ((_ (x) g0 g ...) (run 33 (x) g0 g ...)))) (define-syntax run34 (syntax-rules () ((_ (x) g0 g ...) (run 34 (x) g0 g ...)))) (define-syntax run35 (syntax-rules () ((_ (x) g0 g ...) (run 35 (x) g0 g ...)))) (define-syntax run36 (syntax-rules () ((_ (x) g0 g ...) (run 36 (x) g0 g ...)))) (define-syntax run37 (syntax-rules () ((_ (x) g0 g ...) (run 37 (x) g0 g ...)))) (define-syntax run38 (syntax-rules () ((_ (x) g0 g ...) (run 38 (x) g0 g ...)))) (define-syntax run39 (syntax-rules () ((_ (x) g0 g ...) (run 39 (x) g0 g ...)))) (define-syntax run40 (syntax-rules () ((_ (x) g0 g ...) (run 40 (x) g0 g ...)))) (define caro (lambda (p a) (fresh (d) (== (cons a d) p)))) (define cdro (lambda (p d) (fresh (a) (== (cons a d) p)))) (define conso (lambda (a d p) (== (cons a d) p))) (define nullo (lambda (x) (== '() x))) (define eqo (lambda (x y) (== x y))) (define pairo (lambda (p) (fresh (a d) (conso a d p)))) (define membero (lambda (x l) (conde ((fresh (a) (caro l a) (== a x))) ((fresh (d) (cdro l d) (membero x d)))))) (define rembero (lambda (x l out) (conde ((nullo l) (== '() out)) ((caro l x) (cdro l out)) ((fresh (a d res) (conso a d l) (rembero x d res) (conso a res out)))))) (define appendo (lambda (l s out) (conde ((nullo l) (== s out)) ((fresh (a d res) (conso a d l) (conso a res out) (appendo d s res)))))) (define flatteno (lambda (s out) (conde ((nullo s) (== '() out)) ((pairo s) (fresh (a d res-a res-d) (conso a d s) (flatteno a res-a) (flatteno d res-d) (appendo res-a res-d out))) ((conso s '() out))))) (define anyo (lambda (g) (conde (g) ((anyo g))))) (define nevero (anyo fail)) (define alwayso (anyo succeed)) ;;;;;;;;;;;;;;;;;;;;;;; ;; (define (circular-listo x o) (appendo x o o)) ;; (define (truncated-circular-listo x o) ;; (fresh (y z) ;; (pairo x) ;; (circular-listo x z) ;; (appendo o y z) )) (define mapo (lambda (fo ls q) (conde [(nullo ls ) (== q '())] [(fresh (a d a^ d^) (conso a d ls) (conso a^ d^ q) (fo a a^) (mapo fo d d^))]))) (define (builde n f) (let loop ([m 0]) (if (>= m n) succeed (fresh () (f m) (loop (add1 m)) ) ))) ;;;; usage ;; (let ([vs (build-list 3 var)]) ;; (run* (q) ;; (builde ;; 3 ;; (lambda (i) ;; (display i) ;; (== (list-ref vs i) i) ;; ;; (== q i) ;; )) ;; (== q vs) ;; ) ;; ) ;; > '((0 1 2)) (define (build2e n m f) (builde n (lambda (i) (builde m (lambda (j) (f i j)))))) ;;;; usage ;; (let ([vs (build-list 6 var)]) ;; (run* ;; (q) ;; (build2e ;; 2 3 ;; (lambda (i j) ;; (display (list i j (+ (* i 3) j ))) ;; (== ;; (list-ref vs (+ (* i 3) j ) ) ;; (+ (* i 3) j )) ;; )) ;; (== q vs) ;; ) ;; ) ;; ;; > '((0 1 2 3 4 5)) (define (builde-nest n-list f) (let loop ([n-lst n-list] [i-lst '()] ) ;(display (list n-list i-lst)) (if (null? n-lst) (apply f (reverse i-lst)) (let ([m (car n-lst)]) (builde m (lambda (i) (loop (cdr n-lst) (cons i i-lst)))))))) ;;;; usage ;; (let ([vs (build-list 6 var)]) ;; (run* ;; (q) ;; (builde-nest ;; '(2 3) ;; (lambda (i j) ;; ;(display (list i j (+ (* i 3) j ))) ;; (== ;; (list-ref vs (+ (* i 3) j ) ) ;; (+ (* i 3) j )) ;; )) ;; (== q vs) ;; ) ;; ) ;; > '((0 1 2 3 4 5)) (define for-eacho (lambda (fo ls) (conde [(nullo ls )] [(fresh (a d ) (conso a d ls) (fo a) (for-eacho fo d))]))) ;;;; usage ;(run* (q) (for-eacho (lambda (x) (scm?->ck number? x)) '(1 2 3))) ;(run* (q) (for-eacho (lambda (x) (scm?->ck number? x)) '(1 2 a))) (define (applye-nargs f args n) (let ([vs (build-list n var )]) (fresh () (== vs args) (apply f vs)))) (define for-eache (lambda (fo . lss) (let ([nargs (length lss)] ) (let loop ([lss lss]) (conde [(for-eacho nullo lss)] [(fresh (a d as ds) (mapo caro lss as) (mapo cdro lss ds) (applye-nargs fo as nargs) (loop ds) ) ]))))) ;;;; usage ;; ;; (run* (q) ;; (for-eache ;; == ;; '(2 3 4) ;; q ;; )) ;; (run* (q) ;; (for-eache ;; (lambda (x y) ;; (== x y) ;; ) ;; '(2 3 4) ;; q ;; )) ;; (run* (q) ;; (for-eache ;; nullo ;; ;'(1 2 3) ;; '(() () ()) ;; )) ;;;;;;;;;;;;;;;;;;;;;;;
true
e2ab1beacc1c651682e53104088a6fcc35f1bf77
50a8932cf0abcd58cf69bf8706bb87d51ce6e22c
/tests/010_car.scm
5b42d13a596e70d3828e31204d2a39ccb103c26e
[]
no_license
mikea/scheme-llvm
d1c2282b270aa331ca0537e1a0e6e3028f46fd32
0d580352a73ea98913363c9e996d253962ec06c9
refs/heads/master
2021-01-16T20:42:20.296384
2016-11-25T06:16:23
2016-11-25T06:16:23
26,048
21
5
null
null
null
null
UTF-8
Scheme
false
false
127
scm
010_car.scm
(car '(1 2)) ;; 1 (car '(2 3 4)) ;; 2 (car '(5 . 6)) ;; 5 (car '(a b c)) ;; a (car '((a) b c d)) ;; (a) (car '()) ;; <failure>
false
474c09c4916a3a470f99e56640ef738db35d481d
37c751fc27e790303b84730013217d1c8cbb60cc
/scsh/schemedoc/packages.scm
a528af4f501f3f381216597508629f27293929cb
[ "LicenseRef-scancode-public-domain", "BSD-3-Clause" ]
permissive
gitGNU/gnu_sunterlib
e82df45894f0075e2ad2df88ce6edf0f1704c6a0
96d443b55c990506e81f2c893e02245b7e2b5f4c
refs/heads/master
2023-08-06T09:32:59.463520
2017-03-07T14:31:05
2017-03-07T14:31:05
90,394,267
0
0
null
null
null
null
UTF-8
Scheme
false
false
163
scm
packages.scm
(define-interface schemedoc-interface (export schemedoc-print-doc)) (define-structure schemedoc schemedoc-interface (open scheme) (files schemedoc))
false
cded8d02d50ba7352d497b8ba7ed9ecec7869279
c01a4c8a6cee08088b26e2a2545cc0e32aba897b
/attic/code/mk/test-arithmetic.scm
ed481ecddc72c6f657877cd583200f6b1bc57ed5
[ "MIT" ]
permissive
webyrd/mediKanren
c8d25238db8afbaf8c3c06733dd29eb2d7dbf7e7
b3615c7ed09d176e31ee42595986cc49ab36e54f
refs/heads/master
2023-08-18T00:37:17.512011
2023-08-16T00:53:29
2023-08-16T00:53:29
111,135,120
311
48
MIT
2023-08-04T14:25:49
2017-11-17T18:03:59
Racket
UTF-8
Scheme
false
false
6,070
scm
test-arithmetic.scm
(load "test-check.scm") (load "arithmetic.scm") (test "test 1" (run* (q) (*o (build-num 2) (build-num 3) q)) '(((0 1 1)))) (test "test 2" (run* (q) (fresh (n m) (*o n m (build-num 6)) (== `(,n ,m) q))) '((((1) (0 1 1))) (((0 1 1) (1))) (((0 1) (1 1))) (((1 1) (0 1))))) (test "sums" (run 5 (q) (fresh (x y z) (pluso x y z) (== `(,x ,y ,z) q))) '(((_.0 () _.0)) ((() (_.0 . _.1) (_.0 . _.1))) (((1) (1) (0 1))) (((1) (0 _.0 . _.1) (1 _.0 . _.1))) (((1) (1 1) (0 0 1))))) (test "factors" (run* (q) (fresh (x y) (*o x y (build-num 24)) (== `(,x ,y ,(build-num 24)) q))) '((((1) (0 0 0 1 1) (0 0 0 1 1))) (((0 0 0 1 1) (1) (0 0 0 1 1))) (((0 1) (0 0 1 1) (0 0 0 1 1))) (((0 0 1) (0 1 1) (0 0 0 1 1))) (((0 0 0 1) (1 1) (0 0 0 1 1))) (((1 1) (0 0 0 1) (0 0 0 1 1))) (((0 1 1) (0 0 1) (0 0 0 1 1))) (((0 0 1 1) (0 1) (0 0 0 1 1))))) (define number-primo (lambda (exp env val) (fresh (n) (== `(intexp ,n) exp) (== `(intval ,n) val) (not-in-envo 'numo env)))) (define sub1-primo (lambda (exp env val) (fresh (e n n-1) (== `(sub1 ,e) exp) (== `(intval ,n-1) val) (not-in-envo 'sub1 env) (eval-expo e env `(intval ,n)) (minuso n '(1) n-1)))) (define zero?-primo (lambda (exp env val) (fresh (e n) (== `(zero? ,e) exp) (conde ((zeroo n) (== #t val)) ((poso n) (== #f val))) (not-in-envo 'zero? env) (eval-expo e env `(intval ,n))))) (define *-primo (lambda (exp env val) (fresh (e1 e2 n1 n2 n3) (== `(* ,e1 ,e2) exp) (== `(intval ,n3) val) (not-in-envo '* env) (eval-expo e1 env `(intval ,n1)) (eval-expo e2 env `(intval ,n2)) (*o n1 n2 n3)))) (define if-primo (lambda (exp env val) (fresh (e1 e2 e3 t) (== `(if ,e1 ,e2 ,e3) exp) (not-in-envo 'if env) (eval-expo e1 env t) (conde ((== #t t) (eval-expo e2 env val)) ((== #f t) (eval-expo e3 env val)))))) (define boolean-primo (lambda (exp env val) (conde ((== #t exp) (== #t val)) ((== #f exp) (== #f val))))) (define eval-expo (lambda (exp env val) (conde ((boolean-primo exp env val)) ((number-primo exp env val)) ((sub1-primo exp env val)) ((zero?-primo exp env val)) ((*-primo exp env val)) ((if-primo exp env val)) ((symbolo exp) (lookupo exp env val)) ((fresh (rator rand x body env^ a) (== `(,rator ,rand) exp) (eval-expo rator env `(closure ,x ,body ,env^)) (eval-expo rand env a) (eval-expo body `((,x . ,a) . ,env^) val))) ((fresh (x body) (== `(lambda (,x) ,body) exp) (symbolo x) (== `(closure ,x ,body ,env) val) (not-in-envo 'lambda env)))))) (define not-in-envo (lambda (x env) (conde ((fresh (y v rest) (== `((,y . ,v) . ,rest) env) (=/= y x) (not-in-envo x rest))) ((== '() env))))) (define lookupo (lambda (x env t) (fresh (rest y v) (== `((,y . ,v) . ,rest) env) (conde ((== y x) (== v t)) ((=/= y x) (lookupo x rest t)))))) (test "push-down problems 2" (run* (q) (fresh (x a d) (absento 'intval x) (== 'intval a) (== `(,a . ,d) x))) '()) (test "push-down problems 3" (run* (q) (fresh (x a d) (== `(,a . ,d) x) (absento 'intval x) (== 'intval a))) '()) (test "push-down problems 4" (run* (q) (fresh (x a d) (== `(,a . ,d) x) (== 'intval a) (absento 'intval x))) '()) (test "push-down problems 6" (run* (q) (fresh (x a d) (== 'intval a) (== `(,a . ,d) x) (absento 'intval x))) '()) (test "push-down problems 1" (run* (q) (fresh (x a d) (absento 'intval x) (== `(,a . ,d) x) (== 'intval a))) '()) (test "push-down problems 5" (run* (q) (fresh (x a d) (== 'intval a) (absento 'intval x) (== `(,a . ,d) x))) '()) (test "zero?" (run 1 (q) (eval-expo `(zero? (sub1 (intexp ,(build-num 1)))) '() q)) '((#t))) (test "*" (run 1 (q) (eval-expo `(* (intexp ,(build-num 3)) (intexp ,(build-num 2))) '() `(intval ,(build-num 6)))) '((_.0))) (test "sub1" (run 1 (q) (eval-expo q '() `(intval ,(build-num 6))) (== `(sub1 (intexp ,(build-num 7))) q)) '(((sub1 (intexp (1 1 1)))))) (test "sub1 bigger WAIT a minute" (run 1 (q) (eval-expo q '() `(intval ,(build-num 6))) (== `(sub1 (sub1 (intexp ,(build-num 8)))) q)) '(((sub1 (sub1 (intexp (0 0 0 1))))))) (test "sub1 biggest WAIT a minute" (run 1 (q) (eval-expo q '() `(intval ,(build-num 6))) (== `(sub1 (sub1 (sub1 (intexp ,(build-num 9))))) q)) '(((sub1 (sub1 (sub1 (intexp (1 0 0 1)))))))) (test "lots of programs to make a 6" (run 12 (q) (eval-expo q '() `(intval ,(build-num 6)))) '(((intexp (0 1 1))) ((sub1 (intexp (1 1 1)))) ((* (intexp (1)) (intexp (0 1 1)))) ((* (intexp (0 1 1)) (intexp (1)))) ((if #t (intexp (0 1 1)) _.0)) ((* (intexp (0 1)) (intexp (1 1)))) ((if #f _.0 (intexp (0 1 1)))) ((sub1 (* (intexp (1)) (intexp (1 1 1))))) (((lambda (_.0) (intexp (0 1 1))) #t) (=/= ((_.0 numo))) (sym _.0)) ((sub1 (* (intexp (1 1 1)) (intexp (1))))) ((sub1 (sub1 (intexp (0 0 0 1))))) ((sub1 (if #t (intexp (1 1 1)) _.0))))) (define rel-fact5 `((lambda (f) ((f f) (intexp ,(build-num 5)))) (lambda (f) (lambda (n) (if (zero? n) (intexp ,(build-num 1)) (* n ((f f) (sub1 n)))))))) (test "rel-fact5" (run* (q) (eval-expo rel-fact5 '() q)) `(((intval ,(build-num 120))))) (test "rel-fact5-backwards" (run 1 (q) (eval-expo `((lambda (f) ((f ,q) (intexp ,(build-num 5)))) (lambda (f) (lambda (n) (if (zero? n) (intexp ,(build-num 1)) (* n ((f f) (sub1 n))))))) '() `(intval ,(build-num 120)))) `((f)))
false
33369e1fb2cd489793baf36f8f1510da9968c2e3
f07bc117302b8959f25449863c6fdabdda510c48
/test-full-suite.scm
74b494e630b25d0ed121e56f47bf1d2b6d9e7bdc
[ "MIT" ]
permissive
namin/clpsmt-miniKanren
3a1165a20dc1c50e4d568e2e493b701fb9f5caea
d2270aa14410805fa7068150bc2ab2f3bf9391b4
refs/heads/master
2022-03-10T07:05:21.950751
2022-02-26T23:54:05
2022-02-26T23:54:05
129,262,229
33
9
MIT
2021-08-03T16:02:50
2018-04-12T14:14:59
Scheme
UTF-8
Scheme
false
false
350
scm
test-full-suite.scm
(load "test-header.scm") (load "z3-tests.scm") (load "clpsmt-basic-tests.scm") (load "clpsmt-tests.scm") (load "sign-domain-tests.scm") (load "symbolic-execution-tests.scm") (load "full-interp-extended-tests.scm") (load "abstract-interp.scm") (load "abstract-interp-tagged.scm") (load "twenty-four-puzzle.scm") (load "twenty-four-puzzle-smart.scm")
false
c7909d0285f373ddb661f56d4b5ce580f0635363
8f0c7a999b0cc7fdebd7df062aa5b14c8a809a08
/harlan/middle/lift-complex.scm
cb64c866a8f9a17740a642b1fa7c2302f316e77e
[ "BSD-3-Clause-Open-MPI" ]
permissive
sarvex/harlan-lang
7ab0eb7d0982848f68d0e5e67b12c27b91fdb34c
a361a1dc1312b3f4a46cb81c8d07852a70f67233
refs/heads/master
2023-06-13T03:07:01.753792
2023-05-30T16:03:27
2023-05-30T16:03:27
32,276,436
0
0
NOASSERTION
2023-05-30T16:03:28
2015-03-15T18:22:04
Scheme
UTF-8
Scheme
false
false
5,990
scm
lift-complex.scm
(library (harlan middle lift-complex) (export lift-complex lift-expr) (import (rnrs) (except (elegant-weapons helpers) ident?) (harlan helpers)) (define lift-expr (lambda (expr finish) (match expr ((void) (finish `(void))) ((,t ,n) (guard (scalar-type? t)) (finish `(,t ,n))) ((var ,t ,x) (finish `(var ,t ,x))) ((cast ,t ,e) (lift-expr e (lambda (e) (finish `(cast ,t ,e))))) ((not ,e) (lift-expr e (lambda (e) (finish `(not ,e))))) ((begin ,[lift-stmt -> stmt*] ... ,e) (lift-expr e (lambda (e) `(begin ,@stmt* ,(finish e))))) ((let () ,expr) (lift-expr expr finish)) ((let ((,x ,t ,e) . ,rest) ,expr) (Expr e (lambda (e) `(let ((,x ,t ,e)) ,(lift-expr `(let ,rest ,expr) finish))))) ((if ,test ,conseq ,alt) (lift-expr test (lambda (t) (let ((if-res (gensym 'if_res)) (type (type-of conseq))) (let ((c (lift-expr conseq (lambda (c) `(set! (var ,type ,if-res) ,c)))) (a (lift-expr alt (lambda (a) `(set! (var ,type ,if-res) ,a))))) `(let ((,if-res ,type)) (begin (if ,t ,c ,a) ,(finish `(var ,type ,if-res))))))))) ((vector-ref ,t ,e1 ,e2) (lift-expr e1 (lambda (e1^) (lift-expr e2 (lambda (e2^) (finish `(vector-ref ,t ,e1^ ,e2^))))))) ((unsafe-vec-ptr ,t ,e) (lift-expr e (lambda (e^) (finish `(unsafe-vec-ptr ,t ,e^))))) ((make-vector ,t ,r ,e) (lift-expr e (lambda (e^) (finish `(make-vector ,t ,r ,e^))))) ((vector ,t ,r . ,e*) (lift-expr* e* (lambda (e*) (let ((v (gensym 'v))) `(let ((,v ,t (vector ,t ,r . ,e*))) ,(finish `(var ,t ,v))))))) ((length ,e) (lift-expr e (lambda (e^) (finish `(length ,e^))))) ((box ,r ,t ,e) (let ((box (gensym 'box))) (lift-expr e (lambda (e) `(let ((,box region_ptr (box ,r ,t ,e))) ,(finish `(var region_ptr ,box))))))) ((unbox ,t ,r ,e) (lift-expr e (lambda (e) (finish `(unbox ,t ,r ,e))))) ((field ,e ,x) (lift-expr e (lambda (e) (finish `(field ,e ,x))))) ((empty-struct) (finish '(empty-struct))) ((c-expr ,t ,v) (finish `(c-expr ,t ,v))) ((,op ,e1 ,e2) (guard (or (binop? op) (relop? op))) (lift-expr e1 (lambda (e1^) (lift-expr e2 (lambda (e2^) (finish `(,op ,e1^ ,e2^))))))) ((call ,rator . ,rand*) (lift-expr rator (lambda (rator) (lift-expr* rand* (lambda (rand*) (finish `(call ,rator . ,rand*))))))) (,else (error 'lift-expr "unmatched datum" else))))) (define Expr (lambda (expr finish) (match expr ((make-vector ,t ,e) (lift-expr e (lambda (e) (finish `(make-vector ,t ,e))))) ((vector ,t ,r . ,e*) (lift-expr* e* (lambda (e*) (finish `(vector ,t ,r . ,e*))))) (,else (lift-expr else finish))))) (define (lift-expr* e* finish) (let loop ((e* e*) (e^* `())) (cond ((null? e*) (finish (reverse e^*))) (else (lift-expr (car e*) (lambda (e^) (loop (cdr e*) (cons e^ e^*)))))))) (define-match lift-stmt ((kernel ,t ,dims (((,x* ,t*) (,e* ,ts*) ,dim*) ...) ,[body]) (lift-expr* dims (lambda (dims) (lift-expr* e* (lambda (e*^) `(kernel ,t ,dims (((,x* ,t*) (,e*^ ,ts*) ,dim*) ...) ,body)))))) ((begin ,[lift-stmt -> stmt*] ...) (make-begin stmt*)) ((error ,x) `(error ,x)) ((print ,expr) (lift-expr expr (lambda (e^) `(print ,e^)))) ((print ,expr ,op) (lift-expr expr (lambda (e^) (lift-expr op (lambda (op^) `(print ,e^ ,op^)))))) ((assert ,expr) (lift-expr expr (lambda (e^) `(assert ,e^)))) ((set! ,x ,e) (lift-expr x (lambda (x) (lift-expr e (lambda (e^) `(set! ,x ,e^)))))) ((let-region (,r ...) ,[body]) `(let-region (,r ...) ,body)) ((let () ,[stmt]) stmt) ((let ((,x ,t ,e) . ,rest) ,stmt) (Expr e (lambda (e) `(let ((,x ,t ,e)) ,(lift-stmt `(let ,rest ,stmt)))))) ((if ,test ,[conseq]) (lift-expr test (lambda (t) `(if ,t ,conseq)))) ((if ,test ,[conseq] ,[alt]) (lift-expr test (lambda (t) `(if ,t ,conseq ,alt)))) ((return) `(return)) ((return ,expr) (lift-expr expr (lambda (e^) `(return ,e^)))) ((for (,x ,start ,end ,step) ,[stmt]) (lift-expr start (lambda (start) (lift-expr end (lambda (end) (lift-expr step (lambda (step) `(for (,x ,start ,end ,step) ,stmt)))))))) ((do ,e) (lift-expr e (lambda (e) `(do ,e)))) ((while ,expr ,[stmt]) (lift-expr expr (lambda (expr) `(while ,expr ,stmt))))) (define-match lift-decl ((fn ,name ,args ,t ,[lift-stmt -> stmt]) `(fn ,name ,args ,t ,stmt)) ((typedef ,name ,t) `(typedef ,name ,t)) ((extern ,name ,args -> ,rtype) `(extern ,name ,args -> ,rtype))) (define-match lift-complex ((module ,[lift-decl -> fn*] ...) `(module . ,fn*))) (define-match type-of ((,t ,v) (guard (scalar-type? t)) t) ((var ,t ,x) t) ((length ,t) `int) ((addressof ,[t]) `(ptr ,t)) ((deref ,[t]) (cadr t)) ((if ,t ,[c] ,a) c) ((call (var (,argt -> ,rt) ,fn) . ,arg*) rt) ((c-expr ,t ,v) t) ((vector-ref ,t ,v ,i) t) ((,op ,[lhs] ,rhs) (guard (binop? op)) lhs) ((let ,b ,[e]) e) ((begin ,s* ... ,[e]) e) ((call ,[e] ,e* ...) (match e ((fn ,args -> ,t) t))) ((,op ,lhs ,rhs) (guard (relop? op)) 'bool)) )
false
41ccbefa2c7cd20be73b341f395025ab93022660
b60cb8e39ec090137bef8c31ec9958a8b1c3e8a6
/test/concurrentScheme/futures/ringbuf.scm
6c2ba60ee501110a7f6ff521f5530196d653ef06
[]
no_license
acieroid/scala-am
eff387480d3baaa2f3238a378a6b330212a81042
13ef3befbfc664b77f31f56847c30d60f4ee7dfe
refs/heads/master
2021-01-17T02:21:41.692568
2021-01-15T07:51:20
2021-01-15T07:51:20
28,140,080
32
16
null
2020-04-14T08:53:20
2014-12-17T14:14:02
Scheme
UTF-8
Scheme
false
false
2,414
scm
ringbuf.scm
;; Ring-buffer benchmark (define (build-vector n init f) (letrec ((v (make-vector n init)) (loop (lambda (i) (if (< i n) (begin (vector-set! v i (f i)) (loop (+ i 1))) v)))) (loop 0))) (define (ring-buf size) ;; The buffer (define buffer (build-vector size (atom 0) (lambda (i) (atom 0)))) ;; The read pointer (define read (atom 0)) ;; The write pointer (define write (atom 0)) ;; Number of elements in the buffer (define nelems (atom 0)) ;; Lock protecting the buffer (define lock (new-lock)) ;; Push a value in the buffer (define (push v) (acquire lock) (reset! (vector-ref buffer (modulo (read write) size)) v) (reset! write (+ (read write) 1)) (reset! nelems (+ (read nelems) 1)) (release lock)) ;; Pop a value from the buffer (define (pop) (acquire lock) (let ((v (read (vector-ref buffer (modulo (read read) size))))) (reset! read (+ (read read) 1)) (reset! nelems (- (read nelems) 1)) (release lock) v)) (list push pop (lambda () (read nelems)))) (define NWR 42) (define NRD 42) (define Iterations 42) (define Size 42) (define (do-n n f) (if (= n 0) '() (cons (f) (do-n (- n 1) f)))) (define buf-struct (ring-buf Size)) (define buf-push (car buf-struct)) (define buf-pop (cadr buf-struct)) (define buf-size (caddr buf-struct)) (define wthrds (do-n NWR (lambda () (letrec ((loop (lambda (i) (if (= i Iterations) 'done (begin (buf-push (random 100)) (loop (+ i 1))))))) (future (loop 0)))))) (define rthrds (do-n NRD (lambda () (letrec ((loop (lambda (i) (if (= i Iterations) 'done (begin (display (buf-pop)) (newline) (loop (+ i 1))))))) (future (loop 0)))))) (map (lambda (t) (deref t)) wthrds) (map (lambda (t) (deref t)) rthrds) (if (= NWR NRD) (= (buf-size) 0) #t)
false
e75806f736c89c77737bf2183bee3d4aef2356df
4b480cab3426c89e3e49554d05d1b36aad8aeef4
/chapter-03/ex3.03-falsetru-test.scm
9dff751ae1ec82290a3329c8bf84cf28d2c35d75
[]
no_license
tuestudy/study-sicp
a5dc423719ca30a30ae685e1686534a2c9183b31
a2d5d65e711ac5fee3914e45be7d5c2a62bfc20f
refs/heads/master
2021-01-12T13:37:56.874455
2016-10-04T12:26:45
2016-10-04T12:26:45
69,962,129
0
0
null
null
null
null
UTF-8
Scheme
false
false
592
scm
ex3.03-falsetru-test.scm
(require (planet schematics/schemeunit:3)) (require (planet schematics/schemeunit:3/text-ui)) (load "ex3.03-falsetru.scm") (define ex3.03-falsetru-tests (test-suite "Test for ex3.03-falsetru" (test-case "make-acount password-protected" (define acc (make-acount 100 'secret-password)) (check-equal? ((acc 'secret-password 'withdraw) 40) 60) (check-equal? ((acc 'some-other-password 'withdraw) 50) "Incorrect password") (check-equal? ((acc 'secret-password 'withdraw) 50) 10) ) )) (exit (cond ((= (run-tests ex3.03-falsetru-tests) 0)) (else 1)))
false
b838b221ab59719675fc68bdcdd17259c9004852
bcfa2397f02d5afa93f4f53c0b0a98c204caafc1
/scheme/chapter1/ex1_20.scm
87bc856c5afee0ce524e8bb9f6d4a71e3178a9b6
[]
no_license
rahulkumar96/sicp-study
ec4aa6e1076b46c47dbc7a678ac88e757191c209
4dcd1e1eb607aa1e32277e1c232a321c5de9c0f0
refs/heads/master
2020-12-03T00:37:39.576611
2017-07-05T12:58:48
2017-07-05T12:58:48
96,050,670
0
0
null
2017-07-02T21:46:09
2017-07-02T21:46:09
null
UTF-8
Scheme
false
false
3,307
scm
ex1_20.scm
;; SICP 1.20 ;; Exercise 1.20. The process that a procedure generates is of course ;; dependent on the rules used by the interpreter. As an example, ;; consider the iterative gcd procedure given above. Suppose we were ;; to interpret this procedure using normal-order evaluation, as ;; discussed in section 1.1.5. (The normal-order-evaluation rule for ;; if is described in exercise 1.5.) Using the substitution method ;; (for normal order), illustrate the process generated in evaluating ;; (gcd 206 40) and indicate the remainder operations that are ;; actually performed. How many remainder operations are actually ;; performed in the normal-order evaluation of (gcd 206 40)? In the ;; applicative-order evaluation? ;; ANSWER ------------------------------------------------------------ ;; The gcd function in the book is: (define (gcd a b) (if (= b 0) a (gcd b (remainder a b)))) ;; First we do a normal order evaluation. We will add an X to the ;; line every time a call to remainder is made. At the end, we merely ;; count the number of X's to determine the number of remainder calls. ;; In order the keep the following lines a bit more readable, lets ;; define r to mean remainder. (define (r a b) (remainder a b)) (gcd 206 40) (if (= 206 0) 40 (gcd 40 (r 206 40))) (gcd 40 (r 206 40)) (if (= (r 206 40) 0) 40 (gcd (r 206 40) (r 40 (r 206 40)))) (if (= 6 0) 40 (gcd (r 206 40) (r 40 (r 206 40)))) ;X (gcd (r 206 40) (r 40 (r 206 40))) ;X (if (= (r 40 (r 206 40)) 0) (r 206 40) (gcd (r 40 (r 206 40)) (r (r 206 40) (r 40 (r 206 40))))) ; X (if (= 4 0) (r 206 40) (gcd (r 40 (r 206 40)) (r (r 206 40) (r 40 (r 206 40))))) ;XXX (gcd (r 40 (r 206 40)) (r (r 206 40) (r 40 (r 206 40)))) ;XXX (if (= (r (r 206 40) (r 40 (r 206 40))) 0) (r 40 (r 206 40)) (gcd (r (r 206 40) (r 40 (r 206 40))) (r (r 40 (r 206 40)) (r (r 206 40) (r 40 (r 206 40)))))) ;XXX (if (= 2 0) (r 40 (r 206 40)) (gcd (r (r 206 40) (r 40 (r 206 40))) (r (r 40 (r 206 40)) (r (r 206 40) (r 40 (r 206 40)))))) ;XXX (gcd (r (r 206 40) (r 40 (r 206 40))) (r (r 40 (r 206 40)) (r (r 206 40) (r 40 (r 206 40))))) ;XXXXXXX (if (= (r (r 40 (r 206 40)) (r (r 206 40) (r 40 (r 206 40)))) 0) (r (r 206 40) (r 40 (r 206 40))) (gcd (r (r 40 (r 206 40)) (r (r 206 40) (r 40 (r 206 40)))) (r (r (r 206 40) (r 40 (r 206 40))) (r (r 40 (r 206 40)) (r (r 206 40) (r 40 (r 206 40))))))) ;XXXXXXX (if (= 0 0) (r (r 206 40) (r 40 (r 206 40))) (gcd (r (r 40 (r 206 40)) (r (r 206 40) (r 40 (r 206 40)))) (r (r (r 206 40) (r 40 (r 206 40))) (r (r 40 (r 206 40)) (r (r 206 40) (r 40 (r 206 40))))))) ;XXXXXXXXXXXXXX (r (r 206 40) (r 40 (r 206 40))) ;XXXXXXXXXXXXXX (r (r 206 40) (r 40 6)) ;XXXXXXXXXXXXXXX (r (r 206 40) 4) ;XXXXXXXXXXXXXXXX 2 ;XXXXXXXXXXXXXXXXXX ;; A total of 18 remainder calls were made using normal order evaluation. ;; Now here is applicative order evaluation, using the X notation. (gcd 206 40) (if (= 40 0) 206 (gcd 40 (r 206 40))) (gcd 40 (r 206 40)) ;X (gcd 40 6) ;X (if (= 6 0) 40 (gcd 6 (r 40 6))) ;X (gcd 6 (r 40 6)) ;X (gcd 6 4) ;XX (if (= 4 0) 6 (gcd 4 (r 6 4))) ;XX (gcd 4 (r 6 4)) ;XX (gcd 4 2) ;XXX (if (= 2 0) 4 (gcd 2 (r 4 2))) ;XXX (gcd 2 (r 4 2)) ;XXX (gcd 2 0) ;XXXX (if (= 0 0) 2 (gcd 0 (r 2 0))) ;XXXX 2 ;XXXX ;; Using applicative order, we will call remainder a total of 4 times.
false
7fc54fb9a76bba7e22e1c4b7b9b30711ffd99243
bb8ff001b2ec26769f696b78ef183bdcbc9f9171
/LABS/Lab19/print.scm~
3c37686ea44e56540d7b06490956359763eb8e12
[]
no_license
LiangJoshua/CS152
0e2910e897a4c2fbb88f9184bc8b6719ee4ece3d
379d721c93c7c7a44439f2554c5d3b7396fecd54
refs/heads/master
2020-03-29T20:53:17.356083
2018-12-07T20:50:48
2018-12-07T20:50:48
150,337,000
2
0
null
null
null
null
UTF-8
Scheme
false
false
13
print.scm~
(println 3)
false
6c3b9ca28deb380ad6d69a4ce84ce7dca91a4af4
f4aeaa0812ac15d5a8d2cb6da75ac335c3cf5cf4
/substitution/llrb-tree/miruKanren/substitution.sld
4378bfc4b769322b4a8ceba858d001efacc888f8
[ "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
Scheme
false
false
318
sld
substitution.sld
(define-library (miruKanren substitution) (import (scheme base) (llrb-tree llrb-tree) (miruKanren utils) (miruKanren variables)) (export substitution-set substitution-get substitution-size empty-substitution) (include "substitution-llrb-tree.scm"))
false
1c7ad654f95819acbd6dcc3f0bcbf461d7a5ab3b
7f8e3eb6b64a12225cbc704aedb390f8fb9186de
/ch4/ex4.16.scm
a85bc871484b94db0d279f621d0f03894e7d2141
[]
no_license
fasl/sicp
70e257b6a5fdd44d2dc5783e99d98f0af527fe45
c7228b6b284c525a4195358f91e27ebd6a419fa3
refs/heads/master
2020-12-26T01:12:07.019658
2017-02-01T10:13:38
2017-02-01T10:13:38
17,853,161
0
0
null
null
null
null
UTF-8
Scheme
false
false
2,601
scm
ex4.16.scm
;;; ex4.16 (load "../global.scm") (load "./ch4-mceval.scm") (load "./ex4.8.scm") ;; a (define (lookup-variable-value var env) (define (env-loop env) (define (scan vars vals) (cond ((null? vars) (env-loop (enclosing-environment env))) ((eq? var (car vars)) (if (equal? (car vals) "*unassigned*") (error "Unassigned variable" var) (car vals))) (else (scan (cdr vars) (cdr vals))))) (if (eq? env the-empty-environment) (error "Unbound variable" var) (let ((frame (first-frame env))) (scan (frame-variables frame) (frame-values frame))))) (env-loop env)) ;; b ;; 答え見た ;; @see http://sioramen.sub.jp/blog/2008/02/sicp-416.html ; (let ((a 1)) ; (define (f x) ; (define b (+ a x)) ; (define a 5) ; (+ a b)) ; (f 10)) ; ;> 20 ; (define the-global-environment (setup-environment)) ; (driver-loop) ; ;> ;;; M-Eval input: ; (let ((a 1)) ; (define (f x) ; (define b (+ a x)) ; (define a 5) ; (+ a b)) ; (f 10)) ; ;> 16 ; 20になって欲しい (define (scan-out-defines exp) (let ((lets '()) ; (a '*unassigned*) のリスト (sets '()) ; (set! a hogehoge) のリスト (bodys '())) ; 本文のリスト (let scan-iter ((b exp)) (cond ((null? b) '()) ((definition? (car b)) (let ((var (definition-variable (car b))) (val (definition-value (car b)))) (set! lets (cons (list var ''*unassigned*) lets)) (set! sets (cons (cons 'set! (list var val)) sets)))) (else (set! bodys (append bodys (list (car b)))))) (if (not (null? b)) (scan-iter (cdr b)))) (if (null? lets) exp (list (append (list 'let lets) (append sets bodys)))))) ;(scan-out-defines '((define b (+ a x)) ; (define a 5) ; (+ a b)))) ;; これに対して動くようにする ;; c ;; make-procedureはprocedure作るときに1度だけしか呼ばれない ;; procedure-bodyは複数回呼ばれる可能性があるので、 ;; make-procedureでscan-out-definesしたほうが良い ;(define (procedure-body p) (scan-out-defines (caddr p))) (define (make-procedure parameters body env) (list 'procedure parameters (scan-out-defines body) env)) ; (define the-global-environment (setup-environment)) ; (driver-loop) ; ;> ;;; M-Eval input: ; (let ((a 1)) ; (define (f x) ; (define b (+ a x)) ; (define a 5) ; (+ a b)) ; (f 10)) ; ;> 20 ;
false
625906c327b1ca57ba479f4ec3658bab1a84feff
bf6fad8f5227d0b0ef78598065c83b89b8f74bbc
/chapter02/scheme/reciprocal_v2.ss
40f4688876aeb1d1d4e81051d91150e03bf2c41c
[]
no_license
e5pe0n/tspl
931d1245611280457094bd000e20b1790c3e2499
bc76cac2307fe9c5a3be2cea36ead986ca94be43
refs/heads/main
2023-08-18T08:21:29.222335
2021-09-28T11:04:54
2021-09-28T11:04:54
393,668,056
0
0
null
null
null
null
UTF-8
Scheme
false
false
1,098
ss
reciprocal_v2.ss
(define reciprocal (lambda (n) (if (and (number? n) (not (= n 0))) (/ 1 n) (error ; assertion-violation is introduced since r6rs "in reciprocal: improper argument" n ) ) ) ) (print (reciprocal .25)) (print (reciprocal 0)) ; 4.0 ; Error: in reciprocal: improper argument: 0 ; Call history: ; <syntax> (print (reciprocal 0.25)) ; <syntax> (reciprocal 0.25) ; <eval> (print (reciprocal 0.25)) ; <eval> (reciprocal 0.25) ; <eval> [reciprocal] (number? n) ; <eval> [reciprocal] (not (= n 0)) ; <eval> [reciprocal] (= n 0) ; <eval> [reciprocal] (/ 1 n) ; <syntax> (print (reciprocal 0)) ; <syntax> (reciprocal 0) ; <eval> (print (reciprocal 0)) ; <eval> (reciprocal 0) ; <eval> [reciprocal] (number? n) ; <eval> [reciprocal] (not (= n 0)) ; <eval> [reciprocal] (= n 0) ; <eval> [reciprocal] (error "in reciprocal: improper argument" n) <--
false
dfb92431fb6e23d3c38b0c027749a0fb79a3370e
ab05b79ab17619f548d9762a46199dc9eed6b3e9
/sitelib/ypsilon/gdk/draw.scm
000701431bc27d5ba1f120ececbea7592443d4d9
[ "BSD-2-Clause" ]
permissive
lambdaconservatory/ypsilon
2dce9ff4b5a50453937340bc757697b9b4839dee
f154436db2b3c0629623eb2a53154ad3c50270a1
refs/heads/master
2021-02-28T17:44:05.571304
2017-12-17T12:29:00
2020-03-08T12:57:52
245,719,032
1
0
NOASSERTION
2020-03-07T23:08:26
2020-03-07T23:08:25
null
UTF-8
Scheme
false
false
6,913
scm
draw.scm
#!nobacktrace ;;; Ypsilon Scheme System ;;; Copyright (c) 2004-2009 Y.FUJITA / LittleWing Company Limited. ;;; See license.txt for terms and conditions of use. (library (ypsilon gdk draw) (export gdk_draw_arc gdk_draw_drawable gdk_draw_glyphs gdk_draw_glyphs_transformed gdk_draw_gray_image gdk_draw_image gdk_draw_indexed_image gdk_draw_layout gdk_draw_layout_line gdk_draw_layout_line_with_colors gdk_draw_layout_with_colors gdk_draw_line gdk_draw_lines gdk_draw_pixbuf gdk_draw_point gdk_draw_points gdk_draw_polygon gdk_draw_rectangle gdk_draw_rgb_32_image gdk_draw_rgb_32_image_dithalign gdk_draw_rgb_image gdk_draw_rgb_image_dithalign gdk_draw_segments gdk_draw_trapezoids) (import (rnrs) (ypsilon ffi)) (define lib-name (cond (on-linux "libgdk-x11-2.0.so.0") (on-sunos "libgdk-x11-2.0.so.0") (on-freebsd "libgdk-x11-2.0.so.0") (on-openbsd "libgdk-x11-2.0.so.0") (on-darwin "Gtk.framework/Gtk") (on-windows "libgdk-win32-2.0-0.dll") (else (assertion-violation #f "can not locate GDK library, unknown operating system")))) (define lib (load-shared-object lib-name)) (define-syntax define-function (syntax-rules () ((_ ret name args) (define name (c-function lib lib-name ret name args))))) ;; void gdk_draw_arc (GdkDrawable* drawable, GdkGC* gc, gboolean filled, gint x, gint y, gint width, gint height, gint angle1, gint angle2) (define-function void gdk_draw_arc (void* void* int int int int int int int)) ;; void gdk_draw_drawable (GdkDrawable* drawable, GdkGC* gc, GdkDrawable* src, gint xsrc, gint ysrc, gint xdest, gint ydest, gint width, gint height) (define-function void gdk_draw_drawable (void* void* void* int int int int int int)) ;; void gdk_draw_glyphs (GdkDrawable* drawable, GdkGC* gc, PangoFont* font, gint x, gint y, PangoGlyphString* glyphs) (define-function void gdk_draw_glyphs (void* void* void* int int void*)) ;; void gdk_draw_glyphs_transformed (GdkDrawable* drawable, GdkGC* gc, const PangoMatrix* matrix, PangoFont* font, gint x, gint y, PangoGlyphString* glyphs) (define-function void gdk_draw_glyphs_transformed (void* void* void* void* int int void*)) ;; void gdk_draw_gray_image (GdkDrawable* drawable, GdkGC* gc, gint x, gint y, gint width, gint height, GdkRgbDither dith, const guchar* buf, gint rowstride) (define-function void gdk_draw_gray_image (void* void* int int int int int void* int)) ;; void gdk_draw_image (GdkDrawable* drawable, GdkGC* gc, GdkImage* image, gint xsrc, gint ysrc, gint xdest, gint ydest, gint width, gint height) (define-function void gdk_draw_image (void* void* void* int int int int int int)) ;; void gdk_draw_indexed_image (GdkDrawable* drawable, GdkGC* gc, gint x, gint y, gint width, gint height, GdkRgbDither dith, const guchar* buf, gint rowstride, GdkRgbCmap* cmap) (define-function void gdk_draw_indexed_image (void* void* int int int int int void* int void*)) ;; void gdk_draw_layout (GdkDrawable* drawable, GdkGC* gc, gint x, gint y, PangoLayout* layout) (define-function void gdk_draw_layout (void* void* int int void*)) ;; void gdk_draw_layout_line (GdkDrawable* drawable, GdkGC* gc, gint x, gint y, PangoLayoutLine* line) (define-function void gdk_draw_layout_line (void* void* int int void*)) ;; void gdk_draw_layout_line_with_colors (GdkDrawable* drawable, GdkGC* gc, gint x, gint y, PangoLayoutLine* line, const GdkColor* foreground, const GdkColor* background) (define-function void gdk_draw_layout_line_with_colors (void* void* int int void* void* void*)) ;; void gdk_draw_layout_with_colors (GdkDrawable* drawable, GdkGC* gc, gint x, gint y, PangoLayout* layout, const GdkColor* foreground, const GdkColor* background) (define-function void gdk_draw_layout_with_colors (void* void* int int void* void* void*)) ;; void gdk_draw_line (GdkDrawable* drawable, GdkGC* gc, gint x1_, gint y1_, gint x2_, gint y2_) (define-function void gdk_draw_line (void* void* int int int int)) ;; void gdk_draw_lines (GdkDrawable* drawable, GdkGC* gc, const GdkPoint* points, gint n_points) (define-function void gdk_draw_lines (void* void* void* int)) ;; void gdk_draw_pixbuf (GdkDrawable* drawable, GdkGC* gc, const GdkPixbuf* pixbuf, gint src_x, gint src_y, gint dest_x, gint dest_y, gint width, gint height, GdkRgbDither dither, gint x_dither, gint y_dither) (define-function void gdk_draw_pixbuf (void* void* void* int int int int int int int int int)) ;; void gdk_draw_point (GdkDrawable* drawable, GdkGC* gc, gint x, gint y) (define-function void gdk_draw_point (void* void* int int)) ;; void gdk_draw_points (GdkDrawable* drawable, GdkGC* gc, const GdkPoint* points, gint n_points) (define-function void gdk_draw_points (void* void* void* int)) ;; void gdk_draw_polygon (GdkDrawable* drawable, GdkGC* gc, gboolean filled, const GdkPoint* points, gint n_points) (define-function void gdk_draw_polygon (void* void* int void* int)) ;; void gdk_draw_rectangle (GdkDrawable* drawable, GdkGC* gc, gboolean filled, gint x, gint y, gint width, gint height) (define-function void gdk_draw_rectangle (void* void* int int int int int)) ;; void gdk_draw_rgb_32_image (GdkDrawable* drawable, GdkGC* gc, gint x, gint y, gint width, gint height, GdkRgbDither dith, const guchar* buf, gint rowstride) (define-function void gdk_draw_rgb_32_image (void* void* int int int int int void* int)) ;; void gdk_draw_rgb_32_image_dithalign (GdkDrawable* drawable, GdkGC* gc, gint x, gint y, gint width, gint height, GdkRgbDither dith, const guchar* buf, gint rowstride, gint xdith, gint ydith) (define-function void gdk_draw_rgb_32_image_dithalign (void* void* int int int int int void* int int int)) ;; void gdk_draw_rgb_image (GdkDrawable* drawable, GdkGC* gc, gint x, gint y, gint width, gint height, GdkRgbDither dith, const guchar* rgb_buf, gint rowstride) (define-function void gdk_draw_rgb_image (void* void* int int int int int void* int)) ;; void gdk_draw_rgb_image_dithalign (GdkDrawable* drawable, GdkGC* gc, gint x, gint y, gint width, gint height, GdkRgbDither dith, const guchar* rgb_buf, gint rowstride, gint xdith, gint ydith) (define-function void gdk_draw_rgb_image_dithalign (void* void* int int int int int void* int int int)) ;; void gdk_draw_segments (GdkDrawable* drawable, GdkGC* gc, const GdkSegment* segs, gint n_segs) (define-function void gdk_draw_segments (void* void* void* int)) ;; void gdk_draw_trapezoids (GdkDrawable* drawable, GdkGC* gc, const GdkTrapezoid* trapezoids, gint n_trapezoids) (define-function void gdk_draw_trapezoids (void* void* void* int)) ) ;[end]
true
3312b9664fd846da39d4d47f99a18cb05db2156b
601fa31aff7c3292841aef35316458bb341fc8fd
/src/test/scheme/main-test.scm
553ae429eb3fc7aeab94f9c68c941372640b1092
[ "MIT" ]
permissive
arvyy/kawa-spark
890d41a24006bde602fd54d3b7e53060d71cb9b4
b92be7e1596a3d5fe1b33307e6d340fbe133789f
refs/heads/master
2022-12-30T03:49:54.188278
2020-10-24T08:04:18
2020-10-24T08:04:18
297,773,610
0
0
null
2020-09-22T21:16:13
2020-09-22T21:13:19
Scheme
UTF-8
Scheme
false
false
681
scm
main-test.scm
(import (scheme base) (mapping-test) (request-test) (response-test) (session-test) (srfi 64)) (test-begin "Kawa-Spark test") ;; on test end exit with non-zero status if there were failures (let* ((runner (test-runner-current)) (callback (test-runner-on-final runner))) (test-runner-on-final! runner (lambda (r) (callback r) (exit (= 0 (test-runner-fail-count r)))))) (test-group "Mapping test" (do-mapping-test)) (test-group "Request methods test" (do-request-test)) (test-group "Response methods test" (do-response-test)) (test-group "Session methods test" (do-session-test)) (test-end)
false
d7eaa05c4456d207d4f8dfb27fdd03dca2d5f169
f5083e14d7e451225c8590cc6aabe68fac63ffbd
/cs/01-Programming/sicp/exercices/4.6.scm
5bbb9c468bf627329d7aa891beb2f381f3e60fd7
[]
no_license
Phantas0s/playground
a362653a8feb7acd68a7637334068cde0fe9d32e
c84ec0410a43c84a63dc5093e1c214a0f102edae
refs/heads/master
2022-05-09T06:33:25.625750
2022-04-19T14:57:28
2022-04-19T14:57:28
136,804,123
19
5
null
2021-03-04T14:21:07
2018-06-10T11:46:19
Racket
UTF-8
Scheme
false
false
2,654
scm
4.6.scm
; let expressions are derived expressions, because ; (let ((⟨var1⟩ ⟨exp1⟩) . . . (⟨varn⟩ ⟨expn⟩)) ; ⟨body⟩) ; is equivalent to ; ((lambda (⟨var1⟩ . . . ⟨varn⟩) ; ⟨body⟩) ; ⟨exp1⟩ ; . . . ; ⟨expn⟩) ; Implement a syntactic transformation let->combination ; that reduces evaluating let expressions to evaluating com- ; binations of the type shown above, and add the appropriate ; clause to eval to handle let expressions. (define (let? exp) (tagged-list? exp 'let)) (define (separate l index vars exps needed) (cond ((empty? l) (if (equal? needed 'vars) vars exps)) ((equal? (modulo index 2) 0) (separate (cdr l) (+ index 1) (append vars (list (car l))) exps needed)) (else (separate (cdr l) (+ index 1) vars (append exps (list (car l)))needed)))) (define (let-vars exp) (separate (cadr exp) 1 '() '() 'vars)) (define (let-exps exp) (separate (cadr exp) 1 '() '() 'exps)) (define (let-body exp) (cddr exp)) (define (make-lambda parameters body) (cons 'lambda (cons parameters body))) (define (let->combination exp) (cons (make-lambda (let-exps exp) (let-body exp)) (let-vars exp))) ; TESTS (let->combination (list 'let (list 'a 1 'b 2) (list '+ 'a 'b))) (let->combination (list 'let (list 'a (list '+ 1 1) 'b (list '+ 2 2)) (list '+ 'a 'b))) (define (eval exp env) (cond ((self-evaluating? exp) exp) ((variable? exp) (lookup-variable-value exp env)) ((quoted? exp) (text-of-quotation exp)) ((assignment? exp) (eval-assignment exp env)) ((definition? exp) (eval-definition exp env)) ((if? exp) (eval-if exp env)) ((let? exp) (eval (let->combination exp) env)) ((lambda? exp) (make-procedure (lambda-parameters exp) (lambda-body exp) env)) ((begin? exp) (eval-sequence (begin-actions exp) env)) ((cond? exp) (eval (cond->if exp) env)) ((application? exp) (apply (eval (operator exp) env) (list-of-values (operands exp) env))) (else (error "Unknown expression type: EVAL" exp)))) **GOOD** ; other solution ; Clever to extract vars / exps ; ((let? expr) (evaln (let->combination expr) env)) ;; let expression (define (let? expr) (tagged-list? expr 'let)) (define (let-vars expr) (map car (cadr expr))) (define (let-inits expr) (map cadr (cadr expr))) (define (let-body expr) (cddr expr)) (define (let->combination expr) (cons (make-lambda (let-vars expr) (let-body expr)) (let-inits expr)))
false
4953d02066daead436dc75f7214cc208e1abaa24
e1fc47ba76cfc1881a5d096dc3d59ffe10d07be6
/ch3/3.05.scm
1c86706ded6516ac189c76510e1615611d079890
[]
no_license
lythesia/sicp-sol
e30918e1ebd799e479bae7e2a9bd4b4ed32ac075
169394cf3c3996d1865242a2a2773682f6f00a14
refs/heads/master
2021-01-18T14:31:34.469130
2019-10-08T03:34:36
2019-10-08T03:34:36
27,224,763
2
0
null
null
null
null
UTF-8
Scheme
false
false
1,393
scm
3.05.scm
(load "util.scm") ; point (<x> . <y>) ; ^ ; | ; ------+-------> ; | ; | (define (make-point x y) (cons x y)) (define (xcoord p) (car p)) (define (ycoord p) (cdr p)) (define (estimate-integral pred? left-top right-bot trials) (* 4 (monte-carlo trials (lambda () (pred? left-top right-bot)))) ) (define (monte-carlo trials experiment) (define (iter hit rest) (if (zero? rest) (exact->inexact (/ hit trials)) (if (experiment) (iter (1+ hit) (1- rest)) (iter hit (1- rest)) ) ) ) (iter 0 trials) ) (define (random-in-range low high) (+ low (random (exact->inexact (- high low)))) ; `random` in scheme outputs int/float depends on input ) (define (picked-in-range? lt rb) (let* ( (lt-x (xcoord lt)) (lt-y (ycoord lt)) (rb-x (xcoord rb)) (rb-y (ycoord rb)) (cx (/ (exact->inexact (+ rb-x lt-x)) 2)) (cy (/ (exact->inexact (+ lt-y rb-y)) 2)) (px (random-in-range lt-x rb-x)) (py (random-in-range rb-y lt-y)) (r (/ (exact->inexact (- rb-x lt-x)) 2)) ) (<= (+ (square (- cx px)) (square (- cy py))) (square r)) ) ) ; test ; (define lt (make-point -1.0 1.0)) ; (define rb (make-point 1.0 -1.0)) ; (define (est-pi trials) (estimate-integral picked-in-range? lt rb trials)) ; (display (est-pi 1000))(newline) ; (display (est-pi 10000))(newline) ; (display (est-pi 100000))(newline)
false
0c49ffa6d1f45742b71927e22dbdbd6fe6090f31
defeada37d39bca09ef76f66f38683754c0a6aa0
/UnityEngine/unity-engine/constant-force.sls
7ec06c779ac9ec32c9b65abab8024e48f2457aec
[]
no_license
futsuki/ironscheme-port
2dbac82c0bda4f4ff509208f7f00a5211d1f7cd5
4e7a81b0fbeac9a47440464988e53fb118286c54
refs/heads/master
2016-09-06T17:13:11.462593
2015-09-26T18:20:40
2015-09-26T18:20:40
42,757,369
0
0
null
null
null
null
UTF-8
Scheme
false
false
1,374
sls
constant-force.sls
(library (unity-engine constant-force) (export new is? constant-force? force-get force-set! force-update! relative-force-get relative-force-set! relative-force-update! torque-get torque-set! torque-update! relative-torque-get relative-torque-set! relative-torque-update!) (import (ironscheme-clr-port)) (define-syntax new (lambda (e) (syntax-case e () ((_ a ...) #'(clr-new UnityEngine.ConstantForce a ...))))) (define (is? a) (clr-is UnityEngine.ConstantForce a)) (define (constant-force? a) (clr-is UnityEngine.ConstantForce a)) (define-field-port force-get force-set! force-update! (property:) UnityEngine.ConstantForce force UnityEngine.Vector3) (define-field-port relative-force-get relative-force-set! relative-force-update! (property:) UnityEngine.ConstantForce relativeForce UnityEngine.Vector3) (define-field-port torque-get torque-set! torque-update! (property:) UnityEngine.ConstantForce torque UnityEngine.Vector3) (define-field-port relative-torque-get relative-torque-set! relative-torque-update! (property:) UnityEngine.ConstantForce relativeTorque UnityEngine.Vector3))
true
5bd4fde9d9c8a87c976468d24dd0408da5fa8f86
defeada37d39bca09ef76f66f38683754c0a6aa0
/mscorlib/system/format-exception.sls
bbf0ec3825fb5e8a43800f5215cbd31db15b7fa8
[]
no_license
futsuki/ironscheme-port
2dbac82c0bda4f4ff509208f7f00a5211d1f7cd5
4e7a81b0fbeac9a47440464988e53fb118286c54
refs/heads/master
2016-09-06T17:13:11.462593
2015-09-26T18:20:40
2015-09-26T18:20:40
42,757,369
0
0
null
null
null
null
UTF-8
Scheme
false
false
351
sls
format-exception.sls
(library (system format-exception) (export new is? format-exception?) (import (ironscheme-clr-port)) (define-syntax new (lambda (e) (syntax-case e () ((_ a ...) #'(clr-new System.FormatException a ...))))) (define (is? a) (clr-is System.FormatException a)) (define (format-exception? a) (clr-is System.FormatException a)))
true
1e826204a8a4822bd4e08591f2bac386be2b055e
98fd12cbf428dda4c673987ff64ace5e558874c4
/paip/will/paip-1-transcript-2.scm
e8dbcd2aff82008cd5803e7e0c307e776022e755
[ "MIT", "Unlicense" ]
permissive
CompSciCabal/SMRTYPRTY
397645d909ff1c3d1517b44a1bb0173195b0616e
a8e2c5049199635fecce7b7f70a2225cda6558d8
refs/heads/master
2021-12-30T04:50:30.599471
2021-12-27T23:50:16
2021-12-27T23:50:16
13,666,108
66
11
Unlicense
2019-05-13T03:45:42
2013-10-18T01:26:44
Racket
UTF-8
Scheme
false
false
32,624
scm
paip-1-transcript-2.scm
Chez Scheme Version 9.5.3 Copyright 1984-2019 Cisco Systems, Inc. > (require "paip-1.scm") Exception: variable require is not bound Type (debug) to enter the debugger. > (load "paip-1.scm") > (run 1 (q) (+o (build-num 6) (build-num 7) q)) Exception: variable \x2B;o is not bound Type (debug) to enter the debugger. > +o Exception: variable \x2B;o is not bound Type (debug) to enter the debugger. > pluso #<procedure pluso at numbers.scm:1846> > (run 1 (q) (pluso (build-num 6) (build-num 7) q)) ((1 0 1 1)) > (run 1 (q) (pluso (build-num 6) (build-num 7) '(1 0 1 1))) (_.0) > (run* (x y) (pluso x y '(1 0 1 1))) (((1 0 1 1) ()) (() (1 0 1 1)) ((1) (0 0 1 1)) ((0 0 1 1) (1)) ((1 1) (0 1 0 1)) ((0 1) (1 1 0 1)) ((1 1 1) (0 1 1)) ((0 1 1) (1 1 1)) ((1 1 0 1) (0 1)) ((0 1 0 1) (1 1)) ((1 0 1) (0 0 0 1)) ((0 0 1) (1 0 0 1)) ((1 0 0 1) (0 0 1)) ((0 0 0 1) (1 0 1))) > (run 1 (q) (count-anywhereo '(x y) '((z x y) ((x y z) b) x y))) Exception: incorrect number of arguments to #<procedure count-anywhereo at paip-1.scm:458> Type (debug) to enter the debugger. > (load "paip-1.scm") > (run 1 (q) (count-anywhereo '(x y) '((z x y) ((x y z) b) x y) (build-num 2))) () > (run 1 (q) (count-anywhereo '(x y) '((z x y) ((x y z) b) x y) q)) C-c C-c break> r > (run 1 (q) (count-anywhereo '(x y) '((z x y) ((x y z) b) x y) q)) C-c C-c break> r > (load "paip-1.scm") > (run 1 (q) (count-anywhereo '(x y) '((z x y) ((x y z) b) x y) q)) () > (load "paip-1.scm") > (run 1 (q) (count-anywhereo '(x y) '((z x y) ((x y z) b) x y) q)) ((0 1)) > (run 1 (q) (count-anywhereo q '((z x y) ((x y z) b) x y) (build-num 2))) ((x y)) > (run 2 (q) (count-anywhereo q '((z x y) ((x y z) b) x y) (build-num 2))) ((x y) z) > (run 3 (q) (count-anywhereo q '((z x y) ((x y z) b) x y) (build-num 2))) ((x y) z (y)) > (run 4 (q) (count-anywhereo q '((z x y) ((x y z) b) x y) (build-num 2))) ((x y) z (y)) > (run* (q) (count-anywhereo q '((z x y) ((x y z) b) x y) (build-num 2))) ((x y) z (y)) > (run 1 (e1 e2) (count-anywhereo e1 e2 (build-num 3))) ((_.0 (_.0 _.0 . _.0))) > (run 100 (e1 e2) (count-anywhereo e1 e2 (build-num 3))) ((_.0 (_.0 _.0 . _.0)) ((_.0 (_.0 _.0 _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 _.0 () . _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 _.0 _.0 . #t)) (=/= ((_.0 #t)))) ((_.0 (_.0 _.0 _.0 . #f)) (=/= ((_.0 #f)))) ((_.0 (_.0 () _.0 . _.0)) (=/= ((_.0 ())))) ((_.0 (() _.0 _.0 . _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 _.0 _.0 . _.1)) (=/= ((_.0 _.1))) (sym _.1)) ((_.0 (_.0 _.0 #t . _.0)) (=/= ((_.0 #t)))) ((_.0 (_.0 _.0 _.0 . _.1)) (=/= ((_.0 _.1))) (num _.1)) ((_.0 (_.0 #t _.0 . _.0)) (=/= ((_.0 #t)))) ((_.0 (_.0 _.0 #f . _.0)) (=/= ((_.0 #f)))) (_.0 ((_.0 . _.0) . _.0)) ((_.0 (#t _.0 _.0 . _.0)) (=/= ((_.0 #t)))) ((_.0 (_.0 _.0 _.1 . _.0)) (=/= ((_.0 _.1))) (sym _.1)) ((_.0 (_.0 #f _.0 . _.0)) (=/= ((_.0 #f)))) ((_.0 (_.0 _.0 () _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 _.0 _.0 ())) (=/= ((_.0 (()))) ((_.0 ())))) ((_.0 (#f _.0 _.0 . _.0)) (=/= ((_.0 #f)))) ((_.0 (_.0 () _.0 _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 _.0 () () . _.0)) (=/= ((_.0 ())))) ((_.0 (() _.0 _.0 _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 _.0 _.0 () . #t)) (=/= ((_.0 (() . #t))) ((_.0 #t)) ((_.0 ())))) ((_.0 (_.0 _.0 () _.0 . #t)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (_.0 () _.0 () . _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 _.0 _.1 . _.0)) (=/= ((_.0 _.1))) (num _.1)) ((_.0 (_.0 _.0 _.0 () . #f)) (=/= ((_.0 (() . #f))) ((_.0 #f)) ((_.0 ())))) ((_.0 (_.0 () _.0 _.0 . #t)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (() _.0 _.0 () . _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 _.0 () _.0 . #f)) (=/= ((_.0 #f)) ((_.0 ())))) ((_.0 (_.0 _.1 _.0 . _.0)) (=/= ((_.0 _.1))) (sym _.1)) ((_.0 (() _.0 _.0 _.0 . #t)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (_.0 _.0 _.0 #t)) (=/= ((_.0 (#t))) ((_.0 #t)) ((_.0 ())))) ((_.0 (_.0 _.0 _.0 () . _.1)) (=/= ((_.0 (() . _.1))) ((_.0 _.1)) ((_.0 ()))) (sym _.1)) ((_.0 (_.0 () _.0 _.0 . #f)) (=/= ((_.0 #f)) ((_.0 ())))) ((_.0 (_.0 _.0 () _.0 . _.1)) (=/= ((_.0 _.1)) ((_.0 ()))) (sym _.1)) ((_.0 (_.0 () () _.0 . _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 _.0 () #t . _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (() _.0 _.0 _.0 . #f)) (=/= ((_.0 #f)) ((_.0 ())))) ((_.0 (_.0 _.0 #t _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (() _.0 () _.0 . _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 () _.0 _.0 . _.1)) (=/= ((_.0 _.1)) ((_.0 ()))) (sym _.1)) ((_.0 (_.0 _.0 _.0 () . _.1)) (=/= ((_.0 (() . _.1))) ((_.0 _.1)) ((_.0 ()))) (num _.1)) ((_.0 (_.0 () _.0 #t . _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (() () _.0 _.0 . _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 _.0 () _.0 . _.1)) (=/= ((_.0 _.1)) ((_.0 ()))) (num _.1)) ((_.0 (() _.0 _.0 _.0 . _.1)) (=/= ((_.0 _.1)) ((_.0 ()))) (sym _.1)) ((_.0 (_.0 _.0 _.0 #t . #t)) (=/= ((_.0 (#t . #t))) ((_.0 #t)))) ((_.0 (() _.0 _.0 #t . _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (_.0 #t _.0 _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (_.0 _.0 #t () . _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (_.1 _.0 _.0 . _.0)) (=/= ((_.0 _.1))) (sym _.1)) ((_.0 (_.0 () _.0 _.0 . _.1)) (=/= ((_.0 _.1)) ((_.0 ()))) (num _.1)) ((_.0 (_.0 _.0 #t _.0 . #t)) (=/= ((_.0 #t)))) ((_.0 (_.0 (_.0 . _.0))) (=/= ((_.0 ())))) ((_.0 (_.0 _.0 _.0 #t . #f)) (=/= ((_.0 (#t . #f))) ((_.0 #f)) ((_.0 #t)))) ((_.0 (() _.0 _.0 _.0 . _.1)) (=/= ((_.0 _.1)) ((_.0 ()))) (num _.1)) ((_.0 ((_.0 . _.0) _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 #t _.0 () . _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (#t _.0 _.0 _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (_.0 _.0 #t _.0 . #f)) (=/= ((_.0 #f)) ((_.0 #t)))) ((_.0 (_.0 _.0 () #f . _.0)) (=/= ((_.0 #f)) ((_.0 ())))) ((_.0 (_.0 _.0 _.0 #f)) (=/= ((_.0 (#f))) ((_.0 #f)) ((_.0 ())))) ((_.0 (_.0 #t _.0 _.0 . #t)) (=/= ((_.0 #t)))) ((_.0 (_.0 _.0 _.0 #t . _.1)) (=/= ((_.0 (#t . _.1))) ((_.0 #t)) ((_.0 _.1))) (sym _.1)) ((_.0 (_.0 (_.0 . _.0) . #t)) (=/= ((_.0 #t)))) ((_.0 (_.0 _.1 _.0 . _.0)) (=/= ((_.0 _.1))) (num _.1)) ((_.0 (_.0 () #t _.0 . _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (#t _.0 _.0 () . _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (_.0 (_.0) . _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 () _.0 #f . _.0)) (=/= ((_.0 #f)) ((_.0 ())))) ((_.0 ((_.0 . _.0) () . _.0)) (=/= ((_.0 ())))) ((_.0 (() _.0 #t _.0 . _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (_.0 _.0 #t _.0 . _.1)) (=/= ((_.0 #t)) ((_.0 _.1))) (sym _.1)) ((_.0 (_.0 _.0 #t #t . _.0)) (=/= ((_.0 #t)))) ((_.0 (#t _.0 _.0 _.0 . #t)) (=/= ((_.0 #t)))) ((_.0 (() _.0 _.0 #f . _.0)) (=/= ((_.0 #f)) ((_.0 ())))) ((_.0 (_.0 _.0 _.0 #t . _.1)) (=/= ((_.0 (#t . _.1))) ((_.0 #t)) ((_.0 _.1))) (num _.1)) ((_.0 (_.0 _.0 #f _.0)) (=/= ((_.0 #f)) ((_.0 ())))) ((_.0 (_.0 #t _.0 _.0 . #f)) (=/= ((_.0 #f)) ((_.0 #t)))) ((_.0 ((_.0 . _.0) _.0 . #t)) (=/= ((_.0 #t)))) ((_.0 (_.0 (_.0 . _.0) . #f)) (=/= ((_.0 #f)))) ((_.0 (_.0 #t () _.0 . _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (() (_.0 . _.0) . _.0)) (=/= ((_.0 ())))) ((_.0 (#t _.0 _.0 _.0 . #f)) (=/= ((_.0 #f)) ((_.0 #t)))) ((_.0 (_.0 _.0 _.0 #f . #t)) (=/= ((_.0 (#f . #t))) ((_.0 #f)) ((_.0 #t)))) ((_.0 (_.0 #t _.0 _.0 . _.1)) (=/= ((_.0 #t)) ((_.0 _.1))) (sym _.1)) ((_.0 (_.0 _.0 #t _.0 . _.1)) (=/= ((_.0 #t)) ((_.0 _.1))) (num _.1)) ((_.0 (#t _.0 () _.0 . _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 (_.0 (_.0 . _.0) . _.1)) (=/= ((_.0 _.1))) (sym _.1)) ((_.0 (_.0 #t _.0 #t . _.0)) (=/= ((_.0 #t)))) ((_.0 (() #t _.0 _.0 . _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 ((_.0 . _.0) _.0 . #f)) (=/= ((_.0 #f)))) ((_.0 (_.0 _.0 #f () . _.0)) (=/= ((_.0 #f)) ((_.0 ())))) ((_.0 (#t () _.0 _.0 . _.0)) (=/= ((_.0 #t)) ((_.0 ())))) ((_.0 ((_.0) _.0 . _.0)) (=/= ((_.0 ())))) ((_.0 (_.0 _.0 _.0 #f . #f)) (=/= ((_.0 (#f . #f))) ((_.0 #f)))) ((_.0 (_.0 #f _.0 _.0)) (=/= ((_.0 #f)) ((_.0 ())))) ((_.0 (#t _.0 _.0 _.0 . _.1)) (=/= ((_.0 #t)) ((_.0 _.1))) (sym _.1)) ((_.0 (_.0 _.0 #f _.0 . #t)) (=/= ((_.0 #f)) ((_.0 #t))))) > (run* (q) (count-anywhereo q '((z x y) ((x y z) b) x y) (build-num 2))) ((x y) z (y)) > Process scheme finished Chez Scheme Version 9.5.3 Copyright 1984-2019 Cisco Systems, Inc. > (random 100) 7 > Process scheme finished Chez Scheme Version 9.5.3 Copyright 1984-2019 Cisco Systems, Inc. > (load "paip-1.scm") > membero Exception: variable membero is not bound Type (debug) to enter the debugger. > (load "paip-1.scm") > (run 1 (q) (sentence q)) (((the man) (hit (the man)))) > (run 10 (q) (sentence q)) (((the man) (hit (the man))) ((the man) (hit (the ball))) ((the man) (hit (a man))) ((the man) (took (the man))) ((the ball) (hit (the man))) ((the man) (hit (the woman))) ((the man) (hit (a ball))) ((the man) (hit (the table))) ((the man) (hit (a woman))) ((the man) (took (the ball)))) > (run 100 (q) (sentence q)) (((the man) (hit (the man))) ((the man) (hit (the ball))) ((the man) (hit (a man))) ((the man) (took (the man))) ((the ball) (hit (the man))) ((the man) (hit (the woman))) ((the man) (hit (a ball))) ((the man) (hit (the table))) ((the man) (hit (a woman))) ((the man) (took (the ball))) ((the man) (hit (a table))) ((the ball) (hit (the ball))) ((the man) (took (a man))) ((the ball) (hit (a man))) ((the man) (saw (the man))) ((a man) (hit (the man))) ((the man) (took (the woman))) ((the man) (took (a ball))) ((the ball) (took (the man))) ((the man) (liked (the man))) ((the man) (took (the table))) ((the ball) (hit (the woman))) ((the man) (took (a woman))) ((the ball) (hit (a ball))) ((the man) (saw (the ball))) ((the man) (took (a table))) ((the man) (saw (a man))) ((the man) (liked (the ball))) ((the man) (liked (a man))) ((the man) (saw (the woman))) ((the man) (saw (a ball))) ((the ball) (hit (the table))) ((the ball) (hit (a woman))) ((the man) (liked (the woman))) ((the man) (liked (a ball))) ((the man) (saw (the table))) ((a man) (hit (the ball))) ((the man) (saw (a woman))) ((the ball) (took (the ball))) ((the man) (liked (the table))) ((the man) (liked (a woman))) ((a man) (hit (a man))) ((the man) (saw (a table))) ((the ball) (hit (a table))) ((the ball) (took (a man))) ((the man) (liked (a table))) ((the ball) (saw (the man))) ((a man) (took (the man))) ((the ball) (took (the woman))) ((the ball) (took (a ball))) ((the woman) (hit (the man))) ((a man) (hit (the woman))) ((the ball) (liked (the man))) ((a man) (hit (a ball))) ((the ball) (took (the table))) ((the ball) (took (a woman))) ((the ball) (saw (the ball))) ((the ball) (took (a table))) ((the ball) (saw (a man))) ((the ball) (liked (the ball))) ((the ball) (liked (a man))) ((a man) (hit (the table))) ((the ball) (saw (the woman))) ((a man) (hit (a woman))) ((the ball) (saw (a ball))) ((the ball) (liked (the woman))) ((the ball) (liked (a ball))) ((a man) (took (the ball))) ((the ball) (saw (the table))) ((the ball) (saw (a woman))) ((the woman) (hit (the ball))) ((a man) (hit (a table))) ((the ball) (liked (the table))) ((a man) (took (a man))) ((the ball) (liked (a woman))) ((the ball) (saw (a table))) ((the woman) (hit (a man))) ((the ball) (liked (a table))) ((a man) (saw (the man))) ((a ball) (hit (the man))) ((a man) (took (the woman))) ((the woman) (took (the man))) ((a man) (took (a ball))) ((a man) (liked (the man))) ((the woman) (hit (the woman))) ((a man) (took (the table))) ((a man) (took (a woman))) ((the woman) (hit (a ball))) ((a man) (saw (the ball))) ((a man) (took (a table))) ((a man) (saw (a man))) ((a man) (liked (the ball))) ((a man) (liked (a man))) ((a man) (saw (the woman))) ((the woman) (hit (the table))) ((a man) (saw (a ball))) ((the woman) (hit (a woman))) ((a man) (liked (the woman))) ((a man) (liked (a ball))) ((a man) (saw (the table)))) > Process scheme finished Chez Scheme Version 9.5.3 Copyright 1984-2019 Cisco Systems, Inc. > (load "paip-1.scm") > (run 100 (q) (sentence q)) (((the man) hit the man) ((the man) hit the ball) ((the man) hit a man) ((the man) took the man) ((the ball) hit the man) ((the man) hit the woman) ((the man) hit a ball) ((the man) hit the table) ((the man) hit a woman) ((the man) took the ball) ((the man) hit a table) ((the ball) hit the ball) ((the man) took a man) ((the ball) hit a man) ((the man) saw the man) ((a man) hit the man) ((the man) took the woman) ((the man) took a ball) ((the ball) took the man) ((the man) liked the man) ((the man) took the table) ((the ball) hit the woman) ((the man) took a woman) ((the ball) hit a ball) ((the man) saw the ball) ((the man) took a table) ((the man) saw a man) ((the man) liked the ball) ((the man) liked a man) ((the man) saw the woman) ((the man) saw a ball) ((the ball) hit the table) ((the ball) hit a woman) ((the man) liked the woman) ((the man) liked a ball) ((the man) saw the table) ((a man) hit the ball) ((the man) saw a woman) ((the ball) took the ball) ((the man) liked the table) ((the man) liked a woman) ((a man) hit a man) ((the man) saw a table) ((the ball) hit a table) ((the ball) took a man) ((the man) liked a table) ((the ball) saw the man) ((a man) took the man) ((the ball) took the woman) ((the ball) took a ball) ((the woman) hit the man) ((a man) hit the woman) ((the ball) liked the man) ((a man) hit a ball) ((the ball) took the table) ((the ball) took a woman) ((the ball) saw the ball) ((the ball) took a table) ((the ball) saw a man) ((the ball) liked the ball) ((the ball) liked a man) ((a man) hit the table) ((the ball) saw the woman) ((a man) hit a woman) ((the ball) saw a ball) ((the ball) liked the woman) ((the ball) liked a ball) ((a man) took the ball) ((the ball) saw the table) ((the ball) saw a woman) ((the woman) hit the ball) ((a man) hit a table) ((the ball) liked the table) ((a man) took a man) ((the ball) liked a woman) ((the ball) saw a table) ((the woman) hit a man) ((the ball) liked a table) ((a man) saw the man) ((a ball) hit the man) ((a man) took the woman) ((the woman) took the man) ((a man) took a ball) ((a man) liked the man) ((the woman) hit the woman) ((a man) took the table) ((a man) took a woman) ((the woman) hit a ball) ((a man) saw the ball) ((a man) took a table) ((a man) saw a man) ((a man) liked the ball) ((a man) liked a man) ((a man) saw the woman) ((the woman) hit the table) ((a man) saw a ball) ((the woman) hit a woman) ((a man) liked the woman) ((a man) liked a ball) ((a man) saw the table)) > Process scheme finished Chez Scheme Version 9.5.3 Copyright 1984-2019 Cisco Systems, Inc. > (load "paip-1.scm") > (run 100 (q) (sentence q)) ((the man hit the man) (the man hit the ball) (the man hit a man) (the man took the man) (the ball hit the man) (the man hit the woman) (the man hit a ball) (the man hit the table) (the man hit a woman) (the man took the ball) (the man hit a table) (the ball hit the ball) (the man took a man) (the ball hit a man) (the man saw the man) (a man hit the man) (the man took the woman) (the man took a ball) (the ball took the man) (the man liked the man) (the man took the table) (the ball hit the woman) (the man took a woman) (the ball hit a ball) (the man saw the ball) (the man took a table) (the man saw a man) (the man liked the ball) (the man liked a man) (the man saw the woman) (the man saw a ball) (the ball hit the table) (the ball hit a woman) (the man liked the woman) (the man liked a ball) (the man saw the table) (a man hit the ball) (the man saw a woman) (the ball took the ball) (the man liked the table) (the man liked a woman) (a man hit a man) (the man saw a table) (the ball hit a table) (the ball took a man) (the man liked a table) (the ball saw the man) (a man took the man) (the ball took the woman) (the ball took a ball) (the woman hit the man) (a man hit the woman) (the ball liked the man) (a man hit a ball) (the ball took the table) (the ball took a woman) (the ball saw the ball) (the ball took a table) (the ball saw a man) (the ball liked the ball) (the ball liked a man) (a man hit the table) (the ball saw the woman) (a man hit a woman) (the ball saw a ball) (the ball liked the woman) (the ball liked a ball) (a man took the ball) (the ball saw the table) (the ball saw a woman) (the woman hit the ball) (a man hit a table) (the ball liked the table) (a man took a man) (the ball liked a woman) (the ball saw a table) (the woman hit a man) (the ball liked a table) (a man saw the man) (a ball hit the man) (a man took the woman) (the woman took the man) (a man took a ball) (a man liked the man) (the woman hit the woman) (a man took the table) (a man took a woman) (the woman hit a ball) (a man saw the ball) (a man took a table) (a man saw a man) (a man liked the ball) (a man liked a man) (a man saw the woman) (the woman hit the table) (a man saw a ball) (the woman hit a woman) (a man liked the woman) (a man liked a ball) (a man saw the table)) > (run 1000 (q) (sentence q)) ((the man hit the man) (the man hit the ball) (the man hit a man) (the man took the man) (the ball hit the man) (the man hit the woman) (the man hit a ball) (the man hit the table) (the man hit a woman) (the man took the ball) (the man hit a table) (the ball hit the ball) (the man took a man) (the ball hit a man) (the man saw the man) (a man hit the man) (the man took the woman) (the man took a ball) (the ball took the man) (the man liked the man) (the man took the table) (the ball hit the woman) (the man took a woman) (the ball hit a ball) (the man saw the ball) (the man took a table) (the man saw a man) (the man liked the ball) (the man liked a man) (the man saw the woman) (the man saw a ball) (the ball hit the table) (the ball hit a woman) (the man liked the woman) (the man liked a ball) (the man saw the table) (a man hit the ball) (the man saw a woman) (the ball took the ball) (the man liked the table) (the man liked a woman) (a man hit a man) (the man saw a table) (the ball hit a table) (the ball took a man) (the man liked a table) (the ball saw the man) (a man took the man) (the ball took the woman) (the ball took a ball) (the woman hit the man) (a man hit the woman) (the ball liked the man) (a man hit a ball) (the ball took the table) (the ball took a woman) (the ball saw the ball) (the ball took a table) (the ball saw a man) (the ball liked the ball) (the ball liked a man) (a man hit the table) (the ball saw the woman) (a man hit a woman) (the ball saw a ball) (the ball liked the woman) (the ball liked a ball) (a man took the ball) (the ball saw the table) (the ball saw a woman) (the woman hit the ball) (a man hit a table) (the ball liked the table) (a man took a man) (the ball liked a woman) (the ball saw a table) (the woman hit a man) (the ball liked a table) (a man saw the man) (a ball hit the man) (a man took the woman) (the woman took the man) (a man took a ball) (a man liked the man) (the woman hit the woman) (a man took the table) (a man took a woman) (the woman hit a ball) (a man saw the ball) (a man took a table) (a man saw a man) (a man liked the ball) (a man liked a man) (a man saw the woman) (the woman hit the table) (a man saw a ball) (the woman hit a woman) (a man liked the woman) (a man liked a ball) (a man saw the table) (a ball hit the ball) (a man saw a woman) (the woman took the ball) (a man liked the table) (a ball hit a man) (a man liked a woman) (the woman hit a table) (a man saw a table) (the woman took a man) (a man liked a table) (the woman saw the man) (a ball took the man) (the woman took the woman) (the woman took a ball) (the table hit the man) (a ball hit the woman) (the woman liked the man) (a ball hit a ball) (the woman took the table) (the woman took a woman) (the woman saw the ball) (the woman took a table) (the woman saw a man) (the woman liked the ball) (the woman liked a man) (a ball hit the table) (the woman saw the woman) (a ball hit a woman) (the woman saw a ball) (the woman liked the woman) (the woman liked a ball) (a ball took the ball) (the woman saw the table) (the woman saw a woman) (the table hit the ball) (a ball hit a table) (the woman liked the table) (a ball took a man) (the woman liked a woman) (the woman saw a table) (the table hit a man) (the woman liked a table) (a ball saw the man) (a woman hit the man) (a ball took the woman) (the table took the man) (a ball took a ball) (a ball liked the man) (the table hit the woman) (a ball took the table) (a ball took a woman) (the table hit a ball) (a table hit the man) (a ball saw the ball) (a ball took a table) (a ball saw a man) (a ball liked the ball) (a ball liked a man) (a ball saw the woman) (the table hit the table) (a ball saw a ball) (the table hit a woman) (a ball liked the woman) (a ball liked a ball) (a ball saw the table) (a woman hit the ball) (a ball saw a woman) (the table took the ball) (a ball liked the table) (a woman hit a man) (a ball liked a woman) (the table hit a table) (a ball saw a table) (the table took a man) (a ball liked a table) (a table hit the ball) (the table saw the man) (a table hit a man) (a woman took the man) (the table took the woman) (the table took a ball) (a table took the man) (a woman hit the woman) (the table liked the man) (a woman hit a ball) (the table took the table) (the table took a woman) (a table hit the woman) (the table saw the ball) (a table hit a ball) (the table took a table) (the table saw a man) (the table liked the ball) (the table liked a man) (a woman hit the table) (the table saw the woman) (a woman hit a woman) (the table saw a ball) (a table hit the table) (the table liked the woman) (the table liked a ball) (a table hit a woman) (a woman took the ball) (the table saw the table) (the table saw a woman) (a woman hit a table) (the table liked the table) (a woman took a man) (a table took the ball) (the table liked a woman) (the table saw a table) (a table hit a table) (the table liked a table) (a table took a man) (a woman saw the man) (a table saw the man) (a woman took the woman) (a woman took a ball) (a table took the woman) (a table took a ball) (a woman liked the man) (a woman took the table) (a table liked the man) (a woman took a woman) (a table took the table) (a table took a woman) (a woman saw the ball) (a woman took a table) (a woman saw a man) (a table saw the ball) (a table took a table) (a table saw a man) (a woman liked the ball) (a woman liked a man) (a table liked the ball) (a woman saw the woman) (a table liked a man) (a woman saw a ball) (a table saw the woman) (a table saw a ball) (a woman liked the woman) (a woman liked a ball) (a table liked the woman) (a woman saw the table) (a table liked a ball) (a woman saw a woman) (a table saw the table) (a table saw a woman) (a woman liked the table) (a woman liked a woman) (a woman saw a table) (a table liked the table) (a table liked a woman) (a table saw a table) (a woman liked a table) (a table liked a table)) > (run 1 (q) (sentence q)) ((the man hit the man)) > (run 2 (q) (sentence q)) ((the man hit the man) (the man hit the ball)) > (run 10000 (q) (sentence q)) ((the man hit the man) (the man hit the ball) (the man hit a man) (the man took the man) (the ball hit the man) (the man hit the woman) (the man hit a ball) (the man hit the table) (the man hit a woman) (the man took the ball) (the man hit a table) (the ball hit the ball) (the man took a man) (the ball hit a man) (the man saw the man) (a man hit the man) (the man took the woman) (the man took a ball) (the ball took the man) (the man liked the man) (the man took the table) (the ball hit the woman) (the man took a woman) (the ball hit a ball) (the man saw the ball) (the man took a table) (the man saw a man) (the man liked the ball) (the man liked a man) (the man saw the woman) (the man saw a ball) (the ball hit the table) (the ball hit a woman) (the man liked the woman) (the man liked a ball) (the man saw the table) (a man hit the ball) (the man saw a woman) (the ball took the ball) (the man liked the table) (the man liked a woman) (a man hit a man) (the man saw a table) (the ball hit a table) (the ball took a man) (the man liked a table) (the ball saw the man) (a man took the man) (the ball took the woman) (the ball took a ball) (the woman hit the man) (a man hit the woman) (the ball liked the man) (a man hit a ball) (the ball took the table) (the ball took a woman) (the ball saw the ball) (the ball took a table) (the ball saw a man) (the ball liked the ball) (the ball liked a man) (a man hit the table) (the ball saw the woman) (a man hit a woman) (the ball saw a ball) (the ball liked the woman) (the ball liked a ball) (a man took the ball) (the ball saw the table) (the ball saw a woman) (the woman hit the ball) (a man hit a table) (the ball liked the table) (a man took a man) (the ball liked a woman) (the ball saw a table) (the woman hit a man) (the ball liked a table) (a man saw the man) (a ball hit the man) (a man took the woman) (the woman took the man) (a man took a ball) (a man liked the man) (the woman hit the woman) (a man took the table) (a man took a woman) (the woman hit a ball) (a man saw the ball) (a man took a table) (a man saw a man) (a man liked the ball) (a man liked a man) (a man saw the woman) (the woman hit the table) (a man saw a ball) (the woman hit a woman) (a man liked the woman) (a man liked a ball) (a man saw the table) (a ball hit the ball) (a man saw a woman) (the woman took the ball) (a man liked the table) (a ball hit a man) (a man liked a woman) (the woman hit a table) (a man saw a table) (the woman took a man) (a man liked a table) (the woman saw the man) (a ball took the man) (the woman took the woman) (the woman took a ball) (the table hit the man) (a ball hit the woman) (the woman liked the man) (a ball hit a ball) (the woman took the table) (the woman took a woman) (the woman saw the ball) (the woman took a table) (the woman saw a man) (the woman liked the ball) (the woman liked a man) (a ball hit the table) (the woman saw the woman) (a ball hit a woman) (the woman saw a ball) (the woman liked the woman) (the woman liked a ball) (a ball took the ball) (the woman saw the table) (the woman saw a woman) (the table hit the ball) (a ball hit a table) (the woman liked the table) (a ball took a man) (the woman liked a woman) (the woman saw a table) (the table hit a man) (the woman liked a table) (a ball saw the man) (a woman hit the man) (a ball took the woman) (the table took the man) (a ball took a ball) (a ball liked the man) (the table hit the woman) (a ball took the table) (a ball took a woman) (the table hit a ball) (a table hit the man) (a ball saw the ball) (a ball took a table) (a ball saw a man) (a ball liked the ball) (a ball liked a man) (a ball saw the woman) (the table hit the table) (a ball saw a ball) (the table hit a woman) (a ball liked the woman) (a ball liked a ball) (a ball saw the table) (a woman hit the ball) (a ball saw a woman) (the table took the ball) (a ball liked the table) (a woman hit a man) (a ball liked a woman) (the table hit a table) (a ball saw a table) (the table took a man) (a ball liked a table) (a table hit the ball) (the table saw the man) (a table hit a man) (a woman took the man) (the table took the woman) (the table took a ball) (a table took the man) (a woman hit the woman) (the table liked the man) (a woman hit a ball) (the table took the table) (the table took a woman) (a table hit the woman) (the table saw the ball) (a table hit a ball) (the table took a table) (the table saw a man) (the table liked the ball) (the table liked a man) (a woman hit the table) (the table saw the woman) (a woman hit a woman) (the table saw a ball) (a table hit the table) (the table liked the woman) (the table liked a ball) (a table hit a woman) (a woman took the ball) (the table saw the table) (the table saw a woman) (a woman hit a table) (the table liked the table) (a woman took a man) (a table took the ball) (the table liked a woman) (the table saw a table) (a table hit a table) (the table liked a table) (a table took a man) (a woman saw the man) (a table saw the man) (a woman took the woman) (a woman took a ball) (a table took the woman) (a table took a ball) (a woman liked the man) (a woman took the table) (a table liked the man) (a woman took a woman) (a table took the table) (a table took a woman) (a woman saw the ball) (a woman took a table) (a woman saw a man) (a table saw the ball) (a table took a table) (a table saw a man) (a woman liked the ball) (a woman liked a man) (a table liked the ball) (a woman saw the woman) (a table liked a man) (a woman saw a ball) (a table saw the woman) (a table saw a ball) (a woman liked the woman) (a woman liked a ball) (a table liked the woman) (a woman saw the table) (a table liked a ball) (a woman saw a woman) (a table saw the table) (a table saw a woman) (a woman liked the table) (a woman liked a woman) (a woman saw a table) (a table liked the table) (a table liked a woman) (a table saw a table) (a woman liked a table) (a table liked a table)) > (run 10000 (q) (sentence '(a woman liked a table))) (_.0) > (run 10000 (q) (sentence '(woman a liked a table))) () > (run 1 (x y) (sentence '(a ,x liked . ,y))) () > (run 1 (x y) (sentence `(a ,x liked . ,y))) ((man (the man))) > (run 10 (x y) (sentence `(a ,x liked . ,y))) ((man (the man)) (man (the ball)) (man (a man)) (man (the woman)) (man (a ball)) (man (the table)) (man (a woman)) (man (a table)) (ball (the man)) (ball (the ball))) > (run 1 (s) (fresh (x y z) (== `(,x ,y liked . ,z) s) (sentence s))) ((the man liked the man)) > (run 1 (s) (fresh (x y z) (== `(,x ,y liked . ,z) s) (absento 'man s) (sentence s))) ((the ball liked the ball)) > (run 1 (s) (fresh (x y z) (== `(,x ,y liked . ,z) s) (absento 'man s) (absento 'ball s) (sentence s))) ((the woman liked the woman)) > (run 1 (s) (fresh (np anything) (== `(,np . ,anything) s) (noun-phrase np) (sentence s))) () > (load "paip-1.scm") > (run 1 (adj*) (Adj* adj*)) (()) > (run 2 (adj*) (Adj* adj*)) (()) > (run 1 (adj) (Adj adj)) (big) > (run 2 (adj*) (Adj* adj*)) (() (big)) > (run 100 (adj*) (Adj* adj*)) (() (big) (little) (big big) (green) (big little) (little big) (big big big) (blue) (big green) (little little) (big big little) (green big) (big little big) (little big big) (big big big big) (adiabatic) (big blue) (little green) (big big green) (green little) (big little little) (little big little) (big big big little) (blue big) (big green big) (little little big) (big big little big) (green big big) (big little big big) (little big big big) (big big big big big) (adiabatic big) (big adiabatic) (little blue) (big big blue) (green green) (big little green) (little big green) (big big big green) (blue little) (big green little) (little little little) (big big little little) (green big little) (big little big little) (little big big little) (big big big big little) (big blue big) (adiabatic little) (little green big) (big big green big) (green little big) (big little little big) (little big little big) (big big big little big) (blue big big) (big green big big) (little little big big) (big big little big big) (green big big big) (big little big big big) (little big big big big) (big big big big big big) (adiabatic big big) (big adiabatic big) (little adiabatic) (big big adiabatic) (green blue) (big little blue) (little big blue) (big big big blue) (blue green) (big green green) (little little green) (big big little green) (green big green) (big little big green) (little big big green) (big big big big green) (big blue little) (adiabatic green) (little green little) (big big green little) (green little little) (big little little little) (little big little little) (big big big little little) (blue big little) (big green big little) (little little big little) (big big little big little) (green big big little) (big little big big little) (little big big big little) (big big big big big little) (adiabatic big little) (little blue big) (big big blue big) (green green big)) >
false
057652c44e8b1c7ccb771bf77da0350e47117024
2e50e13dddf57917018ab042f3410a4256b02dcf
/contrib/20.r7rs/scheme/process-context.scm
b19d9fb76c182e9ce91b537b9780651d8a75e42f
[ "MIT" ]
permissive
koba-e964/picrin
c0ca2596b98a96bcad4da9ec77cf52ce04870482
0f17caae6c112de763f4e18c0aebaa73a958d4f6
refs/heads/master
2021-01-22T12:44:29.137052
2016-07-10T16:12:36
2016-07-10T16:12:36
17,021,900
0
0
MIT
2019-05-17T03:46:41
2014-02-20T13:55:33
Scheme
UTF-8
Scheme
false
false
203
scm
process-context.scm
(define-library (scheme process-context) (import (picrin base)) (export command-line emergency-exit exit get-environment-variable get-environment-variables))
false
88cd1a66e15e8ebfffc78896b89cf69b83b258c8
000dbfe5d1df2f18e29a76ea7e2a9556cff5e866
/ext/crypto/tests/testvectors/signature/rsa_pss_misc_test.scm
d31ebffe175899eb9bf1aea162d8daa840ecfa99
[ "BSD-3-Clause", "LicenseRef-scancode-other-permissive", "MIT", "BSD-2-Clause" ]
permissive
ktakashi/sagittarius-scheme
0a6d23a9004e8775792ebe27a395366457daba81
285e84f7c48b65d6594ff4fbbe47a1b499c9fec0
refs/heads/master
2023-09-01T23:45:52.702741
2023-08-31T10:36:08
2023-08-31T10:36:08
41,153,733
48
7
NOASSERTION
2022-07-13T18:04:42
2015-08-21T12:07:54
Scheme
UTF-8
Scheme
false
false
334,023
scm
rsa_pss_misc_test.scm
(test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 0 :der-encode #t :tests '(#(1 "" #vu8(49 50 51 52 48 48) #vu8(136 244 103 107 80 46 54 93 253 130 128 90 193 219 39 209 16 125 21 22 67 26 180 247 17 7 182 38 37 182 39 90 244 165 219 253 131 20 250 226 85 130 12 12 181 119 238 36 87 245 16 133 29 38 120 228 237 62 104 57 132 138 202 139 103 201 206 82 197 191 87 160 27 102 131 130 141 3 71 0 52 177 54 230 171 25 20 173 187 29 145 143 220 49 247 206 246 244 75 11 11 160 219 214 193 211 200 215 105 156 227 116 220 134 194 139 235 59 238 143 129 244 17 98 52 78 104 138 240 217 18 151 218 13 213 232 16 74 84 64 173 216 155 220 108 5 210 10 22 76 15 7 155 120 101 79 3 141 68 55 67 249 75 196 87 98 80 16 52 163 43 93 5 187 134 231 93 217 161 113 200 29 190 67 237 245 11 46 31 194 66 151 55 83 49 215 138 143 3 153 212 174 187 238 237 145 31 109 150 64 73 230 125 137 238 192 233 84 67 175 44 235 55 18 94 168 67 28 186 210 216 65 111 193 95 185 203 237 145 66 251 140 176 109 199 206 175 172 5 108 193 246 105 110 61 147) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 20 :der-encode #t :tests '(#(2 "" #vu8(49 50 51 52 48 48) #vu8(168 95 6 135 91 82 156 166 27 96 223 64 70 82 231 154 73 159 129 160 89 27 175 163 55 123 128 216 227 0 203 174 103 154 148 24 50 235 85 105 251 136 201 248 98 158 60 46 191 95 50 255 228 55 103 209 234 245 144 22 245 144 77 227 247 211 156 180 112 223 197 251 86 120 252 215 181 93 26 48 247 22 183 240 76 37 104 243 193 162 188 120 14 151 74 54 58 220 98 46 103 153 2 233 102 175 24 61 135 75 53 57 100 35 209 162 99 187 28 110 115 48 23 150 113 100 76 105 83 205 121 90 25 226 254 66 8 231 218 82 68 228 118 13 222 20 35 19 167 129 165 91 11 175 134 109 193 88 129 42 114 61 116 145 28 135 23 165 18 215 34 102 145 147 248 136 59 28 255 172 152 222 132 115 183 167 113 152 226 5 96 192 194 18 7 224 15 199 221 20 56 95 171 221 83 13 86 141 20 61 219 238 141 27 80 47 123 25 75 152 39 238 233 71 47 43 232 178 165 65 18 68 5 88 43 255 57 52 18 246 171 169 196 46 88 36 215 194 75 221 77 130 217 37 208 102) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 28 :der-encode #t :tests '(#(3 "" #vu8(49 50 51 52 48 48) #vu8(129 137 119 96 21 219 58 81 128 95 107 247 26 161 33 78 224 127 126 56 85 16 234 149 160 212 195 213 59 192 213 159 7 202 57 175 64 254 140 49 56 207 111 75 160 247 42 51 151 223 111 253 169 207 73 228 103 163 77 146 236 119 47 107 109 81 213 44 239 134 209 111 116 190 167 152 168 90 172 135 60 212 213 211 160 251 187 97 137 152 244 178 182 145 188 20 254 31 35 86 1 197 26 118 196 234 205 26 51 151 93 156 60 223 29 175 87 159 185 67 85 111 15 235 217 72 209 177 225 92 200 94 223 72 107 0 73 159 169 3 43 107 128 27 90 228 69 76 148 215 248 157 193 250 109 214 169 39 150 155 20 164 189 245 28 175 124 200 168 122 224 93 65 225 147 56 73 172 197 252 176 244 120 241 226 58 15 71 99 114 131 122 222 130 248 237 24 9 226 36 80 98 0 155 142 104 63 86 48 41 221 185 137 42 57 141 188 45 245 148 193 47 180 160 240 197 81 171 223 47 238 76 179 37 254 152 0 234 116 31 123 47 43 77 179 112 147 155 199 227 234 149 171 83 155 16) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 32 :der-encode #t :tests '(#(4 "" #vu8(49 50 51 52 48 48) #vu8(73 224 96 204 181 119 235 97 66 116 219 26 211 66 73 73 13 28 171 43 141 58 226 183 8 185 60 138 142 173 48 46 110 251 141 38 100 77 92 170 95 98 184 159 57 73 148 45 7 71 12 55 216 135 142 181 204 156 21 71 1 254 234 54 172 102 208 169 114 63 179 22 247 173 98 38 246 52 52 108 23 239 71 179 225 156 123 153 121 214 1 24 149 154 91 53 204 24 130 0 200 249 178 114 48 70 244 128 217 90 154 10 240 126 100 130 37 220 53 17 77 129 153 164 49 204 244 244 79 232 232 201 192 19 10 168 25 174 236 176 159 149 238 168 246 216 153 129 192 92 200 39 22 254 126 164 153 197 84 96 201 94 153 135 26 186 26 211 172 59 219 201 104 80 134 59 35 227 230 101 156 163 70 238 14 24 106 215 23 168 236 156 122 84 141 143 237 14 123 121 248 150 114 38 89 236 126 19 53 222 18 243 97 213 230 198 92 121 20 65 195 192 2 13 228 142 96 242 0 195 171 121 254 1 121 81 59 44 21 146 226 240 6 75 164 121 159 106 14 234 25 157 167 125 23 74) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 48 :der-encode #t :tests '(#(5 "" #vu8(49 50 51 52 48 48) #vu8(45 66 22 242 119 229 7 54 212 28 218 33 145 250 169 127 169 157 158 50 91 52 146 106 54 63 141 215 60 144 17 83 240 135 172 32 108 243 203 37 0 29 255 187 98 0 183 179 85 101 180 102 244 111 35 170 251 135 46 92 57 210 97 86 211 109 27 171 25 56 46 95 21 135 48 34 230 75 88 193 41 211 142 238 129 38 19 15 98 16 250 95 251 105 123 179 220 221 189 153 169 182 11 83 178 93 9 79 158 201 183 161 205 205 12 199 74 58 196 120 199 163 76 194 44 126 48 233 82 191 172 133 99 134 120 184 170 35 65 251 31 16 129 20 212 61 200 73 217 26 59 23 75 13 214 47 109 251 150 69 157 76 118 171 95 182 71 157 104 214 144 212 165 193 32 196 42 75 248 42 138 126 158 122 186 18 127 213 253 163 244 198 255 191 46 78 235 114 238 105 92 254 178 134 236 153 231 206 232 207 48 14 78 20 156 241 126 112 207 159 43 219 100 33 8 121 22 233 69 188 164 42 112 168 139 26 135 231 202 58 192 161 191 42 177 166 94 186 183 114 105 148 166 201 89 126) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 64 :der-encode #t :tests '(#(6 "" #vu8(49 50 51 52 48 48) #vu8(182 98 148 247 177 225 166 115 229 102 197 159 154 191 38 72 96 32 7 99 134 12 189 102 110 71 109 187 214 31 195 145 54 53 58 183 66 153 203 251 100 191 248 142 213 28 249 162 6 148 232 50 253 151 35 93 49 236 106 239 56 106 212 68 135 211 117 60 193 34 77 189 89 163 75 171 195 235 139 83 140 16 112 87 117 162 127 168 138 227 92 15 97 142 11 60 107 145 217 153 253 236 91 134 241 93 30 70 47 238 163 175 111 161 42 82 52 213 38 232 32 57 225 223 1 62 241 204 96 86 34 27 129 215 85 161 59 112 198 24 206 252 109 237 204 51 97 181 169 16 252 212 168 18 174 72 56 47 221 215 93 91 81 202 61 36 61 172 2 26 238 175 110 43 212 174 215 93 127 246 216 28 154 174 226 53 110 61 18 25 43 94 117 208 6 177 36 39 91 13 174 192 107 90 242 155 13 62 133 240 87 219 89 219 75 136 127 221 43 208 163 56 101 235 135 232 243 227 123 77 134 33 226 228 28 118 10 151 63 27 160 55 34 212 43 245 185 33 56 11 113 254 169 73 207 11) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 0 :der-encode #t :tests '(#(7 "" #vu8(49 50 51 52 48 48) #vu8(81 61 176 102 188 114 137 54 83 209 247 250 63 25 84 98 129 182 35 155 200 57 12 73 132 153 145 33 161 221 117 170 148 0 76 56 116 190 182 50 114 5 242 236 248 246 235 147 234 176 24 222 58 108 113 234 139 45 58 98 129 136 212 170 43 28 214 186 177 105 243 231 130 41 228 56 58 182 138 234 70 53 147 94 14 171 190 157 193 214 113 65 105 69 241 134 119 130 144 13 165 52 81 54 156 203 213 72 200 247 86 231 34 30 231 225 255 40 219 160 153 184 242 141 31 58 173 46 248 189 129 106 83 223 169 188 136 228 227 152 59 13 233 85 230 71 202 247 26 96 127 254 162 10 150 119 230 135 205 218 41 33 156 125 170 131 146 118 222 63 228 54 185 107 44 104 219 100 193 112 171 158 48 12 237 0 231 42 156 15 220 50 26 81 122 161 19 205 236 142 39 19 248 181 78 226 215 136 32 246 248 107 47 110 98 34 73 61 21 203 232 238 152 21 239 46 124 169 166 206 181 89 85 4 157 179 91 26 241 136 185 159 44 75 206 56 241 48 167 87 128 244 27 133 41 23) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 20 :der-encode #t :tests '(#(8 "" #vu8(49 50 51 52 48 48) #vu8(179 233 67 243 152 42 41 208 193 226 65 137 14 189 217 231 52 186 248 91 211 45 232 12 98 64 227 77 209 247 240 202 79 55 255 242 195 115 249 113 142 126 144 13 242 36 209 85 196 70 60 102 186 220 143 195 86 63 54 48 149 104 67 107 203 239 29 131 198 62 57 61 158 20 50 213 5 65 212 94 84 183 175 27 24 204 129 157 158 170 166 90 75 30 79 55 174 22 236 117 233 244 74 7 38 44 243 226 218 184 90 6 109 146 183 80 186 28 210 161 212 36 147 134 129 35 241 128 23 189 159 175 29 225 164 248 122 63 156 247 68 218 30 175 199 97 183 226 76 153 41 211 223 209 93 27 8 219 30 63 198 73 50 129 96 149 206 164 149 224 219 184 40 66 181 243 202 144 220 123 120 137 92 31 18 186 153 31 59 239 111 22 69 26 132 136 15 163 28 223 218 107 150 36 167 122 58 4 137 252 253 246 224 123 137 192 104 155 91 123 112 82 55 42 43 30 6 163 69 123 2 114 133 195 177 96 192 222 29 186 73 16 192 22 42 232 231 55 163 215 221 30 5 199 122 206) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 28 :der-encode #t :tests '(#(9 "" #vu8(49 50 51 52 48 48) #vu8(169 185 238 248 25 124 151 61 106 115 189 193 101 244 15 15 83 176 88 72 201 57 87 174 194 120 95 169 42 156 198 57 116 24 167 24 112 241 187 194 26 57 178 68 82 107 74 57 165 56 209 73 205 230 43 248 242 31 62 171 202 147 39 81 218 131 18 1 54 196 128 115 121 44 85 226 239 244 226 158 105 115 205 63 16 144 197 191 60 237 2 161 186 76 20 90 221 198 116 211 59 10 40 93 115 209 75 205 111 55 79 96 201 92 65 132 226 213 115 136 233 199 63 105 122 192 175 81 22 221 191 80 129 168 249 154 206 17 2 120 53 203 61 248 174 120 84 145 244 40 80 222 4 179 224 27 147 23 189 4 237 72 138 215 46 120 124 114 139 69 22 199 216 57 211 136 162 253 123 33 153 79 243 245 183 242 100 65 59 237 211 216 165 37 141 43 57 230 4 17 222 30 230 159 224 95 78 118 178 58 159 80 180 159 112 67 249 129 42 235 129 205 84 204 29 217 255 220 110 115 88 14 44 174 130 21 121 186 54 66 255 119 147 163 153 91 19 110 5 125 45 44 167 174 250 228) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 32 :der-encode #t :tests '(#(10 "" #vu8(49 50 51 52 48 48) #vu8(137 154 73 171 21 17 190 248 114 125 30 215 9 59 247 230 167 127 168 117 13 4 123 32 55 64 50 77 24 252 69 181 135 211 57 43 183 171 190 126 107 237 123 242 190 47 165 227 85 248 172 84 82 230 117 2 125 190 193 131 85 85 208 89 164 236 68 18 15 73 158 73 81 204 63 171 51 211 232 21 74 67 64 210 156 105 251 80 114 140 96 234 165 141 97 183 92 254 126 250 219 255 85 252 14 223 251 74 249 113 156 209 163 178 162 64 147 110 182 194 173 112 177 11 114 170 183 230 77 159 177 123 168 250 219 111 79 0 54 188 34 213 119 151 5 176 45 38 27 140 155 231 0 182 92 6 108 39 190 2 219 53 63 78 188 171 28 203 65 196 187 207 239 57 171 250 137 153 25 105 81 32 149 88 70 58 171 28 109 73 23 174 151 0 97 153 218 175 150 54 102 216 92 19 56 23 3 95 54 234 50 23 20 166 178 13 173 179 85 162 38 37 127 192 171 255 16 201 175 172 85 27 183 195 186 158 68 115 127 69 173 79 155 127 45 176 2 175 183 173 97 205 160 217 101 56) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 48 :der-encode #t :tests '(#(11 "" #vu8(49 50 51 52 48 48) #vu8(169 202 220 156 244 20 0 234 42 145 232 110 246 224 113 95 229 102 157 214 168 250 58 165 0 54 229 33 224 201 57 173 149 48 209 94 82 177 4 4 206 220 197 64 94 113 120 160 68 77 12 93 32 207 228 175 16 243 192 124 16 239 9 21 208 94 2 198 46 93 8 116 194 239 55 212 23 102 85 246 63 154 157 188 45 161 86 28 9 201 149 88 28 200 17 181 215 98 30 132 190 221 117 70 211 70 167 160 176 166 93 127 56 241 1 178 67 3 218 11 2 54 167 199 143 64 38 204 32 187 50 220 247 156 236 127 154 136 102 29 205 82 213 178 9 188 161 145 245 198 7 232 216 225 149 125 119 158 93 253 237 254 196 155 194 222 252 15 249 33 213 247 232 117 229 223 70 240 104 122 5 240 59 91 165 238 107 192 252 175 141 103 89 42 150 192 171 178 249 169 150 22 149 82 34 221 30 135 236 154 235 75 22 10 181 174 150 175 200 122 101 181 34 198 191 77 129 51 144 29 195 169 250 99 172 247 73 202 6 208 14 10 143 171 57 169 57 57 108 220 112 245 43 152 99 162) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 64 :der-encode #t :tests '(#(12 "" #vu8(49 50 51 52 48 48) #vu8(128 114 133 220 106 234 176 165 170 10 118 103 133 105 147 40 139 155 172 149 68 19 106 87 87 198 59 35 113 89 68 223 59 155 119 149 62 241 219 41 111 242 109 135 255 61 254 81 78 65 93 159 17 143 208 158 122 197 24 249 130 115 107 204 8 181 88 3 140 119 29 209 193 211 180 61 249 34 221 218 87 144 108 181 230 245 163 237 103 112 97 120 127 250 232 235 30 226 222 65 181 229 143 90 1 43 73 147 122 248 215 212 74 181 244 201 53 183 55 100 251 70 218 170 52 108 84 16 156 34 78 22 249 197 61 59 196 207 242 18 15 195 224 144 121 132 5 47 158 51 220 29 210 74 23 27 32 42 82 205 239 225 62 147 202 177 69 65 101 105 181 166 167 242 159 155 123 54 191 186 196 25 89 144 61 118 91 201 28 60 16 182 69 252 233 233 137 59 161 227 50 93 247 100 191 78 240 248 235 59 58 32 112 29 142 65 122 134 217 184 89 242 163 24 166 106 185 35 164 159 194 90 81 25 0 161 73 232 145 35 180 136 228 77 143 119 171 233 231 254 229 98 134 215 178 35) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 0 :der-encode #t :tests '(#(13 "" #vu8(49 50 51 52 48 48) #vu8(144 49 192 99 16 53 66 129 117 66 254 252 233 227 10 114 233 241 75 233 78 242 183 161 223 43 167 33 169 164 239 227 20 118 104 74 73 30 72 73 238 135 32 193 244 156 223 151 85 213 73 182 63 204 14 120 175 131 83 188 180 37 117 171 249 45 224 106 48 129 66 242 18 172 152 125 66 213 246 34 184 120 28 108 33 93 55 96 170 76 168 68 27 179 244 88 125 166 167 70 62 169 66 90 69 135 107 4 112 32 35 21 236 24 129 219 212 241 191 164 8 1 223 184 137 133 97 166 206 111 136 105 141 171 73 116 66 241 239 131 177 211 84 12 195 176 175 19 157 94 18 90 136 100 111 13 203 174 5 63 106 143 194 154 47 8 62 129 214 16 130 129 33 33 195 229 156 48 114 167 109 75 168 48 212 51 17 5 53 86 147 245 97 173 218 26 216 39 140 224 225 14 195 247 165 202 36 227 29 131 158 72 35 198 131 225 77 117 247 100 135 44 34 103 98 63 170 204 161 112 127 64 56 73 69 87 223 132 205 195 253 79 147 228 161 52 233 181 62 126 128 236 29 96 85 106) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 20 :der-encode #t :tests '(#(14 "" #vu8(49 50 51 52 48 48) #vu8(157 216 133 91 10 191 233 133 152 147 118 41 219 68 85 197 97 176 116 210 112 20 109 106 248 55 199 9 223 118 212 47 243 224 213 15 4 247 233 179 196 50 68 228 168 147 240 210 45 84 197 139 18 27 120 221 96 77 25 3 201 97 9 243 114 172 145 98 189 14 65 136 153 45 155 137 87 250 8 173 151 35 117 130 153 239 112 18 95 145 109 160 124 212 166 150 161 99 64 215 87 94 79 230 213 115 101 194 228 174 193 165 70 90 46 188 122 74 123 61 131 216 57 95 204 54 161 30 131 55 135 132 119 49 42 127 180 171 129 183 12 171 36 255 152 86 85 89 132 103 6 164 47 44 7 165 85 233 47 134 190 137 215 112 74 83 41 251 134 55 183 98 17 18 16 159 66 228 156 245 249 160 89 167 34 94 37 135 172 65 182 153 160 178 127 212 119 224 177 220 175 142 232 130 145 214 47 65 105 41 41 184 117 19 165 216 230 147 82 207 110 48 49 244 37 67 203 217 216 68 43 227 194 141 202 30 248 169 183 229 27 160 137 235 105 31 96 84 206 197 90 142 119 1 88 223) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 28 :der-encode #t :tests '(#(15 "" #vu8(49 50 51 52 48 48) #vu8(166 30 227 0 186 14 232 188 173 53 84 165 73 74 13 218 202 238 184 242 224 212 199 19 131 162 104 79 33 162 96 223 107 72 215 18 215 20 95 98 70 140 210 14 61 199 9 80 216 154 125 142 150 41 97 25 110 83 221 199 241 218 83 118 103 50 225 147 167 225 139 8 171 60 113 195 84 122 197 166 64 205 185 221 58 45 205 134 109 139 55 213 117 73 177 122 133 177 169 114 113 222 184 81 83 36 174 48 120 47 172 162 157 174 85 213 0 48 180 213 238 205 170 101 176 53 192 72 163 47 1 1 138 134 90 154 177 57 43 71 115 70 85 77 219 64 61 188 3 253 131 75 114 149 96 135 182 35 205 182 212 173 136 105 133 87 110 247 93 24 109 120 213 7 136 238 235 112 160 198 82 89 242 45 93 251 93 8 169 200 109 96 85 135 75 78 56 103 31 198 74 54 8 59 52 224 245 204 81 194 106 216 118 72 76 71 173 127 142 122 82 78 150 127 88 127 176 173 166 170 28 6 234 219 10 20 153 35 145 37 101 242 80 49 249 197 231 33 236 182 143 242 101 62 35 232) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 32 :der-encode #t :tests '(#(16 "" #vu8(49 50 51 52 48 48) #vu8(48 56 144 81 233 158 4 192 107 94 146 119 62 190 133 254 20 50 221 200 104 21 51 55 167 223 31 66 155 148 28 119 144 73 33 154 37 219 38 199 238 47 24 156 74 155 113 230 144 49 127 173 34 23 75 69 133 122 125 238 102 102 60 205 96 141 78 227 218 28 38 240 240 206 30 135 121 123 222 206 253 29 121 76 120 42 124 172 50 42 211 129 121 170 254 61 244 203 129 88 133 195 145 182 38 82 68 180 90 124 135 13 24 54 191 54 30 237 175 248 153 92 168 130 112 159 233 179 43 192 140 214 36 109 116 68 22 153 187 48 70 43 157 249 247 79 181 151 180 217 83 174 58 74 127 6 13 70 69 135 204 189 167 144 150 223 56 221 249 177 10 104 204 225 29 83 4 214 72 186 60 94 142 17 16 151 165 79 42 254 31 100 238 238 192 219 48 59 95 159 136 99 195 0 195 58 73 96 160 102 75 89 241 128 22 212 130 101 236 36 198 240 187 46 100 65 38 46 110 167 175 200 11 165 57 158 133 15 203 55 205 227 23 95 99 56 61 162 114 241 246 146 205 115 44 162) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 48 :der-encode #t :tests '(#(17 "" #vu8(49 50 51 52 48 48) #vu8(45 255 38 208 123 210 227 222 32 200 182 250 82 126 159 161 106 238 156 191 160 208 28 215 26 6 100 114 123 203 80 93 5 24 49 72 86 196 60 96 45 224 252 70 71 190 127 73 106 186 239 193 199 102 252 68 246 87 46 226 182 174 63 167 212 242 60 130 112 61 21 204 249 126 46 141 250 10 21 163 243 246 57 162 240 51 145 14 192 68 148 251 36 112 236 26 108 215 251 179 72 21 63 98 118 110 47 132 193 84 44 126 50 212 214 13 36 237 165 178 109 81 63 73 191 81 122 165 110 67 208 92 139 18 242 222 147 195 111 86 188 135 247 134 219 234 66 251 150 12 180 66 55 82 251 74 129 30 202 57 109 5 82 196 243 109 214 146 226 239 85 23 120 169 222 120 67 252 243 127 118 126 61 63 99 177 57 165 170 64 216 113 61 252 56 42 83 41 180 249 12 228 48 120 204 203 106 3 241 136 22 239 59 5 48 6 96 60 236 105 75 214 232 53 44 11 84 92 67 98 19 172 94 76 244 43 42 58 187 85 54 182 142 192 91 60 218 225 51 199 16 93 244 97 244 220) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 64 :der-encode #t :tests '(#(18 "" #vu8(49 50 51 52 48 48) #vu8(84 90 69 178 34 134 138 193 191 236 117 244 140 82 178 173 220 15 86 74 126 213 78 167 194 128 90 70 64 203 84 237 197 142 11 109 173 26 170 107 98 158 46 180 193 197 109 83 206 224 14 97 186 85 150 164 41 228 105 223 85 229 150 79 191 140 230 225 243 106 198 173 196 170 182 102 63 21 47 202 9 114 156 49 68 73 67 30 150 55 11 81 167 98 97 237 55 255 38 78 244 220 152 145 164 31 134 110 83 249 134 23 228 150 233 43 190 231 92 210 101 25 83 175 214 92 230 210 96 159 73 203 32 24 114 204 198 184 217 184 83 228 66 191 110 32 124 57 77 174 61 24 11 215 18 100 85 254 139 192 138 156 141 121 169 122 48 8 132 184 142 30 41 121 173 23 209 89 104 232 12 123 110 174 191 203 239 72 143 212 96 79 36 104 95 200 101 133 96 218 56 30 168 39 217 108 120 187 23 217 229 208 156 45 55 214 18 117 251 204 51 61 170 230 204 60 53 164 95 127 141 27 134 149 134 7 94 245 249 15 96 166 233 86 63 49 190 78 230 245 76 27 252 248 80 121) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 0 :der-encode #t :tests '(#(19 "" #vu8(49 50 51 52 48 48) #vu8(64 175 46 49 73 153 111 43 176 85 220 214 234 62 63 186 45 87 190 100 36 226 6 194 19 171 229 182 179 172 124 239 240 73 1 138 188 134 65 24 217 12 80 40 133 125 115 219 103 185 78 96 32 140 67 4 246 20 18 188 133 110 231 110 57 142 33 29 92 73 39 20 92 62 230 26 225 1 236 7 30 67 190 155 241 126 45 224 60 173 134 31 70 17 147 239 237 121 80 121 78 172 238 238 179 79 73 68 224 190 223 24 83 18 53 87 222 172 3 69 120 17 39 12 121 37 208 197 14 171 43 109 190 0 5 66 252 211 221 229 204 133 99 236 171 106 206 133 191 28 83 94 237 123 214 125 176 88 75 212 233 17 252 211 255 92 64 89 254 83 222 167 179 130 249 83 164 144 93 72 26 243 155 234 230 142 65 141 42 76 13 117 237 89 73 218 193 50 126 236 91 217 208 253 196 189 158 198 127 56 242 167 74 77 56 240 118 13 62 25 235 157 198 124 150 251 212 63 26 168 49 122 172 98 120 23 56 80 74 60 13 250 92 34 136 203 249 164 18 187 245 0 37 203 70 48) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 20 :der-encode #t :tests '(#(20 "" #vu8(49 50 51 52 48 48) #vu8(167 174 34 71 62 143 172 165 96 43 159 141 212 233 162 53 175 60 115 76 188 210 103 79 25 217 35 78 238 7 112 104 178 246 91 62 216 132 225 250 190 247 134 165 89 228 88 225 251 98 153 12 84 63 152 126 9 237 72 43 171 105 156 194 253 187 25 57 116 82 174 60 8 12 49 91 101 198 27 160 210 8 140 119 106 196 83 61 63 135 126 157 155 213 141 171 220 155 85 123 90 44 226 233 14 106 132 118 253 204 14 132 188 45 134 30 194 224 155 7 142 74 228 243 42 12 112 50 248 111 154 14 6 74 113 25 153 250 77 222 37 237 40 65 216 116 177 114 246 253 98 28 50 132 19 212 191 251 63 109 141 231 241 163 41 200 22 112 45 28 230 52 63 40 205 2 77 13 129 84 72 84 164 85 243 55 225 0 73 233 182 54 109 207 150 231 196 124 27 243 174 11 159 4 16 23 83 13 49 156 255 106 131 199 180 176 115 246 178 160 3 70 152 99 27 59 16 59 194 150 119 54 2 193 152 241 123 146 51 182 184 54 8 99 167 22 174 27 91 165 78 252 120 53 48 29) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 28 :der-encode #t :tests '(#(21 "" #vu8(49 50 51 52 48 48) #vu8(67 46 199 166 133 6 6 102 223 107 172 63 71 216 203 150 10 112 177 248 253 79 22 29 165 179 207 184 253 68 248 52 66 161 186 67 202 142 116 138 89 198 199 237 121 36 220 0 18 187 239 182 156 151 117 13 141 145 68 180 203 222 35 148 244 185 5 2 193 216 208 71 53 90 81 38 89 19 131 142 233 116 242 56 106 212 101 49 149 93 238 101 91 114 212 112 69 108 140 214 116 103 201 5 203 6 183 212 110 241 79 200 201 205 183 10 77 144 130 12 216 12 253 224 46 177 100 84 46 131 41 220 146 126 25 157 15 44 161 44 244 254 178 65 78 180 147 41 186 57 123 210 136 5 16 50 151 24 197 88 136 24 145 214 8 82 17 182 250 182 20 132 127 190 247 40 233 97 200 203 113 13 46 15 77 31 11 41 44 211 114 248 104 49 199 131 117 93 20 154 81 28 230 25 227 186 9 244 26 164 90 71 105 159 38 109 251 140 21 249 14 121 93 180 247 141 151 194 147 88 160 55 227 48 206 123 89 212 227 74 178 224 187 132 163 232 137 139 252 229 213 133 185 183 79 108) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 32 :der-encode #t :tests '(#(22 "" #vu8(49 50 51 52 48 48) #vu8(60 188 6 52 201 236 39 50 171 54 150 36 174 88 195 165 193 138 193 13 202 72 115 42 68 40 160 66 232 179 86 104 177 25 210 74 94 16 181 86 47 252 198 165 182 137 42 86 44 54 130 134 88 185 32 55 169 212 136 1 240 105 76 244 101 53 130 95 228 80 210 107 85 134 105 121 254 78 162 35 133 80 230 75 42 230 57 181 51 169 180 199 199 201 33 28 138 219 65 232 229 208 195 192 1 245 13 2 91 6 175 53 60 161 29 114 119 18 155 108 61 12 53 146 170 29 211 230 163 55 21 133 176 204 151 72 122 131 16 204 20 3 221 13 175 178 29 223 31 73 131 81 44 145 249 236 169 242 200 60 55 105 99 161 52 13 78 252 97 243 206 35 188 254 214 250 1 34 59 54 159 153 225 48 3 185 185 183 142 84 236 48 85 105 25 27 61 210 247 198 181 49 81 181 228 70 215 43 84 9 177 143 228 172 116 145 133 254 237 243 14 93 179 9 109 249 130 183 97 104 238 163 46 66 152 183 94 56 202 239 115 50 40 166 4 173 239 250 138 135 132 104 114 45 54 176) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 48 :der-encode #t :tests '(#(23 "" #vu8(49 50 51 52 48 48) #vu8(2 213 169 103 73 17 18 0 203 249 119 239 250 32 136 118 248 2 118 220 144 128 73 16 164 20 35 153 194 79 70 6 10 177 72 254 120 23 85 134 87 196 89 190 122 89 208 27 28 107 237 42 157 121 126 118 211 238 207 58 144 153 67 124 115 222 30 241 177 79 162 67 4 251 53 120 40 36 231 45 177 173 173 117 224 220 86 229 3 197 160 174 41 205 213 90 138 108 41 89 65 83 190 79 105 186 109 237 186 113 218 187 207 181 172 141 227 183 12 248 42 236 214 176 61 180 249 160 211 231 187 251 144 181 179 199 80 228 243 60 211 236 199 19 248 207 193 94 172 219 92 110 109 180 29 171 90 237 82 31 204 113 136 175 223 5 154 124 62 191 205 47 21 97 186 173 214 72 205 107 223 255 0 182 200 1 48 197 163 236 195 162 84 248 234 143 72 69 32 160 82 47 58 239 160 250 121 73 107 141 130 17 114 82 165 102 251 158 25 28 4 130 57 143 22 190 81 53 81 231 166 175 217 247 242 241 232 154 219 38 39 222 221 150 234 216 54 168 248 142 11 54 30 190 235 254) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 64 :der-encode #t :tests '(#(24 "" #vu8(49 50 51 52 48 48) #vu8(151 198 131 33 74 56 11 220 135 1 113 124 225 196 192 189 107 135 31 214 94 180 149 212 73 206 209 117 104 183 89 55 20 244 156 168 17 2 129 161 250 139 145 221 187 64 248 92 63 13 218 22 91 186 195 234 5 92 139 6 160 244 251 136 124 89 123 62 144 130 96 124 92 156 131 125 0 52 220 109 58 15 212 212 114 151 107 129 160 121 47 30 49 137 22 145 73 140 7 223 171 136 236 114 225 174 15 37 70 127 154 79 83 36 147 217 101 122 15 222 47 136 239 100 135 105 65 158 38 154 188 131 14 157 107 109 112 176 227 152 203 189 5 6 73 53 255 113 213 134 245 195 99 100 13 166 220 211 48 207 25 1 106 170 232 88 23 49 31 172 88 248 189 219 48 76 116 224 57 47 45 97 239 148 1 36 214 163 55 163 173 107 226 189 175 131 149 84 116 231 240 178 202 99 98 158 244 70 201 53 92 232 245 44 60 128 46 243 225 96 0 47 251 56 36 188 210 85 53 188 43 99 154 78 96 158 51 119 225 33 179 225 112 228 35 211 248 39 19 45 162 22 226 18 146 234) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 0 :der-encode #t :tests '(#(25 "" #vu8(49 50 51 52 48 48) #vu8(13 149 149 85 154 203 133 163 23 221 121 139 106 144 78 200 10 47 154 254 88 112 208 94 1 115 113 64 139 16 23 16 2 110 20 144 132 221 3 153 162 63 174 237 89 177 128 130 220 211 171 98 189 103 239 254 97 152 116 190 191 203 45 79 191 164 78 117 74 79 24 83 57 111 219 121 215 18 241 211 161 221 63 246 176 112 123 148 137 105 77 189 48 210 250 146 224 2 37 141 70 16 35 241 86 76 73 100 200 89 237 86 249 62 212 44 199 192 34 208 94 202 41 253 43 15 194 234 37 43 126 42 104 82 159 226 125 169 167 169 0 241 142 97 251 178 218 212 218 136 22 213 39 70 4 106 101 21 194 159 99 64 108 19 99 70 149 173 7 170 109 43 224 171 254 11 142 16 120 143 42 58 49 230 129 41 187 161 189 81 207 245 201 128 246 196 95 179 96 65 192 123 76 134 61 251 94 232 50 203 95 60 216 112 32 91 35 200 23 103 119 244 7 139 38 85 160 203 68 127 243 76 237 88 79 14 14 180 171 223 47 53 252 69 35 165 42 149 118 201 209 91 128 166 213 79) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 20 :der-encode #t :tests '(#(26 "" #vu8(49 50 51 52 48 48) #vu8(152 187 243 2 134 23 174 26 87 166 137 33 125 218 235 245 97 145 198 134 248 190 142 109 167 188 226 127 223 73 175 43 157 130 108 100 164 63 121 252 124 96 60 88 133 176 196 106 194 209 117 167 102 45 155 163 216 32 114 6 147 99 205 147 247 211 160 214 19 117 225 107 90 94 161 241 142 175 115 7 227 207 139 39 82 138 234 185 208 163 209 144 14 85 153 217 234 214 142 222 136 230 9 194 19 190 10 151 100 44 194 221 110 109 45 108 234 91 21 154 227 92 66 99 15 169 216 221 253 81 85 195 192 112 225 46 201 20 39 60 229 48 79 128 87 235 15 203 12 89 93 137 90 171 239 122 186 246 250 18 235 166 80 89 191 46 216 107 112 100 233 162 121 191 154 223 148 184 148 8 39 96 197 233 193 90 41 254 202 102 230 135 223 91 104 229 79 59 192 96 154 167 120 32 79 239 127 142 169 87 192 206 26 136 61 28 142 206 107 107 150 139 93 44 80 183 38 196 63 40 130 204 118 240 131 100 124 162 89 227 203 51 189 241 254 56 215 191 140 247 13 165 221 146 72 250) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 28 :der-encode #t :tests '(#(27 "" #vu8(49 50 51 52 48 48) #vu8(116 14 222 239 54 215 55 25 232 19 250 239 36 214 111 23 133 178 120 16 109 182 101 72 211 17 17 94 248 32 54 105 210 238 204 191 167 96 157 159 64 232 191 65 128 97 40 53 214 203 7 183 166 199 0 56 147 99 52 224 7 179 45 59 132 251 242 215 141 207 186 226 45 197 198 212 132 158 30 7 51 146 176 43 173 181 33 36 123 255 28 39 124 186 191 20 33 238 150 144 162 54 239 213 6 122 163 238 12 215 163 236 103 204 128 22 107 217 40 186 20 177 16 87 129 167 77 240 153 40 168 22 228 242 230 110 156 94 69 222 210 133 165 151 189 214 81 89 216 127 84 200 132 146 145 207 80 217 172 161 181 126 97 47 125 66 132 242 78 238 209 39 124 67 168 177 167 203 10 62 169 136 105 106 253 15 20 160 188 29 23 43 193 157 74 187 235 147 57 181 167 184 99 122 136 20 47 4 255 155 141 1 31 123 143 225 211 127 117 254 63 252 241 59 202 60 72 29 128 104 57 165 32 203 110 118 11 242 29 40 218 32 245 135 66 245 47 245 69 146 147 167 1 97 187 115) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 32 :der-encode #t :tests '(#(28 "" #vu8(49 50 51 52 48 48) #vu8(113 6 90 253 234 144 88 116 72 157 48 41 255 227 151 149 100 179 105 14 152 3 1 113 127 41 194 51 58 160 41 220 147 222 196 28 38 206 187 78 40 189 11 75 235 88 67 246 177 78 205 128 61 94 73 179 34 49 116 242 173 235 135 166 154 32 151 125 59 253 72 111 238 136 216 41 224 121 87 100 141 165 254 108 140 215 45 13 212 146 178 36 42 251 62 149 120 164 21 182 92 145 96 163 117 1 226 40 144 162 91 70 56 201 207 150 133 244 156 132 10 4 232 189 153 249 2 155 229 117 35 224 90 62 53 222 1 199 69 74 6 73 59 82 73 180 213 190 36 25 164 236 22 111 106 80 247 223 215 165 133 45 5 168 157 25 125 211 126 250 163 236 214 194 126 7 134 83 47 233 119 211 92 214 90 78 194 215 157 176 83 214 103 230 23 147 208 113 154 20 50 176 192 171 102 252 62 93 198 238 180 21 119 76 26 205 68 142 249 90 59 228 252 52 8 56 145 21 156 246 214 48 188 214 217 199 142 181 150 202 235 249 99 33 6 132 239 67 166 166 77 74 131 34 81 204) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 48 :der-encode #t :tests '(#(29 "" #vu8(49 50 51 52 48 48) #vu8(45 1 207 15 210 211 242 86 27 52 183 234 201 243 69 100 163 50 103 169 139 46 212 236 0 240 113 151 203 51 50 167 208 205 65 110 34 26 203 227 180 14 149 153 236 168 124 181 79 30 237 81 229 205 112 235 190 189 229 115 33 88 32 65 123 245 92 233 152 244 18 29 162 133 31 224 20 119 201 136 85 62 221 45 133 245 141 122 36 172 233 158 209 187 68 2 6 203 48 6 125 217 49 202 188 195 227 190 189 224 238 169 173 24 37 105 13 224 197 178 2 33 145 185 120 72 67 121 199 170 48 83 29 41 110 99 81 198 29 107 227 123 4 253 182 235 47 17 175 196 123 148 55 181 207 187 106 111 5 156 159 107 35 251 214 65 5 173 252 114 102 35 37 181 171 180 70 82 146 22 219 231 114 163 163 99 238 237 45 226 102 71 101 43 186 1 114 26 91 135 80 54 167 90 118 102 80 49 188 38 169 125 65 111 229 100 236 42 155 128 133 83 146 158 72 129 123 102 121 171 231 254 237 212 26 169 198 237 121 103 108 119 47 13 138 203 206 101 19 123 102 244 82 66 243 26) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-1" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 64 :der-encode #t :tests '(#(30 "" #vu8(49 50 51 52 48 48) #vu8(85 44 94 168 139 9 181 27 134 83 253 22 76 205 62 166 42 184 74 191 226 45 1 9 36 73 98 13 203 170 134 222 172 170 167 228 14 34 177 108 195 1 19 206 226 27 94 73 28 138 250 56 6 173 57 218 136 210 205 17 107 37 133 27 87 194 108 108 108 133 128 38 26 144 21 10 136 146 142 34 82 78 115 29 191 151 157 126 199 191 112 248 83 251 211 247 127 186 134 213 253 50 94 180 31 18 194 132 22 194 18 94 43 204 104 41 123 186 68 180 29 204 146 57 217 62 92 233 240 103 249 62 15 129 125 67 156 209 120 55 80 59 200 46 179 66 254 250 101 141 6 75 33 209 76 111 126 233 224 190 6 19 100 179 183 62 68 26 107 97 13 99 225 222 102 39 39 101 128 134 27 8 86 72 116 139 213 117 163 59 14 117 187 155 242 239 105 149 86 188 192 159 18 98 212 188 226 155 139 80 138 174 130 120 217 230 99 129 143 39 69 24 108 51 115 61 146 85 197 165 74 238 232 244 24 8 22 216 253 42 160 169 185 207 34 205 10 227 18 78 238 129 196 119 166 182) #t ("WeakHash")))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 0 :der-encode #t :tests '(#(31 "" #vu8(49 50 51 52 48 48) #vu8(82 172 87 26 210 165 78 199 106 30 252 67 15 135 169 20 222 165 13 209 139 207 130 137 44 147 239 35 60 43 158 235 25 112 34 159 62 121 8 107 81 217 241 230 30 174 91 88 156 163 220 177 64 24 156 121 227 57 213 110 7 185 46 36 254 97 218 2 195 149 198 81 230 242 46 156 198 24 89 40 41 172 7 136 63 30 223 18 8 151 176 115 122 223 161 41 68 36 4 228 188 242 62 175 190 243 67 154 125 221 19 150 241 167 171 73 121 226 195 186 175 254 233 54 164 122 77 116 3 79 105 119 185 112 63 250 113 222 66 124 98 26 213 186 109 145 42 162 220 94 88 31 41 153 86 106 224 171 229 166 90 122 129 157 228 92 253 112 28 142 27 186 114 123 215 119 210 16 45 72 76 175 63 106 215 47 64 13 28 240 120 233 119 89 234 190 198 145 165 41 163 84 143 85 119 155 91 159 231 197 134 89 11 212 74 190 0 59 113 222 201 96 194 207 217 9 141 175 163 41 194 167 92 141 148 170 12 238 11 145 104 15 227 145 14 82 57 4 50 118 39 156 112 27 138 239) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 20 :der-encode #t :tests '(#(32 "" #vu8(49 50 51 52 48 48) #vu8(88 149 46 110 21 236 48 12 2 117 138 89 81 143 97 145 121 119 143 222 97 74 62 62 247 66 166 185 3 146 117 204 132 22 194 106 181 253 36 100 158 210 45 239 127 146 21 153 76 211 222 210 52 89 174 75 49 195 162 67 4 64 26 138 231 0 162 43 194 112 200 159 67 0 80 107 175 79 129 51 150 174 1 122 93 219 43 4 119 165 120 109 66 90 150 233 103 250 53 10 218 213 150 241 174 15 129 72 49 30 161 72 54 195 107 57 211 49 223 253 116 83 198 247 231 144 146 193 57 56 217 11 128 29 65 86 155 196 209 74 132 151 205 180 41 44 149 150 99 71 77 60 107 57 30 94 127 243 1 100 122 251 79 218 248 188 253 57 180 230 231 99 45 205 93 230 202 18 240 194 44 75 45 209 106 116 161 232 20 251 51 78 228 100 124 254 169 138 204 105 30 15 193 143 14 77 205 147 84 211 168 245 161 8 32 0 220 179 172 129 116 155 223 33 132 55 80 145 171 49 225 51 33 110 192 206 222 34 173 234 217 6 248 89 94 133 252 229 242 138 103 247 214 241 18 73) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 28 :der-encode #t :tests '(#(33 "" #vu8(49 50 51 52 48 48) #vu8(92 46 199 171 147 175 183 169 254 45 14 0 101 151 160 117 248 238 1 255 4 186 179 24 163 227 196 137 135 139 207 50 31 104 29 18 58 122 205 14 94 176 31 130 97 168 47 195 211 79 206 26 54 86 13 8 89 211 154 217 194 184 250 218 162 103 59 127 175 12 11 116 234 239 19 248 167 31 75 151 41 218 30 61 68 76 191 38 29 180 21 181 147 116 132 39 137 220 96 177 251 250 212 61 175 244 14 187 77 187 222 164 0 203 80 111 240 183 85 104 165 228 135 5 215 90 189 155 116 68 23 141 167 174 144 22 66 131 92 171 248 107 34 229 90 94 9 6 100 169 13 106 120 243 227 173 231 167 39 84 255 245 111 36 69 160 20 146 129 49 173 164 119 66 11 56 149 19 137 232 75 243 207 234 181 126 134 69 19 202 114 71 50 58 240 54 103 205 156 169 38 218 183 235 81 210 76 37 145 143 73 128 6 94 241 132 108 189 163 163 155 16 32 56 1 72 247 10 12 226 111 244 54 88 55 72 112 181 24 84 185 155 226 211 49 91 49 126 251 19 144 199 193 62 135 29) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 32 :der-encode #t :tests '(#(34 "" #vu8(49 50 51 52 48 48) #vu8(186 212 67 116 50 105 157 156 211 121 156 41 188 217 89 104 59 135 146 135 234 194 181 44 92 38 63 70 226 72 138 181 224 190 81 127 247 165 188 89 165 251 33 125 181 96 33 7 162 128 69 240 142 233 40 106 253 61 97 151 15 188 18 254 172 118 177 47 117 241 121 147 119 156 140 58 237 134 45 214 129 102 95 56 102 16 197 154 75 107 14 99 157 229 251 85 227 107 82 186 243 217 224 172 21 13 62 227 11 232 94 233 85 128 179 78 71 2 44 81 122 150 177 75 147 166 76 74 18 157 239 17 197 107 52 246 3 83 244 12 129 63 96 169 36 234 3 145 221 178 119 12 176 9 21 189 243 62 60 190 111 46 135 132 14 99 53 181 216 220 61 26 37 218 163 9 197 100 75 3 92 70 65 108 117 70 15 142 214 138 0 129 223 81 64 206 249 83 59 51 41 111 98 113 120 28 46 222 24 32 2 22 91 232 98 162 244 216 245 195 29 38 223 182 218 213 108 220 242 105 180 227 20 60 21 45 207 246 236 128 117 78 34 206 46 223 231 135 154 30 177 184 48 119 222 152) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 48 :der-encode #t :tests '(#(35 "" #vu8(49 50 51 52 48 48) #vu8(59 69 241 50 109 59 11 197 16 21 101 176 34 84 31 131 106 219 121 201 225 14 32 71 139 27 230 163 42 84 219 182 42 92 86 201 40 68 244 105 150 40 159 133 80 30 26 104 26 41 119 54 103 244 46 63 12 30 121 241 73 99 33 60 234 165 146 130 203 13 41 97 19 158 169 18 250 169 77 55 98 170 146 138 3 200 141 213 103 131 115 227 157 24 45 134 144 217 201 184 40 118 34 253 53 75 213 210 136 203 75 254 252 127 181 163 24 119 129 51 148 65 179 88 183 240 190 108 136 72 104 183 236 71 53 39 18 41 126 241 145 237 78 85 225 200 228 56 238 209 222 194 181 121 7 147 60 20 237 95 255 177 1 205 230 0 124 120 35 232 4 247 156 52 219 66 154 85 194 134 28 44 138 70 6 80 159 123 231 116 209 173 187 102 246 64 173 241 106 172 214 23 48 248 9 89 5 238 153 120 243 121 222 164 210 51 179 187 13 122 15 234 240 127 168 90 40 100 1 67 41 217 211 31 41 207 34 170 118 197 192 97 236 65 228 33 31 187 95 180 44 141 8 123 185 23) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 64 :der-encode #t :tests '(#(36 "" #vu8(49 50 51 52 48 48) #vu8(132 211 14 189 222 182 79 95 203 225 118 50 203 182 146 193 34 44 95 255 181 78 55 242 91 184 124 146 25 147 15 92 189 160 247 98 136 154 137 137 184 178 63 199 158 238 23 216 229 144 32 109 85 180 0 110 227 207 77 121 170 201 58 197 163 252 104 254 250 40 11 83 54 142 22 233 95 184 98 150 83 215 105 145 96 158 66 234 4 241 158 25 165 189 65 27 46 207 154 24 222 148 92 105 84 7 246 8 192 81 105 226 226 0 37 154 108 244 48 20 72 91 134 211 172 16 178 39 131 254 195 145 136 211 155 89 96 169 122 65 64 1 223 131 129 203 12 23 177 173 5 163 165 129 117 32 46 44 216 170 108 163 19 29 59 192 239 188 47 13 95 9 146 80 128 218 83 155 147 152 4 151 129 107 253 4 41 73 172 243 31 162 112 90 99 215 68 44 190 28 40 19 40 191 88 161 227 26 198 159 150 214 124 195 24 86 226 43 127 175 188 174 43 98 35 229 94 44 129 165 253 103 215 76 220 140 204 92 59 111 226 216 49 155 163 106 178 218 154 141 217 114 3 132 102 44) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 0 :der-encode #t :tests '(#(37 "" #vu8(49 50 51 52 48 48) #vu8(8 12 115 99 184 1 182 188 34 176 73 120 231 43 166 172 156 85 147 36 49 89 74 47 128 231 172 161 23 197 27 222 153 15 2 222 253 222 202 55 51 148 130 159 65 169 212 157 98 252 21 147 249 155 22 155 246 248 221 77 170 20 158 178 172 246 244 112 147 42 245 97 94 68 15 123 100 131 84 240 129 217 184 46 173 224 9 245 35 40 25 78 186 56 53 147 182 11 197 6 137 68 158 183 212 120 103 157 238 38 124 225 153 179 201 157 75 0 79 227 8 16 45 204 192 159 224 65 193 37 212 214 194 135 223 186 156 108 64 164 161 66 29 95 55 52 246 234 9 200 94 153 75 20 7 172 140 124 149 176 247 137 37 185 96 64 39 162 138 178 249 33 207 28 159 234 191 83 0 232 38 179 131 182 235 17 176 11 154 55 140 243 96 231 96 196 119 124 200 244 70 115 1 65 122 224 117 86 72 62 78 71 236 228 231 72 123 24 142 42 42 201 93 133 167 117 134 170 18 83 116 54 171 46 80 191 122 79 215 205 87 116 33 250 18 206 111 75 105 185 123 242 72 216 88 102) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 20 :der-encode #t :tests '(#(38 "" #vu8(49 50 51 52 48 48) #vu8(103 104 101 224 51 173 58 115 188 236 210 54 161 37 168 48 84 19 226 204 153 219 34 37 172 135 247 240 191 202 100 77 135 188 100 137 41 87 48 185 136 116 32 31 8 137 230 136 135 43 76 48 166 138 105 158 136 62 192 173 197 195 142 237 91 144 239 27 161 42 147 13 228 42 155 190 253 203 243 191 156 193 87 202 149 11 158 146 120 65 223 19 143 137 248 116 32 124 37 149 230 247 253 64 57 182 240 148 172 10 95 89 202 87 7 218 92 50 48 252 116 10 25 91 141 183 65 214 2 213 177 45 208 4 40 105 250 204 30 5 192 57 5 183 190 156 207 12 222 148 66 98 67 9 62 22 34 55 51 1 84 44 150 102 127 22 59 6 123 27 83 219 16 174 64 17 149 222 185 209 116 103 72 229 244 145 255 199 5 28 148 106 36 92 76 29 28 63 136 15 233 159 9 200 169 13 145 56 219 233 148 120 95 87 109 121 187 62 179 244 190 21 222 70 173 74 128 115 204 185 70 226 132 220 46 215 87 45 144 216 168 65 202 13 191 244 188 174 31 195 7 254 23 232 125 135) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 28 :der-encode #t :tests '(#(39 "" #vu8(49 50 51 52 48 48) #vu8(96 59 247 120 178 149 97 252 170 84 245 255 98 140 93 37 126 2 18 198 50 126 145 18 202 184 207 40 83 20 111 184 233 96 96 30 150 19 245 123 175 248 230 66 35 205 126 0 38 246 97 136 135 139 211 93 146 54 233 222 95 9 80 187 165 27 224 110 238 55 48 64 129 163 110 247 244 247 201 64 73 86 196 13 48 179 164 38 106 59 37 137 143 84 111 15 105 148 197 78 201 73 116 116 237 4 223 179 162 74 73 56 23 45 135 127 239 86 195 230 225 21 134 165 185 32 193 83 142 47 34 221 76 151 29 147 61 105 245 164 116 46 59 35 226 187 86 177 37 59 103 188 206 118 23 34 185 160 38 103 67 152 231 113 31 158 192 65 92 117 200 14 59 243 143 105 145 179 150 59 196 184 155 243 240 65 235 140 137 74 209 39 144 219 53 210 76 84 164 210 18 63 185 29 155 196 233 193 22 172 224 110 123 89 176 147 214 193 205 204 192 103 84 11 44 89 159 143 89 133 255 110 20 218 105 17 105 188 226 3 174 140 18 119 112 243 131 59 11 25 132 124 188 79 106 86) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 32 :der-encode #t :tests '(#(40 "" #vu8(49 50 51 52 48 48) #vu8(130 114 224 134 66 97 197 191 160 95 78 64 169 138 173 238 67 150 142 159 90 126 191 215 207 57 8 122 43 97 179 79 69 146 240 12 60 24 104 30 148 31 185 88 180 70 201 217 139 174 135 148 79 13 65 241 59 61 22 98 191 157 177 208 17 201 38 230 147 17 226 150 208 220 197 158 158 9 228 246 199 176 167 229 242 50 83 62 2 9 126 82 252 7 85 234 117 107 160 192 237 227 174 76 117 247 248 150 107 66 17 141 22 131 251 159 30 18 124 30 106 106 99 18 106 13 80 177 181 165 159 74 219 245 203 130 47 123 134 60 15 141 143 192 29 198 152 189 112 148 58 98 49 215 170 119 213 23 190 63 31 204 171 97 201 155 143 190 94 79 116 80 41 206 129 201 89 94 201 48 171 247 238 238 98 53 171 42 132 0 36 113 185 113 235 145 131 142 19 238 75 1 76 217 16 89 179 151 80 146 189 178 107 180 53 236 164 14 200 174 136 116 112 241 193 30 50 210 252 161 17 220 37 76 2 154 47 130 74 141 194 130 74 227 42 17 104 222 44 35 251 105 199 118 71 201) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 48 :der-encode #t :tests '(#(41 "" #vu8(49 50 51 52 48 48) #vu8(119 199 125 37 195 151 84 117 85 65 64 151 73 169 79 207 16 178 142 222 249 42 6 121 47 238 225 165 56 28 6 170 30 214 253 70 220 118 191 18 84 17 32 146 36 115 145 43 214 59 178 172 23 41 81 16 97 94 140 150 3 158 184 0 160 162 80 74 71 99 8 82 195 84 218 11 156 68 201 204 107 48 252 44 87 21 224 36 37 201 213 115 134 143 14 172 30 151 65 84 8 212 215 133 2 48 208 224 43 97 210 55 180 20 92 153 248 34 195 146 112 254 210 208 194 54 240 18 133 104 215 239 93 213 178 109 10 172 127 117 45 212 94 137 30 127 50 137 151 65 104 166 253 225 200 222 54 141 30 63 84 110 196 238 210 18 0 242 23 201 222 135 64 13 132 108 38 238 112 244 89 192 248 127 90 230 66 115 153 155 15 27 252 27 96 187 164 219 39 27 61 99 219 39 204 36 185 210 37 200 61 32 67 243 227 162 12 8 139 54 173 197 12 21 165 223 137 74 74 72 117 145 140 141 211 79 145 199 252 139 236 80 135 34 23 119 137 146 82 52 9 205 33 248 184 140) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 64 :der-encode #t :tests '(#(42 "" #vu8(49 50 51 52 48 48) #vu8(100 169 192 230 251 206 169 109 98 218 86 33 63 42 17 217 34 65 143 161 181 106 228 175 222 125 52 66 201 244 1 60 225 30 162 3 202 35 163 81 96 154 65 213 183 105 107 190 47 60 202 1 20 154 26 123 156 14 191 5 46 81 22 127 241 139 234 213 242 211 194 223 55 90 47 173 8 169 27 140 54 186 174 215 170 88 70 154 143 66 142 55 232 58 176 79 239 254 73 153 124 100 11 182 58 239 35 239 64 143 178 153 175 249 127 206 4 134 202 54 171 198 68 31 213 44 253 204 223 241 120 87 204 186 111 68 140 179 211 155 114 146 135 166 17 59 103 148 108 0 71 32 180 240 188 228 38 120 224 112 43 12 166 9 109 239 158 76 103 36 75 104 216 154 90 200 152 110 246 244 172 176 181 0 101 250 117 65 12 67 135 72 68 175 81 29 99 50 199 219 143 17 152 142 112 167 160 36 21 38 17 1 217 227 109 236 231 156 33 30 38 213 128 130 90 126 83 88 177 172 100 233 252 67 243 129 182 207 244 119 181 141 40 97 199 49 53 208 68 67 44 254 52 204 232 131) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 0 :der-encode #t :tests '(#(43 "" #vu8(49 50 51 52 48 48) #vu8(38 222 166 142 39 1 141 50 71 226 161 199 7 150 245 224 37 105 44 227 211 26 108 249 234 230 224 173 9 65 253 54 246 106 15 245 66 89 110 161 81 73 112 141 247 184 139 99 215 112 49 177 161 232 230 11 34 33 181 133 96 20 30 42 60 190 223 9 174 210 154 171 237 28 53 235 15 251 49 43 221 208 79 102 172 221 244 42 13 113 48 225 38 141 144 157 152 139 240 109 70 91 2 36 16 150 232 116 75 85 65 225 94 210 116 229 76 235 155 205 121 107 60 54 26 215 204 89 213 236 238 63 17 49 189 249 234 104 30 155 224 157 24 57 74 100 113 26 4 15 228 33 184 103 141 163 48 195 138 230 240 87 165 182 144 186 113 100 37 41 56 253 160 197 57 109 73 242 101 247 163 135 84 237 254 82 148 193 240 146 114 27 162 99 188 195 52 67 144 136 160 199 22 157 155 173 206 91 34 15 44 128 196 68 33 236 239 96 95 70 198 237 154 255 223 60 115 11 38 110 176 49 241 242 101 0 61 255 19 6 109 59 28 187 18 216 152 230 193 95 52 247 81 109 236 117) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 20 :der-encode #t :tests '(#(44 "" #vu8(49 50 51 52 48 48) #vu8(145 255 1 231 159 156 158 80 174 160 239 219 200 178 195 112 243 164 10 216 228 137 96 31 130 23 236 249 208 71 189 142 16 189 166 100 234 152 111 87 52 237 56 170 246 124 215 178 39 229 182 141 221 174 19 205 129 249 238 27 125 130 72 187 48 66 163 202 103 15 50 195 22 232 30 64 118 120 132 32 161 129 80 203 29 71 37 247 162 57 180 158 242 95 69 135 22 103 156 177 151 29 57 176 103 140 31 254 63 69 210 114 146 63 53 81 163 55 135 27 89 244 118 44 110 17 201 102 91 32 12 91 183 252 87 46 10 217 48 166 53 66 161 199 124 13 247 172 184 188 60 59 14 245 156 230 194 218 116 238 110 244 33 11 64 158 34 69 135 62 111 162 71 57 211 108 11 18 229 227 40 202 102 147 22 250 106 77 247 72 26 84 127 110 103 27 112 40 226 234 60 21 172 152 231 66 213 168 153 87 118 189 88 111 204 35 146 46 202 89 177 73 120 113 247 68 179 87 7 142 142 144 24 138 43 114 36 193 155 169 202 71 105 249 30 102 90 156 190 125 232 235 248 79 18 193) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 28 :der-encode #t :tests '(#(45 "" #vu8(49 50 51 52 48 48) #vu8(113 171 98 225 99 227 30 222 148 110 65 144 156 205 135 24 96 134 199 217 154 52 89 129 61 182 227 128 160 70 203 215 94 140 252 210 8 111 43 29 176 33 189 84 231 43 136 25 59 211 143 150 100 175 27 127 16 10 137 194 172 133 28 209 61 61 254 73 7 210 103 105 164 106 75 3 37 109 24 219 33 66 70 54 182 113 24 150 25 132 7 55 254 242 216 211 31 72 100 167 6 71 22 0 12 68 231 235 237 182 176 163 188 6 229 186 240 31 190 216 41 51 171 188 67 223 190 135 250 28 191 104 253 48 228 142 213 149 169 152 251 208 235 241 207 220 53 223 216 2 111 173 2 52 18 232 35 34 239 230 24 42 132 152 87 166 107 28 180 29 231 200 164 242 44 162 81 219 39 20 235 138 173 103 248 115 138 89 96 46 144 12 92 209 96 78 110 18 215 176 93 227 41 211 186 206 6 231 120 92 212 214 139 166 10 47 91 151 106 79 209 18 201 36 228 225 92 254 164 60 218 124 225 77 116 31 168 160 231 119 251 58 119 194 203 124 226 104 10 32 166 255 95 129 122 67) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 32 :der-encode #t :tests '(#(46 "" #vu8(49 50 51 52 48 48) #vu8(50 92 172 219 162 36 7 28 23 54 173 180 129 90 10 19 220 25 155 172 19 32 105 103 137 76 168 151 64 44 40 32 254 48 61 44 33 96 186 99 23 254 52 46 141 176 162 171 81 181 237 171 78 185 3 93 60 204 115 82 29 176 17 160 242 49 208 36 41 72 10 67 152 188 104 191 208 226 72 246 247 114 77 45 183 145 160 54 106 226 90 174 171 47 138 179 119 64 95 149 175 45 186 141 179 73 35 109 190 149 7 177 127 82 253 241 170 212 153 24 148 232 87 5 70 102 231 112 200 110 216 230 47 201 188 43 110 166 213 225 33 234 67 51 114 119 198 30 238 141 100 245 80 190 10 170 238 178 154 24 195 201 220 84 62 208 204 65 207 7 50 211 148 254 0 142 93 136 116 243 7 48 70 24 159 11 102 121 191 228 172 101 207 19 222 67 195 96 115 246 15 17 15 31 57 124 235 31 124 180 3 70 254 253 251 12 129 125 50 83 23 19 160 64 153 172 107 101 148 24 28 17 221 143 44 15 11 67 241 214 135 229 184 70 182 146 131 220 168 90 154 89 107 245 193 18) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 48 :der-encode #t :tests '(#(47 "" #vu8(49 50 51 52 48 48) #vu8(108 225 157 108 110 217 33 139 219 5 100 253 73 10 8 138 61 59 232 10 69 191 240 241 156 125 67 27 188 36 15 163 0 245 98 208 13 37 165 132 86 255 9 35 4 229 16 71 245 216 149 108 208 1 94 187 14 182 80 145 86 100 15 45 237 156 0 61 109 180 158 209 217 91 247 71 65 40 25 144 240 156 254 213 130 173 126 45 107 137 103 19 226 143 125 63 79 164 28 121 141 216 138 208 106 135 22 6 63 13 66 197 92 65 79 182 196 146 5 254 229 58 113 15 187 185 142 114 145 170 7 205 111 113 96 225 253 181 243 220 45 255 224 20 189 145 189 212 80 161 240 218 131 203 56 1 88 185 209 106 162 127 156 7 142 68 78 35 20 103 1 189 27 66 23 159 237 161 153 130 88 212 90 32 79 206 97 75 227 149 65 59 37 155 88 152 160 99 121 199 235 105 230 251 88 234 130 202 114 184 242 49 241 30 208 241 128 215 149 8 124 219 226 106 238 178 255 109 125 62 183 254 175 76 44 116 120 60 150 103 74 217 89 189 92 251 185 121 204 69 11 156 5 16 163 100) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 64 :der-encode #t :tests '(#(48 "" #vu8(49 50 51 52 48 48) #vu8(45 63 197 50 48 69 112 182 205 213 181 139 15 167 40 123 163 54 194 158 236 99 60 197 242 21 244 233 107 46 196 76 103 227 177 222 19 134 171 97 105 117 175 60 227 186 147 136 126 27 112 93 94 85 176 84 225 120 45 80 191 192 9 76 139 123 15 6 127 162 80 207 71 74 195 180 39 118 177 199 101 9 202 130 18 37 152 156 19 250 235 21 177 135 35 31 109 187 92 223 46 30 165 44 238 5 252 44 31 128 51 52 28 170 7 114 1 127 227 167 32 33 42 113 105 212 100 103 160 91 76 185 26 201 136 111 148 13 220 143 40 13 5 93 84 165 17 0 186 189 150 49 178 87 17 64 203 21 194 229 63 179 2 107 172 2 174 250 70 6 93 156 150 95 113 173 188 93 63 17 243 160 80 15 216 51 160 80 33 201 93 94 126 95 63 165 0 243 103 201 149 149 81 78 194 33 216 251 81 219 76 119 109 134 187 219 210 253 130 163 149 7 107 209 225 44 61 12 148 237 9 139 132 216 88 167 51 224 201 161 83 85 139 233 2 19 219 43 64 93 84 223 148 214 201 137) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 0 :der-encode #t :tests '(#(49 "" #vu8(49 50 51 52 48 48) #vu8(57 26 193 181 164 102 184 134 55 143 221 34 13 88 113 41 36 18 187 214 32 5 188 139 31 19 176 44 124 79 152 243 87 140 49 163 12 4 149 41 76 246 141 252 202 18 194 234 9 56 143 224 117 36 135 170 6 15 147 160 191 251 125 112 117 66 143 25 63 103 60 67 214 15 186 148 188 242 168 182 41 125 34 7 251 93 183 171 178 56 133 251 139 79 133 140 122 57 92 94 151 49 132 13 23 215 171 116 157 208 245 81 31 248 82 155 148 97 152 157 204 209 38 189 68 46 140 245 197 110 32 194 122 136 105 166 181 118 239 119 21 32 145 35 71 9 155 86 110 229 136 234 197 131 165 149 163 51 16 39 131 192 249 147 224 236 163 245 90 241 173 171 102 121 14 93 255 28 188 178 245 73 197 224 133 49 122 252 138 250 24 20 36 242 255 37 46 204 246 67 175 80 156 254 135 120 135 33 7 180 130 89 104 172 213 39 26 54 212 184 48 80 241 26 251 52 175 196 160 207 7 50 4 24 124 27 126 129 131 37 0 194 181 204 50 241 35 100 77 157 151 242 71 105 200 215) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 20 :der-encode #t :tests '(#(50 "" #vu8(49 50 51 52 48 48) #vu8(42 108 253 49 18 178 220 211 122 164 250 78 249 221 177 62 215 19 150 12 176 98 101 54 86 147 123 128 124 92 207 128 197 188 210 5 186 49 74 83 7 189 207 88 39 154 251 22 190 27 155 3 140 147 171 77 93 91 150 222 28 4 43 102 228 75 237 244 245 199 45 117 100 227 241 144 244 101 66 17 235 116 113 49 91 81 47 137 109 211 21 240 11 77 25 82 192 192 183 14 72 156 236 44 171 234 165 129 35 207 0 13 70 83 34 140 114 70 149 46 2 64 11 218 6 45 22 195 125 87 144 228 174 185 231 143 117 208 116 13 196 140 125 214 182 113 230 72 222 19 224 54 160 38 94 246 201 69 143 114 96 43 245 210 149 244 104 245 84 202 234 86 59 86 211 185 136 97 93 18 54 109 77 219 79 126 207 57 253 169 145 61 236 39 28 158 165 249 40 111 161 30 234 254 32 136 164 31 22 206 231 237 25 199 51 14 233 154 84 217 129 177 131 195 218 115 3 148 200 245 185 11 23 253 15 221 71 192 38 15 8 73 11 82 72 62 187 50 187 102 64 168 144 201 77 133) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 28 :der-encode #t :tests '(#(51 "" #vu8(49 50 51 52 48 48) #vu8(4 149 7 90 126 247 218 102 90 136 2 163 220 171 86 205 168 103 94 56 214 55 138 155 95 95 188 83 249 36 155 207 119 70 178 225 32 219 76 237 19 65 36 213 78 98 191 122 161 135 237 194 138 51 132 191 37 22 235 97 108 9 88 172 179 140 104 248 90 182 113 206 159 46 62 127 146 162 71 204 76 183 29 42 165 54 236 178 76 110 59 179 252 189 134 54 237 230 119 249 27 197 153 136 176 27 219 188 43 152 107 169 144 130 247 210 220 110 19 185 98 247 230 225 199 32 139 169 177 197 93 217 103 121 248 155 64 23 139 230 72 187 249 6 166 143 253 254 170 7 32 218 184 75 41 9 20 102 126 180 35 167 205 112 253 221 78 148 124 234 7 115 56 60 4 142 94 74 37 14 210 13 49 237 23 48 208 209 177 15 126 211 64 29 164 118 207 156 45 142 27 184 109 197 170 28 121 165 21 135 99 197 214 207 10 221 173 37 64 110 70 50 225 168 86 23 241 119 242 84 95 127 15 96 181 194 151 250 196 10 48 71 103 172 255 197 192 152 168 237 133 218 42 181 199 102) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 32 :der-encode #t :tests '(#(52 "" #vu8(49 50 51 52 48 48) #vu8(173 43 74 185 23 185 66 215 23 45 249 197 23 86 194 31 194 59 59 244 103 244 220 158 2 78 137 183 214 223 113 240 153 160 224 198 39 241 34 87 182 176 95 25 13 220 38 146 6 85 106 197 211 78 180 214 63 9 240 123 142 188 195 140 61 238 72 172 240 86 175 244 110 35 241 112 164 122 207 22 98 26 101 250 63 147 25 229 226 28 101 66 111 154 207 156 166 87 110 254 180 229 147 240 239 1 230 87 124 133 190 115 172 237 231 140 63 67 21 126 104 106 86 78 10 84 45 186 128 128 245 57 85 99 135 193 153 8 156 137 201 134 107 223 236 231 187 224 203 113 48 8 191 154 223 250 55 141 118 228 145 93 27 68 80 128 151 125 53 63 47 52 233 192 99 214 127 14 245 15 117 95 148 220 244 236 65 34 73 88 53 2 77 7 90 171 215 214 90 220 203 25 135 225 230 84 220 42 77 240 222 50 82 180 100 109 215 184 106 6 142 125 149 36 16 241 52 31 164 157 128 214 241 208 152 37 187 46 103 65 217 232 180 61 222 188 224 248 26 198 223 99 95 202 61 146) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 48 :der-encode #t :tests '(#(53 "" #vu8(49 50 51 52 48 48) #vu8(158 90 66 186 128 198 185 24 1 206 111 145 77 196 143 3 190 198 149 70 51 19 175 232 48 111 114 109 30 30 6 144 173 51 66 91 31 90 4 63 139 177 195 180 116 176 9 235 161 202 103 215 217 153 139 86 181 238 239 9 233 67 88 227 227 19 59 133 164 101 36 147 37 58 173 251 77 248 146 209 191 115 180 46 46 133 115 2 189 207 195 121 5 227 127 175 220 138 204 194 106 48 208 203 193 237 152 208 233 113 23 14 25 83 185 28 29 227 91 54 60 0 171 74 155 178 254 244 91 117 51 18 113 121 32 20 18 135 161 184 38 69 34 19 26 82 45 244 109 85 69 199 96 195 160 95 244 72 117 66 242 179 81 167 74 125 205 141 172 110 123 52 42 152 126 214 93 94 24 3 54 46 234 131 64 235 103 240 20 212 127 99 231 32 217 103 56 146 75 21 41 190 173 216 110 98 226 11 100 121 235 150 35 242 144 101 200 36 45 117 48 128 204 77 233 98 185 52 225 15 142 237 35 190 139 179 46 209 171 178 62 117 148 158 48 245 139 150 103 233 194 92 253 121 114 182) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 64 :der-encode #t :tests '(#(54 "" #vu8(49 50 51 52 48 48) #vu8(28 87 221 79 201 61 207 79 182 46 8 45 14 134 29 85 69 99 32 53 120 195 23 205 117 31 1 124 71 121 163 110 198 230 218 228 98 26 192 126 181 6 212 205 77 98 126 99 197 85 52 188 242 177 104 100 154 221 25 98 139 10 135 212 85 198 247 67 41 255 246 99 162 169 1 110 211 213 131 124 43 132 59 131 1 93 32 59 190 37 220 100 7 91 39 192 231 8 135 94 171 217 172 164 234 100 104 162 17 113 57 173 133 121 75 150 41 163 176 110 34 163 217 69 18 59 65 209 202 59 101 97 149 238 59 13 123 4 109 209 242 142 211 180 108 202 217 161 116 218 88 29 51 153 117 65 192 211 236 88 146 133 88 126 52 13 198 92 57 1 196 13 51 83 222 68 136 150 99 70 152 204 177 206 85 226 47 195 184 8 203 165 8 41 88 73 47 161 153 123 38 68 47 9 97 95 134 157 182 94 254 242 141 80 167 80 117 199 111 230 242 233 111 211 138 116 41 224 116 111 59 32 160 235 49 2 126 232 50 87 86 180 43 34 134 224 6 158 146 70 27 165 229 167 49 162) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 0 :der-encode #t :tests '(#(55 "" #vu8(49 50 51 52 48 48) #vu8(170 249 87 71 186 252 217 104 219 194 247 167 25 49 84 103 177 244 56 227 199 30 160 27 91 96 53 185 39 30 22 162 119 145 236 35 186 127 122 166 55 137 44 154 1 16 205 233 243 223 143 171 101 164 178 220 251 203 130 118 40 208 152 140 72 139 157 239 1 202 169 22 17 101 56 213 53 252 149 90 237 151 131 10 75 103 150 206 198 31 222 132 141 20 154 54 18 228 168 21 162 223 212 81 49 164 53 85 159 72 231 35 55 196 44 193 4 241 121 114 98 238 105 112 152 130 213 120 9 177 155 146 116 16 175 151 156 71 159 177 179 246 92 113 60 143 58 172 57 7 210 161 14 236 148 94 48 43 181 235 94 25 67 99 252 76 225 93 37 150 27 221 49 197 19 57 203 16 55 180 200 98 54 22 10 11 209 189 87 76 82 171 216 130 101 121 128 19 241 231 172 231 255 78 183 16 208 183 114 103 84 206 20 160 150 45 126 237 189 8 53 53 116 202 155 207 249 85 237 2 22 108 255 67 12 52 219 212 75 188 146 125 143 252 200 95 205 198 133 224 173 142 232 44 39 217) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 20 :der-encode #t :tests '(#(56 "" #vu8(49 50 51 52 48 48) #vu8(72 72 110 246 50 210 152 24 99 136 248 5 6 191 106 18 222 3 120 26 222 244 183 120 213 246 22 72 74 181 206 251 181 160 160 4 174 21 222 242 216 33 52 185 108 85 94 187 59 169 232 247 220 242 196 115 214 25 139 10 69 92 176 39 179 48 32 172 124 124 45 16 184 144 76 148 213 172 69 186 159 255 66 200 146 220 13 132 92 244 45 77 22 46 168 185 165 68 8 75 101 101 119 15 60 24 142 142 45 186 246 134 21 116 201 78 18 149 181 28 94 19 251 125 41 214 93 145 33 0 136 112 222 153 180 207 33 96 113 137 137 201 242 136 217 11 80 6 157 229 121 2 122 98 72 5 241 53 110 237 182 188 52 173 63 79 201 81 159 217 14 98 107 176 98 43 183 1 230 150 105 114 75 69 68 197 132 87 63 5 77 252 183 154 43 244 179 184 118 15 201 93 169 9 109 143 86 169 20 51 8 30 132 98 201 46 69 176 56 56 17 88 30 55 191 70 41 86 124 43 25 240 19 94 52 26 99 125 134 102 134 49 38 38 185 156 8 133 0 38 85 252 80 39 175 240) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 28 :der-encode #t :tests '(#(57 "" #vu8(49 50 51 52 48 48) #vu8(155 224 139 237 106 236 18 155 40 21 157 35 208 201 211 23 19 114 180 78 195 56 91 233 60 80 112 173 7 20 17 46 136 231 116 82 42 108 97 135 76 160 113 219 187 162 164 26 224 54 152 57 89 67 222 28 4 137 162 144 44 95 188 247 121 13 63 109 240 80 11 63 4 185 137 134 63 111 247 66 149 77 211 36 105 185 111 253 201 64 134 182 221 57 2 74 29 182 35 87 255 213 158 26 38 135 212 38 101 129 229 175 51 113 177 196 81 137 52 107 55 68 38 168 254 135 54 62 113 37 74 111 30 86 108 145 31 70 122 8 157 251 25 203 82 123 176 199 94 68 42 66 172 53 110 235 10 96 238 31 177 110 251 90 54 7 106 40 227 109 111 203 177 255 229 177 102 47 108 225 190 9 243 12 153 73 184 5 102 134 171 60 29 56 148 53 14 160 177 47 151 243 80 239 124 42 35 45 189 226 0 212 172 116 182 20 90 14 234 244 12 195 224 184 147 125 67 119 189 176 78 20 115 12 212 131 15 247 135 17 4 82 199 159 150 94 196 236 139 8 10 91 234 13 11 45) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 32 :der-encode #t :tests '(#(58 "" #vu8(49 50 51 52 48 48) #vu8(38 95 112 190 117 253 44 169 38 50 127 192 173 135 242 10 159 241 169 191 158 69 84 91 109 89 205 167 171 191 50 165 178 251 15 120 164 172 247 114 116 159 240 56 240 54 153 249 14 35 230 162 125 246 195 36 179 74 90 153 80 70 199 44 49 35 248 148 169 1 74 23 101 67 55 171 69 90 154 41 66 175 74 49 164 229 20 74 183 8 198 83 169 167 91 148 155 248 0 248 23 184 86 166 241 57 177 206 2 228 175 39 24 9 1 18 26 225 223 81 150 212 201 107 1 63 152 135 77 147 5 160 75 251 218 217 26 227 101 185 211 154 40 202 102 158 162 12 72 0 175 24 23 110 168 63 70 224 148 168 121 152 223 110 20 232 214 226 111 254 202 217 18 127 111 140 91 150 242 241 146 167 52 86 23 245 197 99 232 251 195 216 112 193 101 184 116 73 175 119 24 106 129 57 9 113 103 71 250 15 42 72 125 110 173 42 182 122 139 129 160 164 221 104 18 152 172 139 60 230 7 204 80 210 185 251 58 74 109 76 221 146 250 61 158 227 170 13 70 252 87 21 223 19 61 29) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 48 :der-encode #t :tests '(#(59 "" #vu8(49 50 51 52 48 48) #vu8(175 18 13 34 4 166 104 12 117 251 200 141 197 47 168 23 180 135 111 37 152 251 125 102 115 231 244 35 208 149 150 86 71 17 146 192 52 208 43 143 150 248 44 99 212 75 34 119 110 208 40 19 221 116 253 211 131 199 8 56 229 19 155 187 50 142 6 143 49 239 9 196 32 229 78 104 87 199 123 79 36 56 230 119 139 215 230 163 182 162 22 59 229 253 187 187 206 50 130 58 38 209 200 82 152 231 241 76 205 153 146 165 16 241 62 102 181 197 199 23 15 70 57 179 155 46 50 43 123 37 37 25 120 128 27 95 218 120 167 61 28 53 201 63 41 118 100 52 178 120 199 244 154 207 20 124 179 187 185 6 240 235 243 198 36 231 176 242 76 223 172 216 82 237 89 77 144 187 226 34 193 126 223 145 206 209 246 173 195 106 231 212 165 162 213 184 25 68 186 84 1 216 40 91 10 149 176 73 55 222 208 1 234 233 63 71 6 0 231 217 176 247 78 77 57 150 42 3 156 245 123 108 149 92 23 36 234 139 179 4 250 160 206 252 9 126 236 75 197 87 7 55 101 106 138 132) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-224" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 64 :der-encode #t :tests '(#(60 "" #vu8(49 50 51 52 48 48) #vu8(40 95 107 48 27 213 213 73 39 227 64 78 94 30 248 223 233 13 88 222 195 126 38 116 120 177 13 47 120 117 115 2 92 38 87 102 93 52 65 89 50 232 30 206 36 175 87 50 156 47 84 166 81 203 199 183 145 191 251 14 226 3 67 226 195 65 207 155 165 160 170 103 24 76 3 52 93 54 229 97 244 174 24 174 52 68 20 192 71 140 123 219 169 215 253 84 47 223 141 94 87 88 41 92 219 161 89 32 52 148 2 30 108 166 116 25 14 206 39 105 160 192 185 124 20 61 165 23 235 235 202 58 173 25 51 196 216 148 50 186 177 151 231 121 153 94 73 188 176 233 69 251 183 220 242 87 197 175 80 159 25 171 250 111 203 242 159 71 4 210 90 238 245 126 163 212 198 63 15 55 142 92 91 143 101 60 83 17 100 13 245 123 213 203 35 34 216 74 235 243 4 182 73 227 55 83 157 71 251 20 145 186 27 13 147 108 192 8 208 105 112 224 192 161 13 117 186 15 46 12 94 252 29 185 40 48 203 2 32 86 149 33 5 218 131 176 126 37 195 117 128 59 63 245 54 229) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 0 :der-encode #t :tests '(#(61 "" #vu8(49 50 51 52 48 48) #vu8(85 216 136 114 210 221 218 190 136 116 248 153 159 225 166 239 220 14 228 206 56 187 16 87 241 28 143 206 194 218 39 210 56 210 58 128 16 202 156 5 16 195 223 18 166 56 250 224 192 214 74 184 58 139 67 202 226 75 21 79 27 134 50 219 239 135 38 219 16 59 253 230 211 63 130 83 81 35 136 85 122 197 2 220 144 204 23 60 154 200 42 80 30 213 52 212 197 127 239 126 246 141 50 8 151 250 136 46 249 10 227 43 41 211 121 195 155 74 137 113 196 106 185 54 110 57 219 44 47 241 128 204 98 89 202 199 3 51 13 194 248 11 163 152 228 235 123 215 1 117 170 72 71 208 230 67 168 217 126 246 171 221 210 57 21 92 251 120 12 162 40 152 82 53 208 201 17 136 87 41 2 196 145 170 1 29 147 72 81 124 55 11 91 214 13 217 169 89 137 151 165 252 118 50 103 210 0 14 39 40 237 239 228 80 157 152 247 25 124 72 125 14 66 149 31 169 42 205 98 31 191 253 203 89 91 32 248 203 83 198 241 147 95 83 93 127 2 130 131 126 77 3 225 136 184 35) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 20 :der-encode #t :tests '(#(62 "" #vu8(49 50 51 52 48 48) #vu8(151 112 73 235 70 132 17 203 75 71 69 209 128 77 206 97 170 216 3 139 224 191 221 163 214 230 231 242 53 80 49 0 80 91 111 134 171 67 44 178 237 40 187 87 53 140 149 4 47 113 184 249 229 34 17 102 218 253 185 40 30 238 183 159 121 15 143 158 43 10 25 229 11 132 89 235 84 248 86 149 177 146 155 166 101 32 212 98 3 129 76 116 144 14 195 204 84 109 214 129 227 90 254 59 85 227 236 26 183 25 81 61 238 126 154 155 85 104 233 187 142 52 42 163 222 45 74 232 131 233 240 196 220 226 201 252 203 104 172 9 213 162 96 160 244 185 72 191 229 160 48 67 172 237 104 175 49 248 84 223 221 93 66 4 125 238 25 183 29 17 75 223 130 59 244 176 60 85 19 181 237 43 243 51 227 35 4 141 223 51 46 194 132 199 211 30 192 50 202 222 132 141 13 78 138 1 33 38 78 203 35 37 162 155 86 206 92 22 140 185 101 45 49 48 85 71 223 162 129 69 123 22 100 15 62 93 40 59 63 222 16 139 103 205 189 107 32 5 175 147 208 8 190 78 196 110) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 28 :der-encode #t :tests '(#(63 "" #vu8(49 50 51 52 48 48) #vu8(76 168 207 45 120 23 100 62 20 72 77 117 127 8 83 98 86 19 152 71 40 201 228 131 239 220 22 238 236 97 109 60 85 18 18 16 122 156 171 145 121 97 133 189 126 96 246 97 165 242 241 126 130 185 243 76 12 85 25 126 181 226 183 215 75 140 255 0 202 238 51 8 59 198 154 166 96 39 163 230 129 128 129 127 192 101 221 90 94 178 225 22 38 191 151 192 202 68 183 12 24 176 160 167 15 250 98 141 134 170 139 69 231 24 112 44 197 209 88 84 213 27 175 52 253 99 123 227 226 1 195 154 195 219 65 43 239 1 55 149 27 223 116 164 60 125 191 89 86 32 118 147 196 12 149 120 245 237 244 8 180 59 177 208 120 0 48 130 89 47 171 88 134 10 61 154 56 214 213 174 224 81 229 190 133 187 234 121 31 87 214 138 124 65 39 183 215 245 220 226 234 33 28 195 95 54 125 123 10 86 31 138 230 60 55 16 23 72 253 253 137 13 97 100 38 105 12 91 108 234 129 124 33 155 145 101 186 103 132 249 237 175 138 186 112 130 249 18 148 2 84 215 183 146 18 18) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 32 :der-encode #t :tests '(#(64 "" #vu8(49 50 51 52 48 48) #vu8(107 166 234 237 154 0 87 94 10 213 207 74 222 57 219 240 188 107 143 80 231 210 168 146 214 38 238 103 81 182 163 96 167 3 144 77 58 17 89 107 16 71 58 128 48 171 89 146 220 202 137 50 222 161 234 231 227 200 136 41 112 37 48 48 31 216 95 91 229 21 33 111 35 195 158 112 180 107 37 106 6 211 146 241 62 219 84 49 253 107 190 75 119 68 93 176 63 180 112 106 219 34 16 90 124 227 198 189 26 83 122 163 211 189 62 38 78 21 187 104 218 168 140 13 176 28 39 7 162 170 122 244 176 85 9 123 104 231 192 230 116 146 20 71 142 201 31 17 4 239 43 81 58 34 49 100 118 222 105 107 20 9 15 106 62 54 165 98 253 171 94 60 104 39 8 200 128 23 160 119 21 79 239 79 184 70 17 185 223 142 59 93 181 95 157 203 13 213 210 215 151 216 17 122 77 179 146 198 47 67 42 226 79 172 249 158 221 199 140 65 8 29 233 206 237 159 101 23 105 228 76 186 9 139 171 247 167 143 25 146 165 63 227 24 135 148 23 255 60 216 165 240 78 102 148 92) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 48 :der-encode #t :tests '(#(65 "" #vu8(49 50 51 52 48 48) #vu8(91 187 220 87 164 94 95 213 160 220 240 59 118 192 110 219 32 102 249 32 94 218 47 172 223 81 32 220 107 249 60 142 150 157 113 74 156 231 17 4 242 185 69 93 108 108 59 100 137 164 30 87 143 255 146 71 222 7 204 243 7 150 27 52 244 84 223 95 180 12 169 138 74 12 235 168 247 5 230 10 250 2 201 69 248 206 208 182 218 202 135 172 182 173 8 16 152 222 177 65 156 199 186 203 64 123 245 37 89 68 10 105 192 202 42 241 115 139 38 110 44 20 251 38 187 235 154 225 244 21 178 123 49 227 110 89 2 96 102 178 103 77 96 81 107 140 6 183 15 200 25 77 134 188 138 85 20 233 231 61 251 41 238 149 159 44 133 127 51 221 15 103 46 53 241 59 96 24 92 140 251 179 175 35 186 219 146 113 228 13 193 212 55 69 98 216 130 119 206 6 0 177 142 99 75 18 125 59 178 245 225 38 77 217 163 193 136 190 56 8 150 23 52 74 1 239 228 126 31 180 66 215 71 191 88 98 196 9 193 67 39 178 227 184 238 6 90 3 118 75 2 109 8 152 58 192) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 64 :der-encode #t :tests '(#(66 "" #vu8(49 50 51 52 48 48) #vu8(77 52 232 24 163 202 231 234 23 156 5 122 202 104 59 169 158 52 127 102 30 90 147 30 112 42 117 233 184 89 60 136 132 97 248 5 127 215 25 180 204 87 221 103 77 160 218 174 54 151 44 84 24 32 92 135 132 4 112 204 9 13 153 113 74 162 216 134 210 70 238 107 87 81 246 131 7 2 84 206 14 18 48 60 159 226 82 213 239 67 95 85 128 6 211 191 201 209 115 190 47 206 156 88 12 60 107 110 253 0 60 132 222 116 170 109 158 49 253 123 4 176 250 47 13 107 173 36 122 60 40 241 87 39 111 82 94 174 22 176 88 147 108 217 31 102 90 225 133 139 44 0 183 120 170 66 185 122 175 181 188 179 142 87 125 168 153 192 57 10 118 25 51 158 46 180 135 38 91 110 102 11 228 32 190 25 149 134 244 18 70 113 198 130 166 126 10 193 211 27 228 180 88 186 94 166 66 73 233 136 187 187 103 165 155 198 45 61 130 123 53 95 59 14 78 211 42 178 7 131 137 101 59 172 24 97 88 110 44 226 180 158 66 63 229 131 44 73 247 224 74 83 198 167 41 151) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 0 :der-encode #t :tests '(#(67 "" #vu8(49 50 51 52 48 48) #vu8(164 176 40 233 206 118 230 135 50 237 209 83 78 108 80 223 15 184 141 226 17 104 104 88 184 21 249 63 137 153 85 217 28 172 180 52 234 212 117 95 107 43 166 74 48 94 101 108 49 245 37 129 230 145 15 27 60 62 148 27 170 118 235 251 91 8 184 84 77 164 111 93 85 123 107 174 164 178 6 170 75 3 180 127 15 179 196 219 179 138 109 238 24 182 230 33 210 106 16 139 16 124 242 76 0 182 245 233 186 42 169 143 122 254 122 233 110 69 208 115 243 109 87 216 211 142 78 200 235 175 0 55 79 155 42 74 42 83 221 122 78 95 176 135 148 152 36 10 189 243 102 255 199 49 236 86 204 137 204 150 87 239 15 110 218 12 243 156 8 70 190 43 139 29 187 104 30 190 49 178 15 133 30 150 40 145 213 95 198 32 80 165 250 1 41 73 206 88 74 248 201 239 91 121 95 10 76 10 66 100 80 215 17 97 99 141 128 164 154 132 47 231 109 211 32 113 105 16 168 29 217 237 188 16 113 126 236 138 252 178 42 89 5 65 218 173 240 191 205 17 125 238 191 178 212 9) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 20 :der-encode #t :tests '(#(68 "" #vu8(49 50 51 52 48 48) #vu8(142 131 94 5 206 11 10 93 75 0 184 174 92 166 12 166 166 246 84 39 77 13 29 185 243 46 189 217 31 82 108 182 155 242 80 128 6 219 30 85 148 137 239 234 107 59 32 42 112 174 114 117 122 161 54 3 251 239 105 8 62 253 195 154 27 118 46 53 95 34 96 56 96 162 177 46 105 234 80 134 88 62 182 29 117 78 95 112 129 46 179 88 146 23 191 196 31 228 252 172 237 255 143 193 70 227 236 16 245 224 108 18 127 65 235 174 167 196 232 43 62 246 231 134 136 106 128 236 81 24 154 197 196 217 49 156 207 80 217 171 75 147 102 23 104 250 39 48 248 217 26 120 146 213 183 40 114 214 157 226 156 57 119 30 129 116 239 10 96 250 164 73 30 174 189 214 81 201 242 4 141 128 15 214 238 94 11 137 126 124 217 98 99 153 17 148 63 84 1 223 180 67 84 164 53 243 83 100 142 190 173 19 220 171 214 38 87 7 75 68 140 13 185 201 164 125 139 134 59 147 129 46 24 115 140 73 9 146 230 177 111 149 124 247 105 253 48 26 45 96 146 67 222 146 110 155) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 28 :der-encode #t :tests '(#(69 "" #vu8(49 50 51 52 48 48) #vu8(154 0 6 53 106 153 113 172 72 184 13 160 50 71 176 172 157 78 185 155 251 122 89 199 48 183 7 209 106 130 61 49 216 198 70 34 242 124 1 132 174 231 82 53 192 171 217 22 37 161 141 13 23 247 221 169 136 35 34 87 182 71 39 207 236 174 225 55 169 162 224 51 148 33 57 236 76 7 109 22 71 107 180 6 190 67 128 94 253 99 152 224 222 55 241 185 116 222 40 36 195 155 246 27 53 175 15 73 54 160 13 15 44 7 139 168 21 222 213 24 176 115 205 74 54 200 193 193 103 145 188 120 162 34 252 216 119 80 73 53 250 237 195 218 99 120 180 1 36 124 108 186 222 235 200 35 251 47 81 99 146 211 112 111 146 253 224 213 25 196 138 60 162 132 32 7 37 122 223 250 31 168 146 126 144 233 60 187 141 46 161 117 166 192 131 244 238 54 64 247 247 19 139 246 60 204 237 218 176 123 42 237 118 57 194 225 162 187 165 18 46 69 136 167 230 149 2 10 59 82 30 27 227 242 153 202 153 150 206 160 161 172 143 122 191 41 161 61 54 115 43 147 68 4 243 190) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 32 :der-encode #t :tests '(#(70 "" #vu8(49 50 51 52 48 48) #vu8(81 94 234 73 106 137 159 27 111 132 216 174 26 49 57 15 244 228 200 137 224 238 37 37 178 233 214 86 181 28 230 8 137 236 151 69 162 93 144 142 62 147 177 13 23 117 246 15 99 133 87 230 186 225 169 221 161 73 27 38 170 3 141 236 96 188 0 48 190 62 35 180 95 177 245 94 128 15 78 239 206 164 72 250 137 120 241 68 164 38 74 59 121 221 223 188 192 51 251 185 135 182 248 73 169 27 42 40 255 25 61 177 186 113 90 21 112 38 250 68 43 133 19 105 231 228 192 134 170 213 223 14 44 154 75 89 140 69 5 229 112 60 185 226 171 10 184 185 197 231 38 111 132 168 233 152 251 199 153 234 47 78 13 224 219 91 151 22 28 114 21 194 70 176 6 196 243 172 154 169 115 223 42 234 150 102 26 54 125 123 9 177 9 214 145 44 250 132 24 89 71 41 143 101 39 77 254 154 218 33 91 23 38 147 205 117 189 158 0 8 240 125 238 110 209 89 147 63 220 105 64 245 163 30 93 49 242 123 132 240 77 98 65 204 244 64 225 206 83 76 143 22 246 242 135 217) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 48 :der-encode #t :tests '(#(71 "" #vu8(49 50 51 52 48 48) #vu8(133 57 25 80 177 246 126 155 236 102 32 145 59 171 55 146 179 66 133 202 40 80 194 214 118 116 82 51 12 93 215 99 18 72 58 80 211 148 138 29 114 31 109 232 62 249 21 198 114 19 224 191 232 220 179 7 144 94 104 16 59 113 241 107 185 99 40 228 79 75 198 31 127 214 217 148 171 234 101 183 116 85 157 253 211 219 207 255 118 8 133 95 183 77 145 179 200 57 123 66 245 254 195 19 171 217 220 89 159 0 145 180 25 132 89 68 164 145 73 236 65 236 82 110 159 82 145 144 78 166 138 166 217 116 220 15 119 27 122 167 139 236 112 38 1 232 61 63 36 187 62 244 138 119 18 244 141 198 226 251 14 199 24 215 221 12 3 95 149 53 184 110 175 225 200 114 112 245 120 47 104 25 126 201 13 210 86 173 121 239 176 245 44 31 211 118 232 169 128 182 129 152 93 251 233 149 64 108 23 207 145 159 73 238 49 34 215 158 185 69 134 148 44 221 44 185 253 175 200 112 8 30 107 201 61 144 204 87 85 129 44 129 143 22 5 214 82 85 47 158 238 251 184 212 104 25) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 64 :der-encode #t :tests '(#(72 "" #vu8(49 50 51 52 48 48) #vu8(5 140 245 106 151 188 140 39 74 241 105 179 145 141 244 12 136 223 111 21 20 144 62 180 103 161 78 167 210 100 202 121 245 106 118 178 54 246 15 62 179 15 211 73 192 141 216 6 106 186 89 131 248 169 194 8 109 204 62 102 131 159 51 128 94 17 202 42 57 217 41 80 139 41 111 164 119 41 60 214 211 49 76 173 119 244 117 127 76 42 89 184 148 109 10 18 239 225 158 224 181 52 207 111 112 157 223 211 2 169 16 155 93 28 170 149 176 47 144 61 173 96 82 190 34 212 111 132 236 229 211 214 131 251 150 137 167 226 209 22 24 51 217 129 22 222 65 76 131 80 228 140 142 196 25 2 120 86 65 193 144 191 26 20 188 89 128 165 246 80 189 177 196 1 174 27 230 172 162 77 92 232 217 17 215 102 23 194 96 165 215 68 234 159 251 80 130 156 61 161 196 222 192 222 58 104 221 55 224 188 110 139 251 48 194 217 18 1 175 255 17 62 120 167 57 240 116 241 114 81 55 203 57 166 43 177 48 187 92 124 153 33 205 213 67 28 7 143 9 211 11 32 96 251 185 0) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 0 :der-encode #t :tests '(#(73 "" #vu8(49 50 51 52 48 48) #vu8(3 246 52 178 193 51 225 87 199 149 84 69 8 33 2 166 146 40 19 30 198 253 185 132 10 242 138 180 92 98 226 12 248 50 192 85 65 139 102 90 73 88 192 46 173 140 231 125 98 133 45 199 123 142 66 123 240 50 102 83 223 113 142 248 65 23 175 80 56 104 204 122 255 60 75 203 187 230 230 156 62 91 20 222 49 9 94 59 59 67 112 19 41 165 116 199 226 198 78 203 224 143 60 255 176 66 155 164 41 232 60 32 102 37 185 190 17 133 188 93 243 75 165 165 143 178 14 101 89 114 250 246 192 245 90 148 219 108 254 151 94 69 6 198 206 69 114 174 91 209 150 226 177 8 202 150 34 185 187 195 21 25 54 151 133 128 148 187 128 7 216 192 7 103 64 52 55 92 177 212 9 46 40 38 34 22 170 68 209 46 218 221 18 98 41 28 208 133 235 141 137 42 228 97 174 108 34 126 233 27 123 225 82 31 83 179 50 225 198 191 122 55 151 201 44 200 107 115 141 48 101 83 190 249 117 238 127 198 240 169 104 24 109 227 144 4 108 225 245 31 171 104 189 175 78 160) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 20 :der-encode #t :tests '(#(74 "" #vu8(49 50 51 52 48 48) #vu8(70 221 21 175 158 62 34 30 133 214 130 244 148 42 140 126 77 49 163 187 170 144 159 72 224 65 179 245 130 169 231 153 233 18 94 107 92 111 195 87 22 231 61 166 167 7 248 162 197 156 73 172 15 79 20 7 21 185 197 26 110 7 23 44 92 150 117 243 171 204 96 164 109 198 113 232 102 222 120 194 56 219 166 243 78 36 193 85 120 206 157 152 105 169 21 5 108 85 11 214 50 228 158 231 128 103 167 210 12 89 119 151 197 98 128 72 216 40 98 24 209 41 30 117 155 73 230 253 189 97 126 120 208 13 137 83 116 28 38 27 197 238 15 39 204 97 113 144 87 197 73 66 52 228 83 174 166 192 134 252 107 99 205 33 209 218 13 22 13 180 161 184 14 148 241 159 20 245 211 232 197 41 25 38 188 129 90 55 142 140 248 178 179 3 107 2 84 152 84 188 192 171 6 52 208 185 231 5 112 168 252 115 44 224 241 42 217 39 230 115 86 249 69 78 245 241 229 248 151 102 188 136 103 105 59 235 78 133 46 111 44 25 173 136 227 58 67 85 72 189 142 132 13 207 132 233) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 28 :der-encode #t :tests '(#(75 "" #vu8(49 50 51 52 48 48) #vu8(161 241 135 170 166 242 195 131 181 184 143 205 89 216 10 88 71 91 255 235 5 4 158 113 9 107 14 57 106 214 22 139 79 152 210 190 57 55 83 70 157 212 129 7 225 25 237 167 59 199 221 215 131 10 119 114 209 156 183 215 153 32 27 83 67 97 237 82 174 145 144 156 46 251 53 94 222 73 241 108 167 100 139 33 160 196 161 116 110 197 187 72 204 229 177 26 220 160 116 215 159 18 82 233 6 51 30 238 58 186 250 111 152 82 5 249 198 77 206 42 149 74 222 78 96 15 48 209 84 73 75 230 119 20 30 78 250 18 229 250 134 231 156 249 57 20 155 195 14 115 98 116 7 69 86 34 81 80 100 181 179 167 227 242 129 109 103 239 89 235 73 156 156 249 43 15 159 120 164 178 30 247 195 45 222 76 184 148 97 246 199 40 13 217 217 12 64 60 13 173 72 108 34 240 57 161 101 36 163 22 68 182 53 240 91 219 97 95 250 182 125 244 145 120 60 92 133 202 25 217 53 41 76 109 69 138 101 255 176 101 34 159 64 133 150 176 190 3 39 213 175 5 40 69 189 107) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 32 :der-encode #t :tests '(#(76 "" #vu8(49 50 51 52 48 48) #vu8(62 179 14 156 145 254 127 12 13 168 4 31 116 65 187 63 253 84 46 99 168 81 151 5 169 148 24 131 170 19 204 95 244 213 193 66 99 96 86 135 119 142 219 184 201 221 221 72 40 82 67 66 135 154 108 139 250 98 3 216 94 51 141 227 81 96 141 220 152 123 203 81 5 144 39 110 166 145 114 141 92 148 2 142 16 253 71 242 9 196 228 190 54 159 253 173 58 4 131 207 108 135 4 175 50 136 225 180 183 244 255 157 234 224 15 84 188 208 104 52 125 223 239 124 59 209 226 208 91 232 232 123 82 200 243 72 128 104 152 240 206 247 244 148 226 194 173 63 255 199 58 57 213 83 28 98 158 252 10 99 96 76 65 115 175 3 173 115 205 113 207 143 250 121 165 203 140 193 14 250 102 0 66 55 163 66 137 155 250 129 245 164 126 118 119 108 154 98 109 73 198 188 176 81 177 104 53 125 90 180 183 229 28 17 66 200 106 180 229 42 107 59 223 133 202 231 104 132 19 150 218 3 106 115 63 193 88 87 7 142 165 99 99 92 207 91 54 100 153 197 80 198 61 188 68 157) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 48 :der-encode #t :tests '(#(77 "" #vu8(49 50 51 52 48 48) #vu8(178 97 219 212 233 109 117 8 104 103 9 222 197 102 40 44 161 146 160 189 209 243 122 234 77 5 48 224 119 52 205 214 100 217 51 144 110 165 187 184 97 109 28 165 184 232 147 234 133 198 19 230 236 111 201 79 79 181 0 186 230 179 86 175 132 25 245 92 204 0 103 129 246 145 97 144 229 15 65 27 208 192 188 251 114 157 43 39 26 75 27 48 168 15 83 220 217 57 57 80 229 149 162 17 110 39 190 155 44 161 70 94 14 181 223 242 216 249 213 36 199 13 6 18 125 155 209 96 234 222 131 40 69 41 103 115 156 213 227 114 229 110 160 152 166 98 232 245 134 134 20 224 131 76 211 128 231 72 25 82 66 140 255 185 225 93 170 102 64 108 2 90 202 200 167 61 99 134 63 227 25 44 30 185 128 109 66 244 173 217 162 201 198 8 199 99 239 182 69 97 194 23 143 144 244 107 52 221 150 127 230 176 144 123 177 61 42 19 69 1 40 196 60 139 69 105 119 138 16 22 73 94 195 23 220 33 71 87 5 214 249 88 67 191 181 248 241 2 157 47 37 121 5 173 130 184) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 64 :der-encode #t :tests '(#(78 "" #vu8(49 50 51 52 48 48) #vu8(175 40 145 39 199 36 19 195 24 18 15 138 85 117 44 238 113 62 129 120 106 210 0 47 229 29 184 158 24 250 10 233 138 251 171 50 8 83 218 50 175 248 239 213 208 124 158 158 220 130 17 197 61 108 171 97 228 224 40 39 204 128 176 204 219 140 227 165 152 75 199 129 11 40 67 132 235 106 251 191 189 174 81 239 21 83 120 147 115 122 70 167 80 183 26 36 138 37 125 78 21 8 2 1 131 122 105 207 251 90 30 170 43 163 21 73 171 39 55 252 251 248 131 61 185 105 45 181 12 172 109 34 208 19 121 174 187 0 238 67 80 91 204 76 21 26 132 205 91 29 169 213 129 34 56 93 26 202 156 188 60 189 110 69 104 184 239 181 31 134 45 23 3 21 171 49 114 196 13 195 110 135 26 16 246 205 136 191 206 19 179 132 101 55 56 135 90 204 42 212 126 81 16 252 215 112 42 23 55 239 69 156 180 157 112 211 223 78 111 41 210 189 108 128 32 196 199 124 49 36 253 93 83 190 67 91 13 190 142 171 106 112 254 18 12 93 232 151 23 41 12 184 5 42 164 5) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 0 :der-encode #t :tests '(#(79 "" #vu8(49 50 51 52 48 48) #vu8(94 109 100 92 69 228 62 117 107 216 41 154 99 17 14 154 253 110 128 85 177 117 159 41 5 130 8 120 114 34 208 73 66 218 50 184 88 204 53 92 8 156 174 119 117 24 38 209 63 214 237 216 183 61 61 147 225 5 88 174 168 99 175 22 199 57 152 12 227 129 251 9 46 218 78 198 176 250 15 64 217 30 249 139 59 133 94 85 126 111 188 193 94 228 96 89 183 80 20 86 95 203 130 111 79 81 102 47 227 127 66 186 228 58 98 141 112 240 216 180 159 162 224 15 234 132 162 32 145 102 155 150 1 150 79 125 217 238 205 193 181 57 67 124 161 236 25 21 73 156 92 213 246 255 179 142 149 133 200 186 243 154 40 50 49 105 22 88 213 161 207 177 190 254 255 74 0 88 4 208 80 195 57 166 129 186 39 23 93 64 55 168 238 198 203 136 41 114 204 10 64 138 0 129 149 141 46 241 61 228 242 205 4 2 161 198 40 46 171 10 140 228 24 232 63 127 94 56 128 232 141 17 82 2 196 196 129 160 157 21 199 157 115 136 194 86 28 199 36 217 202 148 225 243 59 71) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 20 :der-encode #t :tests '(#(80 "" #vu8(49 50 51 52 48 48) #vu8(71 176 122 147 51 41 55 93 16 3 187 152 75 224 233 160 195 182 199 54 118 143 91 195 107 211 20 185 54 91 82 95 95 85 24 94 73 244 56 49 37 189 1 242 234 253 189 169 209 232 181 30 12 245 115 94 90 227 107 188 223 249 247 232 246 226 68 155 77 88 71 122 76 158 87 248 55 120 190 44 123 226 43 126 240 213 174 84 10 135 185 183 234 18 51 114 240 159 142 161 17 239 24 22 71 42 249 179 145 18 39 69 172 207 9 224 246 82 170 88 166 231 157 64 129 235 63 173 228 244 255 187 53 6 196 170 155 141 0 247 147 196 23 54 54 172 228 247 39 231 173 250 89 164 9 64 191 166 82 238 111 170 109 198 182 204 22 217 171 52 120 41 81 160 153 243 54 54 232 16 119 111 33 41 36 201 164 180 120 138 32 242 16 107 138 97 82 154 236 202 20 112 23 56 238 229 154 29 12 70 200 43 144 47 94 73 87 119 43 153 24 219 85 108 11 178 0 50 27 93 117 22 213 176 167 182 127 148 39 219 13 125 161 222 172 222 44 231 0 138 219 139 212 241 37 66) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 28 :der-encode #t :tests '(#(81 "" #vu8(49 50 51 52 48 48) #vu8(139 155 134 188 61 159 52 210 81 75 84 146 138 84 43 227 88 194 37 116 234 1 226 84 82 108 181 105 132 27 85 212 41 244 252 25 14 122 74 165 38 120 30 67 150 113 172 209 24 157 38 58 141 124 200 218 199 240 151 138 9 30 228 69 92 3 10 179 37 186 85 173 222 32 255 91 75 223 156 50 185 212 143 253 92 5 230 182 67 207 124 40 39 190 252 187 116 92 189 48 91 110 254 109 56 166 154 158 68 250 168 26 27 132 129 203 20 26 114 213 47 183 189 1 191 195 219 150 42 199 144 147 147 28 47 221 224 21 109 183 255 160 218 70 26 201 71 68 25 221 210 123 121 206 181 93 187 197 206 201 217 87 196 150 125 61 210 251 157 67 242 174 168 178 84 167 66 140 14 10 169 56 53 189 184 38 52 209 37 227 4 28 169 153 188 229 234 199 240 178 143 135 234 174 141 193 158 163 18 8 92 117 199 45 116 62 138 111 156 32 253 101 155 5 52 234 118 190 136 87 88 86 10 191 13 228 70 249 117 245 104 154 200 63 219 206 48 154 252 232 159 104 213 81 56 58) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 32 :der-encode #t :tests '(#(82 "" #vu8(49 50 51 52 48 48) #vu8(103 184 152 208 165 121 77 128 195 15 185 119 228 236 150 147 63 208 136 223 88 178 9 76 158 93 218 19 43 210 63 234 88 32 218 109 192 236 169 203 159 122 247 207 222 198 27 148 192 94 0 74 125 30 241 131 16 231 22 183 14 241 95 178 227 60 133 106 192 177 133 128 167 53 235 165 155 81 131 73 25 18 238 56 111 123 73 131 112 222 203 163 122 206 140 80 96 139 93 206 162 38 120 181 229 219 32 208 111 226 92 85 76 162 210 155 37 209 60 60 188 152 26 140 154 251 231 60 210 96 201 223 251 159 53 97 175 138 155 69 153 85 7 47 49 98 26 32 148 25 144 176 79 39 225 248 142 134 195 220 137 21 254 160 138 172 180 28 36 40 78 14 165 187 250 26 124 192 158 231 134 221 14 178 222 40 57 47 241 86 4 177 13 85 240 149 154 17 173 42 137 91 145 12 238 54 119 100 198 29 170 175 164 157 96 254 149 29 142 20 58 29 20 83 132 60 174 132 128 139 220 181 41 25 164 149 69 115 80 108 182 158 233 49 103 193 106 13 141 254 137 82 124 197 16 140) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 48 :der-encode #t :tests '(#(83 "" #vu8(49 50 51 52 48 48) #vu8(95 215 189 150 75 9 124 207 125 175 93 205 164 148 109 137 105 214 20 14 199 244 32 139 37 147 211 111 12 205 217 78 25 27 133 211 198 61 197 107 73 121 179 25 49 34 186 62 18 43 108 214 135 255 83 90 230 183 134 53 100 17 115 174 118 227 43 166 203 80 56 74 37 96 96 1 3 203 159 44 30 84 12 95 115 209 67 69 53 200 173 166 246 42 216 48 131 141 9 109 249 175 204 142 225 41 242 179 220 164 153 170 226 89 101 204 6 140 43 233 177 157 60 212 232 197 199 170 105 182 200 166 218 216 102 120 237 184 46 144 102 23 121 75 170 160 87 120 118 202 38 202 123 99 125 109 65 51 163 113 235 122 50 196 42 192 67 27 246 97 26 182 109 86 33 197 173 74 148 242 206 104 11 74 140 33 247 162 193 166 108 254 233 168 2 54 32 65 50 159 214 225 253 102 231 23 85 105 85 11 184 101 243 142 108 24 3 130 156 83 126 42 224 4 157 187 85 9 205 78 5 55 183 225 160 62 202 155 88 37 249 12 9 31 129 196 128 221 25 240 134 99 43 12 179 56) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 64 :der-encode #t :tests '(#(84 "" #vu8(49 50 51 52 48 48) #vu8(173 71 118 40 56 91 166 10 140 9 130 50 252 117 231 212 99 27 91 191 255 28 144 238 185 247 169 98 142 163 58 128 140 59 70 216 106 245 193 13 108 21 203 136 39 233 64 77 180 32 170 161 134 105 211 17 12 58 240 19 117 220 145 121 230 237 144 15 192 73 60 225 164 112 130 46 35 162 147 93 98 64 246 172 14 150 93 141 29 58 239 183 62 52 87 45 179 232 7 202 7 50 244 8 143 234 159 176 1 177 127 92 46 87 95 80 47 23 208 86 199 44 19 155 161 185 180 68 3 104 78 37 246 12 233 66 121 51 217 192 68 117 127 125 209 245 51 247 35 154 126 12 138 217 10 75 86 76 243 4 169 40 181 240 163 2 83 211 164 201 243 138 135 45 251 211 175 11 186 58 72 147 206 79 185 203 176 130 242 92 45 112 12 193 177 189 87 83 122 187 1 205 157 196 237 71 46 227 214 229 221 30 70 4 172 17 141 109 18 16 213 211 92 88 62 77 188 147 234 159 128 66 4 216 31 80 158 79 234 189 222 233 204 230 135 125 77 155 121 222 19 224 138 192 16 128) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 0 :der-encode #t :tests '(#(85 "" #vu8(49 50 51 52 48 48) #vu8(59 178 194 181 21 36 210 154 141 106 17 236 71 250 238 98 89 159 42 49 12 228 45 87 135 37 209 157 5 12 16 81 161 189 214 94 205 126 79 28 110 75 250 4 52 98 111 147 59 252 193 83 43 187 238 26 217 184 58 168 136 213 31 146 243 87 149 164 109 6 200 25 112 166 246 248 203 15 114 165 126 98 179 62 100 81 124 27 38 37 177 20 88 33 57 25 244 185 110 164 149 97 67 216 214 88 189 199 245 96 13 208 243 1 188 122 133 165 247 133 201 28 179 69 65 63 193 177 174 148 153 198 135 57 171 150 51 136 219 71 247 204 129 107 181 63 129 105 204 143 138 226 127 124 236 75 67 102 255 42 193 74 82 115 234 185 33 90 40 21 251 113 196 90 39 75 212 193 29 10 122 114 21 1 228 31 48 25 49 48 231 252 193 80 181 197 77 244 114 139 247 47 102 125 228 243 168 207 111 214 47 174 191 28 47 207 51 223 205 105 65 32 83 44 122 99 138 111 29 169 132 108 54 178 194 207 191 203 135 130 101 92 116 61 157 50 75 79 168 139 205 22 153 127 60 43) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 20 :der-encode #t :tests '(#(86 "" #vu8(49 50 51 52 48 48) #vu8(39 94 34 53 219 163 40 100 43 126 90 120 146 3 17 158 73 1 44 0 6 133 141 1 67 221 87 28 103 239 135 87 195 217 15 100 11 192 199 53 50 136 157 215 115 156 176 35 80 91 187 111 100 255 248 135 42 162 39 79 219 223 26 105 140 224 58 162 78 15 152 92 142 80 61 9 59 177 56 56 138 233 141 209 110 158 63 29 190 101 169 243 19 178 109 200 211 92 82 121 41 220 31 198 195 135 190 83 138 19 201 125 227 10 132 96 236 219 135 137 30 35 60 130 107 231 92 199 245 152 254 192 48 29 251 227 35 75 41 64 214 30 147 178 228 230 9 28 25 103 27 127 7 3 60 159 28 110 233 14 185 154 190 220 157 106 57 174 233 82 50 159 52 214 23 251 16 108 252 246 233 95 200 103 242 217 145 202 48 22 141 8 37 155 18 220 151 79 199 78 181 176 63 146 9 210 8 137 107 136 208 25 29 171 66 91 126 158 208 192 182 229 152 231 40 75 81 187 39 108 70 193 180 182 15 108 146 177 23 120 50 171 38 182 159 197 121 231 49 44 176 17 69 118 209 28) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 28 :der-encode #t :tests '(#(87 "" #vu8(49 50 51 52 48 48) #vu8(40 185 26 204 38 59 250 142 80 116 46 84 246 167 207 158 173 156 192 237 129 239 42 6 60 174 168 200 5 95 0 209 209 203 137 127 132 243 248 50 48 0 49 215 41 60 152 97 106 153 75 41 68 164 226 191 71 101 197 115 239 138 162 109 180 185 85 91 85 25 77 42 80 152 83 50 192 179 228 73 37 52 84 162 177 122 218 242 147 188 94 197 45 111 233 91 107 123 217 151 116 23 41 188 94 214 140 43 83 228 38 244 242 123 83 59 118 92 197 134 87 19 53 102 121 51 86 230 196 239 143 74 138 1 146 242 80 17 22 186 234 2 161 28 127 172 185 198 2 236 165 16 228 205 32 102 189 175 194 120 159 19 237 149 158 68 203 63 52 247 71 110 116 108 111 61 120 234 220 125 1 82 251 55 66 141 13 151 181 42 159 144 228 127 116 182 92 60 14 224 243 83 150 140 112 57 114 38 44 23 95 137 83 110 138 179 194 105 6 82 93 67 10 170 130 210 174 179 79 250 112 211 156 199 119 187 3 232 124 213 229 200 249 61 55 226 145 25 42 79 51 59 200 87 231 20) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 32 :der-encode #t :tests '(#(88 "" #vu8(49 50 51 52 48 48) #vu8(5 214 42 25 221 75 200 252 214 34 205 85 214 118 47 127 70 249 146 139 27 24 6 201 37 145 212 50 196 252 186 145 239 156 131 76 125 153 252 5 131 99 77 119 247 210 166 207 140 165 37 251 179 172 3 123 13 248 195 251 125 164 96 68 199 165 71 128 249 248 58 168 151 213 23 23 196 77 233 28 127 38 5 164 11 49 101 218 143 217 46 236 109 139 182 97 34 38 207 127 205 76 145 139 124 173 104 133 142 176 189 223 112 213 130 57 134 203 88 11 203 61 39 64 151 145 26 204 29 203 182 28 156 119 218 236 132 37 31 2 51 116 155 107 176 59 165 144 90 194 156 111 132 133 239 158 103 198 41 12 134 36 144 191 73 220 244 21 57 97 171 203 203 179 14 23 22 159 148 101 203 113 248 72 115 103 93 155 113 245 192 75 68 220 168 189 37 1 183 83 134 158 4 50 140 0 149 253 75 207 176 89 50 76 78 138 8 144 13 32 18 226 91 223 86 133 63 255 65 227 51 165 82 189 30 172 190 56 73 9 218 134 132 95 150 13 49 232 206 87 7 112 241 116 215 20) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 48 :der-encode #t :tests '(#(89 "" #vu8(49 50 51 52 48 48) #vu8(3 176 205 27 38 120 5 64 77 173 93 218 226 205 52 26 210 212 212 236 53 199 100 239 114 5 225 166 240 228 55 173 65 153 11 175 86 155 155 7 42 46 77 65 168 201 105 198 136 165 134 190 211 218 49 158 228 113 244 171 182 212 160 171 69 46 236 110 94 214 126 108 19 139 239 163 184 120 74 249 31 21 129 133 177 28 27 161 65 187 93 43 185 171 138 117 145 57 209 159 237 178 175 22 178 48 164 202 0 218 159 111 153 8 25 79 146 2 116 111 165 26 28 51 114 212 243 239 88 246 24 137 182 115 128 173 228 187 213 58 2 115 210 122 55 118 77 90 238 176 109 43 217 99 152 213 210 198 245 199 185 113 131 19 89 138 175 136 29 152 38 46 103 215 9 170 199 107 109 57 119 39 223 44 96 127 123 104 42 219 118 207 155 142 88 239 100 222 28 216 21 163 107 175 199 155 39 10 204 48 170 138 24 79 41 158 242 23 205 214 48 210 2 106 134 88 33 242 157 130 184 238 142 64 85 173 69 231 56 141 3 165 243 25 21 136 149 237 128 62 87 195 195 177 16 73) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-256" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 64 :der-encode #t :tests '(#(90 "" #vu8(49 50 51 52 48 48) #vu8(124 145 50 173 170 160 89 43 123 208 248 180 222 112 178 140 95 58 4 205 119 126 144 232 39 88 185 95 54 141 111 123 218 3 158 19 78 195 131 197 205 21 230 126 183 93 244 28 3 186 184 125 96 147 125 80 136 39 35 146 225 30 38 218 181 26 252 215 60 0 192 225 103 251 181 212 189 105 57 105 23 136 96 51 134 184 204 144 69 134 121 17 31 175 74 242 115 179 179 47 74 195 121 12 180 244 216 139 54 45 17 184 247 137 116 114 186 60 138 105 99 251 127 112 139 246 196 74 84 103 100 108 57 114 113 147 69 206 235 66 0 6 3 161 185 252 0 99 113 154 228 76 102 198 232 202 152 148 34 173 210 173 83 52 101 185 84 120 145 129 228 3 4 148 17 88 85 73 164 79 13 169 171 214 175 63 83 213 2 56 235 189 95 74 78 65 228 38 37 92 38 19 34 212 21 243 232 46 27 192 184 137 254 128 165 24 177 144 121 86 90 199 196 77 121 112 115 84 209 88 114 233 94 153 38 44 217 216 24 88 4 252 146 50 153 178 186 248 212 8 20 173 146 130 22 78) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 0 :der-encode #t :tests '(#(91 "" #vu8(49 50 51 52 48 48) #vu8(131 163 198 223 127 146 138 70 112 0 24 84 19 216 2 18 188 86 143 243 187 66 170 93 98 118 194 229 43 242 219 180 228 77 39 199 132 95 5 121 29 234 170 98 205 29 56 118 71 52 84 163 161 133 56 171 5 82 35 108 202 189 99 196 183 217 138 45 56 34 140 102 205 254 155 200 245 215 198 12 207 102 50 29 166 45 47 12 220 22 143 149 132 108 75 213 247 10 145 129 70 188 233 218 132 208 126 35 146 210 224 207 93 61 155 197 142 47 15 100 174 146 217 10 108 91 163 126 7 79 3 40 196 197 33 149 197 70 188 199 212 108 13 253 249 188 225 103 132 139 220 147 211 74 1 164 50 93 92 29 168 68 146 236 173 151 78 209 208 71 205 214 156 218 191 240 55 159 47 23 166 62 51 183 50 162 100 141 84 105 198 38 14 185 106 236 215 227 136 146 245 149 227 209 148 8 48 96 82 96 210 16 123 253 55 215 219 60 207 49 227 148 4 160 246 70 103 53 128 224 254 124 190 21 29 107 197 34 184 213 50 178 189 252 36 24 84 109 128 44 119 186 136 255 89 194) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 20 :der-encode #t :tests '(#(92 "" #vu8(49 50 51 52 48 48) #vu8(177 172 207 126 173 196 220 32 26 135 229 53 36 46 157 146 157 131 215 98 30 233 124 162 120 2 223 188 207 197 248 185 104 19 149 98 251 13 249 204 180 145 120 226 148 197 167 139 240 168 195 243 35 158 118 43 199 7 122 156 11 239 166 157 137 4 183 7 99 203 44 202 134 233 115 146 66 64 130 1 101 170 178 133 163 19 137 126 176 52 210 221 123 156 78 142 23 129 168 236 236 240 28 97 7 55 68 62 169 134 40 233 78 141 148 219 106 179 38 135 50 44 235 61 12 197 174 115 22 247 115 108 63 200 110 138 145 27 48 198 187 128 193 187 250 51 213 250 139 93 79 237 19 186 67 63 102 193 195 35 94 79 219 42 169 21 20 27 52 50 62 100 187 57 212 125 53 130 173 39 81 248 118 210 46 52 142 92 78 255 158 179 141 128 223 160 166 111 157 249 225 249 106 218 186 29 81 57 3 195 251 170 142 19 121 104 0 21 255 127 166 89 242 101 232 38 92 88 23 231 66 144 29 158 156 140 155 49 224 76 80 230 15 228 144 79 233 169 186 205 62 19 56 112 163 136) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 28 :der-encode #t :tests '(#(93 "" #vu8(49 50 51 52 48 48) #vu8(57 62 194 181 253 102 251 234 198 205 251 98 244 63 131 36 131 200 149 247 169 157 241 212 75 116 21 92 158 199 164 23 78 168 15 0 17 147 61 154 41 136 242 236 210 177 64 18 7 9 35 156 164 18 210 207 147 218 48 247 98 110 77 46 65 5 26 41 132 108 71 98 167 151 30 191 1 87 134 186 114 14 146 157 235 15 62 189 252 221 77 217 224 141 217 222 197 159 49 105 122 110 65 170 32 86 123 49 170 10 204 230 34 80 131 33 161 240 204 253 110 248 92 153 187 55 28 224 41 142 93 80 29 37 151 176 80 139 230 131 137 133 203 149 5 28 18 113 180 199 237 251 232 151 110 101 100 136 255 97 248 221 194 145 200 115 3 78 50 252 126 166 93 197 149 3 187 73 238 39 157 106 165 166 152 218 119 246 172 32 214 54 3 48 142 252 32 6 126 144 61 211 65 69 153 237 207 196 136 220 27 147 227 236 77 226 252 161 190 135 114 65 61 16 171 101 5 143 159 29 164 197 171 188 62 121 150 94 173 124 176 107 79 7 82 216 114 83 80 203 132 195 172 229 26 34) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 32 :der-encode #t :tests '(#(94 "" #vu8(49 50 51 52 48 48) #vu8(89 238 151 87 198 215 126 26 41 189 164 194 208 198 154 253 137 168 218 140 250 230 43 236 31 135 6 141 227 200 85 66 29 32 23 44 8 13 141 92 162 79 104 0 144 72 234 27 164 167 44 57 122 97 120 134 127 33 245 0 207 216 179 82 228 207 2 217 156 91 8 77 107 181 0 30 32 224 132 91 98 211 186 255 142 134 197 169 168 214 181 203 217 10 33 80 18 191 242 151 222 221 228 153 120 200 238 246 157 119 69 197 134 113 127 207 54 21 248 61 162 81 175 118 167 123 32 53 163 191 148 247 5 252 168 157 61 252 31 234 239 194 26 25 144 201 172 200 60 229 50 1 18 81 78 79 154 75 174 38 79 13 106 16 11 228 164 79 144 4 80 175 201 150 121 240 126 160 251 232 236 73 65 49 131 6 2 213 113 53 46 184 247 197 24 18 208 107 83 2 52 19 172 67 111 39 232 217 137 52 56 239 160 13 219 191 171 151 95 24 162 92 159 24 158 239 217 13 215 81 255 127 54 172 10 194 46 21 20 200 250 24 130 175 5 81 75 214 195 40 2 141 226 141 183 158) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 48 :der-encode #t :tests '(#(95 "" #vu8(49 50 51 52 48 48) #vu8(58 68 232 79 152 42 34 125 214 92 168 86 33 235 120 109 137 248 111 105 130 81 240 226 151 214 7 233 76 89 236 36 106 171 141 245 96 27 209 220 89 89 118 141 209 51 32 237 106 159 197 216 226 66 77 37 29 174 149 20 187 255 168 9 74 228 139 34 111 135 161 230 43 15 80 170 195 222 122 181 13 172 116 52 177 199 47 198 182 200 32 224 198 83 216 71 120 55 202 18 189 83 162 67 90 86 32 22 103 208 36 29 193 245 194 195 167 62 76 55 251 143 16 207 191 242 57 205 218 94 234 234 216 135 165 5 92 138 47 21 111 189 183 181 236 212 88 203 184 186 163 181 100 4 97 71 175 28 250 115 105 206 182 2 233 236 245 211 122 245 224 168 183 147 100 16 210 218 198 24 131 232 232 97 53 25 226 198 168 130 134 9 156 122 118 17 112 64 82 244 193 192 79 155 64 230 75 208 203 189 185 9 187 161 63 180 124 255 71 89 75 62 20 81 153 46 192 235 189 77 20 235 114 205 77 54 132 36 65 144 191 147 250 163 203 169 62 221 54 119 255 242 1 136 216 162) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 64 :der-encode #t :tests '(#(96 "" #vu8(49 50 51 52 48 48) #vu8(72 0 250 245 51 139 119 149 168 102 106 40 191 138 115 243 49 147 173 32 123 188 161 61 195 243 186 246 57 127 55 98 232 20 194 55 245 81 44 153 221 30 81 36 137 47 125 160 156 141 44 202 229 98 196 253 253 173 146 159 29 232 252 60 67 78 122 153 160 229 108 220 239 246 156 0 241 4 255 178 144 122 6 77 160 229 188 98 87 103 254 35 16 72 49 213 69 193 239 31 130 103 160 255 214 23 85 189 143 82 12 207 121 115 85 135 159 170 117 46 216 213 152 20 174 172 113 63 52 240 125 142 168 3 201 14 208 88 29 117 54 70 213 89 161 60 74 130 203 224 70 85 245 212 4 178 104 24 68 112 116 240 230 128 18 249 90 207 197 158 52 30 107 229 153 1 208 11 47 127 65 189 3 66 19 98 76 79 51 179 160 2 172 162 184 68 125 242 85 39 135 0 237 211 29 46 226 114 194 72 235 40 68 114 20 68 212 163 131 68 255 242 142 7 135 194 241 56 238 132 247 203 204 29 74 201 110 53 75 168 186 246 119 147 242 70 108 75 72 243 159 55 37 62 131 150) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 0 :der-encode #t :tests '(#(97 "" #vu8(49 50 51 52 48 48) #vu8(64 104 8 138 5 42 1 155 212 5 99 82 114 237 33 163 187 118 153 239 75 210 32 245 218 25 81 170 65 159 173 244 23 211 248 24 125 73 238 31 207 23 243 88 191 70 66 112 109 246 132 241 234 203 132 36 174 148 220 135 174 78 177 7 57 105 232 248 116 212 151 43 103 29 179 127 63 89 242 16 213 10 117 182 248 220 194 10 39 73 37 62 121 155 50 89 249 169 94 213 218 151 29 9 60 226 179 243 136 177 71 120 218 216 91 20 235 64 74 60 177 106 24 60 199 50 223 57 52 33 212 143 224 9 67 149 185 2 112 189 118 15 247 169 251 173 25 213 42 36 170 9 37 93 30 192 152 200 120 209 132 152 254 153 41 165 47 105 156 247 162 74 214 55 39 186 136 189 179 219 110 167 104 42 6 183 0 69 89 209 245 52 109 16 183 9 229 201 58 138 36 251 20 135 197 50 183 231 168 123 20 61 34 162 33 63 89 30 123 57 89 180 32 89 62 96 63 91 238 180 69 79 200 220 207 11 212 211 234 73 200 246 173 103 243 172 144 170 179 252 115 219 143 251 218 45) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 20 :der-encode #t :tests '(#(98 "" #vu8(49 50 51 52 48 48) #vu8(183 229 225 44 164 237 83 30 232 5 151 54 145 225 217 113 183 154 234 80 42 116 22 165 109 20 228 156 48 20 130 102 131 35 255 139 220 2 171 73 201 142 192 178 198 127 97 144 205 195 236 84 140 166 250 5 249 74 104 234 162 17 31 1 214 227 170 189 133 19 211 238 10 82 83 136 49 236 44 88 118 107 110 40 207 125 11 86 26 138 45 58 84 207 48 169 142 119 116 105 225 178 241 113 248 69 122 252 226 224 182 30 193 71 221 126 238 100 217 83 84 101 214 38 9 32 56 184 72 181 86 194 212 136 253 97 105 204 17 21 225 13 208 90 75 119 160 86 15 206 244 207 59 166 8 222 230 163 62 9 240 14 1 74 204 58 46 61 254 235 49 40 219 83 177 7 92 105 34 249 217 14 112 208 199 222 96 197 116 32 102 139 133 11 224 193 39 210 104 59 56 206 19 166 219 183 201 203 157 43 238 183 224 6 19 161 56 93 241 8 139 56 40 128 129 242 18 14 148 125 82 42 90 20 91 137 158 174 220 33 185 7 43 32 29 146 239 184 225 150 72 88 227 117 116 207) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 28 :der-encode #t :tests '(#(99 "" #vu8(49 50 51 52 48 48) #vu8(171 36 55 155 164 110 134 201 21 55 77 38 186 37 33 114 130 69 75 37 91 200 166 117 215 180 145 183 215 171 118 61 124 166 173 115 82 151 191 206 67 52 183 43 44 116 254 104 204 206 225 176 67 23 2 62 227 39 27 166 182 116 184 114 55 241 65 233 76 45 68 111 180 99 68 191 216 130 55 65 236 147 28 168 16 80 137 196 142 177 153 49 93 251 97 94 23 164 174 215 79 150 84 161 207 89 23 5 10 198 162 6 94 47 136 134 244 179 251 138 192 146 137 27 164 98 234 211 52 203 100 196 174 26 41 83 123 164 251 83 170 107 172 245 33 169 132 199 201 224 253 14 175 229 253 53 76 117 236 255 181 236 53 111 179 79 42 246 117 147 145 97 81 242 25 99 90 215 175 236 28 232 167 121 8 50 25 215 253 209 226 140 158 120 250 110 49 46 245 80 123 119 113 30 47 88 147 75 111 180 51 121 198 7 249 158 107 79 68 154 11 108 75 92 114 49 113 214 63 215 74 52 51 46 197 74 45 15 77 28 49 9 11 139 213 0 44 152 29 41 134 251 45 215 245 240) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 32 :der-encode #t :tests '(#(100 "" #vu8(49 50 51 52 48 48) #vu8(108 178 210 183 35 88 22 249 236 119 112 75 154 146 225 15 111 213 69 34 42 2 158 189 228 86 254 10 127 71 113 29 38 239 64 18 230 68 95 164 85 253 204 144 82 92 228 178 24 160 203 124 0 2 243 51 26 207 113 85 206 210 178 120 212 107 250 103 102 97 208 203 141 253 168 4 139 209 6 110 70 207 220 195 135 139 132 90 176 219 217 102 139 241 15 237 171 142 151 27 106 199 180 46 132 206 12 125 81 173 226 125 195 23 48 106 142 98 61 248 172 86 225 95 60 240 9 146 64 143 86 68 225 123 115 101 80 175 4 54 27 199 181 220 177 13 169 241 247 223 68 21 242 36 59 172 207 50 181 0 214 157 195 128 32 96 246 108 213 236 230 224 187 205 185 216 193 178 21 45 78 116 126 142 1 120 137 167 169 192 231 26 190 29 198 200 244 89 60 201 19 207 161 198 140 92 133 251 32 219 93 194 114 151 96 95 205 119 216 31 187 157 17 79 90 52 60 7 83 238 171 186 146 211 166 21 121 37 89 138 92 132 2 45 233 234 145 58 45 210 184 102 16 69 98 2) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 48 :der-encode #t :tests '(#(101 "" #vu8(49 50 51 52 48 48) #vu8(156 98 33 246 35 224 145 225 51 241 55 248 44 59 112 12 144 126 121 79 252 86 126 0 177 81 95 91 125 205 98 51 4 62 128 77 133 105 44 30 156 185 196 166 52 253 61 121 139 117 32 94 89 154 20 150 129 254 140 139 118 109 59 157 251 30 80 172 224 47 88 127 169 3 169 39 102 24 46 85 200 42 251 16 137 59 242 156 166 73 21 71 122 191 22 77 99 227 200 96 197 51 1 105 173 74 119 22 73 255 44 56 174 179 106 117 74 169 131 119 254 137 3 36 61 217 52 44 76 141 7 83 245 177 79 5 187 236 62 33 73 247 74 88 99 248 178 151 51 206 161 0 134 174 255 135 38 160 211 197 253 221 3 122 39 152 67 229 233 145 48 23 42 25 216 250 139 93 138 210 129 95 111 6 165 94 65 61 87 77 72 5 87 44 98 86 182 62 139 142 179 56 207 84 100 94 94 110 133 61 167 37 4 80 194 72 138 207 30 123 99 221 216 151 107 8 115 208 25 55 181 188 206 140 240 53 212 27 79 161 64 18 53 92 53 78 107 161 227 198 116 70 50 95 226 36) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 64 :der-encode #t :tests '(#(102 "" #vu8(49 50 51 52 48 48) #vu8(70 87 208 62 134 87 206 29 90 96 215 85 118 93 200 202 58 201 86 207 143 144 37 204 160 38 29 231 12 96 220 63 253 50 5 219 60 218 170 21 80 11 101 43 191 130 50 18 150 3 126 46 251 252 170 144 61 239 82 209 212 81 157 249 250 159 197 212 195 105 18 83 60 221 61 140 120 167 44 7 209 107 98 64 184 106 101 189 231 175 91 171 97 126 211 94 59 122 180 108 147 217 133 122 100 207 131 16 154 254 131 149 94 233 72 81 132 100 14 167 189 45 122 32 52 95 9 51 133 110 45 251 210 186 137 5 195 119 255 131 45 165 107 157 123 204 39 222 150 18 95 92 34 222 33 141 222 222 41 140 149 238 32 217 189 150 190 230 8 218 243 122 219 81 231 200 210 33 200 34 191 43 3 13 236 41 71 140 32 139 150 107 47 105 104 89 77 105 24 231 168 255 112 89 56 151 143 245 111 37 208 8 227 247 237 60 144 32 12 92 250 197 186 112 9 192 173 218 105 223 148 98 27 15 170 167 154 35 221 160 175 135 141 81 151 105 231 45 225 39 218 246 159 163 214 45) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 0 :der-encode #t :tests '(#(103 "" #vu8(49 50 51 52 48 48) #vu8(39 200 178 158 108 189 121 160 165 100 183 173 133 107 54 15 134 33 250 145 98 56 19 230 113 83 111 204 182 151 32 205 117 150 235 2 60 170 164 64 138 72 10 20 177 177 117 115 210 161 144 83 13 0 145 44 90 132 48 174 41 190 153 20 142 60 224 168 63 165 167 137 95 174 143 42 14 160 229 105 17 230 158 252 86 104 1 139 79 220 215 172 108 20 119 19 120 11 53 149 12 236 160 112 98 100 15 168 178 201 70 199 223 219 9 246 156 40 230 5 77 189 37 222 128 127 78 215 80 152 93 92 33 5 147 40 160 218 158 216 204 178 119 212 115 198 167 143 135 61 131 165 218 179 103 95 104 131 167 49 3 217 152 188 236 110 145 21 3 56 201 176 155 132 126 101 196 48 166 67 55 48 111 154 249 204 198 85 118 34 77 64 87 100 194 57 226 177 250 163 117 217 44 172 208 155 182 160 236 44 230 22 21 228 49 154 225 228 145 131 203 15 150 71 180 80 73 122 233 0 251 190 34 222 36 179 30 15 44 176 197 178 109 225 54 153 34 85 52 194 24 176 142 77 66 93) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 20 :der-encode #t :tests '(#(104 "" #vu8(49 50 51 52 48 48) #vu8(62 74 231 254 72 136 255 113 26 52 132 137 164 119 10 191 202 80 237 11 96 186 57 198 16 25 114 201 109 202 84 40 252 214 226 244 63 253 73 63 29 228 28 34 205 252 179 39 167 163 212 63 243 194 33 140 182 196 138 40 123 136 83 115 232 251 76 220 28 121 156 162 86 52 30 181 119 237 242 56 130 30 147 16 240 205 188 152 202 46 72 247 177 220 165 193 184 97 166 184 15 36 111 121 72 194 157 180 178 108 100 143 102 87 59 74 203 5 140 54 164 98 242 214 127 234 45 35 191 68 155 134 60 1 111 58 98 35 32 220 179 118 13 13 163 79 152 165 16 117 177 80 118 224 53 35 253 243 112 162 128 2 85 187 238 190 12 9 32 166 149 198 202 119 88 232 30 206 30 25 149 5 223 136 11 54 95 59 78 232 151 239 125 4 195 3 50 44 39 222 209 131 236 13 67 39 132 182 239 205 171 85 142 33 75 131 156 168 176 204 77 170 248 0 153 246 155 151 145 245 88 79 13 33 202 79 246 111 58 204 62 94 0 58 109 239 166 129 255 218 10 88 248 219 136 97) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 28 :der-encode #t :tests '(#(105 "" #vu8(49 50 51 52 48 48) #vu8(137 227 70 33 193 94 102 56 70 155 196 228 217 82 67 241 240 173 105 142 63 55 77 207 139 183 71 120 241 215 237 181 72 27 34 255 28 241 240 187 48 172 47 14 132 40 22 134 46 85 201 228 123 135 221 165 208 95 11 136 224 38 98 164 224 253 69 101 41 181 53 137 52 17 186 221 253 150 87 113 133 123 124 161 80 79 11 9 82 242 182 15 36 19 157 184 33 164 80 32 145 30 148 232 53 56 65 117 111 255 16 151 149 145 74 70 177 38 216 227 157 201 192 210 206 72 130 248 14 232 67 186 201 6 13 166 47 1 207 86 163 89 105 129 18 2 40 172 187 29 168 245 184 148 21 221 101 43 20 88 194 30 197 28 210 253 216 156 57 31 7 193 87 55 215 72 88 82 179 123 186 69 242 125 149 253 72 211 6 46 162 32 25 220 144 136 226 123 37 172 188 72 98 80 72 90 122 234 160 133 50 165 169 224 122 122 118 117 211 42 23 134 117 206 81 163 160 167 86 24 5 150 116 44 132 70 176 56 59 55 232 111 169 16 231 96 52 162 100 142 147 168 13 185 112 245) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 32 :der-encode #t :tests '(#(106 "" #vu8(49 50 51 52 48 48) #vu8(55 51 245 7 24 121 18 101 82 49 220 246 66 173 159 126 221 203 182 219 50 70 122 73 42 227 195 11 97 255 250 46 209 65 252 37 1 209 29 254 59 54 238 27 16 117 67 104 239 154 4 199 90 162 193 191 206 32 224 237 164 228 106 109 17 46 41 130 124 3 221 251 67 15 56 108 155 36 167 254 212 232 226 108 112 73 237 9 221 242 49 218 193 131 213 4 111 193 65 62 134 182 151 193 252 46 179 15 19 48 110 160 73 70 123 78 195 172 55 245 108 232 36 230 244 121 118 64 199 236 70 162 210 143 41 40 36 224 46 91 222 157 252 249 224 153 223 6 206 180 145 28 220 95 219 164 89 189 177 154 252 232 250 140 235 208 198 74 136 6 85 38 79 53 32 30 229 181 228 206 221 182 78 88 60 28 132 157 108 232 217 119 243 232 66 77 55 175 111 91 129 11 220 139 223 10 195 132 187 13 199 88 86 49 122 204 18 182 107 10 144 129 174 109 42 251 110 179 134 132 223 10 135 8 231 202 69 128 155 152 179 237 128 146 171 215 124 175 56 82 153 119 185 165 43 140) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 48 :der-encode #t :tests '(#(107 "" #vu8(49 50 51 52 48 48) #vu8(115 192 238 163 75 204 194 22 81 40 234 145 65 250 111 57 194 111 216 140 82 130 203 194 110 54 184 144 22 166 55 29 218 205 187 171 242 120 135 80 0 171 85 9 73 165 162 109 38 114 226 33 155 216 223 12 167 253 77 66 87 217 175 106 226 14 247 188 229 241 181 206 184 60 202 178 194 228 164 122 36 132 147 174 133 96 50 32 169 189 62 229 70 1 59 245 92 241 189 37 37 86 3 229 77 246 126 85 27 96 120 180 66 209 136 240 178 93 197 234 140 51 0 79 18 99 32 105 18 32 245 21 231 77 53 72 227 160 138 25 71 134 241 212 46 120 27 13 66 239 235 70 30 42 252 147 4 37 79 44 13 216 94 77 128 177 107 160 214 243 86 18 97 85 187 153 130 15 0 193 125 48 123 199 202 103 124 147 195 147 239 155 47 180 191 231 94 88 118 52 99 144 155 26 57 87 247 117 240 31 18 238 138 186 112 74 99 1 79 131 148 28 52 144 218 69 21 190 45 74 209 221 67 147 74 190 21 53 222 241 179 191 229 138 67 187 14 223 41 100 36 226 228 50 0 60) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 64 :der-encode #t :tests '(#(108 "" #vu8(49 50 51 52 48 48) #vu8(23 104 206 249 101 179 229 234 55 45 180 78 33 29 224 90 228 182 156 46 212 70 80 132 233 229 94 96 43 64 103 209 5 141 204 176 42 113 112 34 248 150 210 250 47 111 86 191 84 207 170 115 236 33 100 109 221 172 233 158 60 76 214 220 42 60 158 193 166 140 185 28 221 233 213 102 113 238 134 106 60 104 27 134 125 18 96 54 129 30 48 108 199 50 11 177 125 106 2 88 24 180 104 193 5 38 97 172 36 117 134 95 222 177 31 254 189 149 33 210 103 143 237 2 185 179 219 34 27 59 245 20 216 215 167 121 138 182 187 7 123 148 203 27 194 44 84 28 193 90 131 133 85 126 133 211 200 143 98 46 147 225 17 147 182 49 163 49 249 147 19 131 104 153 32 21 253 112 248 203 135 22 130 43 107 244 24 210 67 130 121 148 143 195 176 100 28 150 133 241 187 133 62 92 234 5 104 247 225 192 64 193 51 3 205 144 120 55 185 82 193 225 243 235 101 19 136 140 92 173 67 158 114 6 188 63 155 147 85 197 217 18 99 223 159 40 78 95 1 76 178 240 82 228 236 246) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 0 :der-encode #t :tests '(#(109 "" #vu8(49 50 51 52 48 48) #vu8(85 226 165 26 83 153 163 236 158 160 180 190 196 21 241 197 63 207 204 158 11 116 204 39 200 11 160 116 99 190 84 29 33 224 107 75 64 182 188 195 224 66 191 229 134 236 159 3 104 98 190 7 93 132 149 107 13 50 109 146 173 33 161 80 20 140 157 239 49 169 0 76 25 216 136 202 75 70 164 133 50 73 119 147 217 226 214 31 48 90 20 249 91 230 228 250 153 193 185 177 254 234 156 239 152 3 83 0 109 113 194 204 49 5 250 15 67 14 134 223 164 23 67 177 24 170 255 109 19 61 149 197 47 103 149 173 181 63 192 241 129 97 246 116 10 36 14 115 248 200 95 198 77 46 116 226 51 138 206 77 19 225 30 2 176 243 132 128 56 252 255 131 146 161 102 197 129 233 221 31 123 130 99 223 171 213 226 12 167 219 240 28 235 213 81 162 109 133 25 153 121 168 185 124 23 25 81 214 4 233 224 9 172 141 25 150 92 7 154 164 240 156 46 235 111 26 237 152 146 96 118 25 101 196 249 170 19 95 14 215 40 198 132 255 85 91 61 218 79 19 99 105 211 252 181 101) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 20 :der-encode #t :tests '(#(110 "" #vu8(49 50 51 52 48 48) #vu8(169 22 154 5 83 168 240 249 4 176 164 160 13 207 82 71 248 123 184 233 48 241 128 170 42 84 60 252 209 123 7 252 29 98 127 219 6 31 198 182 251 220 43 175 137 211 189 139 35 68 243 199 197 70 159 136 72 69 23 36 61 22 138 144 169 99 64 139 99 168 72 206 159 188 140 18 243 88 229 83 237 98 75 92 205 222 138 148 26 79 100 210 147 100 248 59 191 126 191 16 182 10 133 215 60 52 108 126 70 46 120 89 228 183 114 137 48 71 42 11 46 103 235 131 107 77 101 178 12 28 218 104 245 76 155 124 195 8 64 177 254 99 65 118 203 142 139 224 62 205 43 159 50 238 60 188 152 31 133 41 213 162 5 208 187 109 138 202 87 107 105 230 71 143 28 3 59 27 177 110 241 82 42 124 165 234 31 124 183 18 48 104 21 86 227 205 30 244 136 180 32 4 35 111 158 124 11 66 30 4 191 116 102 112 249 193 213 21 194 56 117 187 152 2 103 254 102 177 112 80 48 77 178 88 103 43 53 189 85 45 161 228 134 10 244 245 100 223 48 86 181 67 121 76 254 207) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 28 :der-encode #t :tests '(#(111 "" #vu8(49 50 51 52 48 48) #vu8(11 173 57 205 138 153 135 235 140 90 246 92 132 145 245 217 117 236 131 51 17 209 174 152 216 154 78 222 148 155 147 207 205 127 69 194 25 31 90 93 239 131 113 162 231 235 38 233 102 55 77 33 189 33 225 60 82 255 168 172 76 69 236 202 190 253 11 211 114 56 158 166 248 87 226 212 79 124 229 72 242 177 138 105 147 163 202 129 234 20 223 73 78 76 22 70 38 139 110 125 195 148 90 6 24 165 244 68 122 131 9 165 204 212 90 141 197 155 211 202 201 52 135 7 53 89 17 237 9 244 226 213 71 45 160 243 67 190 30 217 8 187 68 98 200 100 70 187 95 210 39 118 19 145 195 103 34 118 69 202 81 196 196 137 55 53 9 63 165 8 112 90 113 87 234 183 118 165 21 162 228 3 96 181 12 219 39 57 148 180 233 158 165 250 32 58 175 195 84 144 101 28 110 88 105 173 152 121 241 123 214 229 200 182 51 109 15 52 219 106 248 250 10 98 187 1 171 39 177 213 235 90 125 24 175 168 11 142 243 38 159 8 73 169 158 4 131 117 127 59 140 147 162 113 0 184) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 32 :der-encode #t :tests '(#(112 "" #vu8(49 50 51 52 48 48) #vu8(151 97 140 2 47 83 247 230 135 198 242 230 49 205 204 208 123 232 4 135 63 199 14 118 186 119 234 113 49 234 37 246 141 65 226 173 198 216 212 34 106 7 173 145 83 65 164 192 92 186 46 193 112 123 20 245 237 181 185 42 37 220 57 166 65 135 64 251 71 133 42 221 144 143 64 204 200 186 236 195 67 253 254 84 210 34 203 47 159 218 93 138 100 51 51 147 112 123 209 205 44 74 136 241 61 221 117 149 170 77 182 72 17 21 170 165 165 219 180 22 35 196 93 10 77 62 70 56 164 191 5 184 104 3 174 96 125 216 249 114 96 252 60 217 230 254 88 227 220 36 114 156 242 167 151 84 55 66 32 91 147 160 249 43 50 48 94 179 229 47 199 98 243 51 60 38 222 84 59 239 201 84 5 28 121 254 47 13 194 226 177 187 133 88 39 182 193 27 52 20 26 122 146 117 8 59 210 70 182 23 74 241 183 88 175 238 55 33 105 97 180 14 111 80 74 117 37 233 158 236 108 158 16 18 181 196 183 60 247 60 161 15 153 60 106 15 205 155 7 235 144 83 246 156 20 98) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 48 :der-encode #t :tests '(#(113 "" #vu8(49 50 51 52 48 48) #vu8(145 91 242 48 171 155 33 10 183 166 198 72 22 43 173 213 229 96 36 220 199 131 186 153 147 214 210 224 42 253 46 228 142 102 36 232 197 54 84 92 41 116 104 254 62 78 118 192 92 152 117 51 16 165 223 132 194 244 120 206 83 120 63 155 97 0 139 65 194 96 194 180 132 199 218 234 127 103 204 95 113 93 129 176 123 255 174 173 0 34 65 159 44 8 94 235 105 128 124 161 137 180 66 48 11 232 221 59 58 113 227 236 112 105 21 109 33 68 119 7 73 101 167 214 247 71 197 24 143 16 173 124 38 97 79 164 132 116 237 231 247 168 149 126 234 137 229 175 87 197 154 97 93 82 224 193 104 55 205 231 172 25 134 7 195 87 38 175 157 154 142 78 145 114 93 49 244 122 5 45 201 244 17 77 173 65 1 211 178 29 145 158 196 224 111 200 223 15 175 145 238 165 149 64 57 39 234 186 95 191 63 155 106 238 244 114 26 169 162 200 153 235 214 243 130 23 112 134 61 29 210 222 78 141 207 176 153 120 245 201 32 56 47 10 132 60 6 7 246 106 120 13 83 67 104 34) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 64 :der-encode #t :tests '(#(114 "" #vu8(49 50 51 52 48 48) #vu8(3 72 122 39 77 204 171 101 199 99 86 171 186 241 22 106 107 142 64 191 65 252 25 54 46 96 145 3 214 139 13 166 35 255 166 85 205 34 41 33 222 171 204 120 62 50 205 146 45 83 76 147 11 32 18 240 53 85 105 140 149 72 183 88 128 148 181 120 194 12 26 116 10 84 173 251 134 120 3 102 237 149 29 1 177 98 208 89 131 46 37 27 56 161 3 57 77 236 41 27 199 44 152 44 35 9 145 134 41 220 101 109 150 168 155 113 245 117 32 219 232 186 162 91 151 230 139 224 187 232 72 60 26 65 203 89 240 39 128 139 162 43 130 65 60 65 37 148 25 28 34 147 175 87 15 2 204 36 207 60 121 150 42 70 208 99 188 18 217 218 92 27 31 86 33 65 149 125 4 149 54 212 145 181 3 152 210 205 141 150 138 221 63 191 168 99 122 254 54 207 192 177 180 217 83 170 171 195 247 62 148 253 247 43 168 192 109 64 94 34 78 232 12 153 94 215 179 37 83 222 200 5 144 242 120 118 132 232 220 209 9 98 227 237 130 128 219 194 33 125 129 155 157 231 154 235) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 0 :der-encode #t :tests '(#(115 "" #vu8(49 50 51 52 48 48) #vu8(170 182 193 196 71 213 177 13 146 25 99 50 147 163 105 52 137 132 200 97 70 152 253 124 70 230 54 233 2 244 199 254 137 227 30 244 212 6 79 218 85 221 156 254 132 97 113 63 205 240 246 164 92 136 214 239 235 16 206 2 248 211 106 222 88 149 81 152 143 73 21 141 61 84 110 116 123 224 249 230 95 161 180 194 2 175 240 155 93 18 254 171 239 82 233 33 183 25 207 69 20 122 182 126 111 10 169 220 187 169 156 28 55 70 203 12 208 227 80 154 193 238 208 90 46 217 26 250 66 76 106 51 39 98 69 169 74 155 221 24 63 190 172 158 125 147 5 22 67 120 79 18 30 19 232 155 149 25 10 247 197 17 118 207 113 235 131 43 62 183 56 102 232 151 129 111 169 251 247 3 179 31 25 82 175 93 216 198 132 0 55 75 236 228 241 186 237 6 241 156 92 93 104 161 223 142 50 138 241 200 240 119 155 184 248 5 240 173 182 91 173 107 206 28 37 39 212 205 184 149 113 200 51 240 157 67 117 215 93 174 91 190 23 212 118 8 131 61 16 65 40 141 101 142 19 108) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 20 :der-encode #t :tests '(#(116 "" #vu8(49 50 51 52 48 48) #vu8(19 100 160 24 28 104 93 86 29 68 165 211 167 53 162 99 0 53 132 157 230 236 203 6 188 82 67 28 46 166 153 7 251 8 242 253 115 199 142 163 168 73 188 212 141 47 98 184 158 55 14 59 183 74 211 177 249 214 99 221 5 211 200 41 203 210 217 124 212 40 75 222 132 194 147 239 69 188 15 249 142 180 125 172 36 248 176 157 195 147 149 218 88 127 206 236 122 47 16 189 239 46 176 252 47 164 240 31 101 46 106 176 137 134 217 91 251 21 18 90 229 194 111 132 241 22 130 233 238 74 111 25 251 115 182 108 178 121 81 39 169 233 140 98 61 140 225 50 49 4 113 255 111 80 209 167 173 219 45 132 76 60 222 125 28 123 252 250 207 100 178 136 11 80 222 230 166 135 18 61 49 61 116 255 131 189 161 254 9 180 198 49 21 172 156 9 174 140 147 99 39 183 0 38 138 60 131 165 103 36 166 160 134 163 74 253 92 140 202 233 165 188 50 37 190 53 172 93 107 0 245 164 200 116 102 162 197 250 62 102 1 38 149 125 76 180 235 208 100 16 108 4 86 134 75 169) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 28 :der-encode #t :tests '(#(117 "" #vu8(49 50 51 52 48 48) #vu8(82 16 212 186 200 94 43 164 171 243 155 65 200 145 35 123 211 100 71 104 59 154 216 14 115 140 25 51 130 140 100 40 8 92 13 67 120 181 68 206 107 214 51 100 12 5 143 163 219 209 211 9 146 1 64 255 71 104 201 7 16 207 225 3 30 212 113 189 76 227 3 68 197 235 26 206 240 113 59 2 132 27 97 44 114 13 36 39 109 243 102 243 197 126 86 84 88 95 17 164 143 228 125 25 246 41 109 254 47 132 93 189 145 128 127 46 182 217 73 31 47 242 108 207 236 79 83 201 161 212 138 167 208 189 122 218 249 76 186 197 131 249 193 141 125 111 201 155 133 85 94 188 29 203 40 232 25 58 226 95 209 182 37 55 82 53 230 9 232 233 233 123 211 57 116 114 49 219 178 139 11 22 215 162 133 23 26 121 17 48 167 146 98 125 137 8 137 165 130 170 246 174 168 83 167 252 33 78 58 108 187 250 153 167 8 59 134 180 168 224 198 158 119 98 199 46 66 91 115 112 174 94 180 68 223 61 83 156 141 252 201 1 30 174 161 48 245 66 42 91 226 99 181 188 102 174) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 32 :der-encode #t :tests '(#(118 "" #vu8(49 50 51 52 48 48) #vu8(27 179 125 165 206 103 189 189 84 93 89 243 104 179 57 253 245 229 235 141 33 120 221 54 39 153 85 201 178 169 118 22 243 128 152 63 137 185 88 197 200 69 174 6 31 113 172 84 66 47 243 64 139 146 25 193 228 50 136 144 166 117 126 99 93 194 212 179 255 45 157 214 131 228 140 20 100 156 133 178 50 159 27 78 164 22 69 149 102 182 63 229 12 255 109 231 105 203 26 104 179 114 189 25 102 203 197 89 25 249 121 183 41 59 207 213 158 41 156 24 208 205 49 152 239 126 111 130 140 204 126 6 220 170 201 239 16 158 130 50 255 5 62 154 204 201 93 18 131 41 65 229 144 13 195 18 197 82 181 183 191 92 0 82 32 114 47 186 221 237 13 125 78 116 239 0 232 213 49 200 191 196 112 11 75 24 128 49 42 170 190 161 71 222 254 222 171 21 17 74 121 115 51 34 30 113 113 57 74 94 115 196 117 190 6 57 107 134 31 162 186 247 228 126 89 194 183 127 49 211 183 83 102 148 146 230 174 105 30 206 143 203 155 239 33 98 253 134 223 216 157 5 23 22 238 3) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 48 :der-encode #t :tests '(#(119 "" #vu8(49 50 51 52 48 48) #vu8(16 63 113 206 98 96 144 14 109 83 114 24 25 237 45 243 143 142 45 122 135 58 94 252 115 12 22 200 86 25 177 202 24 10 205 9 125 109 85 15 190 100 82 251 240 254 112 192 162 41 158 61 184 134 86 188 52 125 40 205 33 229 60 73 78 60 79 242 138 140 231 131 238 132 38 88 134 53 130 179 180 71 62 189 67 95 208 184 54 190 213 29 225 108 203 181 19 8 205 201 83 216 191 217 122 176 240 198 86 179 76 93 140 65 122 146 6 174 234 235 59 156 210 252 230 83 206 210 26 20 11 21 96 145 117 76 147 17 159 190 174 90 143 134 138 253 199 7 108 246 94 159 26 20 166 39 75 180 159 108 184 196 244 123 135 5 93 162 129 114 23 111 24 202 199 254 180 99 210 45 132 28 171 164 18 244 24 227 74 136 165 102 211 196 14 222 33 85 26 82 13 75 248 17 136 64 105 45 80 159 191 177 143 29 0 92 47 84 53 107 213 26 200 32 42 133 161 99 166 13 136 94 55 84 196 124 252 163 81 142 126 194 123 151 223 130 66 56 139 236 95 106 65 225 240 215) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-384" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 64 :der-encode #t :tests '(#(120 "" #vu8(49 50 51 52 48 48) #vu8(88 100 57 211 123 240 38 132 144 178 199 214 84 181 176 68 24 246 246 34 66 191 176 168 19 161 7 68 8 152 191 99 33 149 24 243 33 80 229 116 61 124 85 161 160 189 201 8 58 175 192 23 41 87 106 7 244 238 77 26 18 241 0 10 132 144 250 13 77 208 53 40 154 33 14 181 135 187 46 131 253 161 249 153 87 18 225 238 10 173 127 120 112 131 184 106 244 145 59 44 94 76 84 170 8 93 41 182 185 101 184 110 44 175 112 67 60 135 202 134 79 148 214 134 2 253 161 181 71 245 252 241 50 230 197 163 65 194 118 32 132 133 207 204 87 104 191 90 228 103 208 111 210 49 166 178 173 26 12 124 162 93 50 223 137 31 97 16 147 233 147 154 148 158 19 21 69 151 2 90 45 159 91 174 31 25 191 17 246 246 124 55 254 68 22 39 6 14 188 58 139 57 117 45 241 107 106 224 167 111 149 175 22 205 176 230 149 126 242 92 191 74 184 154 202 8 234 145 33 217 9 197 183 193 179 196 103 87 39 60 180 74 153 176 38 183 249 57 254 196 240 11 99 226 129 206) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 0 :der-encode #t :tests '(#(121 "" #vu8(49 50 51 52 48 48) #vu8(101 177 65 151 162 62 231 117 136 44 132 10 93 214 49 188 254 191 110 196 93 6 13 99 47 138 192 12 63 170 104 208 233 88 218 205 113 6 116 249 235 201 83 45 208 178 209 250 83 148 230 157 178 131 112 105 41 223 140 32 111 122 139 49 30 20 235 18 155 241 83 54 58 95 48 182 94 133 21 53 231 27 154 28 70 128 31 117 145 243 193 104 72 4 44 201 229 84 224 240 236 212 21 37 46 158 97 215 36 75 236 10 140 128 142 53 162 44 175 45 205 137 152 6 192 100 153 50 160 171 166 77 97 185 42 92 139 232 135 174 181 188 80 120 30 137 105 7 46 205 182 218 150 186 245 157 102 123 149 199 240 213 28 78 35 99 107 232 55 237 44 1 117 197 212 47 147 27 21 46 207 148 232 198 176 100 153 233 0 195 146 192 243 188 228 113 118 232 80 127 109 35 154 38 228 80 5 168 216 115 199 109 225 40 62 248 82 118 158 19 175 11 190 164 96 216 28 133 52 191 220 198 232 105 144 112 212 72 55 203 255 170 26 235 59 114 234 220 253 210 146 62 80 109 48 204) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 20 :der-encode #t :tests '(#(122 "" #vu8(49 50 51 52 48 48) #vu8(144 234 130 77 18 139 215 195 183 113 157 190 121 224 254 78 52 102 11 173 185 8 163 179 104 54 200 135 62 7 166 32 134 195 209 99 238 123 154 11 15 107 175 252 125 245 76 151 223 167 196 86 198 180 11 114 203 141 4 1 120 241 226 157 7 111 235 218 125 207 90 101 41 48 234 214 105 144 36 30 193 175 229 100 11 114 151 186 82 233 25 183 167 249 229 183 24 198 96 149 102 159 134 96 120 29 167 184 24 48 6 166 166 125 45 208 103 103 17 180 249 111 95 113 250 109 29 6 193 199 171 213 42 147 46 160 88 13 20 225 145 158 90 207 42 201 15 181 83 84 7 11 67 161 164 40 49 186 40 129 130 197 32 96 211 23 21 242 195 254 186 254 142 128 128 188 49 9 63 126 104 140 170 63 141 53 84 72 217 94 67 33 192 151 173 39 198 158 141 120 130 38 30 168 21 184 20 67 232 242 75 55 25 118 223 67 168 205 127 196 45 131 157 246 100 95 126 89 129 206 22 166 186 86 196 39 10 141 166 224 144 120 222 38 251 67 57 214 14 208 227 118 224 170 166 159) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 28 :der-encode #t :tests '(#(123 "" #vu8(49 50 51 52 48 48) #vu8(44 187 80 127 167 172 113 139 198 115 101 7 22 115 200 19 203 131 212 243 191 244 102 97 5 26 67 131 106 127 229 43 66 188 201 152 168 185 42 92 39 156 19 62 82 27 222 45 160 238 138 193 45 203 121 26 173 220 106 40 221 123 121 140 231 194 98 98 213 186 177 15 36 1 112 52 158 162 162 122 158 218 108 199 151 99 101 228 226 80 43 178 104 47 208 13 180 62 13 221 131 219 138 239 20 192 10 39 45 114 251 105 26 4 218 22 35 239 45 167 209 55 210 100 2 92 241 127 106 65 152 192 145 123 57 76 111 1 11 27 66 146 127 64 100 125 194 254 76 195 238 165 123 119 36 154 212 176 17 46 50 132 103 199 84 84 245 91 215 105 117 153 128 246 34 71 186 188 51 45 38 48 134 226 113 66 146 103 25 216 99 121 211 193 34 94 101 97 244 152 33 72 38 128 153 70 144 21 170 90 235 122 53 94 61 79 98 91 76 159 123 225 251 182 172 188 44 119 8 63 49 48 197 154 220 214 43 45 30 189 172 41 111 140 49 34 29 38 1 169 45 34 14 192 61 84) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 32 :der-encode #t :tests '(#(124 "" #vu8(49 50 51 52 48 48) #vu8(104 181 156 41 0 27 112 73 149 234 139 85 255 89 8 50 204 234 17 135 23 46 82 170 165 176 75 75 178 115 4 9 123 14 162 192 143 135 150 163 218 121 32 17 24 91 161 60 122 186 88 19 144 19 8 109 253 129 139 123 138 70 82 115 183 233 39 234 230 235 76 93 5 113 25 182 149 160 72 161 144 71 244 91 172 254 207 252 35 1 56 21 58 254 122 15 9 131 160 230 103 108 207 11 252 139 239 252 124 193 87 129 247 39 14 155 106 152 194 120 105 157 14 31 120 0 253 178 229 163 9 2 119 62 225 207 115 202 5 147 140 88 35 146 186 221 152 46 11 2 242 58 253 198 10 79 106 95 141 59 34 67 94 184 20 209 250 61 14 176 99 175 247 203 31 85 86 113 60 130 235 225 124 155 77 230 164 58 222 233 207 155 221 193 9 121 121 28 1 204 3 221 7 228 85 78 122 44 49 77 220 151 175 248 190 229 193 206 27 171 40 115 98 175 212 76 30 48 13 168 193 204 164 155 75 70 43 15 184 61 177 71 63 248 82 253 79 157 40 152 68 16 29 174 70 70) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 48 :der-encode #t :tests '(#(125 "" #vu8(49 50 51 52 48 48) #vu8(29 208 234 126 37 235 201 197 223 25 213 139 220 76 158 237 6 198 38 6 28 66 238 91 151 231 209 225 136 214 7 82 152 63 88 152 124 197 43 216 123 117 120 193 194 90 50 254 120 172 149 24 108 106 246 77 98 33 197 118 38 120 73 83 205 73 137 222 19 168 73 100 228 6 78 203 31 127 164 237 125 129 45 65 230 12 144 16 128 242 203 64 91 115 239 141 200 170 113 68 232 210 254 84 87 237 84 185 171 160 161 215 123 194 128 249 50 75 3 93 13 32 114 172 11 99 15 180 221 89 108 146 182 204 227 228 182 226 190 70 198 63 96 214 47 47 135 98 109 82 211 76 132 111 252 168 88 151 118 220 202 67 198 112 254 143 168 22 229 28 69 201 167 203 253 62 79 185 5 91 5 162 77 154 194 45 255 174 202 77 128 55 253 69 58 143 53 201 161 24 171 45 124 204 76 205 63 38 197 232 130 179 250 147 192 119 64 103 209 27 227 21 68 126 157 174 198 182 93 188 131 8 145 193 167 231 30 42 170 209 74 104 213 115 0 21 222 214 9 35 183 158 48 35 208 54) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-1" :salt-length 64 :der-encode #t :tests '(#(126 "" #vu8(49 50 51 52 48 48) #vu8(144 95 58 111 100 80 209 247 242 2 234 166 137 9 206 221 115 231 4 34 226 124 107 102 243 246 240 87 180 47 4 88 225 10 252 97 165 55 205 6 185 25 16 58 137 150 125 169 115 234 85 157 192 64 236 24 170 65 45 225 196 253 216 72 253 40 127 248 248 116 50 32 242 204 198 217 227 8 152 201 130 228 69 251 185 134 38 135 38 244 39 141 121 82 249 1 222 221 126 88 108 114 154 76 67 79 192 35 201 110 4 172 154 134 252 94 151 180 158 80 233 112 121 0 108 244 44 84 105 109 55 40 42 134 219 42 60 2 228 150 164 113 112 1 211 1 154 84 183 173 163 119 93 211 231 182 144 253 121 245 56 136 8 68 149 102 173 237 123 11 221 207 174 154 164 241 52 75 148 10 104 17 137 242 229 64 58 92 189 129 30 48 138 108 15 101 120 78 191 241 254 158 230 144 139 222 94 111 156 99 146 232 170 84 239 246 159 181 82 29 87 215 211 254 106 237 83 55 172 115 211 20 20 199 227 162 148 218 205 154 20 158 176 228 37 88 233 168 190 249 128 10 6 216 209 206) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 0 :der-encode #t :tests '(#(127 "" #vu8(49 50 51 52 48 48) #vu8(102 150 76 47 42 49 148 230 12 226 170 31 111 205 111 14 173 207 82 92 107 149 226 228 1 215 172 47 136 175 208 172 31 229 32 16 216 48 246 162 163 133 145 5 251 152 113 63 161 136 201 182 141 247 206 94 77 69 228 156 52 125 131 207 122 26 62 222 54 14 53 123 180 127 179 204 49 224 66 156 37 191 94 147 107 195 104 57 17 132 251 136 214 173 253 194 138 255 43 183 252 169 202 233 199 228 180 239 55 198 26 122 95 197 214 140 177 46 92 86 160 1 123 49 148 139 79 14 2 103 117 77 199 14 233 44 95 141 188 59 46 126 188 222 198 56 64 126 12 8 200 62 118 238 204 101 245 146 233 162 57 170 48 53 129 185 128 247 92 38 48 227 175 141 147 232 250 51 246 44 196 97 9 156 217 220 31 19 62 161 244 153 222 57 2 237 60 198 115 43 230 40 97 104 205 63 107 123 15 237 0 90 134 69 252 74 88 85 240 33 48 35 34 72 93 157 105 72 3 196 164 39 85 51 172 242 177 213 236 98 255 140 152 23 12 115 127 128 3 53 248 79 62 147 136 160) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 20 :der-encode #t :tests '(#(128 "" #vu8(49 50 51 52 48 48) #vu8(99 231 239 81 19 88 210 162 138 113 188 241 225 67 210 118 35 99 123 238 222 206 227 99 139 58 81 61 203 15 114 252 86 195 114 206 81 37 228 107 164 66 214 229 233 41 10 101 128 237 63 218 175 63 81 227 218 163 78 179 44 217 239 60 140 48 114 47 144 149 246 144 143 198 218 252 34 243 189 55 217 152 186 169 40 37 203 227 110 173 0 181 1 79 213 13 35 113 209 36 90 191 214 5 198 168 253 109 182 54 43 24 114 60 121 126 14 163 156 44 219 58 222 216 33 165 31 143 5 130 27 250 27 109 114 255 102 20 21 204 161 26 93 189 182 17 217 167 77 144 82 152 248 83 250 44 210 177 238 183 79 252 196 226 194 149 95 232 219 106 28 42 128 20 145 143 192 225 224 201 84 157 116 228 82 135 116 47 244 191 200 165 104 86 208 212 207 137 129 93 164 242 35 211 248 178 67 205 122 44 202 66 130 6 184 46 40 97 125 156 252 211 92 208 41 222 234 202 192 63 143 247 239 114 245 1 13 205 217 62 208 115 136 178 72 45 176 171 38 14 16 34 163 62 170 200) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 28 :der-encode #t :tests '(#(129 "" #vu8(49 50 51 52 48 48) #vu8(11 20 35 103 124 242 25 5 226 204 13 218 96 226 127 116 156 86 4 155 176 62 97 121 74 67 243 123 132 178 229 242 71 186 155 215 144 80 197 166 1 167 239 194 175 180 42 121 54 213 67 185 22 226 77 225 202 30 102 106 221 27 213 19 55 202 244 207 47 136 164 194 2 229 60 181 7 29 99 140 180 20 115 212 200 219 65 38 227 18 199 17 64 92 171 29 110 5 65 76 67 185 86 107 60 208 183 45 163 208 117 55 150 168 31 188 28 149 12 42 171 72 179 77 93 239 49 64 233 62 10 141 16 35 55 75 150 135 69 28 132 124 218 213 84 75 5 176 152 4 252 151 39 189 70 188 154 134 240 170 35 244 167 113 90 15 233 169 6 87 130 206 88 163 165 60 2 47 79 171 246 113 70 195 201 25 205 16 105 160 139 217 110 68 116 110 26 73 49 89 38 238 6 175 141 118 196 51 159 35 84 11 54 205 139 7 225 77 127 246 61 56 70 26 244 153 39 181 62 116 150 237 107 235 133 92 215 64 98 142 192 2 23 104 41 62 123 168 108 3 207 136 178 238 121 38) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 32 :der-encode #t :tests '(#(130 "" #vu8(49 50 51 52 48 48) #vu8(156 215 159 207 155 135 227 163 15 83 140 183 203 233 77 40 247 107 105 51 95 109 73 223 212 64 33 10 64 220 129 26 147 11 118 83 63 120 159 78 35 144 94 104 142 192 16 104 158 39 65 92 86 0 238 212 218 72 21 219 30 110 112 240 173 201 206 71 105 121 71 224 219 178 61 50 15 194 119 212 115 211 222 122 187 117 131 126 36 205 152 41 245 153 58 195 90 66 124 23 47 71 4 110 72 94 71 0 59 184 68 127 20 6 177 74 164 149 186 75 74 60 248 226 202 161 180 79 7 24 160 70 80 219 190 116 155 210 124 11 105 238 60 127 181 238 149 109 13 144 27 94 66 247 16 212 163 229 155 62 114 215 6 4 198 215 167 164 209 163 162 118 54 72 168 145 16 125 59 20 152 133 129 82 51 86 41 95 66 207 119 183 205 254 58 56 229 84 99 163 149 87 213 236 84 55 16 185 194 142 39 32 62 35 191 140 216 26 46 1 137 39 166 35 184 76 240 16 228 13 136 89 179 4 201 126 12 6 198 126 160 23 215 8 82 186 40 237 219 255 34 113 39 56 177 32) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 48 :der-encode #t :tests '(#(131 "" #vu8(49 50 51 52 48 48) #vu8(144 207 138 255 197 103 119 139 180 125 11 80 20 126 81 161 3 36 99 156 193 123 93 89 88 196 227 24 196 154 34 242 188 52 33 18 154 36 112 46 22 5 179 248 255 254 254 120 71 246 121 201 26 100 229 110 248 116 222 194 123 69 64 178 71 30 121 96 144 103 199 135 28 199 109 113 121 69 188 181 88 96 91 62 180 179 48 52 191 215 20 141 89 27 131 122 201 136 192 204 59 178 55 44 149 148 229 115 165 213 201 186 92 35 222 82 87 206 130 116 246 15 197 236 243 94 136 137 101 158 205 119 194 214 172 116 137 143 222 221 60 84 36 114 166 225 19 172 172 92 138 163 95 170 82 172 13 235 60 237 169 248 61 36 65 168 244 65 221 153 116 38 132 142 70 28 0 246 77 223 109 86 89 219 238 216 104 29 24 16 44 148 179 190 19 126 249 38 132 12 180 112 39 0 111 86 153 220 252 237 26 174 204 202 132 143 174 114 180 5 244 227 76 94 249 254 141 21 254 107 86 82 22 193 2 170 142 147 25 40 159 45 254 172 115 92 138 91 149 249 145 160 253 73 190 4) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-224" :salt-length 64 :der-encode #t :tests '(#(132 "" #vu8(49 50 51 52 48 48) #vu8(75 136 117 155 185 109 103 205 168 118 23 160 157 98 95 91 179 183 103 45 255 224 49 195 184 140 61 142 103 222 223 252 124 132 240 241 247 84 207 235 65 129 208 87 63 42 136 238 76 152 161 13 234 26 4 135 18 71 44 114 75 168 27 194 137 132 252 72 22 154 83 85 56 193 53 102 243 171 61 42 81 178 112 196 178 213 94 74 130 41 44 8 75 79 78 106 88 228 115 254 127 57 1 95 187 167 211 64 131 183 189 33 52 202 99 51 15 13 209 153 125 4 83 170 215 219 222 212 179 23 95 154 105 96 122 135 153 231 211 150 146 128 200 245 238 1 11 178 236 124 21 28 163 200 166 191 73 194 174 142 170 71 9 152 243 144 209 42 74 124 10 57 55 26 108 99 210 50 188 9 166 71 117 10 238 101 90 114 31 6 101 96 228 10 111 137 153 9 231 46 44 59 245 46 112 251 205 38 163 116 2 177 227 124 44 123 216 135 131 250 251 160 114 101 152 93 58 121 85 165 188 20 205 13 13 16 241 233 198 127 109 152 120 92 156 27 57 20 167 151 44 194 177 235 16 255) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 0 :der-encode #t :tests '(#(133 "" #vu8(49 50 51 52 48 48) #vu8(28 136 24 223 31 210 62 199 4 238 182 134 142 209 187 132 25 89 127 65 40 181 255 165 33 102 69 131 18 244 44 244 94 113 7 131 234 179 157 229 17 202 230 137 241 215 49 203 75 204 130 88 41 164 119 54 151 133 94 125 200 76 97 127 69 157 172 213 130 114 231 95 210 238 180 219 32 214 249 86 3 62 147 153 82 97 67 24 195 187 130 39 107 180 38 181 90 13 234 193 75 131 30 117 80 1 52 41 141 204 5 116 148 38 50 44 206 207 16 221 243 196 235 73 242 174 116 109 68 229 243 242 41 249 226 41 131 18 192 185 22 143 189 210 16 66 22 162 124 193 231 32 203 142 40 217 153 45 132 30 82 243 27 42 1 109 137 101 41 250 28 253 119 85 211 99 190 161 186 229 101 229 121 102 62 91 126 140 43 158 11 133 231 125 127 116 2 50 219 25 120 169 32 200 53 130 116 189 228 117 243 135 148 134 75 8 192 238 197 189 23 109 229 44 39 177 15 41 243 206 12 65 178 174 35 176 145 183 57 57 151 164 54 193 88 205 239 118 190 255 210 0 164 228 67 207) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 20 :der-encode #t :tests '(#(134 "" #vu8(49 50 51 52 48 48) #vu8(3 153 234 30 107 237 228 87 225 4 111 35 99 225 219 68 248 69 12 196 82 132 92 71 99 159 48 15 25 41 6 183 211 154 205 96 171 3 223 6 209 178 125 21 202 71 59 155 10 51 158 184 214 58 214 239 42 20 139 92 221 204 231 145 117 1 82 65 23 107 172 129 230 184 203 248 127 226 86 22 127 186 141 60 242 223 209 69 203 162 168 209 24 249 128 207 39 153 137 211 196 145 183 63 193 35 217 28 201 154 70 24 210 30 90 214 120 152 24 243 169 154 51 121 89 173 218 24 251 87 24 103 211 169 235 80 149 109 171 231 230 179 230 77 64 191 221 93 94 207 27 162 175 71 65 211 220 42 154 226 226 34 44 24 129 218 14 190 198 33 99 104 81 196 105 144 242 77 219 255 156 60 239 21 83 58 95 193 121 79 54 84 21 229 217 72 182 72 119 5 58 147 149 52 144 200 242 80 72 140 153 51 242 84 122 137 209 203 89 158 229 231 247 219 234 38 38 237 52 60 99 235 41 11 30 144 152 38 158 17 21 162 245 153 91 113 170 38 23 35 95 219 6 102 148 109) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 28 :der-encode #t :tests '(#(135 "" #vu8(49 50 51 52 48 48) #vu8(18 240 194 22 27 143 123 75 186 22 209 156 76 106 206 205 85 75 208 145 198 20 142 146 162 79 29 115 238 111 231 6 111 226 143 197 176 102 220 247 57 25 103 242 55 134 254 185 53 0 42 14 99 8 66 124 97 60 202 204 199 75 154 162 78 20 37 120 92 223 189 135 32 219 55 216 103 211 93 9 151 60 244 201 187 84 155 125 78 248 200 84 116 37 43 31 118 11 26 129 247 156 203 84 12 9 144 230 162 13 154 14 181 182 193 1 213 88 248 170 67 51 55 93 199 149 238 21 99 101 122 128 60 154 99 162 251 149 117 84 212 180 189 107 163 63 42 107 83 124 8 150 93 228 66 31 216 61 231 143 165 204 220 29 159 212 89 117 104 228 79 22 182 10 254 150 22 104 160 168 33 184 174 229 131 75 13 82 124 17 90 187 100 156 115 201 148 252 110 230 65 212 71 115 25 37 116 217 243 48 184 102 78 224 114 97 133 141 123 93 204 191 39 220 148 82 219 49 251 14 89 135 2 23 196 117 28 82 71 86 93 45 201 69 104 67 31 52 81 220 246 135 71 135 99 62) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 32 :der-encode #t :tests '(#(136 "" #vu8(49 50 51 52 48 48) #vu8(9 193 76 117 15 191 44 85 54 184 68 1 115 53 125 224 62 204 144 24 103 154 241 221 177 163 109 197 179 133 130 196 74 229 212 45 126 0 49 247 56 25 17 113 186 166 231 37 98 194 145 90 231 4 100 137 164 134 61 123 134 175 214 52 198 255 68 178 169 175 7 81 250 132 213 5 79 10 147 151 28 215 195 107 99 77 21 72 157 117 56 110 221 27 21 230 249 50 94 236 132 162 167 135 158 124 128 129 44 250 56 126 91 98 5 51 224 62 69 4 118 143 42 138 8 22 147 137 89 177 231 14 143 140 161 77 31 136 9 163 152 217 140 21 81 1 54 62 50 171 53 61 16 197 224 163 251 255 214 146 102 95 91 157 52 160 157 144 130 252 209 207 115 62 15 55 170 173 130 168 81 43 102 222 188 17 152 153 71 29 97 179 60 127 79 61 74 34 164 95 204 251 134 64 188 37 100 230 121 186 75 110 6 205 192 91 231 204 81 30 18 5 178 92 73 3 183 100 27 214 237 56 223 74 128 8 99 110 90 113 108 1 73 6 213 160 202 174 63 61 86 80 206 52 8 217) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 48 :der-encode #t :tests '(#(137 "" #vu8(49 50 51 52 48 48) #vu8(71 81 14 59 151 133 182 140 241 82 79 169 234 172 239 248 18 37 221 149 17 3 80 119 73 187 73 178 58 76 44 85 3 114 124 113 103 25 254 236 151 183 157 62 96 81 195 73 130 208 124 204 54 24 66 188 12 146 33 55 50 201 8 232 99 155 29 152 160 247 191 195 76 248 1 249 111 237 35 196 213 226 92 8 55 242 34 206 118 79 233 213 33 228 73 157 233 51 7 223 41 172 78 92 45 201 46 14 166 94 151 245 93 247 73 61 150 38 91 4 143 36 38 11 175 142 140 58 229 95 68 234 255 163 25 139 208 230 231 49 190 19 205 67 241 61 64 227 84 211 92 19 43 200 81 75 222 204 219 177 189 106 59 171 215 61 219 141 81 219 133 152 186 199 186 223 17 128 236 42 170 232 73 76 6 196 62 93 43 201 136 181 15 43 187 114 192 191 138 85 41 228 97 139 191 255 83 86 219 180 115 135 208 137 60 221 96 22 71 244 109 237 223 191 248 27 96 150 29 76 41 60 49 57 208 70 165 38 57 138 156 216 207 96 92 239 83 88 148 95 240 51 15 17 62 58) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-256" :salt-length 64 :der-encode #t :tests '(#(138 "" #vu8(49 50 51 52 48 48) #vu8(20 188 26 121 85 179 12 182 3 246 23 188 220 193 36 5 168 115 177 175 189 252 247 121 42 88 127 26 160 133 239 148 17 203 8 140 52 184 152 35 71 4 40 109 127 9 174 21 134 223 163 168 29 76 150 98 186 38 103 76 13 94 169 102 24 78 53 120 197 196 169 38 223 135 215 91 20 158 169 73 63 93 86 0 222 236 160 95 118 188 68 84 33 194 82 32 32 44 21 75 202 131 162 22 161 214 239 176 185 35 62 176 203 62 120 123 226 243 115 222 142 153 153 100 131 243 156 146 225 172 159 24 54 119 23 204 148 104 246 231 69 226 90 186 213 87 67 253 43 89 201 47 132 12 239 14 93 244 127 254 184 60 88 0 229 253 72 107 117 22 165 92 123 5 112 158 178 28 138 133 117 228 27 197 103 115 157 95 29 190 149 190 141 67 242 119 105 191 245 95 225 164 220 133 92 199 107 204 179 204 242 124 104 210 126 58 101 130 155 27 23 112 21 148 84 82 37 79 95 150 169 108 54 60 165 105 105 32 31 218 177 135 201 166 201 145 175 201 50 226 153 24 55 69 25 34) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 0 :der-encode #t :tests '(#(139 "" #vu8(49 50 51 52 48 48) #vu8(73 173 87 175 76 147 181 231 20 168 62 26 243 65 10 144 32 196 125 201 186 242 95 82 193 150 82 151 11 247 14 145 135 128 244 140 61 213 154 107 129 104 153 240 29 155 71 183 175 40 33 238 74 183 105 83 162 183 6 17 142 236 19 245 160 244 66 39 140 186 28 107 114 0 8 145 224 184 50 223 185 124 122 78 91 9 151 28 19 51 36 33 56 32 241 199 113 26 204 175 142 209 208 153 34 30 143 246 224 4 43 161 176 179 130 87 169 75 182 33 80 140 88 79 94 57 200 212 251 213 18 128 15 148 131 220 132 249 158 178 169 186 155 251 229 170 168 207 225 105 28 171 10 216 125 188 53 78 164 155 51 27 38 21 130 116 211 72 98 12 160 29 135 45 146 158 142 1 214 185 129 93 87 59 131 189 161 98 49 54 197 94 129 219 115 146 181 218 186 81 135 160 154 136 61 88 207 6 135 162 77 1 145 114 184 67 227 39 174 80 125 178 221 47 216 77 253 37 171 4 177 28 212 176 34 21 250 178 59 188 168 134 39 144 145 226 31 250 184 215 213 173 73 225 107 167) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 20 :der-encode #t :tests '(#(140 "" #vu8(49 50 51 52 48 48) #vu8(138 251 227 59 152 248 195 11 54 172 170 251 61 97 189 131 23 84 153 189 89 97 255 62 189 52 11 255 206 154 65 105 181 151 104 225 227 229 145 60 43 180 17 181 189 73 92 201 45 124 4 214 88 22 179 193 59 46 62 241 254 96 118 220 145 14 117 244 119 103 126 16 110 61 93 148 167 132 195 120 236 19 182 109 252 30 129 194 208 200 201 169 21 106 245 42 18 117 120 132 190 76 185 208 175 198 243 44 57 196 39 118 109 183 227 208 124 103 128 189 95 166 44 5 202 50 184 89 102 238 98 145 227 206 208 13 0 239 240 204 81 211 193 156 126 27 241 3 219 12 133 186 94 158 45 19 14 81 54 242 9 214 207 138 127 193 134 112 38 75 127 57 42 104 198 214 230 165 211 235 55 11 213 161 148 243 161 116 54 255 36 149 243 115 196 219 180 93 233 160 87 90 170 74 44 157 168 77 95 26 219 225 93 206 52 26 139 58 196 227 114 43 10 255 11 148 46 82 45 139 207 84 251 13 148 41 151 86 139 238 51 36 88 125 10 253 187 229 120 197 179 245 13 95 71 241) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 28 :der-encode #t :tests '(#(141 "" #vu8(49 50 51 52 48 48) #vu8(169 27 156 176 2 85 70 242 198 105 102 48 173 34 83 13 43 65 65 144 115 84 26 93 19 172 155 115 158 189 154 255 143 142 135 244 5 213 21 26 147 13 248 49 18 64 214 19 19 54 163 229 93 51 22 96 25 190 91 201 126 82 9 85 29 240 213 182 155 226 36 175 154 21 234 181 122 183 72 192 129 226 91 158 106 166 142 77 176 147 126 180 191 25 12 164 102 137 187 191 196 234 95 212 116 94 243 147 138 128 64 78 217 219 255 189 196 35 35 132 4 118 143 197 19 96 71 50 185 195 15 151 254 218 221 107 142 63 174 78 84 197 116 210 218 107 169 62 235 112 5 65 223 104 128 17 197 150 136 175 209 26 204 214 199 194 192 240 216 229 176 99 128 88 138 91 214 85 143 175 215 100 68 105 32 178 31 67 175 127 149 144 196 194 11 139 144 224 172 223 241 236 222 244 69 109 28 110 137 139 46 97 230 249 206 116 48 99 198 192 141 26 17 130 181 213 142 219 144 42 240 167 142 157 245 173 109 132 218 75 81 9 128 122 46 99 69 105 140 156 135 150 121 221 108 124) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 32 :der-encode #t :tests '(#(142 "" #vu8(49 50 51 52 48 48) #vu8(154 42 178 187 2 100 201 81 69 211 160 151 11 142 102 49 95 147 236 246 121 233 47 95 188 236 26 79 181 163 242 202 13 221 255 93 66 174 175 108 253 52 227 194 160 237 186 36 21 146 4 120 190 15 178 60 236 79 84 28 62 245 29 70 99 168 93 27 0 248 76 160 105 189 132 5 191 104 144 41 16 9 14 61 183 73 181 228 105 149 176 90 194 130 84 18 13 138 149 182 216 203 150 209 187 239 158 121 111 44 244 78 110 83 148 148 208 118 119 250 222 218 114 55 4 2 94 219 14 30 72 213 194 109 88 74 198 26 227 229 227 99 233 154 170 29 174 209 30 44 249 182 55 212 253 105 177 23 119 39 163 32 92 7 124 29 54 142 175 61 229 110 87 2 38 41 220 147 178 247 190 162 145 64 54 206 95 92 21 79 214 226 22 210 234 210 11 101 239 191 249 255 1 151 67 46 204 1 206 4 153 63 120 116 133 58 128 168 201 139 198 96 34 191 213 196 12 189 135 38 171 59 81 200 77 52 172 103 1 142 96 105 240 108 47 123 45 156 112 4 4 233 224 162 59 22) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 48 :der-encode #t :tests '(#(143 "" #vu8(49 50 51 52 48 48) #vu8(96 104 62 153 95 96 225 207 125 148 78 172 47 12 109 192 42 0 46 137 168 123 74 10 54 55 139 98 71 160 68 86 22 108 162 216 91 178 66 96 218 89 183 174 132 228 25 31 149 209 88 81 175 184 206 218 103 101 3 158 247 105 209 62 250 137 191 8 30 108 202 82 117 62 40 222 34 80 21 226 255 129 201 179 157 155 199 89 0 58 146 146 200 146 181 217 198 88 76 215 121 24 0 72 164 12 117 55 140 204 236 71 168 75 64 151 218 2 135 140 66 66 59 238 165 15 205 41 165 235 123 103 237 58 6 238 226 224 92 212 35 109 134 5 43 255 17 69 168 205 83 103 203 21 226 204 199 146 99 111 3 5 217 10 202 7 209 227 192 17 166 23 240 150 27 147 140 108 233 67 197 96 196 39 36 35 124 228 150 94 245 14 124 152 229 46 13 24 121 122 166 81 80 4 38 144 220 134 4 244 99 16 78 17 74 31 189 215 233 171 38 70 233 199 89 80 47 47 208 226 251 211 49 201 43 251 65 104 182 56 244 216 135 62 14 4 140 244 41 216 169 151 126 49 48 41) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-384" :salt-length 64 :der-encode #t :tests '(#(144 "" #vu8(49 50 51 52 48 48) #vu8(125 197 69 127 111 138 167 75 194 49 65 86 226 239 202 113 124 35 96 213 122 140 94 227 150 221 221 97 81 192 204 137 243 86 227 241 75 234 20 120 199 187 74 84 98 10 115 213 88 190 36 111 168 132 196 19 20 71 43 185 201 134 111 189 219 87 39 176 151 101 147 171 108 102 53 216 37 138 125 174 50 109 190 101 210 3 149 18 9 248 236 228 106 65 50 239 203 100 11 203 215 153 10 111 12 19 139 69 102 136 210 104 21 3 150 238 213 43 85 83 240 145 244 136 134 66 177 133 128 151 125 128 104 11 185 193 25 73 104 190 212 176 25 140 247 45 30 212 99 26 108 22 246 234 86 44 108 243 68 179 248 209 194 253 219 206 222 100 124 145 208 19 18 179 96 147 69 211 227 45 248 153 251 152 31 7 14 209 192 116 13 121 235 25 246 213 71 37 192 6 192 207 217 97 162 148 51 145 186 162 163 46 77 166 223 247 237 10 42 97 253 237 57 168 94 230 66 193 226 25 217 204 249 63 175 128 226 194 19 91 13 228 148 248 203 206 197 187 119 247 81 72 232 59 164 8) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 0 :der-encode #t :tests '(#(145 "" #vu8(49 50 51 52 48 48) #vu8(162 137 98 95 159 230 132 209 134 96 79 160 129 64 247 213 34 219 236 138 230 38 108 232 63 186 43 107 198 48 94 46 39 187 251 52 97 101 180 225 16 225 179 233 68 95 250 137 51 229 65 125 189 135 227 8 72 53 184 103 122 228 57 96 150 22 247 183 85 187 186 211 62 208 37 122 23 10 57 100 184 91 60 223 188 228 62 163 197 80 53 74 146 236 142 117 100 43 3 158 43 77 155 199 123 132 198 188 127 47 42 67 160 164 3 161 153 46 0 135 134 181 233 228 63 190 113 190 231 135 236 217 149 1 241 32 73 33 246 30 192 202 131 241 168 251 120 98 239 230 155 16 77 130 47 245 23 8 2 213 16 253 85 203 167 220 194 182 149 219 144 91 206 76 7 167 2 205 236 242 67 129 244 154 155 149 212 128 95 30 181 23 4 234 25 134 83 244 60 63 18 74 67 71 234 27 236 209 56 204 63 212 62 129 62 216 35 195 115 163 94 185 6 11 203 184 254 251 28 69 60 114 241 246 25 135 71 87 122 239 20 173 63 225 68 183 216 222 27 214 161 35 189 159 63 150) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 20 :der-encode #t :tests '(#(146 "" #vu8(49 50 51 52 48 48) #vu8(116 12 201 74 67 101 54 85 234 190 90 44 159 136 58 55 132 203 197 177 49 97 224 90 192 132 156 238 57 178 232 164 42 15 83 209 75 71 255 97 209 67 88 71 151 173 8 137 178 109 225 123 12 39 199 154 105 163 86 226 227 234 238 43 134 117 176 170 246 141 254 104 45 242 52 99 185 183 128 245 180 214 104 28 0 178 114 119 228 231 131 154 51 59 2 42 22 231 183 84 24 250 233 213 245 179 185 150 66 125 81 142 177 166 150 172 131 206 108 81 7 239 174 87 120 89 184 20 16 15 25 197 39 8 72 30 208 61 3 138 76 246 3 159 145 191 114 244 120 141 186 81 23 158 60 149 199 80 169 67 42 241 4 79 124 199 88 87 47 241 28 83 122 221 20 166 97 141 15 193 6 79 118 36 133 160 255 235 251 12 250 206 255 70 2 54 122 35 28 238 110 162 200 64 123 204 136 38 127 66 24 156 2 227 67 142 98 227 130 93 134 103 209 174 34 20 148 212 226 150 38 202 234 58 127 93 34 132 241 136 98 81 44 221 76 217 207 225 216 213 124 237 201 150 2 153) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 28 :der-encode #t :tests '(#(147 "" #vu8(49 50 51 52 48 48) #vu8(154 128 146 211 231 89 234 201 55 67 86 179 189 168 13 135 198 205 31 17 136 220 137 79 72 191 204 45 21 233 156 101 255 182 53 53 16 153 138 54 15 40 189 99 108 97 237 218 147 235 185 3 2 159 234 233 178 195 147 91 40 112 249 163 242 158 4 79 60 203 169 160 131 87 34 109 72 247 96 21 140 190 91 252 13 124 10 46 172 160 177 177 103 116 91 242 110 161 224 8 231 55 122 8 95 75 214 133 253 90 218 102 2 117 142 39 84 30 111 39 10 223 109 91 26 43 108 101 163 117 124 91 60 76 41 40 78 124 173 189 57 244 207 203 66 83 233 89 148 86 81 198 14 171 87 172 1 112 218 124 203 12 141 114 231 96 230 3 199 85 161 177 225 53 110 150 137 137 206 193 185 225 39 62 194 197 114 237 125 208 208 210 156 10 209 231 118 146 176 215 158 198 6 87 252 33 183 70 22 141 205 240 208 90 62 241 243 122 78 191 177 153 204 22 125 148 204 44 155 117 221 223 17 48 72 50 103 151 166 207 214 201 167 100 166 199 17 49 229 245 101 74 147 252 131 167) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 32 :der-encode #t :tests '(#(148 "" #vu8(49 50 51 52 48 48) #vu8(53 34 148 63 21 128 57 170 104 53 78 60 81 235 109 154 73 111 92 126 124 51 191 233 162 12 249 140 170 113 11 136 177 142 203 109 115 23 119 135 71 157 80 100 206 61 237 220 19 249 137 152 167 32 113 24 222 119 2 158 143 213 240 18 169 224 86 185 114 169 116 203 91 8 123 101 100 130 26 248 156 227 182 67 72 9 90 204 222 168 173 125 5 207 61 33 214 32 131 101 161 210 252 206 124 217 100 41 92 150 62 95 212 149 68 140 9 38 222 9 80 209 44 66 224 86 89 82 149 196 55 100 132 253 125 13 198 254 239 61 203 65 236 90 13 210 30 239 55 94 101 82 59 207 90 247 10 146 51 27 235 12 107 90 196 69 214 160 108 190 190 237 0 131 183 70 179 214 103 170 54 108 100 115 19 56 154 45 155 97 212 30 174 216 207 45 184 180 147 129 21 112 9 103 67 45 204 79 56 50 120 180 163 151 175 172 4 189 183 194 245 246 5 24 84 23 77 133 251 150 82 92 42 183 187 88 192 255 180 129 239 194 157 8 228 173 26 134 204 252 189 205 152 151 72 98) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 48 :der-encode #t :tests '(#(149 "" #vu8(49 50 51 52 48 48) #vu8(69 216 237 73 130 186 72 78 11 207 202 20 83 125 96 127 182 195 248 244 68 66 91 202 5 207 41 189 95 146 148 95 10 194 17 204 188 120 217 52 246 253 36 19 26 232 132 131 84 122 239 1 180 231 10 205 111 132 238 247 77 74 45 228 11 77 21 211 138 8 7 8 122 84 236 227 111 38 138 96 183 12 80 11 114 254 15 244 153 32 198 60 12 189 230 224 217 16 15 78 80 234 59 94 17 165 149 243 117 88 120 187 30 3 194 149 211 231 63 30 195 45 36 214 41 242 251 70 156 234 72 52 108 5 122 189 100 246 186 228 203 208 251 137 7 106 30 66 189 82 96 204 86 145 254 228 103 98 19 111 147 106 237 53 205 182 225 87 157 88 111 196 225 102 254 37 39 120 163 121 193 52 86 33 117 225 126 236 247 88 193 30 202 102 173 37 154 169 229 30 80 77 13 49 123 23 21 189 34 71 6 214 84 24 164 96 22 18 228 130 191 149 193 233 233 39 142 84 1 189 241 237 36 17 139 144 138 142 66 197 98 167 104 150 86 63 228 192 77 98 184 171 219 97 228 203) #t ()))) (test-signature/testvector "rsa_pss_misc_test" :algorithm "RSASSA-PSS" :digest "SHA-512" :public-key #vu8(48 130 1 34 48 13 6 9 42 134 72 134 247 13 1 1 1 5 0 3 130 1 15 0 48 130 1 10 2 130 1 1 0 187 13 65 36 194 1 48 104 139 132 25 250 190 204 66 125 148 108 80 150 220 246 158 203 14 182 159 207 90 237 21 215 225 229 254 78 52 251 226 111 139 36 74 163 240 136 213 70 160 10 83 20 100 186 75 137 128 188 196 213 229 75 204 32 225 165 26 250 144 68 247 253 236 188 110 219 117 27 90 95 167 171 64 58 4 229 247 123 167 134 93 214 210 17 218 10 250 113 38 42 119 166 61 156 6 232 176 11 97 108 161 95 17 234 91 73 72 151 56 100 24 63 87 3 71 87 5 83 227 135 131 118 202 79 117 54 173 90 250 193 12 10 123 52 165 193 31 140 241 97 21 251 174 180 179 35 177 173 111 117 199 236 59 149 72 145 202 178 97 28 241 118 140 236 152 60 23 23 197 127 103 103 109 114 26 149 91 219 188 33 106 51 69 187 49 215 214 62 6 189 172 150 166 185 145 186 30 1 19 208 30 72 199 122 179 39 211 107 66 108 47 143 228 130 90 55 135 116 37 136 92 146 126 146 66 59 105 119 252 48 65 34 162 195 151 203 116 132 95 233 150 29 186 34 193 167 2 3 1 0 1) :mgf "MGF1" :mgf-digest "SHA-512" :salt-length 64 :der-encode #t :tests '(#(150 "" #vu8(49 50 51 52 48 48) #vu8(99 148 46 137 165 107 99 71 135 219 240 116 231 91 5 37 232 189 59 123 129 114 242 194 116 153 39 43 147 154 129 44 226 245 1 235 149 166 70 3 249 188 124 33 32 239 47 113 51 195 178 164 191 100 69 226 37 123 89 229 112 34 200 121 248 214 6 103 171 142 40 220 151 40 70 103 8 88 252 13 91 219 250 113 223 248 112 170 201 100 146 33 69 51 56 61 135 64 216 77 223 97 212 111 133 44 107 240 191 178 209 12 46 77 65 206 126 234 238 2 131 51 223 231 118 80 181 62 102 205 44 41 145 184 12 50 250 163 58 174 39 177 195 12 10 226 171 215 89 197 158 178 46 13 5 151 182 221 99 73 30 12 149 4 140 7 75 29 100 216 243 86 230 55 102 157 144 151 79 78 178 156 161 132 70 139 193 226 210 76 252 211 110 57 92 65 207 55 3 205 177 165 194 6 251 221 71 99 21 78 85 105 208 77 117 153 142 111 66 91 212 47 128 224 220 216 222 238 188 51 34 170 111 80 170 135 51 69 215 201 160 82 33 84 182 222 35 135 102 74 227 55 100 255 178 169) #t ())))
false
f55f4f6e9006a54a6983a7d300aeb366ad0bfcc9
665da87f9fefd8678b0635e31df3f3ff28a1d48c
/tests/debug/api-testing.scm
78ca85e312735bbaded000c9ede28a5c72186cda
[ "MIT" ]
permissive
justinethier/cyclone
eeb782c20a38f916138ac9a988dc53817eb56e79
cc24c6be6d2b7cc16d5e0ee91f0823d7a90a3273
refs/heads/master
2023-08-30T15:30:09.209833
2023-08-22T02:11:59
2023-08-22T02:11:59
31,150,535
862
64
MIT
2023-03-04T15:15:37
2015-02-22T03:08:21
Scheme
UTF-8
Scheme
false
false
1,069
scm
api-testing.scm
(import (scheme base) (scheme file) (scheme read) (scheme write) (scheme cyclone util) ) ;; TODO: this was not working in icyc - wtf? ;(let ((tmp (call-with-input-file "../scheme/base.sld" ; (lambda (fp) ; (read-all fp))))) ; (write ; (cdar ; (filter ; (lambda (l) ; (tagged-list? 'export l)) ; (car tmp))))) (define (read-exports filename) (let* ((tmp (call-with-input-file filename (lambda (fp) (read-all fp)))) (exports (cdar (filter (lambda (l) (tagged-list? 'export l)) (car tmp))))) (write (map (lambda (e) (system (string-append ;; TODO: not good enough, what about define-syntax? "grep -n \"define[ ]*[ \\(]" (symbol->string e) " \" " filename))) exports))) ) (read-exports "../scheme/file.sld")
true
3ec23b6e8d800817d15c8cb0569b116540e64a62
8f0ceb57d807ba1c92846ae899736b0418003e4f
/INF2810/practice for exam/exercises/1_5.scm
da651867e41c8e4432f313589c1a1640a0d4a35d
[]
no_license
hovdis/UiO
4549053188302af5202c8294a89124adb4eb981b
dcaa236314d5b0022e6be7c2cd0b48e88016475a
refs/heads/master
2020-09-16T04:04:22.283098
2020-02-26T08:21:21
2020-02-26T08:21:21
223,645,789
0
0
null
null
null
null
UTF-8
Scheme
false
false
1,018
scm
1_5.scm
(define (p) (p)) (define (test x y) (if (= x 0) 0 y)) (test 0 (p)) #| Applicative order takes the whole parameter, and evaluates it before sending it to the function, while normal order does not evaluate each of the parameters before it needs to be used. In this case the code would run if it used normal order evaluation. This is because x would be defined as 0, and the if-statement would be true, and the output would be 0. Since DrRacket (and scheme) uses applicative order, the code does not run, since (p) is not a valid value. Applicative-order vil si at alle argumenter vil evalueres før de sendes til prosedyren. Dermed vil kallet på (test 0 (p)) forårsake at evalueringen ikke vil terminere, siden p vil kalle seg selv rekursivt. Normal-order vil si at argumentene først evalueres når vi trenger de. Vi behøver ikke å vite hva y er for å avgjøre om vi skal returnere 0 eller y, så da vil heller aldri y (som representerer et kall på (p)) evalueres. Testen vil evalueres til 0. |#
false
f4d77819db0a910bef8d3368d9651df435af6b58
12fc725f8273ebfd9ece9ec19af748036823f495
/tools/schemelib/codegen/active-object.scm
a1d2b45ab386c270b2e2eea247a55ae54922f8d1
[]
no_license
contextlogger/contextlogger2
538e80c120f206553c4c88c5fc51546ae848785e
8af400c3da088f25fd1420dd63889aff5feb1102
refs/heads/master
2020-05-05T05:03:47.896638
2011-10-05T23:50:14
2011-10-05T23:50:14
1,675,623
1
0
null
null
null
null
UTF-8
Scheme
false
false
3,248
scm
active-object.scm
(module active-object mzscheme (require (lib "usual.scm" "wg")) (require (lib "ast-util.scm" "wg")) (require (lib "compact.scm" "wg")) (require (lib "node-ctors.scm" "wg")) (require (lib "local-util.scm" "codegen")) (define (has-elem? name ast) (true? (assq name (cdr ast)))) (define (ensure-has-elems elems ast) (for-each (lambda (elem) (alet name (car elem) (unless (has-elem? name ast) (push-set! ast elem)))) elems) ast) (define* ao-scheduler-add-this (call 'CActiveScheduler::Add '(this))) (define/kw* (ao-ctor-super #:key (priority 'EPriorityStandard)) (ctor-super 'CActive (list priority))) (define* (ao-ctor-init-list . op) (ctor-init-list (apply ao-ctor-super op))) (define* ao-basic-dtor (dtor public virtual (block (call 'Cancel)))) (define* (run-l . args) ;; RunL has no arguments or return values, and the body is ;; application specific, so there is not all that much we can do ;; apart for giving default values to certain attributes. (alet ast (apply func (name 'RunL) args) (ensure-has-elems (list '(private #t) '(virtual #t) '(leaving #t)) ast))) (define* (do-cancel . args) (define ast (apply func (name 'DoCancel) args)) (ensure-has-elems (list '(private #t) '(virtual #t) '(leaving #f)) ast)) (define* (run-error . args) (define ast (apply func (name 'RunError) args)) (ensure-has-elems (list (args (arg (type 'TInt) (name 'aError))) (returns (type 'TInt)) '(private #t) '(virtual #t) '(leaving #f)) ast)) (define* (ao-class . args) (define ast (apply class args)) ;; For easier analysis. (set! ast (compact-flatten ast)) (set! ast (ensure-has-elems (list (bases 'CActive)) ast)) ast) ) ; end module #| Copyright 2008 Helsinki Institute for Information Technology (HIIT) and the authors. All rights reserved. Authors: Tero Hasu <[email protected]> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |#
false
fc114f7b515afb30cbe037e0c32b13e7ac8e125e
f6ebd0a442b29e3d8d57f0c0935fd3e104d4e867
/ch01/1.3/ex-1-3-lispro06.scm
722a139a9a9dc9910df2a2d9e5bae3f6c6b0782c
[]
no_license
waytai/sicp-2
a8e375d43888f316a063d280eb16f4975b583bbf
4cdc1b1d858c6da7c9f4ec925ff4a724f36041cc
refs/heads/master
2021-01-15T14:36:22.995162
2012-01-24T12:21:30
2012-01-24T12:21:30
23,816,705
1
0
null
null
null
null
UTF-8
Scheme
false
false
3,716
scm
ex-1-3-lispro06.scm
;ex 1.40 (define tolerance 0.00001) (define (fixed-point f first-guess) (define (close-enough? v1 v2) (< (abs ( - v1 v2)) tolerance)) (define (try guess) (let ((next (f guess))) (if (close-enough? guess next) next (try next)))) (try first-guess)) (define (deriv g) (lambda (x) (/ (- (g (+ x dx)) (g x)) dx))) (define dx 0.00001) (define (newton-transform g) (lambda (x) (- x (/ (g x) ((deriv g) x))))) (define (newtons-method g guess) (fixed-point (newton-transform g) guess)) (define (cubic a b c) (lambda (x) (+ (* x x x) (* a (* x x)) (* b x) c))) (print "ex 1.40") (newline) (newtons-method (cubic -6 3 10) 1) (newtons-method (cubic 4 6 2) 1) (newtons-method (cubic 1 -4 -10) 1) ;ex 1.41 (define (inc a) (+ 1 a) ) (define (double f) (lambda (x) (f (f x)))) (print "ex 1.41") (newline) (((double (double double)) inc) 5) ;ex 1.42 (define (square x) (* x x) ) (define (compose f g) (lambda (x) (f (g x)))) (print "ex 1.42") (newline) ((compose square inc) 6) ;ex 1.43 (define (repeat f n) (lambda (x) (if (< n 1) x ((compose f (repeat f (- n 1)))x)))) (print "ex 1.43") (newline) ((repeat square 3) 2) ;ex 1.44 (define (smooth f) (define (average a b c) (/ (+ a b c) 3)) (let ((dx 0.000001)) (lambda (x) (average (f (- x dx)) (f x) (f (+ x dx))))) ) (define (repeated f n) (define (iter result a) (if (> a 1) (iter (compose result f) (- a 1)) result)) (iter f n)) (define (n-fold-smooth f n) (repeated (smooth f) n) ) (print "ex 1.44") (newline) ((repeat square 3) 2) ((n-fold-smooth square 3) 2) ;ex 1. 45 (define (average x y) (/ (+ x y) 2.0)) (define (average-damp f) (lambda (x) (average x (f x)))) (define tolerance 0.00001) (define (fixed-point f first-guess) (define (close-enough? v1 v2) (< (abs (- v1 v2)) tolerance)) (define (try guess) (let ((next (f guess))) (if (close-enough? guess next) next (try next)))) (try first-guess)) (define (repeated f n) (if (= n 1) f (lambda (x) (f ((repeated f (- n 1)) x))))) (define (get-max-pow n) (define (iter p r) (if (< (- n r) 0) (- p 1) (iter (+ p 1) (* r 2)))) (iter 1 2)) (define (pow b p) (define (even? x) (= (remainder x 2) 0)) (define (sqr x) (* x x)) (define (iter res a n) (if (= n 0) res (if (even? n) (iter res (sqr a) (/ n 2)) (iter (* res a) a (- n 1))))) (iter 1 b p)) (define (nth-root n x) (fixed-point ((repeated average-damp (get-max-pow n)) (lambda (y) (/ x (pow y (- n 1))))) 1.0)) (print "ex 1.45") (newline) (nth-root 5 32) ;ex 1.46 (define (close-enough? v1 v2) (define tolerance 1.e-6) (< (/ (abs (- v1 v2)) v2) tolerance)) (define (iterative-improve improve close-enough?) (lambda (x) (let ((xim (improve x))) (if (close-enough? x xim) xim ((iterative-improve improve close-enough?) xim)) ))) ; (a) rewrite sqrt using iterative-improve (define (sqrt x) ((iterative-improve ; improve function is nothing but the ; function f whose fixed point is to be found! (lambda (y) (/ (+ (/ x y) y) 2)) close-enough?) 1.0)) ; (b) rewrite fixed-point using iterative-improve (define (fixed-point f first-guess) ((iterative-improve f close-enough?) first-guess)) (print "1.46") (newline) (sqrt 2) (fixed-point cos 1.0)
false
5e4dfb5d346b25f18eb047898b3663269d4b8ae5
12fc725f8273ebfd9ece9ec19af748036823f495
/tools/schemelib/common/usual-4.ss
3cb5c44e854f6c349c23c0fc135865e33a687265
[]
no_license
contextlogger/contextlogger2
538e80c120f206553c4c88c5fc51546ae848785e
8af400c3da088f25fd1420dd63889aff5feb1102
refs/heads/master
2020-05-05T05:03:47.896638
2011-10-05T23:50:14
2011-10-05T23:50:14
1,675,623
1
0
null
null
null
null
UTF-8
Scheme
false
false
196
ss
usual-4.ss
#lang scheme (require (lib "module-util.scm" "wg")) (provide (all-from-out (lib "module-util.scm" "wg"))) (require* "contract.ss") (require* "kw.ss") (require* "module.ss") (require* "util.ss")
false
67203352de5e2e8ac3fb5158fe82f1e8d9cb158e
4b5dddfd00099e79cff58fcc05465b2243161094
/chapter_2/exercise_2_48.scm
958e1b76b483fc224a25f80182fa65ab75d4c8a0
[ "MIT" ]
permissive
hjcapple/reading-sicp
c9b4ef99d75cc85b3758c269b246328122964edc
f54d54e4fc1448a8c52f0e4e07a7ff7356fc0bf0
refs/heads/master
2023-05-27T08:34:05.882703
2023-05-14T04:33:04
2023-05-14T04:33:04
198,552,668
269
41
MIT
2022-12-20T10:08:59
2019-07-24T03:37:47
Scheme
UTF-8
Scheme
false
false
362
scm
exercise_2_48.scm
#lang racket (require (planet "sicp.ss" ("soegaard" "sicp.plt" 2 1))) ;; P93 - [练习 2.48] (define (make-segment start end) (cons start end)) (define (start-segment s) (car s)) (define (end-segment s) (cdr s)) ;;;;;;;;;;;;;;;;;;; (define a (make-segment (make-vect 0 0) (make-vect 10 10))) (start-segment a) (end-segment a)
false
0c7cef1574189cd1c5cc45df7a05e72b233b830b
9dc73e4725583ae7af984b2e19f965bbdd023787
/the-little-series/the-seasoned-schemer/15-the-difference-between-men-and-boys.ss
4465ce6d46f860acd38df0ccf341a28789544885
[]
no_license
hidaris/thinking-dumps
2c6f7798bf51208545a08c737a588a4c0cf81923
05b6093c3d1239f06f3657cd3bd15bf5cd622160
refs/heads/master
2022-12-06T17:43:47.335583
2022-11-26T14:29:18
2022-11-26T14:29:18
83,424,848
6
0
null
null
null
null
UTF-8
Scheme
false
false
1,924
ss
15-the-difference-between-men-and-boys.ss
#lang racket/base (define x (cons (quote chicago) (cons (quote pizza) (quote ())))) (define gourmet (lambda (food) (cons food (cons x (quote ()))))) (define gourmand (lambda (food) (set! x food) (cons food (cons x (quote ()))))) (define diner (lambda (food) (cons (quote milkshake) (cons food (quote ()))))) (define dinerR (lambda (food) (set! x food) (cons (quote milkshake) (cons food (quote ()))))) (define omnivore (let ((x (quote minestrone))) (lambda (food) (set! x food) (cons food (cons x (quote ())))))) ;;; now, we avoid the conflict in dinerR and gourmand ;;; The Sixteenth commandment ;;; Use (set! ...) only with names defined in (let ...)s. (define gobbler (let ((x (quote minestrone))) (lambda (food) (set! x food) (cons food (cons x (quote ())))))) ;;; maybe need review. (define nibbler (lambda (food) (let ((x (quote donut))) (set! x food) (cons food (cons x (quote ())))))) ;;; The Seventeenth Commandment ;;; Use (set! x ...) for (let ((x ...)) ...) only if ;;; there is at least one (lambda ... between it ;;; and the (let ((x ...)) ...). (define food (quote none)) (define glutton (lambda (x) (set! food x) (cons (quote more) (cons x (cons (quote more) (cons x (quote ()))))))) ;;; The Eighteenth Commandment ;;; Use (set! x ...) only when the value that x ;;; refers to is no longer needed. (define chez-nous-wrong (lambda () (set! food x) (set! x food))) ;;; use (let ...) to make first food value in a temp var. (define chez-nous (lambda () (let ((a food)) (set! food x) (set! x a))))
false
a55e4e529aa6c0fe962c24e24149d87333685b1c
f40f97c37847103138c82d3f1b3956d9c2592b76
/templates/scheme-helpers/pmatch.scm
d2e74d63c59f8348eb44695b5a4bea27eb2d73da
[ "MIT" ]
permissive
k-tsushima/Shin-Barliman
34df6868aafcd2d36dbbc57ef56eab555da05a5c
abea8511d18273196ac806dcf14b88d4098e18f8
refs/heads/master
2021-06-25T13:47:22.721816
2020-01-24T04:11:24
2020-01-24T04:11:24
182,607,716
16
1
MIT
2020-12-02T00:12:39
2019-04-22T02:18:17
Scheme
UTF-8
Scheme
false
false
2,696
scm
pmatch.scm
;; This is a new version of pmatch (August 8, 2012). ;; It has two important new features: ;; 1. It allows for a name to be given to the pmatch if an error ensues. ;; 2. A line from the specification has been removed. (see below). Without ;; that line removed, it was impossible for a pattern to be (quote ,x), ;; which might be worth having especially when we write an interpreter ;; for Scheme, which includes quote as a language form. ;;; Code written by Oleg Kiselyov ;; (http://pobox.com/~oleg/ftp/) ;;; ;;; Taken from leanTAP.scm ;;; http://kanren.cvs.sourceforge.net/kanren/kanren/mini/leanTAP.scm?view=log ; A simple linear pattern matcher ; It is efficient (generates code at macro-expansion time) and simple: ; it should work on any R5RS (and R6RS) Scheme system. ; (pmatch exp <clause> ...[<else-clause>]) ; <clause> ::= (<pattern> <guard> exp ...) ; <else-clause> ::= (else exp ...) ; <guard> ::= boolean exp | () ; <pattern> :: = ; ,var -- matches always and binds the var ; pattern must be linear! No check is done ; _ -- matches always ; 'exp -- comparison with exp (using equal?) REMOVED (August 8, 2012) ; exp -- comparison with exp (using equal?) ; (<pattern1> <pattern2> ...) -- matches the list of patterns ; (<pattern1> . <pattern2>) -- ditto ; () -- matches the empty list (define-syntax pmatch (syntax-rules (else guard) ((_ v (e ...) ...) (pmatch-aux #f v (e ...) ...)) ((_ v name (e ...) ...) (pmatch-aux name v (e ...) ...)))) (define-syntax pmatch-aux (syntax-rules (else guard) ((_ name (rator rand ...) cs ...) (let ((v (rator rand ...))) (pmatch-aux name v cs ...))) ((_ name v) (begin (if 'name (printf "pmatch ~s failed\n~s\n" 'name v) (printf "pmatch failed\n ~s\n" v)) (error 'pmatch "match failed"))) ((_ name v (else e0 e ...)) (begin e0 e ...)) ((_ name v (pat (guard g ...) e0 e ...) cs ...) (let ((fk (lambda () (pmatch-aux name v cs ...)))) (ppat v pat (if (and g ...) (begin e0 e ...) (fk)) (fk)))) ((_ name v (pat e0 e ...) cs ...) (let ((fk (lambda () (pmatch-aux name v cs ...)))) (ppat v pat (begin e0 e ...) (fk)))))) (define-syntax ppat (syntax-rules (? comma unquote) ((_ v ? kt kf) kt) ((_ v () kt kf) (if (null? v) kt kf)) ; ((_ v (quote lit) kt kf) (if (equal? v (quote lit)) kt kf)) ((_ v (unquote var) kt kf) (let ((var v)) kt)) ((_ v (x . y) kt kf) (if (pair? v) (let ((vx (car v)) (vy (cdr v))) (ppat vx x (ppat vy y kt kf) kf)) kf)) ((_ v lit kt kf) (if (equal? v (quote lit)) kt kf))))
true
c4236bb9629d56e992851ed751ca067002cb1a96
9f466767730a64747f02ee934138fcc88c93e1fe
/opengl/raw.scm
ac2656d89e0e98463b98433d8cb2fffaa2454d00
[]
no_license
lemvik/scheme-playground
81258bd3b5c847e019dfc6088ff1d806fe5dbc74
d32ab822857ecebd82ee28cd97bbbc07b1b56e3f
refs/heads/master
2021-01-25T04:58:15.536631
2017-06-16T13:32:13
2017-06-16T13:32:13
93,491,658
0
0
null
null
null
null
UTF-8
Scheme
false
false
4,519
scm
raw.scm
; -*- geiser-scheme-implementation: chez -*- ;;;; ;;;; Raw OpenGL bindings. ;;;; (library (opengl raw) (export gl-attach-shader gl-bind-buffer gl-bind-vertex-array gl-buffer-data gl-clear gl-compile-shader gl-create-program gl-create-shader gl-debug-message-callback gl-delete-shader gl-draw-arrays gl-draw-elements gl-enable gl-enable-vertex-attrib-array gl-gen-buffers gl-gen-vertex-arrays gl-get-error gl-link-program gl-polygon-mode gl-shader-source gl-use-program gl-vertex-attrib-pointer :gl-false :gl-true :gl-triangles :gl-unsigned-int :gl-float :gl-debug-output :gl-array-buffer :gl-element-array-buffer :gl-static-draw :gl-fragment-shader :gl-vertex-shader :gl-front-and-back :gl-line :gl-fill) (import (chezscheme) (ffi base) (opengl os)) (define :gl-false #x0) (define :gl-true #x1) (define :gl-triangles #x0004) (define :gl-unsigned-int #x1405) (define :gl-float #x1406) (define :gl-debug-output #x92e0) (define :gl-array-buffer #x8892) (define :gl-element-array-buffer #x8893) (define :gl-static-draw #x88e4) (define :gl-fragment-shader #x8b30) (define :gl-vertex-shader #x8b31) (define :gl-front-and-back #x0408) (define :gl-line #x1B01) (define :gl-fill #x1B02) (define gl-attach-shader (lazy-foreign-procedure (locate-foreign-procedure "glAttachShader") (int int) void)) (define gl-bind-buffer (lazy-foreign-procedure (locate-foreign-procedure "glBindBuffer") (int unsigned-int) void)) (define gl-bind-vertex-array (lazy-foreign-procedure (locate-foreign-procedure "glBindVertexArray") (int) void)) (define gl-buffer-data (lazy-foreign-procedure (locate-foreign-procedure "glBufferData") (int unsigned-int u8* int) void)) (define gl-clear (lazy-foreign-procedure "glClear" (unsigned-int) void)) (define gl-compile-shader (lazy-foreign-procedure (locate-foreign-procedure "glCompileShader") (int) void)) (define gl-create-program (lazy-foreign-procedure (locate-foreign-procedure "glCreateProgram") () int)) (define gl-create-shader (lazy-foreign-procedure (locate-foreign-procedure "glCreateShader") (int) int)) (define gl-debug-message-callback (lazy-foreign-procedure (locate-foreign-procedure "glDebugMessageCallback") (uptr uptr) void)) (define gl-delete-shader (lazy-foreign-procedure (locate-foreign-procedure "glDeleteShader") (int) void)) (define gl-draw-arrays (lazy-foreign-procedure "glDrawArrays" (unsigned-int int size_t) void)) (define gl-draw-elements (lazy-foreign-procedure "glDrawElements" (unsigned-int int size_t uptr) void)) (define gl-enable (lazy-foreign-procedure "glEnable" (unsigned-int) void)) (define gl-enable-vertex-attrib-array (lazy-foreign-procedure (locate-foreign-procedure "glEnableVertexAttribArray") (int) void)) (define gl-gen-buffers (lazy-foreign-procedure (locate-foreign-procedure "glGenBuffers") (int u8*) void)) (define gl-gen-vertex-arrays (lazy-foreign-procedure (locate-foreign-procedure "glGenVertexArrays") (int u8*) void)) (define gl-get-error (lazy-foreign-procedure "glGetError" () unsigned-int)) (define gl-link-program (lazy-foreign-procedure (locate-foreign-procedure "glLinkProgram") (int) void)) (define gl-polygon-mode (lazy-foreign-procedure "glPolygonMode" (unsigned-int unsigned-int) void)) (define gl-shader-source (lazy-foreign-procedure (locate-foreign-procedure "glShaderSource") (int int uptr uptr) int)) (define gl-use-program (lazy-foreign-procedure (locate-foreign-procedure "glUseProgram") (int) void)) (define gl-vertex-attrib-pointer (lazy-foreign-procedure (locate-foreign-procedure "glVertexAttribPointer") (unsigned-int int int int unsigned-int uptr) void)))
false
3bada5a613e40d5683e25b83c8ce5168eabf8506
b4fe4841131773bfc881ed9539d5d8509762b05c
/src/pffi/compat.sagittarius.sls
881003837fcf4ecfb279839e6b8a7a04a73380ec
[]
no_license
ktakashi/r6rs-pffi
6d0cf9b7c89ebf3a57fca81f8f5cb07769e742d1
d1aa1eae4d60677d3610611c711891136a03168a
refs/heads/master
2022-05-20T08:00:05.307243
2022-05-19T19:53:59
2022-05-19T19:53:59
35,493,751
44
9
null
2022-05-06T12:35:35
2015-05-12T14:41:35
Scheme
UTF-8
Scheme
false
false
5,029
sls
compat.sagittarius.sls
;;; -*- mode:scheme; coding: utf-8; -*- ;;; ;;; src/pffi/compat.sagittarius.sls - Compatible layer for Sagittarius ;;; ;;; Copyright (c) 2015 Takashi Kato <[email protected]> ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; ;;; 1. Redistributions of source code must retain the above copyright ;;; notice, this list of conditions and the following disclaimer. ;;; ;;; 2. Redistributions in binary form must reproduce the above copyright ;;; notice, this list of conditions and the following disclaimer in the ;;; documentation and/or other materials provided with the distribution. ;;; ;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ;;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ;;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ;;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ;;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ;;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ;;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ;;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ;;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ;;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;;; ;; this file provides compatible layer for (pffi procedure) ;; if implementations can't make this layer, then make ;; pffi/procedure.$name.sls file so that (pffi) library can ;; look it up. #!r6rs (library (pffi compat) (export (rename (open-shared-library open-shared-object)) (rename (lookup-shared-library lookup-shared-object)) make-c-function make-c-callback free-c-callback ;; primitive types char unsigned-char short unsigned-short int unsigned-int long unsigned-long float double int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t pointer callback void ___ ;; pointer ref pointer-ref-c-uint8 pointer-ref-c-int8 pointer-ref-c-uint16 pointer-ref-c-int16 pointer-ref-c-uint32 pointer-ref-c-int32 pointer-ref-c-uint64 pointer-ref-c-int64 ;; should we define them? ;; pointer-ref-c-uint8_t ;; pointer-ref-c-int8_t ;; pointer-ref-c-uint16_t ;; pointer-ref-c-int16_t ;; pointer-ref-c-uint32_t ;; pointer-ref-c-int32_t ;; pointer-ref-c-uint64_t ;; pointer-ref-c-int64_t pointer-ref-c-unsigned-char pointer-ref-c-char pointer-ref-c-unsigned-short pointer-ref-c-short pointer-ref-c-unsigned-int pointer-ref-c-int pointer-ref-c-unsigned-long pointer-ref-c-long pointer-ref-c-float pointer-ref-c-double pointer-ref-c-pointer ;; pointer set pointer-set-c-uint8! pointer-set-c-int8! pointer-set-c-uint16! pointer-set-c-int16! pointer-set-c-uint32! pointer-set-c-int32! pointer-set-c-uint64! pointer-set-c-int64! pointer-set-c-unsigned-char! pointer-set-c-char! pointer-set-c-unsigned-short! pointer-set-c-short! pointer-set-c-unsigned-int! pointer-set-c-int! pointer-set-c-unsigned-long! pointer-set-c-long! pointer-set-c-float! pointer-set-c-double! pointer-set-c-pointer! ;; sizeof size-of-char size-of-short size-of-int size-of-long size-of-float size-of-double (rename (size-of-void* size-of-pointer)) size-of-int8_t size-of-int16_t size-of-int32_t size-of-int64_t pointer? bytevector->pointer pointer->bytevector pointer->integer (rename (uinteger->pointer integer->pointer)) ) (import (rnrs) (rename (sagittarius ffi) (callback %callback) (make-c-function %make-c-function)) (sagittarius control)) (define (make-c-function lib conv ret name args) (%make-c-function lib ret name args)) (define-syntax callback (syntax-rules () ((_ ignore ...) %callback))) (define pointer void*) ;; Since 0.6.4, this is available ;; (define make-c-callback (with-library (sagittarius ffi) make-c-callback)) )
true
c4533c121d6ecf769c9fa8d8a6eb4e6d375093fe
ac2a3544b88444eabf12b68a9bce08941cd62581
/gsc/_t-c-3.scm
dc704dd49bc1f755301d5f01eb01bfb6c17fa335
[ "Apache-2.0", "LGPL-2.1-only" ]
permissive
tomelam/gambit
2fd664cf6ea68859d4549fdda62d31a25b2d6c6f
d60fdeb136b2ed89b75da5bfa8011aa334b29020
refs/heads/master
2020-11-27T06:39:26.718179
2019-12-15T16:56:31
2019-12-15T16:56:31
229,341,552
1
0
Apache-2.0
2019-12-20T21:52:26
2019-12-20T21:52:26
null
UTF-8
Scheme
false
false
14,086
scm
_t-c-3.scm
;;;============================================================================ ;;; File: "_t-c-3.scm" ;;; Copyright (c) 1994-2019 by Marc Feeley, All Rights Reserved. (include "generic.scm") (include-adt "_envadt.scm") (include-adt "_gvmadt.scm") (include-adt "_ptreeadt.scm") (include-adt "_sourceadt.scm") '(begin;**************brad (##declare (fixnum)) (##include "_hostadt.scm") (##declare (generic)) ) ;;;---------------------------------------------------------------------------- ;; ;; Back end for C language (part 3) ;; ----------------------- (define targ-bits-per-byte 8) ; 8 bits per byte (define (targ-ceiling-log2 n) (let loop ((i 0) (x 1)) (if (< x n) (loop (+ i 1) (* x 2)) i))) ;; FIXNUM representation. ;; Limits of fixnums (assumes 2's complement representation): (define targ-min-fixnum32 (* -2 (expt 2 (- (* 4 targ-bits-per-byte) (+ targ-tag-bits 2))))) (define targ-max-fixnum32 (- (+ targ-min-fixnum32 1))) (define (targ-fixnum32? x) (and (integer? x) (exact? x) (>= x targ-min-fixnum32) (<= x targ-max-fixnum32))) (define (targ-nonzero-fixnum32? x) (and (targ-fixnum32? x) (not (zero? x)))) (define targ-min-fixnum64 (* -2 (expt 2 (- (* 8 targ-bits-per-byte) (+ targ-tag-bits 2))))) (define targ-max-fixnum64 (- (+ targ-min-fixnum64 1))) (define (targ-fixnum64? x) (and (integer? x) (exact? x) (>= x targ-min-fixnum64) (<= x targ-max-fixnum64))) (define (targ-cast-to-fixnum32 n) (+ (modulo (- n targ-min-fixnum32) (* -2 targ-min-fixnum32)) targ-min-fixnum32)) (define (targ-u32-to-s32 n) (if (< 2147483647 n) (- n 4294967296) n)) (define (targ-s32-to-u32 n) (if (< n 0) (+ n 4294967296) n)) (define (targ-u64-to-s64 n) (if (< 9223372036854775807 n) (- n 18446744073709551616) n)) (define (targ-s64-to-u64 n) (if (< n 0) (+ n 18446744073709551616) n)) (define (targ-s32->hex-string n) (cond ((= n -2147483648) "-1-0x7FFFFFFF") ((< n 0) (string-append "-0x" (number->string (- n) 16))) (else (string-append "0x" (number->string n 16))))) (define (targ-s64->hi-lo-bits x) (let* ((y (targ-u64->hi-lo-bits (targ-s64-to-u64 x))) (hi (car y)) (lo (cdr y))) (cons (targ-u32-to-s32 hi) lo))) (define (targ-u64->hi-lo-bits x) (cons (quotient x #x100000000) (modulo x #x100000000))) ;; BIGNUM representation. (define targ-min-adigit-width 32) ; At least 32 bits per adigit (define targ-max-adigit-width 64) ; At most 64 bits per adigit (define (targ-bignum-digits obj) (define (dig n len rest) (cond ((= len 1) (cons n rest)) (else (let* ((hi-len (quotient len 2)) (lo-len (- len hi-len)) (lo-len-bits (* targ-min-adigit-width lo-len))) (let* ((hi (arithmetic-shift n (- lo-len-bits))) (lo (- n (arithmetic-shift hi lo-len-bits)))) (dig lo lo-len (dig hi hi-len rest))))))) (let* ((width (integer-length obj)) (len (+ (quotient width targ-min-adigit-width) 1))) (dig (if (< obj 0) (+ (arithmetic-shift 1 (* targ-min-adigit-width len)) obj) obj) len '()))) ;; FLONUM representation. (define targ-inexact-+2 (exact->inexact 2)) (define targ-inexact--2 (exact->inexact -2)) (define targ-inexact-+1 (exact->inexact 1)) (define targ-inexact--1 (exact->inexact -1)) (define targ-inexact-+1/2 (exact->inexact (/ 1 2))) (define targ-inexact-+0 (exact->inexact 0)) (define (targ-float->inexact-exponential-format x f64?) (let* ((e-bits (if f64? 11 8)) (e-bias (- (expt 2 (- e-bits 1)) 1))) (define (exp-form-pos x y i) (let ((i*2 (+ i i))) (let ((z (if (and (not (< e-bias i*2)) (not (< x y))) (exp-form-pos x (* y y) i*2) (vector x 0 1)))) (let ((a (vector-ref z 0)) (b (vector-ref z 1))) (let ((i+b (+ i b))) (if (and (not (< e-bias i+b)) (not (< a y))) (begin (vector-set! z 0 (/ a y)) (vector-set! z 1 i+b))) z))))) (define (exp-form-neg x y i) (let ((i*2 (+ i i))) (let ((z (if (and (< i*2 (- e-bias 1)) (< x y)) (exp-form-neg x (* y y) i*2) (vector x 0 1)))) (let ((a (vector-ref z 0)) (b (vector-ref z 1))) (let ((i+b (+ i b))) (if (and (< i+b (- e-bias 1)) (< a y)) (begin (vector-set! z 0 (/ a y)) (vector-set! z 1 i+b))) z))))) (define (exp-form x) (if (< x targ-inexact-+1) (let ((z (exp-form-neg x targ-inexact-+1/2 1))) (vector-set! z 0 (* targ-inexact-+2 (vector-ref z 0))) (vector-set! z 1 (- -1 (vector-ref z 1))) z) (exp-form-pos x targ-inexact-+2 1))) (if (negative? (float-copysign targ-inexact-+1 x)) (let ((z (exp-form (float-copysign x targ-inexact-+1)))) (vector-set! z 2 -1) z) (exp-form x)))) (define (targ-float->exact-exponential-format x f64?) (let* ((z (targ-float->inexact-exponential-format x f64?)) (m-bits (if f64? 52 23)) (e-bits (if f64? 11 8))) (let ((y (vector-ref z 0))) (if (not (< y targ-inexact-+2)) ;; +inf.0 or +nan.0? (begin (if (< targ-inexact-+0 y) (vector-set! z 0 (expt 2 m-bits)) ;; +inf.0 (vector-set! z 0 (- (* (expt 2 m-bits) 2) 1))) ;; +nan.0 (vector-set! z 1 (expt 2 (- e-bits 1)))) (vector-set! z 0 (truncate (inexact->exact (* (vector-ref z 0) (exact->inexact (expt 2 m-bits))))))) (vector-set! z 1 (- (vector-ref z 1) m-bits)) z))) (define (targ-float->bits x f64?) (let ((m-bits (if f64? 52 23)) (e-bits (if f64? 11 8))) (define (bits a b) (let ((m-min (expt 2 m-bits))) (if (< a m-min) a (+ (- a m-min) (* (+ (+ b m-bits) (- (expt 2 (- e-bits 1)) 1)) m-min))))) (let* ((z (targ-float->exact-exponential-format x f64?)) (y (bits (vector-ref z 0) (vector-ref z 1)))) (if (negative? (vector-ref z 2)) (+ (expt 2 (+ e-bits m-bits)) y) y)))) (define (targ-f32->bits x) (targ-float->bits x #f)) (define (targ-f64->hi-lo-bits x) (targ-u64->hi-lo-bits (targ-float->bits x #t))) (define (targ-unusual-float? x) (cond ((zero? x) (negative? (float-copysign targ-inexact-+1 x))) ((negative? x) (not (< x (/ x targ-inexact-+2)))) (else (not (< (/ x targ-inexact-+2) x))))) (define (targ-flonum? x) (and (number? x) (inexact? (targ-real-part x)) (exact? (targ-imag-part x)) (zero? (targ-imag-part x)))) (define (targ-nonzero-flonum? x) (and (targ-flonum? x) (not (zero? x)))) ;; RATNUM representation. (define (targ-numerator x) (numerator x)) (define (targ-denominator x) (denominator x)) ;; CPXNUM representation. (define (targ-real-part x) (real-part x)) (define (targ-imag-part x) (imag-part x)) (define (targ-integer? x) (integer? x)) (define (targ-nonzero-integer? x) (and (targ-integer? x) (not (zero? x)))) (define (targ-number? x) (number? x)) (define (targ-nonzero-number? x) (and (targ-number? x) (not (zero? x)))) (define (targ-finite? x) (finite? x)) ;; Extraction of object's type and subtype. (define (targ-obj-type obj) (cond ((false-object? obj) 'boolean) ((eq? obj #t) 'boolean) ((null? obj) 'null) ((absent-object? obj) 'absent) ((unused-object? obj) 'unused) ((deleted-object? obj) 'deleted) ((void-object? obj) 'void) ((unbound1-object? obj) 'unbound1) ((unbound2-object? obj) 'unbound2) ((end-of-file-object? obj) 'eof) ((optional-object? obj) 'optional) ((key-object? obj) 'key) ((rest-object? obj) 'rest) ((symbol-object? obj) 'subtyped) ((keyword-object? obj) 'subtyped) ((structure-object? obj) 'subtyped) ((box-object? obj) 'subtyped) ((proc-obj? obj) 'subtyped) ((pair? obj) 'pair) ((number? obj) (cond ((targ-fixnum32? obj) 'fixnum) (else 'subtyped))) ((char? obj) 'char) (else 'subtyped))) (define (targ-obj-subtype obj) (cond ((proc-obj? obj) 'procedure) ((symbol-object? obj) 'symbol) ((keyword-object? obj) 'keyword) ((structure-object? obj) 'structure) ((box-object? obj) 'box) ((number? obj) (cond ((and (integer? obj) (exact? obj)) (if (targ-fixnum64? obj) 'bigfixnum 'bignum)) ((and (rational? obj) (exact? obj)) 'ratnum) ((and (inexact? (targ-real-part obj)) (exact? (targ-imag-part obj)) (zero? (targ-imag-part obj))) 'flonum) (else 'cpxnum))) ((s8vect? obj) 's8vector) ((u8vect? obj) 'u8vector) ((s16vect? obj) 's16vector) ((u16vect? obj) 'u16vector) ((s32vect? obj) 's32vector) ((u32vect? obj) 'u32vector) ((s64vect? obj) 's64vector) ((u64vect? obj) 'u64vector) ((f32vect? obj) 'f32vector) ((f64vect? obj) 'f64vector) ((vector-object? obj) 'vector) ((string? obj) 'string) (else (compiler-internal-error "targ-obj-subtype, unknown object 'obj'" obj)))) (define (targ-obj-subtype-integer obj) (define (err) (compiler-internal-error "targ-obj-subtype-integer, unknown subtyped object 'obj'" obj)) (case (targ-obj-type obj) ((pair) 1) ((subtyped) (case (targ-obj-subtype obj) ((vector) 0) ((ratnum) 2) ((cpxnum) 3) ((structure) 4) ((box) 5) ((symbol) 8) ((keyword) 9) ((procedure) 14) ((string) 19) ((s8vector) 20) ((u8vector) 21) ((s16vector) 22) ((u16vector) 23) ((s32vector) 24) ((u32vector) 25) ((s64vector) 26) ((u64vector) 27) ((f32vector) 28) ((f64vector) 29) ((flonum) 30) ((bignum) 31) (else (err)))) (else (err)))) ;; The targ-hash hashing function implements an adaptation of the ;; FNV1a hash algorithm (see ;; https://tools.ietf.org/html/draft-eastlake-fnv-12). Instead of ;; iterating over bytes, an iteration over Unicode code points is ;; used. This will give the same result if the string contains only ;; ISO-8859-1 characters. However, only the lower 29 bits of the ;; standard 32 bit FNV1a algorithm are returned so the result fits in ;; a fixnum on a 32 bit word architecture. ;; ;; Note: The function targ-hash must return the same value as the ;; functions "hash_UTF_8_string" and "hash_scheme_string" in ;; lib/setup.c, and the function "##string=?-hash" in lib/_system.scm . (define (targ-hash str) ;; FNV1a 32 bit constants adapted to fit in 29 bits (tagged 32 bit fixnums) (define fnv1a-prime-fixnum32 #x01000193) (define fnv1a-offset-basis-fixnum32 #x011C9DC5) (let loop ((i 0) (h fnv1a-offset-basis-fixnum32)) (if (< i (string-length str)) (loop (+ i 1) (bitwise-and targ-max-fixnum32 (* fnv1a-prime-fixnum32 (bitwise-xor h (character->unicode (string-ref str i)))))) h))) (define (targ-build-gc-map slots live?) (let loop ((i 0) (2^i 1) (lst slots) (gc-map 0)) (if (pair? lst) (let ((var (car lst))) (loop (+ i 1) (* 2^i 2) (cdr lst) (if (live? i var) (+ gc-map 2^i) gc-map))) gc-map))) (define (targ-build-gc-map-all-live fs) (- (expt 2 fs) 1)) (define (targ-gc-map-chunks gc-map kind fs) (define bits-per-chunk 32) (define two^32 4294967296) (define (build-chunks gc-map fs) (if (<= fs 0) '() (cons (remainder gc-map two^32) (build-chunks (quotient gc-map two^32) (- fs bits-per-chunk))))) (build-chunks gc-map (targ-actual-fs kind fs))) (define (targ-out-of-line-frame? kind fs) (> (targ-actual-fs kind fs) targ-max-inline-fs)) (define (targ-actual-fs kind fs) (if (eq? kind 'internal) (targ-internal-fs fs) fs)) (define (targ-internal-fs fs) (+ (targ-align-frame fs) (targ-align-frame-without-reserve (+ (targ-nb-gvm-regs) 1)))) (define (targ-align-frame fs) (* (quotient (+ fs (- targ-frame-alignment 1)) targ-frame-alignment) targ-frame-alignment)) (define (targ-align-frame-without-reserve fs) (- (targ-align-frame (+ fs targ-frame-reserve)) targ-frame-reserve)) (define targ-min-word-size-in-bits (* targ-min-word-size targ-bits-per-byte)) (define targ-max-inline-fs (- targ-min-word-size-in-bits (+ 2 ; 2 bits needed for tag (* 2 ; space for fs and link (targ-ceiling-log2 targ-min-word-size-in-bits))))) ;;;----------------------------------------------------------------------------
false
7f9078d7e8b73c3d839faf8c83fb93b1e14b8349
696a4954b2dba8cdb090d55fc51b16a34072889e
/scheme/dungeon_crawl/crawl.scm
b6d6aec87dab5cbfa8fd9180432033f4f22812f2
[]
no_license
thesnarky1/7DRL
0da6d224431f163cdc55ab0d41e6a09875483167
3e364312631c5771128e3585723dd1b51f5d36d0
refs/heads/master
2016-09-06T19:53:17.572610
2010-02-25T03:06:25
2010-02-25T03:06:25
515,962
1
0
null
null
null
null
UTF-8
Scheme
false
false
12,624
scm
crawl.scm
;;Sample game just to test out ncurses and some ideas for roguelike (c-declare "#include <ncurses.h>") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;Junk to break out to OOP lib;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define-syntax define-object (syntax-rules () [(_ (name . varlist) ((var1 val1) ...) ((var2 val2) ...)) (define name (lambda varlist (let* ([var1 val1] ...) (letrec ([var2 val2] ...) (lambda (msg . args) (case msg [(var2) (apply var2 args)] ... [else (assertion-violation 'name "invalid message" (cons msg args))]))))))] [(_ (name . varlist) ((var2 val2) ...)) (define-object (name . varlist) () ((var2 val2) ...))])) ; send-message abstracts the act of sending a message from the act ; of applying a procedure and allows the message to be unquoted. (define-syntax send-message (syntax-rules () [(_ obj msg arg ...) (obj 'msg arg ...)])) ;;Real map should be a vector of tile vectors... ;;read in something like the below and hold the vector to allow for ;;simple getting of x,y coordinates (define test-map (list "##################################################" "#..#.........#.#.................................#" "#..#..#......###.................................#" "#.....#......................#####......#........#" "#######......................~~~~#......#........#" "#........................~~~~~..~#...............#" "#.................~~~~~~~~~......................#" "#................~~~~~~..........................#" "#........#.......~~~~..................###+###...#" "########+#..##....~~~...#..............#.....#...#" "#........#.........~~....#.............#.....+...#" "#........#........~~......#............#+#####...#" "#........#.......~~..............................#" "##################################################")) ;;;;;;;;;;;;;;;;;;;;;; ;;Object Definitions;; ;;;;;;;;;;;;;;;;;;;;;; ;;Living object holds everything that's alive ;;Play with defaults in here? (define-object (living name symbol x y z hp max-hp str inv speed) ((get-name (lambda () name)) (get-symbol (lambda () symbol)) (set-symbol (lambda (new-symbol) (set! symbol new-symbol))) (get-x (lambda () x)) (set-x (lambda (new-x) (set! x new-x))) (get-y (lambda () y)) (set-y (lambda (new-y) (set! y new-y))) (get-z (lambda () z)) (set-z (lambda (new-z) (set! z new-z))) (get-hp (lambda () hp)) (set-hp (lambda (new-hp) (set! hp new-hp))) (get-max-hp (lambda () max-hp)) (set-max-hp (lambda (new-max-hp) (set! max-hp new-max-hp))) (get-str (lambda () str)) (set-str (lambda (new-str) (set! str new-str))) (get-speed (lambda () speed)) (set-speed (lambda (new-speed) (set! speed new-speed))) (get-inv (lambda() inv)) (set-inv (lambda(new-inv) (set! inv new-inv))) )) ;;Tile object holds our tile properties (define-object (tile-obj symbol x y z passable visible blocks-vision living item) ((get-symbol (lambda () symbol)) (set-symbol (lambda (new-symbol) (set! symbol new-symbol))) (get-x (lambda () x)) (set-x (lambda (new-x) (set! x new-x))) (get-y (lambda () y)) (set-y (lambda (new-y) (set! y new-y))) (get-z (lambda () z)) (set-z (lambda (new-z) (set! z new-z))) (get-passable (lambda () passable)) (set-passable (lambda (new-passable) (set! passable new-passable))) (get-visible (lambda () visible)) (set-visible (lambda (new-visible) (set! visible new-visible))) (get-blocks-vision (lambda () blocks-vision)) (set-blocks-vision (lambda (new-blocks-vision) (set! blocks-vision new-blocks-vision))) (get-living (lambda () living)) (set-living (lambda (new-living) (set! living new-living))) (get-item (lambda () item)) (set-item (lambda (new-item) (set! item new-item))) )) ;;Global look up vars (define impassable-tiles (list #\# #\~ #\+)) (define vision-blocking-tiles (list #\# #\+)) ;;Monsters vector, it holds a series of individual monster ;;vectors of the form: ;;MONSTER-NAME ;;MONSTER-HP ;;MONSTER-STRENGTH ;;MONSTER-SPEED ;;MONSTER-ICON (define monsters (vector (vector "Orc" 20 5 10 #\o) (vector "Goblin" 10 2 14 #\g) (vector "Dragon" 80 20 20 #\D))) ;;;;;;;;;;;;;;;;;; ;;Game Functions;; ;;;;;;;;;;;;;;;;;; ;;Function to Move a living object (define move-living (lambda (living src dest) (if ((send-message src get-passable)) (if ((send-message dest get-passable)) (let ((enemy (send-message dest get-living))) (if (null? enemy) (let ((x (send-message dest get-x)) (y (send-message dest get-y)) (z (send-message dest get-z))) (send-message src set-living '()) (send-message dest set-living (list living)) (send-message living set-x x) (send-message living set-y y) (send-message living set-z z)))))))) ;;;;;;;;;;;;;;;;;;;;;;; ;;Game Tick Functions;; ;;;;;;;;;;;;;;;;;;;;;;; ;;Function to do one game tick (define do-tick (lambda (tmp-tick-stack) (if (null? tmp-tick-stack) (set! tick-stack '()) (let ((curr-command (car tmp-tick-stack))) (eval-command curr-command) (do-tick (cdr tmp-tick-stack)))))) ;;Function to add something to the tick stack (define add-to-tick-stack (lambda (tmp-tick-stack tmp-action tmp-actor tmp-speed) (if (null? tmp-tick-stack) (cons (list tmp-speed tmp-actor tmp-action) tmp-tick-stack) (let ((tmp-task (car tmp-tick-stack))) (let ((tmp-task-speed (car tmp-task))) (if (>= tmp-task-speed tmp-speed) (cons tmp-task (add-to-tick-stack (cdr tmp-tick-stack) tmp-action tmp-actor tmp-speed)) (cons (list tmp-speed tmp-actor tmp-action) tmp-tick-stack))))))) ;;Function to evaluate a given command (define eval-command (lambda (tmp-command) (print tmp-command))) ;;;;;;;;;;;;;;;;;;;;; ;;NCurses Functions;; ;;;;;;;;;;;;;;;;;;;;; ;;Function to init ncurses (define ncurses-init (c-lambda () int "initscr();/*leaveok(curscr, TRUE);*/noecho();" )) ;;Function to kill NCurses (define ncurses-end (c-lambda () int "endwin();" )) ;;Function to refresh the screen (define ncurses-refresh-screen (c-lambda () void "refresh();")) ;;Function to block for user input (define ncurses-input (c-lambda () char "___result = getch();")) ;;Function to move cursor to a given location (define ncurses-move-cursor (c-lambda (int int) void "move(___arg1, ___arg2);")) ;;Function to snag the user input, ;;will block thanks to ncurses-input (define get-input-character (lambda () (char->integer (ncurses-input)))) ;;Function to draw a given character at a given spot (define move-draw-char (c-lambda (int int char) void "mvaddch(___arg1, ___arg2, ___arg3);")) ;;Function to put a living object on the screen (define ncurses-draw-living (lambda (living-object) (let ((x (send-message living-object get-x)) (y (send-message living-object get-y))) (move-draw-char y x (send-message living-object get-symbol))))) ;;;;;;;;;;;;;;;;; ;;Map Functions;; ;;;;;;;;;;;;;;;;; ;;Function to prepare our overall map object (define create-tile-set (lambda (map) (list->vector (create-map-vector map 0)))) ;;Function that creates the entire map vector (define create-map-vector (lambda (source y) (let ((curr-row (car source))) (if (= (length source) 1) (cons (list->vector (create-tiles-from-string (string->list curr-row) y 0)) '()) (cons (list->vector (create-tiles-from-string (string->list curr-row) y 0)) (create-map-vector (cdr source) (+ y 1))))))) ;;Function that creates a Tile vector given a string (define create-tiles-from-string (lambda (char-list y x) (let ((curr-char (car char-list))) (if (= (length char-list) 1) (cons (tile-from-char curr-char y x) '()) (cons (tile-from-char curr-char y x) (create-tiles-from-string (cdr char-list) y (+ x 1))))))) ;;Function to create a tile given a characetr (define tile-from-char (lambda (char y x) (let ((new-tile (tile-obj char x y 0 (lambda () #t) (lambda () #t) (lambda () #f) '() '()))) (if (member char impassable-tiles) (send-message new-tile set-passable (lambda () #f))) (if (member char vision-blocking-tiles) (send-message new-tile set-blocks-vision (lambda () #t))) new-tile))) ;;Function to draw all our map objects (define draw-whole-map (lambda (map character) (draw-tile-set map 0) (ncurses-draw-living character) (ncurses-move-cursor (send-message character get-y) (send-message character get-x)))) ;;Function to draw a tileset (define draw-tile-set (lambda (tile-set index) (if (< index (vector-length tile-set)) (begin (draw-tile-row (vector-ref tile-set index) 0) (draw-tile-set tile-set (+ index 1)))))) ;;Function to draw a tile row (define draw-tile-row (lambda (tile-set-row index) (if (< index (vector-length tile-set-row)) (let ((curr-tile (vector-ref tile-set-row index))) (move-draw-char (send-message curr-tile get-y) (send-message curr-tile get-x) (send-message curr-tile get-symbol)) (draw-tile-row tile-set-row (+ index 1)))))) ;;Function to fetch a tile identified by X/Y coords (define fetch-tile (lambda (map x y) (if (< y (vector-length map)) (let ((row (vector-ref map y))) (if (< x (vector-length row)) (vector-ref row x) #f)) #f))) ;;;;;;;;;;;;; ;;GAME CODE;; ;;;;;;;;;;;;; ;;init the screen (ncurses-init) ;;Init our character (define character (living "Segfault" #\@ 5 5 0 100 100 10 '() 15)) ;;Init the map (define our-map (create-tile-set test-map)) ;;Draw our map to start the view (draw-whole-map our-map character) ;;Block for input and deal with it as it comes (let loop ((test-char (get-input-character))) (if (not (eq? test-char 27)) ;:Get characters x/y and tile for future reference (let* ((char-x (send-message character get-x)) (char-y (send-message character get-y)) (char-tile (fetch-tile our-map char-x char-y))) ;;Case the char and deal with the input (case test-char [(108) (move-living character char-tile (fetch-tile our-map (+ char-x 1) char-y))] ;;l - move right [(107) (move-living character char-tile (fetch-tile our-map char-x (- char-y 1)))] ;;k - move up [(106) (move-living character char-tile (fetch-tile our-map char-x (+ char-y 1)))] ;;j - move down [(104) (move-living character char-tile (fetch-tile our-map (- char-x 1) char-y))] ;;h - move left ) ;;Refresh the screen (draw-whole-map our-map character) (ncurses-refresh-screen) (loop (get-input-character))) ;;Kill off the screen (ncurses-end))) ;;Encourage them to return (print "Farewell hero!\n")
true
38754f06d99ed539ab4f5161141f6a9c155fa47d
3a214ad77e543669d58675446794d430a2e16fbe
/yuniloader/yuniloader-mit-scheme.scm
01b7e7f9e4ec7f25de916253ac721b3c517f51e8
[ "CC0-1.0", "GPL-2.0-or-later", "LicenseRef-scancode-public-domain" ]
permissive
lassik/yuni
97e746d10baca7940f2a67e2b4d3e6415bdfc8db
27e88c2d4832258a4182198e901d35642634ee57
refs/heads/master
2021-05-17T22:14:26.942363
2020-03-29T05:23:38
2020-03-29T05:31:30
250,975,051
0
0
CC0-1.0
2020-03-29T07:13:59
2020-03-29T07:13:59
null
UTF-8
Scheme
false
false
2,964
scm
yuniloader-mit-scheme.scm
;; ~/local/mit-scheme/bin/mit-scheme --batch-mode ;; --load yuniloader/yuniloader-mit-scheme.scm ;; -- -YUNIROOT $PWD -I lib -I lib-compat -I lib-stub/gen ;; -I lib-stub/mit-scheme -PROG _sanity.sps ;; ;; current-error-port (which is required by yuniloader-fake) (define (current-error-port) (trace-output-port)) (define %%yuniloader-result 0) (define %%yuniloader-use-debugger #f) ;; hook (for earlyboot) (define (exit . arg) ;; override (if (null? arg) (exit 0) (let ((x (car arg))) (cond ((boolean? x) (if x (set! %%yuniloader-result 0) (set! %%yuniloader-result 1))) (else (set! %%yuniloader-result x))) (%exit %%yuniloader-result)))) (define (call-with-values thunk receiver) ;; override ;; See src/runtime/global.scm for actual impl. (let ((t (thunk))) (cond ((procedure? t) (t receiver)) (else (receiver t))))) ;; Override (define $boolean=? boolean=?) (define $log log) (define %%yunirootpath #f) (define (%%yuniroot str) (if %%yunirootpath (string-append %%yunirootpath "/" str) str)) (let () (define (error-hook c) (display "ERROR!\n" (trace-output-port)) ;FIXME: Disable pretty-print conditions for now ;(pp c) (write-condition-report c (trace-output-port)) (newline (trace-output-port)) (%exit 1)) (define (%%expand frm) (define %%myenv (%%yuniloader-alexpander-newenv)) (%%yuniloader-alexpander-expand-top-level-forms! frm %%myenv)) (define (eval-core frm) (eval frm (nearest-repl/environment))) (define (runner0 code arg* modpath do-dump use-debugger) (define (filtnull code) (let loop ((acc '()) (cur code)) (if (pair? cur) (let ((a (car cur)) (d (cdr cur))) (if (null? a) (loop acc d) (loop (cons a acc) d))) (reverse acc)))) (let ((expanded (cons 'begin (filtnull (%%expand code))))) (cond (do-dump (pp expanded))) (eval-core expanded))) (define (runner code arg* modpath do-dump use-debugger) (if use-debugger (fluid-let ((standard-error-hook default-error-hook)) (runner0 code arg* modpath do-dump use-debugger)) (runner0 code arg* modpath do-dump use-debugger))) (define cmd (command-line-arguments)) ;; Changed from 9.2+ (cond ((and (list? cmd) (string=? (car cmd) "-YUNIROOT")) (let ((root (cadr cmd)) (next (cddr cmd))) (set! %%yunirootpath root) (set! cmd next)))) (load (%%yuniroot "yuniloader/yuniloader-fake.scm")) (load (%%yuniroot "external/yuni-alexpander.scm")) (for-each eval-core %%yuniloader-alexpander-init) (define default-error-hook standard-error-hook) (if %%yuniloader-use-debugger (%%yuniloader-fake-generate cmd runner) (fluid-let ((standard-error-hook error-hook)) (%%yuniloader-fake-generate cmd runner)))) (%exit %%yuniloader-result)
false
7b16cf9b1d1a4f16119f65ec987006238f74d5fb
9f4da04b0e19af0d4ebeef6eec58c3c2028e96d9
/calysto_scheme/src/environments-cps.ss
e1d7e7ef6710be0e566a7db8e6568e858d50a8bf
[ "BSD-3-Clause" ]
permissive
Calysto/calysto_scheme
2b740778e2701e2e7ec2334a7fe11ccd01903a51
fab33b57850aa2d86159e3b38c1365f01701b34f
refs/heads/master
2023-09-03T03:53:02.661188
2023-09-02T15:32:38
2023-09-02T15:32:38
33,034,377
277
26
BSD-3-Clause
2023-09-08T22:53:44
2015-03-28T13:29:52
Scheme
UTF-8
Scheme
false
false
7,270
ss
environments-cps.ss
(load "transformer-macros.ss") ;; Environments represented as data structures ;; <env> ::= (environment <frame> ...) ;; <frame> ::= (<vector-of-bindings> <list-of-vars>) ;; <binding> ::= (<value> . <docstring>) ;; bindings (define make-binding (lambda (value docstring) (cons value docstring))) (define binding-value (lambda (binding) (car binding))) (define binding-docstring (lambda (binding) (cdr binding))) (define set-binding-value! (lambda (binding value) (set-car! binding value))) (define set-binding-docstring! (lambda (binding docstring) (set-cdr! binding docstring))) ;; frames (define make-frame (lambda (variables values docstrings) (list (list->vector (map make-binding values docstrings)) variables))) (define empty-frame? (lambda (frame) (null? (cadr frame)))) (define frame-bindings (lambda (frame) (car frame))) ;; environments ;; <environment> ::= (environment <frame> <frame>*) (define environment? (lambda (x) (and (pair? x) (eq? (car x) 'environment)))) (define make-empty-environment (lambda () (list 'environment (make-frame '() '() '())))) (define make-initial-environment (lambda (vars vals docstrings) (list 'environment (make-frame vars vals docstrings)))) (define first-frame (lambda (env) (cadr env))) (define first-frame-vars (lambda (env) (cadr (first-frame env)))) (define initial-contours (lambda (env) (cdr (first-frame env)))) (define frames (lambda (env) (cdr env))) (define add-binding (lambda (new-var new-binding frame) (let ((bindings (vector->list (car frame))) (vars (cadr frame))) ;; must add new binding to the end of the frame, not the front, to ;; preserve correct lexical addresses of other variables in frame (list (list->vector (append bindings (list new-binding))) (append vars (list new-var)))))) (define set-first-frame! (lambda (env new-frame) (set-car! (cdr env) new-frame))) (define extend (lambda (env variables values docstrings) (cons 'environment (cons (make-frame variables values docstrings) (cdr env))))) ;; variable lookup (define search-env (lambda (env variable) (search-frames (cdr env) variable))) (define search-frames (lambda (frames variable) (if (null? frames) #f (let ((binding (search-frame (car frames) variable))) (if binding binding (search-frames (cdr frames) variable)))))) (define-native search-frame (lambda (frame var) (search-for-binding var (car frame) (cadr frame) 0))) (define-native search-for-binding (lambda (var bindings variables i) (cond ((null? variables) #f) ((eq? (car variables) var) (vector-ref bindings i)) (else (search-for-binding var bindings (cdr variables) (+ i 1)))))) ;; for macro environments (define in-first-frame? (lambda (var env) (true? (memq var (first-frame-vars env))))) ;; for macro environments (define get-first-frame-value (lambda (var env) (binding-value (search-frame (first-frame env) var)))) (define* lookup-value-by-lexical-address (lambda (depth offset frames fail k) (let ((bindings (frame-bindings (list-ref frames depth)))) (k (binding-value (vector-ref bindings offset)) fail)))) (define* lookup-binding-by-lexical-address (lambda (depth offset frames fail k) (let ((bindings (frame-bindings (list-ref frames depth)))) (k (vector-ref bindings offset) fail)))) (define* lookup-value (lambda (var env var-info handler fail k) (lookup-variable var env var-info handler fail (lambda-cont2 (var fail) (k (dlr-env-lookup var) fail)) (lambda-cont3 (dlr-obj components fail) (k (get-external-member dlr-obj components) fail)) (lambda-cont2 (binding fail) (k (binding-value binding) fail))))) (define* lookup-variable (lambda (var env var-info handler fail gk dk sk) ;; gk: global dlr, dk: dlr obj, sk: scheme module ;;(printf "in lookup-variable var: ~s env: ~s\n" var env) (let ((binding (search-env env var))) ;; look in scheme env for variable as a whole (if binding (sk binding fail) ;; found it in the scheme env (let ((components (split-variable var))) ;; split into components, if any (cond ((and (null? (cdr components)) (dlr-env-contains (car components))) (gk (car components) fail)) ;; (set! Myro 42) ((and (not (null? (cdr components))) ;; (set! Myro.robot 42) (dlr-env-contains (car components)) (dlr-object-contains (dlr-env-lookup (car components)) components)) (dk (dlr-env-lookup (car components)) components fail)) ((null? (cdr components)) ;; (set! a.b..c val) (runtime-error (format "unbound variable '~a'" var) var-info handler fail)) (else (lookup-variable-components components "" env var-info handler fail dk sk)))))))) ;; math.x.y.z where math is a module or a DLR module/item ;; components: '(math x y z) "" ... ;; components: '(x y z) "math" ... ;; components: '(y z) "math.x" ... ;; components: '(z) "math.x.y" ... (define* lookup-variable-components (lambda (components path module var-info handler fail dk sk) ;;(printf "in lookup-variable-components. components: ~s path: ~s\n" components path) (let* ((var (car components)) (binding (search-env module var))) (cond (binding ;; (set! c val) (if (null? (cdr components)) (sk binding fail) (let ((value (binding-value binding)) (new-path (if (string=? path "") (format "~a" var) (format "~a.~a" path var)))) (cond ((environment? value) (lookup-variable-components (cdr components) new-path value var-info handler fail dk sk)) ((dlr-object-contains value components) (dk value components fail)) (else (runtime-error (format "'~a' is not a module" new-path) var-info handler fail)))))) ((string=? path "") (runtime-error (format "undefined item in '~a'" var) var-info handler fail)) (else (runtime-error (format "unbound variable '~a' in module '~a'" var path) var-info handler fail)))))) ;; adds a new binding for var to the first frame if one doesn't exist (define* lookup-binding-in-first-frame (lambda (var env handler fail k) (let ((frame (first-frame env))) (let ((binding (search-frame frame var))) (if binding (k binding fail) (let ((new-binding (make-binding 'undefined ""))) (let ((new-frame (add-binding var new-binding frame))) (set-first-frame! env new-frame) (k new-binding fail)))))))) ;; (split-variable 'a) => (a) ;; (split-variable 'a.b.c.d) => (a b c d) ;; (split-variable 'a.b..c) => () (define split-variable (lambda (var) (let ((strings (string-split (symbol->string var) #\.))) (if (member "" strings) '() (map string->symbol strings))))) (define string-split (lambda (s delimiter-char) (letrec ((position (lambda (chars) (if (char=? (car chars) delimiter-char) 0 (+ 1 (position (cdr chars)))))) (split (lambda (chars) (cond ((null? chars) '()) ((not (member delimiter-char chars)) (list (apply string chars))) (else (let ((n (position chars))) (cons (apply string (list-head chars n)) (split (cdr (list-tail chars n)))))))))) (split (string->list s)))))
false
b8506c0c950447baae1d1d0808d94b5bc437b357
eb32c279a34737c769d4e2c498a62c761750aeb5
/lyonesse/match/compat.scm
868e24e35be92a1aacb67ea1d9c91fd2d823b19b
[ "Apache-2.0" ]
permissive
theschemer/lyonesse
baaf340be710f68b84c1969befc6ddbd2be3739b
9d9624e3141ea3acaa670526cbe52c2d6546beef
refs/heads/master
2021-06-10T02:58:28.040995
2016-11-29T21:28:11
2016-11-29T21:28:11
null
0
0
null
null
null
null
UTF-8
Scheme
false
false
1,256
scm
compat.scm
(library (lyonesse match compat) (export add1 sub1 syntax-error andmap with-implicit make-list rec last-pair make-parameter) (import (rnrs (6))) (define (add1 x) (+ 1 x)) (define (sub1 x) (- x 1)) (define (syntax-error obj . msgs) (let ((msg (if (null? msgs) "invalid syntax." (string-append msgs)))) (error 'syntax-error msg))) (define andmap for-all) (define-syntax with-implicit (syntax-rules () [(_ (tid id ...) b1 b2 ...) (with-syntax ([id (datum->syntax #'tid 'id)] ...) b1 b2 ...)])) (define make-list (case-lambda ((n) (make-list n #f)) ((n obj) (let loop ([n n] [result '()]) (if (= n n) result (loop (add1 n) (cons obj result))))))) (define-syntax rec (syntax-rules () [(_ x e) (letrec ((x e)) x)])) (define (last-pair l) (cond ((null? l) (error 'last-pair "list must not be empty." l)) ((null? (cdr l)) l) (else (last-pair (cdr l))))) (define make-parameter (case-lambda [(init guard) (let ([v (guard init)]) (case-lambda [() v] [(u) (set! v (guard u))]))] [(init) (make-parameter init (lambda (x) x))])) )
true
05d38410231b8755a9a6ecc88488639c70c3233d
648776d3a0d9a8ca036acaf6f2f7a60dcdb45877
/queries/puppet/injections.scm
caa10a2b03b4112e474586ba29f4a8999228c574
[ "Apache-2.0" ]
permissive
nvim-treesitter/nvim-treesitter
4c3c55cbe6ff73debcfaecb9b7a0d42d984be3e6
f8c2825220bff70919b527ee68fe44e7b1dae4b2
refs/heads/master
2023-08-31T20:04:23.790698
2023-08-31T09:28:16
2023-08-31T18:19:23
256,786,531
7,890
980
Apache-2.0
2023-09-14T18:07:03
2020-04-18T15:24:10
Scheme
UTF-8
Scheme
false
false
178
scm
injections.scm
((regex) @injection.content (#set! injection.language "regex") (#offset! @injection.content 0 1 0 -1)) ((comment) @injection.content (#set! injection.language "comment"))
false
2b442acfb9907fda8dffd08179193ab5afc86a9c
f07bc117302b8959f25449863c6fdabdda510c48
/radiw.scm
68933c13593d4fc75dcfac2efad9e536ad345492
[ "MIT" ]
permissive
namin/clpsmt-miniKanren
3a1165a20dc1c50e4d568e2e493b701fb9f5caea
d2270aa14410805fa7068150bc2ab2f3bf9391b4
refs/heads/master
2022-03-10T07:05:21.950751
2022-02-26T23:54:05
2022-02-26T23:54:05
129,262,229
33
9
MIT
2021-08-03T16:02:50
2018-04-12T14:14:59
Scheme
UTF-8
Scheme
false
false
8,499
scm
radiw.scm
(define (map-singletono k v m) (== `((,k ,v)) m)) (define (ino x xs) (fresh [y ys] (conso y ys xs) (conde [(== y x) (not-ino x ys)] [(=/= y x) (ino x ys)]))) (define (not-ino x xs) (conde [(== '() xs)] [(fresh [y ys] (conso y ys xs) (=/= y x) (not-ino x ys))])) (define (is-ino a s b) (conde [(== b #t) (ino a s)] [(== b #f) (not-ino a s)])) (define (conso x xs r) (== (cons x xs) r)) (define (mapo r xs f) (conde [(== '() xs) (== '() r)] [(fresh [y ys z zs] (conso y ys xs) (conso z zs r) (f y z) (mapo zs ys f))])) (define (foldlo f x xs r) (conde [(== '() xs) (== x r)] [(fresh [y ys z] (conso y ys xs) (f x y z) (foldlo f z ys r))])) (define (lookupo x bs out) (conde ;; #f is never bound as a value in the store, ;; we don't have booleans. [(== '() bs) (== #f out)] [(fresh [b br y v] (conso b br bs) (== `(,y ,v) b) (conde [(== y x) (== v out)] [(=/= y x) (lookupo x br out)]))])) (define (boto v) (== `(aval () ()) v)) (define (includo a b) (conde [(== '() a)] [(fresh [a1 ar] (conso a1 ar a) (ino a1 b) (includo ar b))])) (define (set-equivo a b) (fresh () (includo a b) (includo b a))) (define (excludo a b) (fresh [a1 ar] (conso a1 ar a) (conde [(not-ino a1 b)] [(ino a1 b) (excludo ar b)]))) (define (not-set-equivo a b) (conde [(excludo a b)] [(includo a b) (excludo b a)])) (define (set-uniono a b c) (conde [(== '() a) (== b c)] [(fresh [xa ra] (conso xa ra a) (conde [(ino xa b) (set-uniono ra b c)] [(not-ino xa b) (fresh [rc] (conso xa rc c) (set-uniono ra b rc))]))])) (define (set-unionso xs out) (foldlo set-uniono '() xs out)) (define (set-unionso2 xs out) (foldlo (lambda (a b c) (set-uniono a `(,b) c)) '() xs out)) (define (uo a b c) (fresh [ai bi ci aj bj cj] (== `(aval ,ai ,aj) a) (== `(aval ,bi ,bj) b) (== `(aval ,ci ,cj) c) (set-uniono ai bi ci) (set-uniono aj bj cj))) (define (joinso xs o) (fresh [b] (boto b) (foldlo uo b xs o))) (define (replaceo x vo bs out) (fresh [b br y v] (conso b br bs) (== `(,y ,v) b) (conde [(== y x) (conso `(,x ,vo) br out)] [(=/= y x) (fresh [r-out] (conso b r-out out) (replaceo x vo br r-out))]))) (define (add-uo x v s out) (fresh [l] (lookupo x s l) (conde [(== #f l) (== `((,x ,v) . ,s) out)] [(=/= #f l) (fresh [vo] (uo v l vo) (replaceo x vo s out))]))) (define (add-uo1 m xv r) (fresh [x v] (== `(,x ,v) xv) (add-uo x v m r))) (define (muo m1 m2 mo) (foldlo add-uo1 m1 m2 mo)) (define (mjoinso ms o) (foldlo muo '() ms o)) (define (injo i a) (conde [(== -1 i) (== 'neg a)] [(== 0 i) (== 'zer a)] [(== 1 i) (== 'pos a)])) (define (into i v) (fresh [a] (injo i a) (== `(aval (,a) ()) v))) (define (combo f u os1 s1 s2 s3) (conde [(== '() s2) (== '() s3)] [(== '() s1) (fresh [a2 r2] (conso a2 r2 s2) (combo f u os1 os1 r2 s3))] [(fresh [a1 r1 a2 r2 sa sm] (conso a1 r1 s1) (conso a2 r2 s2) (f a1 a2 sa) (combo f u os1 r1 s2 sm) (u sa sm s3))])) (define (combino f s1 s2 s3) (combo f set-uniono s1 s1 s2 s3)) (define (plusdo a b s) (conde [(== a 'neg) (== b 'neg) (== s `(neg))] [(== a 'neg) (== b 'zer) (== s `(neg))] [(== a 'neg) (== b 'pos) (== s `(neg zer pos))] [(== a 'zer) (== b 'neg) (== s `(neg))] [(== a 'zer) (== b 'zer) (== s `(zer))] [(== a 'zer) (== b 'pos) (== s `(pos))] [(== a 'pos) (== b 'neg) (== s `(neg zer pos))] [(== a 'pos) (== b 'zer) (== s `(pos))] [(== a 'pos) (== b 'pos) (== s `(pos))])) (define (plusso s1 s2 s3) (combino plusdo s1 s2 s3)) (define (timeso a b c) (conde [(== a 'zer) (== c 'zer)] [(=/= a 'zer) (== b 'zer) (== c 'zer)] [(== a 'neg) (== b 'neg) (== c 'pos)] [(== a 'neg) (== b 'pos) (== c 'neg)] [(== a 'pos) (== b 'neg) (== c 'neg)] [(== a 'pos) (== b 'pos) (== c 'pos)])) (define (timesdo a b s) (fresh [c] (timeso a b c) (== `(,c) s))) (define (timesso s1 s2 s3) (combino timesdo s1 s2 s3)) (define (cloo x y body out) (== `(aval () ((,x ,y ,body))) out)) (define (unzip3o rs as bs cs) (conde [(== rs '()) (== as '()) (== bs '()) (== cs '())] [(fresh [r1 rr a1 ar b1 br c1 cr] (conso r1 rr rs) (conso a1 ar as) (conso b1 br bs) (conso c1 cr cs) (== `(,a1 ,b1 ,c1) r1) (unzip3o rr ar br cr))])) (define (adivalo e s oc ic v so co) (conde [(fresh [x l] (== `(var ,x) e) (symbolo x) (== s so) (== ic co) (conde [(== l #f) (boto v)] [(=/= l #f) (== l v)]) (lookupo x s l))] [(fresh [i a] (== `(int ,i) e) (== s so) (== ic co) (into i v))] [(fresh [e1 e2 v1 v2 n1 n2 s1 s2 n so1 co1 so2 co2] (== `(plus ,e1 ,e2) e) (== `(aval ,n1 ,s1) v1) (== `(aval ,n2 ,s2) v2) (== `(aval ,n ()) v) (adivalpo e1 s oc ic v1 so1 co1) (adivalpo e2 s oc ic v2 so2 co2) (plusso n1 n2 n) (muo so1 so2 so) (muo co1 co2 co))] [(fresh [e1 e2 v1 v2 n1 n2 s1 s2 n so1 co1 so2 co2] (== `(times ,e1 ,e2) e) (== v1 `(aval ,n1 ,s1)) (== v2 `(aval ,n2 ,s2)) (== v `(aval ,n ())) (adivalpo e1 s oc ic v1 so1 co1) (adivalpo e2 s oc ic v2 so2 co2) (timesso n1 n2 n) (muo so1 so2 so) (muo co1 co2 co))] [(fresh [x y body] (== `(lam ,x ,y ,body) e) (cloo x y body v) (== s so) (== ic co))] [(fresh [e1 e2 is fs v1 s1 c1 v2 s2 c2 r vs ss3 cs3] (== `(app ,e1 ,e2) e) (== `(aval ,is ,fs) v1) (adivalpo e1 s oc ic v1 s1 c1) (adivalpo e2 s oc ic v2 s2 c2) (mapo r fs (lambda (i z) (fresh [x y body c sa1 sa vo so co] (== `(,x ,y ,body) i) (== `(,vo ,so ,co) z) (cloo x y body c) (add-uo x c s sa1) (add-uo y v2 sa1 sa) (adivalpo body sa oc ic vo so co)))) (unzip3o r vs ss3 cs3) (joinso vs v) (mjoinso ss3 so) (mjoinso cs3 co))] [(fresh [e1 e2 e3 r2 r3p r3n r3 v1 n1 b1 s1 c1 v2 s2 c2 v3 s3 c3 s23 c23] (== `(if0 ,e1 ,e2 ,e3) e) (== `(aval ,n1 ,b1) v1) (adivalpo e1 s oc ic v1 s1 c1) (is-ino 'zer n1 r2) (is-ino 'pos n1 r3p) (is-ino 'neg n1 r3n) (conde [(== r2 #t) (adivalpo e2 s oc ic v2 s2 c2)] [(== r2 #f) (boto v2) (== s s2) (== ic c2)]) (conde [(== r3p #t) (== r3 #t)] [(== r3p #f) (== r3n #t) (== r3 #t)] [(== r3p #f) (== r3n #f) (== r3 #f)]) (conde [(== r3 #t) (adivalpo e3 s oc ic v3 s3 c3)] [(== r3 #f) (boto v3) (== s s3) (== ic c3)]) (uo v2 v3 v) (muo s2 s3 s23) (muo s1 s23 so) (muo c3 c3 c23) (muo c1 c23 co))])) (define (adivalpo e s oc ic v so co) (fresh [r] (lookupo e ic r) (conde [(=/= r #f) (== v r) (== s so) (== ic co)] [(== r #f) (fresh [r0 v0 ic1 ic2] (conde [(== r0 #f) (boto v0)] [(=/= r0 #f) (== v0 r0)]) (lookupo e oc r0) (add-uo e v0 ic ic1) (adivalo e s oc ic1 v so ic2) (add-uo e v ic2 co))]))) (define (lfppo e s c so co) (fresh [v sp cp] (adivalpo e s c '() v sp cp) (conde [(== so sp) (== co cp) (set-equivo sp s) (set-equivo cp c)] [(set-equivo sp s) (not-set-equivo cp c) (lfppo e sp cp so co)] [(not-set-equivo sp s) (set-equivo cp c) (lfppo e sp cp so co)] [(not-set-equivo sp s) (not-set-equivo cp c) (lfppo e sp cp so co)]))) (define (lfpo e so co) (lfppo e '() '() so co)) (define (analyzeo e vo) (fresh [so co] (lfpo e so co) (lookupo e co vo)))
false
fb169b4c0e9af90b22ad2db69ac3c2b84d2b45b7
defeada37d39bca09ef76f66f38683754c0a6aa0
/UnityEngine/unity-engine/physic-material.sls
8abe876ed62d779a6edd5a3ca5db22a75024092c
[]
no_license
futsuki/ironscheme-port
2dbac82c0bda4f4ff509208f7f00a5211d1f7cd5
4e7a81b0fbeac9a47440464988e53fb118286c54
refs/heads/master
2016-09-06T17:13:11.462593
2015-09-26T18:20:40
2015-09-26T18:20:40
42,757,369
0
0
null
null
null
null
UTF-8
Scheme
false
false
3,227
sls
physic-material.sls
(library (unity-engine physic-material) (export new is? physic-material? dynamic-friction-get dynamic-friction-set! dynamic-friction-update! static-friction-get static-friction-set! static-friction-update! bounciness-get bounciness-set! bounciness-update! bouncyness-get bouncyness-set! bouncyness-update! friction-direction2-get friction-direction2-set! friction-direction2-update! dynamic-friction2-get dynamic-friction2-set! dynamic-friction2-update! static-friction2-get static-friction2-set! static-friction2-update! friction-combine-get friction-combine-set! friction-combine-update! bounce-combine-get bounce-combine-set! bounce-combine-update! friction-direction-get friction-direction-set! friction-direction-update!) (import (ironscheme-clr-port)) (define-syntax new (lambda (e) (syntax-case e () ((_ a ...) #'(clr-new UnityEngine.PhysicMaterial a ...))))) (define (is? a) (clr-is UnityEngine.PhysicMaterial a)) (define (physic-material? a) (clr-is UnityEngine.PhysicMaterial a)) (define-field-port dynamic-friction-get dynamic-friction-set! dynamic-friction-update! (property:) UnityEngine.PhysicMaterial dynamicFriction System.Single) (define-field-port static-friction-get static-friction-set! static-friction-update! (property:) UnityEngine.PhysicMaterial staticFriction System.Single) (define-field-port bounciness-get bounciness-set! bounciness-update! (property:) UnityEngine.PhysicMaterial bounciness System.Single) (define-field-port bouncyness-get bouncyness-set! bouncyness-update! (property:) UnityEngine.PhysicMaterial bouncyness System.Single) (define-field-port friction-direction2-get friction-direction2-set! friction-direction2-update! (property:) UnityEngine.PhysicMaterial frictionDirection2 UnityEngine.Vector3) (define-field-port dynamic-friction2-get dynamic-friction2-set! dynamic-friction2-update! (property:) UnityEngine.PhysicMaterial dynamicFriction2 System.Single) (define-field-port static-friction2-get static-friction2-set! static-friction2-update! (property:) UnityEngine.PhysicMaterial staticFriction2 System.Single) (define-field-port friction-combine-get friction-combine-set! friction-combine-update! (property:) UnityEngine.PhysicMaterial frictionCombine UnityEngine.PhysicMaterialCombine) (define-field-port bounce-combine-get bounce-combine-set! bounce-combine-update! (property:) UnityEngine.PhysicMaterial bounceCombine UnityEngine.PhysicMaterialCombine) (define-field-port friction-direction-get friction-direction-set! friction-direction-update! (property:) UnityEngine.PhysicMaterial frictionDirection UnityEngine.Vector3))
true
ad2097206c5cf6b79ec45ff211dc8b02c01cf432
d986b0986379047a6bfcf42fe36e389810bc05e3
/ps7/chiptail.scm
f74e90973e29cb08af688decece567664f273cd9
[]
no_license
GlassGhost/6.001-fall91
a43b2846103c4a6c53175f96811c18254d582724
a596389c4c69a5d929bfa06e26993dfcd27c34c8
refs/heads/master
2020-05-19T23:33:58.979546
2014-07-21T21:18:45
2014-07-21T21:18:45
null
0
0
null
null
null
null
UTF-8
Scheme
false
false
826
scm
chiptail.scm
;; This patch by-passes a bug in the compiled run-time definition of TAIL on ;; Chipmunks... <<Vive la type-checking!>> If anyone gets around to fixing the ;; runtime system to avoid using a compiled TAIL, or if someone fixes the ;; compiler to not punt type checking, then this patch will become obsolete. ;; NB: Must (ENABLE-LANGUAGE-FEATURES) before loading this file since it uses ;; the procedure DELAYED? (define delayed? delayed?) (if (eq? (object-type tail) 'COMPILED-PROCEDURE) ; TAIL loses? (set! tail (let ((native-tail tail)) (define (stream? x) (conjunction (pair? x ) (delayed? (cdr x)))) (lambda (stream) (if (stream? stream) (native-tail stream) (error "Argument to TAIL was not a STREAM:" stream)))))) 'FINI ; Signal that file is done loading.
false
0633919c98c5a8f65f49954b1553c8d13523616e
4fd95c081ccef6afc8845c94fedbe19699b115b6
/chapter_3/3.73.scm
d174c4e719844fccaecbdf076d58ffa5a68c1bdf
[ "MIT" ]
permissive
ceoro9/sicp
61ff130e655e705bafb39b4d336057bd3996195d
7c0000f4ec4adc713f399dc12a0596c770bd2783
refs/heads/master
2020-05-03T09:41:04.531521
2019-08-08T12:14:35
2019-08-08T12:14:35
178,560,765
1
0
null
null
null
null
UTF-8
Scheme
false
false
1,502
scm
3.73.scm
(define (force delayed-object) (delayed-object)) (define-syntax delay (syntax-rules () ((_ exp) (lambda () exp)))) (define-syntax cons-stream (syntax-rules () ((_ a b) (cons a (delay b))))) (define (stream-car s) (car s)) (define (stream-cdr s) (force (cdr s))) (define the-empty-stream '()) (define (stream-null? s) (eq? s the-empty-stream)) (define (stream-map proc . argstreams) (if (stream-null? (car argstreams)) the-empty-stream (cons-stream (apply proc (map stream-car argstreams)) (apply stream-map (cons proc (map stream-cdr argstreams)))))) (define (stream-ref s n) (newline) (display (stream-car s)) (if (= n 0) (stream-car s) (stream-ref (stream-cdr s) (- n 1)))) (define (add-streams s1 s2) (stream-map + s1 s2)) (define (scale-stream s factor) (stream-map (lambda (x) (* x factor)) s)) ; ----------------------------------------------------------------- ; ----------------------------------------------------------------- ; ----------------------------------------------------------------- (define (integral integrand initial-value dt) (define int (cons-stream initial-value (add-streams (scale-stream integrand dt) int))) int) (define (RC R C dt) (lambda (s v0) (add-streams (integral (scale-stream s (/ 1 C)) v0 dt) (scale-stream s R)))) (define RC1 (RC 5 1 0.5)) (define ones (cons-stream 1 ones)) (stream-ref (RC1 ones 0) 10)
true
05098624c4cd588596ea75721d8fa3bc3ba6a9a1
2c01a6143d8630044e3629f2ca8adf1455f25801
/xitomatl/ssax/private-5-1/to-html-ext.sls
8c97d7f52f9544912266bada564568877ad5cafc
[ "X11-distribute-modifications-variant" ]
permissive
stuhlmueller/scheme-tools
e103fac13cfcb6d45e54e4f27e409adbc0125fe1
6e82e873d29b34b0de69b768c5a0317446867b3c
refs/heads/master
2021-01-25T10:06:33.054510
2017-05-09T19:44:12
2017-05-09T19:44:12
1,092,490
5
1
null
null
null
null
UTF-8
Scheme
false
false
1,131
sls
to-html-ext.sls
#!r6rs ;; Copyright 2009 Derick Eddington. My MIT-style license is in the file named ;; LICENSE from the original collection this file is distributed with. (library (xitomatl ssax private-5-1 to-html-ext) (export make-header make-navbar make-footer universal-conversion-rules universal-protected-rules alist-conv-rules find-Header generic-web-rules) (import (except (rnrs) error) (rnrs r5rs) (xitomatl include) (except (srfi :13 strings) string-copy string-for-each string->list string-upcase string-downcase string-titlecase string-hash) (only (xitomatl file-system base) file-regular?) (xitomatl ssax private-5-1 to-html) (xitomatl ssax tree-trans) (xitomatl ssax private-5-1 error) (xitomatl ssax private-5-1 output) (xitomatl ssax private-5-1 misc) (xitomatl ssax private-5-1 util)) (define (OS:file-length filename) (if (file-regular? filename) 1 0)) (define error (make-errorer "(xitomatl ssax private-5-1 to-html-ext)")) (include/resolve ("xitomatl" "ssax" "private-5-1") "SXML-to-HTML-ext.scm") )
false
83c078271afcfe0892d8c2bdeb349f287bfb56b4
b8eb3fdd0e4e38a696c4013a8f91054df3f75833
/t/perf/2-tiny-if.ss
7847c2e0f525ee58206a10ccd4fa220b22fc8cd7
[ "Zlib" ]
permissive
lojikil/digamma
952a7bdf176227bf82b3583020bc41764b12d906
61c7ffdc501f207a84e5d47157c3c84e5882fa0d
refs/heads/master
2020-05-30T07:11:20.716792
2016-05-11T11:32:15
2016-05-11T11:32:15
58,539,277
6
3
null
null
null
null
UTF-8
Scheme
false
false
131
ss
2-tiny-if.ss
; modified for tiny scheme... (define (fib n) (if (<= n 1) 1 (+ (fib (- n 1)) (fib (- n 2))))) (display (fib 22)) (newline) (quit)
false
e2ded50c0e3192f61dc9f98f2b1944db421aaecc
d8bdd07d7fff442a028ca9edbb4d66660621442d
/scam/tests/10-scheme/00-base/input/eof.scm
9afb790a570c493c01a970ba3ba85b0e1674c000
[]
no_license
xprime480/scam
0257dc2eae4aede8594b3a3adf0a109e230aae7d
a567d7a3a981979d929be53fce0a5fb5669ab294
refs/heads/master
2020-03-31T23:03:19.143250
2020-02-10T20:58:59
2020-02-10T20:58:59
152,641,151
0
0
null
null
null
null
UTF-8
Scheme
false
false
194
scm
eof.scm
(import (only (scheme base) eof-object eof-object?) (test narc)) (narc-label "EOF") (narc-expect (#t (eof-object? (eof-object)))) (narc-catch (:args (eof-object 2))) (narc-report)
false
a3888a881e1c5af470ef258ed8f59c19d7fac744
542b1510c22ad5c41ba2f896f674c275c34e9195
/srfi/160/base/valid.scm
441f65f0162c1ef41e6a52ac4119e533a14158ec
[ "MIT" ]
permissive
diamond-lizard/srfi-160
c88b955a7c5e6a5656876a4b9fea452a282b3d24
69b2abad0da573ee22acebb0dc4eefebea72fae1
refs/heads/main
2023-03-03T22:32:31.181967
2020-11-20T06:00:43
2020-11-20T06:00:43
311,722,584
0
1
MIT
2021-01-28T15:50:57
2020-11-10T16:41:12
Scheme
UTF-8
Scheme
false
false
682
scm
valid.scm
(define (u8? n) (and (exact-integer? n) (<= 0 n 255))) (define (s8? n) (and (exact-integer? n) (<= -128 n 127))) (define (u16? n) (and (exact-integer? n) (<= 0 n 65535))) (define (s16? n) (and (exact-integer? n) (<= -32768 n 32767))) (define (u32? n) (and (exact-integer? n) (<= 0 n 4294967295))) (define (s32? n) (and (exact-integer? n) (<= -2147483648 n 2147483647))) (define (u64? n) (and (exact-integer? n) (<= 0 n 18446744073709551615))) (define (s64? n) (and (exact-integer? n) (<= -9223372036854775808 n 9223372036854775807))) (define (f32? n) (and (inexact? n) (real? n))) (define (f64? n) (f32? n)) (define (c64? n) (inexact? n)) (define (c128? n) (inexact? n))
false
f99e1845b462bef2a79236d5483d746553c3116b
7301b8e6fbd4ac510d5e8cb1a3dfe5be61762107
/ex-3.3.scm
2feaab26eee0322641e64e36b114a23cbe897456
[]
no_license
jiakai0419/sicp-1
75ec0c6c8fe39038d6f2f3c4c6dd647a39be6216
974391622443c07259ea13ec0c19b80ac04b2760
refs/heads/master
2021-01-12T02:48:12.327718
2017-01-11T12:54:38
2017-01-11T12:54:38
78,108,302
0
0
null
2017-01-05T11:44:44
2017-01-05T11:44:44
null
UTF-8
Scheme
false
false
1,145
scm
ex-3.3.scm
;;; Exercise 3.3. Modify the make-account procedure so that it creates ;;; password-protected accounts. That is, make-account should take a symbol as ;;; an additional argument, as in ;;; ;;; (define acc (make-account 100 'secret-password)) ;;; ;;; The resulting account object should process a request only if it is ;;; accompanied by the password with which the account was created, and should ;;; otherwise return a complaint: ;;; ;;; ((acc 'secret-password 'withdraw) 40) ;;; 60 ;;; ;;; ((acc 'some-other-password 'deposit) 50) ;;; "Incorrect password" (load "./sec-3.1.1.scm") (define make-account (let ([%make-account make-account]) (lambda (initial-balance the-password) (let ([acc (%make-account initial-balance)]) (define (dispatch password message) (if (eq? password the-password) (acc message) (lambda _ "Incorrect password"))) dispatch)))) ; (define acc (make-account 100 'secret-password)) ; ; (print ((acc 'secret-password 'withdraw) 40)) ; ;==> 60 ; ; (print ((acc 'some-other-password 'deposit) 50)) ; ;==> "Incorrect password"
false
ce7dfb8adca6058d275676557ac3fbc9c334a974
436ffe1a05d0e75f767ece1230a4b81f227a1268
/small-exact.scm
645921c233ebe30ad3ee4d94d02ae34c837e7485
[]
no_license
axch/venture-pre-v1
92d2de8b80a5957105726187a3ca66915ae553a9
571aef73db6e5464937b6f46089b5c394b1f81e2
refs/heads/master
2021-08-09T02:30:13.561039
2017-11-11T21:52:31
2017-11-11T21:52:31
110,304,296
0
0
null
2017-11-11T00:05:54
2017-11-11T00:05:53
null
UTF-8
Scheme
false
false
2,028
scm
small-exact.scm
;;; Copyright (c) 2014 MIT Probabilistic Computing Project. ;;; ;;; This file is part of Venture. ;;; ;;; Venture is free software: you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by ;;; the Free Software Foundation, either version 3 of the License, or ;;; (at your option) any later version. ;;; ;;; Venture is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with Venture. If not, see <http://www.gnu.org/licenses/>. (declare (usual-integrations)) ;;; Some utilities for computing exact answers to questions about ;;; small, discrete probability distributions. ;;; TODO Canonicalize to wt-tree representation of distributions? ;;; (will improve asymptotics of chi-sq test) (define (discrete-iid-map f d1 d2) (append-map (lambda (p1) (map (lambda (p2) (cons (f (car p1) (car p2)) (* (cdr p1) (cdr p2)))) d2)) d1)) (define (square-discrete d) (discrete-iid-map cons d d)) (define (freqs-return datum) `((,datum . 1))) (define (freqs-bind d f) (define (possible? pair) (let ((prob (cdr pair))) (not (and (exact? prob) (= 0 prob))))) (append-map (lambda (p1) (let ((item (car p1)) (prob (cdr p1))) (map (lambda (p2) (let ((item* (car p2)) (prob* (cdr p2))) (cons item* (* prob prob*)))) (f item)))) (filter possible? d))) (define (freqs-normalize d <) (wt-tree->alist (fold (lambda (item prob tree) (wt-tree/add tree item (+ prob (wt-tree/lookup tree item 0)))) (make-wt-tree (make-wt-tree-type <)) (map car d) (map cdr d))))
false
b11f9f2c284029ebbfe7d1a2371191ffc3c90a66
d6cb5370b9502942b755e884ab953e94bc3f2e2a
/20_alg_types.scm
fbbe7c9ad4461f28151089c8d5213716fa8f1a18
[]
no_license
AsadiR/Scheme_tasks
7df4279f5e1749182f138f554fb40d96e6d4436a
f28927044a7a7e40b913126c8da44c551f35c4dc
refs/heads/master
2021-05-04T07:47:21.261738
2016-10-12T12:13:36
2016-10-12T12:13:36
70,696,735
0
0
null
null
null
null
UTF-8
Scheme
false
false
3,801
scm
20_alg_types.scm
;(define-syntax test ; (syntax-rules () ; ((_)(define a 4)) ; )) ;(test) ;(display a) (define (symbol-append . xs) (string->symbol (apply string-append (map symbol->string xs)))) (define (define-constructor% outer_tag tag slots) (define constructor-name (symbol-append tag)) (eval `(define (,constructor-name . xs) (cons (quote ,outer_tag) (list->vector (cons (quote ,tag) xs)))) (interaction-environment))) (define (define-getter% tag field index) (define getter-name (symbol-append tag '- field)) (eval `(define (,getter-name x) (vector-ref (cdr x) ,index)) (interaction-environment))) (define (define-setter% tag field index) (define setter-name (symbol-append 'set- tag '- field '!)) (eval `(define (,setter-name x val) (vector-set! (cdr x) ,index val)) (interaction-environment))) (define (define-predicate% outer_tag tag) (define predicate-name (symbol-append tag '?)) (eval `(define (,predicate-name x) (and (equal? (vector-ref (cdr x) 0) (quote ,tag)) (equal? (car x) (quote ,outer_tag)))) (interaction-environment))) (define (define-struct% outer_tag tag slots) (define-constructor% outer_tag tag slots) (define-predicate% outer_tag tag) (define (rec slots counter) (cond ((null? slots) '()) (else (begin (define-getter% tag (car slots) counter) (define-setter% tag (car slots) counter) (rec (cdr slots) (+ counter 1)))))) (rec slots 1)) (define (define-data% outer_tag types) (define predicate-name (symbol-append outer_tag '?)) (eval `(define (,predicate-name x) (equal? (car x) (quote ,outer_tag))) (interaction-environment)) (define (rec types) ;(display types) ;(newline) (cond ((null? types) '()) (else (begin (define-struct% outer_tag (caar types) (cdar types)) (rec (cdr types)))))) (rec types)) (define-syntax define-data (syntax-rules () ((_ outer_tag types) (define-data% (quote outer_tag) (quote types))) )) ;;;;;;;; (define (create-body% elem args body) ;elem - элемент из которого дергаем поля ;args - переменные которые нужно объявить ;body - исполняемое действие (define vec (cdr elem)) (define (rec args counter) (cond ((null? args) '()) (else (cons `(,(car args) ,(vector-ref vec counter)) (rec (cdr args) (+ 1 counter)))))) `(let ,(rec (cdr args) 1) ,body)) (define (match% elem xs) (define elem-name (vector-ref (cdr elem) 0)) (define (rec xs) (cond ((null? xs) 'error) (else (if (equal? (caaar xs) elem-name) (create-body% elem (caar xs) (cadar xs)) (rec (cdr xs)))))) ;smth strange (display (rec xs)) (newline) (rec xs)) (define-syntax match (syntax-rules () ((_ elem . xs) (eval (match% elem (quote xs)) (interaction-environment))) )) (define-data% 'figure '((square a) (rectangle a b) (triangle a b c) (circle r))) ;(display fig1) ;(newline) ;(display (square-a fig1)) ;(newline) ;(create-body% '(figure . #(square 2)) '(a) '(* a a)) ;(newline) ;(create-body% '(figure . #(rectangle 2 3)) '(a b) '(* a b)) (define pi (acos -1)) (define (perim fig) (match fig ((square a) (* 4 a)) ((rectangle a b) (* 2 (+ a b))) ((triangle a b c) (+ a b c)) ((circle r) (* 2 pi r)))) (define s (square 10)) (define r (rectangle 10 20)) (define t (triangle 10 20 30)) (define c (circle 10)) (perim s) (perim r) ;(display c) (perim t) ;(display c) (perim c)
true
7c775b22daf3b2c3c5545a3b54aa4dac97457953
b9eb119317d72a6742dce6db5be8c1f78c7275ad
/racket/line-break.ss
ef73ea75793819f68f13f4d8ef14b2df733be06c
[]
no_license
offby1/doodles
be811b1004b262f69365d645a9ae837d87d7f707
316c4a0dedb8e4fde2da351a8de98a5725367901
refs/heads/master
2023-02-21T05:07:52.295903
2022-05-15T18:08:58
2022-05-15T18:08:58
512,608
2
1
null
2023-02-14T22:19:40
2010-02-11T04:24:52
Scheme
UTF-8
Scheme
false
false
2,177
ss
line-break.ss
#! /bin/sh #| Hey Emacs, this is -*-scheme-*- code! #$Id$ exec mzscheme -M errortrace --no-init-file --mute-banner --version --require "$0" -p "text-ui.ss" "schematics" "schemeunit.plt" -e "(exit (test/text-ui line-break-tests 'verbose))" |# (module line-break mzscheme (require (lib "trace.ss") (planet "test.ss" ("schematics" "schemeunit.plt" 2)) (planet "util.ss" ("schematics" "schemeunit.plt" 2)) (planet "assert.ss" ("offby1" "offby1.plt")) (only (lib "13.ss" "srfi") string-join string-tokenize)) ;; written in a hurry for some guy on IRC (define *max-line-length* 43) (define (maybe-space str) (if (positive? (string-length str)) " " "")) (define (break-into-lines str) (let loop ((tokens (string-tokenize str)) (current-line "") (result '())) (cond ((null? tokens) (reverse (if (positive? (string-length current-line)) (cons current-line result) result))) ;; If putting this token on the current line would make it too ;; long, then start a new line. ((< *max-line-length* (+ (string-length (maybe-space current-line)) (string-length (car tokens)) (string-length current-line))) (loop (cdr tokens) (car tokens) (cons current-line result))) (else (loop (cdr tokens) (string-append current-line (maybe-space current-line) (car tokens)) result))))) (define line-break-tests (test-suite "line-break" (test-case "yow" (let* ((desired (list "when the chick came from beach, got her" "launch and got back to it cose the wheather" "was really nice, so she got some fruit and" "water because it was really boiling, and" "that's all, she just got back, what more" "you want me to say? oh my")) (unbroken (string-join desired " "))) (check-equal? (break-into-lines unbroken) desired))))) (provide (all-defined)) )
false
1010145c141e6c64814baa5704a8265db956ec38
ce567bbf766df9d98dc6a5e710a77870753c7d29
/base/chapter2/utils.scm
0bee87b814eb8064893938010a6c9b5c9b57ca06
[]
no_license
dott94/eopl
1cbe2d98c948689687f88e514579e66412236fc9
47fadf6f2aa6ca72c831d6e2e2eccbe673129113
refs/heads/master
2021-01-18T06:42:35.921839
2015-01-21T07:06:43
2015-01-21T07:06:43
30,055,972
1
0
null
2015-01-30T04:21:42
2015-01-30T04:21:42
null
UTF-8
Scheme
false
false
510
scm
utils.scm
(module utils (lib "eopl.ss" "eopl") ;; a very simple macro for inline testing (provide equal?? report-unit-tests-completed) ;; simple-minded magic for tests (define-syntax equal?? (syntax-rules () ((_ x y) (let ((x^ x) (y^ y)) (if (not (equal? x y)) (eopl:error 'equal?? "~s is not equal to ~s" 'x 'y)))))) (define report-unit-tests-completed (lambda (fn-name) (eopl:printf "unit tests completed: ~s~%" fn-name))) )
true
d4c58beb583cd1c4143285c7f841c08d1c6901db
f4cf5bf3fb3c06b127dda5b5d479c74cecec9ce9
/Sources/LispKit/Resources/Libraries/srfi/54.sld
7b7b6e076b83fdb1c2a0cad413f07bbcba7dbfa0
[ "Apache-2.0" ]
permissive
objecthub/swift-lispkit
62b907d35fe4f20ecbe022da70075b70a1d86881
90d78a4de3a20447db7fc33bdbeb544efea05dda
refs/heads/master
2023-08-16T21:09:24.735239
2023-08-12T21:37:39
2023-08-12T21:37:39
57,930,217
356
17
Apache-2.0
2023-06-04T12:11:51
2016-05-03T00:37:22
Scheme
UTF-8
Scheme
false
false
17,185
sld
54.sld
;;; SRFI 54 ;;; Formatting ;;; ;;; This SRFI introduces the `cat` procedure that converts any object to a string. It takes ;;; one object as the first argument and accepts a variable number of optional arguments, ;;; unlike the procedure called `format`. ;;; ;;; Copyright © 2004 Joo ChurlSoo. All rights reserved. ;;; ;;; Permission is hereby granted, free of charge, to any person obtaining a copy ;;; of this software and associated documentation files (the "Software"), to ;;; deal in the Software without restriction, including without limitation the ;;; rights to use, copy, modify, merge, publish, distribute, sublicense, and/or ;;; sell copies of the Software, and to permit persons to whom the Software is ;;; furnished to do so, subject to the following conditions: ;;; ;;; The above copyright notice and this permission notice shall be included in ;;; all copies or substantial portions of the Software. ;;; ;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ;;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ;;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ;;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ;;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ;;; IN THE SOFTWARE. ;;; ;;; Adaptation to LispKit ;;; Copyright © 2020 Matthias Zenger. All rights reserved. (define-library (srfi 54) (export cat) (import (lispkit base)) (begin (define-syntax alet-cat* ; borrowed from SRFI-86 (syntax-rules () ((alet-cat* z (a . e) bd ...) (let ((y z)) (%alet-cat* y (a . e) bd ...))))) (define-syntax %alet-cat* ; borrowed from SRFI-86 (syntax-rules () ((%alet-cat* z ((n d t ...)) bd ...) (let ((n (if (null? z) d (if (null? (cdr z)) (wow-cat-end z n t ...) (error "cat: too many arguments" (cdr z)))))) bd ...)) ((%alet-cat* z ((n d t ...) . e) bd ...) (let ((n (if (null? z) d (wow-cat! z n d t ...)))) (%alet-cat* z e bd ...))) ((%alet-cat* z e bd ...) (let ((e z)) bd ...)))) (define-syntax wow-cat! ; borrowed from SRFI-86 (syntax-rules () ((wow-cat! z n d) (let ((n (car z))) (set! z (cdr z)) n)) ((wow-cat! z n d t) (let ((n (car z))) (if t (begin (set! z (cdr z)) n) (let lp ((head (list n)) (tail (cdr z))) (if (null? tail) d (let ((n (car tail))) (if t (begin (set! z (append (reverse head) (cdr tail))) n) (lp (cons n head) (cdr tail))))))))) ((wow-cat! z n d t ts) (let ((n (car z))) (if t (begin (set! z (cdr z)) ts) (let lp ((head (list n)) (tail (cdr z))) (if (null? tail) d (let ((n (car tail))) (if t (begin (set! z (append (reverse head) (cdr tail))) ts) (lp (cons n head) (cdr tail))))))))) ((wow-cat! z n d t ts fs) (let ((n (car z))) (if t (begin (set! z (cdr z)) ts) (begin (set! z (cdr z)) fs)))))) (define-syntax wow-cat-end ; borrowed from SRFI-86 (syntax-rules () ((wow-cat-end z n) (car z)) ((wow-cat-end z n t) (let ((n (car z))) (if t n (error "cat: too many argument" z)))) ((wow-cat-end z n t ts) (let ((n (car z))) (if t ts (error "cat: too many argument" z)))) ((wow-cat-end z n t ts fs) (let ((n (car z))) (if t ts fs))))) (define (str-index str char) (let ((len (string-length str))) (let lp ((n 0)) (and (< n len) (if (char=? char (string-ref str n)) n (lp (+ n 1))))))) (define (part pred ls) (let lp ((ls ls) (true '()) (false '())) (cond ((null? ls) (cons (reverse true) (reverse false))) ((pred (car ls)) (lp (cdr ls) (cons (car ls) true) false)) (else (lp (cdr ls) true (cons (car ls) false)))))) (define (e-mold num pre) (let* ((str (number->string (inexact num))) (e-index (str-index str #\e))) (if e-index (string-append (mold (substring str 0 e-index) pre) (substring str e-index (string-length str))) (mold str pre)))) (define (mold str pre) (let ((ind (str-index str #\.))) (if ind (let ((d-len (- (string-length str) (+ ind 1)))) (cond ((= d-len pre) str) ((< d-len pre) (string-append str (make-string (- pre d-len) #\0))) ;;((char<? #\4 (string-ref str (+ 1 ind pre))) ;;(let ((com (expt 10 pre))) ;; (number->string (/ (round (* (string->number str) com)) com)))) ((or (char<? #\5 (string-ref str (+ 1 ind pre))) (and (char=? #\5 (string-ref str (+ 1 ind pre))) (or (< (+ 1 pre) d-len) (memv (string-ref str (+ ind (if (= 0 pre) -1 pre))) '(#\1 #\3 #\5 #\7 #\9))))) (apply string (let* ((minus (char=? #\- (string-ref str 0))) (str (substring str (if minus 1 0) (+ 1 ind pre))) (char-list (reverse (let lp ((index (- (string-length str) 1)) (raise #t)) (if (= -1 index) (if raise '(#\1) '()) (let ((chr (string-ref str index))) (if (char=? #\. chr) (cons chr (lp (- index 1) raise)) (if raise (if (char=? #\9 chr) (cons #\0 (lp (- index 1) raise)) (cons (integer->char (+ 1 (char->integer chr))) (lp (- index 1) #f))) (cons chr (lp (- index 1) raise)))))))))) (if minus (cons #\- char-list) char-list)))) (else (substring str 0 (+ 1 ind pre))))) (string-append str "." (make-string pre #\0))))) (define (separate str sep num opt) (let* ((len (string-length str)) (pos (if opt (let ((pos (remainder (if (eq? opt 'minus) (- len 1) len) num))) (if (= 0 pos) num pos)) num))) (apply string-append (let loop ((ini 0) (pos (if (eq? opt 'minus) (+ pos 1) pos))) (if (< pos len) (cons (substring str ini pos) (cons sep (loop pos (+ pos num)))) (list (substring str ini len))))))) (define (cat object . rest) (let* ((str-rest (part string? rest)) (str-list (car str-rest)) (rest-list (cdr str-rest))) (if (null? rest-list) (apply string-append (cond ((number? object) (number->string object)) ((string? object) object) ((char? object) (string object)) ((boolean? object) (if object "#t" "#f")) ((symbol? object) (symbol->string object)) (else (get-output-string (let ((str-port (open-output-string))) (write object str-port) str-port)))) str-list) (alet-cat* rest-list ((width 0 (and (integer? width) (exact? width))) (port #f (or (boolean? port) (output-port? port)) (if (eq? port #t) (current-output-port) port)) (char #\space (char? char)) (converter #f (and (pair? converter) (procedure? (car converter)) (procedure? (cdr converter)))) (precision #f (and (integer? precision) (inexact? precision))) (sign #f (eq? 'sign sign)) (radix 'decimal (memq radix '(decimal octal binary hexadecimal))) (exactness #f (memq exactness '(exact inexact))) (separator #f (and (list? separator) (< 0 (length separator) 3) (char? (car separator)) (or (null? (cdr separator)) (let ((n (cadr separator))) (and (integer? n) (exact? n) (< 0 n)))))) (writer #f (procedure? writer)) (pipe #f (and (list? pipe) (not (null? pipe)) (every? procedure? pipe))) (take #f (and (list? take) (< 0 (length take) 3) (every? (lambda (x) (and (integer? x) (exact? x))) take)))) (let* ((str (cond ((and converter ((car converter) object)) (let* ((str ((cdr converter) object)) (pad (- (abs width) (string-length str)))) (cond ((<= pad 0) str) ((< 0 width) (string-append (make-string pad char) str)) (else (string-append str (make-string pad char)))))) ((number? object) (and (not (eq? radix 'decimal)) precision (error "cat: non-decimal cannot have a decimal point")) (and precision (< precision 0) (eq? exactness 'exact) (error "cat: exact number cannot have a decimal point without exact sign")) (let* ((exact-sign (and precision (<= 0 precision) (or (eq? exactness 'exact) (and (exact? object) (not (eq? exactness 'inexact)))) "#e")) (inexact-sign (and (not (eq? radix 'decimal)) (or (and (inexact? object) (not (eq? exactness 'exact))) (eq? exactness 'inexact)) "#i")) (radix-sign (cdr (assq radix '((decimal . #f) (octal . "#o") (binary . "#b") (hexadecimal . "#x"))))) (plus-sign (and sign (< 0 (real-part object)) "+")) (exactness-sign (or exact-sign inexact-sign)) (str0 (if precision (let ((precision (exact (abs precision))) (imag (imag-part object))) (if (= 0 imag) (e-mold object precision) (string-append (e-mold (real-part object) precision) (if (< 0 imag) "+" "") (e-mold imag precision) "i"))) (number->string (cond (inexact-sign (exact object)) (exactness (if (eq? exactness 'exact) (exact object) (inexact object))) (else object)) (cdr (assq radix '((decimal . 10) (octal . 8) (binary . 2) (hexadecimal . 16))))))) (str (if (and separator (not (or (and (eq? radix 'decimal) (str-index str0 #\e)) (str-index str0 #\i) (str-index str0 #\/)))) (let ((sep (string (car separator))) (num (if (null? (cdr separator)) 3 (cadr separator))) (dot-index (str-index str0 #\.))) (if dot-index (string-append (separate (substring str0 0 dot-index) sep num (if (< object 0) 'minus #t)) "." (separate (substring str0 (+ 1 dot-index) (string-length str0)) sep num #f)) (separate str0 sep num (if (< object 0) 'minus #t)))) str0)) (pad0 (- (abs width) (+ (string-length str) (if exactness-sign 2 0) (if radix-sign 2 0) (if plus-sign 1 0)))) (pad (if (< 0 pad0) pad0 0))) (if (< 0 width) (if (char-numeric? char) (if (< (real-part object) 0) (string-append (or exactness-sign "") (or radix-sign "") "-" (make-string pad char) (substring str 1 (string-length str))) (string-append (or exactness-sign "") (or radix-sign "") (or plus-sign "") (make-string pad char) str)) (string-append (make-string pad char) (or exactness-sign "") (or radix-sign "") (or plus-sign "") str)) (string-append (or exactness-sign "") (or radix-sign "") (or plus-sign "") str (make-string pad char))))) (else (let* ((str0 (cond (writer (get-output-string (let ((str-port (open-output-string))) (writer object str-port) str-port))) ((string? object) object) ((char? object) (string object)) ((boolean? object) (if object "#t" "#f")) ((symbol? object) (symbol->string object)) (else (get-output-string (let ((str-port (open-output-string))) (write object str-port) str-port))))) (str1 (if pipe (let loop ((str ((car pipe) str0)) (fns (cdr pipe))) (if (null? fns) str (loop ((car fns) str) (cdr fns)))) str0)) (str (if take (let ((left (car take)) (right (if (null? (cdr take)) 0 (cadr take))) (len (string-length str1))) (define (substr str1 beg end) (let ((end (cond ((< end 0) 0) ((< len end) len) (else end))) (beg (cond ((< beg 0) 0) ((< len beg) len) (else beg)))) (if (and (= beg 0) (= end len)) str1 (substring str1 beg end)))) (string-append (if (< left 0) (substr str1 (abs left) len) (substr str1 0 left)) (if (< right 0) (substr str1 0 (+ len right)) (substr str1 (- len right) len)))) str1)) (pad (- (abs width) (string-length str)))) (cond ((<= pad 0) str) ((< 0 width) (string-append (make-string pad char) str)) (else (string-append str (make-string pad char)))))))) (str3 (apply string-append str str-list))) (and port (display str3 port)) str3))))) ) )
true