How to use sc method in wpt

Best JavaScript code snippet using wpt

earley-boyer.js

Source:earley-boyer.js Github

copy

Full Screen

1// This file is automatically generated by scheme2js, except for the2// benchmark harness code at the beginning and end of the file.3var EarleyBoyer = new BenchmarkSuite('EarleyBoyer', 666463, [4 new Benchmark("Earley", function () { BgL_earleyzd2benchmarkzd2(); }),5 new Benchmark("Boyer", function () { BgL_nboyerzd2benchmarkzd2(); })6]);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 *************/12/************* GENERATED FILE - DO NOT EDIT *************/13/************* GENERATED FILE - DO NOT EDIT *************/14/************* GENERATED FILE - DO NOT EDIT *************/15/*16 * To use write/prints/... the default-output port has to be set first.17 * Simply setting SC_DEFAULT_OUT and SC_ERROR_OUT to the desired values18 * should do the trick.19 * In the following example the std-out and error-port are redirected to20 * a DIV.21function initRuntime() {22 function escapeHTML(s) {23 var tmp = s;24 tmp = tmp.replace(/&/g, "&amp;");25 tmp = tmp.replace(/</g, "&lt;");26 tmp = tmp.replace(/>/g, "&gt;");27 tmp = tmp.replace(/ /g, "&nbsp;");28 tmp = tmp.replace(/\n/g, "<br />");29 tmp = tmp.replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp");30 return tmp;31 32 }33 document.write("<div id='stdout'></div>");34 SC_DEFAULT_OUT = new sc_GenericOutputPort(35 function(s) {36 var stdout = document.getElementById('stdout');37 stdout.innerHTML = stdout.innerHTML + escapeHTML(s);38 });39 SC_ERROR_OUT = SC_DEFAULT_OUT;40}41*/42function sc_print_debug() {43 sc_print.apply(null, arguments);44}45/*** META ((export *js*)) */46var sc_JS_GLOBALS = this;47var __sc_LINE=-1;48var __sc_FILE="";49/*** META ((export #t)) */50function sc_alert() {51 var len = arguments.length;52 var s = "";53 var i;54 for( i = 0; i < len; i++ ) {55 s += sc_toDisplayString(arguments[ i ]);56 }57 return alert( s );58}59/*** META ((export #t)) */60function sc_typeof( x ) {61 return typeof x;62}63/*** META ((export #t)) */64function sc_error() {65 var a = [sc_jsstring2symbol("*error*")];66 for (var i = 0; i < arguments.length; i++) {67 a[i+1] = arguments[i];68 }69 throw a;70}71/*** META ((export #t)72 (peephole (prefix "throw ")))73*/74function sc_raise(obj) {75 throw obj;76}77/*** META ((export with-handler-lambda)) */78function sc_withHandlerLambda(handler, body) {79 try {80 return body();81 } catch(e) {82 if (!e._internalException)83 return handler(e);84 else85 throw e;86 }87}88var sc_properties = new Object();89/*** META ((export #t)) */90function sc_putpropBang(sym, key, val) {91 var ht = sc_properties[sym];92 if (!ht) {93 ht = new Object();94 sc_properties[sym] = ht;95 }96 ht[key] = val;97}98/*** META ((export #t)) */99function sc_getprop(sym, key) {100 var ht = sc_properties[sym];101 if (ht) {102 if (key in ht)103 return ht[key];104 else105 return false;106 } else107 return false;108}109/*** META ((export #t)) */110function sc_rempropBang(sym, key) {111 var ht = sc_properties[sym];112 if (ht)113 delete ht[key];114}115/*** META ((export #t)) */116function sc_any2String(o) {117 return jsstring2string(sc_toDisplayString(o));118} 119/*** META ((export #t)120 (peephole (infix 2 2 "==="))121 (type bool))122*/123function sc_isEqv(o1, o2) {124 return (o1 === o2);125}126/*** META ((export #t)127 (peephole (infix 2 2 "==="))128 (type bool))129*/130function sc_isEq(o1, o2) {131 return (o1 === o2);132}133/*** META ((export #t)134 (type bool))135*/136function sc_isNumber(n) {137 return (typeof n === "number");138}139/*** META ((export #t)140 (type bool))141*/142function sc_isComplex(n) {143 return sc_isNumber(n);144}145/*** META ((export #t)146 (type bool))147*/148function sc_isReal(n) {149 return sc_isNumber(n);150}151/*** META ((export #t)152 (type bool))153*/154function sc_isRational(n) {155 return sc_isReal(n);156}157/*** META ((export #t)158 (type bool))159*/160function sc_isInteger(n) {161 return (parseInt(n) === n);162}163/*** META ((export #t)164 (type bool)165 (peephole (postfix ", false")))166*/167// we don't have exact numbers...168function sc_isExact(n) {169 return false;170}171/*** META ((export #t)172 (peephole (postfix ", true"))173 (type bool))174*/175function sc_isInexact(n) {176 return true;177}178/*** META ((export = =fx =fl)179 (type bool)180 (peephole (infix 2 2 "===")))181*/182function sc_equal(x) {183 for (var i = 1; i < arguments.length; i++)184 if (x !== arguments[i])185 return false;186 return true;187}188/*** META ((export < <fx <fl)189 (type bool)190 (peephole (infix 2 2 "<")))191*/192function sc_less(x) {193 for (var i = 1; i < arguments.length; i++) {194 if (x >= arguments[i])195 return false;196 x = arguments[i];197 }198 return true;199}200/*** META ((export > >fx >fl)201 (type bool)202 (peephole (infix 2 2 ">")))203*/204function sc_greater(x, y) {205 for (var i = 1; i < arguments.length; i++) {206 if (x <= arguments[i])207 return false;208 x = arguments[i];209 }210 return true;211}212/*** META ((export <= <=fx <=fl)213 (type bool)214 (peephole (infix 2 2 "<=")))215*/216function sc_lessEqual(x, y) {217 for (var i = 1; i < arguments.length; i++) {218 if (x > arguments[i])219 return false;220 x = arguments[i];221 }222 return true;223}224/*** META ((export >= >=fl >=fx)225 (type bool)226 (peephole (infix 2 2 ">=")))227*/228function sc_greaterEqual(x, y) {229 for (var i = 1; i < arguments.length; i++) {230 if (x < arguments[i])231 return false;232 x = arguments[i];233 }234 return true;235}236/*** META ((export #t)237 (type bool)238 (peephole (postfix "=== 0")))239*/240function sc_isZero(x) {241 return (x === 0);242}243/*** META ((export #t)244 (type bool)245 (peephole (postfix "> 0")))246*/247function sc_isPositive(x) {248 return (x > 0);249}250/*** META ((export #t)251 (type bool)252 (peephole (postfix "< 0")))253*/254function sc_isNegative(x) {255 return (x < 0);256}257/*** META ((export #t)258 (type bool)259 (peephole (postfix "%2===1")))260*/261function sc_isOdd(x) {262 return (x % 2 === 1);263}264/*** META ((export #t)265 (type bool)266 (peephole (postfix "%2===0")))267*/268function sc_isEven(x) {269 return (x % 2 === 0);270}271/*** META ((export #t)) */272var sc_max = Math.max;273/*** META ((export #t)) */274var sc_min = Math.min;275/*** META ((export + +fx +fl)276 (peephole (infix 0 #f "+" "0")))277*/278function sc_plus() {279 var sum = 0;280 for (var i = 0; i < arguments.length; i++)281 sum += arguments[i];282 return sum;283}284/*** META ((export * *fx *fl)285 (peephole (infix 0 #f "*" "1")))286*/287function sc_multi() {288 var product = 1;289 for (var i = 0; i < arguments.length; i++)290 product *= arguments[i];291 return product;292}293/*** META ((export - -fx -fl)294 (peephole (minus)))295*/296function sc_minus(x) {297 if (arguments.length === 1)298 return -x;299 else {300 var res = x;301 for (var i = 1; i < arguments.length; i++)302 res -= arguments[i];303 return res;304 }305}306/*** META ((export / /fl)307 (peephole (div)))308*/309function sc_div(x) {310 if (arguments.length === 1)311 return 1/x;312 else {313 var res = x;314 for (var i = 1; i < arguments.length; i++)315 res /= arguments[i];316 return res;317 }318}319/*** META ((export #t)) */320var sc_abs = Math.abs;321/*** META ((export quotient /fx)322 (peephole (hole 2 "parseInt(" x "/" y ")")))323*/324function sc_quotient(x, y) {325 return parseInt(x / y);326}327/*** META ((export #t)328 (peephole (infix 2 2 "%")))329*/330function sc_remainder(x, y) {331 return x % y;332}333/*** META ((export #t)334 (peephole (modulo)))335*/336function sc_modulo(x, y) {337 var remainder = x % y;338 // if they don't have the same sign339 if ((remainder * y) < 0)340 return remainder + y;341 else342 return remainder;343}344function sc_euclid_gcd(a, b) {345 var temp;346 if (a === 0) return b;347 if (b === 0) return a;348 if (a < 0) {a = -a;};349 if (b < 0) {b = -b;};350 if (b > a) {temp = a; a = b; b = temp;};351 while (true) {352 a %= b;353 if(a === 0) {return b;};354 b %= a;355 if(b === 0) {return a;};356 };357 return b;358}359/*** META ((export #t)) */360function sc_gcd() {361 var gcd = 0;362 for (var i = 0; i < arguments.length; i++)363 gcd = sc_euclid_gcd(gcd, arguments[i]);364 return gcd;365}366/*** META ((export #t)) */367function sc_lcm() {368 var lcm = 1;369 for (var i = 0; i < arguments.length; i++) {370 var f = Math.round(arguments[i] / sc_euclid_gcd(arguments[i], lcm));371 lcm *= Math.abs(f);372 }373 return lcm;374}375// LIMITATION: numerator and denominator don't make sense in floating point world.376//var SC_MAX_DECIMALS = 1000000377//378// function sc_numerator(x) {379// var rounded = Math.round(x * SC_MAX_DECIMALS);380// return Math.round(rounded / sc_euclid_gcd(rounded, SC_MAX_DECIMALS));381// }382// function sc_denominator(x) {383// var rounded = Math.round(x * SC_MAX_DECIMALS);384// return Math.round(SC_MAX_DECIMALS / sc_euclid_gcd(rounded, SC_MAX_DECIMALS));385// }386/*** META ((export #t)) */387var sc_floor = Math.floor;388/*** META ((export #t)) */389var sc_ceiling = Math.ceil;390/*** META ((export #t)) */391var sc_truncate = parseInt;392/*** META ((export #t)) */393var sc_round = Math.round;394// LIMITATION: sc_rationalize doesn't make sense in a floating point world.395/*** META ((export #t)) */396var sc_exp = Math.exp;397/*** META ((export #t)) */398var sc_log = Math.log;399/*** META ((export #t)) */400var sc_sin = Math.sin;401/*** META ((export #t)) */402var sc_cos = Math.cos;403/*** META ((export #t)) */404var sc_tan = Math.tan;405/*** META ((export #t)) */406var sc_asin = Math.asin;407/*** META ((export #t)) */408var sc_acos = Math.acos;409/*** META ((export #t)) */410var sc_atan = Math.atan;411/*** META ((export #t)) */412var sc_sqrt = Math.sqrt;413/*** META ((export #t)) */414var sc_expt = Math.pow;415// LIMITATION: we don't have complex numbers.416// LIMITATION: the following functions are hence not implemented.417// LIMITATION: make-rectangular, make-polar, real-part, imag-part, magnitude, angle418// LIMITATION: 2 argument atan419/*** META ((export #t)420 (peephole (id)))421*/422function sc_exact2inexact(x) {423 return x;424}425/*** META ((export #t)426 (peephole (id)))427*/428function sc_inexact2exact(x) {429 return x;430}431function sc_number2jsstring(x, radix) {432 if (radix)433 return x.toString(radix);434 else435 return x.toString();436}437function sc_jsstring2number(s, radix) {438 if (s === "") return false;439 if (radix) {440 var t = parseInt(s, radix);441 if (!t && t !== 0) return false;442 // verify that each char is in range. (parseInt ignores leading443 // white and trailing chars)444 var allowedChars = "01234567890abcdefghijklmnopqrstuvwxyz".substring(0, radix+1);445 if ((new RegExp("^["+allowedChars+"]*$", "i")).test(s))446 return t;447 else return false;448 } else {449 var t = +s; // does not ignore trailing chars.450 if (!t && t !== 0) return false;451 // simply verify that first char is not whitespace.452 var c = s.charAt(0);453 // if +c is 0, but the char is not "0", then we have a whitespace.454 if (+c === 0 && c !== "0") return false;455 return t;456 }457}458/*** META ((export #t)459 (type bool)460 (peephole (not)))461*/462function sc_not(b) {463 return b === false;464}465/*** META ((export #t)466 (type bool))467*/468function sc_isBoolean(b) {469 return (b === true) || (b === false);470}471function sc_Pair(car, cdr) {472 this.car = car;473 this.cdr = cdr;474}475sc_Pair.prototype.toString = function() {476 return sc_toDisplayString(this);477};478sc_Pair.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {479 var current = this;480 var res = "(";481 while(true) {482 res += writeOrDisplay(current.car);483 if (sc_isPair(current.cdr)) {484 res += " ";485 current = current.cdr;486 } else if (current.cdr !== null) {487 res += " . " + writeOrDisplay(current.cdr);488 break;489 } else // current.cdr == null490 break;491 }492 493 res += ")";494 return res;495};496sc_Pair.prototype.sc_toDisplayString = function() {497 return this.sc_toWriteOrDisplayString(sc_toDisplayString);498};499sc_Pair.prototype.sc_toWriteString = function() {500 return this.sc_toWriteOrDisplayString(sc_toWriteString);501};502// sc_Pair.prototype.sc_toWriteCircleString in IO.js503/*** META ((export #t)504 (type bool)505 (peephole (postfix " instanceof sc_Pair")))506*/507function sc_isPair(p) {508 return (p instanceof sc_Pair);509}510function sc_isPairEqual(p1, p2, comp) {511 return (comp(p1.car, p2.car) && comp(p1.cdr, p2.cdr));512}513/*** META ((export #t)514 (peephole (hole 2 "new sc_Pair(" car ", " cdr ")")))515*/516function sc_cons(car, cdr) {517 return new sc_Pair(car, cdr);518}519/*** META ((export cons*)) */520function sc_consStar() {521 var res = arguments[arguments.length - 1];522 for (var i = arguments.length-2; i >= 0; i--)523 res = new sc_Pair(arguments[i], res);524 return res;525}526/*** META ((export #t)527 (peephole (postfix ".car")))528*/529function sc_car(p) {530 return p.car;531}532/*** META ((export #t)533 (peephole (postfix ".cdr")))534*/535function sc_cdr(p) {536 return p.cdr;537}538/*** META ((export #t)539 (peephole (hole 2 p ".car = " val)))540*/541function sc_setCarBang(p, val) {542 p.car = val;543}544/*** META ((export #t)545 (peephole (hole 2 p ".cdr = " val)))546*/547function sc_setCdrBang(p, val) {548 p.cdr = val;549}550/*** META ((export #t)551 (peephole (postfix ".car.car")))552*/553function sc_caar(p) { return p.car.car; }554/*** META ((export #t)555 (peephole (postfix ".cdr.car")))556*/557function sc_cadr(p) { return p.cdr.car; }558/*** META ((export #t)559 (peephole (postfix ".car.cdr")))560*/561function sc_cdar(p) { return p.car.cdr; }562/*** META ((export #t)563 (peephole (postfix ".cdr.cdr")))564*/565function sc_cddr(p) { return p.cdr.cdr; }566/*** META ((export #t)567 (peephole (postfix ".car.car.car")))568*/569function sc_caaar(p) { return p.car.car.car; }570/*** META ((export #t)571 (peephole (postfix ".car.cdr.car")))572*/573function sc_cadar(p) { return p.car.cdr.car; }574/*** META ((export #t)575 (peephole (postfix ".cdr.car.car")))576*/577function sc_caadr(p) { return p.cdr.car.car; }578/*** META ((export #t)579 (peephole (postfix ".cdr.cdr.car")))580*/581function sc_caddr(p) { return p.cdr.cdr.car; }582/*** META ((export #t)583 (peephole (postfix ".car.car.cdr")))584*/585function sc_cdaar(p) { return p.car.car.cdr; }586/*** META ((export #t)587 (peephole (postfix ".cdr.car.cdr")))588*/589function sc_cdadr(p) { return p.cdr.car.cdr; }590/*** META ((export #t)591 (peephole (postfix ".car.cdr.cdr")))592*/593function sc_cddar(p) { return p.car.cdr.cdr; }594/*** META ((export #t)595 (peephole (postfix ".cdr.cdr.cdr")))596*/597function sc_cdddr(p) { return p.cdr.cdr.cdr; }598/*** META ((export #t)599 (peephole (postfix ".car.car.car.car")))600*/601function sc_caaaar(p) { return p.car.car.car.car; }602/*** META ((export #t)603 (peephole (postfix ".car.cdr.car.car")))604*/605function sc_caadar(p) { return p.car.cdr.car.car; }606/*** META ((export #t)607 (peephole (postfix ".cdr.car.car.car")))608*/609function sc_caaadr(p) { return p.cdr.car.car.car; }610/*** META ((export #t)611 (peephole (postfix ".cdr.cdr.car.car")))612*/613function sc_caaddr(p) { return p.cdr.cdr.car.car; }614/*** META ((export #t)615 (peephole (postfix ".car.car.car.cdr")))616*/617function sc_cdaaar(p) { return p.car.car.car.cdr; }618/*** META ((export #t)619 (peephole (postfix ".car.cdr.car.cdr")))620*/621function sc_cdadar(p) { return p.car.cdr.car.cdr; }622/*** META ((export #t)623 (peephole (postfix ".cdr.car.car.cdr")))624*/625function sc_cdaadr(p) { return p.cdr.car.car.cdr; }626/*** META ((export #t)627 (peephole (postfix ".cdr.cdr.car.cdr")))628*/629function sc_cdaddr(p) { return p.cdr.cdr.car.cdr; }630/*** META ((export #t)631 (peephole (postfix ".car.car.cdr.car")))632*/633function sc_cadaar(p) { return p.car.car.cdr.car; }634/*** META ((export #t)635 (peephole (postfix ".car.cdr.cdr.car")))636*/637function sc_caddar(p) { return p.car.cdr.cdr.car; }638/*** META ((export #t)639 (peephole (postfix ".cdr.car.cdr.car")))640*/641function sc_cadadr(p) { return p.cdr.car.cdr.car; }642/*** META ((export #t)643 (peephole (postfix ".cdr.cdr.cdr.car")))644*/645function sc_cadddr(p) { return p.cdr.cdr.cdr.car; }646/*** META ((export #t)647 (peephole (postfix ".car.car.cdr.cdr")))648*/649function sc_cddaar(p) { return p.car.car.cdr.cdr; }650/*** META ((export #t)651 (peephole (postfix ".car.cdr.cdr.cdr")))652*/653function sc_cdddar(p) { return p.car.cdr.cdr.cdr; }654/*** META ((export #t)655 (peephole (postfix ".cdr.car.cdr.cdr")))656*/657function sc_cddadr(p) { return p.cdr.car.cdr.cdr; }658/*** META ((export #t)659 (peephole (postfix ".cdr.cdr.cdr.cdr")))660*/661function sc_cddddr(p) { return p.cdr.cdr.cdr.cdr; }662/*** META ((export #t)) */663function sc_lastPair(l) {664 if (!sc_isPair(l)) sc_error("sc_lastPair: pair expected");665 var res = l;666 var cdr = l.cdr;667 while (sc_isPair(cdr)) {668 res = cdr;669 cdr = res.cdr;670 }671 return res;672}673/*** META ((export #t)674 (type bool)675 (peephole (postfix " === null")))676*/677function sc_isNull(o) {678 return (o === null);679}680/*** META ((export #t)681 (type bool))682*/683function sc_isList(o) {684 var rabbit;685 var turtle;686 var rabbit = o;687 var turtle = o;688 while (true) {689 if (rabbit === null ||690 (rabbit instanceof sc_Pair && rabbit.cdr === null))691 return true; // end of list692 else if ((rabbit instanceof sc_Pair) &&693 (rabbit.cdr instanceof sc_Pair)) {694 rabbit = rabbit.cdr.cdr;695 turtle = turtle.cdr;696 if (rabbit === turtle) return false; // cycle697 } else698 return false; // not pair699 }700}701/*** META ((export #t)) */702function sc_list() {703 var res = null;704 var a = arguments;705 for (var i = a.length-1; i >= 0; i--)706 res = new sc_Pair(a[i], res);707 return res;708}709/*** META ((export #t)) */710function sc_iota(num, init) {711 var res = null;712 if (!init) init = 0;713 for (var i = num - 1; i >= 0; i--)714 res = new sc_Pair(i + init, res);715 return res;716}717/*** META ((export #t)) */718function sc_makeList(nbEls, fill) {719 var res = null;720 for (var i = 0; i < nbEls; i++)721 res = new sc_Pair(fill, res);722 return res;723}724/*** META ((export #t)) */725function sc_length(l) {726 var res = 0;727 while (l !== null) {728 res++;729 l = l.cdr;730 }731 return res;732}733/*** META ((export #t)) */734function sc_remq(o, l) {735 var dummy = { cdr : null };736 var tail = dummy;737 while (l !== null) {738 if (l.car !== o) {739 tail.cdr = sc_cons(l.car, null);740 tail = tail.cdr;741 }742 l = l.cdr;743 }744 return dummy.cdr;745}746/*** META ((export #t)) */747function sc_remqBang(o, l) {748 var dummy = { cdr : null };749 var tail = dummy;750 var needsAssig = true;751 while (l !== null) {752 if (l.car === o) {753 needsAssig = true;754 } else {755 if (needsAssig) {756 tail.cdr = l;757 needsAssig = false;758 }759 tail = l;760 }761 l = l.cdr;762 }763 tail.cdr = null;764 return dummy.cdr;765}766/*** META ((export #t)) */767function sc_delete(o, l) {768 var dummy = { cdr : null };769 var tail = dummy;770 while (l !== null) {771 if (!sc_isEqual(l.car, o)) {772 tail.cdr = sc_cons(l.car, null);773 tail = tail.cdr;774 }775 l = l.cdr;776 }777 return dummy.cdr;778}779/*** META ((export #t)) */780function sc_deleteBang(o, l) {781 var dummy = { cdr : null };782 var tail = dummy;783 var needsAssig = true;784 while (l !== null) {785 if (sc_isEqual(l.car, o)) {786 needsAssig = true;787 } else {788 if (needsAssig) {789 tail.cdr = l;790 needsAssig = false;791 }792 tail = l;793 }794 l = l.cdr;795 }796 tail.cdr = null;797 return dummy.cdr;798}799function sc_reverseAppendBang(l1, l2) {800 var res = l2;801 while (l1 !== null) {802 var tmp = res;803 res = l1;804 l1 = l1.cdr;805 res.cdr = tmp;806 }807 return res;808}809 810function sc_dualAppend(l1, l2) {811 if (l1 === null) return l2;812 if (l2 === null) return l1;813 var rev = sc_reverse(l1);814 return sc_reverseAppendBang(rev, l2);815}816/*** META ((export #t)) */817function sc_append() {818 if (arguments.length === 0)819 return null;820 var res = arguments[arguments.length - 1];821 for (var i = arguments.length - 2; i >= 0; i--)822 res = sc_dualAppend(arguments[i], res);823 return res;824}825function sc_dualAppendBang(l1, l2) {826 if (l1 === null) return l2;827 if (l2 === null) return l1;828 var tmp = l1;829 while (tmp.cdr !== null) tmp=tmp.cdr;830 tmp.cdr = l2;831 return l1;832}833 834/*** META ((export #t)) */835function sc_appendBang() {836 var res = null;837 for (var i = 0; i < arguments.length; i++)838 res = sc_dualAppendBang(res, arguments[i]);839 return res;840}841/*** META ((export #t)) */842function sc_reverse(l1) {843 var res = null;844 while (l1 !== null) {845 res = sc_cons(l1.car, res);846 l1 = l1.cdr;847 }848 return res;849}850/*** META ((export #t)) */851function sc_reverseBang(l) {852 return sc_reverseAppendBang(l, null);853}854/*** META ((export #t)) */855function sc_listTail(l, k) {856 var res = l;857 for (var i = 0; i < k; i++) {858 res = res.cdr;859 }860 return res;861}862/*** META ((export #t)) */863function sc_listRef(l, k) {864 return sc_listTail(l, k).car;865}866/* // unoptimized generic versions867function sc_memX(o, l, comp) {868 while (l != null) {869 if (comp(l.car, o))870 return l;871 l = l.cdr;872 }873 return false;874}875function sc_memq(o, l) { return sc_memX(o, l, sc_isEq); }876function sc_memv(o, l) { return sc_memX(o, l, sc_isEqv); }877function sc_member(o, l) { return sc_memX(o, l, sc_isEqual); }878*/879/* optimized versions */880/*** META ((export #t)) */881function sc_memq(o, l) {882 while (l !== null) {883 if (l.car === o)884 return l;885 l = l.cdr;886 }887 return false;888}889/*** META ((export #t)) */890function sc_memv(o, l) {891 while (l !== null) {892 if (l.car === o)893 return l;894 l = l.cdr;895 }896 return false;897}898/*** META ((export #t)) */899function sc_member(o, l) {900 while (l !== null) {901 if (sc_isEqual(l.car,o))902 return l;903 l = l.cdr;904 }905 return false;906}907/* // generic unoptimized versions908function sc_assX(o, al, comp) {909 while (al != null) {910 if (comp(al.car.car, o))911 return al.car;912 al = al.cdr;913 }914 return false;915}916function sc_assq(o, al) { return sc_assX(o, al, sc_isEq); }917function sc_assv(o, al) { return sc_assX(o, al, sc_isEqv); }918function sc_assoc(o, al) { return sc_assX(o, al, sc_isEqual); }919*/920// optimized versions921/*** META ((export #t)) */922function sc_assq(o, al) {923 while (al !== null) {924 if (al.car.car === o)925 return al.car;926 al = al.cdr;927 }928 return false;929}930/*** META ((export #t)) */931function sc_assv(o, al) {932 while (al !== null) {933 if (al.car.car === o)934 return al.car;935 al = al.cdr;936 }937 return false;938}939/*** META ((export #t)) */940function sc_assoc(o, al) {941 while (al !== null) {942 if (sc_isEqual(al.car.car, o))943 return al.car;944 al = al.cdr;945 }946 return false;947}948/* can be used for mutable strings and characters */949function sc_isCharStringEqual(cs1, cs2) { return cs1.val === cs2.val; }950function sc_isCharStringLess(cs1, cs2) { return cs1.val < cs2.val; }951function sc_isCharStringGreater(cs1, cs2) { return cs1.val > cs2.val; }952function sc_isCharStringLessEqual(cs1, cs2) { return cs1.val <= cs2.val; }953function sc_isCharStringGreaterEqual(cs1, cs2) { return cs1.val >= cs2.val; }954function sc_isCharStringCIEqual(cs1, cs2)955 { return cs1.val.toLowerCase() === cs2.val.toLowerCase(); }956function sc_isCharStringCILess(cs1, cs2)957 { return cs1.val.toLowerCase() < cs2.val.toLowerCase(); }958function sc_isCharStringCIGreater(cs1, cs2)959 { return cs1.val.toLowerCase() > cs2.val.toLowerCase(); }960function sc_isCharStringCILessEqual(cs1, cs2)961 { return cs1.val.toLowerCase() <= cs2.val.toLowerCase(); }962function sc_isCharStringCIGreaterEqual(cs1, cs2)963 { return cs1.val.toLowerCase() >= cs2.val.toLowerCase(); }964function sc_Char(c) {965 var cached = sc_Char.lazy[c];966 if (cached)967 return cached;968 this.val = c;969 sc_Char.lazy[c] = this;970 // add return, so FF does not complain.971 return undefined;972}973sc_Char.lazy = new Object();974// thanks to Eric975sc_Char.char2readable = {976 "\000": "#\\null",977 "\007": "#\\bell",978 "\010": "#\\backspace",979 "\011": "#\\tab",980 "\012": "#\\newline",981 "\014": "#\\page",982 "\015": "#\\return",983 "\033": "#\\escape",984 "\040": "#\\space",985 "\177": "#\\delete",986 /* poeticless names */987 "\001": "#\\soh",988 "\002": "#\\stx",989 "\003": "#\\etx",990 "\004": "#\\eot",991 "\005": "#\\enq",992 "\006": "#\\ack",993 "\013": "#\\vt",994 "\016": "#\\so",995 "\017": "#\\si",996 "\020": "#\\dle",997 "\021": "#\\dc1",998 "\022": "#\\dc2",999 "\023": "#\\dc3",1000 "\024": "#\\dc4",1001 "\025": "#\\nak",1002 "\026": "#\\syn",1003 "\027": "#\\etb",1004 "\030": "#\\can",1005 "\031": "#\\em",1006 "\032": "#\\sub",1007 "\033": "#\\esc",1008 "\034": "#\\fs",1009 "\035": "#\\gs",1010 "\036": "#\\rs",1011 "\037": "#\\us"};1012sc_Char.readable2char = {1013 "null": "\000",1014 "bell": "\007",1015 "backspace": "\010",1016 "tab": "\011",1017 "newline": "\012",1018 "page": "\014",1019 "return": "\015",1020 "escape": "\033",1021 "space": "\040",1022 "delete": "\000",1023 "soh": "\001",1024 "stx": "\002",1025 "etx": "\003",1026 "eot": "\004",1027 "enq": "\005",1028 "ack": "\006",1029 "bel": "\007",1030 "bs": "\010",1031 "ht": "\011",1032 "nl": "\012",1033 "vt": "\013",1034 "np": "\014",1035 "cr": "\015",1036 "so": "\016",1037 "si": "\017",1038 "dle": "\020",1039 "dc1": "\021",1040 "dc2": "\022",1041 "dc3": "\023",1042 "dc4": "\024",1043 "nak": "\025",1044 "syn": "\026",1045 "etb": "\027",1046 "can": "\030",1047 "em": "\031",1048 "sub": "\032",1049 "esc": "\033",1050 "fs": "\034",1051 "gs": "\035",1052 "rs": "\036",1053 "us": "\037",1054 "sp": "\040",1055 "del": "\177"};1056 1057sc_Char.prototype.toString = function() {1058 return this.val;1059};1060// sc_toDisplayString == toString1061sc_Char.prototype.sc_toWriteString = function() {1062 var entry = sc_Char.char2readable[this.val];1063 if (entry)1064 return entry;1065 else1066 return "#\\" + this.val;1067};1068/*** META ((export #t)1069 (type bool)1070 (peephole (postfix "instanceof sc_Char")))1071*/1072function sc_isChar(c) {1073 return (c instanceof sc_Char);1074}1075/*** META ((export char=?)1076 (type bool)1077 (peephole (hole 2 c1 ".val === " c2 ".val")))1078*/1079var sc_isCharEqual = sc_isCharStringEqual;1080/*** META ((export char<?)1081 (type bool)1082 (peephole (hole 2 c1 ".val < " c2 ".val")))1083*/1084var sc_isCharLess = sc_isCharStringLess;1085/*** META ((export char>?)1086 (type bool)1087 (peephole (hole 2 c1 ".val > " c2 ".val")))1088*/1089var sc_isCharGreater = sc_isCharStringGreater;1090/*** META ((export char<=?)1091 (type bool)1092 (peephole (hole 2 c1 ".val <= " c2 ".val")))1093*/1094var sc_isCharLessEqual = sc_isCharStringLessEqual;1095/*** META ((export char>=?)1096 (type bool)1097 (peephole (hole 2 c1 ".val >= " c2 ".val")))1098*/1099var sc_isCharGreaterEqual = sc_isCharStringGreaterEqual;1100/*** META ((export char-ci=?)1101 (type bool)1102 (peephole (hole 2 c1 ".val.toLowerCase() === " c2 ".val.toLowerCase()")))1103*/1104var sc_isCharCIEqual = sc_isCharStringCIEqual;1105/*** META ((export char-ci<?)1106 (type bool)1107 (peephole (hole 2 c1 ".val.toLowerCase() < " c2 ".val.toLowerCase()")))1108*/1109var sc_isCharCILess = sc_isCharStringCILess;1110/*** META ((export char-ci>?)1111 (type bool)1112 (peephole (hole 2 c1 ".val.toLowerCase() > " c2 ".val.toLowerCase()")))1113*/1114var sc_isCharCIGreater = sc_isCharStringCIGreater;1115/*** META ((export char-ci<=?)1116 (type bool)1117 (peephole (hole 2 c1 ".val.toLowerCase() <= " c2 ".val.toLowerCase()")))1118*/1119var sc_isCharCILessEqual = sc_isCharStringCILessEqual;1120/*** META ((export char-ci>=?)1121 (type bool)1122 (peephole (hole 2 c1 ".val.toLowerCase() >= " c2 ".val.toLowerCase()")))1123*/1124var sc_isCharCIGreaterEqual = sc_isCharStringCIGreaterEqual;1125var SC_NUMBER_CLASS = "0123456789";1126var SC_WHITESPACE_CLASS = ' \r\n\t\f';1127var SC_LOWER_CLASS = 'abcdefghijklmnopqrstuvwxyz';1128var SC_UPPER_CLASS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';1129function sc_isCharOfClass(c, cl) { return (cl.indexOf(c) != -1); }1130/*** META ((export #t)1131 (type bool))1132*/1133function sc_isCharAlphabetic(c)1134 { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||1135 sc_isCharOfClass(c.val, SC_UPPER_CLASS); }1136/*** META ((export #t)1137 (type bool)1138 (peephole (hole 1 "SC_NUMBER_CLASS.indexOf(" c ".val) != -1")))1139*/1140function sc_isCharNumeric(c)1141 { return sc_isCharOfClass(c.val, SC_NUMBER_CLASS); }1142/*** META ((export #t)1143 (type bool))1144*/1145function sc_isCharWhitespace(c) {1146 var tmp = c.val;1147 return tmp === " " || tmp === "\r" || tmp === "\n" || tmp === "\t" || tmp === "\f";1148}1149/*** META ((export #t)1150 (type bool)1151 (peephole (hole 1 "SC_UPPER_CLASS.indexOf(" c ".val) != -1")))1152*/1153function sc_isCharUpperCase(c)1154 { return sc_isCharOfClass(c.val, SC_UPPER_CLASS); }1155/*** META ((export #t)1156 (type bool)1157 (peephole (hole 1 "SC_LOWER_CLASS.indexOf(" c ".val) != -1")))1158*/1159function sc_isCharLowerCase(c)1160 { return sc_isCharOfClass(c.val, SC_LOWER_CLASS); }1161/*** META ((export #t)1162 (peephole (postfix ".val.charCodeAt(0)")))1163*/1164function sc_char2integer(c)1165 { return c.val.charCodeAt(0); }1166/*** META ((export #t)1167 (peephole (hole 1 "new sc_Char(String.fromCharCode(" n "))")))1168*/1169function sc_integer2char(n)1170 { return new sc_Char(String.fromCharCode(n)); }1171/*** META ((export #t)1172 (peephole (hole 1 "new sc_Char(" c ".val.toUpperCase())")))1173*/1174function sc_charUpcase(c)1175 { return new sc_Char(c.val.toUpperCase()); }1176/*** META ((export #t)1177 (peephole (hole 1 "new sc_Char(" c ".val.toLowerCase())")))1178*/1179function sc_charDowncase(c)1180 { return new sc_Char(c.val.toLowerCase()); }1181function sc_makeJSStringOfLength(k, c) {1182 var fill;1183 if (c === undefined)1184 fill = " ";1185 else1186 fill = c;1187 var res = "";1188 var len = 1;1189 // every round doubles the size of fill.1190 while (k >= len) {1191 if (k & len)1192 res = res.concat(fill);1193 fill = fill.concat(fill);1194 len *= 2;1195 }1196 return res;1197}1198function sc_makejsString(k, c) {1199 var fill;1200 if (c)1201 fill = c.val;1202 else1203 fill = " ";1204 return sc_makeJSStringOfLength(k, fill);1205}1206function sc_jsstring2list(s) {1207 var res = null;1208 for (var i = s.length - 1; i >= 0; i--)1209 res = sc_cons(new sc_Char(s.charAt(i)), res);1210 return res;1211}1212function sc_list2jsstring(l) {1213 var a = new Array();1214 while(l !== null) {1215 a.push(l.car.val);1216 l = l.cdr;1217 }1218 return "".concat.apply("", a);1219}1220var sc_Vector = Array;1221sc_Vector.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {1222 if (this.length === 0) return "#()";1223 var res = "#(" + writeOrDisplay(this[0]);1224 for (var i = 1; i < this.length; i++)1225 res += " " + writeOrDisplay(this[i]);1226 res += ")";1227 return res;1228};1229sc_Vector.prototype.sc_toDisplayString = function() {1230 return this.sc_toWriteOrDisplayString(sc_toDisplayString);1231};1232sc_Vector.prototype.sc_toWriteString = function() {1233 return this.sc_toWriteOrDisplayString(sc_toWriteString);1234};1235/*** META ((export vector? array?)1236 (type bool)1237 (peephole (postfix " instanceof sc_Vector")))1238*/1239function sc_isVector(v) {1240 return (v instanceof sc_Vector);1241}1242// only applies to vectors1243function sc_isVectorEqual(v1, v2, comp) {1244 if (v1.length !== v2.length) return false;1245 for (var i = 0; i < v1.length; i++)1246 if (!comp(v1[i], v2[i])) return false;1247 return true;1248}1249/*** META ((export make-vector make-array)) */1250function sc_makeVector(size, fill) {1251 var a = new sc_Vector(size);1252 if (fill !== undefined)1253 sc_vectorFillBang(a, fill);1254 return a;1255}1256/*** META ((export vector array)1257 (peephole (vector)))1258*/1259function sc_vector() {1260 var a = new sc_Vector();1261 for (var i = 0; i < arguments.length; i++)1262 a.push(arguments[i]);1263 return a;1264}1265/*** META ((export vector-length array-length)1266 (peephole (postfix ".length")))1267*/1268function sc_vectorLength(v) {1269 return v.length;1270}1271/*** META ((export vector-ref array-ref)1272 (peephole (hole 2 v "[" pos "]")))1273*/1274function sc_vectorRef(v, pos) {1275 return v[pos];1276}1277/*** META ((export vector-set! array-set!)1278 (peephole (hole 3 v "[" pos "] = " val)))1279*/1280function sc_vectorSetBang(v, pos, val) {1281 v[pos] = val;1282}1283/*** META ((export vector->list array->list)) */1284function sc_vector2list(a) {1285 var res = null;1286 for (var i = a.length-1; i >= 0; i--)1287 res = sc_cons(a[i], res);1288 return res;1289}1290/*** META ((export list->vector list->array)) */1291function sc_list2vector(l) {1292 var a = new sc_Vector();1293 while(l !== null) {1294 a.push(l.car);1295 l = l.cdr;1296 }1297 return a;1298}1299/*** META ((export vector-fill! array-fill!)) */1300function sc_vectorFillBang(a, fill) {1301 for (var i = 0; i < a.length; i++)1302 a[i] = fill;1303}1304/*** META ((export #t)) */1305function sc_copyVector(a, len) {1306 if (len <= a.length)1307 return a.slice(0, len);1308 else {1309 var tmp = a.concat();1310 tmp.length = len;1311 return tmp;1312 }1313}1314/*** META ((export #t)1315 (peephole (hole 3 a ".slice(" start "," end ")")))1316*/1317function sc_vectorCopy(a, start, end) {1318 return a.slice(start, end);1319}1320/*** META ((export #t)) */1321function sc_vectorCopyBang(target, tstart, source, sstart, send) {1322 if (!sstart) sstart = 0;1323 if (!send) send = source.length;1324 // if target == source we don't want to overwrite not yet copied elements.1325 if (tstart <= sstart) {1326 for (var i = tstart, j = sstart; j < send; i++, j++) {1327 target[i] = source[j];1328 }1329 } else {1330 var diff = send - sstart;1331 for (var i = tstart + diff - 1, j = send - 1;1332 j >= sstart;1333 i--, j--) {1334 target[i] = source[j];1335 }1336 }1337 return target;1338}1339/*** META ((export #t)1340 (type bool)1341 (peephole (hole 1 "typeof " o " === 'function'")))1342*/1343function sc_isProcedure(o) {1344 return (typeof o === "function");1345}1346/*** META ((export #t)) */1347function sc_apply(proc) {1348 var args = new Array();1349 // first part of arguments are not in list-form.1350 for (var i = 1; i < arguments.length - 1; i++)1351 args.push(arguments[i]);1352 var l = arguments[arguments.length - 1];1353 while (l !== null) {1354 args.push(l.car);1355 l = l.cdr;1356 }1357 return proc.apply(null, args);1358}1359/*** META ((export #t)) */1360function sc_map(proc, l1) {1361 if (l1 === undefined)1362 return null;1363 // else1364 var nbApplyArgs = arguments.length - 1;1365 var applyArgs = new Array(nbApplyArgs);1366 var revres = null;1367 while (l1 !== null) {1368 for (var i = 0; i < nbApplyArgs; i++) {1369 applyArgs[i] = arguments[i + 1].car;1370 arguments[i + 1] = arguments[i + 1].cdr;1371 }1372 revres = sc_cons(proc.apply(null, applyArgs), revres);1373 }1374 return sc_reverseAppendBang(revres, null);1375}1376/*** META ((export #t)) */1377function sc_mapBang(proc, l1) {1378 if (l1 === undefined)1379 return null;1380 // else1381 var l1_orig = l1;1382 var nbApplyArgs = arguments.length - 1;1383 var applyArgs = new Array(nbApplyArgs);1384 while (l1 !== null) {1385 var tmp = l1;1386 for (var i = 0; i < nbApplyArgs; i++) {1387 applyArgs[i] = arguments[i + 1].car;1388 arguments[i + 1] = arguments[i + 1].cdr;1389 }1390 tmp.car = proc.apply(null, applyArgs);1391 }1392 return l1_orig;1393}1394 1395/*** META ((export #t)) */1396function sc_forEach(proc, l1) {1397 if (l1 === undefined)1398 return undefined;1399 // else1400 var nbApplyArgs = arguments.length - 1;1401 var applyArgs = new Array(nbApplyArgs);1402 while (l1 !== null) {1403 for (var i = 0; i < nbApplyArgs; i++) {1404 applyArgs[i] = arguments[i + 1].car;1405 arguments[i + 1] = arguments[i + 1].cdr;1406 }1407 proc.apply(null, applyArgs);1408 }1409 // add return so FF does not complain.1410 return undefined;1411}1412/*** META ((export #t)) */1413function sc_filter(proc, l1) {1414 var dummy = { cdr : null };1415 var tail = dummy;1416 while (l1 !== null) {1417 if (proc(l1.car) !== false) {1418 tail.cdr = sc_cons(l1.car, null);1419 tail = tail.cdr;1420 }1421 l1 = l1.cdr;1422 }1423 return dummy.cdr;1424}1425/*** META ((export #t)) */1426function sc_filterBang(proc, l1) {1427 var head = sc_cons("dummy", l1);1428 var it = head;1429 var next = l1;1430 while (next !== null) {1431 if (proc(next.car) !== false) {1432 it.cdr = next1433 it = next;1434 }1435 next = next.cdr;1436 }1437 it.cdr = null;1438 return head.cdr;1439}1440function sc_filterMap1(proc, l1) {1441 var revres = null;1442 while (l1 !== null) {1443 var tmp = proc(l1.car)1444 if (tmp !== false) revres = sc_cons(tmp, revres);1445 l1 = l1.cdr;1446 }1447 return sc_reverseAppendBang(revres, null);1448}1449function sc_filterMap2(proc, l1, l2) {1450 var revres = null;1451 while (l1 !== null) {1452 var tmp = proc(l1.car, l2.car);1453 if(tmp !== false) revres = sc_cons(tmp, revres);1454 l1 = l1.cdr;1455 l2 = l2.cdr1456 }1457 return sc_reverseAppendBang(revres, null);1458}1459/*** META ((export #t)) */1460function sc_filterMap(proc, l1, l2, l3) {1461 if (l2 === undefined)1462 return sc_filterMap1(proc, l1);1463 else if (l3 === undefined)1464 return sc_filterMap2(proc, l1, l2);1465 // else1466 var nbApplyArgs = arguments.length - 1;1467 var applyArgs = new Array(nbApplyArgs);1468 var revres = null;1469 while (l1 !== null) {1470 for (var i = 0; i < nbApplyArgs; i++) {1471 applyArgs[i] = arguments[i + 1].car;1472 arguments[i + 1] = arguments[i + 1].cdr;1473 }1474 var tmp = proc.apply(null, applyArgs);1475 if(tmp !== false) revres = sc_cons(tmp, revres);1476 }1477 return sc_reverseAppendBang(revres, null);1478}1479/*** META ((export #t)) */1480function sc_any(proc, l) {1481 var revres = null;1482 while (l !== null) {1483 var tmp = proc(l.car);1484 if(tmp !== false) return tmp;1485 l = l.cdr;1486 }1487 return false;1488}1489/*** META ((export any?)1490 (peephole (hole 2 "sc_any(" proc "," l ") !== false")))1491*/1492function sc_anyPred(proc, l) {1493 return sc_any(proc, l)!== false;1494}1495/*** META ((export #t)) */1496function sc_every(proc, l) {1497 var revres = null;1498 var tmp = true;1499 while (l !== null) {1500 tmp = proc(l.car);1501 if (tmp === false) return false;1502 l = l.cdr;1503 }1504 return tmp;1505}1506/*** META ((export every?)1507 (peephole (hole 2 "sc_every(" proc "," l ") !== false")))1508*/1509function sc_everyPred(proc, l) {1510 var tmp = sc_every(proc, l);1511 if (tmp !== false) return true;1512 return false;1513}1514/*** META ((export #t)1515 (peephole (postfix "()")))1516*/1517function sc_force(o) {1518 return o();1519}1520/*** META ((export #t)) */1521function sc_makePromise(proc) {1522 var isResultReady = false;1523 var result = undefined;1524 return function() {1525 if (!isResultReady) {1526 var tmp = proc();1527 if (!isResultReady) {1528 isResultReady = true;1529 result = tmp;1530 }1531 }1532 return result;1533 };1534}1535function sc_Values(values) {1536 this.values = values;1537}1538/*** META ((export #t)1539 (peephole (values)))1540*/1541function sc_values() {1542 if (arguments.length === 1)1543 return arguments[0];1544 else1545 return new sc_Values(arguments);1546}1547/*** META ((export #t)) */1548function sc_callWithValues(producer, consumer) {1549 var produced = producer();1550 if (produced instanceof sc_Values)1551 return consumer.apply(null, produced.values);1552 else1553 return consumer(produced);1554}1555/*** META ((export #t)) */1556function sc_dynamicWind(before, thunk, after) {1557 before();1558 try {1559 var res = thunk();1560 return res;1561 } finally {1562 after();1563 }1564}1565// TODO: eval/scheme-report-environment/null-environment/interaction-environment1566// LIMITATION: 'load' doesn't exist without files.1567// LIMITATION: transcript-on/transcript-off doesn't exist without files.1568function sc_Struct(name) {1569 this.name = name;1570}1571sc_Struct.prototype.sc_toDisplayString = function() {1572 return "#<struct" + sc_hash(this) + ">";1573};1574sc_Struct.prototype.sc_toWriteString = sc_Struct.prototype.sc_toDisplayString;1575/*** META ((export #t)1576 (peephole (hole 1 "new sc_Struct(" name ")")))1577*/1578function sc_makeStruct(name) {1579 return new sc_Struct(name);1580}1581/*** META ((export #t)1582 (type bool)1583 (peephole (postfix " instanceof sc_Struct")))1584*/1585function sc_isStruct(o) {1586 return (o instanceof sc_Struct);1587}1588/*** META ((export #t)1589 (type bool)1590 (peephole (hole 2 "(" 1 " instanceof sc_Struct) && ( " 1 ".name === " 0 ")")))1591*/1592function sc_isStructNamed(name, s) {1593 return ((s instanceof sc_Struct) && (s.name === name));1594}1595/*** META ((export struct-field)1596 (peephole (hole 3 0 "[" 2 "]")))1597*/1598function sc_getStructField(s, name, field) {1599 return s[field];1600}1601/*** META ((export struct-field-set!)1602 (peephole (hole 4 0 "[" 2 "] = " 3)))1603*/1604function sc_setStructFieldBang(s, name, field, val) {1605 s[field] = val;1606}1607/*** META ((export #t)1608 (peephole (prefix "~")))1609*/1610function sc_bitNot(x) {1611 return ~x;1612}1613/*** META ((export #t)1614 (peephole (infix 2 2 "&")))1615*/1616function sc_bitAnd(x, y) {1617 return x & y;1618}1619/*** META ((export #t)1620 (peephole (infix 2 2 "|")))1621*/1622function sc_bitOr(x, y) {1623 return x | y;1624}1625/*** META ((export #t)1626 (peephole (infix 2 2 "^")))1627*/1628function sc_bitXor(x, y) {1629 return x ^ y;1630}1631/*** META ((export #t)1632 (peephole (infix 2 2 "<<")))1633*/1634function sc_bitLsh(x, y) {1635 return x << y;1636}1637/*** META ((export #t)1638 (peephole (infix 2 2 ">>")))1639*/1640function sc_bitRsh(x, y) {1641 return x >> y;1642}1643/*** META ((export #t)1644 (peephole (infix 2 2 ">>>")))1645*/1646function sc_bitUrsh(x, y) {1647 return x >>> y;1648}1649/*** META ((export js-field js-property)1650 (peephole (hole 2 o "[" field "]")))1651*/1652function sc_jsField(o, field) {1653 return o[field];1654}1655/*** META ((export js-field-set! js-property-set!)1656 (peephole (hole 3 o "[" field "] = " val)))1657*/1658function sc_setJsFieldBang(o, field, val) {1659 return o[field] = val;1660}1661/*** META ((export js-field-delete! js-property-delete!)1662 (peephole (hole 2 "delete" o "[" field "]")))1663*/1664function sc_deleteJsFieldBang(o, field) {1665 delete o[field];1666}1667/*** META ((export #t)1668 (peephole (jsCall)))1669*/1670function sc_jsCall(o, fun) {1671 var args = new Array();1672 for (var i = 2; i < arguments.length; i++)1673 args[i-2] = arguments[i];1674 return fun.apply(o, args);1675}1676/*** META ((export #t)1677 (peephole (jsMethodCall)))1678*/1679function sc_jsMethodCall(o, field) {1680 var args = new Array();1681 for (var i = 2; i < arguments.length; i++)1682 args[i-2] = arguments[i];1683 return o[field].apply(o, args);1684}1685/*** META ((export new js-new)1686 (peephole (jsNew)))1687*/1688function sc_jsNew(c) {1689 var evalStr = "new c(";1690 evalStr +=arguments.length > 1? "arguments[1]": "";1691 for (var i = 2; i < arguments.length; i++)1692 evalStr += ", arguments[" + i + "]";1693 evalStr +=")";1694 return eval(evalStr);1695} 1696// ======================== RegExp ====================1697/*** META ((export #t)) */1698function sc_pregexp(re) {1699 return new RegExp(sc_string2jsstring(re));1700}1701/*** META ((export #t)) */1702function sc_pregexpMatch(re, s) {1703 var reg = (re instanceof RegExp) ? re : sc_pregexp(re);1704 var tmp = reg.exec(sc_string2jsstring(s));1705 1706 if (tmp == null) return false;1707 1708 var res = null;1709 for (var i = tmp.length-1; i >= 0; i--) {1710 if (tmp[i] !== null) {1711 res = sc_cons(sc_jsstring2string(tmp[i]), res);1712 } else {1713 res = sc_cons(false, res);1714 }1715 }1716 return res;1717}1718 1719/*** META ((export #t)) */1720function sc_pregexpReplace(re, s1, s2) {1721 var reg;1722 var jss1 = sc_string2jsstring(s1);1723 var jss2 = sc_string2jsstring(s2);1724 if (re instanceof RegExp) {1725 if (re.global)1726 reg = re;1727 else1728 reg = new RegExp(re.source);1729 } else {1730 reg = new RegExp(sc_string2jsstring(re));1731 }1732 return jss1.replace(reg, jss2);1733}1734 1735/*** META ((export pregexp-replace*)) */1736function sc_pregexpReplaceAll(re, s1, s2) {1737 var reg;1738 var jss1 = sc_string2jsstring(s1);1739 var jss2 = sc_string2jsstring(s2);1740 if (re instanceof RegExp) {1741 if (re.global)1742 reg = re;1743 else1744 reg = new RegExp(re.source, "g");1745 } else {1746 reg = new RegExp(sc_string2jsstring(re), "g");1747 }1748 return jss1.replace(reg, jss2);1749}1750/*** META ((export #t)) */1751function sc_pregexpSplit(re, s) {1752 var reg = ((re instanceof RegExp) ?1753 re :1754 new RegExp(sc_string2jsstring(re)));1755 var jss = sc_string2jsstring(s);1756 var tmp = jss.split(reg);1757 if (tmp == null) return false;1758 return sc_vector2list(tmp);1759}1760 1761/* =========================================================================== */1762/* Other library stuff */1763/* =========================================================================== */1764/*** META ((export #t)1765 (peephole (hole 1 "Math.floor(Math.random()*" 'n ")")))1766*/1767function sc_random(n) {1768 return Math.floor(Math.random()*n);1769}1770/*** META ((export current-date)1771 (peephole (hole 0 "new Date()")))1772*/1773function sc_currentDate() {1774 return new Date();1775}1776function sc_Hashtable() {1777}1778sc_Hashtable.prototype.toString = function() {1779 return "#{%hashtable}";1780};1781// sc_toWriteString == sc_toDisplayString == toString1782function sc_HashtableElement(key, val) {1783 this.key = key;1784 this.val = val;1785}1786/*** META ((export #t)1787 (peephole (hole 0 "new sc_Hashtable()")))1788*/1789function sc_makeHashtable() {1790 return new sc_Hashtable();1791}1792/*** META ((export #t)) */1793function sc_hashtablePutBang(ht, key, val) {1794 var hash = sc_hash(key);1795 ht[hash] = new sc_HashtableElement(key, val);1796}1797/*** META ((export #t)) */1798function sc_hashtableGet(ht, key) {1799 var hash = sc_hash(key);1800 if (hash in ht)1801 return ht[hash].val;1802 else1803 return false;1804}1805/*** META ((export #t)) */1806function sc_hashtableForEach(ht, f) {1807 for (var v in ht) {1808 if (ht[v] instanceof sc_HashtableElement)1809 f(ht[v].key, ht[v].val);1810 }1811}1812/*** META ((export hashtable-contains?)1813 (peephole (hole 2 "sc_hash(" 1 ") in " 0)))1814*/1815function sc_hashtableContains(ht, key) {1816 var hash = sc_hash(key);1817 if (hash in ht)1818 return true;1819 else1820 return false;1821}1822var SC_HASH_COUNTER = 0;1823function sc_hash(o) {1824 if (o === null)1825 return "null";1826 else if (o === undefined)1827 return "undefined";1828 else if (o === true)1829 return "true";1830 else if (o === false)1831 return "false";1832 else if (typeof o === "number")1833 return "num-" + o;1834 else if (typeof o === "string")1835 return "jsstr-" + o;1836 else if (o.sc_getHash)1837 return o.sc_getHash();1838 else1839 return sc_counterHash.call(o);1840}1841function sc_counterHash() {1842 if (!this.sc_hash) {1843 this.sc_hash = "hash-" + SC_HASH_COUNTER;1844 SC_HASH_COUNTER++;1845 }1846 return this.sc_hash;1847}1848function sc_Trampoline(args, maxTailCalls) {1849 this['__trampoline return__'] = true;1850 this.args = args;1851 this.MAX_TAIL_CALLs = maxTailCalls;1852}1853// TODO: call/cc stuff1854sc_Trampoline.prototype.restart = function() {1855 var o = this;1856 while (true) {1857 // set both globals.1858 SC_TAIL_OBJECT.calls = o.MAX_TAIL_CALLs-1;1859 var fun = o.args.callee;1860 var res = fun.apply(SC_TAIL_OBJECT, o.args);1861 if (res instanceof sc_Trampoline)1862 o = res;1863 else1864 return res;1865 }1866}1867/*** META ((export bind-exit-lambda)) */1868function sc_bindExitLambda(proc) {1869 var escape_obj = new sc_BindExitException();1870 var escape = function(res) {1871 escape_obj.res = res;1872 throw escape_obj;1873 };1874 try {1875 return proc(escape);1876 } catch(e) {1877 if (e === escape_obj) {1878 return e.res;1879 }1880 throw e;1881 }1882}1883function sc_BindExitException() {1884 this._internalException = true;1885}1886var SC_SCM2JS_GLOBALS = new Object();1887// default tail-call depth.1888// normally the program should set it again. but just in case...1889var SC_TAIL_OBJECT = new Object();1890SC_SCM2JS_GLOBALS.TAIL_OBJECT = SC_TAIL_OBJECT;1891// ======================== I/O =======================1892/*------------------------------------------------------------------*/1893function sc_EOF() {1894}1895var SC_EOF_OBJECT = new sc_EOF();1896function sc_Port() {1897}1898/* --------------- Input ports -------------------------------------*/1899function sc_InputPort() {1900}1901sc_InputPort.prototype = new sc_Port();1902sc_InputPort.prototype.peekChar = function() {1903 if (!("peeked" in this))1904 this.peeked = this.getNextChar();1905 return this.peeked;1906}1907sc_InputPort.prototype.readChar = function() {1908 var tmp = this.peekChar();1909 delete this.peeked;1910 return tmp;1911}1912sc_InputPort.prototype.isCharReady = function() {1913 return true;1914}1915sc_InputPort.prototype.close = function() {1916 // do nothing1917}1918/* .............. String port ..........................*/1919function sc_ErrorInputPort() {1920};1921sc_ErrorInputPort.prototype = new sc_InputPort();1922sc_ErrorInputPort.prototype.getNextChar = function() {1923 throw "can't read from error-port.";1924};1925sc_ErrorInputPort.prototype.isCharReady = function() {1926 return false;1927};1928 1929/* .............. String port ..........................*/1930function sc_StringInputPort(jsStr) {1931 // we are going to do some charAts on the str.1932 // instead of recreating all the time a String-object, we1933 // create one in the beginning. (not sure, if this is really an optim)1934 this.str = new String(jsStr);1935 this.pos = 0;1936}1937sc_StringInputPort.prototype = new sc_InputPort();1938sc_StringInputPort.prototype.getNextChar = function() {1939 if (this.pos >= this.str.length)1940 return SC_EOF_OBJECT;1941 return this.str.charAt(this.pos++);1942};1943/* ------------- Read and other lib-funs -------------------------------*/1944function sc_Token(type, val, pos) {1945 this.type = type;1946 this.val = val;1947 this.pos = pos;1948}1949sc_Token.EOF = 0/*EOF*/;1950sc_Token.OPEN_PAR = 1/*OPEN_PAR*/;1951sc_Token.CLOSE_PAR = 2/*CLOSE_PAR*/;1952sc_Token.OPEN_BRACE = 3/*OPEN_BRACE*/;1953sc_Token.CLOSE_BRACE = 4/*CLOSE_BRACE*/;1954sc_Token.OPEN_BRACKET = 5/*OPEN_BRACKET*/;1955sc_Token.CLOSE_BRACKET = 6/*CLOSE_BRACKET*/;1956sc_Token.WHITESPACE = 7/*WHITESPACE*/;1957sc_Token.QUOTE = 8/*QUOTE*/;1958sc_Token.ID = 9/*ID*/;1959sc_Token.DOT = 10/*DOT*/;1960sc_Token.STRING = 11/*STRING*/;1961sc_Token.NUMBER = 12/*NUMBER*/;1962sc_Token.ERROR = 13/*ERROR*/;1963sc_Token.VECTOR_BEGIN = 14/*VECTOR_BEGIN*/;1964sc_Token.TRUE = 15/*TRUE*/;1965sc_Token.FALSE = 16/*FALSE*/;1966sc_Token.UNSPECIFIED = 17/*UNSPECIFIED*/;1967sc_Token.REFERENCE = 18/*REFERENCE*/;1968sc_Token.STORE = 19/*STORE*/;1969sc_Token.CHAR = 20/*CHAR*/;1970var SC_ID_CLASS = SC_LOWER_CLASS + SC_UPPER_CLASS + "!$%*+-./:<=>?@^_~";1971function sc_Tokenizer(port) {1972 this.port = port;1973}1974sc_Tokenizer.prototype.peekToken = function() {1975 if (this.peeked)1976 return this.peeked;1977 var newToken = this.nextToken();1978 this.peeked = newToken;1979 return newToken;1980};1981sc_Tokenizer.prototype.readToken = function() {1982 var tmp = this.peekToken();1983 delete this.peeked;1984 return tmp;1985};1986sc_Tokenizer.prototype.nextToken = function() {1987 var port = this.port;1988 1989 function isNumberChar(c) {1990 return (c >= "0" && c <= "9");1991 };1992 function isIdOrNumberChar(c) {1993 return SC_ID_CLASS.indexOf(c) != -1 || // ID-char1994 (c >= "0" && c <= "9");1995 }1996 function isWhitespace(c) {1997 return c === " " || c === "\r" || c === "\n" || c === "\t" || c === "\f";1998 };1999 function isWhitespaceOrEOF(c) {2000 return isWhitespace(c) || c === SC_EOF_OBJECT;2001 };2002 function readString() {2003 res = "";2004 while (true) {2005 var c = port.readChar();2006 switch (c) {2007 case '"':2008 return new sc_Token(11/*STRING*/, res);2009 case "\\":2010 var tmp = port.readChar();2011 switch (tmp) {2012 case '0': res += "\0"; break;2013 case 'a': res += "\a"; break;2014 case 'b': res += "\b"; break;2015 case 'f': res += "\f"; break;2016 case 'n': res += "\n"; break;2017 case 'r': res += "\r"; break;2018 case 't': res += "\t"; break;2019 case 'v': res += "\v"; break;2020 case '"': res += '"'; break;2021 case '\\': res += '\\'; break;2022 case 'x':2023 /* hexa-number */2024 var nb = 0;2025 while (true) {2026 var hexC = port.peekChar();2027 if (hexC >= '0' && hexC <= '9') {2028 port.readChar();2029 nb = nb * 16 + hexC.charCodeAt(0) - '0'.charCodeAt(0);2030 } else if (hexC >= 'a' && hexC <= 'f') {2031 port.readChar();2032 nb = nb * 16 + hexC.charCodeAt(0) - 'a'.charCodeAt(0);2033 } else if (hexC >= 'A' && hexC <= 'F') {2034 port.readChar();2035 nb = nb * 16 + hexC.charCodeAt(0) - 'A'.charCodeAt(0);2036 } else {2037 // next char isn't part of hex.2038 res += String.fromCharCode(nb);2039 break;2040 }2041 }2042 break;2043 default:2044 if (tmp === SC_EOF_OBJECT) {2045 return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);2046 }2047 res += tmp;2048 }2049 break;2050 default:2051 if (c === SC_EOF_OBJECT) {2052 return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);2053 }2054 res += c;2055 }2056 }2057 };2058 function readIdOrNumber(firstChar) {2059 var res = firstChar;2060 while (isIdOrNumberChar(port.peekChar()))2061 res += port.readChar();2062 if (isNaN(res))2063 return new sc_Token(9/*ID*/, res);2064 else2065 return new sc_Token(12/*NUMBER*/, res - 0);2066 };2067 2068 function skipWhitespaceAndComments() {2069 var done = false;2070 while (!done) {2071 done = true;2072 while (isWhitespace(port.peekChar()))2073 port.readChar();2074 if (port.peekChar() === ';') {2075 port.readChar();2076 done = false;2077 while (true) {2078 curChar = port.readChar();2079 if (curChar === SC_EOF_OBJECT ||2080 curChar === '\n')2081 break;2082 }2083 }2084 }2085 };2086 2087 function readDot() {2088 if (isWhitespace(port.peekChar()))2089 return new sc_Token(10/*DOT*/);2090 else2091 return readIdOrNumber(".");2092 };2093 function readSharp() {2094 var c = port.readChar();2095 if (isWhitespace(c))2096 return new sc_Token(13/*ERROR*/, "bad #-pattern0.");2097 // reference2098 if (isNumberChar(c)) {2099 var nb = c - 0;2100 while (isNumberChar(port.peekChar()))2101 nb = nb*10 + (port.readChar() - 0);2102 switch (port.readChar()) {2103 case '#':2104 return new sc_Token(18/*REFERENCE*/, nb);2105 case '=':2106 return new sc_Token(19/*STORE*/, nb);2107 default:2108 return new sc_Token(13/*ERROR*/, "bad #-pattern1." + nb);2109 }2110 }2111 if (c === "(")2112 return new sc_Token(14/*VECTOR_BEGIN*/);2113 2114 if (c === "\\") { // character2115 var tmp = ""2116 while (!isWhitespaceOrEOF(port.peekChar()))2117 tmp += port.readChar();2118 switch (tmp.length) {2119 case 0: // it's escaping a whitespace char:2120 if (sc_isEOFObject(port.peekChar))2121 return new sc_Token(13/*ERROR*/, "bad #-pattern2.");2122 else2123 return new sc_Token(20/*CHAR*/, port.readChar());2124 case 1:2125 return new sc_Token(20/*CHAR*/, tmp);2126 default:2127 var entry = sc_Char.readable2char[tmp.toLowerCase()];2128 if (entry)2129 return new sc_Token(20/*CHAR*/, entry);2130 else2131 return new sc_Token(13/*ERROR*/, "unknown character description: #\\" + tmp);2132 }2133 }2134 // some constants (#t, #f, #unspecified)2135 var res;2136 var needing;2137 switch (c) {2138 case 't': res = new sc_Token(15/*TRUE*/, true); needing = ""; break;2139 case 'f': res = new sc_Token(16/*FALSE*/, false); needing = ""; break;2140 case 'u': res = new sc_Token(17/*UNSPECIFIED*/, undefined); needing = "nspecified"; break;2141 default:2142 return new sc_Token(13/*ERROR*/, "bad #-pattern3: " + c);2143 }2144 while(true) {2145 c = port.peekChar();2146 if ((isWhitespaceOrEOF(c) || c === ')') &&2147 needing == "")2148 return res;2149 else if (isWhitespace(c) || needing == "")2150 return new sc_Token(13/*ERROR*/, "bad #-pattern4 " + c + " " + needing);2151 else if (needing.charAt(0) == c) {2152 port.readChar(); // consume2153 needing = needing.slice(1);2154 } else2155 return new sc_Token(13/*ERROR*/, "bad #-pattern5");2156 }2157 2158 };2159 skipWhitespaceAndComments();2160 var curChar = port.readChar();2161 if (curChar === SC_EOF_OBJECT)2162 return new sc_Token(0/*EOF*/, curChar);2163 switch (curChar)2164 {2165 case " ":2166 case "\n":2167 case "\t":2168 return readWhitespace();2169 case "(":2170 return new sc_Token(1/*OPEN_PAR*/);2171 case ")":2172 return new sc_Token(2/*CLOSE_PAR*/);2173 case "{":2174 return new sc_Token(3/*OPEN_BRACE*/);2175 case "}":2176 return new sc_Token(4/*CLOSE_BRACE*/);2177 case "[":2178 return new sc_Token(5/*OPEN_BRACKET*/);2179 case "]":2180 return new sc_Token(6/*CLOSE_BRACKET*/);2181 case "'":2182 return new sc_Token(8/*QUOTE*/);2183 case "#":2184 return readSharp();2185 case ".":2186 return readDot();2187 case '"':2188 return readString();2189 default:2190 if (isIdOrNumberChar(curChar))2191 return readIdOrNumber(curChar);2192 throw "unexpected character: " + curChar;2193 }2194};2195function sc_Reader(tokenizer) {2196 this.tokenizer = tokenizer;2197 this.backref = new Array();2198}2199sc_Reader.prototype.read = function() {2200 function readList(listBeginType) {2201 function matchesPeer(open, close) {2202 return open === 1/*OPEN_PAR*/ && close === 2/*CLOSE_PAR*/2203 || open === 3/*OPEN_BRACE*/ && close === 4/*CLOSE_BRACE*/2204 || open === 5/*OPEN_BRACKET*/ && close === 6/*CLOSE_BRACKET*/;2205 };2206 var res = null;2207 while (true) {2208 var token = tokenizer.peekToken();2209 2210 switch (token.type) {2211 case 2/*CLOSE_PAR*/:2212 case 4/*CLOSE_BRACE*/:2213 case 6/*CLOSE_BRACKET*/:2214 if (matchesPeer(listBeginType, token.type)) {2215 tokenizer.readToken(); // consume token2216 return sc_reverseBang(res);2217 } else2218 throw "closing par doesn't match: " + listBeginType2219 + " " + listEndType;2220 case 0/*EOF*/:2221 throw "unexpected end of file";2222 case 10/*DOT*/:2223 tokenizer.readToken(); // consume token2224 var cdr = this.read();2225 var par = tokenizer.readToken();2226 if (!matchesPeer(listBeginType, par.type))2227 throw "closing par doesn't match: " + listBeginType2228 + " " + par.type;2229 else2230 return sc_reverseAppendBang(res, cdr);2231 2232 default:2233 res = sc_cons(this.read(), res);2234 }2235 }2236 };2237 function readQuote() {2238 return sc_cons("quote", sc_cons(this.read(), null));2239 };2240 function readVector() {2241 // opening-parenthesis is already consumed2242 var a = new Array();2243 while (true) {2244 var token = tokenizer.peekToken();2245 switch (token.type) {2246 case 2/*CLOSE_PAR*/:2247 tokenizer.readToken();2248 return a;2249 2250 default:2251 a.push(this.read());2252 }2253 }2254 };2255 function storeRefence(nb) {2256 var tmp = this.read();2257 this.backref[nb] = tmp;2258 return tmp;2259 };2260 2261 function readReference(nb) {2262 if (nb in this.backref)2263 return this.backref[nb];2264 else2265 throw "bad reference: " + nb;2266 };2267 2268 var tokenizer = this.tokenizer;2269 var token = tokenizer.readToken();2270 // handle error2271 if (token.type === 13/*ERROR*/)2272 throw token.val;2273 2274 switch (token.type) {2275 case 1/*OPEN_PAR*/:2276 case 3/*OPEN_BRACE*/:2277 case 5/*OPEN_BRACKET*/:2278 return readList.call(this, token.type);2279 case 8/*QUOTE*/:2280 return readQuote.call(this);2281 case 11/*STRING*/:2282 return sc_jsstring2string(token.val);2283 case 20/*CHAR*/:2284 return new sc_Char(token.val);2285 case 14/*VECTOR_BEGIN*/:2286 return readVector.call(this);2287 case 18/*REFERENCE*/:2288 return readReference.call(this, token.val);2289 case 19/*STORE*/:2290 return storeRefence.call(this, token.val);2291 case 9/*ID*/:2292 return sc_jsstring2symbol(token.val);2293 case 0/*EOF*/:2294 case 12/*NUMBER*/:2295 case 15/*TRUE*/:2296 case 16/*FALSE*/:2297 case 17/*UNSPECIFIED*/:2298 return token.val;2299 default:2300 throw "unexpected token " + token.type + " " + token.val;2301 }2302};2303/*** META ((export #t)) */2304function sc_read(port) {2305 if (port === undefined) // we assume the port hasn't been given.2306 port = SC_DEFAULT_IN; // THREAD: shared var...2307 var reader = new sc_Reader(new sc_Tokenizer(port));2308 return reader.read();2309}2310/*** META ((export #t)) */2311function sc_readChar(port) {2312 if (port === undefined) // we assume the port hasn't been given.2313 port = SC_DEFAULT_IN; // THREAD: shared var...2314 var t = port.readChar();2315 return t === SC_EOF_OBJECT? t: new sc_Char(t);2316}2317/*** META ((export #t)) */2318function sc_peekChar(port) {2319 if (port === undefined) // we assume the port hasn't been given.2320 port = SC_DEFAULT_IN; // THREAD: shared var...2321 var t = port.peekChar();2322 return t === SC_EOF_OBJECT? t: new sc_Char(t);2323} 2324/*** META ((export #t)2325 (type bool))2326*/2327function sc_isCharReady(port) {2328 if (port === undefined) // we assume the port hasn't been given.2329 port = SC_DEFAULT_IN; // THREAD: shared var...2330 return port.isCharReady();2331}2332/*** META ((export #t)2333 (peephole (postfix ".close()")))2334*/2335function sc_closeInputPort(p) {2336 return p.close();2337}2338/*** META ((export #t)2339 (type bool)2340 (peephole (postfix " instanceof sc_InputPort")))2341*/2342function sc_isInputPort(o) {2343 return (o instanceof sc_InputPort);2344}2345/*** META ((export eof-object?)2346 (type bool)2347 (peephole (postfix " === SC_EOF_OBJECT")))2348*/2349function sc_isEOFObject(o) {2350 return o === SC_EOF_OBJECT;2351}2352/*** META ((export #t)2353 (peephole (hole 0 "SC_DEFAULT_IN")))2354*/2355function sc_currentInputPort() {2356 return SC_DEFAULT_IN;2357}2358/* ------------ file operations are not supported -----------*/2359/*** META ((export #t)) */2360function sc_callWithInputFile(s, proc) {2361 throw "can't open " + s;2362}2363/*** META ((export #t)) */2364function sc_callWithOutputFile(s, proc) {2365 throw "can't open " + s;2366}2367/*** META ((export #t)) */2368function sc_withInputFromFile(s, thunk) {2369 throw "can't open " + s;2370}2371/*** META ((export #t)) */2372function sc_withOutputToFile(s, thunk) {2373 throw "can't open " + s;2374}2375/*** META ((export #t)) */2376function sc_openInputFile(s) {2377 throw "can't open " + s;2378}2379/*** META ((export #t)) */2380function sc_openOutputFile(s) {2381 throw "can't open " + s;2382}2383/* ----------------------------------------------------------------------------*/2384/*** META ((export #t)) */2385function sc_basename(p) {2386 var i = p.lastIndexOf('/');2387 if(i >= 0)2388 return p.substring(i + 1, p.length);2389 else2390 return '';2391}2392/*** META ((export #t)) */2393function sc_dirname(p) {2394 var i = p.lastIndexOf('/');2395 if(i >= 0)2396 return p.substring(0, i);2397 else2398 return '';2399}2400/* ----------------------------------------------------------------------------*/2401/*** META ((export #t)) */2402function sc_withInputFromPort(p, thunk) {2403 try {2404 var tmp = SC_DEFAULT_IN; // THREAD: shared var.2405 SC_DEFAULT_IN = p;2406 return thunk();2407 } finally {2408 SC_DEFAULT_IN = tmp;2409 }2410}2411/*** META ((export #t)) */2412function sc_withInputFromString(s, thunk) {2413 return sc_withInputFromPort(new sc_StringInputPort(sc_string2jsstring(s)), thunk);2414}2415/*** META ((export #t)) */2416function sc_withOutputToPort(p, thunk) {2417 try {2418 var tmp = SC_DEFAULT_OUT; // THREAD: shared var.2419 SC_DEFAULT_OUT = p;2420 return thunk();2421 } finally {2422 SC_DEFAULT_OUT = tmp;2423 }2424}2425/*** META ((export #t)) */2426function sc_withOutputToString(thunk) {2427 var p = new sc_StringOutputPort();2428 sc_withOutputToPort(p, thunk);2429 return p.close();2430}2431/*** META ((export #t)) */2432function sc_withOutputToProcedure(proc, thunk) {2433 var t = function(s) { proc(sc_jsstring2string(s)); };2434 return sc_withOutputToPort(new sc_GenericOutputPort(t), thunk);2435}2436/*** META ((export #t)2437 (peephole (hole 0 "new sc_StringOutputPort()")))2438*/2439function sc_openOutputString() {2440 return new sc_StringOutputPort();2441}2442/*** META ((export #t)) */2443function sc_openInputString(str) {2444 return new sc_StringInputPort(sc_string2jsstring(str));2445}2446/* ----------------------------------------------------------------------------*/2447function sc_OutputPort() {2448}2449sc_OutputPort.prototype = new sc_Port();2450sc_OutputPort.prototype.appendJSString = function(obj) {2451 /* do nothing */2452}2453sc_OutputPort.prototype.close = function() {2454 /* do nothing */2455}2456function sc_StringOutputPort() {2457 this.res = "";2458}2459sc_StringOutputPort.prototype = new sc_OutputPort();2460sc_StringOutputPort.prototype.appendJSString = function(s) {2461 this.res += s;2462}2463sc_StringOutputPort.prototype.close = function() {2464 return sc_jsstring2string(this.res);2465}2466/*** META ((export #t)) */2467function sc_getOutputString(sp) {2468 return sc_jsstring2string(sp.res);2469}2470 2471function sc_ErrorOutputPort() {2472}2473sc_ErrorOutputPort.prototype = new sc_OutputPort();2474sc_ErrorOutputPort.prototype.appendJSString = function(s) {2475 throw "don't write on ErrorPort!";2476}2477sc_ErrorOutputPort.prototype.close = function() {2478 /* do nothing */2479}2480function sc_GenericOutputPort(appendJSString, close) {2481 this.appendJSString = appendJSString;2482 if (close)2483 this.close = close;2484}2485sc_GenericOutputPort.prototype = new sc_OutputPort();2486/*** META ((export #t)2487 (type bool)2488 (peephole (postfix " instanceof sc_OutputPort")))2489*/2490function sc_isOutputPort(o) {2491 return (o instanceof sc_OutputPort);2492}2493/*** META ((export #t)2494 (peephole (postfix ".close()")))2495*/2496function sc_closeOutputPort(p) {2497 return p.close();2498}2499/* ------------------ write ---------------------------------------------------*/2500/*** META ((export #t)) */2501function sc_write(o, p) {2502 if (p === undefined) // we assume not given2503 p = SC_DEFAULT_OUT;2504 p.appendJSString(sc_toWriteString(o));2505}2506function sc_toWriteString(o) {2507 if (o === null)2508 return "()";2509 else if (o === true)2510 return "#t";2511 else if (o === false)2512 return "#f";2513 else if (o === undefined)2514 return "#unspecified";2515 else if (typeof o === 'function')2516 return "#<procedure " + sc_hash(o) + ">";2517 else if (o.sc_toWriteString)2518 return o.sc_toWriteString();2519 else2520 return o.toString();2521}2522function sc_escapeWriteString(s) {2523 var res = "";2524 var j = 0;2525 for (i = 0; i < s.length; i++) {2526 switch (s.charAt(i)) {2527 case "\0": res += s.substring(j, i) + "\\0"; j = i + 1; break;2528 case "\b": res += s.substring(j, i) + "\\b"; j = i + 1; break;2529 case "\f": res += s.substring(j, i) + "\\f"; j = i + 1; break;2530 case "\n": res += s.substring(j, i) + "\\n"; j = i + 1; break;2531 case "\r": res += s.substring(j, i) + "\\r"; j = i + 1; break;2532 case "\t": res += s.substring(j, i) + "\\t"; j = i + 1; break;2533 case "\v": res += s.substring(j, i) + "\\v"; j = i + 1; break;2534 case '"': res += s.substring(j, i) + '\\"'; j = i + 1; break;2535 case "\\": res += s.substring(j, i) + "\\\\"; j = i + 1; break;2536 default:2537 var c = s.charAt(i);2538 if ("\a" !== "a" && c == "\a") {2539 res += s.substring(j, i) + "\\a"; j = i + 1; continue;2540 }2541 if ("\v" !== "v" && c == "\v") {2542 res += s.substring(j, i) + "\\v"; j = i + 1; continue;2543 }2544 //if (s.charAt(i) < ' ' || s.charCodeAt(i) > 127) {2545 // CARE: Manuel is this OK with HOP?2546 if (s.charAt(i) < ' ') {2547 /* non printable character and special chars */2548 res += s.substring(j, i) + "\\x" + s.charCodeAt(i).toString(16);2549 j = i + 1;2550 }2551 // else just let i increase...2552 }2553 }2554 res += s.substring(j, i);2555 return res;2556}2557/* ------------------ display ---------------------------------------------------*/2558/*** META ((export #t)) */2559function sc_display(o, p) {2560 if (p === undefined) // we assume not given2561 p = SC_DEFAULT_OUT;2562 p.appendJSString(sc_toDisplayString(o));2563}2564function sc_toDisplayString(o) {2565 if (o === null)2566 return "()";2567 else if (o === true)2568 return "#t";2569 else if (o === false)2570 return "#f";2571 else if (o === undefined)2572 return "#unspecified";2573 else if (typeof o === 'function')2574 return "#<procedure " + sc_hash(o) + ">";2575 else if (o.sc_toDisplayString)2576 return o.sc_toDisplayString();2577 else2578 return o.toString();2579}2580/* ------------------ newline ---------------------------------------------------*/2581/*** META ((export #t)) */2582function sc_newline(p) {2583 if (p === undefined) // we assume not given2584 p = SC_DEFAULT_OUT;2585 p.appendJSString("\n");2586}2587 2588/* ------------------ write-char ---------------------------------------------------*/2589/*** META ((export #t)) */2590function sc_writeChar(c, p) {2591 if (p === undefined) // we assume not given2592 p = SC_DEFAULT_OUT;2593 p.appendJSString(c.val);2594}2595/* ------------------ write-circle ---------------------------------------------------*/2596/*** META ((export #t)) */2597function sc_writeCircle(o, p) {2598 if (p === undefined) // we assume not given2599 p = SC_DEFAULT_OUT;2600 p.appendJSString(sc_toWriteCircleString(o));2601}2602function sc_toWriteCircleString(o) {2603 var symb = sc_gensym("writeCircle");2604 var nbPointer = new Object();2605 nbPointer.nb = 0;2606 sc_prepWriteCircle(o, symb, nbPointer);2607 return sc_genToWriteCircleString(o, symb);2608}2609function sc_prepWriteCircle(o, symb, nbPointer) {2610 // TODO sc_Struct2611 if (o instanceof sc_Pair ||2612 o instanceof sc_Vector) {2613 if (o[symb] !== undefined) {2614 // not the first visit.2615 o[symb]++;2616 // unless there is already a number, assign one.2617 if (!o[symb + "nb"]) o[symb + "nb"] = nbPointer.nb++;2618 return;2619 }2620 o[symb] = 0;2621 if (o instanceof sc_Pair) {2622 sc_prepWriteCircle(o.car, symb, nbPointer);2623 sc_prepWriteCircle(o.cdr, symb, nbPointer);2624 } else {2625 for (var i = 0; i < o.length; i++)2626 sc_prepWriteCircle(o[i], symb, nbPointer);2627 }2628 }2629}2630function sc_genToWriteCircleString(o, symb) {2631 if (!(o instanceof sc_Pair ||2632 o instanceof sc_Vector))2633 return sc_toWriteString(o);2634 return o.sc_toWriteCircleString(symb);2635}2636sc_Pair.prototype.sc_toWriteCircleString = function(symb, inList) {2637 if (this[symb + "use"]) { // use-flag is set. Just use it.2638 var nb = this[symb + "nb"];2639 if (this[symb]-- === 0) { // if we are the last use. remove all fields.2640 delete this[symb];2641 delete this[symb + "nb"];2642 delete this[symb + "use"];2643 }2644 if (inList)2645 return '. #' + nb + '#';2646 else2647 return '#' + nb + '#';2648 }2649 if (this[symb]-- === 0) { // if we are the last use. remove all fields.2650 delete this[symb];2651 delete this[symb + "nb"];2652 delete this[symb + "use"];2653 }2654 var res = "";2655 2656 if (this[symb] !== undefined) { // implies > 02657 this[symb + "use"] = true;2658 if (inList)2659 res += '. #' + this[symb + "nb"] + '=';2660 else2661 res += '#' + this[symb + "nb"] + '=';2662 inList = false;2663 }2664 if (!inList)2665 res += "(";2666 2667 // print car2668 res += sc_genToWriteCircleString(this.car, symb);2669 2670 if (sc_isPair(this.cdr)) {2671 res += " " + this.cdr.sc_toWriteCircleString(symb, true);2672 } else if (this.cdr !== null) {2673 res += " . " + sc_genToWriteCircleString(this.cdr, symb);2674 }2675 if (!inList)2676 res += ")";2677 return res;2678};2679sc_Vector.prototype.sc_toWriteCircleString = function(symb) {2680 if (this[symb + "use"]) { // use-flag is set. Just use it.2681 var nb = this[symb + "nb"];2682 if (this[symb]-- === 0) { // if we are the last use. remove all fields.2683 delete this[symb];2684 delete this[symb + "nb"];2685 delete this[symb + "use"];2686 }2687 return '#' + nb + '#';2688 }2689 if (this[symb]-- === 0) { // if we are the last use. remove all fields.2690 delete this[symb];2691 delete this[symb + "nb"];2692 delete this[symb + "use"];2693 }2694 var res = "";2695 if (this[symb] !== undefined) { // implies > 02696 this[symb + "use"] = true;2697 res += '#' + this[symb + "nb"] + '=';2698 }2699 res += "#(";2700 for (var i = 0; i < this.length; i++) {2701 res += sc_genToWriteCircleString(this[i], symb);2702 if (i < this.length - 1) res += " ";2703 }2704 res += ")";2705 return res;2706};2707/* ------------------ print ---------------------------------------------------*/2708/*** META ((export #t)) */2709function sc_print(s) {2710 if (arguments.length === 1) {2711 sc_display(s);2712 sc_newline();2713 }2714 else {2715 for (var i = 0; i < arguments.length; i++)2716 sc_display(arguments[i]);2717 sc_newline();2718 }2719}2720/* ------------------ format ---------------------------------------------------*/2721/*** META ((export #t)) */2722function sc_format(s, args) {2723 var len = s.length;2724 var p = new sc_StringOutputPort();2725 var i = 0, j = 1;2726 while( i < len ) {2727 var i2 = s.indexOf("~", i);2728 if (i2 == -1) {2729 p.appendJSString( s.substring( i, len ) );2730 return p.close();2731 } else {2732 if (i2 > i) {2733 if (i2 == (len - 1)) {2734 p.appendJSString(s.substring(i, len));2735 return p.close();2736 } else {2737 p.appendJSString(s.substring(i, i2));2738 i = i2;2739 }2740 }2741 switch(s.charCodeAt(i2 + 1)) {2742 case 65:2743 case 97:2744 // a2745 sc_display(arguments[j], p);2746 i += 2; j++;2747 break;2748 case 83:2749 case 115:2750 // s2751 sc_write(arguments[j], p);2752 i += 2; j++;2753 break;2754 case 86:2755 case 118:2756 // v2757 sc_display(arguments[j], p);2758 p.appendJSString("\n");2759 i += 2; j++;2760 break;2761 case 67:2762 case 99:2763 // c2764 p.appendJSString(String.fromCharCode(arguments[j]));2765 i += 2; j++;2766 break;2767 case 88:2768 case 120:2769 // x2770 p.appendJSString(arguments[j].toString(6));2771 i += 2; j++;2772 break;2773 case 79:2774 case 111:2775 // o2776 p.appendJSString(arguments[j].toString(8));2777 i += 2; j++;2778 break;2779 case 66:2780 case 98:2781 // b2782 p.appendJSString(arguments[j].toString(2));2783 i += 2; j++;2784 break;2785 2786 case 37:2787 case 110:2788 // %, n2789 p.appendJSString("\n");2790 i += 2; break;2791 case 114:2792 // r2793 p.appendJSString("\r");2794 i += 2; break;2795 case 126:2796 // ~2797 p.appendJSString("~");2798 i += 2; break;2799 default:2800 sc_error( "format: illegal ~"2801 + String.fromCharCode(s.charCodeAt(i2 + 1))2802 + " sequence" );2803 return "";2804 }2805 }2806 }2807 return p.close();2808}2809/* ------------------ global ports ---------------------------------------------------*/2810var SC_DEFAULT_IN = new sc_ErrorInputPort();2811var SC_DEFAULT_OUT = new sc_ErrorOutputPort();2812var SC_ERROR_OUT = new sc_ErrorOutputPort();2813var sc_SYMBOL_PREFIX = "\u1E9C";2814var sc_KEYWORD_PREFIX = "\u1E9D";2815/*** META ((export #t)2816 (peephole (id))) */2817function sc_jsstring2string(s) {2818 return s;2819}2820/*** META ((export #t)2821 (peephole (prefix "'\\u1E9C' +")))2822*/2823function sc_jsstring2symbol(s) {2824 return sc_SYMBOL_PREFIX + s;2825}2826/*** META ((export #t)2827 (peephole (id)))2828*/2829function sc_string2jsstring(s) {2830 return s;2831}2832/*** META ((export #t)2833 (peephole (symbol2jsstring_immutable)))2834*/2835function sc_symbol2jsstring(s) {2836 return s.slice(1);2837}2838/*** META ((export #t)2839 (peephole (postfix ".slice(1)")))2840*/2841function sc_keyword2jsstring(k) {2842 return k.slice(1);2843}2844/*** META ((export #t)2845 (peephole (prefix "'\\u1E9D' +")))2846*/2847function sc_jsstring2keyword(s) {2848 return sc_KEYWORD_PREFIX + s;2849}2850/*** META ((export #t)2851 (type bool))2852*/2853function sc_isKeyword(s) {2854 return (typeof s === "string") &&2855 (s.charAt(0) === sc_KEYWORD_PREFIX);2856}2857/*** META ((export #t)) */2858var sc_gensym = function() {2859 var counter = 1000;2860 return function(sym) {2861 counter++;2862 if (!sym) sym = sc_SYMBOL_PREFIX;2863 return sym + "s" + counter + "~" + "^sC-GeNsYm ";2864 };2865}();2866/*** META ((export #t)2867 (type bool))2868*/2869function sc_isEqual(o1, o2) {2870 return ((o1 === o2) ||2871 (sc_isPair(o1) && sc_isPair(o2)2872 && sc_isPairEqual(o1, o2, sc_isEqual)) ||2873 (sc_isVector(o1) && sc_isVector(o2)2874 && sc_isVectorEqual(o1, o2, sc_isEqual)));2875}2876/*** META ((export number->symbol integer->symbol)) */2877function sc_number2symbol(x, radix) {2878 return sc_SYMBOL_PREFIX + sc_number2jsstring(x, radix);2879}2880 2881/*** META ((export number->string integer->string)) */2882var sc_number2string = sc_number2jsstring;2883/*** META ((export #t)) */2884function sc_symbol2number(s, radix) {2885 return sc_jsstring2number(s.slice(1), radix);2886}2887/*** META ((export #t)) */2888var sc_string2number = sc_jsstring2number;2889/*** META ((export #t)2890 (peephole (prefix "+" s)))2891 ;; peephole will only apply if no radix is given.2892*/2893function sc_string2integer(s, radix) {2894 if (!radix) return +s;2895 return parseInt(s, radix);2896}2897/*** META ((export #t)2898 (peephole (prefix "+")))2899*/2900function sc_string2real(s) {2901 return +s;2902}2903/*** META ((export #t)2904 (type bool))2905*/2906function sc_isSymbol(s) {2907 return (typeof s === "string") &&2908 (s.charAt(0) === sc_SYMBOL_PREFIX);2909}2910/*** META ((export #t)2911 (peephole (symbol2string_immutable)))2912*/2913function sc_symbol2string(s) {2914 return s.slice(1);2915}2916/*** META ((export #t)2917 (peephole (prefix "'\\u1E9C' +")))2918*/2919function sc_string2symbol(s) {2920 return sc_SYMBOL_PREFIX + s;2921}2922/*** META ((export symbol-append)2923 (peephole (symbolAppend_immutable)))2924*/2925function sc_symbolAppend() {2926 var res = sc_SYMBOL_PREFIX;2927 for (var i = 0; i < arguments.length; i++)2928 res += arguments[i].slice(1);2929 return res;2930}2931/*** META ((export #t)2932 (peephole (postfix ".val")))2933*/2934function sc_char2string(c) { return c.val; }2935/*** META ((export #t)2936 (peephole (hole 1 "'\\u1E9C' + " c ".val")))2937*/2938function sc_char2symbol(c) { return sc_SYMBOL_PREFIX + c.val; }2939/*** META ((export #t)2940 (type bool))2941*/2942function sc_isString(s) {2943 return (typeof s === "string") &&2944 (s.charAt(0) !== sc_SYMBOL_PREFIX);2945}2946/*** META ((export #t)) */2947var sc_makeString = sc_makejsString;2948/*** META ((export #t)) */2949function sc_string() {2950 for (var i = 0; i < arguments.length; i++)2951 arguments[i] = arguments[i].val;2952 return "".concat.apply("", arguments);2953}2954/*** META ((export #t)2955 (peephole (postfix ".length")))2956*/2957function sc_stringLength(s) { return s.length; }2958/*** META ((export #t)) */2959function sc_stringRef(s, k) {2960 return new sc_Char(s.charAt(k));2961}2962/* there's no stringSet in the immutable version2963function sc_stringSet(s, k, c)2964*/2965/*** META ((export string=?)2966 (type bool)2967 (peephole (hole 2 str1 " === " str2)))2968*/2969function sc_isStringEqual(s1, s2) {2970 return s1 === s2;2971}2972/*** META ((export string<?)2973 (type bool)2974 (peephole (hole 2 str1 " < " str2)))2975*/2976function sc_isStringLess(s1, s2) {2977 return s1 < s2;2978}2979/*** META ((export string>?)2980 (type bool)2981 (peephole (hole 2 str1 " > " str2)))2982*/2983function sc_isStringGreater(s1, s2) {2984 return s1 > s2;2985}2986/*** META ((export string<=?)2987 (type bool)2988 (peephole (hole 2 str1 " <= " str2)))2989*/2990function sc_isStringLessEqual(s1, s2) {2991 return s1 <= s2;2992}2993/*** META ((export string>=?)2994 (type bool)2995 (peephole (hole 2 str1 " >= " str2)))2996*/2997function sc_isStringGreaterEqual(s1, s2) {2998 return s1 >= s2;2999}3000/*** META ((export string-ci=?)3001 (type bool)3002 (peephole (hole 2 str1 ".toLowerCase() === " str2 ".toLowerCase()")))3003*/3004function sc_isStringCIEqual(s1, s2) {3005 return s1.toLowerCase() === s2.toLowerCase();3006}3007/*** META ((export string-ci<?)3008 (type bool)3009 (peephole (hole 2 str1 ".toLowerCase() < " str2 ".toLowerCase()")))3010*/3011function sc_isStringCILess(s1, s2) {3012 return s1.toLowerCase() < s2.toLowerCase();3013}3014/*** META ((export string-ci>?)3015 (type bool)3016 (peephole (hole 2 str1 ".toLowerCase() > " str2 ".toLowerCase()")))3017*/3018function sc_isStringCIGreater(s1, s2) {3019 return s1.toLowerCase() > s2.toLowerCase();3020}3021/*** META ((export string-ci<=?)3022 (type bool)3023 (peephole (hole 2 str1 ".toLowerCase() <= " str2 ".toLowerCase()")))3024*/3025function sc_isStringCILessEqual(s1, s2) {3026 return s1.toLowerCase() <= s2.toLowerCase();3027}3028/*** META ((export string-ci>=?)3029 (type bool)3030 (peephole (hole 2 str1 ".toLowerCase() >= " str2 ".toLowerCase()")))3031*/3032function sc_isStringCIGreaterEqual(s1, s2) {3033 return s1.toLowerCase() >= s2.toLowerCase();3034}3035/*** META ((export #t)3036 (peephole (hole 3 s ".substring(" start ", " end ")")))3037*/3038function sc_substring(s, start, end) {3039 return s.substring(start, end);3040}3041/*** META ((export #t))3042*/3043function sc_isSubstring_at(s1, s2, i) {3044 return s2 == s1.substring(i, i+ s2.length);3045}3046/*** META ((export #t)3047 (peephole (infix 0 #f "+" "''")))3048*/3049function sc_stringAppend() {3050 return "".concat.apply("", arguments);3051}3052/*** META ((export #t)) */3053var sc_string2list = sc_jsstring2list;3054/*** META ((export #t)) */3055var sc_list2string = sc_list2jsstring;3056/*** META ((export #t)3057 (peephole (id)))3058*/3059function sc_stringCopy(s) {3060 return s;3061}3062/* there's no string-fill in the immutable version3063function sc_stringFill(s, c)3064*/3065/*** META ((export #t)3066 (peephole (postfix ".slice(1)")))3067*/3068function sc_keyword2string(o) {3069 return o.slice(1);3070}3071/*** META ((export #t)3072 (peephole (prefix "'\\u1E9D' +")))3073*/3074function sc_string2keyword(o) {3075 return sc_KEYWORD_PREFIX + o;3076}3077String.prototype.sc_toDisplayString = function() {3078 if (this.charAt(0) === sc_SYMBOL_PREFIX)3079 // TODO: care for symbols with spaces (escape-chars symbols).3080 return this.slice(1);3081 else if (this.charAt(0) === sc_KEYWORD_PREFIX)3082 return ":" + this.slice(1);3083 else3084 return this.toString();3085};3086String.prototype.sc_toWriteString = function() {3087 if (this.charAt(0) === sc_SYMBOL_PREFIX)3088 // TODO: care for symbols with spaces (escape-chars symbols).3089 return this.slice(1);3090 else if (this.charAt(0) === sc_KEYWORD_PREFIX)3091 return ":" + this.slice(1);3092 else3093 return '"' + sc_escapeWriteString(this) + '"';3094};3095/* Exported Variables */3096var BgL_testzd2boyerzd2;3097var BgL_nboyerzd2benchmarkzd2;3098var BgL_setupzd2boyerzd2;3099/* End Exports */3100var translate_term_nboyer;3101var translate_args_nboyer;3102var untranslate_term_nboyer;3103var BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer;3104var BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer;3105var translate_alist_nboyer;3106var apply_subst_nboyer;3107var apply_subst_lst_nboyer;3108var tautologyp_nboyer;3109var if_constructor_nboyer;3110var rewrite_count_nboyer;3111var rewrite_nboyer;3112var rewrite_args_nboyer;3113var unify_subst_nboyer;3114var one_way_unify1_nboyer;3115var false_term_nboyer;3116var true_term_nboyer;3117var trans_of_implies1_nboyer;3118var is_term_equal_nboyer;3119var is_term_member_nboyer;3120var const_nboyer;3121var sc_const_3_nboyer;3122var sc_const_4_nboyer;3123{3124 (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)))))));3125 (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))))))));3126 (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)))))))))));3127 BgL_nboyerzd2benchmarkzd2 = function() {3128 var args = null;3129 for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {3130 args = sc_cons(arguments[sc_tmp], args);3131 }3132 var n;3133 return ((n = ((args === null)?(0):(args.car))), (BgL_setupzd2boyerzd2()), (BgL_runzd2benchmarkzd2(("nboyer"+(sc_number2string(n))), (1), function() {3134 return (BgL_testzd2boyerzd2(n));3135 }, function(rewrites) {3136 if ((sc_isNumber(rewrites)))3137 switch (n) {3138 case (0):3139 return (rewrites===(95024));3140 break;3141 case (1):3142 return (rewrites===(591777));3143 break;3144 case (2):3145 return (rewrites===(1813975));3146 break;3147 case (3):3148 return (rewrites===(5375678));3149 break;3150 case (4):3151 return (rewrites===(16445406));3152 break;3153 case (5):3154 return (rewrites===(51507739));3155 break;3156 default:3157 return true;3158 break;3159 }3160 else3161 return false;3162 })));3163 };3164 BgL_setupzd2boyerzd2 = function() {3165 return true;3166 };3167 BgL_testzd2boyerzd2 = function() {3168 return true;3169 };3170 translate_term_nboyer = function(term) {3171 var lst;3172 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))))))))));3173 };3174 translate_args_nboyer = function(lst) {3175 var sc_lst_5;3176 var term;3177 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))))))))));3178 };3179 untranslate_term_nboyer = function(term) {3180 var optrOpnd;3181 var tail1131;3182 var L1127;3183 var falseHead1130;3184 var symbol_record;3185 if (!(term instanceof sc_Pair))3186 return term;3187 else3188 {3189 (falseHead1130 = (new sc_Pair(null, null)));3190 (L1127 = (term.cdr));3191 (tail1131 = falseHead1130);3192 while (!(L1127 === null)) {3193 {3194 (tail1131.cdr = (new sc_Pair((untranslate_term_nboyer((L1127.car))), null)));3195 (tail1131 = (tail1131.cdr));3196 (L1127 = (L1127.cdr));3197 }3198 }3199 (optrOpnd = (falseHead1130.cdr));3200 return (new sc_Pair(((symbol_record = (term.car)), (symbol_record[(0)])), optrOpnd));3201 }3202 };3203 BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer = function(sym) {3204 var r;3205 var x;3206 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)));3207 };3208 (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);3209 translate_alist_nboyer = function(alist) {3210 var sc_alist_6;3211 var term;3212 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))))))))));3213 };3214 apply_subst_nboyer = function(alist, term) {3215 var lst;3216 var temp_temp;3217 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))))))))));3218 };3219 apply_subst_lst_nboyer = function(alist, lst) {3220 var sc_lst_7;3221 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))))))))));3222 };3223 tautologyp_nboyer = function(sc_x_11, true_lst, false_lst) {3224 var tmp1125;3225 var x;3226 var tmp1126;3227 var sc_x_8;3228 var sc_tmp1125_9;3229 var sc_tmp1126_10;3230 var sc_x_11;3231 var true_lst;3232 var false_lst;3233 while (true) {3234 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))3235 return true;3236 else3237 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))3238 return false;3239 else3240 if (!(sc_x_11 instanceof sc_Pair))3241 return false;3242 else3243 if (((sc_x_11.car)===if_constructor_nboyer))3244 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))3245 (sc_x_11 = (sc_x_11.cdr.cdr.car));3246 else3247 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))3248 (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));3249 else3250 if (((tautologyp_nboyer((sc_x_11.cdr.cdr.car), (new sc_Pair((sc_x_11.cdr.car), true_lst)), false_lst))!== false))3251 {3252 (false_lst = (new sc_Pair((sc_x_11.cdr.car), false_lst)));3253 (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));3254 }3255 else3256 return false;3257 else3258 return false;3259 }3260 };3261 (if_constructor_nboyer = "\u1E9C*");3262 (rewrite_count_nboyer = (0));3263 rewrite_nboyer = function(term) {3264 var term2;3265 var sc_term_12;3266 var lst;3267 var symbol_record;3268 var sc_lst_13;3269 {3270 (++rewrite_count_nboyer);3271 if (!(term instanceof sc_Pair))3272 return term;3273 else3274 {3275 (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))))))))));3276 (lst = ((symbol_record = (term.car)), (symbol_record[(1)])));3277 while (true) {3278 if ((lst === null))3279 return sc_term_12;3280 else3281 if ((((term2 = ((lst.car).cdr.car)), (unify_subst_nboyer = null), (one_way_unify1_nboyer(sc_term_12, term2)))!== false))3282 return (rewrite_nboyer((apply_subst_nboyer(unify_subst_nboyer, ((lst.car).cdr.cdr.car)))));3283 else3284 (lst = (lst.cdr));3285 }3286 }3287 }3288 };3289 rewrite_args_nboyer = function(lst) {3290 var sc_lst_14;3291 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))))))))));3292 };3293 (unify_subst_nboyer = "\u1E9C*");3294 one_way_unify1_nboyer = function(term1, term2) {3295 var lst1;3296 var lst2;3297 var temp_temp;3298 if (!(term2 instanceof sc_Pair))3299 {3300 (temp_temp = (sc_assq(term2, unify_subst_nboyer)));3301 if ((temp_temp!== false))3302 return (is_term_equal_nboyer(term1, (temp_temp.cdr)));3303 else3304 if ((sc_isNumber(term2)))3305 return (sc_isEqual(term1, term2));3306 else3307 {3308 (unify_subst_nboyer = (new sc_Pair((new sc_Pair(term2, term1)), unify_subst_nboyer)));3309 return true;3310 }3311 }3312 else3313 if (!(term1 instanceof sc_Pair))3314 return false;3315 else3316 if (((term1.car)===(term2.car)))3317 {3318 (lst1 = (term1.cdr));3319 (lst2 = (term2.cdr));3320 while (true) {3321 if ((lst1 === null))3322 return (lst2 === null);3323 else3324 if ((lst2 === null))3325 return false;3326 else3327 if (((one_way_unify1_nboyer((lst1.car), (lst2.car)))!== false))3328 {3329 (lst1 = (lst1.cdr));3330 (lst2 = (lst2.cdr));3331 }3332 else3333 return false;3334 }3335 }3336 else3337 return false;3338 };3339 (false_term_nboyer = "\u1E9C*");3340 (true_term_nboyer = "\u1E9C*");3341 trans_of_implies1_nboyer = function(n) {3342 var sc_n_15;3343 return ((sc_isEqual(n, (1)))?(sc_list("\u1E9Cimplies", (0), (1))):(sc_list("\u1E9Cand", (sc_list("\u1E9Cimplies", (n-(1)), n)), ((sc_n_15 = (n-(1))), ((sc_isEqual(sc_n_15, (1)))?(sc_list("\u1E9Cimplies", (0), (1))):(sc_list("\u1E9Cand", (sc_list("\u1E9Cimplies", (sc_n_15-(1)), sc_n_15)), (trans_of_implies1_nboyer((sc_n_15-(1)))))))))));3344 };3345 is_term_equal_nboyer = function(x, y) {3346 var lst1;3347 var lst2;3348 var r2;3349 var r1;3350 if ((x instanceof sc_Pair))3351 if ((y instanceof sc_Pair))3352 if ((((r1 = (x.car)), (r2 = (y.car)), (r1===r2))!== false))3353 {3354 (lst1 = (x.cdr));3355 (lst2 = (y.cdr));3356 while (true) {3357 if ((lst1 === null))3358 return (lst2 === null);3359 else3360 if ((lst2 === null))3361 return false;3362 else3363 if (((is_term_equal_nboyer((lst1.car), (lst2.car)))!== false))3364 {3365 (lst1 = (lst1.cdr));3366 (lst2 = (lst2.cdr));3367 }3368 else3369 return false;3370 }3371 }3372 else3373 return false;3374 else3375 return false;3376 else3377 return (sc_isEqual(x, y));3378 };3379 is_term_member_nboyer = function(x, lst) {3380 var x;3381 var lst;3382 while (true) {3383 if ((lst === null))3384 return false;3385 else3386 if (((is_term_equal_nboyer(x, (lst.car)))!== false))3387 return true;3388 else3389 (lst = (lst.cdr));3390 }3391 };3392 BgL_setupzd2boyerzd2 = function() {3393 var symbol_record;3394 var value;3395 var BgL_sc_symbolzd2record_16zd2;3396 var sym;3397 var sc_sym_17;3398 var term;3399 var lst;3400 var sc_term_18;3401 var sc_term_19;3402 {3403 (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);3404 (if_constructor_nboyer = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer("\u1E9Cif")));3405 (false_term_nboyer = ((sc_term_19 = (new sc_Pair("\u1E9Cf",null))), (!(sc_term_19 instanceof sc_Pair)?sc_term_19:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_19.car))), (translate_args_nboyer((sc_term_19.cdr))))))));3406 (true_term_nboyer = ((sc_term_18 = (new sc_Pair("\u1E9Ct",null))), (!(sc_term_18 instanceof sc_Pair)?sc_term_18:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_18.car))), (translate_args_nboyer((sc_term_18.cdr))))))));3407 (lst = sc_const_3_nboyer);3408 while (!(lst === null)) {3409 {3410 (term = (lst.car));3411 if (((term instanceof sc_Pair)&&(((term.car)==="\u1E9Cequal")&&((term.cdr.car) instanceof sc_Pair))))3412 {3413 (sc_sym_17 = ((term.cdr.car).car));3414 (value = (new sc_Pair((!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr)))))), ((sym = ((term.cdr.car).car)), (BgL_sc_symbolzd2record_16zd2 = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sym))), (BgL_sc_symbolzd2record_16zd2[(1)])))));3415 (symbol_record = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sc_sym_17)));3416 (symbol_record[(1)] = value);3417 }3418 else3419 (sc_error("ADD-LEMMA did not like term: ", term));3420 (lst = (lst.cdr));3421 }3422 }3423 return true;3424 }3425 };3426 BgL_testzd2boyerzd2 = function(n) {3427 var optrOpnd;3428 var term;3429 var sc_n_20;3430 var answer;3431 var sc_term_21;3432 var sc_term_22;3433 {3434 (rewrite_count_nboyer = (0));3435 (term = sc_const_4_nboyer);3436 (sc_n_20 = n);3437 while (!(sc_n_20=== 0)) {3438 {3439 (term = (sc_list("\u1E9Cor", term, (new sc_Pair("\u1E9Cf",null)))));3440 (--sc_n_20);3441 }3442 }3443 (sc_term_22 = term);3444 if (!(sc_term_22 instanceof sc_Pair))3445 (optrOpnd = sc_term_22);3446 else3447 (optrOpnd = (new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_22.car))), (translate_args_nboyer((sc_term_22.cdr))))));3448 (sc_term_21 = (apply_subst_nboyer(((const_nboyer === null)?null:(new sc_Pair((new sc_Pair((const_nboyer.car.car), (translate_term_nboyer((const_nboyer.car.cdr))))), (translate_alist_nboyer((const_nboyer.cdr)))))), optrOpnd)));3449 (answer = (tautologyp_nboyer((rewrite_nboyer(sc_term_21)), null, null)));3450 (sc_write(rewrite_count_nboyer));3451 (sc_display(" rewrites"));3452 (sc_newline());3453 if ((answer!== false))3454 return rewrite_count_nboyer;3455 else3456 return false;3457 }3458 };3459}3460/* Exported Variables */3461var BgL_parsezd2ze3nbzd2treesze3;3462var BgL_earleyzd2benchmarkzd2;3463var BgL_parsezd2ze3parsedzf3zc2;3464var test;3465var BgL_parsezd2ze3treesz31;3466var BgL_makezd2parserzd2;3467/* End Exports */3468var const_earley;3469{3470 (const_earley = (new sc_Pair((new sc_Pair("\u1E9Cs",(new sc_Pair((new sc_Pair("\u1E9Ca",null)),(new sc_Pair((new sc_Pair("\u1E9Cs",(new sc_Pair("\u1E9Cs",null)))),null)))))),null)));3471 BgL_makezd2parserzd2 = function(grammar, lexer) {3472 var i;3473 var parser_descr;3474 var def_loop;3475 var nb_nts;3476 var names;3477 var steps;3478 var predictors;3479 var enders;3480 var starters;3481 var nts;3482 var sc_names_1;3483 var sc_steps_2;3484 var sc_predictors_3;3485 var sc_enders_4;3486 var sc_starters_5;3487 var nb_confs;3488 var BgL_sc_defzd2loop_6zd2;3489 var BgL_sc_nbzd2nts_7zd2;3490 var sc_nts_8;3491 var BgL_sc_defzd2loop_9zd2;3492 var ind;3493 {3494 ind = function(nt, sc_nts_10) {3495 var i;3496 {3497 (i = ((sc_nts_10.length)-(1)));3498 while (true) {3499 if ((i>=(0)))3500 if ((sc_isEqual((sc_nts_10[i]), nt)))3501 return i;3502 else3503 (--i);3504 else3505 return false;3506 }3507 }3508 };3509 (sc_nts_8 = ((BgL_sc_defzd2loop_9zd2 = function(defs, sc_nts_11) {3510 var rule_loop;3511 var head;3512 var def;3513 return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, sc_nts_12) {3514 var nt;3515 var l;3516 var sc_nts_13;3517 var rule;3518 if ((rules instanceof sc_Pair))3519 {3520 (rule = (rules.car));3521 (l = rule);3522 (sc_nts_13 = sc_nts_12);3523 while ((l instanceof sc_Pair)) {3524 {3525 (nt = (l.car));3526 (l = (l.cdr));3527 (sc_nts_13 = (((sc_member(nt, sc_nts_13))!== false)?sc_nts_13:(new sc_Pair(nt, sc_nts_13))));3528 }3529 }3530 return (rule_loop((rules.cdr), sc_nts_13));3531 }3532 else3533 return (BgL_sc_defzd2loop_9zd2((defs.cdr), sc_nts_12));3534 }), (rule_loop((def.cdr), (((sc_member(head, sc_nts_11))!== false)?sc_nts_11:(new sc_Pair(head, sc_nts_11)))))):(sc_list2vector((sc_reverse(sc_nts_11)))));3535 }), (BgL_sc_defzd2loop_9zd2(grammar, null))));3536 (BgL_sc_nbzd2nts_7zd2 = (sc_nts_8.length));3537 (nb_confs = (((BgL_sc_defzd2loop_6zd2 = function(defs, BgL_sc_nbzd2confs_14zd2) {3538 var rule_loop;3539 var def;3540 return ((defs instanceof sc_Pair)?((def = (defs.car)), (rule_loop = function(rules, BgL_sc_nbzd2confs_15zd2) {3541 var l;3542 var BgL_sc_nbzd2confs_16zd2;3543 var rule;3544 if ((rules instanceof sc_Pair))3545 {3546 (rule = (rules.car));3547 (l = rule);3548 (BgL_sc_nbzd2confs_16zd2 = BgL_sc_nbzd2confs_15zd2);3549 while ((l instanceof sc_Pair)) {3550 {3551 (l = (l.cdr));3552 (++BgL_sc_nbzd2confs_16zd2);3553 }3554 }3555 return (rule_loop((rules.cdr), (BgL_sc_nbzd2confs_16zd2+(1))));3556 }3557 else3558 return (BgL_sc_defzd2loop_6zd2((defs.cdr), BgL_sc_nbzd2confs_15zd2));3559 }), (rule_loop((def.cdr), BgL_sc_nbzd2confs_14zd2))):BgL_sc_nbzd2confs_14zd2);3560 }), (BgL_sc_defzd2loop_6zd2(grammar, (0))))+BgL_sc_nbzd2nts_7zd2));3561 (sc_starters_5 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));3562 (sc_enders_4 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));3563 (sc_predictors_3 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));3564 (sc_steps_2 = (sc_makeVector(nb_confs, false)));3565 (sc_names_1 = (sc_makeVector(nb_confs, false)));3566 (nts = sc_nts_8);3567 (starters = sc_starters_5);3568 (enders = sc_enders_4);3569 (predictors = sc_predictors_3);3570 (steps = sc_steps_2);3571 (names = sc_names_1);3572 (nb_nts = (sc_nts_8.length));3573 (i = (nb_nts-(1)));3574 while ((i>=(0))) {3575 {3576 (sc_steps_2[i] = (i-nb_nts));3577 (sc_names_1[i] = (sc_list((sc_nts_8[i]), (0))));3578 (sc_enders_4[i] = (sc_list(i)));3579 (--i);3580 }3581 }3582 def_loop = function(defs, conf) {3583 var rule_loop;3584 var head;3585 var def;3586 return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, conf, rule_num) {3587 var i;3588 var sc_i_17;3589 var nt;3590 var l;3591 var sc_conf_18;3592 var sc_i_19;3593 var rule;3594 if ((rules instanceof sc_Pair))3595 {3596 (rule = (rules.car));3597 (names[conf] = (sc_list(head, rule_num)));3598 (sc_i_19 = (ind(head, nts)));3599 (starters[sc_i_19] = (new sc_Pair(conf, (starters[sc_i_19]))));3600 (l = rule);3601 (sc_conf_18 = conf);3602 while ((l instanceof sc_Pair)) {3603 {3604 (nt = (l.car));3605 (steps[sc_conf_18] = (ind(nt, nts)));3606 (sc_i_17 = (ind(nt, nts)));3607 (predictors[sc_i_17] = (new sc_Pair(sc_conf_18, (predictors[sc_i_17]))));3608 (l = (l.cdr));3609 (++sc_conf_18);3610 }3611 }3612 (steps[sc_conf_18] = ((ind(head, nts))-nb_nts));3613 (i = (ind(head, nts)));3614 (enders[i] = (new sc_Pair(sc_conf_18, (enders[i]))));3615 return (rule_loop((rules.cdr), (sc_conf_18+(1)), (rule_num+(1))));3616 }3617 else3618 return (def_loop((defs.cdr), conf));3619 }), (rule_loop((def.cdr), conf, (1)))):undefined);3620 };3621 (def_loop(grammar, (sc_nts_8.length)));3622 (parser_descr = [lexer, sc_nts_8, sc_starters_5, sc_enders_4, sc_predictors_3, sc_steps_2, sc_names_1]);3623 return function(input) {3624 var optrOpnd;3625 var sc_optrOpnd_20;3626 var sc_optrOpnd_21;3627 var sc_optrOpnd_22;3628 var loop1;3629 var BgL_sc_stateza2_23za2;3630 var toks;3631 var BgL_sc_nbzd2nts_24zd2;3632 var sc_steps_25;3633 var sc_enders_26;3634 var state_num;3635 var BgL_sc_statesza2_27za2;3636 var states;3637 var i;3638 var conf;3639 var l;3640 var tok_nts;3641 var sc_i_28;3642 var sc_i_29;3643 var l1;3644 var l2;3645 var tok;3646 var tail1129;3647 var L1125;3648 var goal_enders;3649 var BgL_sc_statesza2_30za2;3650 var BgL_sc_nbzd2nts_31zd2;3651 var BgL_sc_nbzd2confs_32zd2;3652 var nb_toks;3653 var goal_starters;3654 var sc_states_33;3655 var BgL_sc_nbzd2confs_34zd2;3656 var BgL_sc_nbzd2toks_35zd2;3657 var sc_toks_36;3658 var falseHead1128;3659 var sc_names_37;3660 var sc_steps_38;3661 var sc_predictors_39;3662 var sc_enders_40;3663 var sc_starters_41;3664 var sc_nts_42;3665 var lexer;3666 var sc_ind_43;3667 var make_states;3668 var BgL_sc_confzd2setzd2getza2_44za2;3669 var conf_set_merge_new_bang;3670 var conf_set_adjoin;3671 var BgL_sc_confzd2setzd2adjoinza2_45za2;3672 var BgL_sc_confzd2setzd2adjoinza2za2_46z00;3673 var conf_set_union;3674 var forw;3675 var is_parsed;3676 var deriv_trees;3677 var BgL_sc_derivzd2treesza2_47z70;3678 var nb_deriv_trees;3679 var BgL_sc_nbzd2derivzd2treesza2_48za2;3680 {3681 sc_ind_43 = function(nt, sc_nts_49) {3682 var i;3683 {3684 (i = ((sc_nts_49.length)-(1)));3685 while (true) {3686 if ((i>=(0)))3687 if ((sc_isEqual((sc_nts_49[i]), nt)))3688 return i;3689 else3690 (--i);3691 else3692 return false;3693 }3694 }3695 };3696 make_states = function(BgL_sc_nbzd2toks_50zd2, BgL_sc_nbzd2confs_51zd2) {3697 var v;3698 var i;3699 var sc_states_52;3700 {3701 (sc_states_52 = (sc_makeVector((BgL_sc_nbzd2toks_50zd2+(1)), false)));3702 (i = BgL_sc_nbzd2toks_50zd2);3703 while ((i>=(0))) {3704 {3705 (v = (sc_makeVector((BgL_sc_nbzd2confs_51zd2+(1)), false)));3706 (v[(0)] = (-1));3707 (sc_states_52[i] = v);3708 (--i);3709 }3710 }3711 return sc_states_52;3712 }3713 };3714 BgL_sc_confzd2setzd2getza2_44za2 = function(state, BgL_sc_statezd2num_53zd2, sc_conf_54) {3715 var conf_set;3716 var BgL_sc_confzd2set_55zd2;3717 return ((BgL_sc_confzd2set_55zd2 = (state[(sc_conf_54+(1))])), ((BgL_sc_confzd2set_55zd2!== false)?BgL_sc_confzd2set_55zd2:((conf_set = (sc_makeVector((BgL_sc_statezd2num_53zd2+(6)), false))), (conf_set[(1)] = (-3)), (conf_set[(2)] = (-1)), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1)), (state[(sc_conf_54+(1))] = conf_set), conf_set)));3718 };3719 conf_set_merge_new_bang = function(conf_set) {3720 return ((conf_set[((conf_set[(1)])+(5))] = (conf_set[(4)])), (conf_set[(1)] = (conf_set[(3)])), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1)));3721 };3722 conf_set_adjoin = function(state, conf_set, sc_conf_56, i) {3723 var tail;3724 return ((tail = (conf_set[(3)])), (conf_set[(i+(5))] = (-1)), (conf_set[(tail+(5))] = i), (conf_set[(3)] = i), ((tail<(0))?((conf_set[(0)] = (state[(0)])), (state[(0)] = sc_conf_56)):undefined));3725 };3726 BgL_sc_confzd2setzd2adjoinza2_45za2 = function(sc_states_57, BgL_sc_statezd2num_58zd2, l, i) {3727 var conf_set;3728 var sc_conf_59;3729 var l1;3730 var state;3731 {3732 (state = (sc_states_57[BgL_sc_statezd2num_58zd2]));3733 (l1 = l);3734 while ((l1 instanceof sc_Pair)) {3735 {3736 (sc_conf_59 = (l1.car));3737 (conf_set = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_58zd2, sc_conf_59)));3738 if (((conf_set[(i+(5))])=== false))3739 {3740 (conf_set_adjoin(state, conf_set, sc_conf_59, i));3741 (l1 = (l1.cdr));3742 }3743 else3744 (l1 = (l1.cdr));3745 }3746 }3747 return undefined;3748 }3749 };3750 BgL_sc_confzd2setzd2adjoinza2za2_46z00 = function(sc_states_60, BgL_sc_statesza2_61za2, BgL_sc_statezd2num_62zd2, sc_conf_63, i) {3751 var BgL_sc_confzd2setza2_64z70;3752 var BgL_sc_stateza2_65za2;3753 var conf_set;3754 var state;3755 return ((state = (sc_states_60[BgL_sc_statezd2num_62zd2])), ((((conf_set = (state[(sc_conf_63+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)?((BgL_sc_stateza2_65za2 = (BgL_sc_statesza2_61za2[BgL_sc_statezd2num_62zd2])), (BgL_sc_confzd2setza2_64z70 = (BgL_sc_confzd2setzd2getza2_44za2(BgL_sc_stateza2_65za2, BgL_sc_statezd2num_62zd2, sc_conf_63))), (((BgL_sc_confzd2setza2_64z70[(i+(5))])=== false)?(conf_set_adjoin(BgL_sc_stateza2_65za2, BgL_sc_confzd2setza2_64z70, sc_conf_63, i)):undefined), true):false));3756 };3757 conf_set_union = function(state, conf_set, sc_conf_66, other_set) {3758 var i;3759 {3760 (i = (other_set[(2)]));3761 while ((i>=(0))) {3762 if (((conf_set[(i+(5))])=== false))3763 {3764 (conf_set_adjoin(state, conf_set, sc_conf_66, i));3765 (i = (other_set[(i+(5))]));3766 }3767 else3768 (i = (other_set[(i+(5))]));3769 }3770 return undefined;3771 }3772 };3773 forw = function(sc_states_67, BgL_sc_statezd2num_68zd2, sc_starters_69, sc_enders_70, sc_predictors_71, sc_steps_72, sc_nts_73) {3774 var next_set;3775 var next;3776 var conf_set;3777 var ender;3778 var l;3779 var starter_set;3780 var starter;3781 var sc_l_74;3782 var sc_loop1_75;3783 var head;3784 var BgL_sc_confzd2set_76zd2;3785 var BgL_sc_statezd2num_77zd2;3786 var state;3787 var sc_states_78;3788 var preds;3789 var BgL_sc_confzd2set_79zd2;3790 var step;3791 var sc_conf_80;3792 var BgL_sc_nbzd2nts_81zd2;3793 var sc_state_82;3794 {3795 (sc_state_82 = (sc_states_67[BgL_sc_statezd2num_68zd2]));3796 (BgL_sc_nbzd2nts_81zd2 = (sc_nts_73.length));3797 while (true) {3798 {3799 (sc_conf_80 = (sc_state_82[(0)]));3800 if ((sc_conf_80>=(0)))3801 {3802 (step = (sc_steps_72[sc_conf_80]));3803 (BgL_sc_confzd2set_79zd2 = (sc_state_82[(sc_conf_80+(1))]));3804 (head = (BgL_sc_confzd2set_79zd2[(4)]));3805 (sc_state_82[(0)] = (BgL_sc_confzd2set_79zd2[(0)]));3806 (conf_set_merge_new_bang(BgL_sc_confzd2set_79zd2));3807 if ((step>=(0)))3808 {3809 (sc_l_74 = (sc_starters_69[step]));3810 while ((sc_l_74 instanceof sc_Pair)) {3811 {3812 (starter = (sc_l_74.car));3813 (starter_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, starter)));3814 if (((starter_set[(BgL_sc_statezd2num_68zd2+(5))])=== false))3815 {3816 (conf_set_adjoin(sc_state_82, starter_set, starter, BgL_sc_statezd2num_68zd2));3817 (sc_l_74 = (sc_l_74.cdr));3818 }3819 else3820 (sc_l_74 = (sc_l_74.cdr));3821 }3822 }3823 (l = (sc_enders_70[step]));3824 while ((l instanceof sc_Pair)) {3825 {3826 (ender = (l.car));3827 if ((((conf_set = (sc_state_82[(ender+(1))])), ((conf_set!== false)?(conf_set[(BgL_sc_statezd2num_68zd2+(5))]):false))!== false))3828 {3829 (next = (sc_conf_80+(1)));3830 (next_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, next)));3831 (conf_set_union(sc_state_82, next_set, next, BgL_sc_confzd2set_79zd2));3832 (l = (l.cdr));3833 }3834 else3835 (l = (l.cdr));3836 }3837 }3838 }3839 else3840 {3841 (preds = (sc_predictors_71[(step+BgL_sc_nbzd2nts_81zd2)]));3842 (sc_states_78 = sc_states_67);3843 (state = sc_state_82);3844 (BgL_sc_statezd2num_77zd2 = BgL_sc_statezd2num_68zd2);3845 (BgL_sc_confzd2set_76zd2 = BgL_sc_confzd2set_79zd2);3846 sc_loop1_75 = function(l) {3847 var sc_state_83;3848 var BgL_sc_nextzd2set_84zd2;3849 var sc_next_85;3850 var pred_set;3851 var i;3852 var pred;3853 if ((l instanceof sc_Pair))3854 {3855 (pred = (l.car));3856 (i = head);3857 while ((i>=(0))) {3858 {3859 (pred_set = ((sc_state_83 = (sc_states_78[i])), (sc_state_83[(pred+(1))])));3860 if ((pred_set!== false))3861 {3862 (sc_next_85 = (pred+(1)));3863 (BgL_sc_nextzd2set_84zd2 = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_77zd2, sc_next_85)));3864 (conf_set_union(state, BgL_sc_nextzd2set_84zd2, sc_next_85, pred_set));3865 }3866 (i = (BgL_sc_confzd2set_76zd2[(i+(5))]));3867 }3868 }3869 return (sc_loop1_75((l.cdr)));3870 }3871 else3872 return undefined;3873 };3874 (sc_loop1_75(preds));3875 }3876 }3877 else3878 return undefined;3879 }3880 }3881 }3882 };3883 is_parsed = function(nt, i, j, sc_nts_86, sc_enders_87, sc_states_88) {3884 var conf_set;3885 var state;3886 var sc_conf_89;3887 var l;3888 var BgL_sc_ntza2_90za2;3889 {3890 (BgL_sc_ntza2_90za2 = (sc_ind_43(nt, sc_nts_86)));3891 if ((BgL_sc_ntza2_90za2!== false))3892 {3893 (sc_nts_86.length);3894 (l = (sc_enders_87[BgL_sc_ntza2_90za2]));3895 while (true) {3896 if ((l instanceof sc_Pair))3897 {3898 (sc_conf_89 = (l.car));3899 if ((((state = (sc_states_88[j])), (conf_set = (state[(sc_conf_89+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))3900 return true;3901 else3902 (l = (l.cdr));3903 }3904 else3905 return false;3906 }3907 }3908 else3909 return false;3910 }3911 };3912 deriv_trees = function(sc_conf_91, i, j, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2) {3913 var sc_loop1_98;3914 var prev;3915 var name;3916 return ((name = (sc_names_94[sc_conf_91])), ((name!== false)?((sc_conf_91<BgL_sc_nbzd2nts_97zd2)?(sc_list((sc_list(name, ((sc_toks_95[i]).car))))):(sc_list((sc_list(name))))):((prev = (sc_conf_91-(1))), (sc_loop1_98 = function(l1, l2) {3917 var loop2;3918 var ender_set;3919 var state;3920 var ender;3921 var l1;3922 var l2;3923 while (true) {3924 if ((l1 instanceof sc_Pair))3925 {3926 (ender = (l1.car));3927 (ender_set = ((state = (sc_states_96[j])), (state[(ender+(1))])));3928 if ((ender_set!== false))3929 {3930 loop2 = function(k, l2) {3931 var loop3;3932 var ender_trees;3933 var prev_trees;3934 var conf_set;3935 var sc_state_99;3936 var k;3937 var l2;3938 while (true) {3939 if ((k>=(0)))3940 if (((k>=i)&&(((sc_state_99 = (sc_states_96[k])), (conf_set = (sc_state_99[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)))3941 {3942 (prev_trees = (deriv_trees(prev, i, k, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2)));3943 (ender_trees = (deriv_trees(ender, k, j, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2)));3944 loop3 = function(l3, l2) {3945 var l4;3946 var sc_l2_100;3947 var ender_tree;3948 if ((l3 instanceof sc_Pair))3949 {3950 (ender_tree = (sc_list((l3.car))));3951 (l4 = prev_trees);3952 (sc_l2_100 = l2);3953 while ((l4 instanceof sc_Pair)) {3954 {3955 (sc_l2_100 = (new sc_Pair((sc_append((l4.car), ender_tree)), sc_l2_100)));3956 (l4 = (l4.cdr));3957 }3958 }3959 return (loop3((l3.cdr), sc_l2_100));3960 }3961 else3962 return (loop2((ender_set[(k+(5))]), l2));3963 };3964 return (loop3(ender_trees, l2));3965 }3966 else3967 (k = (ender_set[(k+(5))]));3968 else3969 return (sc_loop1_98((l1.cdr), l2));3970 }3971 };3972 return (loop2((ender_set[(2)]), l2));3973 }3974 else3975 (l1 = (l1.cdr));3976 }3977 else3978 return l2;3979 }3980 }), (sc_loop1_98((sc_enders_92[(sc_steps_93[prev])]), null)))));3981 };3982 BgL_sc_derivzd2treesza2_47z70 = function(nt, i, j, sc_nts_101, sc_enders_102, sc_steps_103, sc_names_104, sc_toks_105, sc_states_106) {3983 var conf_set;3984 var state;3985 var sc_conf_107;3986 var l;3987 var trees;3988 var BgL_sc_nbzd2nts_108zd2;3989 var BgL_sc_ntza2_109za2;3990 {3991 (BgL_sc_ntza2_109za2 = (sc_ind_43(nt, sc_nts_101)));3992 if ((BgL_sc_ntza2_109za2!== false))3993 {3994 (BgL_sc_nbzd2nts_108zd2 = (sc_nts_101.length));3995 (l = (sc_enders_102[BgL_sc_ntza2_109za2]));3996 (trees = null);3997 while ((l instanceof sc_Pair)) {3998 {3999 (sc_conf_107 = (l.car));4000 if ((((state = (sc_states_106[j])), (conf_set = (state[(sc_conf_107+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))4001 {4002 (l = (l.cdr));4003 (trees = (sc_append((deriv_trees(sc_conf_107, i, j, sc_enders_102, sc_steps_103, sc_names_104, sc_toks_105, sc_states_106, BgL_sc_nbzd2nts_108zd2)), trees)));4004 }4005 else4006 (l = (l.cdr));4007 }4008 }4009 return trees;4010 }4011 else4012 return false;4013 }4014 };4015 nb_deriv_trees = function(sc_conf_110, i, j, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2) {4016 var sc_loop1_116;4017 var tmp1124;4018 var prev;4019 return ((prev = (sc_conf_110-(1))), ((((tmp1124 = (sc_conf_110<BgL_sc_nbzd2nts_115zd2)), ((tmp1124!== false)?tmp1124:((sc_steps_112[prev])<(0))))!== false)?(1):((sc_loop1_116 = function(l, sc_n_118) {4020 var nb_ender_trees;4021 var nb_prev_trees;4022 var conf_set;4023 var state;4024 var k;4025 var n;4026 var ender_set;4027 var sc_state_117;4028 var ender;4029 var l;4030 var sc_n_118;4031 while (true) {4032 if ((l instanceof sc_Pair))4033 {4034 (ender = (l.car));4035 (ender_set = ((sc_state_117 = (sc_states_114[j])), (sc_state_117[(ender+(1))])));4036 if ((ender_set!== false))4037 {4038 (k = (ender_set[(2)]));4039 (n = sc_n_118);4040 while ((k>=(0))) {4041 if (((k>=i)&&(((state = (sc_states_114[k])), (conf_set = (state[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)))4042 {4043 (nb_prev_trees = (nb_deriv_trees(prev, i, k, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2)));4044 (nb_ender_trees = (nb_deriv_trees(ender, k, j, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2)));4045 (k = (ender_set[(k+(5))]));4046 (n +=(nb_prev_trees*nb_ender_trees));4047 }4048 else4049 (k = (ender_set[(k+(5))]));4050 }4051 return (sc_loop1_116((l.cdr), n));4052 }4053 else4054 (l = (l.cdr));4055 }4056 else4057 return sc_n_118;4058 }4059 }), (sc_loop1_116((sc_enders_111[(sc_steps_112[prev])]), (0))))));4060 };4061 BgL_sc_nbzd2derivzd2treesza2_48za2 = function(nt, i, j, sc_nts_119, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123) {4062 var conf_set;4063 var state;4064 var sc_conf_124;4065 var l;4066 var nb_trees;4067 var BgL_sc_nbzd2nts_125zd2;4068 var BgL_sc_ntza2_126za2;4069 {4070 (BgL_sc_ntza2_126za2 = (sc_ind_43(nt, sc_nts_119)));4071 if ((BgL_sc_ntza2_126za2!== false))4072 {4073 (BgL_sc_nbzd2nts_125zd2 = (sc_nts_119.length));4074 (l = (sc_enders_120[BgL_sc_ntza2_126za2]));4075 (nb_trees = (0));4076 while ((l instanceof sc_Pair)) {4077 {4078 (sc_conf_124 = (l.car));4079 if ((((state = (sc_states_123[j])), (conf_set = (state[(sc_conf_124+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))4080 {4081 (l = (l.cdr));4082 (nb_trees = ((nb_deriv_trees(sc_conf_124, i, j, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123, BgL_sc_nbzd2nts_125zd2))+nb_trees));4083 }4084 else4085 (l = (l.cdr));4086 }4087 }4088 return nb_trees;4089 }4090 else4091 return false;4092 }4093 };4094 (lexer = (parser_descr[(0)]));4095 (sc_nts_42 = (parser_descr[(1)]));4096 (sc_starters_41 = (parser_descr[(2)]));4097 (sc_enders_40 = (parser_descr[(3)]));4098 (sc_predictors_39 = (parser_descr[(4)]));4099 (sc_steps_38 = (parser_descr[(5)]));4100 (sc_names_37 = (parser_descr[(6)]));4101 (falseHead1128 = (new sc_Pair(null, null)));4102 (L1125 = (lexer(input)));4103 (tail1129 = falseHead1128);4104 while (!(L1125 === null)) {4105 {4106 (tok = (L1125.car));4107 (l1 = (tok.cdr));4108 (l2 = null);4109 while ((l1 instanceof sc_Pair)) {4110 {4111 (sc_i_29 = (sc_ind_43((l1.car), sc_nts_42)));4112 if ((sc_i_29!== false))4113 {4114 (l1 = (l1.cdr));4115 (l2 = (new sc_Pair(sc_i_29, l2)));4116 }4117 else4118 (l1 = (l1.cdr));4119 }4120 }4121 (sc_optrOpnd_22 = (new sc_Pair((tok.car), (sc_reverse(l2)))));4122 (sc_optrOpnd_21 = (new sc_Pair(sc_optrOpnd_22, null)));4123 (tail1129.cdr = sc_optrOpnd_21);4124 (tail1129 = (tail1129.cdr));4125 (L1125 = (L1125.cdr));4126 }4127 }4128 (sc_optrOpnd_20 = (falseHead1128.cdr));4129 (sc_toks_36 = (sc_list2vector(sc_optrOpnd_20)));4130 (BgL_sc_nbzd2toks_35zd2 = (sc_toks_36.length));4131 (BgL_sc_nbzd2confs_34zd2 = (sc_steps_38.length));4132 (sc_states_33 = (make_states(BgL_sc_nbzd2toks_35zd2, BgL_sc_nbzd2confs_34zd2)));4133 (goal_starters = (sc_starters_41[(0)]));4134 (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (0), goal_starters, (0)));4135 (forw(sc_states_33, (0), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42));4136 (sc_i_28 = (0));4137 while ((sc_i_28<BgL_sc_nbzd2toks_35zd2)) {4138 {4139 (tok_nts = ((sc_toks_36[sc_i_28]).cdr));4140 (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (sc_i_28+(1)), tok_nts, sc_i_28));4141 (forw(sc_states_33, (sc_i_28+(1)), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42));4142 (++sc_i_28);4143 }4144 }4145 (nb_toks = (sc_toks_36.length));4146 (BgL_sc_nbzd2confs_32zd2 = (sc_steps_38.length));4147 (BgL_sc_nbzd2nts_31zd2 = (sc_nts_42.length));4148 (BgL_sc_statesza2_30za2 = (make_states(nb_toks, BgL_sc_nbzd2confs_32zd2)));4149 (goal_enders = (sc_enders_40[(0)]));4150 (l = goal_enders);4151 while ((l instanceof sc_Pair)) {4152 {4153 (conf = (l.car));4154 (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_33, BgL_sc_statesza2_30za2, nb_toks, conf, (0)));4155 (l = (l.cdr));4156 }4157 }4158 (i = nb_toks);4159 while ((i>=(0))) {4160 {4161 (states = sc_states_33);4162 (BgL_sc_statesza2_27za2 = BgL_sc_statesza2_30za2);4163 (state_num = i);4164 (sc_enders_26 = sc_enders_40);4165 (sc_steps_25 = sc_steps_38);4166 (BgL_sc_nbzd2nts_24zd2 = BgL_sc_nbzd2nts_31zd2);4167 (toks = sc_toks_36);4168 (BgL_sc_stateza2_23za2 = (BgL_sc_statesza2_30za2[i]));4169 loop1 = function() {4170 var sc_loop1_127;4171 var prev;4172 var BgL_sc_statesza2_128za2;4173 var sc_states_129;4174 var j;4175 var i;4176 var sc_i_130;4177 var head;4178 var conf_set;4179 var sc_conf_131;4180 {4181 (sc_conf_131 = (BgL_sc_stateza2_23za2[(0)]));4182 if ((sc_conf_131>=(0)))4183 {4184 (conf_set = (BgL_sc_stateza2_23za2[(sc_conf_131+(1))]));4185 (head = (conf_set[(4)]));4186 (BgL_sc_stateza2_23za2[(0)] = (conf_set[(0)]));4187 (conf_set_merge_new_bang(conf_set));4188 (sc_i_130 = head);4189 while ((sc_i_130>=(0))) {4190 {4191 (i = sc_i_130);4192 (j = state_num);4193 (sc_states_129 = states);4194 (BgL_sc_statesza2_128za2 = BgL_sc_statesza2_27za2);4195 (prev = (sc_conf_131-(1)));4196 if (((sc_conf_131>=BgL_sc_nbzd2nts_24zd2)&&((sc_steps_25[prev])>=(0))))4197 {4198 sc_loop1_127 = function(l) {4199 var k;4200 var ender_set;4201 var state;4202 var ender;4203 var l;4204 while (true) {4205 if ((l instanceof sc_Pair))4206 {4207 (ender = (l.car));4208 (ender_set = ((state = (sc_states_129[j])), (state[(ender+(1))])));4209 if ((ender_set!== false))4210 {4211 (k = (ender_set[(2)]));4212 while ((k>=(0))) {4213 {4214 if ((k>=i))4215 if (((BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, k, prev, i))!== false))4216 (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, j, ender, k));4217 (k = (ender_set[(k+(5))]));4218 }4219 }4220 return (sc_loop1_127((l.cdr)));4221 }4222 else4223 (l = (l.cdr));4224 }4225 else4226 return undefined;4227 }4228 };4229 (sc_loop1_127((sc_enders_26[(sc_steps_25[prev])])));4230 }4231 (sc_i_130 = (conf_set[(sc_i_130+(5))]));4232 }4233 }4234 return (loop1());4235 }4236 else4237 return undefined;4238 }4239 };4240 (loop1());4241 (--i);4242 }4243 }4244 (optrOpnd = BgL_sc_statesza2_30za2);4245 return [sc_nts_42, sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_names_37, sc_toks_36, optrOpnd, is_parsed, BgL_sc_derivzd2treesza2_47z70, BgL_sc_nbzd2derivzd2treesza2_48za2];4246 }4247 };4248 }4249 };4250 BgL_parsezd2ze3parsedzf3zc2 = function(parse, nt, i, j) {4251 var is_parsed;4252 var states;4253 var enders;4254 var nts;4255 return ((nts = (parse[(0)])), (enders = (parse[(2)])), (states = (parse[(7)])), (is_parsed = (parse[(8)])), (is_parsed(nt, i, j, nts, enders, states)));4256 };4257 BgL_parsezd2ze3treesz31 = function(parse, nt, i, j) {4258 var BgL_sc_derivzd2treesza2_132z70;4259 var states;4260 var toks;4261 var names;4262 var steps;4263 var enders;4264 var nts;4265 return ((nts = (parse[(0)])), (enders = (parse[(2)])), (steps = (parse[(4)])), (names = (parse[(5)])), (toks = (parse[(6)])), (states = (parse[(7)])), (BgL_sc_derivzd2treesza2_132z70 = (parse[(9)])), (BgL_sc_derivzd2treesza2_132z70(nt, i, j, nts, enders, steps, names, toks, states)));4266 };4267 BgL_parsezd2ze3nbzd2treesze3 = function(parse, nt, i, j) {4268 var BgL_sc_nbzd2derivzd2treesza2_133za2;4269 var states;4270 var toks;4271 var steps;4272 var enders;4273 var nts;4274 return ((nts = (parse[(0)])), (enders = (parse[(2)])), (steps = (parse[(4)])), (toks = (parse[(6)])), (states = (parse[(7)])), (BgL_sc_nbzd2derivzd2treesza2_133za2 = (parse[(10)])), (BgL_sc_nbzd2derivzd2treesza2_133za2(nt, i, j, nts, enders, steps, toks, states)));4275 };4276 test = function(k) {4277 var x;4278 var p;4279 return ((p = (BgL_makezd2parserzd2(const_earley, function(l) {4280 var sc_x_134;4281 var tail1134;4282 var L1130;4283 var falseHead1133;4284 {4285 (falseHead1133 = (new sc_Pair(null, null)));4286 (tail1134 = falseHead1133);4287 (L1130 = l);4288 while (!(L1130 === null)) {4289 {4290 (tail1134.cdr = (new sc_Pair(((sc_x_134 = (L1130.car)), (sc_list(sc_x_134, sc_x_134))), null)));4291 (tail1134 = (tail1134.cdr));4292 (L1130 = (L1130.cdr));4293 }4294 }4295 return (falseHead1133.cdr);4296 }4297 }))), (x = (p((sc_vector2list((sc_makeVector(k, "\u1E9Ca"))))))), (sc_length((BgL_parsezd2ze3treesz31(x, "\u1E9Cs", (0), k)))));4298 };4299 BgL_earleyzd2benchmarkzd2 = function() {4300 var args = null;4301 for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {4302 args = sc_cons(arguments[sc_tmp], args);4303 }4304 var k;4305 return ((k = ((args === null)?(7):(args.car))), (BgL_runzd2benchmarkzd2("earley", (1), function() {4306 return (test(k));4307 }, function(result) {4308 return ((sc_display(result)), (sc_newline()), result == 132);4309 })));4310 };4311}4312/************* END OF GENERATED CODE *************/4313// Invoke this function to run a benchmark.4314// The first argument is a string identifying the benchmark.4315// The second argument is the number of times to run the benchmark.4316// The third argument is a function that runs the benchmark.4317// The fourth argument is a unary function that warns if the result4318// returned by the benchmark is incorrect.4319//4320// Example:4321// RunBenchmark("new Array()",4322// 1,4323// function () { new Array(1000000); }4324// function (v) {4325// return (v instanceof Array) && (v.length == 1000000);4326// });4327SC_DEFAULT_OUT = new sc_GenericOutputPort(function(s) {});4328SC_ERROR_OUT = SC_DEFAULT_OUT;4329function RunBenchmark(name, count, run, warn) {4330 for (var n = 0; n < count; ++n) {4331 result = run();4332 if (!warn(result)) {4333 throw new Error("Earley or Boyer did incorrect number of rewrites");4334 }4335 }4336}...

Full Screen

Full Screen

scancodes.h.ts

Source:scancodes.h.ts Github

copy

Full Screen

1var sc_None = 0;2var sc_Bad = 0xff;3var sc_Comma = 0x33;4var sc_Period = 0x34;5var sc_Return = 0x1c;6var sc_Enter = sc_Return;7var sc_Escape = 0x01;8var sc_Space = 0x39;9var sc_BackSpace = 0x0e;10var sc_Tab = 0x0f;11var sc_LeftAlt = 0x38;12var sc_LeftControl = 0x1d;13var sc_CapsLock = 0x3a;14var sc_LeftShift = 0x2a;15var sc_RightShift = 0x36;16var sc_F1 = 0x3b;17var sc_F2 = 0x3c;18var sc_F3 = 0x3d;19var sc_F4 = 0x3e;20var sc_F5 = 0x3f;21var sc_F6 = 0x40;22var sc_F7 = 0x41;23var sc_F8 = 0x42;24var sc_F9 = 0x43;25var sc_F10 = 0x44;26var sc_F11 = 0x57;27var sc_F12 = 0x58;28var sc_Kpad_Star = 0x37;29var sc_Pause = 0x59;30var sc_ScrollLock = 0x46;31var sc_NumLock = 0x45;32var sc_Slash = 0x35;33var sc_SemiColon = 0x27;34var sc_Quote = 0x28;35var sc_Tilde = 0x29;36var sc_BackSlash = 0x2b;37var sc_OpenBracket = 0x1a;38var sc_CloseBracket= 0x1b;39var sc_1 = 0x02;40var sc_2 = 0x03;41var sc_3 = 0x04;42var sc_4 = 0x05;43var sc_5 = 0x06;44var sc_6 = 0x07;45var sc_7 = 0x08;46var sc_8 = 0x09;47var sc_9 = 0x0a;48var sc_0 = 0x0b;49var sc_Minus = 0x0c;50var sc_Equals = 0x0d;51var sc_Plus = 0x0d;52var sc_kpad_1 = 0x4f;53var sc_kpad_2 = 0x50;54var sc_kpad_3 = 0x51;55var sc_kpad_4 = 0x4b;56var sc_kpad_5 = 0x4c;57var sc_kpad_6 = 0x4d;58var sc_kpad_7 = 0x47;59var sc_kpad_8 = 0x48;60var sc_kpad_9 = 0x49;61var sc_kpad_0 = 0x52;62var sc_kpad_Minus = 0x4a;63var sc_kpad_Plus = 0x4e;64var sc_kpad_Period = 0x53;65var sc_A = 0x1e;66var sc_B = 0x30;67var sc_C = 0x2e;68var sc_D = 0x20;69var sc_E = 0x12;70var sc_F = 0x21;71var sc_G = 0x22;72var sc_H = 0x23;73var sc_I = 0x17;74var sc_J = 0x24;75var sc_K = 0x25;76var sc_L = 0x26;77var sc_M = 0x32;78var sc_N = 0x31;79var sc_O = 0x18;80var sc_P = 0x19;81var sc_Q = 0x10;82var sc_R = 0x13;83var sc_S = 0x1f;84var sc_T = 0x14;85var sc_U = 0x16;86var sc_V = 0x2f;87var sc_W = 0x11;88var sc_X = 0x2d;89var sc_Y = 0x15;90var sc_Z = 0x2c;91// Extended scan codes92var sc_UpArrow = 0xc8;//0x5a93var sc_DownArrow = 0xd0;//0x6a94var sc_LeftArrow = 0xcb;//0x6b95var sc_RightArrow = 0xcd;//0x6c96var sc_Insert = 0xd2;//0x5e97var sc_Delete = 0xd3;//0x5f98var sc_Home = 0xc7;//0x6199var sc_End = 0xcf;//0x62100var sc_PgUp = 0xc9;//0x63101var sc_PgDn = 0xd1;//0x64102var sc_RightAlt = 0xb8;//0x65103var sc_RightControl= 0x9d;//0x66104var sc_kpad_Slash = 0xb5;//0x67105var sc_kpad_Enter = 0x9c;//0x68106var sc_PrintScreen = 0xb7;//0x69107var sc_LastScanCode= 0x6e;108// Ascii scan codes109var asc_Enter = 13;110var asc_Escape = 27;111var asc_BackSpace = 8;112var asc_Tab = 9;...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var WebPageTest = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org', 'A.1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f3g4h5i6j7k8l9m0n1o2p3q4r5s6t7u8v9w0x1y2z3');3var options = {4};5wpt.runTest(url, options, function(err, data) {6 if (err) return console.error(err);7 console.log('Test %s from %s completed', data.data.testId, data.data.from);8});9var WebPageTest = require('webpagetest');10var wpt = new WebPageTest('www.webpagetest.org', 'A.1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f3g4h5i6j7k8l9m0n1o2p3q4r5s6t7u8v9w0x1y2z3');11var options = {12};13wpt.runTest(url, options, function(err, data) {14 if (err) return console.error(err);15 console.log('Test %s from %s completed', data.data.testId, data.data.from);16});17var WebPageTest = require('webpagetest');18var wpt = new WebPageTest('

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org', 'A.9d5d5b5d5b5d5b5d5b5d5b5d5b5d5b5d5');3 if (err) return console.error(err);4 console.log('Test submitted. Poll for results at %s/jsonResult.php?test=%s', wpt.host, data.data.testId);5});6var wpt = require('webpagetest');7var wpt = new WebPageTest('www.webpagetest.org', 'A.9d5d5b5d5b5d5b5d5b5d5b5d5b5d5b5d5');8 if (err) return console.error(err);9 console.log('Test submitted. Poll for results at %s/jsonResult.php?test=%s', wpt.host, data.data.testId);10});11var wpt = require('webpagetest');12var wpt = new WebPageTest('www.webpagetest.org', 'A.9d5d5b5d5b5d5b5d5b5d5b5d5b5d5b5d5');13 if (err) return console.error(err);14 console.log('Test submitted. Poll for results at %s/jsonResult.php?test=%s', wpt.host, data.data.testId);15});16var wpt = require('webpagetest');17var wpt = new WebPageTest('www.webpagetest.org', 'A.9d5d5b5d5b5d5b5d5b5d5b5d5b5d5b5d5');18 if (err) return console.error(err);

Full Screen

Using AI Code Generation

copy

Full Screen

1var WebPageTest = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org', 'A.6b0a6d7c6f1d6b7d8a0f9e7b0e4b6a7b');3}, function(err, data) {4 if (err) return console.error(err);5 console.log('Test status:', data.statusText);6 if (data.statusCode == 200) {7 console.log('Test completed, results available at ' + data.data.userUrl);8 }9});10var WebPageTest = require('webpagetest');11var wpt = new WebPageTest('www.webpagetest.org', 'A.6b0a6d7c6f1d6b7d8a0f9e7b0e4b6a7b');12}, function(err, data) {13 if (err) return console.error(err);14 console.log('Test status:', data.statusText);15 if (data.statusCode == 200) {16 console.log('Test completed, results available at ' + data.data.userUrl);17 }18});19var WebPageTest = require('webpagetest');20var wpt = new WebPageTest('www.webpagetest.org', 'A.6b0a6d7c6f1d6b7d8a0f9e7b0e4b6a7b');21}, function(err, data) {22 if (err) return console.error(err);23 console.log('Test status:', data.statusText);24 if (data

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful