1 // This file is automatically generated by scheme2js, except for the
2 // benchmark harness code at the beginning and end of the file.
4 /************* GENERATED FILE - DO NOT EDIT *************/
5 /************* GENERATED FILE - DO NOT EDIT *************/
6 /************* GENERATED FILE - DO NOT EDIT *************/
7 /************* GENERATED FILE - DO NOT EDIT *************/
8 /************* GENERATED FILE - DO NOT EDIT *************/
9 /************* GENERATED FILE - DO NOT EDIT *************/
10 /************* GENERATED FILE - DO NOT EDIT *************/
11 /************* GENERATED FILE - DO NOT EDIT *************/
13 * To use write/prints/... the default-output port has to be set first.
14 * Simply setting SC_DEFAULT_OUT and SC_ERROR_OUT to the desired values
15 * should do the trick.
16 * In the following example the std-out and error-port are redirected to
18 function initRuntime() {
19 function escapeHTML(s) {
21 tmp = tmp.replace(/&/g, "&");
22 tmp = tmp.replace(/</g, "<");
23 tmp = tmp.replace(/>/g, ">");
24 tmp = tmp.replace(/ /g, " ");
25 tmp = tmp.replace(/\n/g, "<br />");
26 tmp = tmp.replace(/\t/g, "  ");
31 document.write("<div id='stdout'></div>");
32 SC_DEFAULT_OUT = new sc_GenericOutputPort(
34 var stdout = document.getElementById('stdout');
35 stdout.innerHTML = stdout.innerHTML + escapeHTML(s);
37 SC_ERROR_OUT = SC_DEFAULT_OUT;
42 function sc_print_debug() {
43 sc_print.apply(null, arguments);
45 /*** META ((export *js*)) */
46 var sc_JS_GLOBALS = this;
51 /*** META ((export #t)) */
53 var len = arguments.length;
57 for( i = 0; i < len; i++ ) {
58 s += sc_toDisplayString(arguments[ i ]);
64 /*** META ((export #t)) */
65 function sc_typeof( x ) {
69 /*** META ((export #t)) */
71 var a = [sc_jsstring2symbol("*error*")];
72 for (var i = 0; i < arguments.length; i++) {
73 a[i+1] = arguments[i];
78 /*** META ((export #t)
79 (peephole (prefix "throw ")))
81 function sc_raise(obj) {
85 /*** META ((export with-handler-lambda)) */
86 function sc_withHandlerLambda(handler, body) {
90 if (!e._internalException)
97 var sc_properties = new Object();
99 /*** META ((export #t)) */
100 function sc_putpropBang(sym, key, val) {
101 var ht = sc_properties[sym];
104 sc_properties[sym] = ht;
109 /*** META ((export #t)) */
110 function sc_getprop(sym, key) {
111 var ht = sc_properties[sym];
121 /*** META ((export #t)) */
122 function sc_rempropBang(sym, key) {
123 var ht = sc_properties[sym];
128 /*** META ((export #t)) */
129 function sc_any2String(o) {
130 return jsstring2string(sc_toDisplayString(o));
133 /*** META ((export #t)
134 (peephole (infix 2 2 "==="))
137 function sc_isEqv(o1, o2) {
141 /*** META ((export #t)
142 (peephole (infix 2 2 "==="))
145 function sc_isEq(o1, o2) {
149 /*** META ((export #t)
152 function sc_isNumber(n) {
153 return (typeof n === "number");
156 /*** META ((export #t)
159 function sc_isComplex(n) {
160 return sc_isNumber(n);
163 /*** META ((export #t)
166 function sc_isReal(n) {
167 return sc_isNumber(n);
170 /*** META ((export #t)
173 function sc_isRational(n) {
177 /*** META ((export #t)
180 function sc_isInteger(n) {
181 return (parseInt(n) === n);
184 /*** META ((export #t)
186 (peephole (postfix ", false")))
188 // we don't have exact numbers...
189 function sc_isExact(n) {
193 /*** META ((export #t)
194 (peephole (postfix ", true"))
197 function sc_isInexact(n) {
201 /*** META ((export = =fx =fl)
203 (peephole (infix 2 2 "===")))
205 function sc_equal(x) {
206 for (var i = 1; i < arguments.length; i++)
207 if (x !== arguments[i])
212 /*** META ((export < <fx <fl)
214 (peephole (infix 2 2 "<")))
216 function sc_less(x) {
217 for (var i = 1; i < arguments.length; i++) {
218 if (x >= arguments[i])
225 /*** META ((export > >fx >fl)
227 (peephole (infix 2 2 ">")))
229 function sc_greater(x, y) {
230 for (var i = 1; i < arguments.length; i++) {
231 if (x <= arguments[i])
238 /*** META ((export <= <=fx <=fl)
240 (peephole (infix 2 2 "<=")))
242 function sc_lessEqual(x, y) {
243 for (var i = 1; i < arguments.length; i++) {
244 if (x > arguments[i])
251 /*** META ((export >= >=fl >=fx)
253 (peephole (infix 2 2 ">=")))
255 function sc_greaterEqual(x, y) {
256 for (var i = 1; i < arguments.length; i++) {
257 if (x < arguments[i])
264 /*** META ((export #t)
266 (peephole (postfix "=== 0")))
268 function sc_isZero(x) {
272 /*** META ((export #t)
274 (peephole (postfix "> 0")))
276 function sc_isPositive(x) {
280 /*** META ((export #t)
282 (peephole (postfix "< 0")))
284 function sc_isNegative(x) {
288 /*** META ((export #t)
290 (peephole (postfix "%2===1")))
292 function sc_isOdd(x) {
293 return (x % 2 === 1);
296 /*** META ((export #t)
298 (peephole (postfix "%2===0")))
300 function sc_isEven(x) {
301 return (x % 2 === 0);
304 /*** META ((export #t)) */
305 var sc_max = Math.max;
306 /*** META ((export #t)) */
307 var sc_min = Math.min;
309 /*** META ((export + +fx +fl)
310 (peephole (infix 0 #f "+" "0")))
314 for (var i = 0; i < arguments.length; i++)
319 /*** META ((export * *fx *fl)
320 (peephole (infix 0 #f "*" "1")))
322 function sc_multi() {
324 for (var i = 0; i < arguments.length; i++)
325 product *= arguments[i];
329 /*** META ((export - -fx -fl)
332 function sc_minus(x) {
333 if (arguments.length === 1)
337 for (var i = 1; i < arguments.length; i++)
343 /*** META ((export / /fl)
347 if (arguments.length === 1)
351 for (var i = 1; i < arguments.length; i++)
357 /*** META ((export #t)) */
358 var sc_abs = Math.abs;
360 /*** META ((export quotient /fx)
361 (peephole (hole 2 "parseInt(" x "/" y ")")))
363 function sc_quotient(x, y) {
364 return parseInt(x / y);
367 /*** META ((export #t)
368 (peephole (infix 2 2 "%")))
370 function sc_remainder(x, y) {
374 /*** META ((export #t)
377 function sc_modulo(x, y) {
378 var remainder = x % y;
379 // if they don't have the same sign
380 if ((remainder * y) < 0)
381 return remainder + y;
386 function sc_euclid_gcd(a, b) {
388 if (a === 0) return b;
389 if (b === 0) return a;
390 if (a < 0) {a = -a;};
391 if (b < 0) {b = -b;};
392 if (b > a) {temp = a; a = b; b = temp;};
395 if(a === 0) {return b;};
397 if(b === 0) {return a;};
402 /*** META ((export #t)) */
405 for (var i = 0; i < arguments.length; i++)
406 gcd = sc_euclid_gcd(gcd, arguments[i]);
410 /*** META ((export #t)) */
413 for (var i = 0; i < arguments.length; i++) {
414 var f = Math.round(arguments[i] / sc_euclid_gcd(arguments[i], lcm));
420 // LIMITATION: numerator and denominator don't make sense in floating point world.
421 //var SC_MAX_DECIMALS = 1000000
423 // function sc_numerator(x) {
424 // var rounded = Math.round(x * SC_MAX_DECIMALS);
425 // return Math.round(rounded / sc_euclid_gcd(rounded, SC_MAX_DECIMALS));
428 // function sc_denominator(x) {
429 // var rounded = Math.round(x * SC_MAX_DECIMALS);
430 // return Math.round(SC_MAX_DECIMALS / sc_euclid_gcd(rounded, SC_MAX_DECIMALS));
433 /*** META ((export #t)) */
434 var sc_floor = Math.floor;
435 /*** META ((export #t)) */
436 var sc_ceiling = Math.ceil;
437 /*** META ((export #t)) */
438 var sc_truncate = parseInt;
439 /*** META ((export #t)) */
440 var sc_round = Math.round;
442 // LIMITATION: sc_rationalize doesn't make sense in a floating point world.
444 /*** META ((export #t)) */
445 var sc_exp = Math.exp;
446 /*** META ((export #t)) */
447 var sc_log = Math.log;
448 /*** META ((export #t)) */
449 var sc_sin = Math.sin;
450 /*** META ((export #t)) */
451 var sc_cos = Math.cos;
452 /*** META ((export #t)) */
453 var sc_tan = Math.tan;
454 /*** META ((export #t)) */
455 var sc_asin = Math.asin;
456 /*** META ((export #t)) */
457 var sc_acos = Math.acos;
458 /*** META ((export #t)) */
459 var sc_atan = Math.atan;
461 /*** META ((export #t)) */
462 var sc_sqrt = Math.sqrt;
463 /*** META ((export #t)) */
464 var sc_expt = Math.pow;
466 // LIMITATION: we don't have complex numbers.
467 // LIMITATION: the following functions are hence not implemented.
468 // LIMITATION: make-rectangular, make-polar, real-part, imag-part, magnitude, angle
469 // LIMITATION: 2 argument atan
471 /*** META ((export #t)
474 function sc_exact2inexact(x) {
478 /*** META ((export #t)
481 function sc_inexact2exact(x) {
485 function sc_number2jsstring(x, radix) {
487 return x.toString(radix);
492 function sc_jsstring2number(s, radix) {
493 if (s === "") return false;
496 var t = parseInt(s, radix);
497 if (!t && t !== 0) return false;
498 // verify that each char is in range. (parseInt ignores leading
499 // white and trailing chars)
500 var allowedChars = "01234567890abcdefghijklmnopqrstuvwxyz".substring(0, radix+1);
501 if ((new RegExp("^["+allowedChars+"]*$", "i")).test(s))
505 var t = +s; // does not ignore trailing chars.
506 if (!t && t !== 0) return false;
507 // simply verify that first char is not whitespace.
509 // if +c is 0, but the char is not "0", then we have a whitespace.
510 if (+c === 0 && c !== "0") return false;
515 /*** META ((export #t)
523 /*** META ((export #t)
526 function sc_isBoolean(b) {
527 return (b === true) || (b === false);
530 function sc_Pair(car, cdr) {
535 sc_Pair.prototype.toString = function() {
536 return sc_toDisplayString(this);
538 sc_Pair.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {
544 res += writeOrDisplay(current.car);
545 if (sc_isPair(current.cdr)) {
547 current = current.cdr;
548 } else if (current.cdr !== null) {
549 res += " . " + writeOrDisplay(current.cdr);
551 } else // current.cdr == null
559 sc_Pair.prototype.sc_toDisplayString = function() {
560 return this.sc_toWriteOrDisplayString(sc_toDisplayString);
562 sc_Pair.prototype.sc_toWriteString = function() {
563 return this.sc_toWriteOrDisplayString(sc_toWriteString);
565 // sc_Pair.prototype.sc_toWriteCircleString in IO.js
567 /*** META ((export #t)
569 (peephole (postfix " instanceof sc_Pair")))
571 function sc_isPair(p) {
572 return (p instanceof sc_Pair);
575 function sc_isPairEqual(p1, p2, comp) {
576 return (comp(p1.car, p2.car) && comp(p1.cdr, p2.cdr));
579 /*** META ((export #t)
580 (peephole (hole 2 "new sc_Pair(" car ", " cdr ")")))
582 function sc_cons(car, cdr) {
583 return new sc_Pair(car, cdr);
586 /*** META ((export cons*)) */
587 function sc_consStar() {
588 var res = arguments[arguments.length - 1];
589 for (var i = arguments.length-2; i >= 0; i--)
590 res = new sc_Pair(arguments[i], res);
594 /*** META ((export #t)
595 (peephole (postfix ".car")))
601 /*** META ((export #t)
602 (peephole (postfix ".cdr")))
608 /*** META ((export #t)
609 (peephole (hole 2 p ".car = " val)))
611 function sc_setCarBang(p, val) {
615 /*** META ((export #t)
616 (peephole (hole 2 p ".cdr = " val)))
618 function sc_setCdrBang(p, val) {
622 /*** META ((export #t)
623 (peephole (postfix ".car.car")))
625 function sc_caar(p) { return p.car.car; }
626 /*** META ((export #t)
627 (peephole (postfix ".cdr.car")))
629 function sc_cadr(p) { return p.cdr.car; }
630 /*** META ((export #t)
631 (peephole (postfix ".car.cdr")))
633 function sc_cdar(p) { return p.car.cdr; }
634 /*** META ((export #t)
635 (peephole (postfix ".cdr.cdr")))
637 function sc_cddr(p) { return p.cdr.cdr; }
638 /*** META ((export #t)
639 (peephole (postfix ".car.car.car")))
641 function sc_caaar(p) { return p.car.car.car; }
642 /*** META ((export #t)
643 (peephole (postfix ".car.cdr.car")))
645 function sc_cadar(p) { return p.car.cdr.car; }
646 /*** META ((export #t)
647 (peephole (postfix ".cdr.car.car")))
649 function sc_caadr(p) { return p.cdr.car.car; }
650 /*** META ((export #t)
651 (peephole (postfix ".cdr.cdr.car")))
653 function sc_caddr(p) { return p.cdr.cdr.car; }
654 /*** META ((export #t)
655 (peephole (postfix ".car.car.cdr")))
657 function sc_cdaar(p) { return p.car.car.cdr; }
658 /*** META ((export #t)
659 (peephole (postfix ".cdr.car.cdr")))
661 function sc_cdadr(p) { return p.cdr.car.cdr; }
662 /*** META ((export #t)
663 (peephole (postfix ".car.cdr.cdr")))
665 function sc_cddar(p) { return p.car.cdr.cdr; }
666 /*** META ((export #t)
667 (peephole (postfix ".cdr.cdr.cdr")))
669 function sc_cdddr(p) { return p.cdr.cdr.cdr; }
670 /*** META ((export #t)
671 (peephole (postfix ".car.car.car.car")))
673 function sc_caaaar(p) { return p.car.car.car.car; }
674 /*** META ((export #t)
675 (peephole (postfix ".car.cdr.car.car")))
677 function sc_caadar(p) { return p.car.cdr.car.car; }
678 /*** META ((export #t)
679 (peephole (postfix ".cdr.car.car.car")))
681 function sc_caaadr(p) { return p.cdr.car.car.car; }
682 /*** META ((export #t)
683 (peephole (postfix ".cdr.cdr.car.car")))
685 function sc_caaddr(p) { return p.cdr.cdr.car.car; }
686 /*** META ((export #t)
687 (peephole (postfix ".car.car.car.cdr")))
689 function sc_cdaaar(p) { return p.car.car.car.cdr; }
690 /*** META ((export #t)
691 (peephole (postfix ".car.cdr.car.cdr")))
693 function sc_cdadar(p) { return p.car.cdr.car.cdr; }
694 /*** META ((export #t)
695 (peephole (postfix ".cdr.car.car.cdr")))
697 function sc_cdaadr(p) { return p.cdr.car.car.cdr; }
698 /*** META ((export #t)
699 (peephole (postfix ".cdr.cdr.car.cdr")))
701 function sc_cdaddr(p) { return p.cdr.cdr.car.cdr; }
702 /*** META ((export #t)
703 (peephole (postfix ".car.car.cdr.car")))
705 function sc_cadaar(p) { return p.car.car.cdr.car; }
706 /*** META ((export #t)
707 (peephole (postfix ".car.cdr.cdr.car")))
709 function sc_caddar(p) { return p.car.cdr.cdr.car; }
710 /*** META ((export #t)
711 (peephole (postfix ".cdr.car.cdr.car")))
713 function sc_cadadr(p) { return p.cdr.car.cdr.car; }
714 /*** META ((export #t)
715 (peephole (postfix ".cdr.cdr.cdr.car")))
717 function sc_cadddr(p) { return p.cdr.cdr.cdr.car; }
718 /*** META ((export #t)
719 (peephole (postfix ".car.car.cdr.cdr")))
721 function sc_cddaar(p) { return p.car.car.cdr.cdr; }
722 /*** META ((export #t)
723 (peephole (postfix ".car.cdr.cdr.cdr")))
725 function sc_cdddar(p) { return p.car.cdr.cdr.cdr; }
726 /*** META ((export #t)
727 (peephole (postfix ".cdr.car.cdr.cdr")))
729 function sc_cddadr(p) { return p.cdr.car.cdr.cdr; }
730 /*** META ((export #t)
731 (peephole (postfix ".cdr.cdr.cdr.cdr")))
733 function sc_cddddr(p) { return p.cdr.cdr.cdr.cdr; }
735 /*** META ((export #t)) */
736 function sc_lastPair(l) {
737 if (!sc_isPair(l)) sc_error("sc_lastPair: pair expected");
740 while (sc_isPair(cdr)) {
747 /*** META ((export #t)
749 (peephole (postfix " === null")))
751 function sc_isNull(o) {
755 /*** META ((export #t)
758 function sc_isList(o) {
765 if (rabbit === null ||
766 (rabbit instanceof sc_Pair && rabbit.cdr === null))
767 return true; // end of list
768 else if ((rabbit instanceof sc_Pair) &&
769 (rabbit.cdr instanceof sc_Pair)) {
770 rabbit = rabbit.cdr.cdr;
772 if (rabbit === turtle) return false; // cycle
774 return false; // not pair
778 /*** META ((export #t)) */
782 for (var i = a.length-1; i >= 0; i--)
783 res = new sc_Pair(a[i], res);
787 /*** META ((export #t)) */
788 function sc_iota(num, init) {
791 for (var i = num - 1; i >= 0; i--)
792 res = new sc_Pair(i + init, res);
796 /*** META ((export #t)) */
797 function sc_makeList(nbEls, fill) {
799 for (var i = 0; i < nbEls; i++)
800 res = new sc_Pair(fill, res);
804 /*** META ((export #t)) */
805 function sc_length(l) {
814 /*** META ((export #t)) */
815 function sc_remq(o, l) {
816 var dummy = { cdr : null };
820 tail.cdr = sc_cons(l.car, null);
828 /*** META ((export #t)) */
829 function sc_remqBang(o, l) {
830 var dummy = { cdr : null };
832 var needsAssig = true;
849 /*** META ((export #t)) */
850 function sc_delete(o, l) {
851 var dummy = { cdr : null };
854 if (!sc_isEqual(l.car, o)) {
855 tail.cdr = sc_cons(l.car, null);
863 /*** META ((export #t)) */
864 function sc_deleteBang(o, l) {
865 var dummy = { cdr : null };
867 var needsAssig = true;
869 if (sc_isEqual(l.car, o)) {
884 function sc_reverseAppendBang(l1, l2) {
886 while (l1 !== null) {
895 function sc_dualAppend(l1, l2) {
896 if (l1 === null) return l2;
897 if (l2 === null) return l1;
898 var rev = sc_reverse(l1);
899 return sc_reverseAppendBang(rev, l2);
902 /*** META ((export #t)) */
903 function sc_append() {
904 if (arguments.length === 0)
906 var res = arguments[arguments.length - 1];
907 for (var i = arguments.length - 2; i >= 0; i--)
908 res = sc_dualAppend(arguments[i], res);
912 function sc_dualAppendBang(l1, l2) {
913 if (l1 === null) return l2;
914 if (l2 === null) return l1;
916 while (tmp.cdr !== null) tmp=tmp.cdr;
921 /*** META ((export #t)) */
922 function sc_appendBang() {
924 for (var i = 0; i < arguments.length; i++)
925 res = sc_dualAppendBang(res, arguments[i]);
929 /*** META ((export #t)) */
930 function sc_reverse(l1) {
932 while (l1 !== null) {
933 res = sc_cons(l1.car, res);
939 /*** META ((export #t)) */
940 function sc_reverseBang(l) {
941 return sc_reverseAppendBang(l, null);
944 /*** META ((export #t)) */
945 function sc_listTail(l, k) {
947 for (var i = 0; i < k; i++) {
953 /*** META ((export #t)) */
954 function sc_listRef(l, k) {
955 return sc_listTail(l, k).car;
958 /* // unoptimized generic versions
959 function sc_memX(o, l, comp) {
967 function sc_memq(o, l) { return sc_memX(o, l, sc_isEq); }
968 function sc_memv(o, l) { return sc_memX(o, l, sc_isEqv); }
969 function sc_member(o, l) { return sc_memX(o, l, sc_isEqual); }
972 /* optimized versions */
973 /*** META ((export #t)) */
974 function sc_memq(o, l) {
982 /*** META ((export #t)) */
983 function sc_memv(o, l) {
991 /*** META ((export #t)) */
992 function sc_member(o, l) {
994 if (sc_isEqual(l.car,o))
1001 /* // generic unoptimized versions
1002 function sc_assX(o, al, comp) {
1003 while (al != null) {
1004 if (comp(al.car.car, o))
1010 function sc_assq(o, al) { return sc_assX(o, al, sc_isEq); }
1011 function sc_assv(o, al) { return sc_assX(o, al, sc_isEqv); }
1012 function sc_assoc(o, al) { return sc_assX(o, al, sc_isEqual); }
1014 // optimized versions
1015 /*** META ((export #t)) */
1016 function sc_assq(o, al) {
1017 while (al !== null) {
1018 if (al.car.car === o)
1024 /*** META ((export #t)) */
1025 function sc_assv(o, al) {
1026 while (al !== null) {
1027 if (al.car.car === o)
1033 /*** META ((export #t)) */
1034 function sc_assoc(o, al) {
1035 while (al !== null) {
1036 if (sc_isEqual(al.car.car, o))
1043 /* can be used for mutable strings and characters */
1044 function sc_isCharStringEqual(cs1, cs2) { return cs1.val === cs2.val; }
1045 function sc_isCharStringLess(cs1, cs2) { return cs1.val < cs2.val; }
1046 function sc_isCharStringGreater(cs1, cs2) { return cs1.val > cs2.val; }
1047 function sc_isCharStringLessEqual(cs1, cs2) { return cs1.val <= cs2.val; }
1048 function sc_isCharStringGreaterEqual(cs1, cs2) { return cs1.val >= cs2.val; }
1049 function sc_isCharStringCIEqual(cs1, cs2)
1050 { return cs1.val.toLowerCase() === cs2.val.toLowerCase(); }
1051 function sc_isCharStringCILess(cs1, cs2)
1052 { return cs1.val.toLowerCase() < cs2.val.toLowerCase(); }
1053 function sc_isCharStringCIGreater(cs1, cs2)
1054 { return cs1.val.toLowerCase() > cs2.val.toLowerCase(); }
1055 function sc_isCharStringCILessEqual(cs1, cs2)
1056 { return cs1.val.toLowerCase() <= cs2.val.toLowerCase(); }
1057 function sc_isCharStringCIGreaterEqual(cs1, cs2)
1058 { return cs1.val.toLowerCase() >= cs2.val.toLowerCase(); }
1063 function sc_Char(c) {
1064 var cached = sc_Char.lazy[c];
1068 sc_Char.lazy[c] = this;
1069 // add return, so FF does not complain.
1072 sc_Char.lazy = new Object();
1074 sc_Char.char2readable = {
1077 "\010": "#\\backspace",
1079 "\012": "#\\newline",
1081 "\015": "#\\return",
1082 "\033": "#\\escape",
1084 "\177": "#\\delete",
1086 /* poeticless names */
1116 sc_Char.readable2char = {
1119 "backspace": "\010",
1161 sc_Char.prototype.toString = function() {
1164 // sc_toDisplayString == toString
1165 sc_Char.prototype.sc_toWriteString = function() {
1166 var entry = sc_Char.char2readable[this.val];
1170 return "#\\" + this.val;
1173 /*** META ((export #t)
1175 (peephole (postfix "instanceof sc_Char")))
1177 function sc_isChar(c) {
1178 return (c instanceof sc_Char);
1181 /*** META ((export char=?)
1183 (peephole (hole 2 c1 ".val === " c2 ".val")))
1185 var sc_isCharEqual = sc_isCharStringEqual;
1186 /*** META ((export char<?)
1188 (peephole (hole 2 c1 ".val < " c2 ".val")))
1190 var sc_isCharLess = sc_isCharStringLess;
1191 /*** META ((export char>?)
1193 (peephole (hole 2 c1 ".val > " c2 ".val")))
1195 var sc_isCharGreater = sc_isCharStringGreater;
1196 /*** META ((export char<=?)
1198 (peephole (hole 2 c1 ".val <= " c2 ".val")))
1200 var sc_isCharLessEqual = sc_isCharStringLessEqual;
1201 /*** META ((export char>=?)
1203 (peephole (hole 2 c1 ".val >= " c2 ".val")))
1205 var sc_isCharGreaterEqual = sc_isCharStringGreaterEqual;
1206 /*** META ((export char-ci=?)
1208 (peephole (hole 2 c1 ".val.toLowerCase() === " c2 ".val.toLowerCase()")))
1210 var sc_isCharCIEqual = sc_isCharStringCIEqual;
1211 /*** META ((export char-ci<?)
1213 (peephole (hole 2 c1 ".val.toLowerCase() < " c2 ".val.toLowerCase()")))
1215 var sc_isCharCILess = sc_isCharStringCILess;
1216 /*** META ((export char-ci>?)
1218 (peephole (hole 2 c1 ".val.toLowerCase() > " c2 ".val.toLowerCase()")))
1220 var sc_isCharCIGreater = sc_isCharStringCIGreater;
1221 /*** META ((export char-ci<=?)
1223 (peephole (hole 2 c1 ".val.toLowerCase() <= " c2 ".val.toLowerCase()")))
1225 var sc_isCharCILessEqual = sc_isCharStringCILessEqual;
1226 /*** META ((export char-ci>=?)
1228 (peephole (hole 2 c1 ".val.toLowerCase() >= " c2 ".val.toLowerCase()")))
1230 var sc_isCharCIGreaterEqual = sc_isCharStringCIGreaterEqual;
1232 var SC_NUMBER_CLASS = "0123456789";
1233 var SC_WHITESPACE_CLASS = ' \r\n\t\f';
1234 var SC_LOWER_CLASS = 'abcdefghijklmnopqrstuvwxyz';
1235 var SC_UPPER_CLASS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
1237 function sc_isCharOfClass(c, cl) { return (cl.indexOf(c) != -1); }
1238 /*** META ((export #t)
1241 function sc_isCharAlphabetic(c)
1242 { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||
1243 sc_isCharOfClass(c.val, SC_UPPER_CLASS); }
1244 /*** META ((export #t)
1246 (peephole (hole 1 "SC_NUMBER_CLASS.indexOf(" c ".val) != -1")))
1248 function sc_isCharNumeric(c)
1249 { return sc_isCharOfClass(c.val, SC_NUMBER_CLASS); }
1250 /*** META ((export #t)
1253 function sc_isCharWhitespace(c) {
1255 return tmp === " " || tmp === "\r" || tmp === "\n" || tmp === "\t" || tmp === "\f";
1257 /*** META ((export #t)
1259 (peephole (hole 1 "SC_UPPER_CLASS.indexOf(" c ".val) != -1")))
1261 function sc_isCharUpperCase(c)
1262 { return sc_isCharOfClass(c.val, SC_UPPER_CLASS); }
1263 /*** META ((export #t)
1265 (peephole (hole 1 "SC_LOWER_CLASS.indexOf(" c ".val) != -1")))
1267 function sc_isCharLowerCase(c)
1268 { return sc_isCharOfClass(c.val, SC_LOWER_CLASS); }
1270 /*** META ((export #t)
1271 (peephole (postfix ".val.charCodeAt(0)")))
1273 function sc_char2integer(c)
1274 { return c.val.charCodeAt(0); }
1275 /*** META ((export #t)
1276 (peephole (hole 1 "new sc_Char(String.fromCharCode(" n "))")))
1278 function sc_integer2char(n)
1279 { return new sc_Char(String.fromCharCode(n)); }
1281 /*** META ((export #t)
1282 (peephole (hole 1 "new sc_Char(" c ".val.toUpperCase())")))
1284 function sc_charUpcase(c)
1285 { return new sc_Char(c.val.toUpperCase()); }
1286 /*** META ((export #t)
1287 (peephole (hole 1 "new sc_Char(" c ".val.toLowerCase())")))
1289 function sc_charDowncase(c)
1290 { return new sc_Char(c.val.toLowerCase()); }
1292 function sc_makeJSStringOfLength(k, c) {
1294 if (c === undefined)
1300 // every round doubles the size of fill.
1303 res = res.concat(fill);
1304 fill = fill.concat(fill);
1310 function sc_makejsString(k, c) {
1316 return sc_makeJSStringOfLength(k, fill);
1319 function sc_jsstring2list(s) {
1321 for (var i = s.length - 1; i >= 0; i--)
1322 res = sc_cons(new sc_Char(s.charAt(i)), res);
1326 function sc_list2jsstring(l) {
1327 var a = new Array();
1332 return "".concat.apply("", a);
1335 var sc_Vector = Array;
1337 sc_Vector.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {
1338 if (this.length === 0) return "#()";
1340 var res = "#(" + writeOrDisplay(this[0]);
1341 for (var i = 1; i < this.length; i++)
1342 res += " " + writeOrDisplay(this[i]);
1346 sc_Vector.prototype.sc_toDisplayString = function() {
1347 return this.sc_toWriteOrDisplayString(sc_toDisplayString);
1349 sc_Vector.prototype.sc_toWriteString = function() {
1350 return this.sc_toWriteOrDisplayString(sc_toWriteString);
1353 /*** META ((export vector? array?)
1355 (peephole (postfix " instanceof sc_Vector")))
1357 function sc_isVector(v) {
1358 return (v instanceof sc_Vector);
1361 // only applies to vectors
1362 function sc_isVectorEqual(v1, v2, comp) {
1363 if (v1.length !== v2.length) return false;
1364 for (var i = 0; i < v1.length; i++)
1365 if (!comp(v1[i], v2[i])) return false;
1369 /*** META ((export make-vector make-array)) */
1370 function sc_makeVector(size, fill) {
1371 var a = new sc_Vector(size);
1372 if (fill !== undefined)
1373 sc_vectorFillBang(a, fill);
1377 /*** META ((export vector array)
1378 (peephole (vector)))
1380 function sc_vector() {
1381 var a = new sc_Vector();
1382 for (var i = 0; i < arguments.length; i++)
1383 a.push(arguments[i]);
1387 /*** META ((export vector-length array-length)
1388 (peephole (postfix ".length")))
1390 function sc_vectorLength(v) {
1394 /*** META ((export vector-ref array-ref)
1395 (peephole (hole 2 v "[" pos "]")))
1397 function sc_vectorRef(v, pos) {
1401 /*** META ((export vector-set! array-set!)
1402 (peephole (hole 3 v "[" pos "] = " val)))
1404 function sc_vectorSetBang(v, pos, val) {
1408 /*** META ((export vector->list array->list)) */
1409 function sc_vector2list(a) {
1411 for (var i = a.length-1; i >= 0; i--)
1412 res = sc_cons(a[i], res);
1416 /*** META ((export list->vector list->array)) */
1417 function sc_list2vector(l) {
1418 var a = new sc_Vector();
1426 /*** META ((export vector-fill! array-fill!)) */
1427 function sc_vectorFillBang(a, fill) {
1428 for (var i = 0; i < a.length; i++)
1433 /*** META ((export #t)) */
1434 function sc_copyVector(a, len) {
1435 if (len <= a.length)
1436 return a.slice(0, len);
1438 var tmp = a.concat();
1444 /*** META ((export #t)
1445 (peephole (hole 3 a ".slice(" start "," end ")")))
1447 function sc_vectorCopy(a, start, end) {
1448 return a.slice(start, end);
1451 /*** META ((export #t)) */
1452 function sc_vectorCopyBang(target, tstart, source, sstart, send) {
1453 if (!sstart) sstart = 0;
1454 if (!send) send = source.length;
1456 // if target == source we don't want to overwrite not yet copied elements.
1457 if (tstart <= sstart) {
1458 for (var i = tstart, j = sstart; j < send; i++, j++) {
1459 target[i] = source[j];
1462 var diff = send - sstart;
1463 for (var i = tstart + diff - 1, j = send - 1;
1466 target[i] = source[j];
1472 /*** META ((export #t)
1474 (peephole (hole 1 "typeof " o " === 'function'")))
1476 function sc_isProcedure(o) {
1477 return (typeof o === "function");
1480 /*** META ((export #t)) */
1481 function sc_apply(proc) {
1482 var args = new Array();
1483 // first part of arguments are not in list-form.
1484 for (var i = 1; i < arguments.length - 1; i++)
1485 args.push(arguments[i]);
1486 var l = arguments[arguments.length - 1];
1487 while (l !== null) {
1491 return proc.apply(null, args);
1494 /*** META ((export #t)) */
1495 function sc_map(proc, l1) {
1496 if (l1 === undefined)
1499 var nbApplyArgs = arguments.length - 1;
1500 var applyArgs = new Array(nbApplyArgs);
1502 while (l1 !== null) {
1503 for (var i = 0; i < nbApplyArgs; i++) {
1504 applyArgs[i] = arguments[i + 1].car;
1505 arguments[i + 1] = arguments[i + 1].cdr;
1507 revres = sc_cons(proc.apply(null, applyArgs), revres);
1509 return sc_reverseAppendBang(revres, null);
1512 /*** META ((export #t)) */
1513 function sc_mapBang(proc, l1) {
1514 if (l1 === undefined)
1518 var nbApplyArgs = arguments.length - 1;
1519 var applyArgs = new Array(nbApplyArgs);
1520 while (l1 !== null) {
1522 for (var i = 0; i < nbApplyArgs; i++) {
1523 applyArgs[i] = arguments[i + 1].car;
1524 arguments[i + 1] = arguments[i + 1].cdr;
1526 tmp.car = proc.apply(null, applyArgs);
1531 /*** META ((export #t)) */
1532 function sc_forEach(proc, l1) {
1533 if (l1 === undefined)
1536 var nbApplyArgs = arguments.length - 1;
1537 var applyArgs = new Array(nbApplyArgs);
1538 while (l1 !== null) {
1539 for (var i = 0; i < nbApplyArgs; i++) {
1540 applyArgs[i] = arguments[i + 1].car;
1541 arguments[i + 1] = arguments[i + 1].cdr;
1543 proc.apply(null, applyArgs);
1545 // add return so FF does not complain.
1549 /*** META ((export #t)) */
1550 function sc_filter(proc, l1) {
1551 var dummy = { cdr : null };
1553 while (l1 !== null) {
1554 if (proc(l1.car) !== false) {
1555 tail.cdr = sc_cons(l1.car, null);
1563 /*** META ((export #t)) */
1564 function sc_filterBang(proc, l1) {
1565 var head = sc_cons("dummy", l1);
1568 while (next !== null) {
1569 if (proc(next.car) !== false) {
1579 function sc_filterMap1(proc, l1) {
1581 while (l1 !== null) {
1582 var tmp = proc(l1.car)
1583 if (tmp !== false) revres = sc_cons(tmp, revres);
1586 return sc_reverseAppendBang(revres, null);
1588 function sc_filterMap2(proc, l1, l2) {
1590 while (l1 !== null) {
1591 var tmp = proc(l1.car, l2.car);
1592 if(tmp !== false) revres = sc_cons(tmp, revres);
1596 return sc_reverseAppendBang(revres, null);
1599 /*** META ((export #t)) */
1600 function sc_filterMap(proc, l1, l2, l3) {
1601 if (l2 === undefined)
1602 return sc_filterMap1(proc, l1);
1603 else if (l3 === undefined)
1604 return sc_filterMap2(proc, l1, l2);
1606 var nbApplyArgs = arguments.length - 1;
1607 var applyArgs = new Array(nbApplyArgs);
1609 while (l1 !== null) {
1610 for (var i = 0; i < nbApplyArgs; i++) {
1611 applyArgs[i] = arguments[i + 1].car;
1612 arguments[i + 1] = arguments[i + 1].cdr;
1614 var tmp = proc.apply(null, applyArgs);
1615 if(tmp !== false) revres = sc_cons(tmp, revres);
1617 return sc_reverseAppendBang(revres, null);
1620 /*** META ((export #t)) */
1621 function sc_any(proc, l) {
1623 while (l !== null) {
1624 var tmp = proc(l.car);
1625 if(tmp !== false) return tmp;
1631 /*** META ((export any?)
1632 (peephole (hole 2 "sc_any(" proc "," l ") !== false")))
1634 function sc_anyPred(proc, l) {
1635 return sc_any(proc, l)!== false;
1638 /*** META ((export #t)) */
1639 function sc_every(proc, l) {
1642 while (l !== null) {
1644 if (tmp === false) return false;
1650 /*** META ((export every?)
1651 (peephole (hole 2 "sc_every(" proc "," l ") !== false")))
1653 function sc_everyPred(proc, l) {
1654 var tmp = sc_every(proc, l);
1655 if (tmp !== false) return true;
1659 /*** META ((export #t)
1660 (peephole (postfix "()")))
1662 function sc_force(o) {
1666 /*** META ((export #t)) */
1667 function sc_makePromise(proc) {
1668 var isResultReady = false;
1669 var result = undefined;
1671 if (!isResultReady) {
1673 if (!isResultReady) {
1674 isResultReady = true;
1682 function sc_Values(values) {
1683 this.values = values;
1686 /*** META ((export #t)
1687 (peephole (values)))
1689 function sc_values() {
1690 if (arguments.length === 1)
1691 return arguments[0];
1693 return new sc_Values(arguments);
1696 /*** META ((export #t)) */
1697 function sc_callWithValues(producer, consumer) {
1698 var produced = producer();
1699 if (produced instanceof sc_Values)
1700 return consumer.apply(null, produced.values);
1702 return consumer(produced);
1705 /*** META ((export #t)) */
1706 function sc_dynamicWind(before, thunk, after) {
1717 // TODO: eval/scheme-report-environment/null-environment/interaction-environment
1719 // LIMITATION: 'load' doesn't exist without files.
1720 // LIMITATION: transcript-on/transcript-off doesn't exist without files.
1723 function sc_Struct(name) {
1726 sc_Struct.prototype.sc_toDisplayString = function() {
1727 return "#<struct" + sc_hash(this) + ">";
1729 sc_Struct.prototype.sc_toWriteString = sc_Struct.prototype.sc_toDisplayString;
1731 /*** META ((export #t)
1732 (peephole (hole 1 "new sc_Struct(" name ")")))
1734 function sc_makeStruct(name) {
1735 return new sc_Struct(name);
1738 /*** META ((export #t)
1740 (peephole (postfix " instanceof sc_Struct")))
1742 function sc_isStruct(o) {
1743 return (o instanceof sc_Struct);
1746 /*** META ((export #t)
1748 (peephole (hole 2 "(" 1 " instanceof sc_Struct) && ( " 1 ".name === " 0 ")")))
1750 function sc_isStructNamed(name, s) {
1751 return ((s instanceof sc_Struct) && (s.name === name));
1754 /*** META ((export struct-field)
1755 (peephole (hole 3 0 "[" 2 "]")))
1757 function sc_getStructField(s, name, field) {
1761 /*** META ((export struct-field-set!)
1762 (peephole (hole 4 0 "[" 2 "] = " 3)))
1764 function sc_setStructFieldBang(s, name, field, val) {
1768 /*** META ((export #t)
1769 (peephole (prefix "~")))
1771 function sc_bitNot(x) {
1775 /*** META ((export #t)
1776 (peephole (infix 2 2 "&")))
1778 function sc_bitAnd(x, y) {
1782 /*** META ((export #t)
1783 (peephole (infix 2 2 "|")))
1785 function sc_bitOr(x, y) {
1789 /*** META ((export #t)
1790 (peephole (infix 2 2 "^")))
1792 function sc_bitXor(x, y) {
1796 /*** META ((export #t)
1797 (peephole (infix 2 2 "<<")))
1799 function sc_bitLsh(x, y) {
1803 /*** META ((export #t)
1804 (peephole (infix 2 2 ">>")))
1806 function sc_bitRsh(x, y) {
1810 /*** META ((export #t)
1811 (peephole (infix 2 2 ">>>")))
1813 function sc_bitUrsh(x, y) {
1817 /*** META ((export js-field js-property)
1818 (peephole (hole 2 o "[" field "]")))
1820 function sc_jsField(o, field) {
1824 /*** META ((export js-field-set! js-property-set!)
1825 (peephole (hole 3 o "[" field "] = " val)))
1827 function sc_setJsFieldBang(o, field, val) {
1828 return o[field] = val;
1831 /*** META ((export js-field-delete! js-property-delete!)
1832 (peephole (hole 2 "delete" o "[" field "]")))
1834 function sc_deleteJsFieldBang(o, field) {
1838 /*** META ((export #t)
1839 (peephole (jsCall)))
1841 function sc_jsCall(o, fun) {
1842 var args = new Array();
1843 for (var i = 2; i < arguments.length; i++)
1844 args[i-2] = arguments[i];
1845 return fun.apply(o, args);
1848 /*** META ((export #t)
1849 (peephole (jsMethodCall)))
1851 function sc_jsMethodCall(o, field) {
1852 var args = new Array();
1853 for (var i = 2; i < arguments.length; i++)
1854 args[i-2] = arguments[i];
1855 return o[field].apply(o, args);
1858 /*** META ((export new js-new)
1861 function sc_jsNew(c) {
1862 var evalStr = "new c(";
1863 evalStr +=arguments.length > 1? "arguments[1]": "";
1864 for (var i = 2; i < arguments.length; i++)
1865 evalStr += ", arguments[" + i + "]";
1867 return eval(evalStr);
1870 // ======================== RegExp ====================
1871 /*** META ((export #t)) */
1872 function sc_pregexp(re) {
1873 return new RegExp(sc_string2jsstring(re));
1876 /*** META ((export #t)) */
1877 function sc_pregexpMatch(re, s) {
1878 var reg = (re instanceof RegExp) ? re : sc_pregexp(re);
1879 var tmp = reg.exec(sc_string2jsstring(s));
1881 if (tmp == null) return false;
1884 for (var i = tmp.length-1; i >= 0; i--) {
1885 if (tmp[i] !== null) {
1886 res = sc_cons(sc_jsstring2string(tmp[i]), res);
1888 res = sc_cons(false, res);
1894 /*** META ((export #t)) */
1895 function sc_pregexpReplace(re, s1, s2) {
1897 var jss1 = sc_string2jsstring(s1);
1898 var jss2 = sc_string2jsstring(s2);
1900 if (re instanceof RegExp) {
1904 reg = new RegExp(re.source);
1906 reg = new RegExp(sc_string2jsstring(re));
1909 return jss1.replace(reg, jss2);
1912 /*** META ((export pregexp-replace*)) */
1913 function sc_pregexpReplaceAll(re, s1, s2) {
1915 var jss1 = sc_string2jsstring(s1);
1916 var jss2 = sc_string2jsstring(s2);
1918 if (re instanceof RegExp) {
1922 reg = new RegExp(re.source, "g");
1924 reg = new RegExp(sc_string2jsstring(re), "g");
1927 return jss1.replace(reg, jss2);
1930 /*** META ((export #t)) */
1931 function sc_pregexpSplit(re, s) {
1932 var reg = ((re instanceof RegExp) ?
1934 new RegExp(sc_string2jsstring(re)));
1935 var jss = sc_string2jsstring(s);
1936 var tmp = jss.split(reg);
1938 if (tmp == null) return false;
1940 return sc_vector2list(tmp);
1944 /* =========================================================================== */
1945 /* Other library stuff */
1946 /* =========================================================================== */
1948 /*** META ((export #t)
1949 (peephole (hole 1 "Math.floor(Math.random()*" 'n ")")))
1951 function sc_random(n) {
1952 return Math.floor(Math.random()*n);
1955 /*** META ((export current-date)
1956 (peephole (hole 0 "new Date()")))
1958 function sc_currentDate() {
1962 function sc_Hashtable() {
1964 sc_Hashtable.prototype.toString = function() {
1965 return "#{%hashtable}";
1967 // sc_toWriteString == sc_toDisplayString == toString
1969 function sc_HashtableElement(key, val) {
1974 /*** META ((export #t)
1975 (peephole (hole 0 "new sc_Hashtable()")))
1977 function sc_makeHashtable() {
1978 return new sc_Hashtable();
1981 /*** META ((export #t)) */
1982 function sc_hashtablePutBang(ht, key, val) {
1983 var hash = sc_hash(key);
1984 ht[hash] = new sc_HashtableElement(key, val);
1987 /*** META ((export #t)) */
1988 function sc_hashtableGet(ht, key) {
1989 var hash = sc_hash(key);
1991 return ht[hash].val;
1996 /*** META ((export #t)) */
1997 function sc_hashtableForEach(ht, f) {
1999 if (ht[v] instanceof sc_HashtableElement)
2000 f(ht[v].key, ht[v].val);
2004 /*** META ((export hashtable-contains?)
2005 (peephole (hole 2 "sc_hash(" 1 ") in " 0)))
2007 function sc_hashtableContains(ht, key) {
2008 var hash = sc_hash(key);
2015 var SC_HASH_COUNTER = 0;
2017 function sc_hash(o) {
2020 else if (o === undefined)
2022 else if (o === true)
2024 else if (o === false)
2026 else if (typeof o === "number")
2028 else if (typeof o === "string")
2029 return "jsstr-" + o;
2030 else if (o.sc_getHash)
2031 return o.sc_getHash();
2033 return sc_counterHash.call(o);
2035 function sc_counterHash() {
2036 if (!this.sc_hash) {
2037 this.sc_hash = "hash-" + SC_HASH_COUNTER;
2040 return this.sc_hash;
2043 function sc_Trampoline(args, maxTailCalls) {
2044 this['__trampoline return__'] = true;
2046 this.MAX_TAIL_CALLs = maxTailCalls;
2048 // TODO: call/cc stuff
2049 sc_Trampoline.prototype.restart = function() {
2052 // set both globals.
2053 SC_TAIL_OBJECT.calls = o.MAX_TAIL_CALLs-1;
2054 var fun = o.args.callee;
2055 var res = fun.apply(SC_TAIL_OBJECT, o.args);
2056 if (res instanceof sc_Trampoline)
2063 /*** META ((export bind-exit-lambda)) */
2064 function sc_bindExitLambda(proc) {
2065 var escape_obj = new sc_BindExitException();
2066 var escape = function(res) {
2067 escape_obj.res = res;
2071 return proc(escape);
2073 if (e === escape_obj) {
2079 function sc_BindExitException() {
2080 this._internalException = true;
2083 var SC_SCM2JS_GLOBALS = new Object();
2085 // default tail-call depth.
2086 // normally the program should set it again. but just in case...
2087 var SC_TAIL_OBJECT = new Object();
2088 SC_SCM2JS_GLOBALS.TAIL_OBJECT = SC_TAIL_OBJECT;
2089 // ======================== I/O =======================
2091 /*------------------------------------------------------------------*/
2095 var SC_EOF_OBJECT = new sc_EOF();
2097 function sc_Port() {
2100 /* --------------- Input ports -------------------------------------*/
2102 function sc_InputPort() {
2104 sc_InputPort.prototype = new sc_Port();
2106 sc_InputPort.prototype.peekChar = function() {
2107 if (!("peeked" in this))
2108 this.peeked = this.getNextChar();
2111 sc_InputPort.prototype.readChar = function() {
2112 var tmp = this.peekChar();
2116 sc_InputPort.prototype.isCharReady = function() {
2119 sc_InputPort.prototype.close = function() {
2123 /* .............. String port ..........................*/
2124 function sc_ErrorInputPort() {
2126 sc_ErrorInputPort.prototype = new sc_InputPort();
2127 sc_ErrorInputPort.prototype.getNextChar = function() {
2128 throw "can't read from error-port.";
2130 sc_ErrorInputPort.prototype.isCharReady = function() {
2135 /* .............. String port ..........................*/
2137 function sc_StringInputPort(jsStr) {
2138 // we are going to do some charAts on the str.
2139 // instead of recreating all the time a String-object, we
2140 // create one in the beginning. (not sure, if this is really an optim)
2141 this.str = new String(jsStr);
2144 sc_StringInputPort.prototype = new sc_InputPort();
2145 sc_StringInputPort.prototype.getNextChar = function() {
2146 if (this.pos >= this.str.length)
2147 return SC_EOF_OBJECT;
2148 return this.str.charAt(this.pos++);
2151 /* ------------- Read and other lib-funs -------------------------------*/
2152 function sc_Token(type, val, pos) {
2157 sc_Token.EOF = 0/*EOF*/;
2158 sc_Token.OPEN_PAR = 1/*OPEN_PAR*/;
2159 sc_Token.CLOSE_PAR = 2/*CLOSE_PAR*/;
2160 sc_Token.OPEN_BRACE = 3/*OPEN_BRACE*/;
2161 sc_Token.CLOSE_BRACE = 4/*CLOSE_BRACE*/;
2162 sc_Token.OPEN_BRACKET = 5/*OPEN_BRACKET*/;
2163 sc_Token.CLOSE_BRACKET = 6/*CLOSE_BRACKET*/;
2164 sc_Token.WHITESPACE = 7/*WHITESPACE*/;
2165 sc_Token.QUOTE = 8/*QUOTE*/;
2166 sc_Token.ID = 9/*ID*/;
2167 sc_Token.DOT = 10/*DOT*/;
2168 sc_Token.STRING = 11/*STRING*/;
2169 sc_Token.NUMBER = 12/*NUMBER*/;
2170 sc_Token.ERROR = 13/*ERROR*/;
2171 sc_Token.VECTOR_BEGIN = 14/*VECTOR_BEGIN*/;
2172 sc_Token.TRUE = 15/*TRUE*/;
2173 sc_Token.FALSE = 16/*FALSE*/;
2174 sc_Token.UNSPECIFIED = 17/*UNSPECIFIED*/;
2175 sc_Token.REFERENCE = 18/*REFERENCE*/;
2176 sc_Token.STORE = 19/*STORE*/;
2177 sc_Token.CHAR = 20/*CHAR*/;
2179 var SC_ID_CLASS = SC_LOWER_CLASS + SC_UPPER_CLASS + "!$%*+-./:<=>?@^_~";
2180 function sc_Tokenizer(port) {
2183 sc_Tokenizer.prototype.peekToken = function() {
2186 var newToken = this.nextToken();
2187 this.peeked = newToken;
2190 sc_Tokenizer.prototype.readToken = function() {
2191 var tmp = this.peekToken();
2195 sc_Tokenizer.prototype.nextToken = function() {
2196 var port = this.port;
2198 function isNumberChar(c) {
2199 return (c >= "0" && c <= "9");
2201 function isIdOrNumberChar(c) {
2202 return SC_ID_CLASS.indexOf(c) != -1 || // ID-char
2203 (c >= "0" && c <= "9");
2205 function isWhitespace(c) {
2206 return c === " " || c === "\r" || c === "\n" || c === "\t" || c === "\f";
2208 function isWhitespaceOrEOF(c) {
2209 return isWhitespace(c) || c === SC_EOF_OBJECT;
2212 function readString() {
2215 var c = port.readChar();
2218 return new sc_Token(11/*STRING*/, res);
2220 var tmp = port.readChar();
2222 case '0': res += "\0"; break;
2223 case 'a': res += "\a"; break;
2224 case 'b': res += "\b"; break;
2225 case 'f': res += "\f"; break;
2226 case 'n': res += "\n"; break;
2227 case 'r': res += "\r"; break;
2228 case 't': res += "\t"; break;
2229 case 'v': res += "\v"; break;
2230 case '"': res += '"'; break;
2231 case '\\': res += '\\'; break;
2236 var hexC = port.peekChar();
2237 if (hexC >= '0' && hexC <= '9') {
2239 nb = nb * 16 + hexC.charCodeAt(0) - '0'.charCodeAt(0);
2240 } else if (hexC >= 'a' && hexC <= 'f') {
2242 nb = nb * 16 + hexC.charCodeAt(0) - 'a'.charCodeAt(0);
2243 } else if (hexC >= 'A' && hexC <= 'F') {
2245 nb = nb * 16 + hexC.charCodeAt(0) - 'A'.charCodeAt(0);
2247 // next char isn't part of hex.
2248 res += String.fromCharCode(nb);
2254 if (tmp === SC_EOF_OBJECT) {
2255 return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);
2261 if (c === SC_EOF_OBJECT) {
2262 return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);
2268 function readIdOrNumber(firstChar) {
2269 var res = firstChar;
2270 while (isIdOrNumberChar(port.peekChar()))
2271 res += port.readChar();
2273 return new sc_Token(9/*ID*/, res);
2275 return new sc_Token(12/*NUMBER*/, res - 0);
2278 function skipWhitespaceAndComments() {
2282 while (isWhitespace(port.peekChar()))
2284 if (port.peekChar() === ';') {
2288 curChar = port.readChar();
2289 if (curChar === SC_EOF_OBJECT ||
2297 function readDot() {
2298 if (isWhitespace(port.peekChar()))
2299 return new sc_Token(10/*DOT*/);
2301 return readIdOrNumber(".");
2304 function readSharp() {
2305 var c = port.readChar();
2306 if (isWhitespace(c))
2307 return new sc_Token(13/*ERROR*/, "bad #-pattern0.");
2310 if (isNumberChar(c)) {
2312 while (isNumberChar(port.peekChar()))
2313 nb = nb*10 + (port.readChar() - 0);
2314 switch (port.readChar()) {
2316 return new sc_Token(18/*REFERENCE*/, nb);
2318 return new sc_Token(19/*STORE*/, nb);
2320 return new sc_Token(13/*ERROR*/, "bad #-pattern1." + nb);
2325 return new sc_Token(14/*VECTOR_BEGIN*/);
2327 if (c === "\\") { // character
2329 while (!isWhitespaceOrEOF(port.peekChar()))
2330 tmp += port.readChar();
2331 switch (tmp.length) {
2332 case 0: // it's escaping a whitespace char:
2333 if (sc_isEOFObject(port.peekChar))
2334 return new sc_Token(13/*ERROR*/, "bad #-pattern2.");
2336 return new sc_Token(20/*CHAR*/, port.readChar());
2338 return new sc_Token(20/*CHAR*/, tmp);
2340 var entry = sc_Char.readable2char[tmp.toLowerCase()];
2342 return new sc_Token(20/*CHAR*/, entry);
2344 return new sc_Token(13/*ERROR*/, "unknown character description: #\\" + tmp);
2348 // some constants (#t, #f, #unspecified)
2352 case 't': res = new sc_Token(15/*TRUE*/, true); needing = ""; break;
2353 case 'f': res = new sc_Token(16/*FALSE*/, false); needing = ""; break;
2354 case 'u': res = new sc_Token(17/*UNSPECIFIED*/, undefined); needing = "nspecified"; break;
2356 return new sc_Token(13/*ERROR*/, "bad #-pattern3: " + c);
2359 c = port.peekChar();
2360 if ((isWhitespaceOrEOF(c) || c === ')') &&
2363 else if (isWhitespace(c) || needing == "")
2364 return new sc_Token(13/*ERROR*/, "bad #-pattern4 " + c + " " + needing);
2365 else if (needing.charAt(0) == c) {
2366 port.readChar(); // consume
2367 needing = needing.slice(1);
2369 return new sc_Token(13/*ERROR*/, "bad #-pattern5");
2374 skipWhitespaceAndComments();
2375 var curChar = port.readChar();
2376 if (curChar === SC_EOF_OBJECT)
2377 return new sc_Token(0/*EOF*/, curChar);
2383 return readWhitespace();
2385 return new sc_Token(1/*OPEN_PAR*/);
2387 return new sc_Token(2/*CLOSE_PAR*/);
2389 return new sc_Token(3/*OPEN_BRACE*/);
2391 return new sc_Token(4/*CLOSE_BRACE*/);
2393 return new sc_Token(5/*OPEN_BRACKET*/);
2395 return new sc_Token(6/*CLOSE_BRACKET*/);
2397 return new sc_Token(8/*QUOTE*/);
2403 return readString();
2405 if (isIdOrNumberChar(curChar))
2406 return readIdOrNumber(curChar);
2407 throw "unexpected character: " + curChar;
2411 function sc_Reader(tokenizer) {
2412 this.tokenizer = tokenizer;
2413 this.backref = new Array();
2415 sc_Reader.prototype.read = function() {
2416 function readList(listBeginType) {
2417 function matchesPeer(open, close) {
2418 return open === 1/*OPEN_PAR*/ && close === 2/*CLOSE_PAR*/
2419 || open === 3/*OPEN_BRACE*/ && close === 4/*CLOSE_BRACE*/
2420 || open === 5/*OPEN_BRACKET*/ && close === 6/*CLOSE_BRACKET*/;
2425 var token = tokenizer.peekToken();
2427 switch (token.type) {
2428 case 2/*CLOSE_PAR*/:
2429 case 4/*CLOSE_BRACE*/:
2430 case 6/*CLOSE_BRACKET*/:
2431 if (matchesPeer(listBeginType, token.type)) {
2432 tokenizer.readToken(); // consume token
2433 return sc_reverseBang(res);
2435 throw "closing par doesn't match: " + listBeginType
2436 + " " + listEndType;
2439 throw "unexpected end of file";
2442 tokenizer.readToken(); // consume token
2443 var cdr = this.read();
2444 var par = tokenizer.readToken();
2445 if (!matchesPeer(listBeginType, par.type))
2446 throw "closing par doesn't match: " + listBeginType
2449 return sc_reverseAppendBang(res, cdr);
2453 res = sc_cons(this.read(), res);
2457 function readQuote() {
2458 return sc_cons("quote", sc_cons(this.read(), null));
2460 function readVector() {
2461 // opening-parenthesis is already consumed
2462 var a = new Array();
2464 var token = tokenizer.peekToken();
2465 switch (token.type) {
2466 case 2/*CLOSE_PAR*/:
2467 tokenizer.readToken();
2471 a.push(this.read());
2476 function storeRefence(nb) {
2477 var tmp = this.read();
2478 this.backref[nb] = tmp;
2482 function readReference(nb) {
2483 if (nb in this.backref)
2484 return this.backref[nb];
2486 throw "bad reference: " + nb;
2489 var tokenizer = this.tokenizer;
2491 var token = tokenizer.readToken();
2494 if (token.type === 13/*ERROR*/)
2497 switch (token.type) {
2499 case 3/*OPEN_BRACE*/:
2500 case 5/*OPEN_BRACKET*/:
2501 return readList.call(this, token.type);
2503 return readQuote.call(this);
2505 return sc_jsstring2string(token.val);
2507 return new sc_Char(token.val);
2508 case 14/*VECTOR_BEGIN*/:
2509 return readVector.call(this);
2510 case 18/*REFERENCE*/:
2511 return readReference.call(this, token.val);
2513 return storeRefence.call(this, token.val);
2515 return sc_jsstring2symbol(token.val);
2520 case 17/*UNSPECIFIED*/:
2523 throw "unexpected token " + token.type + " " + token.val;
2527 /*** META ((export #t)) */
2528 function sc_read(port) {
2529 if (port === undefined) // we assume the port hasn't been given.
2530 port = SC_DEFAULT_IN; // THREAD: shared var...
2531 var reader = new sc_Reader(new sc_Tokenizer(port));
2532 return reader.read();
2534 /*** META ((export #t)) */
2535 function sc_readChar(port) {
2536 if (port === undefined) // we assume the port hasn't been given.
2537 port = SC_DEFAULT_IN; // THREAD: shared var...
2538 var t = port.readChar();
2539 return t === SC_EOF_OBJECT? t: new sc_Char(t);
2541 /*** META ((export #t)) */
2542 function sc_peekChar(port) {
2543 if (port === undefined) // we assume the port hasn't been given.
2544 port = SC_DEFAULT_IN; // THREAD: shared var...
2545 var t = port.peekChar();
2546 return t === SC_EOF_OBJECT? t: new sc_Char(t);
2548 /*** META ((export #t)
2551 function sc_isCharReady(port) {
2552 if (port === undefined) // we assume the port hasn't been given.
2553 port = SC_DEFAULT_IN; // THREAD: shared var...
2554 return port.isCharReady();
2556 /*** META ((export #t)
2557 (peephole (postfix ".close()")))
2559 function sc_closeInputPort(p) {
2563 /*** META ((export #t)
2565 (peephole (postfix " instanceof sc_InputPort")))
2567 function sc_isInputPort(o) {
2568 return (o instanceof sc_InputPort);
2571 /*** META ((export eof-object?)
2573 (peephole (postfix " === SC_EOF_OBJECT")))
2575 function sc_isEOFObject(o) {
2576 return o === SC_EOF_OBJECT;
2579 /*** META ((export #t)
2580 (peephole (hole 0 "SC_DEFAULT_IN")))
2582 function sc_currentInputPort() {
2583 return SC_DEFAULT_IN;
2586 /* ------------ file operations are not supported -----------*/
2587 /*** META ((export #t)) */
2588 function sc_callWithInputFile(s, proc) {
2589 throw "can't open " + s;
2592 /*** META ((export #t)) */
2593 function sc_callWithOutputFile(s, proc) {
2594 throw "can't open " + s;
2597 /*** META ((export #t)) */
2598 function sc_withInputFromFile(s, thunk) {
2599 throw "can't open " + s;
2602 /*** META ((export #t)) */
2603 function sc_withOutputToFile(s, thunk) {
2604 throw "can't open " + s;
2607 /*** META ((export #t)) */
2608 function sc_openInputFile(s) {
2609 throw "can't open " + s;
2612 /*** META ((export #t)) */
2613 function sc_openOutputFile(s) {
2614 throw "can't open " + s;
2617 /* ----------------------------------------------------------------------------*/
2618 /*** META ((export #t)) */
2619 function sc_basename(p) {
2620 var i = p.lastIndexOf('/');
2623 return p.substring(i + 1, p.length);
2628 /*** META ((export #t)) */
2629 function sc_dirname(p) {
2630 var i = p.lastIndexOf('/');
2633 return p.substring(0, i);
2638 /* ----------------------------------------------------------------------------*/
2640 /*** META ((export #t)) */
2641 function sc_withInputFromPort(p, thunk) {
2643 var tmp = SC_DEFAULT_IN; // THREAD: shared var.
2647 SC_DEFAULT_IN = tmp;
2651 /*** META ((export #t)) */
2652 function sc_withInputFromString(s, thunk) {
2653 return sc_withInputFromPort(new sc_StringInputPort(sc_string2jsstring(s)), thunk);
2656 /*** META ((export #t)) */
2657 function sc_withOutputToPort(p, thunk) {
2659 var tmp = SC_DEFAULT_OUT; // THREAD: shared var.
2663 SC_DEFAULT_OUT = tmp;
2667 /*** META ((export #t)) */
2668 function sc_withOutputToString(thunk) {
2669 var p = new sc_StringOutputPort();
2670 sc_withOutputToPort(p, thunk);
2674 /*** META ((export #t)) */
2675 function sc_withOutputToProcedure(proc, thunk) {
2676 var t = function(s) { proc(sc_jsstring2string(s)); };
2677 return sc_withOutputToPort(new sc_GenericOutputPort(t), thunk);
2680 /*** META ((export #t)
2681 (peephole (hole 0 "new sc_StringOutputPort()")))
2683 function sc_openOutputString() {
2684 return new sc_StringOutputPort();
2687 /*** META ((export #t)) */
2688 function sc_openInputString(str) {
2689 return new sc_StringInputPort(sc_string2jsstring(str));
2692 /* ----------------------------------------------------------------------------*/
2694 function sc_OutputPort() {
2696 sc_OutputPort.prototype = new sc_Port();
2697 sc_OutputPort.prototype.appendJSString = function(obj) {
2700 sc_OutputPort.prototype.close = function() {
2704 function sc_StringOutputPort() {
2707 sc_StringOutputPort.prototype = new sc_OutputPort();
2708 sc_StringOutputPort.prototype.appendJSString = function(s) {
2711 sc_StringOutputPort.prototype.close = function() {
2712 return sc_jsstring2string(this.res);
2715 /*** META ((export #t)) */
2716 function sc_getOutputString(sp) {
2717 return sc_jsstring2string(sp.res);
2721 function sc_ErrorOutputPort() {
2723 sc_ErrorOutputPort.prototype = new sc_OutputPort();
2724 sc_ErrorOutputPort.prototype.appendJSString = function(s) {
2725 throw "don't write on ErrorPort!";
2727 sc_ErrorOutputPort.prototype.close = function() {
2731 function sc_GenericOutputPort(appendJSString, close) {
2732 this.appendJSString = appendJSString;
2736 sc_GenericOutputPort.prototype = new sc_OutputPort();
2738 /*** META ((export #t)
2740 (peephole (postfix " instanceof sc_OutputPort")))
2742 function sc_isOutputPort(o) {
2743 return (o instanceof sc_OutputPort);
2746 /*** META ((export #t)
2747 (peephole (postfix ".close()")))
2749 function sc_closeOutputPort(p) {
2753 /* ------------------ write ---------------------------------------------------*/
2755 /*** META ((export #t)) */
2756 function sc_write(o, p) {
2757 if (p === undefined) // we assume not given
2759 p.appendJSString(sc_toWriteString(o));
2762 function sc_toWriteString(o) {
2765 else if (o === true)
2767 else if (o === false)
2769 else if (o === undefined)
2770 return "#unspecified";
2771 else if (typeof o === 'function')
2772 return "#<procedure " + sc_hash(o) + ">";
2773 else if (o.sc_toWriteString)
2774 return o.sc_toWriteString();
2776 return o.toString();
2779 function sc_escapeWriteString(s) {
2782 for (i = 0; i < s.length; i++) {
2783 switch (s.charAt(i)) {
2784 case "\0": res += s.substring(j, i) + "\\0"; j = i + 1; break;
2785 case "\b": res += s.substring(j, i) + "\\b"; j = i + 1; break;
2786 case "\f": res += s.substring(j, i) + "\\f"; j = i + 1; break;
2787 case "\n": res += s.substring(j, i) + "\\n"; j = i + 1; break;
2788 case "\r": res += s.substring(j, i) + "\\r"; j = i + 1; break;
2789 case "\t": res += s.substring(j, i) + "\\t"; j = i + 1; break;
2790 case "\v": res += s.substring(j, i) + "\\v"; j = i + 1; break;
2791 case '"': res += s.substring(j, i) + '\\"'; j = i + 1; break;
2792 case "\\": res += s.substring(j, i) + "\\\\"; j = i + 1; break;
2794 var c = s.charAt(i);
2795 if ("\a" !== "a" && c == "\a") {
2796 res += s.substring(j, i) + "\\a"; j = i + 1; continue;
2798 if ("\v" !== "v" && c == "\v") {
2799 res += s.substring(j, i) + "\\v"; j = i + 1; continue;
2801 //if (s.charAt(i) < ' ' || s.charCodeAt(i) > 127) {
2802 // CARE: Manuel is this OK with HOP?
2803 if (s.charAt(i) < ' ') {
2804 /* non printable character and special chars */
2805 res += s.substring(j, i) + "\\x" + s.charCodeAt(i).toString(16);
2808 // else just let i increase...
2811 res += s.substring(j, i);
2815 /* ------------------ display ---------------------------------------------------*/
2817 /*** META ((export #t)) */
2818 function sc_display(o, p) {
2819 if (p === undefined) // we assume not given
2821 p.appendJSString(sc_toDisplayString(o));
2824 function sc_toDisplayString(o) {
2827 else if (o === true)
2829 else if (o === false)
2831 else if (o === undefined)
2832 return "#unspecified";
2833 else if (typeof o === 'function')
2834 return "#<procedure " + sc_hash(o) + ">";
2835 else if (o.sc_toDisplayString)
2836 return o.sc_toDisplayString();
2838 return o.toString();
2841 /* ------------------ newline ---------------------------------------------------*/
2843 /*** META ((export #t)) */
2844 function sc_newline(p) {
2845 if (p === undefined) // we assume not given
2847 p.appendJSString("\n");
2850 /* ------------------ write-char ---------------------------------------------------*/
2852 /*** META ((export #t)) */
2853 function sc_writeChar(c, p) {
2854 if (p === undefined) // we assume not given
2856 p.appendJSString(c.val);
2859 /* ------------------ write-circle ---------------------------------------------------*/
2861 /*** META ((export #t)) */
2862 function sc_writeCircle(o, p) {
2863 if (p === undefined) // we assume not given
2865 p.appendJSString(sc_toWriteCircleString(o));
2868 function sc_toWriteCircleString(o) {
2869 var symb = sc_gensym("writeCircle");
2870 var nbPointer = new Object();
2872 sc_prepWriteCircle(o, symb, nbPointer);
2873 return sc_genToWriteCircleString(o, symb);
2876 function sc_prepWriteCircle(o, symb, nbPointer) {
2878 if (o instanceof sc_Pair ||
2879 o instanceof sc_Vector) {
2880 if (o[symb] !== undefined) {
2881 // not the first visit.
2883 // unless there is already a number, assign one.
2884 if (!o[symb + "nb"]) o[symb + "nb"] = nbPointer.nb++;
2888 if (o instanceof sc_Pair) {
2889 sc_prepWriteCircle(o.car, symb, nbPointer);
2890 sc_prepWriteCircle(o.cdr, symb, nbPointer);
2892 for (var i = 0; i < o.length; i++)
2893 sc_prepWriteCircle(o[i], symb, nbPointer);
2898 function sc_genToWriteCircleString(o, symb) {
2899 if (!(o instanceof sc_Pair ||
2900 o instanceof sc_Vector))
2901 return sc_toWriteString(o);
2902 return o.sc_toWriteCircleString(symb);
2904 sc_Pair.prototype.sc_toWriteCircleString = function(symb, inList) {
2905 if (this[symb + "use"]) { // use-flag is set. Just use it.
2906 var nb = this[symb + "nb"];
2907 if (this[symb]-- === 0) { // if we are the last use. remove all fields.
2909 delete this[symb + "nb"];
2910 delete this[symb + "use"];
2913 return '. #' + nb + '#';
2915 return '#' + nb + '#';
2917 if (this[symb]-- === 0) { // if we are the last use. remove all fields.
2919 delete this[symb + "nb"];
2920 delete this[symb + "use"];
2925 if (this[symb] !== undefined) { // implies > 0
2926 this[symb + "use"] = true;
2928 res += '. #' + this[symb + "nb"] + '=';
2930 res += '#' + this[symb + "nb"] + '=';
2938 res += sc_genToWriteCircleString(this.car, symb);
2940 if (sc_isPair(this.cdr)) {
2941 res += " " + this.cdr.sc_toWriteCircleString(symb, true);
2942 } else if (this.cdr !== null) {
2943 res += " . " + sc_genToWriteCircleString(this.cdr, symb);
2949 sc_Vector.prototype.sc_toWriteCircleString = function(symb) {
2950 if (this[symb + "use"]) { // use-flag is set. Just use it.
2951 var nb = this[symb + "nb"];
2952 if (this[symb]-- === 0) { // if we are the last use. remove all fields.
2954 delete this[symb + "nb"];
2955 delete this[symb + "use"];
2957 return '#' + nb + '#';
2959 if (this[symb]-- === 0) { // if we are the last use. remove all fields.
2961 delete this[symb + "nb"];
2962 delete this[symb + "use"];
2966 if (this[symb] !== undefined) { // implies > 0
2967 this[symb + "use"] = true;
2968 res += '#' + this[symb + "nb"] + '=';
2971 for (var i = 0; i < this.length; i++) {
2972 res += sc_genToWriteCircleString(this[i], symb);
2973 if (i < this.length - 1) res += " ";
2980 /* ------------------ print ---------------------------------------------------*/
2982 /*** META ((export #t)) */
2983 function sc_print(s) {
2984 if (arguments.length === 1) {
2989 for (var i = 0; i < arguments.length; i++)
2990 sc_display(arguments[i]);
2995 /* ------------------ format ---------------------------------------------------*/
2996 /*** META ((export #t)) */
2997 function sc_format(s, args) {
2999 var p = new sc_StringOutputPort();
3003 var i2 = s.indexOf("~", i);
3006 p.appendJSString( s.substring( i, len ) );
3010 if (i2 == (len - 1)) {
3011 p.appendJSString(s.substring(i, len));
3014 p.appendJSString(s.substring(i, i2));
3019 switch(s.charCodeAt(i2 + 1)) {
3023 sc_display(arguments[j], p);
3030 sc_write(arguments[j], p);
3037 sc_display(arguments[j], p);
3038 p.appendJSString("\n");
3045 p.appendJSString(String.fromCharCode(arguments[j]));
3052 p.appendJSString(arguments[j].toString(6));
3059 p.appendJSString(arguments[j].toString(8));
3066 p.appendJSString(arguments[j].toString(2));
3073 p.appendJSString("\n");
3078 p.appendJSString("\r");
3083 p.appendJSString("~");
3087 sc_error( "format: illegal ~"
3088 + String.fromCharCode(s.charCodeAt(i2 + 1))
3098 /* ------------------ global ports ---------------------------------------------------*/
3100 var SC_DEFAULT_IN = new sc_ErrorInputPort();
3101 var SC_DEFAULT_OUT = new sc_ErrorOutputPort();
3102 var SC_ERROR_OUT = new sc_ErrorOutputPort();
3104 var sc_SYMBOL_PREFIX = "\u1E9C";
3105 var sc_KEYWORD_PREFIX = "\u1E9D";
3107 /*** META ((export #t)
3109 function sc_jsstring2string(s) {
3113 /*** META ((export #t)
3114 (peephole (prefix "'\\u1E9C' +")))
3116 function sc_jsstring2symbol(s) {
3117 return sc_SYMBOL_PREFIX + s;
3120 /*** META ((export #t)
3123 function sc_string2jsstring(s) {
3127 /*** META ((export #t)
3128 (peephole (symbol2jsstring_immutable)))
3130 function sc_symbol2jsstring(s) {
3134 /*** META ((export #t)
3135 (peephole (postfix ".slice(1)")))
3137 function sc_keyword2jsstring(k) {
3141 /*** META ((export #t)
3142 (peephole (prefix "'\\u1E9D' +")))
3144 function sc_jsstring2keyword(s) {
3145 return sc_KEYWORD_PREFIX + s;
3148 /*** META ((export #t)
3151 function sc_isKeyword(s) {
3152 return (typeof s === "string") &&
3153 (s.charAt(0) === sc_KEYWORD_PREFIX);
3157 /*** META ((export #t)) */
3158 var sc_gensym = function() {
3160 return function(sym) {
3162 if (!sym) sym = sc_SYMBOL_PREFIX;
3163 return sym + "s" + counter + "~" + "^sC-GeNsYm ";
3168 /*** META ((export #t)
3171 function sc_isEqual(o1, o2) {
3172 return ((o1 === o2) ||
3173 (sc_isPair(o1) && sc_isPair(o2)
3174 && sc_isPairEqual(o1, o2, sc_isEqual)) ||
3175 (sc_isVector(o1) && sc_isVector(o2)
3176 && sc_isVectorEqual(o1, o2, sc_isEqual)));
3179 /*** META ((export number->symbol integer->symbol)) */
3180 function sc_number2symbol(x, radix) {
3181 return sc_SYMBOL_PREFIX + sc_number2jsstring(x, radix);
3184 /*** META ((export number->string integer->string)) */
3185 var sc_number2string = sc_number2jsstring;
3187 /*** META ((export #t)) */
3188 function sc_symbol2number(s, radix) {
3189 return sc_jsstring2number(s.slice(1), radix);
3192 /*** META ((export #t)) */
3193 var sc_string2number = sc_jsstring2number;
3195 /*** META ((export #t)
3196 (peephole (prefix "+" s)))
3197 ;; peephole will only apply if no radix is given.
3199 function sc_string2integer(s, radix) {
3200 if (!radix) return +s;
3201 return parseInt(s, radix);
3204 /*** META ((export #t)
3205 (peephole (prefix "+")))
3207 function sc_string2real(s) {
3212 /*** META ((export #t)
3215 function sc_isSymbol(s) {
3216 return (typeof s === "string") &&
3217 (s.charAt(0) === sc_SYMBOL_PREFIX);
3220 /*** META ((export #t)
3221 (peephole (symbol2string_immutable)))
3223 function sc_symbol2string(s) {
3227 /*** META ((export #t)
3228 (peephole (prefix "'\\u1E9C' +")))
3230 function sc_string2symbol(s) {
3231 return sc_SYMBOL_PREFIX + s;
3234 /*** META ((export symbol-append)
3235 (peephole (symbolAppend_immutable)))
3237 function sc_symbolAppend() {
3238 var res = sc_SYMBOL_PREFIX;
3239 for (var i = 0; i < arguments.length; i++)
3240 res += arguments[i].slice(1);
3244 /*** META ((export #t)
3245 (peephole (postfix ".val")))
3247 function sc_char2string(c) { return c.val; }
3249 /*** META ((export #t)
3250 (peephole (hole 1 "'\\u1E9C' + " c ".val")))
3252 function sc_char2symbol(c) { return sc_SYMBOL_PREFIX + c.val; }
3254 /*** META ((export #t)
3257 function sc_isString(s) {
3258 return (typeof s === "string") &&
3259 (s.charAt(0) !== sc_SYMBOL_PREFIX);
3262 /*** META ((export #t)) */
3263 var sc_makeString = sc_makejsString;
3266 /*** META ((export #t)) */
3267 function sc_string() {
3268 for (var i = 0; i < arguments.length; i++)
3269 arguments[i] = arguments[i].val;
3270 return "".concat.apply("", arguments);
3273 /*** META ((export #t)
3274 (peephole (postfix ".length")))
3276 function sc_stringLength(s) { return s.length; }
3278 /*** META ((export #t)) */
3279 function sc_stringRef(s, k) {
3280 return new sc_Char(s.charAt(k));
3283 /* there's no stringSet in the immutable version
3284 function sc_stringSet(s, k, c)
3288 /*** META ((export string=?)
3290 (peephole (hole 2 str1 " === " str2)))
3292 function sc_isStringEqual(s1, s2) {
3295 /*** META ((export string<?)
3297 (peephole (hole 2 str1 " < " str2)))
3299 function sc_isStringLess(s1, s2) {
3302 /*** META ((export string>?)
3304 (peephole (hole 2 str1 " > " str2)))
3306 function sc_isStringGreater(s1, s2) {
3309 /*** META ((export string<=?)
3311 (peephole (hole 2 str1 " <= " str2)))
3313 function sc_isStringLessEqual(s1, s2) {
3316 /*** META ((export string>=?)
3318 (peephole (hole 2 str1 " >= " str2)))
3320 function sc_isStringGreaterEqual(s1, s2) {
3323 /*** META ((export string-ci=?)
3325 (peephole (hole 2 str1 ".toLowerCase() === " str2 ".toLowerCase()")))
3327 function sc_isStringCIEqual(s1, s2) {
3328 return s1.toLowerCase() === s2.toLowerCase();
3330 /*** META ((export string-ci<?)
3332 (peephole (hole 2 str1 ".toLowerCase() < " str2 ".toLowerCase()")))
3334 function sc_isStringCILess(s1, s2) {
3335 return s1.toLowerCase() < s2.toLowerCase();
3337 /*** META ((export string-ci>?)
3339 (peephole (hole 2 str1 ".toLowerCase() > " str2 ".toLowerCase()")))
3341 function sc_isStringCIGreater(s1, s2) {
3342 return s1.toLowerCase() > s2.toLowerCase();
3344 /*** META ((export string-ci<=?)
3346 (peephole (hole 2 str1 ".toLowerCase() <= " str2 ".toLowerCase()")))
3348 function sc_isStringCILessEqual(s1, s2) {
3349 return s1.toLowerCase() <= s2.toLowerCase();
3351 /*** META ((export string-ci>=?)
3353 (peephole (hole 2 str1 ".toLowerCase() >= " str2 ".toLowerCase()")))
3355 function sc_isStringCIGreaterEqual(s1, s2) {
3356 return s1.toLowerCase() >= s2.toLowerCase();
3359 /*** META ((export #t)
3360 (peephole (hole 3 s ".substring(" start ", " end ")")))
3362 function sc_substring(s, start, end) {
3363 return s.substring(start, end);
3366 /*** META ((export #t))
3368 function sc_isSubstring_at(s1, s2, i) {
3369 return s2 == s1.substring(i, i+ s2.length);
3372 /*** META ((export #t)
3373 (peephole (infix 0 #f "+" "''")))
3375 function sc_stringAppend() {
3376 return "".concat.apply("", arguments);
3379 /*** META ((export #t)) */
3380 var sc_string2list = sc_jsstring2list;
3382 /*** META ((export #t)) */
3383 var sc_list2string = sc_list2jsstring;
3385 /*** META ((export #t)
3388 function sc_stringCopy(s) {
3392 /* there's no string-fill in the immutable version
3393 function sc_stringFill(s, c)
3396 /*** META ((export #t)
3397 (peephole (postfix ".slice(1)")))
3399 function sc_keyword2string(o) {
3403 /*** META ((export #t)
3404 (peephole (prefix "'\\u1E9D' +")))
3406 function sc_string2keyword(o) {
3407 return sc_KEYWORD_PREFIX + o;
3410 String.prototype.sc_toDisplayString = function() {
3411 if (this.charAt(0) === sc_SYMBOL_PREFIX)
3412 // TODO: care for symbols with spaces (escape-chars symbols).
3413 return this.slice(1);
3414 else if (this.charAt(0) === sc_KEYWORD_PREFIX)
3415 return ":" + this.slice(1);
3417 return this.toString();
3420 String.prototype.sc_toWriteString = function() {
3421 if (this.charAt(0) === sc_SYMBOL_PREFIX)
3422 // TODO: care for symbols with spaces (escape-chars symbols).
3423 return this.slice(1);
3424 else if (this.charAt(0) === sc_KEYWORD_PREFIX)
3425 return ":" + this.slice(1);
3427 return '"' + sc_escapeWriteString(this) + '"';
3429 /* Exported Variables */
3430 var BgL_testzd2boyerzd2;
3431 var BgL_nboyerzd2benchmarkzd2;
3432 var BgL_setupzd2boyerzd2;
3435 var translate_term_nboyer;
3436 var translate_args_nboyer;
3437 var untranslate_term_nboyer;
3438 var BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer;
3439 var BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer;
3440 var translate_alist_nboyer;
3441 var apply_subst_nboyer;
3442 var apply_subst_lst_nboyer;
3443 var tautologyp_nboyer;
3444 var if_constructor_nboyer;
3445 var rewrite_count_nboyer;
3447 var rewrite_args_nboyer;
3448 var unify_subst_nboyer;
3449 var one_way_unify1_nboyer;
3450 var false_term_nboyer;
3451 var true_term_nboyer;
3452 var trans_of_implies1_nboyer;
3453 var is_term_equal_nboyer;
3454 var is_term_member_nboyer;
3456 var sc_const_3_nboyer;
3457 var sc_const_4_nboyer;
3459 (sc_const_4_nboyer = (new sc_Pair("\u1E9Cimplies",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cu",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cu",(new sc_Pair("\u1E9Cw",null)))))),null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cw",null)))))),null)))))));
3460 (sc_const_3_nboyer = sc_list((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccompile",(new sc_Pair("\u1E9Cform",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Ccodegen",(new sc_Pair((new sc_Pair("\u1E9Coptimize",(new sc_Pair("\u1E9Cform",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ceqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreaterp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clesseqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatereqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cboolean",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ciff",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ceven1",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Codd",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccountps-",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cpred",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccountps-loop",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cpred",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfact-",(new sc_Pair("\u1E9Ci",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfact-loop",(new sc_Pair("\u1E9Ci",(new sc_Pair((1),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdivides",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassume-true",(new sc_Pair("\u1E9Cvar",(new sc_Pair("\u1E9Calist",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cvar",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))),(new sc_Pair("\u1E9Calist",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassume-false",(new sc_Pair("\u1E9Cvar",(new sc_Pair("\u1E9Calist",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cvar",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))),(new sc_Pair("\u1E9Calist",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctautology-checker",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ctautologyp",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfalsify",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfalsify1",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cprime",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))),null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cprime1",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cx",null)))),null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair("\u1E9Cp",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))))),(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cb",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cc",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cplus-fringe",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Ca",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cpds",(new sc_Pair("\u1E9Cenvrn",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cpds",(new sc_Pair("\u1E9Cenvrn",null)))))))),(new sc_Pair("\u1E9Cenvrn",null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmc-flatten",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cb",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Cintersect",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ck",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Ck",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ck",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair("\u1E9Ck",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Csort-lp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus1",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair("\u1E9Ci",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cbase",null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ci",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cj",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cj",(new sc_Pair((1),null)))))),null)))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Ci",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus",(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Cbase",null)))))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Ca",null)))),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cw",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Cx",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cz",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cvalue",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cvalue",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnlistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csamefringe",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((1),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((1),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cz",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cw",(new sc_Pair((1),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatereqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((1),null)))))),(new sc_Pair(sc_list("\u1E9Cand", (new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))), (new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))), (new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Ca",null)))), (new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cb",null)))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cl",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair("\u1E9Cl",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdsort",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx1",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx2",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx3",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx4",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx5",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx6",(new sc_Pair("\u1E9Cx7",null)))))),null)))))),null)))))),null)))))),null)))))),null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((6),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cx7",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((2),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((2),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Cy",(new sc_Pair((2),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csigma",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Ci",null)))),null)))))),(new sc_Pair((2),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cz",null)))),null)))))),null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ci",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair("\u1E9Ca",null)))),null)))),(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair("\u1E9Cb",null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),(new sc_Pair("\u1E9Cz",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cassignedp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cb",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair((new sc_Pair("\u1E9Ccdr",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccdr",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cget",(new sc_Pair("\u1E9Cj",(new sc_Pair((new sc_Pair("\u1E9Cset",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cval",(new sc_Pair("\u1E9Cmem",null)))))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Ceqp",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair("\u1E9Cval",(new sc_Pair((new sc_Pair("\u1E9Cget",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Cmem",null)))))),null)))))))),null))))))));
3461 (const_nboyer = (new sc_Pair((new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cc",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cd",null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cu",(new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cb",null)))),null)))))),null)))))))),null)))))))))));
3462 BgL_nboyerzd2benchmarkzd2 = function() {
3464 for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {
3465 args = sc_cons(arguments[sc_tmp], args);
3468 return ((n = ((args === null)?(0):(args.car))), (BgL_setupzd2boyerzd2()), (BgL_runzd2benchmarkzd2(("nboyer"+(sc_number2string(n))), (1), function() {
3469 return (BgL_testzd2boyerzd2(n));
3470 }, function(rewrites) {
3471 if ((sc_isNumber(rewrites)))
3474 return (rewrites===(95024));
3477 return (rewrites===(591777));
3480 return (rewrites===(1813975));
3483 return (rewrites===(5375678));
3486 return (rewrites===(16445406));
3489 return (rewrites===(51507739));
3499 BgL_setupzd2boyerzd2 = function() {
3502 BgL_testzd2boyerzd2 = function() {
3505 translate_term_nboyer = function(term) {
3507 return (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), ((lst = (term.cdr)), ((lst === null)?null:(new sc_Pair((translate_term_nboyer((lst.car))), (translate_args_nboyer((lst.cdr))))))))));
3509 translate_args_nboyer = function(lst) {
3512 return ((lst === null)?null:(new sc_Pair(((term = (lst.car)), (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr))))))), ((sc_lst_5 = (lst.cdr)), ((sc_lst_5 === null)?null:(new sc_Pair((translate_term_nboyer((sc_lst_5.car))), (translate_args_nboyer((sc_lst_5.cdr))))))))));
3514 untranslate_term_nboyer = function(term) {
3520 if (!(term instanceof sc_Pair))
3524 (falseHead1130 = (new sc_Pair(null, null)));
3525 (L1127 = (term.cdr));
3526 (tail1131 = falseHead1130);
3527 while (!(L1127 === null)) {
3529 (tail1131.cdr = (new sc_Pair((untranslate_term_nboyer((L1127.car))), null)));
3530 (tail1131 = (tail1131.cdr));
3531 (L1127 = (L1127.cdr));
3534 (optrOpnd = (falseHead1130.cdr));
3535 return (new sc_Pair(((symbol_record = (term.car)), (symbol_record[(0)])), optrOpnd));
3538 BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer = function(sym) {
3541 return ((x = (sc_assq(sym, BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer))), ((x!== false)?(x.cdr):((r = [sym, null]), (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = (new sc_Pair((new sc_Pair(sym, r)), BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer))), r)));
3543 (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);
3544 translate_alist_nboyer = function(alist) {
3547 return ((alist === null)?null:(new sc_Pair((new sc_Pair((alist.car.car), ((term = (alist.car.cdr)), (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr))))))))), ((sc_alist_6 = (alist.cdr)), ((sc_alist_6 === null)?null:(new sc_Pair((new sc_Pair((sc_alist_6.car.car), (translate_term_nboyer((sc_alist_6.car.cdr))))), (translate_alist_nboyer((sc_alist_6.cdr))))))))));
3549 apply_subst_nboyer = function(alist, term) {
3552 return (!(term instanceof sc_Pair)?((temp_temp = (sc_assq(term, alist))), ((temp_temp!== false)?(temp_temp.cdr):term)):(new sc_Pair((term.car), ((lst = (term.cdr)), ((lst === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (lst.car))), (apply_subst_lst_nboyer(alist, (lst.cdr))))))))));
3554 apply_subst_lst_nboyer = function(alist, lst) {
3556 return ((lst === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (lst.car))), ((sc_lst_7 = (lst.cdr)), ((sc_lst_7 === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (sc_lst_7.car))), (apply_subst_lst_nboyer(alist, (sc_lst_7.cdr))))))))));
3558 tautologyp_nboyer = function(sc_x_11, true_lst, false_lst) {
3569 if ((((sc_tmp1126_10 = (is_term_equal_nboyer(sc_x_11, true_term_nboyer))), ((sc_tmp1126_10!== false)?sc_tmp1126_10:(is_term_member_nboyer(sc_x_11, true_lst))))!== false))
3572 if ((((sc_tmp1125_9 = (is_term_equal_nboyer(sc_x_11, false_term_nboyer))), ((sc_tmp1125_9!== false)?sc_tmp1125_9:(is_term_member_nboyer(sc_x_11, false_lst))))!== false))
3575 if (!(sc_x_11 instanceof sc_Pair))
3578 if (((sc_x_11.car)===if_constructor_nboyer))
3579 if ((((sc_x_8 = (sc_x_11.cdr.car)), (tmp1126 = (is_term_equal_nboyer(sc_x_8, true_term_nboyer))), ((tmp1126!== false)?tmp1126:(is_term_member_nboyer(sc_x_8, true_lst))))!== false))
3580 (sc_x_11 = (sc_x_11.cdr.cdr.car));
3582 if ((((x = (sc_x_11.cdr.car)), (tmp1125 = (is_term_equal_nboyer(x, false_term_nboyer))), ((tmp1125!== false)?tmp1125:(is_term_member_nboyer(x, false_lst))))!== false))
3583 (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));
3585 if (((tautologyp_nboyer((sc_x_11.cdr.cdr.car), (new sc_Pair((sc_x_11.cdr.car), true_lst)), false_lst))!== false))
3587 (false_lst = (new sc_Pair((sc_x_11.cdr.car), false_lst)));
3588 (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));
3596 (if_constructor_nboyer = "\u1E9C*");
3597 (rewrite_count_nboyer = (0));
3598 rewrite_nboyer = function(term) {
3605 (++rewrite_count_nboyer);
3606 if (!(term instanceof sc_Pair))
3610 (sc_term_12 = (new sc_Pair((term.car), ((sc_lst_13 = (term.cdr)), ((sc_lst_13 === null)?null:(new sc_Pair((rewrite_nboyer((sc_lst_13.car))), (rewrite_args_nboyer((sc_lst_13.cdr))))))))));
3611 (lst = ((symbol_record = (term.car)), (symbol_record[(1)])));
3616 if ((((term2 = ((lst.car).cdr.car)), (unify_subst_nboyer = null), (one_way_unify1_nboyer(sc_term_12, term2)))!== false))
3617 return (rewrite_nboyer((apply_subst_nboyer(unify_subst_nboyer, ((lst.car).cdr.cdr.car)))));
3624 rewrite_args_nboyer = function(lst) {
3626 return ((lst === null)?null:(new sc_Pair((rewrite_nboyer((lst.car))), ((sc_lst_14 = (lst.cdr)), ((sc_lst_14 === null)?null:(new sc_Pair((rewrite_nboyer((sc_lst_14.car))), (rewrite_args_nboyer((sc_lst_14.cdr))))))))));
3628 (unify_subst_nboyer = "\u1E9C*");
3629 one_way_unify1_nboyer = function(term1, term2) {
3633 if (!(term2 instanceof sc_Pair))
3635 (temp_temp = (sc_assq(term2, unify_subst_nboyer)));
3636 if ((temp_temp!== false))
3637 return (is_term_equal_nboyer(term1, (temp_temp.cdr)));