Best JavaScript code snippet using ng-mocks
earley-boyer.js
Source:earley-boyer.js
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, "&");25 tmp = tmp.replace(/</g, "<");26 tmp = tmp.replace(/>/g, ">");27 tmp = tmp.replace(/ /g, " ");28 tmp = tmp.replace(/\n/g, "<br />");29 tmp = tmp.replace(/\t/g, "  ");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/*** META ((export #t)) */834function sc_appendBang() {835 var res = null;836 for (var i = 0; i < arguments.length; i++)837 res = sc_dualAppendBang(res, arguments[i]);838 return res;839}840/*** META ((export #t)) */841function sc_reverse(l1) {842 var res = null;843 while (l1 !== null) {844 res = sc_cons(l1.car, res);845 l1 = l1.cdr;846 }847 return res;848}849/*** META ((export #t)) */850function sc_reverseBang(l) {851 return sc_reverseAppendBang(l, null);852}853/*** META ((export #t)) */854function sc_listTail(l, k) {855 var res = l;856 for (var i = 0; i < k; i++) {857 res = res.cdr;858 }859 return res;860}861/*** META ((export #t)) */862function sc_listRef(l, k) {863 return sc_listTail(l, k).car;864}865/* // unoptimized generic versions866function sc_memX(o, l, comp) {867 while (l != null) {868 if (comp(l.car, o))869 return l;870 l = l.cdr;871 }872 return false;873}874function sc_memq(o, l) { return sc_memX(o, l, sc_isEq); }875function sc_memv(o, l) { return sc_memX(o, l, sc_isEqv); }876function sc_member(o, l) { return sc_memX(o, l, sc_isEqual); }877*/878/* optimized versions */879/*** META ((export #t)) */880function sc_memq(o, l) {881 while (l !== null) {882 if (l.car === o)883 return l;884 l = l.cdr;885 }886 return false;887}888/*** META ((export #t)) */889function sc_memv(o, l) {890 while (l !== null) {891 if (l.car === o)892 return l;893 l = l.cdr;894 }895 return false;896}897/*** META ((export #t)) */898function sc_member(o, l) {899 while (l !== null) {900 if (sc_isEqual(l.car,o))901 return l;902 l = l.cdr;903 }904 return false;905}906/* // generic unoptimized versions907function sc_assX(o, al, comp) {908 while (al != null) {909 if (comp(al.car.car, o))910 return al.car;911 al = al.cdr;912 }913 return false;914}915function sc_assq(o, al) { return sc_assX(o, al, sc_isEq); }916function sc_assv(o, al) { return sc_assX(o, al, sc_isEqv); }917function sc_assoc(o, al) { return sc_assX(o, al, sc_isEqual); }918*/919// optimized versions920/*** META ((export #t)) */921function sc_assq(o, al) {922 while (al !== null) {923 if (al.car.car === o)924 return al.car;925 al = al.cdr;926 }927 return false;928}929/*** META ((export #t)) */930function sc_assv(o, al) {931 while (al !== null) {932 if (al.car.car === o)933 return al.car;934 al = al.cdr;935 }936 return false;937}938/*** META ((export #t)) */939function sc_assoc(o, al) {940 while (al !== null) {941 if (sc_isEqual(al.car.car, o))942 return al.car;943 al = al.cdr;944 }945 return false;946}947/* can be used for mutable strings and characters */948function sc_isCharStringEqual(cs1, cs2) { return cs1.val === cs2.val; }949function sc_isCharStringLess(cs1, cs2) { return cs1.val < cs2.val; }950function sc_isCharStringGreater(cs1, cs2) { return cs1.val > cs2.val; }951function sc_isCharStringLessEqual(cs1, cs2) { return cs1.val <= cs2.val; }952function sc_isCharStringGreaterEqual(cs1, cs2) { return cs1.val >= cs2.val; }953function sc_isCharStringCIEqual(cs1, cs2)954 { return cs1.val.toLowerCase() === cs2.val.toLowerCase(); }955function sc_isCharStringCILess(cs1, cs2)956 { return cs1.val.toLowerCase() < cs2.val.toLowerCase(); }957function sc_isCharStringCIGreater(cs1, cs2)958 { return cs1.val.toLowerCase() > cs2.val.toLowerCase(); }959function sc_isCharStringCILessEqual(cs1, cs2)960 { return cs1.val.toLowerCase() <= cs2.val.toLowerCase(); }961function sc_isCharStringCIGreaterEqual(cs1, cs2)962 { return cs1.val.toLowerCase() >= cs2.val.toLowerCase(); }963function sc_Char(c) {964 var cached = sc_Char.lazy[c];965 if (cached)966 return cached;967 this.val = c;968 sc_Char.lazy[c] = this;969 // add return, so FF does not complain.970 return undefined;971}972sc_Char.lazy = new Object();973// thanks to Eric974sc_Char.char2readable = {975 "\000": "#\\null",976 "\007": "#\\bell",977 "\010": "#\\backspace",978 "\011": "#\\tab",979 "\012": "#\\newline",980 "\014": "#\\page",981 "\015": "#\\return",982 "\033": "#\\escape",983 "\040": "#\\space",984 "\177": "#\\delete",985 /* poeticless names */986 "\001": "#\\soh",987 "\002": "#\\stx",988 "\003": "#\\etx",989 "\004": "#\\eot",990 "\005": "#\\enq",991 "\006": "#\\ack",992 "\013": "#\\vt",993 "\016": "#\\so",994 "\017": "#\\si",995 "\020": "#\\dle",996 "\021": "#\\dc1",997 "\022": "#\\dc2",998 "\023": "#\\dc3",999 "\024": "#\\dc4",1000 "\025": "#\\nak",1001 "\026": "#\\syn",1002 "\027": "#\\etb",1003 "\030": "#\\can",1004 "\031": "#\\em",1005 "\032": "#\\sub",1006 "\033": "#\\esc",1007 "\034": "#\\fs",1008 "\035": "#\\gs",1009 "\036": "#\\rs",1010 "\037": "#\\us"};1011sc_Char.readable2char = {1012 "null": "\000",1013 "bell": "\007",1014 "backspace": "\010",1015 "tab": "\011",1016 "newline": "\012",1017 "page": "\014",1018 "return": "\015",1019 "escape": "\033",1020 "space": "\040",1021 "delete": "\000",1022 "soh": "\001",1023 "stx": "\002",1024 "etx": "\003",1025 "eot": "\004",1026 "enq": "\005",1027 "ack": "\006",1028 "bel": "\007",1029 "bs": "\010",1030 "ht": "\011",1031 "nl": "\012",1032 "vt": "\013",1033 "np": "\014",1034 "cr": "\015",1035 "so": "\016",1036 "si": "\017",1037 "dle": "\020",1038 "dc1": "\021",1039 "dc2": "\022",1040 "dc3": "\023",1041 "dc4": "\024",1042 "nak": "\025",1043 "syn": "\026",1044 "etb": "\027",1045 "can": "\030",1046 "em": "\031",1047 "sub": "\032",1048 "esc": "\033",1049 "fs": "\034",1050 "gs": "\035",1051 "rs": "\036",1052 "us": "\037",1053 "sp": "\040",1054 "del": "\177"};1055sc_Char.prototype.toString = function() {1056 return this.val;1057};1058// sc_toDisplayString == toString1059sc_Char.prototype.sc_toWriteString = function() {1060 var entry = sc_Char.char2readable[this.val];1061 if (entry)1062 return entry;1063 else1064 return "#\\" + this.val;1065};1066/*** META ((export #t)1067 (type bool)1068 (peephole (postfix "instanceof sc_Char")))1069*/1070function sc_isChar(c) {1071 return (c instanceof sc_Char);1072}1073/*** META ((export char=?)1074 (type bool)1075 (peephole (hole 2 c1 ".val === " c2 ".val")))1076*/1077var sc_isCharEqual = sc_isCharStringEqual;1078/*** META ((export char<?)1079 (type bool)1080 (peephole (hole 2 c1 ".val < " c2 ".val")))1081*/1082var sc_isCharLess = sc_isCharStringLess;1083/*** META ((export char>?)1084 (type bool)1085 (peephole (hole 2 c1 ".val > " c2 ".val")))1086*/1087var sc_isCharGreater = sc_isCharStringGreater;1088/*** META ((export char<=?)1089 (type bool)1090 (peephole (hole 2 c1 ".val <= " c2 ".val")))1091*/1092var sc_isCharLessEqual = sc_isCharStringLessEqual;1093/*** META ((export char>=?)1094 (type bool)1095 (peephole (hole 2 c1 ".val >= " c2 ".val")))1096*/1097var sc_isCharGreaterEqual = sc_isCharStringGreaterEqual;1098/*** META ((export char-ci=?)1099 (type bool)1100 (peephole (hole 2 c1 ".val.toLowerCase() === " c2 ".val.toLowerCase()")))1101*/1102var sc_isCharCIEqual = sc_isCharStringCIEqual;1103/*** META ((export char-ci<?)1104 (type bool)1105 (peephole (hole 2 c1 ".val.toLowerCase() < " c2 ".val.toLowerCase()")))1106*/1107var sc_isCharCILess = sc_isCharStringCILess;1108/*** META ((export char-ci>?)1109 (type bool)1110 (peephole (hole 2 c1 ".val.toLowerCase() > " c2 ".val.toLowerCase()")))1111*/1112var sc_isCharCIGreater = sc_isCharStringCIGreater;1113/*** META ((export char-ci<=?)1114 (type bool)1115 (peephole (hole 2 c1 ".val.toLowerCase() <= " c2 ".val.toLowerCase()")))1116*/1117var sc_isCharCILessEqual = sc_isCharStringCILessEqual;1118/*** META ((export char-ci>=?)1119 (type bool)1120 (peephole (hole 2 c1 ".val.toLowerCase() >= " c2 ".val.toLowerCase()")))1121*/1122var sc_isCharCIGreaterEqual = sc_isCharStringCIGreaterEqual;1123var SC_NUMBER_CLASS = "0123456789";1124var SC_WHITESPACE_CLASS = ' \r\n\t\f';1125var SC_LOWER_CLASS = 'abcdefghijklmnopqrstuvwxyz';1126var SC_UPPER_CLASS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';1127function sc_isCharOfClass(c, cl) { return (cl.indexOf(c) != -1); }1128/*** META ((export #t)1129 (type bool))1130*/1131function sc_isCharAlphabetic(c)1132 { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||1133 sc_isCharOfClass(c.val, SC_UPPER_CLASS); }1134/*** META ((export #t)1135 (type bool)1136 (peephole (hole 1 "SC_NUMBER_CLASS.indexOf(" c ".val) != -1")))1137*/1138function sc_isCharNumeric(c)1139 { return sc_isCharOfClass(c.val, SC_NUMBER_CLASS); }1140/*** META ((export #t)1141 (type bool))1142*/1143function sc_isCharWhitespace(c) {1144 var tmp = c.val;1145 return tmp === " " || tmp === "\r" || tmp === "\n" || tmp === "\t" || tmp === "\f";1146}1147/*** META ((export #t)1148 (type bool)1149 (peephole (hole 1 "SC_UPPER_CLASS.indexOf(" c ".val) != -1")))1150*/1151function sc_isCharUpperCase(c)1152 { return sc_isCharOfClass(c.val, SC_UPPER_CLASS); }1153/*** META ((export #t)1154 (type bool)1155 (peephole (hole 1 "SC_LOWER_CLASS.indexOf(" c ".val) != -1")))1156*/1157function sc_isCharLowerCase(c)1158 { return sc_isCharOfClass(c.val, SC_LOWER_CLASS); }1159/*** META ((export #t)1160 (peephole (postfix ".val.charCodeAt(0)")))1161*/1162function sc_char2integer(c)1163 { return c.val.charCodeAt(0); }1164/*** META ((export #t)1165 (peephole (hole 1 "new sc_Char(String.fromCharCode(" n "))")))1166*/1167function sc_integer2char(n)1168 { return new sc_Char(String.fromCharCode(n)); }1169/*** META ((export #t)1170 (peephole (hole 1 "new sc_Char(" c ".val.toUpperCase())")))1171*/1172function sc_charUpcase(c)1173 { return new sc_Char(c.val.toUpperCase()); }1174/*** META ((export #t)1175 (peephole (hole 1 "new sc_Char(" c ".val.toLowerCase())")))1176*/1177function sc_charDowncase(c)1178 { return new sc_Char(c.val.toLowerCase()); }1179function sc_makeJSStringOfLength(k, c) {1180 var fill;1181 if (c === undefined)1182 fill = " ";1183 else1184 fill = c;1185 var res = "";1186 var len = 1;1187 // every round doubles the size of fill.1188 while (k >= len) {1189 if (k & len)1190 res = res.concat(fill);1191 fill = fill.concat(fill);1192 len *= 2;1193 }1194 return res;1195}1196function sc_makejsString(k, c) {1197 var fill;1198 if (c)1199 fill = c.val;1200 else1201 fill = " ";1202 return sc_makeJSStringOfLength(k, fill);1203}1204function sc_jsstring2list(s) {1205 var res = null;1206 for (var i = s.length - 1; i >= 0; i--)1207 res = sc_cons(new sc_Char(s.charAt(i)), res);1208 return res;1209}1210function sc_list2jsstring(l) {1211 var a = new Array();1212 while(l !== null) {1213 a.push(l.car.val);1214 l = l.cdr;1215 }1216 return "".concat.apply("", a);1217}1218var sc_Vector = Array;1219sc_Vector.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {1220 if (this.length === 0) return "#()";1221 var res = "#(" + writeOrDisplay(this[0]);1222 for (var i = 1; i < this.length; i++)1223 res += " " + writeOrDisplay(this[i]);1224 res += ")";1225 return res;1226};1227sc_Vector.prototype.sc_toDisplayString = function() {1228 return this.sc_toWriteOrDisplayString(sc_toDisplayString);1229};1230sc_Vector.prototype.sc_toWriteString = function() {1231 return this.sc_toWriteOrDisplayString(sc_toWriteString);1232};1233/*** META ((export vector? array?)1234 (type bool)1235 (peephole (postfix " instanceof sc_Vector")))1236*/1237function sc_isVector(v) {1238 return (v instanceof sc_Vector);1239}1240// only applies to vectors1241function sc_isVectorEqual(v1, v2, comp) {1242 if (v1.length !== v2.length) return false;1243 for (var i = 0; i < v1.length; i++)1244 if (!comp(v1[i], v2[i])) return false;1245 return true;1246}1247/*** META ((export make-vector make-array)) */1248function sc_makeVector(size, fill) {1249 var a = new sc_Vector(size);1250 if (fill !== undefined)1251 sc_vectorFillBang(a, fill);1252 return a;1253}1254/*** META ((export vector array)1255 (peephole (vector)))1256*/1257function sc_vector() {1258 var a = new sc_Vector();1259 for (var i = 0; i < arguments.length; i++)1260 a.push(arguments[i]);1261 return a;1262}1263/*** META ((export vector-length array-length)1264 (peephole (postfix ".length")))1265*/1266function sc_vectorLength(v) {1267 return v.length;1268}1269/*** META ((export vector-ref array-ref)1270 (peephole (hole 2 v "[" pos "]")))1271*/1272function sc_vectorRef(v, pos) {1273 return v[pos];1274}1275/*** META ((export vector-set! array-set!)1276 (peephole (hole 3 v "[" pos "] = " val)))1277*/1278function sc_vectorSetBang(v, pos, val) {1279 v[pos] = val;1280}1281/*** META ((export vector->list array->list)) */1282function sc_vector2list(a) {1283 var res = null;1284 for (var i = a.length-1; i >= 0; i--)1285 res = sc_cons(a[i], res);1286 return res;1287}1288/*** META ((export list->vector list->array)) */1289function sc_list2vector(l) {1290 var a = new sc_Vector();1291 while(l !== null) {1292 a.push(l.car);1293 l = l.cdr;1294 }1295 return a;1296}1297/*** META ((export vector-fill! array-fill!)) */1298function sc_vectorFillBang(a, fill) {1299 for (var i = 0; i < a.length; i++)1300 a[i] = fill;1301}1302/*** META ((export #t)) */1303function sc_copyVector(a, len) {1304 if (len <= a.length)1305 return a.slice(0, len);1306 else {1307 var tmp = a.concat();1308 tmp.length = len;1309 return tmp;1310 }1311}1312/*** META ((export #t)1313 (peephole (hole 3 a ".slice(" start "," end ")")))1314*/1315function sc_vectorCopy(a, start, end) {1316 return a.slice(start, end);1317}1318/*** META ((export #t)) */1319function sc_vectorCopyBang(target, tstart, source, sstart, send) {1320 if (!sstart) sstart = 0;1321 if (!send) send = source.length;1322 // if target == source we don't want to overwrite not yet copied elements.1323 if (tstart <= sstart) {1324 for (var i = tstart, j = sstart; j < send; i++, j++) {1325 target[i] = source[j];1326 }1327 } else {1328 var diff = send - sstart;1329 for (var i = tstart + diff - 1, j = send - 1;1330 j >= sstart;1331 i--, j--) {1332 target[i] = source[j];1333 }1334 }1335 return target;1336}1337/*** META ((export #t)1338 (type bool)1339 (peephole (hole 1 "typeof " o " === 'function'")))1340*/1341function sc_isProcedure(o) {1342 return (typeof o === "function");1343}1344/*** META ((export #t)) */1345function sc_apply(proc) {1346 var args = new Array();1347 // first part of arguments are not in list-form.1348 for (var i = 1; i < arguments.length - 1; i++)1349 args.push(arguments[i]);1350 var l = arguments[arguments.length - 1];1351 while (l !== null) {1352 args.push(l.car);1353 l = l.cdr;1354 }1355 return proc.apply(null, args);1356}1357/*** META ((export #t)) */1358function sc_map(proc, l1) {1359 if (l1 === undefined)1360 return null;1361 // else1362 var nbApplyArgs = arguments.length - 1;1363 var applyArgs = new Array(nbApplyArgs);1364 var revres = null;1365 while (l1 !== null) {1366 for (var i = 0; i < nbApplyArgs; i++) {1367 applyArgs[i] = arguments[i + 1].car;1368 arguments[i + 1] = arguments[i + 1].cdr;1369 }1370 revres = sc_cons(proc.apply(null, applyArgs), revres);1371 }1372 return sc_reverseAppendBang(revres, null);1373}1374/*** META ((export #t)) */1375function sc_mapBang(proc, l1) {1376 if (l1 === undefined)1377 return null;1378 // else1379 var l1_orig = l1;1380 var nbApplyArgs = arguments.length - 1;1381 var applyArgs = new Array(nbApplyArgs);1382 while (l1 !== null) {1383 var tmp = l1;1384 for (var i = 0; i < nbApplyArgs; i++) {1385 applyArgs[i] = arguments[i + 1].car;1386 arguments[i + 1] = arguments[i + 1].cdr;1387 }1388 tmp.car = proc.apply(null, applyArgs);1389 }1390 return l1_orig;1391}1392/*** META ((export #t)) */1393function sc_forEach(proc, l1) {1394 if (l1 === undefined)1395 return undefined;1396 // else1397 var nbApplyArgs = arguments.length - 1;1398 var applyArgs = new Array(nbApplyArgs);1399 while (l1 !== null) {1400 for (var i = 0; i < nbApplyArgs; i++) {1401 applyArgs[i] = arguments[i + 1].car;1402 arguments[i + 1] = arguments[i + 1].cdr;1403 }1404 proc.apply(null, applyArgs);1405 }1406 // add return so FF does not complain.1407 return undefined;1408}1409/*** META ((export #t)) */1410function sc_filter(proc, l1) {1411 var dummy = { cdr : null };1412 var tail = dummy;1413 while (l1 !== null) {1414 if (proc(l1.car) !== false) {1415 tail.cdr = sc_cons(l1.car, null);1416 tail = tail.cdr;1417 }1418 l1 = l1.cdr;1419 }1420 return dummy.cdr;1421}1422/*** META ((export #t)) */1423function sc_filterBang(proc, l1) {1424 var head = sc_cons("dummy", l1);1425 var it = head;1426 var next = l1;1427 while (next !== null) {1428 if (proc(next.car) !== false) {1429 it.cdr = next1430 it = next;1431 }1432 next = next.cdr;1433 }1434 it.cdr = null;1435 return head.cdr;1436}1437function sc_filterMap1(proc, l1) {1438 var revres = null;1439 while (l1 !== null) {1440 var tmp = proc(l1.car)1441 if (tmp !== false) revres = sc_cons(tmp, revres);1442 l1 = l1.cdr;1443 }1444 return sc_reverseAppendBang(revres, null);1445}1446function sc_filterMap2(proc, l1, l2) {1447 var revres = null;1448 while (l1 !== null) {1449 var tmp = proc(l1.car, l2.car);1450 if(tmp !== false) revres = sc_cons(tmp, revres);1451 l1 = l1.cdr;1452 l2 = l2.cdr1453 }1454 return sc_reverseAppendBang(revres, null);1455}1456/*** META ((export #t)) */1457function sc_filterMap(proc, l1, l2, l3) {1458 if (l2 === undefined)1459 return sc_filterMap1(proc, l1);1460 else if (l3 === undefined)1461 return sc_filterMap2(proc, l1, l2);1462 // else1463 var nbApplyArgs = arguments.length - 1;1464 var applyArgs = new Array(nbApplyArgs);1465 var revres = null;1466 while (l1 !== null) {1467 for (var i = 0; i < nbApplyArgs; i++) {1468 applyArgs[i] = arguments[i + 1].car;1469 arguments[i + 1] = arguments[i + 1].cdr;1470 }1471 var tmp = proc.apply(null, applyArgs);1472 if(tmp !== false) revres = sc_cons(tmp, revres);1473 }1474 return sc_reverseAppendBang(revres, null);1475}1476/*** META ((export #t)) */1477function sc_any(proc, l) {1478 var revres = null;1479 while (l !== null) {1480 var tmp = proc(l.car);1481 if(tmp !== false) return tmp;1482 l = l.cdr;1483 }1484 return false;1485}1486/*** META ((export any?)1487 (peephole (hole 2 "sc_any(" proc "," l ") !== false")))1488*/1489function sc_anyPred(proc, l) {1490 return sc_any(proc, l)!== false;1491}1492/*** META ((export #t)) */1493function sc_every(proc, l) {1494 var revres = null;1495 var tmp = true;1496 while (l !== null) {1497 tmp = proc(l.car);1498 if (tmp === false) return false;1499 l = l.cdr;1500 }1501 return tmp;1502}1503/*** META ((export every?)1504 (peephole (hole 2 "sc_every(" proc "," l ") !== false")))1505*/1506function sc_everyPred(proc, l) {1507 var tmp = sc_every(proc, l);1508 if (tmp !== false) return true;1509 return false;1510}1511/*** META ((export #t)1512 (peephole (postfix "()")))1513*/1514function sc_force(o) {1515 return o();1516}1517/*** META ((export #t)) */1518function sc_makePromise(proc) {1519 var isResultReady = false;1520 var result = undefined;1521 return function() {1522 if (!isResultReady) {1523 var tmp = proc();1524 if (!isResultReady) {1525 isResultReady = true;1526 result = tmp;1527 }1528 }1529 return result;1530 };1531}1532function sc_Values(values) {1533 this.values = values;1534}1535/*** META ((export #t)1536 (peephole (values)))1537*/1538function sc_values() {1539 if (arguments.length === 1)1540 return arguments[0];1541 else1542 return new sc_Values(arguments);1543}1544/*** META ((export #t)) */1545function sc_callWithValues(producer, consumer) {1546 var produced = producer();1547 if (produced instanceof sc_Values)1548 return consumer.apply(null, produced.values);1549 else1550 return consumer(produced);1551}1552/*** META ((export #t)) */1553function sc_dynamicWind(before, thunk, after) {1554 before();1555 try {1556 var res = thunk();1557 return res;1558 } finally {1559 after();1560 }1561}1562// TODO: eval/scheme-report-environment/null-environment/interaction-environment1563// LIMITATION: 'load' doesn't exist without files.1564// LIMITATION: transcript-on/transcript-off doesn't exist without files.1565function sc_Struct(name) {1566 this.name = name;1567}1568sc_Struct.prototype.sc_toDisplayString = function() {1569 return "#<struct" + sc_hash(this) + ">";1570};1571sc_Struct.prototype.sc_toWriteString = sc_Struct.prototype.sc_toDisplayString;1572/*** META ((export #t)1573 (peephole (hole 1 "new sc_Struct(" name ")")))1574*/1575function sc_makeStruct(name) {1576 return new sc_Struct(name);1577}1578/*** META ((export #t)1579 (type bool)1580 (peephole (postfix " instanceof sc_Struct")))1581*/1582function sc_isStruct(o) {1583 return (o instanceof sc_Struct);1584}1585/*** META ((export #t)1586 (type bool)1587 (peephole (hole 2 "(" 1 " instanceof sc_Struct) && ( " 1 ".name === " 0 ")")))1588*/1589function sc_isStructNamed(name, s) {1590 return ((s instanceof sc_Struct) && (s.name === name));1591}1592/*** META ((export struct-field)1593 (peephole (hole 3 0 "[" 2 "]")))1594*/1595function sc_getStructField(s, name, field) {1596 return s[field];1597}1598/*** META ((export struct-field-set!)1599 (peephole (hole 4 0 "[" 2 "] = " 3)))1600*/1601function sc_setStructFieldBang(s, name, field, val) {1602 s[field] = val;1603}1604/*** META ((export #t)1605 (peephole (prefix "~")))1606*/1607function sc_bitNot(x) {1608 return ~x;1609}1610/*** META ((export #t)1611 (peephole (infix 2 2 "&")))1612*/1613function sc_bitAnd(x, y) {1614 return x & y;1615}1616/*** META ((export #t)1617 (peephole (infix 2 2 "|")))1618*/1619function sc_bitOr(x, y) {1620 return x | y;1621}1622/*** META ((export #t)1623 (peephole (infix 2 2 "^")))1624*/1625function sc_bitXor(x, y) {1626 return x ^ y;1627}1628/*** META ((export #t)1629 (peephole (infix 2 2 "<<")))1630*/1631function sc_bitLsh(x, y) {1632 return x << y;1633}1634/*** META ((export #t)1635 (peephole (infix 2 2 ">>")))1636*/1637function sc_bitRsh(x, y) {1638 return x >> y;1639}1640/*** META ((export #t)1641 (peephole (infix 2 2 ">>>")))1642*/1643function sc_bitUrsh(x, y) {1644 return x >>> y;1645}1646/*** META ((export js-field js-property)1647 (peephole (hole 2 o "[" field "]")))1648*/1649function sc_jsField(o, field) {1650 return o[field];1651}1652/*** META ((export js-field-set! js-property-set!)1653 (peephole (hole 3 o "[" field "] = " val)))1654*/1655function sc_setJsFieldBang(o, field, val) {1656 return o[field] = val;1657}1658/*** META ((export js-field-delete! js-property-delete!)1659 (peephole (hole 2 "delete" o "[" field "]")))1660*/1661function sc_deleteJsFieldBang(o, field) {1662 delete o[field];1663}1664/*** META ((export #t)1665 (peephole (jsCall)))1666*/1667function sc_jsCall(o, fun) {1668 var args = new Array();1669 for (var i = 2; i < arguments.length; i++)1670 args[i-2] = arguments[i];1671 return fun.apply(o, args);1672}1673/*** META ((export #t)1674 (peephole (jsMethodCall)))1675*/1676function sc_jsMethodCall(o, field) {1677 var args = new Array();1678 for (var i = 2; i < arguments.length; i++)1679 args[i-2] = arguments[i];1680 return o[field].apply(o, args);1681}1682/*** META ((export new js-new)1683 (peephole (jsNew)))1684*/1685function sc_jsNew(c) {1686 var evalStr = "new c(";1687 evalStr +=arguments.length > 1? "arguments[1]": "";1688 for (var i = 2; i < arguments.length; i++)1689 evalStr += ", arguments[" + i + "]";1690 evalStr +=")";1691 return eval(evalStr);1692}1693// ======================== RegExp ====================1694/*** META ((export #t)) */1695function sc_pregexp(re) {1696 return new RegExp(sc_string2jsstring(re));1697}1698/*** META ((export #t)) */1699function sc_pregexpMatch(re, s) {1700 var reg = (re instanceof RegExp) ? re : sc_pregexp(re);1701 var tmp = reg.exec(sc_string2jsstring(s));1702 if (tmp == null) return false;1703 var res = null;1704 for (var i = tmp.length-1; i >= 0; i--) {1705 if (tmp[i] !== null) {1706 res = sc_cons(sc_jsstring2string(tmp[i]), res);1707 } else {1708 res = sc_cons(false, res);1709 }1710 }1711 return res;1712}1713/*** META ((export #t)) */1714function sc_pregexpReplace(re, s1, s2) {1715 var reg;1716 var jss1 = sc_string2jsstring(s1);1717 var jss2 = sc_string2jsstring(s2);1718 if (re instanceof RegExp) {1719 if (re.global)1720 reg = re;1721 else1722 reg = new RegExp(re.source);1723 } else {1724 reg = new RegExp(sc_string2jsstring(re));1725 }1726 return jss1.replace(reg, jss2);1727}1728/*** META ((export pregexp-replace*)) */1729function sc_pregexpReplaceAll(re, s1, s2) {1730 var reg;1731 var jss1 = sc_string2jsstring(s1);1732 var jss2 = sc_string2jsstring(s2);1733 if (re instanceof RegExp) {1734 if (re.global)1735 reg = re;1736 else1737 reg = new RegExp(re.source, "g");1738 } else {1739 reg = new RegExp(sc_string2jsstring(re), "g");1740 }1741 return jss1.replace(reg, jss2);1742}1743/*** META ((export #t)) */1744function sc_pregexpSplit(re, s) {1745 var reg = ((re instanceof RegExp) ?1746 re :1747 new RegExp(sc_string2jsstring(re)));1748 var jss = sc_string2jsstring(s);1749 var tmp = jss.split(reg);1750 if (tmp == null) return false;1751 return sc_vector2list(tmp);1752}1753/* =========================================================================== */1754/* Other library stuff */1755/* =========================================================================== */1756/*** META ((export #t)1757 (peephole (hole 1 "Math.floor(Math.random()*" 'n ")")))1758*/1759function sc_random(n) {1760 return Math.floor(Math.random()*n);1761}1762/*** META ((export current-date)1763 (peephole (hole 0 "new Date()")))1764*/1765function sc_currentDate() {1766 return new Date();1767}1768function sc_Hashtable() {1769}1770sc_Hashtable.prototype.toString = function() {1771 return "#{%hashtable}";1772};1773// sc_toWriteString == sc_toDisplayString == toString1774function sc_HashtableElement(key, val) {1775 this.key = key;1776 this.val = val;1777}1778/*** META ((export #t)1779 (peephole (hole 0 "new sc_Hashtable()")))1780*/1781function sc_makeHashtable() {1782 return new sc_Hashtable();1783}1784/*** META ((export #t)) */1785function sc_hashtablePutBang(ht, key, val) {1786 var hash = sc_hash(key);1787 ht[hash] = new sc_HashtableElement(key, val);1788}1789/*** META ((export #t)) */1790function sc_hashtableGet(ht, key) {1791 var hash = sc_hash(key);1792 if (hash in ht)1793 return ht[hash].val;1794 else1795 return false;1796}1797/*** META ((export #t)) */1798function sc_hashtableForEach(ht, f) {1799 for (var v in ht) {1800 if (ht[v] instanceof sc_HashtableElement)1801 f(ht[v].key, ht[v].val);1802 }1803}1804/*** META ((export hashtable-contains?)1805 (peephole (hole 2 "sc_hash(" 1 ") in " 0)))1806*/1807function sc_hashtableContains(ht, key) {1808 var hash = sc_hash(key);1809 if (hash in ht)1810 return true;1811 else1812 return false;1813}1814var SC_HASH_COUNTER = 0;1815function sc_hash(o) {1816 if (o === null)1817 return "null";1818 else if (o === undefined)1819 return "undefined";1820 else if (o === true)1821 return "true";1822 else if (o === false)1823 return "false";1824 else if (typeof o === "number")1825 return "num-" + o;1826 else if (typeof o === "string")1827 return "jsstr-" + o;1828 else if (o.sc_getHash)1829 return o.sc_getHash();1830 else1831 return sc_counterHash.call(o);1832}1833function sc_counterHash() {1834 if (!this.sc_hash) {1835 this.sc_hash = "hash-" + SC_HASH_COUNTER;1836 SC_HASH_COUNTER++;1837 }1838 return this.sc_hash;1839}1840function sc_Trampoline(args, maxTailCalls) {1841 this['__trampoline return__'] = true;1842 this.args = args;1843 this.MAX_TAIL_CALLs = maxTailCalls;1844}1845// TODO: call/cc stuff1846sc_Trampoline.prototype.restart = function() {1847 var o = this;1848 while (true) {1849 // set both globals.1850 SC_TAIL_OBJECT.calls = o.MAX_TAIL_CALLs-1;1851 var fun = o.args.callee;1852 var res = fun.apply(SC_TAIL_OBJECT, o.args);1853 if (res instanceof sc_Trampoline)1854 o = res;1855 else1856 return res;1857 }1858}1859/*** META ((export bind-exit-lambda)) */1860function sc_bindExitLambda(proc) {1861 var escape_obj = new sc_BindExitException();1862 var escape = function(res) {1863 escape_obj.res = res;1864 throw escape_obj;1865 };1866 try {1867 return proc(escape);1868 } catch(e) {1869 if (e === escape_obj) {1870 return e.res;1871 }1872 throw e;1873 }1874}1875function sc_BindExitException() {1876 this._internalException = true;1877}1878var SC_SCM2JS_GLOBALS = new Object();1879// default tail-call depth.1880// normally the program should set it again. but just in case...1881var SC_TAIL_OBJECT = new Object();1882SC_SCM2JS_GLOBALS.TAIL_OBJECT = SC_TAIL_OBJECT;1883// ======================== I/O =======================1884/*------------------------------------------------------------------*/1885function sc_EOF() {1886}1887var SC_EOF_OBJECT = new sc_EOF();1888function sc_Port() {1889}1890/* --------------- Input ports -------------------------------------*/1891function sc_InputPort() {1892}1893sc_InputPort.prototype = new sc_Port();1894sc_InputPort.prototype.peekChar = function() {1895 if (!("peeked" in this))1896 this.peeked = this.getNextChar();1897 return this.peeked;1898}1899sc_InputPort.prototype.readChar = function() {1900 var tmp = this.peekChar();1901 delete this.peeked;1902 return tmp;1903}1904sc_InputPort.prototype.isCharReady = function() {1905 return true;1906}1907sc_InputPort.prototype.close = function() {1908 // do nothing1909}1910/* .............. String port ..........................*/1911function sc_ErrorInputPort() {1912};1913sc_ErrorInputPort.prototype = new sc_InputPort();1914sc_ErrorInputPort.prototype.getNextChar = function() {1915 throw "can't read from error-port.";1916};1917sc_ErrorInputPort.prototype.isCharReady = function() {1918 return false;1919};1920/* .............. String port ..........................*/1921function sc_StringInputPort(jsStr) {1922 // we are going to do some charAts on the str.1923 // instead of recreating all the time a String-object, we1924 // create one in the beginning. (not sure, if this is really an optim)1925 this.str = new String(jsStr);1926 this.pos = 0;1927}1928sc_StringInputPort.prototype = new sc_InputPort();1929sc_StringInputPort.prototype.getNextChar = function() {1930 if (this.pos >= this.str.length)1931 return SC_EOF_OBJECT;1932 return this.str.charAt(this.pos++);1933};1934/* ------------- Read and other lib-funs -------------------------------*/1935function sc_Token(type, val, pos) {1936 this.type = type;1937 this.val = val;1938 this.pos = pos;1939}1940sc_Token.EOF = 0/*EOF*/;1941sc_Token.OPEN_PAR = 1/*OPEN_PAR*/;1942sc_Token.CLOSE_PAR = 2/*CLOSE_PAR*/;1943sc_Token.OPEN_BRACE = 3/*OPEN_BRACE*/;1944sc_Token.CLOSE_BRACE = 4/*CLOSE_BRACE*/;1945sc_Token.OPEN_BRACKET = 5/*OPEN_BRACKET*/;1946sc_Token.CLOSE_BRACKET = 6/*CLOSE_BRACKET*/;1947sc_Token.WHITESPACE = 7/*WHITESPACE*/;1948sc_Token.QUOTE = 8/*QUOTE*/;1949sc_Token.ID = 9/*ID*/;1950sc_Token.DOT = 10/*DOT*/;1951sc_Token.STRING = 11/*STRING*/;1952sc_Token.NUMBER = 12/*NUMBER*/;1953sc_Token.ERROR = 13/*ERROR*/;1954sc_Token.VECTOR_BEGIN = 14/*VECTOR_BEGIN*/;1955sc_Token.TRUE = 15/*TRUE*/;1956sc_Token.FALSE = 16/*FALSE*/;1957sc_Token.UNSPECIFIED = 17/*UNSPECIFIED*/;1958sc_Token.REFERENCE = 18/*REFERENCE*/;1959sc_Token.STORE = 19/*STORE*/;1960sc_Token.CHAR = 20/*CHAR*/;1961var SC_ID_CLASS = SC_LOWER_CLASS + SC_UPPER_CLASS + "!$%*+-./:<=>?@^_~";1962function sc_Tokenizer(port) {1963 this.port = port;1964}1965sc_Tokenizer.prototype.peekToken = function() {1966 if (this.peeked)1967 return this.peeked;1968 var newToken = this.nextToken();1969 this.peeked = newToken;1970 return newToken;1971};1972sc_Tokenizer.prototype.readToken = function() {1973 var tmp = this.peekToken();1974 delete this.peeked;1975 return tmp;1976};1977sc_Tokenizer.prototype.nextToken = function() {1978 var port = this.port;1979 function isNumberChar(c) {1980 return (c >= "0" && c <= "9");1981 };1982 function isIdOrNumberChar(c) {1983 return SC_ID_CLASS.indexOf(c) != -1 || // ID-char1984 (c >= "0" && c <= "9");1985 }1986 function isWhitespace(c) {1987 return c === " " || c === "\r" || c === "\n" || c === "\t" || c === "\f";1988 };1989 function isWhitespaceOrEOF(c) {1990 return isWhitespace(c) || c === SC_EOF_OBJECT;1991 };1992 function readString() {1993 res = "";1994 while (true) {1995 var c = port.readChar();1996 switch (c) {1997 case '"':1998 return new sc_Token(11/*STRING*/, res);1999 case "\\":2000 var tmp = port.readChar();2001 switch (tmp) {2002 case '0': res += "\0"; break;2003 case 'a': res += "\a"; break;2004 case 'b': res += "\b"; break;2005 case 'f': res += "\f"; break;2006 case 'n': res += "\n"; break;2007 case 'r': res += "\r"; break;2008 case 't': res += "\t"; break;2009 case 'v': res += "\v"; break;2010 case '"': res += '"'; break;2011 case '\\': res += '\\'; break;2012 case 'x':2013 /* hexa-number */2014 var nb = 0;2015 while (true) {2016 var hexC = port.peekChar();2017 if (hexC >= '0' && hexC <= '9') {2018 port.readChar();2019 nb = nb * 16 + hexC.charCodeAt(0) - '0'.charCodeAt(0);2020 } else if (hexC >= 'a' && hexC <= 'f') {2021 port.readChar();2022 nb = nb * 16 + hexC.charCodeAt(0) - 'a'.charCodeAt(0);2023 } else if (hexC >= 'A' && hexC <= 'F') {2024 port.readChar();2025 nb = nb * 16 + hexC.charCodeAt(0) - 'A'.charCodeAt(0);2026 } else {2027 // next char isn't part of hex.2028 res += String.fromCharCode(nb);2029 break;2030 }2031 }2032 break;2033 default:2034 if (tmp === SC_EOF_OBJECT) {2035 return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);2036 }2037 res += tmp;2038 }2039 break;2040 default:2041 if (c === SC_EOF_OBJECT) {2042 return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);2043 }2044 res += c;2045 }2046 }2047 };2048 function readIdOrNumber(firstChar) {2049 var res = firstChar;2050 while (isIdOrNumberChar(port.peekChar()))2051 res += port.readChar();2052 if (isNaN(res))2053 return new sc_Token(9/*ID*/, res);2054 else2055 return new sc_Token(12/*NUMBER*/, res - 0);2056 };2057 function skipWhitespaceAndComments() {2058 var done = false;2059 while (!done) {2060 done = true;2061 while (isWhitespace(port.peekChar()))2062 port.readChar();2063 if (port.peekChar() === ';') {2064 port.readChar();2065 done = false;2066 while (true) {2067 curChar = port.readChar();2068 if (curChar === SC_EOF_OBJECT ||2069 curChar === '\n')2070 break;2071 }2072 }2073 }2074 };2075 function readDot() {2076 if (isWhitespace(port.peekChar()))2077 return new sc_Token(10/*DOT*/);2078 else2079 return readIdOrNumber(".");2080 };2081 function readSharp() {2082 var c = port.readChar();2083 if (isWhitespace(c))2084 return new sc_Token(13/*ERROR*/, "bad #-pattern0.");2085 // reference2086 if (isNumberChar(c)) {2087 var nb = c - 0;2088 while (isNumberChar(port.peekChar()))2089 nb = nb*10 + (port.readChar() - 0);2090 switch (port.readChar()) {2091 case '#':2092 return new sc_Token(18/*REFERENCE*/, nb);2093 case '=':2094 return new sc_Token(19/*STORE*/, nb);2095 default:2096 return new sc_Token(13/*ERROR*/, "bad #-pattern1." + nb);2097 }2098 }2099 if (c === "(")2100 return new sc_Token(14/*VECTOR_BEGIN*/);2101 2102 if (c === "\\") { // character2103 var tmp = ""2104 while (!isWhitespaceOrEOF(port.peekChar()))2105 tmp += port.readChar();2106 switch (tmp.length) {2107 case 0: // it's escaping a whitespace char:2108 if (sc_isEOFObject(port.peekChar))2109 return new sc_Token(13/*ERROR*/, "bad #-pattern2.");2110 else2111 return new sc_Token(20/*CHAR*/, port.readChar());2112 case 1:2113 return new sc_Token(20/*CHAR*/, tmp);2114 default:2115 var entry = sc_Char.readable2char[tmp.toLowerCase()];2116 if (entry)2117 return new sc_Token(20/*CHAR*/, entry);2118 else2119 return new sc_Token(13/*ERROR*/, "unknown character description: #\\" + tmp);2120 }2121 }2122 // some constants (#t, #f, #unspecified)2123 var res;2124 var needing;2125 switch (c) {2126 case 't': res = new sc_Token(15/*TRUE*/, true); needing = ""; break;2127 case 'f': res = new sc_Token(16/*FALSE*/, false); needing = ""; break;2128 case 'u': res = new sc_Token(17/*UNSPECIFIED*/, undefined); needing = "nspecified"; break;2129 default:2130 return new sc_Token(13/*ERROR*/, "bad #-pattern3: " + c);2131 }2132 while(true) {2133 c = port.peekChar();2134 if ((isWhitespaceOrEOF(c) || c === ')') &&2135 needing == "")2136 return res;2137 else if (isWhitespace(c) || needing == "")2138 return new sc_Token(13/*ERROR*/, "bad #-pattern4 " + c + " " + needing);2139 else if (needing.charAt(0) == c) {2140 port.readChar(); // consume2141 needing = needing.slice(1);2142 } else2143 return new sc_Token(13/*ERROR*/, "bad #-pattern5");2144 }2145 2146 };2147 skipWhitespaceAndComments();2148 var curChar = port.readChar();2149 if (curChar === SC_EOF_OBJECT)2150 return new sc_Token(0/*EOF*/, curChar);2151 switch (curChar)2152 {2153 case " ":2154 case "\n":2155 case "\t":2156 return readWhitespace();2157 case "(":2158 return new sc_Token(1/*OPEN_PAR*/);2159 case ")":2160 return new sc_Token(2/*CLOSE_PAR*/);2161 case "{":2162 return new sc_Token(3/*OPEN_BRACE*/);2163 case "}":2164 return new sc_Token(4/*CLOSE_BRACE*/);2165 case "[":2166 return new sc_Token(5/*OPEN_BRACKET*/);2167 case "]":2168 return new sc_Token(6/*CLOSE_BRACKET*/);2169 case "'":2170 return new sc_Token(8/*QUOTE*/);2171 case "#":2172 return readSharp();2173 case ".":2174 return readDot();2175 case '"':2176 return readString();2177 default:2178 if (isIdOrNumberChar(curChar))2179 return readIdOrNumber(curChar);2180 throw "unexpected character: " + curChar;2181 }2182};2183function sc_Reader(tokenizer) {2184 this.tokenizer = tokenizer;2185 this.backref = new Array();2186}2187sc_Reader.prototype.read = function() {2188 function readList(listBeginType) {2189 function matchesPeer(open, close) {2190 return open === 1/*OPEN_PAR*/ && close === 2/*CLOSE_PAR*/2191 || open === 3/*OPEN_BRACE*/ && close === 4/*CLOSE_BRACE*/2192 || open === 5/*OPEN_BRACKET*/ && close === 6/*CLOSE_BRACKET*/;2193 };2194 var res = null;2195 while (true) {2196 var token = tokenizer.peekToken();2197 switch (token.type) {2198 case 2/*CLOSE_PAR*/:2199 case 4/*CLOSE_BRACE*/:2200 case 6/*CLOSE_BRACKET*/:2201 if (matchesPeer(listBeginType, token.type)) {2202 tokenizer.readToken(); // consume token2203 return sc_reverseBang(res);2204 } else2205 throw "closing par doesn't match: " + listBeginType2206 + " " + listEndType;2207 case 0/*EOF*/:2208 throw "unexpected end of file";2209 case 10/*DOT*/:2210 tokenizer.readToken(); // consume token2211 var cdr = this.read();2212 var par = tokenizer.readToken();2213 if (!matchesPeer(listBeginType, par.type))2214 throw "closing par doesn't match: " + listBeginType2215 + " " + par.type;2216 else2217 return sc_reverseAppendBang(res, cdr);2218 2219 default:2220 res = sc_cons(this.read(), res);2221 }2222 }2223 };2224 function readQuote() {2225 return sc_cons("quote", sc_cons(this.read(), null));2226 };2227 function readVector() {2228 // opening-parenthesis is already consumed2229 var a = new Array();2230 while (true) {2231 var token = tokenizer.peekToken();2232 switch (token.type) {2233 case 2/*CLOSE_PAR*/:2234 tokenizer.readToken();2235 return a;2236 2237 default:2238 a.push(this.read());2239 }2240 }2241 };2242 function storeRefence(nb) {2243 var tmp = this.read();2244 this.backref[nb] = tmp;2245 return tmp;2246 };2247 2248 function readReference(nb) {2249 if (nb in this.backref)2250 return this.backref[nb];2251 else2252 throw "bad reference: " + nb;2253 };2254 var tokenizer = this.tokenizer;2255 var token = tokenizer.readToken();2256 // handle error2257 if (token.type === 13/*ERROR*/)2258 throw token.val;2259 switch (token.type) {2260 case 1/*OPEN_PAR*/:2261 case 3/*OPEN_BRACE*/:2262 case 5/*OPEN_BRACKET*/:2263 return readList.call(this, token.type);2264 case 8/*QUOTE*/:2265 return readQuote.call(this);2266 case 11/*STRING*/:2267 return sc_jsstring2string(token.val);2268 case 20/*CHAR*/:2269 return new sc_Char(token.val);2270 case 14/*VECTOR_BEGIN*/:2271 return readVector.call(this);2272 case 18/*REFERENCE*/:2273 return readReference.call(this, token.val);2274 case 19/*STORE*/:2275 return storeRefence.call(this, token.val);2276 case 9/*ID*/:2277 return sc_jsstring2symbol(token.val);2278 case 0/*EOF*/:2279 case 12/*NUMBER*/:2280 case 15/*TRUE*/:2281 case 16/*FALSE*/:2282 case 17/*UNSPECIFIED*/:2283 return token.val;2284 default:2285 throw "unexpected token " + token.type + " " + token.val;2286 }2287};2288/*** META ((export #t)) */2289function sc_read(port) {2290 if (port === undefined) // we assume the port hasn't been given.2291 port = SC_DEFAULT_IN; // THREAD: shared var...2292 var reader = new sc_Reader(new sc_Tokenizer(port));2293 return reader.read();2294}2295/*** META ((export #t)) */2296function sc_readChar(port) {2297 if (port === undefined) // we assume the port hasn't been given.2298 port = SC_DEFAULT_IN; // THREAD: shared var...2299 var t = port.readChar();2300 return t === SC_EOF_OBJECT? t: new sc_Char(t);2301}2302/*** META ((export #t)) */2303function sc_peekChar(port) {2304 if (port === undefined) // we assume the port hasn't been given.2305 port = SC_DEFAULT_IN; // THREAD: shared var...2306 var t = port.peekChar();2307 return t === SC_EOF_OBJECT? t: new sc_Char(t);2308}2309/*** META ((export #t)2310 (type bool))2311*/2312function sc_isCharReady(port) {2313 if (port === undefined) // we assume the port hasn't been given.2314 port = SC_DEFAULT_IN; // THREAD: shared var...2315 return port.isCharReady();2316}2317/*** META ((export #t)2318 (peephole (postfix ".close()")))2319*/2320function sc_closeInputPort(p) {2321 return p.close();2322}2323/*** META ((export #t)2324 (type bool)2325 (peephole (postfix " instanceof sc_InputPort")))2326*/2327function sc_isInputPort(o) {2328 return (o instanceof sc_InputPort);2329}2330/*** META ((export eof-object?)2331 (type bool)2332 (peephole (postfix " === SC_EOF_OBJECT")))2333*/2334function sc_isEOFObject(o) {2335 return o === SC_EOF_OBJECT;2336}2337/*** META ((export #t)2338 (peephole (hole 0 "SC_DEFAULT_IN")))2339*/2340function sc_currentInputPort() {2341 return SC_DEFAULT_IN;2342}2343/* ------------ file operations are not supported -----------*/2344/*** META ((export #t)) */2345function sc_callWithInputFile(s, proc) {2346 throw "can't open " + s;2347}2348/*** META ((export #t)) */2349function sc_callWithOutputFile(s, proc) {2350 throw "can't open " + s;2351}2352/*** META ((export #t)) */2353function sc_withInputFromFile(s, thunk) {2354 throw "can't open " + s;2355}2356/*** META ((export #t)) */2357function sc_withOutputToFile(s, thunk) {2358 throw "can't open " + s;2359}2360/*** META ((export #t)) */2361function sc_openInputFile(s) {2362 throw "can't open " + s;2363}2364/*** META ((export #t)) */2365function sc_openOutputFile(s) {2366 throw "can't open " + s;2367}2368/* ----------------------------------------------------------------------------*/2369/*** META ((export #t)) */2370function sc_basename(p) {2371 var i = p.lastIndexOf('/');2372 if(i >= 0)2373 return p.substring(i + 1, p.length);2374 else2375 return '';2376}2377/*** META ((export #t)) */2378function sc_dirname(p) {2379 var i = p.lastIndexOf('/');2380 if(i >= 0)2381 return p.substring(0, i);2382 else2383 return '';2384}2385/* ----------------------------------------------------------------------------*/2386/*** META ((export #t)) */2387function sc_withInputFromPort(p, thunk) {2388 try {2389 var tmp = SC_DEFAULT_IN; // THREAD: shared var.2390 SC_DEFAULT_IN = p;2391 return thunk();2392 } finally {2393 SC_DEFAULT_IN = tmp;2394 }2395}2396/*** META ((export #t)) */2397function sc_withInputFromString(s, thunk) {2398 return sc_withInputFromPort(new sc_StringInputPort(sc_string2jsstring(s)), thunk);2399}2400/*** META ((export #t)) */2401function sc_withOutputToPort(p, thunk) {2402 try {2403 var tmp = SC_DEFAULT_OUT; // THREAD: shared var.2404 SC_DEFAULT_OUT = p;2405 return thunk();2406 } finally {2407 SC_DEFAULT_OUT = tmp;2408 }2409}2410/*** META ((export #t)) */2411function sc_withOutputToString(thunk) {2412 var p = new sc_StringOutputPort();2413 sc_withOutputToPort(p, thunk);2414 return p.close();2415}2416/*** META ((export #t)) */2417function sc_withOutputToProcedure(proc, thunk) {2418 var t = function(s) { proc(sc_jsstring2string(s)); };2419 return sc_withOutputToPort(new sc_GenericOutputPort(t), thunk);2420}2421/*** META ((export #t)2422 (peephole (hole 0 "new sc_StringOutputPort()")))2423*/2424function sc_openOutputString() {2425 return new sc_StringOutputPort();2426}2427/*** META ((export #t)) */2428function sc_openInputString(str) {2429 return new sc_StringInputPort(sc_string2jsstring(str));2430}2431/* ----------------------------------------------------------------------------*/2432function sc_OutputPort() {2433}2434sc_OutputPort.prototype = new sc_Port();2435sc_OutputPort.prototype.appendJSString = function(obj) {2436 /* do nothing */2437}2438sc_OutputPort.prototype.close = function() {2439 /* do nothing */2440}2441function sc_StringOutputPort() {2442 this.res = "";2443}2444sc_StringOutputPort.prototype = new sc_OutputPort();2445sc_StringOutputPort.prototype.appendJSString = function(s) {2446 this.res += s;2447}2448sc_StringOutputPort.prototype.close = function() {2449 return sc_jsstring2string(this.res);2450}2451/*** META ((export #t)) */2452function sc_getOutputString(sp) {2453 return sc_jsstring2string(sp.res);2454}2455function sc_ErrorOutputPort() {2456}2457sc_ErrorOutputPort.prototype = new sc_OutputPort();2458sc_ErrorOutputPort.prototype.appendJSString = function(s) {2459 throw "don't write on ErrorPort!";2460}2461sc_ErrorOutputPort.prototype.close = function() {2462 /* do nothing */2463}2464function sc_GenericOutputPort(appendJSString, close) {2465 this.appendJSString = appendJSString;2466 if (close)2467 this.close = close;2468}2469sc_GenericOutputPort.prototype = new sc_OutputPort();2470/*** META ((export #t)2471 (type bool)2472 (peephole (postfix " instanceof sc_OutputPort")))2473*/2474function sc_isOutputPort(o) {2475 return (o instanceof sc_OutputPort);2476}2477/*** META ((export #t)2478 (peephole (postfix ".close()")))2479*/2480function sc_closeOutputPort(p) {2481 return p.close();2482}2483/* ------------------ write ---------------------------------------------------*/2484/*** META ((export #t)) */2485function sc_write(o, p) {2486 if (p === undefined) // we assume not given2487 p = SC_DEFAULT_OUT;2488 p.appendJSString(sc_toWriteString(o));2489}2490function sc_toWriteString(o) {2491 if (o === null)2492 return "()";2493 else if (o === true)2494 return "#t";2495 else if (o === false)2496 return "#f";2497 else if (o === undefined)2498 return "#unspecified";2499 else if (typeof o === 'function')2500 return "#<procedure " + sc_hash(o) + ">";2501 else if (o.sc_toWriteString)2502 return o.sc_toWriteString();2503 else2504 return o.toString();2505}2506function sc_escapeWriteString(s) {2507 var res = "";2508 var j = 0;2509 for (i = 0; i < s.length; i++) {2510 switch (s.charAt(i)) {2511 case "\0": res += s.substring(j, i) + "\\0"; j = i + 1; break;2512 case "\b": res += s.substring(j, i) + "\\b"; j = i + 1; break;2513 case "\f": res += s.substring(j, i) + "\\f"; j = i + 1; break;2514 case "\n": res += s.substring(j, i) + "\\n"; j = i + 1; break;2515 case "\r": res += s.substring(j, i) + "\\r"; j = i + 1; break;2516 case "\t": res += s.substring(j, i) + "\\t"; j = i + 1; break;2517 case "\v": res += s.substring(j, i) + "\\v"; j = i + 1; break;2518 case '"': res += s.substring(j, i) + '\\"'; j = i + 1; break;2519 case "\\": res += s.substring(j, i) + "\\\\"; j = i + 1; break;2520 default:2521 var c = s.charAt(i);2522 if ("\a" !== "a" && c == "\a") {2523 res += s.substring(j, i) + "\\a"; j = i + 1; continue;2524 }2525 if ("\v" !== "v" && c == "\v") {2526 res += s.substring(j, i) + "\\v"; j = i + 1; continue;2527 }2528 //if (s.charAt(i) < ' ' || s.charCodeAt(i) > 127) {2529 // CARE: Manuel is this OK with HOP?2530 if (s.charAt(i) < ' ') {2531 /* non printable character and special chars */2532 res += s.substring(j, i) + "\\x" + s.charCodeAt(i).toString(16);2533 j = i + 1;2534 }2535 // else just let i increase...2536 }2537 }2538 res += s.substring(j, i);2539 return res;2540}2541/* ------------------ display ---------------------------------------------------*/2542/*** META ((export #t)) */2543function sc_display(o, p) {2544 if (p === undefined) // we assume not given2545 p = SC_DEFAULT_OUT;2546 p.appendJSString(sc_toDisplayString(o));2547}2548function sc_toDisplayString(o) {2549 if (o === null)2550 return "()";2551 else if (o === true)2552 return "#t";2553 else if (o === false)2554 return "#f";2555 else if (o === undefined)2556 return "#unspecified";2557 else if (typeof o === 'function')2558 return "#<procedure " + sc_hash(o) + ">";2559 else if (o.sc_toDisplayString)2560 return o.sc_toDisplayString();2561 else2562 return o.toString();2563}2564/* ------------------ newline ---------------------------------------------------*/2565/*** META ((export #t)) */2566function sc_newline(p) {2567 if (p === undefined) // we assume not given2568 p = SC_DEFAULT_OUT;2569 p.appendJSString("\n");2570}2571/* ------------------ write-char ---------------------------------------------------*/2572/*** META ((export #t)) */2573function sc_writeChar(c, p) {2574 if (p === undefined) // we assume not given2575 p = SC_DEFAULT_OUT;2576 p.appendJSString(c.val);2577}2578/* ------------------ write-circle ---------------------------------------------------*/2579/*** META ((export #t)) */2580function sc_writeCircle(o, p) {2581 if (p === undefined) // we assume not given2582 p = SC_DEFAULT_OUT;2583 p.appendJSString(sc_toWriteCircleString(o));2584}2585function sc_toWriteCircleString(o) {2586 var symb = sc_gensym("writeCircle");2587 var nbPointer = new Object();2588 nbPointer.nb = 0;2589 sc_prepWriteCircle(o, symb, nbPointer);2590 return sc_genToWriteCircleString(o, symb);2591}2592function sc_prepWriteCircle(o, symb, nbPointer) {2593 // TODO sc_Struct2594 if (o instanceof sc_Pair ||2595 o instanceof sc_Vector) {2596 if (o[symb] !== undefined) {2597 // not the first visit.2598 o[symb]++;2599 // unless there is already a number, assign one.2600 if (!o[symb + "nb"]) o[symb + "nb"] = nbPointer.nb++;2601 return;2602 }2603 o[symb] = 0;2604 if (o instanceof sc_Pair) {2605 sc_prepWriteCircle(o.car, symb, nbPointer);2606 sc_prepWriteCircle(o.cdr, symb, nbPointer);2607 } else {2608 for (var i = 0; i < o.length; i++)2609 sc_prepWriteCircle(o[i], symb, nbPointer);2610 }2611 }2612}2613function sc_genToWriteCircleString(o, symb) {2614 if (!(o instanceof sc_Pair ||2615 o instanceof sc_Vector))2616 return sc_toWriteString(o);2617 return o.sc_toWriteCircleString(symb);2618}2619sc_Pair.prototype.sc_toWriteCircleString = function(symb, inList) {2620 if (this[symb + "use"]) { // use-flag is set. Just use it.2621 var nb = this[symb + "nb"];2622 if (this[symb]-- === 0) { // if we are the last use. remove all fields.2623 delete this[symb];2624 delete this[symb + "nb"];2625 delete this[symb + "use"];2626 }2627 if (inList)2628 return '. #' + nb + '#';2629 else2630 return '#' + nb + '#';2631 }2632 if (this[symb]-- === 0) { // if we are the last use. remove all fields.2633 delete this[symb];2634 delete this[symb + "nb"];2635 delete this[symb + "use"];2636 }2637 var res = "";2638 if (this[symb] !== undefined) { // implies > 02639 this[symb + "use"] = true;2640 if (inList)2641 res += '. #' + this[symb + "nb"] + '=';2642 else2643 res += '#' + this[symb + "nb"] + '=';2644 inList = false;2645 }2646 if (!inList)2647 res += "(";2648 // print car2649 res += sc_genToWriteCircleString(this.car, symb);2650 if (sc_isPair(this.cdr)) {2651 res += " " + this.cdr.sc_toWriteCircleString(symb, true);2652 } else if (this.cdr !== null) {2653 res += " . " + sc_genToWriteCircleString(this.cdr, symb);2654 }2655 if (!inList)2656 res += ")";2657 return res;2658};2659sc_Vector.prototype.sc_toWriteCircleString = function(symb) {2660 if (this[symb + "use"]) { // use-flag is set. Just use it.2661 var nb = this[symb + "nb"];2662 if (this[symb]-- === 0) { // if we are the last use. remove all fields.2663 delete this[symb];2664 delete this[symb + "nb"];2665 delete this[symb + "use"];2666 }2667 return '#' + nb + '#';2668 }2669 if (this[symb]-- === 0) { // if we are the last use. remove all fields.2670 delete this[symb];2671 delete this[symb + "nb"];2672 delete this[symb + "use"];2673 }2674 var res = "";2675 if (this[symb] !== undefined) { // implies > 02676 this[symb + "use"] = true;2677 res += '#' + this[symb + "nb"] + '=';2678 }2679 res += "#(";2680 for (var i = 0; i < this.length; i++) {2681 res += sc_genToWriteCircleString(this[i], symb);2682 if (i < this.length - 1) res += " ";2683 }2684 res += ")";2685 return res;2686};2687/* ------------------ print ---------------------------------------------------*/2688/*** META ((export #t)) */2689function sc_print(s) {2690 if (arguments.length === 1) {2691 sc_display(s);2692 sc_newline();2693 }2694 else {2695 for (var i = 0; i < arguments.length; i++)2696 sc_display(arguments[i]);2697 sc_newline();2698 }2699}2700/* ------------------ format ---------------------------------------------------*/2701/*** META ((export #t)) */2702function sc_format(s, args) {2703 var len = s.length;2704 var p = new sc_StringOutputPort();2705 var i = 0, j = 1;2706 while( i < len ) {2707 var i2 = s.indexOf("~", i);2708 if (i2 == -1) {2709 p.appendJSString( s.substring( i, len ) );2710 return p.close();2711 } else {2712 if (i2 > i) {2713 if (i2 == (len - 1)) {2714 p.appendJSString(s.substring(i, len));2715 return p.close();2716 } else {2717 p.appendJSString(s.substring(i, i2));2718 i = i2;2719 }2720 }2721 switch(s.charCodeAt(i2 + 1)) {2722 case 65:2723 case 97:2724 // a2725 sc_display(arguments[j], p);2726 i += 2; j++;2727 break;2728 case 83:2729 case 115:2730 // s2731 sc_write(arguments[j], p);2732 i += 2; j++;2733 break;2734 case 86:2735 case 118:2736 // v2737 sc_display(arguments[j], p);2738 p.appendJSString("\n");2739 i += 2; j++;2740 break;2741 case 67:2742 case 99:2743 // c2744 p.appendJSString(String.fromCharCode(arguments[j]));2745 i += 2; j++;2746 break;2747 case 88:2748 case 120:2749 // x2750 p.appendJSString(arguments[j].toString(6));2751 i += 2; j++;2752 break;2753 case 79:2754 case 111:2755 // o2756 p.appendJSString(arguments[j].toString(8));2757 i += 2; j++;2758 break;2759 case 66:2760 case 98:2761 // b2762 p.appendJSString(arguments[j].toString(2));2763 i += 2; j++;2764 break;2765 case 37:2766 case 110:2767 // %, n2768 p.appendJSString("\n");2769 i += 2; break;2770 case 114:2771 // r2772 p.appendJSString("\r");2773 i += 2; break;2774 case 126:2775 // ~2776 p.appendJSString("~");2777 i += 2; break;2778 default:2779 sc_error( "format: illegal ~"2780 + String.fromCharCode(s.charCodeAt(i2 + 1))2781 + " sequence" );2782 return "";2783 }2784 }2785 }2786 return p.close();2787}2788/* ------------------ global ports ---------------------------------------------------*/2789var SC_DEFAULT_IN = new sc_ErrorInputPort();2790var SC_DEFAULT_OUT = new sc_ErrorOutputPort();2791var SC_ERROR_OUT = new sc_ErrorOutputPort();2792var sc_SYMBOL_PREFIX = "\u1E9C";2793var sc_KEYWORD_PREFIX = "\u1E9D";2794/*** META ((export #t)2795 (peephole (id))) */2796function sc_jsstring2string(s) {2797 return s;2798}2799/*** META ((export #t)2800 (peephole (prefix "'\\u1E9C' +")))2801*/2802function sc_jsstring2symbol(s) {2803 return sc_SYMBOL_PREFIX + s;2804}2805/*** META ((export #t)2806 (peephole (id)))2807*/2808function sc_string2jsstring(s) {2809 return s;2810}2811/*** META ((export #t)2812 (peephole (symbol2jsstring_immutable)))2813*/2814function sc_symbol2jsstring(s) {2815 return s.slice(1);2816}2817/*** META ((export #t)2818 (peephole (postfix ".slice(1)")))2819*/2820function sc_keyword2jsstring(k) {2821 return k.slice(1);2822}2823/*** META ((export #t)2824 (peephole (prefix "'\\u1E9D' +")))2825*/2826function sc_jsstring2keyword(s) {2827 return sc_KEYWORD_PREFIX + s;2828}2829/*** META ((export #t)2830 (type bool))2831*/2832function sc_isKeyword(s) {2833 return (typeof s === "string") &&2834 (s.charAt(0) === sc_KEYWORD_PREFIX);2835}2836/*** META ((export #t)) */2837var sc_gensym = function() {2838 var counter = 1000;2839 return function(sym) {2840 counter++;2841 if (!sym) sym = sc_SYMBOL_PREFIX;2842 return sym + "s" + counter + "~" + "^sC-GeNsYm ";2843 };2844}();2845/*** META ((export #t)2846 (type bool))2847*/2848function sc_isEqual(o1, o2) {2849 return ((o1 === o2) ||2850 (sc_isPair(o1) && sc_isPair(o2)2851 && sc_isPairEqual(o1, o2, sc_isEqual)) ||2852 (sc_isVector(o1) && sc_isVector(o2)2853 && sc_isVectorEqual(o1, o2, sc_isEqual)));2854}2855/*** META ((export number->symbol integer->symbol)) */2856function sc_number2symbol(x, radix) {2857 return sc_SYMBOL_PREFIX + sc_number2jsstring(x, radix);2858}2859/*** META ((export number->string integer->string)) */2860var sc_number2string = sc_number2jsstring;2861/*** META ((export #t)) */2862function sc_symbol2number(s, radix) {2863 return sc_jsstring2number(s.slice(1), radix);2864}2865/*** META ((export #t)) */2866var sc_string2number = sc_jsstring2number;2867/*** META ((export #t)2868 (peephole (prefix "+" s)))2869 ;; peephole will only apply if no radix is given.2870*/2871function sc_string2integer(s, radix) {2872 if (!radix) return +s;2873 return parseInt(s, radix);2874}2875/*** META ((export #t)2876 (peephole (prefix "+")))2877*/2878function sc_string2real(s) {2879 return +s;2880}2881/*** META ((export #t)2882 (type bool))2883*/2884function sc_isSymbol(s) {2885 return (typeof s === "string") &&2886 (s.charAt(0) === sc_SYMBOL_PREFIX);2887}2888/*** META ((export #t)2889 (peephole (symbol2string_immutable)))2890*/2891function sc_symbol2string(s) {2892 return s.slice(1);2893}2894/*** META ((export #t)2895 (peephole (prefix "'\\u1E9C' +")))2896*/2897function sc_string2symbol(s) {2898 return sc_SYMBOL_PREFIX + s;2899}2900/*** META ((export symbol-append)2901 (peephole (symbolAppend_immutable)))2902*/2903function sc_symbolAppend() {2904 var res = sc_SYMBOL_PREFIX;2905 for (var i = 0; i < arguments.length; i++)2906 res += arguments[i].slice(1);2907 return res;2908}2909/*** META ((export #t)2910 (peephole (postfix ".val")))2911*/2912function sc_char2string(c) { return c.val; }2913/*** META ((export #t)2914 (peephole (hole 1 "'\\u1E9C' + " c ".val")))2915*/2916function sc_char2symbol(c) { return sc_SYMBOL_PREFIX + c.val; }2917/*** META ((export #t)2918 (type bool))2919*/2920function sc_isString(s) {2921 return (typeof s === "string") &&2922 (s.charAt(0) !== sc_SYMBOL_PREFIX);2923}2924/*** META ((export #t)) */2925var sc_makeString = sc_makejsString;2926/*** META ((export #t)) */2927function sc_string() {2928 for (var i = 0; i < arguments.length; i++)2929 arguments[i] = arguments[i].val;2930 return "".concat.apply("", arguments);2931}2932/*** META ((export #t)2933 (peephole (postfix ".length")))2934*/2935function sc_stringLength(s) { return s.length; }2936/*** META ((export #t)) */2937function sc_stringRef(s, k) {2938 return new sc_Char(s.charAt(k));2939}2940/* there's no stringSet in the immutable version2941function sc_stringSet(s, k, c)2942*/2943/*** META ((export string=?)2944 (type bool)2945 (peephole (hole 2 str1 " === " str2)))2946*/2947function sc_isStringEqual(s1, s2) {2948 return s1 === s2;2949}2950/*** META ((export string<?)2951 (type bool)2952 (peephole (hole 2 str1 " < " str2)))2953*/2954function sc_isStringLess(s1, s2) {2955 return s1 < s2;2956}2957/*** META ((export string>?)2958 (type bool)2959 (peephole (hole 2 str1 " > " str2)))2960*/2961function sc_isStringGreater(s1, s2) {2962 return s1 > s2;2963}2964/*** META ((export string<=?)2965 (type bool)2966 (peephole (hole 2 str1 " <= " str2)))2967*/2968function sc_isStringLessEqual(s1, s2) {2969 return s1 <= s2;2970}2971/*** META ((export string>=?)2972 (type bool)2973 (peephole (hole 2 str1 " >= " str2)))2974*/2975function sc_isStringGreaterEqual(s1, s2) {2976 return s1 >= s2;2977}2978/*** META ((export string-ci=?)2979 (type bool)2980 (peephole (hole 2 str1 ".toLowerCase() === " str2 ".toLowerCase()")))2981*/2982function sc_isStringCIEqual(s1, s2) {2983 return s1.toLowerCase() === s2.toLowerCase();2984}2985/*** META ((export string-ci<?)2986 (type bool)2987 (peephole (hole 2 str1 ".toLowerCase() < " str2 ".toLowerCase()")))2988*/2989function sc_isStringCILess(s1, s2) {2990 return s1.toLowerCase() < s2.toLowerCase();2991}2992/*** META ((export string-ci>?)2993 (type bool)2994 (peephole (hole 2 str1 ".toLowerCase() > " str2 ".toLowerCase()")))2995*/2996function sc_isStringCIGreater(s1, s2) {2997 return s1.toLowerCase() > s2.toLowerCase();2998}2999/*** META ((export string-ci<=?)3000 (type bool)3001 (peephole (hole 2 str1 ".toLowerCase() <= " str2 ".toLowerCase()")))3002*/3003function sc_isStringCILessEqual(s1, s2) {3004 return s1.toLowerCase() <= s2.toLowerCase();3005}3006/*** META ((export string-ci>=?)3007 (type bool)3008 (peephole (hole 2 str1 ".toLowerCase() >= " str2 ".toLowerCase()")))3009*/3010function sc_isStringCIGreaterEqual(s1, s2) {3011 return s1.toLowerCase() >= s2.toLowerCase();3012}3013/*** META ((export #t)3014 (peephole (hole 3 s ".substring(" start ", " end ")")))3015*/3016function sc_substring(s, start, end) {3017 return s.substring(start, end);3018}3019/*** META ((export #t))3020*/3021function sc_isSubstring_at(s1, s2, i) {3022 return s2 == s1.substring(i, i+ s2.length);3023}3024/*** META ((export #t)3025 (peephole (infix 0 #f "+" "''")))3026*/3027function sc_stringAppend() {3028 return "".concat.apply("", arguments);3029}3030/*** META ((export #t)) */3031var sc_string2list = sc_jsstring2list;3032/*** META ((export #t)) */3033var sc_list2string = sc_list2jsstring;3034/*** META ((export #t)3035 (peephole (id)))3036*/3037function sc_stringCopy(s) {3038 return s;3039}3040/* there's no string-fill in the immutable version3041function sc_stringFill(s, c)3042*/3043/*** META ((export #t)3044 (peephole (postfix ".slice(1)")))3045*/3046function sc_keyword2string(o) {3047 return o.slice(1);3048}3049/*** META ((export #t)3050 (peephole (prefix "'\\u1E9D' +")))3051*/3052function sc_string2keyword(o) {3053 return sc_KEYWORD_PREFIX + o;3054}3055String.prototype.sc_toDisplayString = function() {3056 if (this.charAt(0) === sc_SYMBOL_PREFIX)3057 // TODO: care for symbols with spaces (escape-chars symbols).3058 return this.slice(1);3059 else if (this.charAt(0) === sc_KEYWORD_PREFIX)3060 return ":" + this.slice(1);3061 else3062 return this.toString();3063};3064String.prototype.sc_toWriteString = function() {3065 if (this.charAt(0) === sc_SYMBOL_PREFIX)3066 // TODO: care for symbols with spaces (escape-chars symbols).3067 return this.slice(1);3068 else if (this.charAt(0) === sc_KEYWORD_PREFIX)3069 return ":" + this.slice(1);3070 else3071 return '"' + sc_escapeWriteString(this) + '"';3072};3073/* Exported Variables */3074var BgL_testzd2boyerzd2;3075var BgL_nboyerzd2benchmarkzd2;3076var BgL_setupzd2boyerzd2;3077/* End Exports */3078var translate_term_nboyer;3079var translate_args_nboyer;3080var untranslate_term_nboyer;3081var BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer;3082var BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer;3083var translate_alist_nboyer;3084var apply_subst_nboyer;3085var apply_subst_lst_nboyer;3086var tautologyp_nboyer;3087var if_constructor_nboyer;3088var rewrite_count_nboyer;3089var rewrite_nboyer;3090var rewrite_args_nboyer;3091var unify_subst_nboyer;3092var one_way_unify1_nboyer;3093var false_term_nboyer;3094var true_term_nboyer;3095var trans_of_implies1_nboyer;3096var is_term_equal_nboyer;3097var is_term_member_nboyer;3098var const_nboyer;3099var sc_const_3_nboyer;3100var sc_const_4_nboyer;3101{3102 (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)))))));3103 (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))))))));3104 (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)))))))))));3105 BgL_nboyerzd2benchmarkzd2 = function() {3106 var args = null;3107 for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {3108 args = sc_cons(arguments[sc_tmp], args);3109 }3110 var n;3111 return ((n = ((args === null)?(0):(args.car))), (BgL_setupzd2boyerzd2()), (BgL_runzd2benchmarkzd2(("nboyer"+(sc_number2string(n))), (1), function() {3112 return (BgL_testzd2boyerzd2(n));3113 }, function(rewrites) {3114 if ((sc_isNumber(rewrites)))3115 switch (n) {3116 case (0):3117 return (rewrites===(95024));3118 break;3119 case (1):3120 return (rewrites===(591777));3121 break;3122 case (2):3123 return (rewrites===(1813975));3124 break;3125 case (3):3126 return (rewrites===(5375678));3127 break;3128 case (4):3129 return (rewrites===(16445406));3130 break;3131 case (5):3132 return (rewrites===(51507739));3133 break;3134 default:3135 return true;3136 break;3137 }3138 else3139 return false;3140 })));3141 };3142 BgL_setupzd2boyerzd2 = function() {3143 return true;3144 };3145 BgL_testzd2boyerzd2 = function() {3146 return true;3147 };3148 translate_term_nboyer = function(term) {3149 var lst;3150 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))))))))));3151 };3152 translate_args_nboyer = function(lst) {3153 var sc_lst_5;3154 var term;3155 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))))))))));3156 };3157 untranslate_term_nboyer = function(term) {3158 var optrOpnd;3159 var tail1131;3160 var L1127;3161 var falseHead1130;3162 var symbol_record;3163 if (!(term instanceof sc_Pair))3164 return term;3165 else3166 {3167 (falseHead1130 = (new sc_Pair(null, null)));3168 (L1127 = (term.cdr));3169 (tail1131 = falseHead1130);3170 while (!(L1127 === null)) {3171 {3172 (tail1131.cdr = (new sc_Pair((untranslate_term_nboyer((L1127.car))), null)));3173 (tail1131 = (tail1131.cdr));3174 (L1127 = (L1127.cdr));3175 }3176 }3177 (optrOpnd = (falseHead1130.cdr));3178 return (new sc_Pair(((symbol_record = (term.car)), (symbol_record[(0)])), optrOpnd));3179 }3180 };3181 BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer = function(sym) {3182 var r;3183 var x;3184 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)));3185 };3186 (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);3187 translate_alist_nboyer = function(alist) {3188 var sc_alist_6;3189 var term;3190 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))))))))));3191 };3192 apply_subst_nboyer = function(alist, term) {3193 var lst;3194 var temp_temp;3195 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))))))))));3196 };3197 apply_subst_lst_nboyer = function(alist, lst) {3198 var sc_lst_7;3199 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))))))))));3200 };3201 tautologyp_nboyer = function(sc_x_11, true_lst, false_lst) {3202 var tmp1125;3203 var x;3204 var tmp1126;3205 var sc_x_8;3206 var sc_tmp1125_9;3207 var sc_tmp1126_10;3208 var sc_x_11;3209 var true_lst;3210 var false_lst;3211 while (true) {3212 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))3213 return true;3214 else3215 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))3216 return false;3217 else3218 if (!(sc_x_11 instanceof sc_Pair))3219 return false;3220 else3221 if (((sc_x_11.car)===if_constructor_nboyer))3222 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))3223 (sc_x_11 = (sc_x_11.cdr.cdr.car));3224 else3225 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))3226 (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));3227 else3228 if (((tautologyp_nboyer((sc_x_11.cdr.cdr.car), (new sc_Pair((sc_x_11.cdr.car), true_lst)), false_lst))!== false))3229 {3230 (false_lst = (new sc_Pair((sc_x_11.cdr.car), false_lst)));3231 (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));3232 }3233 else3234 return false;3235 else3236 return false;3237 }3238 };3239 (if_constructor_nboyer = "\u1E9C*");3240 (rewrite_count_nboyer = (0));3241 rewrite_nboyer = function(term) {3242 var term2;3243 var sc_term_12;3244 var lst;3245 var symbol_record;3246 var sc_lst_13;3247 {3248 (++rewrite_count_nboyer);3249 if (!(term instanceof sc_Pair))3250 return term;3251 else3252 {3253 (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))))))))));3254 (lst = ((symbol_record = (term.car)), (symbol_record[(1)])));3255 while (true) {3256 if ((lst === null))3257 return sc_term_12;3258 else3259 if ((((term2 = ((lst.car).cdr.car)), (unify_subst_nboyer = null), (one_way_unify1_nboyer(sc_term_12, term2)))!== false))3260 return (rewrite_nboyer((apply_subst_nboyer(unify_subst_nboyer, ((lst.car).cdr.cdr.car)))));3261 else3262 (lst = (lst.cdr));3263 }3264 }3265 }3266 };3267 rewrite_args_nboyer = function(lst) {3268 var sc_lst_14;3269 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))))))))));3270 };3271 (unify_subst_nboyer = "\u1E9C*");3272 one_way_unify1_nboyer = function(term1, term2) {3273 var lst1;3274 var lst2;3275 var temp_temp;3276 if (!(term2 instanceof sc_Pair))3277 {3278 (temp_temp = (sc_assq(term2, unify_subst_nboyer)));3279 if ((temp_temp!== false))3280 return (is_term_equal_nboyer(term1, (temp_temp.cdr)));3281 else3282 if ((sc_isNumber(term2)))3283 return (sc_isEqual(term1, term2));3284 else3285 {3286 (unify_subst_nboyer = (new sc_Pair((new sc_Pair(term2, term1)), unify_subst_nboyer)));3287 return true;3288 }3289 }3290 else3291 if (!(term1 instanceof sc_Pair))3292 return false;3293 else3294 if (((term1.car)===(term2.car)))3295 {3296 (lst1 = (term1.cdr));3297 (lst2 = (term2.cdr));3298 while (true) {3299 if ((lst1 === null))3300 return (lst2 === null);3301 else3302 if ((lst2 === null))3303 return false;3304 else3305 if (((one_way_unify1_nboyer((lst1.car), (lst2.car)))!== false))3306 {3307 (lst1 = (lst1.cdr));3308 (lst2 = (lst2.cdr));3309 }3310 else3311 return false;3312 }3313 }3314 else3315 return false;3316 };3317 (false_term_nboyer = "\u1E9C*");3318 (true_term_nboyer = "\u1E9C*");3319 trans_of_implies1_nboyer = function(n) {3320 var sc_n_15;3321 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)))))))))));3322 };3323 is_term_equal_nboyer = function(x, y) {3324 var lst1;3325 var lst2;3326 var r2;3327 var r1;3328 if ((x instanceof sc_Pair))3329 if ((y instanceof sc_Pair))3330 if ((((r1 = (x.car)), (r2 = (y.car)), (r1===r2))!== false))3331 {3332 (lst1 = (x.cdr));3333 (lst2 = (y.cdr));3334 while (true) {3335 if ((lst1 === null))3336 return (lst2 === null);3337 else3338 if ((lst2 === null))3339 return false;3340 else3341 if (((is_term_equal_nboyer((lst1.car), (lst2.car)))!== false))3342 {3343 (lst1 = (lst1.cdr));3344 (lst2 = (lst2.cdr));3345 }3346 else3347 return false;3348 }3349 }3350 else3351 return false;3352 else3353 return false;3354 else3355 return (sc_isEqual(x, y));3356 };3357 is_term_member_nboyer = function(x, lst) {3358 var x;3359 var lst;3360 while (true) {3361 if ((lst === null))3362 return false;3363 else3364 if (((is_term_equal_nboyer(x, (lst.car)))!== false))3365 return true;3366 else3367 (lst = (lst.cdr));3368 }3369 };3370 BgL_setupzd2boyerzd2 = function() {3371 var symbol_record;3372 var value;3373 var BgL_sc_symbolzd2record_16zd2;3374 var sym;3375 var sc_sym_17;3376 var term;3377 var lst;3378 var sc_term_18;3379 var sc_term_19;3380 {3381 (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);3382 (if_constructor_nboyer = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer("\u1E9Cif")));3383 (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))))))));3384 (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))))))));3385 (lst = sc_const_3_nboyer);3386 while (!(lst === null)) {3387 {3388 (term = (lst.car));3389 if (((term instanceof sc_Pair)&&(((term.car)==="\u1E9Cequal")&&((term.cdr.car) instanceof sc_Pair))))3390 {3391 (sc_sym_17 = ((term.cdr.car).car));3392 (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)])))));3393 (symbol_record = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sc_sym_17)));3394 (symbol_record[(1)] = value);3395 }3396 else3397 (sc_error("ADD-LEMMA did not like term: ", term));3398 (lst = (lst.cdr));3399 }3400 }3401 return true;3402 }3403 };3404 BgL_testzd2boyerzd2 = function(n) {3405 var optrOpnd;3406 var term;3407 var sc_n_20;3408 var answer;3409 var sc_term_21;3410 var sc_term_22;3411 {3412 (rewrite_count_nboyer = (0));3413 (term = sc_const_4_nboyer);3414 (sc_n_20 = n);3415 while (!(sc_n_20=== 0)) {3416 {3417 (term = (sc_list("\u1E9Cor", term, (new sc_Pair("\u1E9Cf",null)))));3418 (--sc_n_20);3419 }3420 }3421 (sc_term_22 = term);3422 if (!(sc_term_22 instanceof sc_Pair))3423 (optrOpnd = sc_term_22);3424 else3425 (optrOpnd = (new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_22.car))), (translate_args_nboyer((sc_term_22.cdr))))));3426 (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)));3427 (answer = (tautologyp_nboyer((rewrite_nboyer(sc_term_21)), null, null)));3428 (sc_write(rewrite_count_nboyer));3429 (sc_display(" rewrites"));3430 (sc_newline());3431 if ((answer!== false))3432 return rewrite_count_nboyer;3433 else3434 return false;3435 }3436 };3437}3438/* Exported Variables */3439var BgL_parsezd2ze3nbzd2treesze3;3440var BgL_earleyzd2benchmarkzd2;3441var BgL_parsezd2ze3parsedzf3zc2;3442var test;3443var BgL_parsezd2ze3treesz31;3444var BgL_makezd2parserzd2;3445/* End Exports */3446var const_earley;3447{3448 (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)));3449 BgL_makezd2parserzd2 = function(grammar, lexer) {3450 var i;3451 var parser_descr;3452 var def_loop;3453 var nb_nts;3454 var names;3455 var steps;3456 var predictors;3457 var enders;3458 var starters;3459 var nts;3460 var sc_names_1;3461 var sc_steps_2;3462 var sc_predictors_3;3463 var sc_enders_4;3464 var sc_starters_5;3465 var nb_confs;3466 var BgL_sc_defzd2loop_6zd2;3467 var BgL_sc_nbzd2nts_7zd2;3468 var sc_nts_8;3469 var BgL_sc_defzd2loop_9zd2;3470 var ind;3471 {3472 ind = function(nt, sc_nts_10) {3473 var i;3474 {3475 (i = ((sc_nts_10.length)-(1)));3476 while (true) {3477 if ((i>=(0)))3478 if ((sc_isEqual((sc_nts_10[i]), nt)))3479 return i;3480 else3481 (--i);3482 else3483 return false;3484 }3485 }3486 };3487 (sc_nts_8 = ((BgL_sc_defzd2loop_9zd2 = function(defs, sc_nts_11) {3488 var rule_loop;3489 var head;3490 var def;3491 return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, sc_nts_12) {3492 var nt;3493 var l;3494 var sc_nts_13;3495 var rule;3496 if ((rules instanceof sc_Pair))3497 {3498 (rule = (rules.car));3499 (l = rule);3500 (sc_nts_13 = sc_nts_12);3501 while ((l instanceof sc_Pair)) {3502 {3503 (nt = (l.car));3504 (l = (l.cdr));3505 (sc_nts_13 = (((sc_member(nt, sc_nts_13))!== false)?sc_nts_13:(new sc_Pair(nt, sc_nts_13))));3506 }3507 }3508 return (rule_loop((rules.cdr), sc_nts_13));3509 }3510 else3511 return (BgL_sc_defzd2loop_9zd2((defs.cdr), sc_nts_12));3512 }), (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)))));3513 }), (BgL_sc_defzd2loop_9zd2(grammar, null))));3514 (BgL_sc_nbzd2nts_7zd2 = (sc_nts_8.length));3515 (nb_confs = (((BgL_sc_defzd2loop_6zd2 = function(defs, BgL_sc_nbzd2confs_14zd2) {3516 var rule_loop;3517 var def;3518 return ((defs instanceof sc_Pair)?((def = (defs.car)), (rule_loop = function(rules, BgL_sc_nbzd2confs_15zd2) {3519 var l;3520 var BgL_sc_nbzd2confs_16zd2;3521 var rule;3522 if ((rules instanceof sc_Pair))3523 {3524 (rule = (rules.car));3525 (l = rule);3526 (BgL_sc_nbzd2confs_16zd2 = BgL_sc_nbzd2confs_15zd2);3527 while ((l instanceof sc_Pair)) {3528 {3529 (l = (l.cdr));3530 (++BgL_sc_nbzd2confs_16zd2);3531 }3532 }3533 return (rule_loop((rules.cdr), (BgL_sc_nbzd2confs_16zd2+(1))));3534 }3535 else3536 return (BgL_sc_defzd2loop_6zd2((defs.cdr), BgL_sc_nbzd2confs_15zd2));3537 }), (rule_loop((def.cdr), BgL_sc_nbzd2confs_14zd2))):BgL_sc_nbzd2confs_14zd2);3538 }), (BgL_sc_defzd2loop_6zd2(grammar, (0))))+BgL_sc_nbzd2nts_7zd2));3539 (sc_starters_5 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));3540 (sc_enders_4 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));3541 (sc_predictors_3 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));3542 (sc_steps_2 = (sc_makeVector(nb_confs, false)));3543 (sc_names_1 = (sc_makeVector(nb_confs, false)));3544 (nts = sc_nts_8);3545 (starters = sc_starters_5);3546 (enders = sc_enders_4);3547 (predictors = sc_predictors_3);3548 (steps = sc_steps_2);3549 (names = sc_names_1);3550 (nb_nts = (sc_nts_8.length));3551 (i = (nb_nts-(1)));3552 while ((i>=(0))) {3553 {3554 (sc_steps_2[i] = (i-nb_nts));3555 (sc_names_1[i] = (sc_list((sc_nts_8[i]), (0))));3556 (sc_enders_4[i] = (sc_list(i)));3557 (--i);3558 }3559 }3560 def_loop = function(defs, conf) {3561 var rule_loop;3562 var head;3563 var def;3564 return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, conf, rule_num) {3565 var i;3566 var sc_i_17;3567 var nt;3568 var l;3569 var sc_conf_18;3570 var sc_i_19;3571 var rule;3572 if ((rules instanceof sc_Pair))3573 {3574 (rule = (rules.car));3575 (names[conf] = (sc_list(head, rule_num)));3576 (sc_i_19 = (ind(head, nts)));3577 (starters[sc_i_19] = (new sc_Pair(conf, (starters[sc_i_19]))));3578 (l = rule);3579 (sc_conf_18 = conf);3580 while ((l instanceof sc_Pair)) {3581 {3582 (nt = (l.car));3583 (steps[sc_conf_18] = (ind(nt, nts)));3584 (sc_i_17 = (ind(nt, nts)));3585 (predictors[sc_i_17] = (new sc_Pair(sc_conf_18, (predictors[sc_i_17]))));3586 (l = (l.cdr));3587 (++sc_conf_18);3588 }3589 }3590 (steps[sc_conf_18] = ((ind(head, nts))-nb_nts));3591 (i = (ind(head, nts)));3592 (enders[i] = (new sc_Pair(sc_conf_18, (enders[i]))));3593 return (rule_loop((rules.cdr), (sc_conf_18+(1)), (rule_num+(1))));3594 }3595 else3596 return (def_loop((defs.cdr), conf));3597 }), (rule_loop((def.cdr), conf, (1)))):undefined);3598 };3599 (def_loop(grammar, (sc_nts_8.length)));3600 (parser_descr = [lexer, sc_nts_8, sc_starters_5, sc_enders_4, sc_predictors_3, sc_steps_2, sc_names_1]);3601 return function(input) {3602 var optrOpnd;3603 var sc_optrOpnd_20;3604 var sc_optrOpnd_21;3605 var sc_optrOpnd_22;3606 var loop1;3607 var BgL_sc_stateza2_23za2;3608 var toks;3609 var BgL_sc_nbzd2nts_24zd2;3610 var sc_steps_25;3611 var sc_enders_26;3612 var state_num;3613 var BgL_sc_statesza2_27za2;3614 var states;3615 var i;3616 var conf;3617 var l;3618 var tok_nts;3619 var sc_i_28;3620 var sc_i_29;3621 var l1;3622 var l2;3623 var tok;3624 var tail1129;3625 var L1125;3626 var goal_enders;3627 var BgL_sc_statesza2_30za2;3628 var BgL_sc_nbzd2nts_31zd2;3629 var BgL_sc_nbzd2confs_32zd2;3630 var nb_toks;3631 var goal_starters;3632 var sc_states_33;3633 var BgL_sc_nbzd2confs_34zd2;3634 var BgL_sc_nbzd2toks_35zd2;3635 var sc_toks_36;3636 var falseHead1128;3637 var sc_names_37;3638 var sc_steps_38;3639 var sc_predictors_39;3640 var sc_enders_40;3641 var sc_starters_41;3642 var sc_nts_42;3643 var lexer;3644 var sc_ind_43;3645 var make_states;3646 var BgL_sc_confzd2setzd2getza2_44za2;3647 var conf_set_merge_new_bang;3648 var conf_set_adjoin;3649 var BgL_sc_confzd2setzd2adjoinza2_45za2;3650 var BgL_sc_confzd2setzd2adjoinza2za2_46z00;3651 var conf_set_union;3652 var forw;3653 var is_parsed;3654 var deriv_trees;3655 var BgL_sc_derivzd2treesza2_47z70;3656 var nb_deriv_trees;3657 var BgL_sc_nbzd2derivzd2treesza2_48za2;3658 {3659 sc_ind_43 = function(nt, sc_nts_49) {3660 var i;3661 {3662 (i = ((sc_nts_49.length)-(1)));3663 while (true) {3664 if ((i>=(0)))3665 if ((sc_isEqual((sc_nts_49[i]), nt)))3666 return i;3667 else3668 (--i);3669 else3670 return false;3671 }3672 }3673 };3674 make_states = function(BgL_sc_nbzd2toks_50zd2, BgL_sc_nbzd2confs_51zd2) {3675 var v;3676 var i;3677 var sc_states_52;3678 {3679 (sc_states_52 = (sc_makeVector((BgL_sc_nbzd2toks_50zd2+(1)), false)));3680 (i = BgL_sc_nbzd2toks_50zd2);3681 while ((i>=(0))) {3682 {3683 (v = (sc_makeVector((BgL_sc_nbzd2confs_51zd2+(1)), false)));3684 (v[(0)] = (-1));3685 (sc_states_52[i] = v);3686 (--i);3687 }3688 }3689 return sc_states_52;3690 }3691 };3692 BgL_sc_confzd2setzd2getza2_44za2 = function(state, BgL_sc_statezd2num_53zd2, sc_conf_54) {3693 var conf_set;3694 var BgL_sc_confzd2set_55zd2;3695 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)));3696 };3697 conf_set_merge_new_bang = function(conf_set) {3698 return ((conf_set[((conf_set[(1)])+(5))] = (conf_set[(4)])), (conf_set[(1)] = (conf_set[(3)])), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1)));3699 };3700 conf_set_adjoin = function(state, conf_set, sc_conf_56, i) {3701 var tail;3702 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));3703 };3704 BgL_sc_confzd2setzd2adjoinza2_45za2 = function(sc_states_57, BgL_sc_statezd2num_58zd2, l, i) {3705 var conf_set;3706 var sc_conf_59;3707 var l1;3708 var state;3709 {3710 (state = (sc_states_57[BgL_sc_statezd2num_58zd2]));3711 (l1 = l);3712 while ((l1 instanceof sc_Pair)) {3713 {3714 (sc_conf_59 = (l1.car));3715 (conf_set = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_58zd2, sc_conf_59)));3716 if (((conf_set[(i+(5))])=== false))3717 {3718 (conf_set_adjoin(state, conf_set, sc_conf_59, i));3719 (l1 = (l1.cdr));3720 }3721 else3722 (l1 = (l1.cdr));3723 }3724 }3725 return undefined;3726 }3727 };3728 BgL_sc_confzd2setzd2adjoinza2za2_46z00 = function(sc_states_60, BgL_sc_statesza2_61za2, BgL_sc_statezd2num_62zd2, sc_conf_63, i) {3729 var BgL_sc_confzd2setza2_64z70;3730 var BgL_sc_stateza2_65za2;3731 var conf_set;3732 var state;3733 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));3734 };3735 conf_set_union = function(state, conf_set, sc_conf_66, other_set) {3736 var i;3737 {3738 (i = (other_set[(2)]));3739 while ((i>=(0))) {3740 if (((conf_set[(i+(5))])=== false))3741 {3742 (conf_set_adjoin(state, conf_set, sc_conf_66, i));3743 (i = (other_set[(i+(5))]));3744 }3745 else3746 (i = (other_set[(i+(5))]));3747 }3748 return undefined;3749 }3750 };3751 forw = function(sc_states_67, BgL_sc_statezd2num_68zd2, sc_starters_69, sc_enders_70, sc_predictors_71, sc_steps_72, sc_nts_73) {3752 var next_set;3753 var next;3754 var conf_set;3755 var ender;3756 var l;3757 var starter_set;3758 var starter;3759 var sc_l_74;3760 var sc_loop1_75;3761 var head;3762 var BgL_sc_confzd2set_76zd2;3763 var BgL_sc_statezd2num_77zd2;3764 var state;3765 var sc_states_78;3766 var preds;3767 var BgL_sc_confzd2set_79zd2;3768 var step;3769 var sc_conf_80;3770 var BgL_sc_nbzd2nts_81zd2;3771 var sc_state_82;3772 {3773 (sc_state_82 = (sc_states_67[BgL_sc_statezd2num_68zd2]));3774 (BgL_sc_nbzd2nts_81zd2 = (sc_nts_73.length));3775 while (true) {3776 {3777 (sc_conf_80 = (sc_state_82[(0)]));3778 if ((sc_conf_80>=(0)))3779 {3780 (step = (sc_steps_72[sc_conf_80]));3781 (BgL_sc_confzd2set_79zd2 = (sc_state_82[(sc_conf_80+(1))]));3782 (head = (BgL_sc_confzd2set_79zd2[(4)]));3783 (sc_state_82[(0)] = (BgL_sc_confzd2set_79zd2[(0)]));3784 (conf_set_merge_new_bang(BgL_sc_confzd2set_79zd2));3785 if ((step>=(0)))3786 {3787 (sc_l_74 = (sc_starters_69[step]));3788 while ((sc_l_74 instanceof sc_Pair)) {3789 {3790 (starter = (sc_l_74.car));3791 (starter_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, starter)));3792 if (((starter_set[(BgL_sc_statezd2num_68zd2+(5))])=== false))3793 {3794 (conf_set_adjoin(sc_state_82, starter_set, starter, BgL_sc_statezd2num_68zd2));3795 (sc_l_74 = (sc_l_74.cdr));3796 }3797 else3798 (sc_l_74 = (sc_l_74.cdr));3799 }3800 }3801 (l = (sc_enders_70[step]));3802 while ((l instanceof sc_Pair)) {3803 {3804 (ender = (l.car));3805 if ((((conf_set = (sc_state_82[(ender+(1))])), ((conf_set!== false)?(conf_set[(BgL_sc_statezd2num_68zd2+(5))]):false))!== false))3806 {3807 (next = (sc_conf_80+(1)));3808 (next_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, next)));3809 (conf_set_union(sc_state_82, next_set, next, BgL_sc_confzd2set_79zd2));3810 (l = (l.cdr));3811 }3812 else3813 (l = (l.cdr));3814 }3815 }3816 }3817 else3818 {3819 (preds = (sc_predictors_71[(step+BgL_sc_nbzd2nts_81zd2)]));3820 (sc_states_78 = sc_states_67);3821 (state = sc_state_82);3822 (BgL_sc_statezd2num_77zd2 = BgL_sc_statezd2num_68zd2);3823 (BgL_sc_confzd2set_76zd2 = BgL_sc_confzd2set_79zd2);3824 sc_loop1_75 = function(l) {3825 var sc_state_83;3826 var BgL_sc_nextzd2set_84zd2;3827 var sc_next_85;3828 var pred_set;3829 var i;3830 var pred;3831 if ((l instanceof sc_Pair))3832 {3833 (pred = (l.car));3834 (i = head);3835 while ((i>=(0))) {3836 {3837 (pred_set = ((sc_state_83 = (sc_states_78[i])), (sc_state_83[(pred+(1))])));3838 if ((pred_set!== false))3839 {3840 (sc_next_85 = (pred+(1)));3841 (BgL_sc_nextzd2set_84zd2 = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_77zd2, sc_next_85)));3842 (conf_set_union(state, BgL_sc_nextzd2set_84zd2, sc_next_85, pred_set));3843 }3844 (i = (BgL_sc_confzd2set_76zd2[(i+(5))]));3845 }3846 }3847 return (sc_loop1_75((l.cdr)));3848 }3849 else3850 return undefined;3851 };3852 (sc_loop1_75(preds));3853 }3854 }3855 else3856 return undefined;3857 }3858 }3859 }3860 };3861 is_parsed = function(nt, i, j, sc_nts_86, sc_enders_87, sc_states_88) {3862 var conf_set;3863 var state;3864 var sc_conf_89;3865 var l;3866 var BgL_sc_ntza2_90za2;3867 {3868 (BgL_sc_ntza2_90za2 = (sc_ind_43(nt, sc_nts_86)));3869 if ((BgL_sc_ntza2_90za2!== false))3870 {3871 (sc_nts_86.length);3872 (l = (sc_enders_87[BgL_sc_ntza2_90za2]));3873 while (true) {3874 if ((l instanceof sc_Pair))3875 {3876 (sc_conf_89 = (l.car));3877 if ((((state = (sc_states_88[j])), (conf_set = (state[(sc_conf_89+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))3878 return true;3879 else3880 (l = (l.cdr));3881 }3882 else3883 return false;3884 }3885 }3886 else3887 return false;3888 }3889 };3890 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) {3891 var sc_loop1_98;3892 var prev;3893 var name;3894 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) {3895 var loop2;3896 var ender_set;3897 var state;3898 var ender;3899 var l1;3900 var l2;3901 while (true) {3902 if ((l1 instanceof sc_Pair))3903 {3904 (ender = (l1.car));3905 (ender_set = ((state = (sc_states_96[j])), (state[(ender+(1))])));3906 if ((ender_set!== false))3907 {3908 loop2 = function(k, l2) {3909 var loop3;3910 var ender_trees;3911 var prev_trees;3912 var conf_set;3913 var sc_state_99;3914 var k;3915 var l2;3916 while (true) {3917 if ((k>=(0)))3918 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)))3919 {3920 (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)));3921 (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)));3922 loop3 = function(l3, l2) {3923 var l4;3924 var sc_l2_100;3925 var ender_tree;3926 if ((l3 instanceof sc_Pair))3927 {3928 (ender_tree = (sc_list((l3.car))));3929 (l4 = prev_trees);3930 (sc_l2_100 = l2);3931 while ((l4 instanceof sc_Pair)) {3932 {3933 (sc_l2_100 = (new sc_Pair((sc_append((l4.car), ender_tree)), sc_l2_100)));3934 (l4 = (l4.cdr));3935 }3936 }3937 return (loop3((l3.cdr), sc_l2_100));3938 }3939 else3940 return (loop2((ender_set[(k+(5))]), l2));3941 };3942 return (loop3(ender_trees, l2));3943 }3944 else3945 (k = (ender_set[(k+(5))]));3946 else3947 return (sc_loop1_98((l1.cdr), l2));3948 }3949 };3950 return (loop2((ender_set[(2)]), l2));3951 }3952 else3953 (l1 = (l1.cdr));3954 }3955 else3956 return l2;3957 }3958 }), (sc_loop1_98((sc_enders_92[(sc_steps_93[prev])]), null)))));3959 };3960 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) {3961 var conf_set;3962 var state;3963 var sc_conf_107;3964 var l;3965 var trees;3966 var BgL_sc_nbzd2nts_108zd2;3967 var BgL_sc_ntza2_109za2;3968 {3969 (BgL_sc_ntza2_109za2 = (sc_ind_43(nt, sc_nts_101)));3970 if ((BgL_sc_ntza2_109za2!== false))3971 {3972 (BgL_sc_nbzd2nts_108zd2 = (sc_nts_101.length));3973 (l = (sc_enders_102[BgL_sc_ntza2_109za2]));3974 (trees = null);3975 while ((l instanceof sc_Pair)) {3976 {3977 (sc_conf_107 = (l.car));3978 if ((((state = (sc_states_106[j])), (conf_set = (state[(sc_conf_107+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))3979 {3980 (l = (l.cdr));3981 (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)));3982 }3983 else3984 (l = (l.cdr));3985 }3986 }3987 return trees;3988 }3989 else3990 return false;3991 }3992 };3993 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) {3994 var sc_loop1_116;3995 var tmp1124;3996 var prev;3997 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) {3998 var nb_ender_trees;3999 var nb_prev_trees;4000 var conf_set;4001 var state;4002 var k;4003 var n;4004 var ender_set;4005 var sc_state_117;4006 var ender;4007 var l;4008 var sc_n_118;4009 while (true) {4010 if ((l instanceof sc_Pair))4011 {4012 (ender = (l.car));4013 (ender_set = ((sc_state_117 = (sc_states_114[j])), (sc_state_117[(ender+(1))])));4014 if ((ender_set!== false))4015 {4016 (k = (ender_set[(2)]));4017 (n = sc_n_118);4018 while ((k>=(0))) {4019 if (((k>=i)&&(((state = (sc_states_114[k])), (conf_set = (state[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)))4020 {4021 (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)));4022 (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)));4023 (k = (ender_set[(k+(5))]));4024 (n +=(nb_prev_trees*nb_ender_trees));4025 }4026 else4027 (k = (ender_set[(k+(5))]));4028 }4029 return (sc_loop1_116((l.cdr), n));4030 }4031 else4032 (l = (l.cdr));4033 }4034 else4035 return sc_n_118;4036 }4037 }), (sc_loop1_116((sc_enders_111[(sc_steps_112[prev])]), (0))))));4038 };4039 BgL_sc_nbzd2derivzd2treesza2_48za2 = function(nt, i, j, sc_nts_119, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123) {4040 var conf_set;4041 var state;4042 var sc_conf_124;4043 var l;4044 var nb_trees;4045 var BgL_sc_nbzd2nts_125zd2;4046 var BgL_sc_ntza2_126za2;4047 {4048 (BgL_sc_ntza2_126za2 = (sc_ind_43(nt, sc_nts_119)));4049 if ((BgL_sc_ntza2_126za2!== false))4050 {4051 (BgL_sc_nbzd2nts_125zd2 = (sc_nts_119.length));4052 (l = (sc_enders_120[BgL_sc_ntza2_126za2]));4053 (nb_trees = (0));4054 while ((l instanceof sc_Pair)) {4055 {4056 (sc_conf_124 = (l.car));4057 if ((((state = (sc_states_123[j])), (conf_set = (state[(sc_conf_124+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))4058 {4059 (l = (l.cdr));4060 (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));4061 }4062 else4063 (l = (l.cdr));4064 }4065 }4066 return nb_trees;4067 }4068 else4069 return false;4070 }4071 };4072 (lexer = (parser_descr[(0)]));4073 (sc_nts_42 = (parser_descr[(1)]));4074 (sc_starters_41 = (parser_descr[(2)]));4075 (sc_enders_40 = (parser_descr[(3)]));4076 (sc_predictors_39 = (parser_descr[(4)]));4077 (sc_steps_38 = (parser_descr[(5)]));4078 (sc_names_37 = (parser_descr[(6)]));4079 (falseHead1128 = (new sc_Pair(null, null)));4080 (L1125 = (lexer(input)));4081 (tail1129 = falseHead1128);4082 while (!(L1125 === null)) {4083 {4084 (tok = (L1125.car));4085 (l1 = (tok.cdr));4086 (l2 = null);4087 while ((l1 instanceof sc_Pair)) {4088 {4089 (sc_i_29 = (sc_ind_43((l1.car), sc_nts_42)));4090 if ((sc_i_29!== false))4091 {4092 (l1 = (l1.cdr));4093 (l2 = (new sc_Pair(sc_i_29, l2)));4094 }4095 else4096 (l1 = (l1.cdr));4097 }4098 }4099 (sc_optrOpnd_22 = (new sc_Pair((tok.car), (sc_reverse(l2)))));4100 (sc_optrOpnd_21 = (new sc_Pair(sc_optrOpnd_22, null)));4101 (tail1129.cdr = sc_optrOpnd_21);4102 (tail1129 = (tail1129.cdr));4103 (L1125 = (L1125.cdr));4104 }4105 }4106 (sc_optrOpnd_20 = (falseHead1128.cdr));4107 (sc_toks_36 = (sc_list2vector(sc_optrOpnd_20)));4108 (BgL_sc_nbzd2toks_35zd2 = (sc_toks_36.length));4109 (BgL_sc_nbzd2confs_34zd2 = (sc_steps_38.length));4110 (sc_states_33 = (make_states(BgL_sc_nbzd2toks_35zd2, BgL_sc_nbzd2confs_34zd2)));4111 (goal_starters = (sc_starters_41[(0)]));4112 (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (0), goal_starters, (0)));4113 (forw(sc_states_33, (0), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42));4114 (sc_i_28 = (0));4115 while ((sc_i_28<BgL_sc_nbzd2toks_35zd2)) {4116 {4117 (tok_nts = ((sc_toks_36[sc_i_28]).cdr));4118 (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (sc_i_28+(1)), tok_nts, sc_i_28));4119 (forw(sc_states_33, (sc_i_28+(1)), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42));4120 (++sc_i_28);4121 }4122 }4123 (nb_toks = (sc_toks_36.length));4124 (BgL_sc_nbzd2confs_32zd2 = (sc_steps_38.length));4125 (BgL_sc_nbzd2nts_31zd2 = (sc_nts_42.length));4126 (BgL_sc_statesza2_30za2 = (make_states(nb_toks, BgL_sc_nbzd2confs_32zd2)));4127 (goal_enders = (sc_enders_40[(0)]));4128 (l = goal_enders);4129 while ((l instanceof sc_Pair)) {4130 {4131 (conf = (l.car));4132 (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_33, BgL_sc_statesza2_30za2, nb_toks, conf, (0)));4133 (l = (l.cdr));4134 }4135 }4136 (i = nb_toks);4137 while ((i>=(0))) {4138 {4139 (states = sc_states_33);4140 (BgL_sc_statesza2_27za2 = BgL_sc_statesza2_30za2);4141 (state_num = i);4142 (sc_enders_26 = sc_enders_40);4143 (sc_steps_25 = sc_steps_38);4144 (BgL_sc_nbzd2nts_24zd2 = BgL_sc_nbzd2nts_31zd2);4145 (toks = sc_toks_36);4146 (BgL_sc_stateza2_23za2 = (BgL_sc_statesza2_30za2[i]));4147 loop1 = function() {4148 var sc_loop1_127;4149 var prev;4150 var BgL_sc_statesza2_128za2;4151 var sc_states_129;4152 var j;4153 var i;4154 var sc_i_130;4155 var head;4156 var conf_set;4157 var sc_conf_131;4158 {4159 (sc_conf_131 = (BgL_sc_stateza2_23za2[(0)]));4160 if ((sc_conf_131>=(0)))4161 {4162 (conf_set = (BgL_sc_stateza2_23za2[(sc_conf_131+(1))]));4163 (head = (conf_set[(4)]));4164 (BgL_sc_stateza2_23za2[(0)] = (conf_set[(0)]));4165 (conf_set_merge_new_bang(conf_set));4166 (sc_i_130 = head);4167 while ((sc_i_130>=(0))) {4168 {4169 (i = sc_i_130);4170 (j = state_num);4171 (sc_states_129 = states);4172 (BgL_sc_statesza2_128za2 = BgL_sc_statesza2_27za2);4173 (prev = (sc_conf_131-(1)));4174 if (((sc_conf_131>=BgL_sc_nbzd2nts_24zd2)&&((sc_steps_25[prev])>=(0))))4175 {4176 sc_loop1_127 = function(l) {4177 var k;4178 var ender_set;4179 var state;4180 var ender;4181 var l;4182 while (true) {4183 if ((l instanceof sc_Pair))4184 {4185 (ender = (l.car));4186 (ender_set = ((state = (sc_states_129[j])), (state[(ender+(1))])));4187 if ((ender_set!== false))4188 {4189 (k = (ender_set[(2)]));4190 while ((k>=(0))) {4191 {4192 if ((k>=i))4193 if (((BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, k, prev, i))!== false))4194 (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, j, ender, k));4195 (k = (ender_set[(k+(5))]));4196 }4197 }4198 return (sc_loop1_127((l.cdr)));4199 }4200 else4201 (l = (l.cdr));4202 }4203 else4204 return undefined;4205 }4206 };4207 (sc_loop1_127((sc_enders_26[(sc_steps_25[prev])])));4208 }4209 (sc_i_130 = (conf_set[(sc_i_130+(5))]));4210 }4211 }4212 return (loop1());4213 }4214 else4215 return undefined;4216 }4217 };4218 (loop1());4219 (--i);4220 }4221 }4222 (optrOpnd = BgL_sc_statesza2_30za2);4223 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];4224 }4225 };4226 }4227 };4228 BgL_parsezd2ze3parsedzf3zc2 = function(parse, nt, i, j) {4229 var is_parsed;4230 var states;4231 var enders;4232 var nts;4233 return ((nts = (parse[(0)])), (enders = (parse[(2)])), (states = (parse[(7)])), (is_parsed = (parse[(8)])), (is_parsed(nt, i, j, nts, enders, states)));4234 };4235 BgL_parsezd2ze3treesz31 = function(parse, nt, i, j) {4236 var BgL_sc_derivzd2treesza2_132z70;4237 var states;4238 var toks;4239 var names;4240 var steps;4241 var enders;4242 var nts;4243 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)));4244 };4245 BgL_parsezd2ze3nbzd2treesze3 = function(parse, nt, i, j) {4246 var BgL_sc_nbzd2derivzd2treesza2_133za2;4247 var states;4248 var toks;4249 var steps;4250 var enders;4251 var nts;4252 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)));4253 };4254 test = function(k) {4255 var x;4256 var p;4257 return ((p = (BgL_makezd2parserzd2(const_earley, function(l) {4258 var sc_x_134;4259 var tail1134;4260 var L1130;4261 var falseHead1133;4262 {4263 (falseHead1133 = (new sc_Pair(null, null)));4264 (tail1134 = falseHead1133);4265 (L1130 = l);4266 while (!(L1130 === null)) {4267 {4268 (tail1134.cdr = (new sc_Pair(((sc_x_134 = (L1130.car)), (sc_list(sc_x_134, sc_x_134))), null)));4269 (tail1134 = (tail1134.cdr));4270 (L1130 = (L1130.cdr));4271 }4272 }4273 return (falseHead1133.cdr);4274 }4275 }))), (x = (p((sc_vector2list((sc_makeVector(k, "\u1E9Ca"))))))), (sc_length((BgL_parsezd2ze3treesz31(x, "\u1E9Cs", (0), k)))));4276 };4277 BgL_earleyzd2benchmarkzd2 = function() {4278 var args = null;4279 for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {4280 args = sc_cons(arguments[sc_tmp], args);4281 }4282 var k;4283 return ((k = ((args === null)?(7):(args.car))), (BgL_runzd2benchmarkzd2("earley", (1), function() {4284 return (test(k));4285 }, function(result) {4286 return ((sc_display(result)), (sc_newline()), result == 132);4287 })));4288 };4289}4290/************* END OF GENERATED CODE *************/4291// Invoke this function to run a benchmark.4292// The first argument is a string identifying the benchmark.4293// The second argument is the number of times to run the benchmark.4294// The third argument is a function that runs the benchmark.4295// The fourth argument is a unary function that warns if the result4296// returned by the benchmark is incorrect.4297//4298// Example:4299// RunBenchmark("new Array()",4300// 1,4301// function () { new Array(1000000); }4302// function (v) {4303// return (v instanceof Array) && (v.length == 1000000);4304// });4305SC_DEFAULT_OUT = new sc_GenericOutputPort(function(s) {});4306SC_ERROR_OUT = SC_DEFAULT_OUT;4307function RunBenchmark(name, count, run, warn) {4308 for (var n = 0; n < count; ++n) {4309 result = run();4310 if (!warn(result)) {4311 throw new Error("Earley or Boyer did incorrect number of rewrites");4312 }4313 }4314}...
v8-earley-boyer.js
Source:v8-earley-boyer.js
1// This file is automatically generated by scheme2js, except for the2// benchmark harness code at the beginning and end of the file.3/************* GENERATED FILE - DO NOT EDIT *************/4/************* GENERATED FILE - DO NOT EDIT *************/5/************* GENERATED FILE - DO NOT EDIT *************/6/************* GENERATED FILE - DO NOT EDIT *************/7/************* GENERATED FILE - DO NOT EDIT *************/8/************* GENERATED FILE - DO NOT EDIT *************/9/************* GENERATED FILE - DO NOT EDIT *************/10/************* GENERATED FILE - DO NOT EDIT *************/11/*12 * To use write/prints/... the default-output port has to be set first.13 * Simply setting SC_DEFAULT_OUT and SC_ERROR_OUT to the desired values14 * should do the trick.15 * In the following example the std-out and error-port are redirected to16 * a DIV.17function initRuntime() {18 function escapeHTML(s) {19 var tmp = s;20 tmp = tmp.replace(/&/g, "&");21 tmp = tmp.replace(/</g, "<");22 tmp = tmp.replace(/>/g, ">");23 tmp = tmp.replace(/ /g, " ");24 tmp = tmp.replace(/\n/g, "<br />");25 tmp = tmp.replace(/\t/g, "  ");26 return tmp;27 28 }29 document.write("<div id='stdout'></div>");30 SC_DEFAULT_OUT = new sc_GenericOutputPort(31 function(s) {32 var stdout = document.getElementById('stdout');33 stdout.innerHTML = stdout.innerHTML + escapeHTML(s);34 });35 SC_ERROR_OUT = SC_DEFAULT_OUT;36}37*/38function sc_print_debug() {39 sc_print.apply(null, arguments);40}41/*** META ((export *js*)) */42var sc_JS_GLOBALS = this;43var __sc_LINE=-1;44var __sc_FILE="";45/*** META ((export #t)) */46function sc_alert() {47 var len = arguments.length;48 var s = "";49 var i;50 for( i = 0; i < len; i++ ) {51 s += sc_toDisplayString(arguments[ i ]);52 }53 return alert( s );54}55/*** META ((export #t)) */56function sc_typeof( x ) {57 return typeof x;58}59/*** META ((export #t)) */60function sc_error() {61 var a = [sc_jsstring2symbol("*error*")];62 for (var i = 0; i < arguments.length; i++) {63 a[i+1] = arguments[i];64 }65 throw a;66}67/*** META ((export #t)68 (peephole (prefix "throw ")))69*/70function sc_raise(obj) {71 throw obj;72}73/*** META ((export with-handler-lambda)) */74function sc_withHandlerLambda(handler, body) {75 try {76 return body();77 } catch(e) {78 if (!e._internalException)79 return handler(e);80 else81 throw e;82 }83}84var sc_properties = new Object();85/*** META ((export #t)) */86function sc_putpropBang(sym, key, val) {87 var ht = sc_properties[sym];88 if (!ht) {89 ht = new Object();90 sc_properties[sym] = ht;91 }92 ht[key] = val;93}94/*** META ((export #t)) */95function sc_getprop(sym, key) {96 var ht = sc_properties[sym];97 if (ht) {98 if (key in ht)99 return ht[key];100 else101 return false;102 } else103 return false;104}105/*** META ((export #t)) */106function sc_rempropBang(sym, key) {107 var ht = sc_properties[sym];108 if (ht)109 delete ht[key];110}111/*** META ((export #t)) */112function sc_any2String(o) {113 return jsstring2string(sc_toDisplayString(o));114} 115/*** META ((export #t)116 (peephole (infix 2 2 "==="))117 (type bool))118*/119function sc_isEqv(o1, o2) {120 return (o1 === o2);121}122/*** META ((export #t)123 (peephole (infix 2 2 "==="))124 (type bool))125*/126function sc_isEq(o1, o2) {127 return (o1 === o2);128}129/*** META ((export #t)130 (type bool))131*/132function sc_isNumber(n) {133 return (typeof n === "number");134}135/*** META ((export #t)136 (type bool))137*/138function sc_isComplex(n) {139 return sc_isNumber(n);140}141/*** META ((export #t)142 (type bool))143*/144function sc_isReal(n) {145 return sc_isNumber(n);146}147/*** META ((export #t)148 (type bool))149*/150function sc_isRational(n) {151 return sc_isReal(n);152}153/*** META ((export #t)154 (type bool))155*/156function sc_isInteger(n) {157 return (parseInt(n) === n);158}159/*** META ((export #t)160 (type bool)161 (peephole (postfix ", false")))162*/163// we don't have exact numbers...164function sc_isExact(n) {165 return false;166}167/*** META ((export #t)168 (peephole (postfix ", true"))169 (type bool))170*/171function sc_isInexact(n) {172 return true;173}174/*** META ((export = =fx =fl)175 (type bool)176 (peephole (infix 2 2 "===")))177*/178function sc_equal(x) {179 for (var i = 1; i < arguments.length; i++)180 if (x !== arguments[i])181 return false;182 return true;183}184/*** META ((export < <fx <fl)185 (type bool)186 (peephole (infix 2 2 "<")))187*/188function sc_less(x) {189 for (var i = 1; i < arguments.length; i++) {190 if (x >= arguments[i])191 return false;192 x = arguments[i];193 }194 return true;195}196/*** META ((export > >fx >fl)197 (type bool)198 (peephole (infix 2 2 ">")))199*/200function sc_greater(x, y) {201 for (var i = 1; i < arguments.length; i++) {202 if (x <= arguments[i])203 return false;204 x = arguments[i];205 }206 return true;207}208/*** META ((export <= <=fx <=fl)209 (type bool)210 (peephole (infix 2 2 "<=")))211*/212function sc_lessEqual(x, y) {213 for (var i = 1; i < arguments.length; i++) {214 if (x > arguments[i])215 return false;216 x = arguments[i];217 }218 return true;219}220/*** META ((export >= >=fl >=fx)221 (type bool)222 (peephole (infix 2 2 ">=")))223*/224function sc_greaterEqual(x, y) {225 for (var i = 1; i < arguments.length; i++) {226 if (x < arguments[i])227 return false;228 x = arguments[i];229 }230 return true;231}232/*** META ((export #t)233 (type bool)234 (peephole (postfix "=== 0")))235*/236function sc_isZero(x) {237 return (x === 0);238}239/*** META ((export #t)240 (type bool)241 (peephole (postfix "> 0")))242*/243function sc_isPositive(x) {244 return (x > 0);245}246/*** META ((export #t)247 (type bool)248 (peephole (postfix "< 0")))249*/250function sc_isNegative(x) {251 return (x < 0);252}253/*** META ((export #t)254 (type bool)255 (peephole (postfix "%2===1")))256*/257function sc_isOdd(x) {258 return (x % 2 === 1);259}260/*** META ((export #t)261 (type bool)262 (peephole (postfix "%2===0")))263*/264function sc_isEven(x) {265 return (x % 2 === 0);266}267/*** META ((export #t)) */268var sc_max = Math.max;269/*** META ((export #t)) */270var sc_min = Math.min;271/*** META ((export + +fx +fl)272 (peephole (infix 0 #f "+" "0")))273*/274function sc_plus() {275 var sum = 0;276 for (var i = 0; i < arguments.length; i++)277 sum += arguments[i];278 return sum;279}280/*** META ((export * *fx *fl)281 (peephole (infix 0 #f "*" "1")))282*/283function sc_multi() {284 var product = 1;285 for (var i = 0; i < arguments.length; i++)286 product *= arguments[i];287 return product;288}289/*** META ((export - -fx -fl)290 (peephole (minus)))291*/292function sc_minus(x) {293 if (arguments.length === 1)294 return -x;295 else {296 var res = x;297 for (var i = 1; i < arguments.length; i++)298 res -= arguments[i];299 return res;300 }301}302/*** META ((export / /fl)303 (peephole (div)))304*/305function sc_div(x) {306 if (arguments.length === 1)307 return 1/x;308 else {309 var res = x;310 for (var i = 1; i < arguments.length; i++)311 res /= arguments[i];312 return res;313 }314}315/*** META ((export #t)) */316var sc_abs = Math.abs;317/*** META ((export quotient /fx)318 (peephole (hole 2 "parseInt(" x "/" y ")")))319*/320function sc_quotient(x, y) {321 return parseInt(x / y);322}323/*** META ((export #t)324 (peephole (infix 2 2 "%")))325*/326function sc_remainder(x, y) {327 return x % y;328}329/*** META ((export #t)330 (peephole (modulo)))331*/332function sc_modulo(x, y) {333 var remainder = x % y;334 // if they don't have the same sign335 if ((remainder * y) < 0)336 return remainder + y;337 else338 return remainder;339}340function sc_euclid_gcd(a, b) {341 var temp;342 if (a === 0) return b;343 if (b === 0) return a;344 if (a < 0) {a = -a;};345 if (b < 0) {b = -b;};346 if (b > a) {temp = a; a = b; b = temp;};347 while (true) {348 a %= b;349 if(a === 0) {return b;};350 b %= a;351 if(b === 0) {return a;};352 };353 return b;354}355/*** META ((export #t)) */356function sc_gcd() {357 var gcd = 0;358 for (var i = 0; i < arguments.length; i++)359 gcd = sc_euclid_gcd(gcd, arguments[i]);360 return gcd;361}362/*** META ((export #t)) */363function sc_lcm() {364 var lcm = 1;365 for (var i = 0; i < arguments.length; i++) {366 var f = Math.round(arguments[i] / sc_euclid_gcd(arguments[i], lcm));367 lcm *= Math.abs(f);368 }369 return lcm;370}371// LIMITATION: numerator and denominator don't make sense in floating point world.372//var SC_MAX_DECIMALS = 1000000373//374// function sc_numerator(x) {375// var rounded = Math.round(x * SC_MAX_DECIMALS);376// return Math.round(rounded / sc_euclid_gcd(rounded, SC_MAX_DECIMALS));377// }378// function sc_denominator(x) {379// var rounded = Math.round(x * SC_MAX_DECIMALS);380// return Math.round(SC_MAX_DECIMALS / sc_euclid_gcd(rounded, SC_MAX_DECIMALS));381// }382/*** META ((export #t)) */383var sc_floor = Math.floor;384/*** META ((export #t)) */385var sc_ceiling = Math.ceil;386/*** META ((export #t)) */387var sc_truncate = parseInt;388/*** META ((export #t)) */389var sc_round = Math.round;390// LIMITATION: sc_rationalize doesn't make sense in a floating point world.391/*** META ((export #t)) */392var sc_exp = Math.exp;393/*** META ((export #t)) */394var sc_log = Math.log;395/*** META ((export #t)) */396var sc_sin = Math.sin;397/*** META ((export #t)) */398var sc_cos = Math.cos;399/*** META ((export #t)) */400var sc_tan = Math.tan;401/*** META ((export #t)) */402var sc_asin = Math.asin;403/*** META ((export #t)) */404var sc_acos = Math.acos;405/*** META ((export #t)) */406var sc_atan = Math.atan;407/*** META ((export #t)) */408var sc_sqrt = Math.sqrt;409/*** META ((export #t)) */410var sc_expt = Math.pow;411// LIMITATION: we don't have complex numbers.412// LIMITATION: the following functions are hence not implemented.413// LIMITATION: make-rectangular, make-polar, real-part, imag-part, magnitude, angle414// LIMITATION: 2 argument atan415/*** META ((export #t)416 (peephole (id)))417*/418function sc_exact2inexact(x) {419 return x;420}421/*** META ((export #t)422 (peephole (id)))423*/424function sc_inexact2exact(x) {425 return x;426}427function sc_number2jsstring(x, radix) {428 if (radix)429 return x.toString(radix);430 else431 return x.toString();432}433function sc_jsstring2number(s, radix) {434 if (s === "") return false;435 if (radix) {436 var t = parseInt(s, radix);437 if (!t && t !== 0) return false;438 // verify that each char is in range. (parseInt ignores leading439 // white and trailing chars)440 var allowedChars = "01234567890abcdefghijklmnopqrstuvwxyz".substring(0, radix+1);441 if ((new RegExp("^["+allowedChars+"]*$", "i")).test(s))442 return t;443 else return false;444 } else {445 var t = +s; // does not ignore trailing chars.446 if (!t && t !== 0) return false;447 // simply verify that first char is not whitespace.448 var c = s.charAt(0);449 // if +c is 0, but the char is not "0", then we have a whitespace.450 if (+c === 0 && c !== "0") return false;451 return t;452 }453}454/*** META ((export #t)455 (type bool)456 (peephole (not)))457*/458function sc_not(b) {459 return b === false;460}461/*** META ((export #t)462 (type bool))463*/464function sc_isBoolean(b) {465 return (b === true) || (b === false);466}467function sc_Pair(car, cdr) {468 this.car = car;469 this.cdr = cdr;470}471sc_Pair.prototype.toString = function() {472 return sc_toDisplayString(this);473};474sc_Pair.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {475 var current = this;476 var res = "(";477 while(true) {478 res += writeOrDisplay(current.car);479 if (sc_isPair(current.cdr)) {480 res += " ";481 current = current.cdr;482 } else if (current.cdr !== null) {483 res += " . " + writeOrDisplay(current.cdr);484 break;485 } else // current.cdr == null486 break;487 }488 489 res += ")";490 return res;491};492sc_Pair.prototype.sc_toDisplayString = function() {493 return this.sc_toWriteOrDisplayString(sc_toDisplayString);494};495sc_Pair.prototype.sc_toWriteString = function() {496 return this.sc_toWriteOrDisplayString(sc_toWriteString);497};498// sc_Pair.prototype.sc_toWriteCircleString in IO.js499/*** META ((export #t)500 (type bool)501 (peephole (postfix " instanceof sc_Pair")))502*/503function sc_isPair(p) {504 return (p instanceof sc_Pair);505}506function sc_isPairEqual(p1, p2, comp) {507 return (comp(p1.car, p2.car) && comp(p1.cdr, p2.cdr));508}509/*** META ((export #t)510 (peephole (hole 2 "new sc_Pair(" car ", " cdr ")")))511*/512function sc_cons(car, cdr) {513 return new sc_Pair(car, cdr);514}515/*** META ((export cons*)) */516function sc_consStar() {517 var res = arguments[arguments.length - 1];518 for (var i = arguments.length-2; i >= 0; i--)519 res = new sc_Pair(arguments[i], res);520 return res;521}522/*** META ((export #t)523 (peephole (postfix ".car")))524*/525function sc_car(p) {526 return p.car;527}528/*** META ((export #t)529 (peephole (postfix ".cdr")))530*/531function sc_cdr(p) {532 return p.cdr;533}534/*** META ((export #t)535 (peephole (hole 2 p ".car = " val)))536*/537function sc_setCarBang(p, val) {538 p.car = val;539}540/*** META ((export #t)541 (peephole (hole 2 p ".cdr = " val)))542*/543function sc_setCdrBang(p, val) {544 p.cdr = val;545}546/*** META ((export #t)547 (peephole (postfix ".car.car")))548*/549function sc_caar(p) { return p.car.car; }550/*** META ((export #t)551 (peephole (postfix ".cdr.car")))552*/553function sc_cadr(p) { return p.cdr.car; }554/*** META ((export #t)555 (peephole (postfix ".car.cdr")))556*/557function sc_cdar(p) { return p.car.cdr; }558/*** META ((export #t)559 (peephole (postfix ".cdr.cdr")))560*/561function sc_cddr(p) { return p.cdr.cdr; }562/*** META ((export #t)563 (peephole (postfix ".car.car.car")))564*/565function sc_caaar(p) { return p.car.car.car; }566/*** META ((export #t)567 (peephole (postfix ".car.cdr.car")))568*/569function sc_cadar(p) { return p.car.cdr.car; }570/*** META ((export #t)571 (peephole (postfix ".cdr.car.car")))572*/573function sc_caadr(p) { return p.cdr.car.car; }574/*** META ((export #t)575 (peephole (postfix ".cdr.cdr.car")))576*/577function sc_caddr(p) { return p.cdr.cdr.car; }578/*** META ((export #t)579 (peephole (postfix ".car.car.cdr")))580*/581function sc_cdaar(p) { return p.car.car.cdr; }582/*** META ((export #t)583 (peephole (postfix ".cdr.car.cdr")))584*/585function sc_cdadr(p) { return p.cdr.car.cdr; }586/*** META ((export #t)587 (peephole (postfix ".car.cdr.cdr")))588*/589function sc_cddar(p) { return p.car.cdr.cdr; }590/*** META ((export #t)591 (peephole (postfix ".cdr.cdr.cdr")))592*/593function sc_cdddr(p) { return p.cdr.cdr.cdr; }594/*** META ((export #t)595 (peephole (postfix ".car.car.car.car")))596*/597function sc_caaaar(p) { return p.car.car.car.car; }598/*** META ((export #t)599 (peephole (postfix ".car.cdr.car.car")))600*/601function sc_caadar(p) { return p.car.cdr.car.car; }602/*** META ((export #t)603 (peephole (postfix ".cdr.car.car.car")))604*/605function sc_caaadr(p) { return p.cdr.car.car.car; }606/*** META ((export #t)607 (peephole (postfix ".cdr.cdr.car.car")))608*/609function sc_caaddr(p) { return p.cdr.cdr.car.car; }610/*** META ((export #t)611 (peephole (postfix ".car.car.car.cdr")))612*/613function sc_cdaaar(p) { return p.car.car.car.cdr; }614/*** META ((export #t)615 (peephole (postfix ".car.cdr.car.cdr")))616*/617function sc_cdadar(p) { return p.car.cdr.car.cdr; }618/*** META ((export #t)619 (peephole (postfix ".cdr.car.car.cdr")))620*/621function sc_cdaadr(p) { return p.cdr.car.car.cdr; }622/*** META ((export #t)623 (peephole (postfix ".cdr.cdr.car.cdr")))624*/625function sc_cdaddr(p) { return p.cdr.cdr.car.cdr; }626/*** META ((export #t)627 (peephole (postfix ".car.car.cdr.car")))628*/629function sc_cadaar(p) { return p.car.car.cdr.car; }630/*** META ((export #t)631 (peephole (postfix ".car.cdr.cdr.car")))632*/633function sc_caddar(p) { return p.car.cdr.cdr.car; }634/*** META ((export #t)635 (peephole (postfix ".cdr.car.cdr.car")))636*/637function sc_cadadr(p) { return p.cdr.car.cdr.car; }638/*** META ((export #t)639 (peephole (postfix ".cdr.cdr.cdr.car")))640*/641function sc_cadddr(p) { return p.cdr.cdr.cdr.car; }642/*** META ((export #t)643 (peephole (postfix ".car.car.cdr.cdr")))644*/645function sc_cddaar(p) { return p.car.car.cdr.cdr; }646/*** META ((export #t)647 (peephole (postfix ".car.cdr.cdr.cdr")))648*/649function sc_cdddar(p) { return p.car.cdr.cdr.cdr; }650/*** META ((export #t)651 (peephole (postfix ".cdr.car.cdr.cdr")))652*/653function sc_cddadr(p) { return p.cdr.car.cdr.cdr; }654/*** META ((export #t)655 (peephole (postfix ".cdr.cdr.cdr.cdr")))656*/657function sc_cddddr(p) { return p.cdr.cdr.cdr.cdr; }658/*** META ((export #t)) */659function sc_lastPair(l) {660 if (!sc_isPair(l)) sc_error("sc_lastPair: pair expected");661 var res = l;662 var cdr = l.cdr;663 while (sc_isPair(cdr)) {664 res = cdr;665 cdr = res.cdr;666 }667 return res;668}669/*** META ((export #t)670 (type bool)671 (peephole (postfix " === null")))672*/673function sc_isNull(o) {674 return (o === null);675}676/*** META ((export #t)677 (type bool))678*/679function sc_isList(o) {680 var rabbit;681 var turtle;682 var rabbit = o;683 var turtle = o;684 while (true) {685 if (rabbit === null ||686 (rabbit instanceof sc_Pair && rabbit.cdr === null))687 return true; // end of list688 else if ((rabbit instanceof sc_Pair) &&689 (rabbit.cdr instanceof sc_Pair)) {690 rabbit = rabbit.cdr.cdr;691 turtle = turtle.cdr;692 if (rabbit === turtle) return false; // cycle693 } else694 return false; // not pair695 }696}697/*** META ((export #t)) */698function sc_list() {699 var res = null;700 var a = arguments;701 for (var i = a.length-1; i >= 0; i--)702 res = new sc_Pair(a[i], res);703 return res;704}705/*** META ((export #t)) */706function sc_iota(num, init) {707 var res = null;708 if (!init) init = 0;709 for (var i = num - 1; i >= 0; i--)710 res = new sc_Pair(i + init, res);711 return res;712}713/*** META ((export #t)) */714function sc_makeList(nbEls, fill) {715 var res = null;716 for (var i = 0; i < nbEls; i++)717 res = new sc_Pair(fill, res);718 return res;719}720/*** META ((export #t)) */721function sc_length(l) {722 var res = 0;723 while (l !== null) {724 res++;725 l = l.cdr;726 }727 return res;728}729/*** META ((export #t)) */730function sc_remq(o, l) {731 var dummy = { cdr : null };732 var tail = dummy;733 while (l !== null) {734 if (l.car !== o) {735 tail.cdr = sc_cons(l.car, null);736 tail = tail.cdr;737 }738 l = l.cdr;739 }740 return dummy.cdr;741}742/*** META ((export #t)) */743function sc_remqBang(o, l) {744 var dummy = { cdr : null };745 var tail = dummy;746 var needsAssig = true;747 while (l !== null) {748 if (l.car === o) {749 needsAssig = true;750 } else {751 if (needsAssig) {752 tail.cdr = l;753 needsAssig = false;754 }755 tail = l;756 }757 l = l.cdr;758 }759 tail.cdr = null;760 return dummy.cdr;761}762/*** META ((export #t)) */763function sc_delete(o, l) {764 var dummy = { cdr : null };765 var tail = dummy;766 while (l !== null) {767 if (!sc_isEqual(l.car, o)) {768 tail.cdr = sc_cons(l.car, null);769 tail = tail.cdr;770 }771 l = l.cdr;772 }773 return dummy.cdr;774}775/*** META ((export #t)) */776function sc_deleteBang(o, l) {777 var dummy = { cdr : null };778 var tail = dummy;779 var needsAssig = true;780 while (l !== null) {781 if (sc_isEqual(l.car, o)) {782 needsAssig = true;783 } else {784 if (needsAssig) {785 tail.cdr = l;786 needsAssig = false;787 }788 tail = l;789 }790 l = l.cdr;791 }792 tail.cdr = null;793 return dummy.cdr;794}795function sc_reverseAppendBang(l1, l2) {796 var res = l2;797 while (l1 !== null) {798 var tmp = res;799 res = l1;800 l1 = l1.cdr;801 res.cdr = tmp;802 }803 return res;804}805 806function sc_dualAppend(l1, l2) {807 if (l1 === null) return l2;808 if (l2 === null) return l1;809 var rev = sc_reverse(l1);810 return sc_reverseAppendBang(rev, l2);811}812/*** META ((export #t)) */813function sc_append() {814 if (arguments.length === 0)815 return null;816 var res = arguments[arguments.length - 1];817 for (var i = arguments.length - 2; i >= 0; i--)818 res = sc_dualAppend(arguments[i], res);819 return res;820}821function sc_dualAppendBang(l1, l2) {822 if (l1 === null) return l2;823 if (l2 === null) return l1;824 var tmp = l1;825 while (tmp.cdr !== null) tmp=tmp.cdr;826 tmp.cdr = l2;827 return l1;828}829 830/*** META ((export #t)) */831function sc_appendBang() {832 var res = null;833 for (var i = 0; i < arguments.length; i++)834 res = sc_dualAppendBang(res, arguments[i]);835 return res;836}837/*** META ((export #t)) */838function sc_reverse(l1) {839 var res = null;840 while (l1 !== null) {841 res = sc_cons(l1.car, res);842 l1 = l1.cdr;843 }844 return res;845}846/*** META ((export #t)) */847function sc_reverseBang(l) {848 return sc_reverseAppendBang(l, null);849}850/*** META ((export #t)) */851function sc_listTail(l, k) {852 var res = l;853 for (var i = 0; i < k; i++) {854 res = res.cdr;855 }856 return res;857}858/*** META ((export #t)) */859function sc_listRef(l, k) {860 return sc_listTail(l, k).car;861}862/* // unoptimized generic versions863function sc_memX(o, l, comp) {864 while (l != null) {865 if (comp(l.car, o))866 return l;867 l = l.cdr;868 }869 return false;870}871function sc_memq(o, l) { return sc_memX(o, l, sc_isEq); }872function sc_memv(o, l) { return sc_memX(o, l, sc_isEqv); }873function sc_member(o, l) { return sc_memX(o, l, sc_isEqual); }874*/875/* optimized versions */876/*** META ((export #t)) */877function sc_memq(o, l) {878 while (l !== null) {879 if (l.car === o)880 return l;881 l = l.cdr;882 }883 return false;884}885/*** META ((export #t)) */886function sc_memv(o, l) {887 while (l !== null) {888 if (l.car === o)889 return l;890 l = l.cdr;891 }892 return false;893}894/*** META ((export #t)) */895function sc_member(o, l) {896 while (l !== null) {897 if (sc_isEqual(l.car,o))898 return l;899 l = l.cdr;900 }901 return false;902}903/* // generic unoptimized versions904function sc_assX(o, al, comp) {905 while (al != null) {906 if (comp(al.car.car, o))907 return al.car;908 al = al.cdr;909 }910 return false;911}912function sc_assq(o, al) { return sc_assX(o, al, sc_isEq); }913function sc_assv(o, al) { return sc_assX(o, al, sc_isEqv); }914function sc_assoc(o, al) { return sc_assX(o, al, sc_isEqual); }915*/916// optimized versions917/*** META ((export #t)) */918function sc_assq(o, al) {919 while (al !== null) {920 if (al.car.car === o)921 return al.car;922 al = al.cdr;923 }924 return false;925}926/*** META ((export #t)) */927function sc_assv(o, al) {928 while (al !== null) {929 if (al.car.car === o)930 return al.car;931 al = al.cdr;932 }933 return false;934}935/*** META ((export #t)) */936function sc_assoc(o, al) {937 while (al !== null) {938 if (sc_isEqual(al.car.car, o))939 return al.car;940 al = al.cdr;941 }942 return false;943}944/* can be used for mutable strings and characters */945function sc_isCharStringEqual(cs1, cs2) { return cs1.val === cs2.val; }946function sc_isCharStringLess(cs1, cs2) { return cs1.val < cs2.val; }947function sc_isCharStringGreater(cs1, cs2) { return cs1.val > cs2.val; }948function sc_isCharStringLessEqual(cs1, cs2) { return cs1.val <= cs2.val; }949function sc_isCharStringGreaterEqual(cs1, cs2) { return cs1.val >= cs2.val; }950function sc_isCharStringCIEqual(cs1, cs2)951 { return cs1.val.toLowerCase() === cs2.val.toLowerCase(); }952function sc_isCharStringCILess(cs1, cs2)953 { return cs1.val.toLowerCase() < cs2.val.toLowerCase(); }954function sc_isCharStringCIGreater(cs1, cs2)955 { return cs1.val.toLowerCase() > cs2.val.toLowerCase(); }956function sc_isCharStringCILessEqual(cs1, cs2)957 { return cs1.val.toLowerCase() <= cs2.val.toLowerCase(); }958function sc_isCharStringCIGreaterEqual(cs1, cs2)959 { return cs1.val.toLowerCase() >= cs2.val.toLowerCase(); }960function sc_Char(c) {961 var cached = sc_Char.lazy[c];962 if (cached)963 return cached;964 this.val = c;965 sc_Char.lazy[c] = this;966 // add return, so FF does not complain.967 return undefined;968}969sc_Char.lazy = new Object();970// thanks to Eric971sc_Char.char2readable = {972 "\000": "#\\null",973 "\007": "#\\bell",974 "\010": "#\\backspace",975 "\011": "#\\tab",976 "\012": "#\\newline",977 "\014": "#\\page",978 "\015": "#\\return",979 "\033": "#\\escape",980 "\040": "#\\space",981 "\177": "#\\delete",982 /* poeticless names */983 "\001": "#\\soh",984 "\002": "#\\stx",985 "\003": "#\\etx",986 "\004": "#\\eot",987 "\005": "#\\enq",988 "\006": "#\\ack",989 "\013": "#\\vt",990 "\016": "#\\so",991 "\017": "#\\si",992 "\020": "#\\dle",993 "\021": "#\\dc1",994 "\022": "#\\dc2",995 "\023": "#\\dc3",996 "\024": "#\\dc4",997 "\025": "#\\nak",998 "\026": "#\\syn",999 "\027": "#\\etb",1000 "\030": "#\\can",1001 "\031": "#\\em",1002 "\032": "#\\sub",1003 "\033": "#\\esc",1004 "\034": "#\\fs",1005 "\035": "#\\gs",1006 "\036": "#\\rs",1007 "\037": "#\\us"};1008sc_Char.readable2char = {1009 "null": "\000",1010 "bell": "\007",1011 "backspace": "\010",1012 "tab": "\011",1013 "newline": "\012",1014 "page": "\014",1015 "return": "\015",1016 "escape": "\033",1017 "space": "\040",1018 "delete": "\000",1019 "soh": "\001",1020 "stx": "\002",1021 "etx": "\003",1022 "eot": "\004",1023 "enq": "\005",1024 "ack": "\006",1025 "bel": "\007",1026 "bs": "\010",1027 "ht": "\011",1028 "nl": "\012",1029 "vt": "\013",1030 "np": "\014",1031 "cr": "\015",1032 "so": "\016",1033 "si": "\017",1034 "dle": "\020",1035 "dc1": "\021",1036 "dc2": "\022",1037 "dc3": "\023",1038 "dc4": "\024",1039 "nak": "\025",1040 "syn": "\026",1041 "etb": "\027",1042 "can": "\030",1043 "em": "\031",1044 "sub": "\032",1045 "esc": "\033",1046 "fs": "\034",1047 "gs": "\035",1048 "rs": "\036",1049 "us": "\037",1050 "sp": "\040",1051 "del": "\177"};1052 1053sc_Char.prototype.toString = function() {1054 return this.val;1055};1056// sc_toDisplayString == toString1057sc_Char.prototype.sc_toWriteString = function() {1058 var entry = sc_Char.char2readable[this.val];1059 if (entry)1060 return entry;1061 else1062 return "#\\" + this.val;1063};1064/*** META ((export #t)1065 (type bool)1066 (peephole (postfix "instanceof sc_Char")))1067*/1068function sc_isChar(c) {1069 return (c instanceof sc_Char);1070}1071/*** META ((export char=?)1072 (type bool)1073 (peephole (hole 2 c1 ".val === " c2 ".val")))1074*/1075var sc_isCharEqual = sc_isCharStringEqual;1076/*** META ((export char<?)1077 (type bool)1078 (peephole (hole 2 c1 ".val < " c2 ".val")))1079*/1080var sc_isCharLess = sc_isCharStringLess;1081/*** META ((export char>?)1082 (type bool)1083 (peephole (hole 2 c1 ".val > " c2 ".val")))1084*/1085var sc_isCharGreater = sc_isCharStringGreater;1086/*** META ((export char<=?)1087 (type bool)1088 (peephole (hole 2 c1 ".val <= " c2 ".val")))1089*/1090var sc_isCharLessEqual = sc_isCharStringLessEqual;1091/*** META ((export char>=?)1092 (type bool)1093 (peephole (hole 2 c1 ".val >= " c2 ".val")))1094*/1095var sc_isCharGreaterEqual = sc_isCharStringGreaterEqual;1096/*** META ((export char-ci=?)1097 (type bool)1098 (peephole (hole 2 c1 ".val.toLowerCase() === " c2 ".val.toLowerCase()")))1099*/1100var sc_isCharCIEqual = sc_isCharStringCIEqual;1101/*** META ((export char-ci<?)1102 (type bool)1103 (peephole (hole 2 c1 ".val.toLowerCase() < " c2 ".val.toLowerCase()")))1104*/1105var sc_isCharCILess = sc_isCharStringCILess;1106/*** META ((export char-ci>?)1107 (type bool)1108 (peephole (hole 2 c1 ".val.toLowerCase() > " c2 ".val.toLowerCase()")))1109*/1110var sc_isCharCIGreater = sc_isCharStringCIGreater;1111/*** META ((export char-ci<=?)1112 (type bool)1113 (peephole (hole 2 c1 ".val.toLowerCase() <= " c2 ".val.toLowerCase()")))1114*/1115var sc_isCharCILessEqual = sc_isCharStringCILessEqual;1116/*** META ((export char-ci>=?)1117 (type bool)1118 (peephole (hole 2 c1 ".val.toLowerCase() >= " c2 ".val.toLowerCase()")))1119*/1120var sc_isCharCIGreaterEqual = sc_isCharStringCIGreaterEqual;1121var SC_NUMBER_CLASS = "0123456789";1122var SC_WHITESPACE_CLASS = ' \r\n\t\f';1123var SC_LOWER_CLASS = 'abcdefghijklmnopqrstuvwxyz';1124var SC_UPPER_CLASS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';1125function sc_isCharOfClass(c, cl) { return (cl.indexOf(c) != -1); }1126/*** META ((export #t)1127 (type bool))1128*/1129function sc_isCharAlphabetic(c)1130 { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||1131 sc_isCharOfClass(c.val, SC_UPPER_CLASS); }1132/*** META ((export #t)1133 (type bool)1134 (peephole (hole 1 "SC_NUMBER_CLASS.indexOf(" c ".val) != -1")))1135*/1136function sc_isCharNumeric(c)1137 { return sc_isCharOfClass(c.val, SC_NUMBER_CLASS); }1138/*** META ((export #t)1139 (type bool))1140*/1141function sc_isCharWhitespace(c) {1142 var tmp = c.val;1143 return tmp === " " || tmp === "\r" || tmp === "\n" || tmp === "\t" || tmp === "\f";1144}1145/*** META ((export #t)1146 (type bool)1147 (peephole (hole 1 "SC_UPPER_CLASS.indexOf(" c ".val) != -1")))1148*/1149function sc_isCharUpperCase(c)1150 { return sc_isCharOfClass(c.val, SC_UPPER_CLASS); }1151/*** META ((export #t)1152 (type bool)1153 (peephole (hole 1 "SC_LOWER_CLASS.indexOf(" c ".val) != -1")))1154*/1155function sc_isCharLowerCase(c)1156 { return sc_isCharOfClass(c.val, SC_LOWER_CLASS); }1157/*** META ((export #t)1158 (peephole (postfix ".val.charCodeAt(0)")))1159*/1160function sc_char2integer(c)1161 { return c.val.charCodeAt(0); }1162/*** META ((export #t)1163 (peephole (hole 1 "new sc_Char(String.fromCharCode(" n "))")))1164*/1165function sc_integer2char(n)1166 { return new sc_Char(String.fromCharCode(n)); }1167/*** META ((export #t)1168 (peephole (hole 1 "new sc_Char(" c ".val.toUpperCase())")))1169*/1170function sc_charUpcase(c)1171 { return new sc_Char(c.val.toUpperCase()); }1172/*** META ((export #t)1173 (peephole (hole 1 "new sc_Char(" c ".val.toLowerCase())")))1174*/1175function sc_charDowncase(c)1176 { return new sc_Char(c.val.toLowerCase()); }1177function sc_makeJSStringOfLength(k, c) {1178 var fill;1179 if (c === undefined)1180 fill = " ";1181 else1182 fill = c;1183 var res = "";1184 var len = 1;1185 // every round doubles the size of fill.1186 while (k >= len) {1187 if (k & len)1188 res = res.concat(fill);1189 fill = fill.concat(fill);1190 len *= 2;1191 }1192 return res;1193}1194function sc_makejsString(k, c) {1195 var fill;1196 if (c)1197 fill = c.val;1198 else1199 fill = " ";1200 return sc_makeJSStringOfLength(k, fill);1201}1202function sc_jsstring2list(s) {1203 var res = null;1204 for (var i = s.length - 1; i >= 0; i--)1205 res = sc_cons(new sc_Char(s.charAt(i)), res);1206 return res;1207}1208function sc_list2jsstring(l) {1209 var a = new Array();1210 while(l !== null) {1211 a.push(l.car.val);1212 l = l.cdr;1213 }1214 return "".concat.apply("", a);1215}1216var sc_Vector = Array;1217sc_Vector.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {1218 if (this.length === 0) return "#()";1219 var res = "#(" + writeOrDisplay(this[0]);1220 for (var i = 1; i < this.length; i++)1221 res += " " + writeOrDisplay(this[i]);1222 res += ")";1223 return res;1224};1225sc_Vector.prototype.sc_toDisplayString = function() {1226 return this.sc_toWriteOrDisplayString(sc_toDisplayString);1227};1228sc_Vector.prototype.sc_toWriteString = function() {1229 return this.sc_toWriteOrDisplayString(sc_toWriteString);1230};1231/*** META ((export vector? array?)1232 (type bool)1233 (peephole (postfix " instanceof sc_Vector")))1234*/1235function sc_isVector(v) {1236 return (v instanceof sc_Vector);1237}1238// only applies to vectors1239function sc_isVectorEqual(v1, v2, comp) {1240 if (v1.length !== v2.length) return false;1241 for (var i = 0; i < v1.length; i++)1242 if (!comp(v1[i], v2[i])) return false;1243 return true;1244}1245/*** META ((export make-vector make-array)) */1246function sc_makeVector(size, fill) {1247 var a = new sc_Vector(size);1248 if (fill !== undefined)1249 sc_vectorFillBang(a, fill);1250 return a;1251}1252/*** META ((export vector array)1253 (peephole (vector)))1254*/1255function sc_vector() {1256 var a = new sc_Vector();1257 for (var i = 0; i < arguments.length; i++)1258 a.push(arguments[i]);1259 return a;1260}1261/*** META ((export vector-length array-length)1262 (peephole (postfix ".length")))1263*/1264function sc_vectorLength(v) {1265 return v.length;1266}1267/*** META ((export vector-ref array-ref)1268 (peephole (hole 2 v "[" pos "]")))1269*/1270function sc_vectorRef(v, pos) {1271 return v[pos];1272}1273/*** META ((export vector-set! array-set!)1274 (peephole (hole 3 v "[" pos "] = " val)))1275*/1276function sc_vectorSetBang(v, pos, val) {1277 v[pos] = val;1278}1279/*** META ((export vector->list array->list)) */1280function sc_vector2list(a) {1281 var res = null;1282 for (var i = a.length-1; i >= 0; i--)1283 res = sc_cons(a[i], res);1284 return res;1285}1286/*** META ((export list->vector list->array)) */1287function sc_list2vector(l) {1288 var a = new sc_Vector();1289 while(l !== null) {1290 a.push(l.car);1291 l = l.cdr;1292 }1293 return a;1294}1295/*** META ((export vector-fill! array-fill!)) */1296function sc_vectorFillBang(a, fill) {1297 for (var i = 0; i < a.length; i++)1298 a[i] = fill;1299}1300/*** META ((export #t)) */1301function sc_copyVector(a, len) {1302 if (len <= a.length)1303 return a.slice(0, len);1304 else {1305 var tmp = a.concat();1306 tmp.length = len;1307 return tmp;1308 }1309}1310/*** META ((export #t)1311 (peephole (hole 3 a ".slice(" start "," end ")")))1312*/1313function sc_vectorCopy(a, start, end) {1314 return a.slice(start, end);1315}1316/*** META ((export #t)) */1317function sc_vectorCopyBang(target, tstart, source, sstart, send) {1318 if (!sstart) sstart = 0;1319 if (!send) send = source.length;1320 // if target == source we don't want to overwrite not yet copied elements.1321 if (tstart <= sstart) {1322 for (var i = tstart, j = sstart; j < send; i++, j++) {1323 target[i] = source[j];1324 }1325 } else {1326 var diff = send - sstart;1327 for (var i = tstart + diff - 1, j = send - 1;1328 j >= sstart;1329 i--, j--) {1330 target[i] = source[j];1331 }1332 }1333 return target;1334}1335/*** META ((export #t)1336 (type bool)1337 (peephole (hole 1 "typeof " o " === 'function'")))1338*/1339function sc_isProcedure(o) {1340 return (typeof o === "function");1341}1342/*** META ((export #t)) */1343function sc_apply(proc) {1344 var args = new Array();1345 // first part of arguments are not in list-form.1346 for (var i = 1; i < arguments.length - 1; i++)1347 args.push(arguments[i]);1348 var l = arguments[arguments.length - 1];1349 while (l !== null) {1350 args.push(l.car);1351 l = l.cdr;1352 }1353 return proc.apply(null, args);1354}1355/*** META ((export #t)) */1356function sc_map(proc, l1) {1357 if (l1 === undefined)1358 return null;1359 // else1360 var nbApplyArgs = arguments.length - 1;1361 var applyArgs = new Array(nbApplyArgs);1362 var revres = null;1363 while (l1 !== null) {1364 for (var i = 0; i < nbApplyArgs; i++) {1365 applyArgs[i] = arguments[i + 1].car;1366 arguments[i + 1] = arguments[i + 1].cdr;1367 }1368 revres = sc_cons(proc.apply(null, applyArgs), revres);1369 }1370 return sc_reverseAppendBang(revres, null);1371}1372/*** META ((export #t)) */1373function sc_mapBang(proc, l1) {1374 if (l1 === undefined)1375 return null;1376 // else1377 var l1_orig = l1;1378 var nbApplyArgs = arguments.length - 1;1379 var applyArgs = new Array(nbApplyArgs);1380 while (l1 !== null) {1381 var tmp = l1;1382 for (var i = 0; i < nbApplyArgs; i++) {1383 applyArgs[i] = arguments[i + 1].car;1384 arguments[i + 1] = arguments[i + 1].cdr;1385 }1386 tmp.car = proc.apply(null, applyArgs);1387 }1388 return l1_orig;1389}1390 1391/*** META ((export #t)) */1392function sc_forEach(proc, l1) {1393 if (l1 === undefined)1394 return undefined;1395 // else1396 var nbApplyArgs = arguments.length - 1;1397 var applyArgs = new Array(nbApplyArgs);1398 while (l1 !== null) {1399 for (var i = 0; i < nbApplyArgs; i++) {1400 applyArgs[i] = arguments[i + 1].car;1401 arguments[i + 1] = arguments[i + 1].cdr;1402 }1403 proc.apply(null, applyArgs);1404 }1405 // add return so FF does not complain.1406 return undefined;1407}1408/*** META ((export #t)) */1409function sc_filter(proc, l1) {1410 var dummy = { cdr : null };1411 var tail = dummy;1412 while (l1 !== null) {1413 if (proc(l1.car) !== false) {1414 tail.cdr = sc_cons(l1.car, null);1415 tail = tail.cdr;1416 }1417 l1 = l1.cdr;1418 }1419 return dummy.cdr;1420}1421/*** META ((export #t)) */1422function sc_filterBang(proc, l1) {1423 var head = sc_cons("dummy", l1);1424 var it = head;1425 var next = l1;1426 while (next !== null) {1427 if (proc(next.car) !== false) {1428 it.cdr = next1429 it = next;1430 }1431 next = next.cdr;1432 }1433 it.cdr = null;1434 return head.cdr;1435}1436function sc_filterMap1(proc, l1) {1437 var revres = null;1438 while (l1 !== null) {1439 var tmp = proc(l1.car)1440 if (tmp !== false) revres = sc_cons(tmp, revres);1441 l1 = l1.cdr;1442 }1443 return sc_reverseAppendBang(revres, null);1444}1445function sc_filterMap2(proc, l1, l2) {1446 var revres = null;1447 while (l1 !== null) {1448 var tmp = proc(l1.car, l2.car);1449 if(tmp !== false) revres = sc_cons(tmp, revres);1450 l1 = l1.cdr;1451 l2 = l2.cdr1452 }1453 return sc_reverseAppendBang(revres, null);1454}1455/*** META ((export #t)) */1456function sc_filterMap(proc, l1, l2, l3) {1457 if (l2 === undefined)1458 return sc_filterMap1(proc, l1);1459 else if (l3 === undefined)1460 return sc_filterMap2(proc, l1, l2);1461 // else1462 var nbApplyArgs = arguments.length - 1;1463 var applyArgs = new Array(nbApplyArgs);1464 var revres = null;1465 while (l1 !== null) {1466 for (var i = 0; i < nbApplyArgs; i++) {1467 applyArgs[i] = arguments[i + 1].car;1468 arguments[i + 1] = arguments[i + 1].cdr;1469 }1470 var tmp = proc.apply(null, applyArgs);1471 if(tmp !== false) revres = sc_cons(tmp, revres);1472 }1473 return sc_reverseAppendBang(revres, null);1474}1475/*** META ((export #t)) */1476function sc_any(proc, l) {1477 var revres = null;1478 while (l !== null) {1479 var tmp = proc(l.car);1480 if(tmp !== false) return tmp;1481 l = l.cdr;1482 }1483 return false;1484}1485/*** META ((export any?)1486 (peephole (hole 2 "sc_any(" proc "," l ") !== false")))1487*/1488function sc_anyPred(proc, l) {1489 return sc_any(proc, l)!== false;1490}1491/*** META ((export #t)) */1492function sc_every(proc, l) {1493 var revres = null;1494 var tmp = true;1495 while (l !== null) {1496 tmp = proc(l.car);1497 if (tmp === false) return false;1498 l = l.cdr;1499 }1500 return tmp;1501}1502/*** META ((export every?)1503 (peephole (hole 2 "sc_every(" proc "," l ") !== false")))1504*/1505function sc_everyPred(proc, l) {1506 var tmp = sc_every(proc, l);1507 if (tmp !== false) return true;1508 return false;1509}1510/*** META ((export #t)1511 (peephole (postfix "()")))1512*/1513function sc_force(o) {1514 return o();1515}1516/*** META ((export #t)) */1517function sc_makePromise(proc) {1518 var isResultReady = false;1519 var result = undefined;1520 return function() {1521 if (!isResultReady) {1522 var tmp = proc();1523 if (!isResultReady) {1524 isResultReady = true;1525 result = tmp;1526 }1527 }1528 return result;1529 };1530}1531function sc_Values(values) {1532 this.values = values;1533}1534/*** META ((export #t)1535 (peephole (values)))1536*/1537function sc_values() {1538 if (arguments.length === 1)1539 return arguments[0];1540 else1541 return new sc_Values(arguments);1542}1543/*** META ((export #t)) */1544function sc_callWithValues(producer, consumer) {1545 var produced = producer();1546 if (produced instanceof sc_Values)1547 return consumer.apply(null, produced.values);1548 else1549 return consumer(produced);1550}1551/*** META ((export #t)) */1552function sc_dynamicWind(before, thunk, after) {1553 before();1554 try {1555 var res = thunk();1556 return res;1557 } finally {1558 after();1559 }1560}1561// TODO: eval/scheme-report-environment/null-environment/interaction-environment1562// LIMITATION: 'load' doesn't exist without files.1563// LIMITATION: transcript-on/transcript-off doesn't exist without files.1564function sc_Struct(name) {1565 this.name = name;1566}1567sc_Struct.prototype.sc_toDisplayString = function() {1568 return "#<struct" + sc_hash(this) + ">";1569};1570sc_Struct.prototype.sc_toWriteString = sc_Struct.prototype.sc_toDisplayString;1571/*** META ((export #t)1572 (peephole (hole 1 "new sc_Struct(" name ")")))1573*/1574function sc_makeStruct(name) {1575 return new sc_Struct(name);1576}1577/*** META ((export #t)1578 (type bool)1579 (peephole (postfix " instanceof sc_Struct")))1580*/1581function sc_isStruct(o) {1582 return (o instanceof sc_Struct);1583}1584/*** META ((export #t)1585 (type bool)1586 (peephole (hole 2 "(" 1 " instanceof sc_Struct) && ( " 1 ".name === " 0 ")")))1587*/1588function sc_isStructNamed(name, s) {1589 return ((s instanceof sc_Struct) && (s.name === name));1590}1591/*** META ((export struct-field)1592 (peephole (hole 3 0 "[" 2 "]")))1593*/1594function sc_getStructField(s, name, field) {1595 return s[field];1596}1597/*** META ((export struct-field-set!)1598 (peephole (hole 4 0 "[" 2 "] = " 3)))1599*/1600function sc_setStructFieldBang(s, name, field, val) {1601 s[field] = val;1602}1603/*** META ((export #t)1604 (peephole (prefix "~")))1605*/1606function sc_bitNot(x) {1607 return ~x;1608}1609/*** META ((export #t)1610 (peephole (infix 2 2 "&")))1611*/1612function sc_bitAnd(x, y) {1613 return x & y;1614}1615/*** META ((export #t)1616 (peephole (infix 2 2 "|")))1617*/1618function sc_bitOr(x, y) {1619 return x | y;1620}1621/*** META ((export #t)1622 (peephole (infix 2 2 "^")))1623*/1624function sc_bitXor(x, y) {1625 return x ^ y;1626}1627/*** META ((export #t)1628 (peephole (infix 2 2 "<<")))1629*/1630function sc_bitLsh(x, y) {1631 return x << y;1632}1633/*** META ((export #t)1634 (peephole (infix 2 2 ">>")))1635*/1636function sc_bitRsh(x, y) {1637 return x >> y;1638}1639/*** META ((export #t)1640 (peephole (infix 2 2 ">>>")))1641*/1642function sc_bitUrsh(x, y) {1643 return x >>> y;1644}1645/*** META ((export js-field js-property)1646 (peephole (hole 2 o "[" field "]")))1647*/1648function sc_jsField(o, field) {1649 return o[field];1650}1651/*** META ((export js-field-set! js-property-set!)1652 (peephole (hole 3 o "[" field "] = " val)))1653*/1654function sc_setJsFieldBang(o, field, val) {1655 return o[field] = val;1656}1657/*** META ((export js-field-delete! js-property-delete!)1658 (peephole (hole 2 "delete" o "[" field "]")))1659*/1660function sc_deleteJsFieldBang(o, field) {1661 delete o[field];1662}1663/*** META ((export #t)1664 (peephole (jsCall)))1665*/1666function sc_jsCall(o, fun) {1667 var args = new Array();1668 for (var i = 2; i < arguments.length; i++)1669 args[i-2] = arguments[i];1670 return fun.apply(o, args);1671}1672/*** META ((export #t)1673 (peephole (jsMethodCall)))1674*/1675function sc_jsMethodCall(o, field) {1676 var args = new Array();1677 for (var i = 2; i < arguments.length; i++)1678 args[i-2] = arguments[i];1679 return o[field].apply(o, args);1680}1681/*** META ((export new js-new)1682 (peephole (jsNew)))1683*/1684function sc_jsNew(c) {1685 var evalStr = "new c(";1686 evalStr +=arguments.length > 1? "arguments[1]": "";1687 for (var i = 2; i < arguments.length; i++)1688 evalStr += ", arguments[" + i + "]";1689 evalStr +=")";1690 return eval(evalStr);1691} 1692// ======================== RegExp ====================1693/*** META ((export #t)) */1694function sc_pregexp(re) {1695 return new RegExp(sc_string2jsstring(re));1696}1697/*** META ((export #t)) */1698function sc_pregexpMatch(re, s) {1699 var reg = (re instanceof RegExp) ? re : sc_pregexp(re);1700 var tmp = reg.exec(sc_string2jsstring(s));1701 1702 if (tmp == null) return false;1703 1704 var res = null;1705 for (var i = tmp.length-1; i >= 0; i--) {1706 if (tmp[i] !== null) {1707 res = sc_cons(sc_jsstring2string(tmp[i]), res);1708 } else {1709 res = sc_cons(false, res);1710 }1711 }1712 return res;1713}1714 1715/*** META ((export #t)) */1716function sc_pregexpReplace(re, s1, s2) {1717 var reg;1718 var jss1 = sc_string2jsstring(s1);1719 var jss2 = sc_string2jsstring(s2);1720 if (re instanceof RegExp) {1721 if (re.global)1722 reg = re;1723 else1724 reg = new RegExp(re.source);1725 } else {1726 reg = new RegExp(sc_string2jsstring(re));1727 }1728 return jss1.replace(reg, jss2);1729}1730 1731/*** META ((export pregexp-replace*)) */1732function sc_pregexpReplaceAll(re, s1, s2) {1733 var reg;1734 var jss1 = sc_string2jsstring(s1);1735 var jss2 = sc_string2jsstring(s2);1736 if (re instanceof RegExp) {1737 if (re.global)1738 reg = re;1739 else1740 reg = new RegExp(re.source, "g");1741 } else {1742 reg = new RegExp(sc_string2jsstring(re), "g");1743 }1744 return jss1.replace(reg, jss2);1745}1746/*** META ((export #t)) */1747function sc_pregexpSplit(re, s) {1748 var reg = ((re instanceof RegExp) ?1749 re :1750 new RegExp(sc_string2jsstring(re)));1751 var jss = sc_string2jsstring(s);1752 var tmp = jss.split(reg);1753 if (tmp == null) return false;1754 return sc_vector2list(tmp);1755}1756 1757/* =========================================================================== */1758/* Other library stuff */1759/* =========================================================================== */1760/*** META ((export #t)1761 (peephole (hole 1 "Math.floor(Math.random()*" 'n ")")))1762*/1763function sc_random(n) {1764 return Math.floor(Math.random()*n);1765}1766/*** META ((export current-date)1767 (peephole (hole 0 "new Date()")))1768*/1769function sc_currentDate() {1770 return new Date();1771}1772function sc_Hashtable() {1773}1774sc_Hashtable.prototype.toString = function() {1775 return "#{%hashtable}";1776};1777// sc_toWriteString == sc_toDisplayString == toString1778function sc_HashtableElement(key, val) {1779 this.key = key;1780 this.val = val;1781}1782/*** META ((export #t)1783 (peephole (hole 0 "new sc_Hashtable()")))1784*/1785function sc_makeHashtable() {1786 return new sc_Hashtable();1787}1788/*** META ((export #t)) */1789function sc_hashtablePutBang(ht, key, val) {1790 var hash = sc_hash(key);1791 ht[hash] = new sc_HashtableElement(key, val);1792}1793/*** META ((export #t)) */1794function sc_hashtableGet(ht, key) {1795 var hash = sc_hash(key);1796 if (hash in ht)1797 return ht[hash].val;1798 else1799 return false;1800}1801/*** META ((export #t)) */1802function sc_hashtableForEach(ht, f) {1803 for (var v in ht) {1804 if (ht[v] instanceof sc_HashtableElement)1805 f(ht[v].key, ht[v].val);1806 }1807}1808/*** META ((export hashtable-contains?)1809 (peephole (hole 2 "sc_hash(" 1 ") in " 0)))1810*/1811function sc_hashtableContains(ht, key) {1812 var hash = sc_hash(key);1813 if (hash in ht)1814 return true;1815 else1816 return false;1817}1818var SC_HASH_COUNTER = 0;1819function sc_hash(o) {1820 if (o === null)1821 return "null";1822 else if (o === undefined)1823 return "undefined";1824 else if (o === true)1825 return "true";1826 else if (o === false)1827 return "false";1828 else if (typeof o === "number")1829 return "num-" + o;1830 else if (typeof o === "string")1831 return "jsstr-" + o;1832 else if (o.sc_getHash)1833 return o.sc_getHash();1834 else1835 return sc_counterHash.call(o);1836}1837function sc_counterHash() {1838 if (!this.sc_hash) {1839 this.sc_hash = "hash-" + SC_HASH_COUNTER;1840 SC_HASH_COUNTER++;1841 }1842 return this.sc_hash;1843}1844function sc_Trampoline(args, maxTailCalls) {1845 this['__trampoline return__'] = true;1846 this.args = args;1847 this.MAX_TAIL_CALLs = maxTailCalls;1848}1849// TODO: call/cc stuff1850sc_Trampoline.prototype.restart = function() {1851 var o = this;1852 while (true) {1853 // set both globals.1854 SC_TAIL_OBJECT.calls = o.MAX_TAIL_CALLs-1;1855 var fun = o.args.callee;1856 var res = fun.apply(SC_TAIL_OBJECT, o.args);1857 if (res instanceof sc_Trampoline)1858 o = res;1859 else1860 return res;1861 }1862}1863/*** META ((export bind-exit-lambda)) */1864function sc_bindExitLambda(proc) {1865 var escape_obj = new sc_BindExitException();1866 var escape = function(res) {1867 escape_obj.res = res;1868 throw escape_obj;1869 };1870 try {1871 return proc(escape);1872 } catch(e) {1873 if (e === escape_obj) {1874 return e.res;1875 }1876 throw e;1877 }1878}1879function sc_BindExitException() {1880 this._internalException = true;1881}1882var SC_SCM2JS_GLOBALS = new Object();1883// default tail-call depth.1884// normally the program should set it again. but just in case...1885var SC_TAIL_OBJECT = new Object();1886SC_SCM2JS_GLOBALS.TAIL_OBJECT = SC_TAIL_OBJECT;1887// ======================== I/O =======================1888/*------------------------------------------------------------------*/1889function sc_EOF() {1890}1891var SC_EOF_OBJECT = new sc_EOF();1892function sc_Port() {1893}1894/* --------------- Input ports -------------------------------------*/1895function sc_InputPort() {1896}1897sc_InputPort.prototype = new sc_Port();1898sc_InputPort.prototype.peekChar = function() {1899 if (!("peeked" in this))1900 this.peeked = this.getNextChar();1901 return this.peeked;1902}1903sc_InputPort.prototype.readChar = function() {1904 var tmp = this.peekChar();1905 delete this.peeked;1906 return tmp;1907}1908sc_InputPort.prototype.isCharReady = function() {1909 return true;1910}1911sc_InputPort.prototype.close = function() {1912 // do nothing1913}1914/* .............. String port ..........................*/1915function sc_ErrorInputPort() {1916};1917sc_ErrorInputPort.prototype = new sc_InputPort();1918sc_ErrorInputPort.prototype.getNextChar = function() {1919 throw "can't read from error-port.";1920};1921sc_ErrorInputPort.prototype.isCharReady = function() {1922 return false;1923};1924 1925/* .............. String port ..........................*/1926function sc_StringInputPort(jsStr) {1927 // we are going to do some charAts on the str.1928 // instead of recreating all the time a String-object, we1929 // create one in the beginning. (not sure, if this is really an optim)1930 this.str = new String(jsStr);1931 this.pos = 0;1932}1933sc_StringInputPort.prototype = new sc_InputPort();1934sc_StringInputPort.prototype.getNextChar = function() {1935 if (this.pos >= this.str.length)1936 return SC_EOF_OBJECT;1937 return this.str.charAt(this.pos++);1938};1939/* ------------- Read and other lib-funs -------------------------------*/1940function sc_Token(type, val, pos) {1941 this.type = type;1942 this.val = val;1943 this.pos = pos;1944}1945sc_Token.EOF = 0/*EOF*/;1946sc_Token.OPEN_PAR = 1/*OPEN_PAR*/;1947sc_Token.CLOSE_PAR = 2/*CLOSE_PAR*/;1948sc_Token.OPEN_BRACE = 3/*OPEN_BRACE*/;1949sc_Token.CLOSE_BRACE = 4/*CLOSE_BRACE*/;1950sc_Token.OPEN_BRACKET = 5/*OPEN_BRACKET*/;1951sc_Token.CLOSE_BRACKET = 6/*CLOSE_BRACKET*/;1952sc_Token.WHITESPACE = 7/*WHITESPACE*/;1953sc_Token.QUOTE = 8/*QUOTE*/;1954sc_Token.ID = 9/*ID*/;1955sc_Token.DOT = 10/*DOT*/;1956sc_Token.STRING = 11/*STRING*/;1957sc_Token.NUMBER = 12/*NUMBER*/;1958sc_Token.ERROR = 13/*ERROR*/;1959sc_Token.VECTOR_BEGIN = 14/*VECTOR_BEGIN*/;1960sc_Token.TRUE = 15/*TRUE*/;1961sc_Token.FALSE = 16/*FALSE*/;1962sc_Token.UNSPECIFIED = 17/*UNSPECIFIED*/;1963sc_Token.REFERENCE = 18/*REFERENCE*/;1964sc_Token.STORE = 19/*STORE*/;1965sc_Token.CHAR = 20/*CHAR*/;1966var SC_ID_CLASS = SC_LOWER_CLASS + SC_UPPER_CLASS + "!$%*+-./:<=>?@^_~";1967function sc_Tokenizer(port) {1968 this.port = port;1969}1970sc_Tokenizer.prototype.peekToken = function() {1971 if (this.peeked)1972 return this.peeked;1973 var newToken = this.nextToken();1974 this.peeked = newToken;1975 return newToken;1976};1977sc_Tokenizer.prototype.readToken = function() {1978 var tmp = this.peekToken();1979 delete this.peeked;1980 return tmp;1981};1982sc_Tokenizer.prototype.nextToken = function() {1983 var port = this.port;1984 1985 function isNumberChar(c) {1986 return (c >= "0" && c <= "9");1987 };1988 function isIdOrNumberChar(c) {1989 return SC_ID_CLASS.indexOf(c) != -1 || // ID-char1990 (c >= "0" && c <= "9");1991 }1992 function isWhitespace(c) {1993 return c === " " || c === "\r" || c === "\n" || c === "\t" || c === "\f";1994 };1995 function isWhitespaceOrEOF(c) {1996 return isWhitespace(c) || c === SC_EOF_OBJECT;1997 };1998 function readString() {1999 res = "";2000 while (true) {2001 var c = port.readChar();2002 switch (c) {2003 case '"':2004 return new sc_Token(11/*STRING*/, res);2005 case "\\":2006 var tmp = port.readChar();2007 switch (tmp) {2008 case '0': res += "\0"; break;2009 case 'a': res += "\a"; break;2010 case 'b': res += "\b"; break;2011 case 'f': res += "\f"; break;2012 case 'n': res += "\n"; break;2013 case 'r': res += "\r"; break;2014 case 't': res += "\t"; break;2015 case 'v': res += "\v"; break;2016 case '"': res += '"'; break;2017 case '\\': res += '\\'; break;2018 case 'x':2019 /* hexa-number */2020 var nb = 0;2021 while (true) {2022 var hexC = port.peekChar();2023 if (hexC >= '0' && hexC <= '9') {2024 port.readChar();2025 nb = nb * 16 + hexC.charCodeAt(0) - '0'.charCodeAt(0);2026 } else if (hexC >= 'a' && hexC <= 'f') {2027 port.readChar();2028 nb = nb * 16 + hexC.charCodeAt(0) - 'a'.charCodeAt(0);2029 } else if (hexC >= 'A' && hexC <= 'F') {2030 port.readChar();2031 nb = nb * 16 + hexC.charCodeAt(0) - 'A'.charCodeAt(0);2032 } else {2033 // next char isn't part of hex.2034 res += String.fromCharCode(nb);2035 break;2036 }2037 }2038 break;2039 default:2040 if (tmp === SC_EOF_OBJECT) {2041 return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);2042 }2043 res += tmp;2044 }2045 break;2046 default:2047 if (c === SC_EOF_OBJECT) {2048 return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);2049 }2050 res += c;2051 }2052 }2053 };2054 function readIdOrNumber(firstChar) {2055 var res = firstChar;2056 while (isIdOrNumberChar(port.peekChar()))2057 res += port.readChar();2058 if (isNaN(res))2059 return new sc_Token(9/*ID*/, res);2060 else2061 return new sc_Token(12/*NUMBER*/, res - 0);2062 };2063 2064 function skipWhitespaceAndComments() {2065 var done = false;2066 while (!done) {2067 done = true;2068 while (isWhitespace(port.peekChar()))2069 port.readChar();2070 if (port.peekChar() === ';') {2071 port.readChar();2072 done = false;2073 while (true) {2074 curChar = port.readChar();2075 if (curChar === SC_EOF_OBJECT ||2076 curChar === '\n')2077 break;2078 }2079 }2080 }2081 };2082 2083 function readDot() {2084 if (isWhitespace(port.peekChar()))2085 return new sc_Token(10/*DOT*/);2086 else2087 return readIdOrNumber(".");2088 };2089 function readSharp() {2090 var c = port.readChar();2091 if (isWhitespace(c))2092 return new sc_Token(13/*ERROR*/, "bad #-pattern0.");2093 // reference2094 if (isNumberChar(c)) {2095 var nb = c - 0;2096 while (isNumberChar(port.peekChar()))2097 nb = nb*10 + (port.readChar() - 0);2098 switch (port.readChar()) {2099 case '#':2100 return new sc_Token(18/*REFERENCE*/, nb);2101 case '=':2102 return new sc_Token(19/*STORE*/, nb);2103 default:2104 return new sc_Token(13/*ERROR*/, "bad #-pattern1." + nb);2105 }2106 }2107 if (c === "(")2108 return new sc_Token(14/*VECTOR_BEGIN*/);2109 2110 if (c === "\\") { // character2111 var tmp = ""2112 while (!isWhitespaceOrEOF(port.peekChar()))2113 tmp += port.readChar();2114 switch (tmp.length) {2115 case 0: // it's escaping a whitespace char:2116 if (sc_isEOFObject(port.peekChar))2117 return new sc_Token(13/*ERROR*/, "bad #-pattern2.");2118 else2119 return new sc_Token(20/*CHAR*/, port.readChar());2120 case 1:2121 return new sc_Token(20/*CHAR*/, tmp);2122 default:2123 var entry = sc_Char.readable2char[tmp.toLowerCase()];2124 if (entry)2125 return new sc_Token(20/*CHAR*/, entry);2126 else2127 return new sc_Token(13/*ERROR*/, "unknown character description: #\\" + tmp);2128 }2129 }2130 // some constants (#t, #f, #unspecified)2131 var res;2132 var needing;2133 switch (c) {2134 case 't': res = new sc_Token(15/*TRUE*/, true); needing = ""; break;2135 case 'f': res = new sc_Token(16/*FALSE*/, false); needing = ""; break;2136 case 'u': res = new sc_Token(17/*UNSPECIFIED*/, undefined); needing = "nspecified"; break;2137 default:2138 return new sc_Token(13/*ERROR*/, "bad #-pattern3: " + c);2139 }2140 while(true) {2141 c = port.peekChar();2142 if ((isWhitespaceOrEOF(c) || c === ')') &&2143 needing == "")2144 return res;2145 else if (isWhitespace(c) || needing == "")2146 return new sc_Token(13/*ERROR*/, "bad #-pattern4 " + c + " " + needing);2147 else if (needing.charAt(0) == c) {2148 port.readChar(); // consume2149 needing = needing.slice(1);2150 } else2151 return new sc_Token(13/*ERROR*/, "bad #-pattern5");2152 }2153 2154 };2155 skipWhitespaceAndComments();2156 var curChar = port.readChar();2157 if (curChar === SC_EOF_OBJECT)2158 return new sc_Token(0/*EOF*/, curChar);2159 switch (curChar)2160 {2161 case " ":2162 case "\n":2163 case "\t":2164 return readWhitespace();2165 case "(":2166 return new sc_Token(1/*OPEN_PAR*/);2167 case ")":2168 return new sc_Token(2/*CLOSE_PAR*/);2169 case "{":2170 return new sc_Token(3/*OPEN_BRACE*/);2171 case "}":2172 return new sc_Token(4/*CLOSE_BRACE*/);2173 case "[":2174 return new sc_Token(5/*OPEN_BRACKET*/);2175 case "]":2176 return new sc_Token(6/*CLOSE_BRACKET*/);2177 case "'":2178 return new sc_Token(8/*QUOTE*/);2179 case "#":2180 return readSharp();2181 case ".":2182 return readDot();2183 case '"':2184 return readString();2185 default:2186 if (isIdOrNumberChar(curChar))2187 return readIdOrNumber(curChar);2188 throw "unexpected character: " + curChar;2189 }2190};2191function sc_Reader(tokenizer) {2192 this.tokenizer = tokenizer;2193 this.backref = new Array();2194}2195sc_Reader.prototype.read = function() {2196 function readList(listBeginType) {2197 function matchesPeer(open, close) {2198 return open === 1/*OPEN_PAR*/ && close === 2/*CLOSE_PAR*/2199 || open === 3/*OPEN_BRACE*/ && close === 4/*CLOSE_BRACE*/2200 || open === 5/*OPEN_BRACKET*/ && close === 6/*CLOSE_BRACKET*/;2201 };2202 var res = null;2203 while (true) {2204 var token = tokenizer.peekToken();2205 2206 switch (token.type) {2207 case 2/*CLOSE_PAR*/:2208 case 4/*CLOSE_BRACE*/:2209 case 6/*CLOSE_BRACKET*/:2210 if (matchesPeer(listBeginType, token.type)) {2211 tokenizer.readToken(); // consume token2212 return sc_reverseBang(res);2213 } else2214 throw "closing par doesn't match: " + listBeginType2215 + " " + listEndType;2216 case 0/*EOF*/:2217 throw "unexpected end of file";2218 case 10/*DOT*/:2219 tokenizer.readToken(); // consume token2220 var cdr = this.read();2221 var par = tokenizer.readToken();2222 if (!matchesPeer(listBeginType, par.type))2223 throw "closing par doesn't match: " + listBeginType2224 + " " + par.type;2225 else2226 return sc_reverseAppendBang(res, cdr);2227 2228 default:2229 res = sc_cons(this.read(), res);2230 }2231 }2232 };2233 function readQuote() {2234 return sc_cons("quote", sc_cons(this.read(), null));2235 };2236 function readVector() {2237 // opening-parenthesis is already consumed2238 var a = new Array();2239 while (true) {2240 var token = tokenizer.peekToken();2241 switch (token.type) {2242 case 2/*CLOSE_PAR*/:2243 tokenizer.readToken();2244 return a;2245 2246 default:2247 a.push(this.read());2248 }2249 }2250 };2251 function storeRefence(nb) {2252 var tmp = this.read();2253 this.backref[nb] = tmp;2254 return tmp;2255 };2256 2257 function readReference(nb) {2258 if (nb in this.backref)2259 return this.backref[nb];2260 else2261 throw "bad reference: " + nb;2262 };2263 2264 var tokenizer = this.tokenizer;2265 var token = tokenizer.readToken();2266 // handle error2267 if (token.type === 13/*ERROR*/)2268 throw token.val;2269 2270 switch (token.type) {2271 case 1/*OPEN_PAR*/:2272 case 3/*OPEN_BRACE*/:2273 case 5/*OPEN_BRACKET*/:2274 return readList.call(this, token.type);2275 case 8/*QUOTE*/:2276 return readQuote.call(this);2277 case 11/*STRING*/:2278 return sc_jsstring2string(token.val);2279 case 20/*CHAR*/:2280 return new sc_Char(token.val);2281 case 14/*VECTOR_BEGIN*/:2282 return readVector.call(this);2283 case 18/*REFERENCE*/:2284 return readReference.call(this, token.val);2285 case 19/*STORE*/:2286 return storeRefence.call(this, token.val);2287 case 9/*ID*/:2288 return sc_jsstring2symbol(token.val);2289 case 0/*EOF*/:2290 case 12/*NUMBER*/:2291 case 15/*TRUE*/:2292 case 16/*FALSE*/:2293 case 17/*UNSPECIFIED*/:2294 return token.val;2295 default:2296 throw "unexpected token " + token.type + " " + token.val;2297 }2298};2299/*** META ((export #t)) */2300function sc_read(port) {2301 if (port === undefined) // we assume the port hasn't been given.2302 port = SC_DEFAULT_IN; // THREAD: shared var...2303 var reader = new sc_Reader(new sc_Tokenizer(port));2304 return reader.read();2305}2306/*** META ((export #t)) */2307function sc_readChar(port) {2308 if (port === undefined) // we assume the port hasn't been given.2309 port = SC_DEFAULT_IN; // THREAD: shared var...2310 var t = port.readChar();2311 return t === SC_EOF_OBJECT? t: new sc_Char(t);2312}2313/*** META ((export #t)) */2314function sc_peekChar(port) {2315 if (port === undefined) // we assume the port hasn't been given.2316 port = SC_DEFAULT_IN; // THREAD: shared var...2317 var t = port.peekChar();2318 return t === SC_EOF_OBJECT? t: new sc_Char(t);2319} 2320/*** META ((export #t)2321 (type bool))2322*/2323function sc_isCharReady(port) {2324 if (port === undefined) // we assume the port hasn't been given.2325 port = SC_DEFAULT_IN; // THREAD: shared var...2326 return port.isCharReady();2327}2328/*** META ((export #t)2329 (peephole (postfix ".close()")))2330*/2331function sc_closeInputPort(p) {2332 return p.close();2333}2334/*** META ((export #t)2335 (type bool)2336 (peephole (postfix " instanceof sc_InputPort")))2337*/2338function sc_isInputPort(o) {2339 return (o instanceof sc_InputPort);2340}2341/*** META ((export eof-object?)2342 (type bool)2343 (peephole (postfix " === SC_EOF_OBJECT")))2344*/2345function sc_isEOFObject(o) {2346 return o === SC_EOF_OBJECT;2347}2348/*** META ((export #t)2349 (peephole (hole 0 "SC_DEFAULT_IN")))2350*/2351function sc_currentInputPort() {2352 return SC_DEFAULT_IN;2353}2354/* ------------ file operations are not supported -----------*/2355/*** META ((export #t)) */2356function sc_callWithInputFile(s, proc) {2357 throw "can't open " + s;2358}2359/*** META ((export #t)) */2360function sc_callWithOutputFile(s, proc) {2361 throw "can't open " + s;2362}2363/*** META ((export #t)) */2364function sc_withInputFromFile(s, thunk) {2365 throw "can't open " + s;2366}2367/*** META ((export #t)) */2368function sc_withOutputToFile(s, thunk) {2369 throw "can't open " + s;2370}2371/*** META ((export #t)) */2372function sc_openInputFile(s) {2373 throw "can't open " + s;2374}2375/*** META ((export #t)) */2376function sc_openOutputFile(s) {2377 throw "can't open " + s;2378}2379/* ----------------------------------------------------------------------------*/2380/*** META ((export #t)) */2381function sc_basename(p) {2382 var i = p.lastIndexOf('/');2383 if(i >= 0)2384 return p.substring(i + 1, p.length);2385 else2386 return '';2387}2388/*** META ((export #t)) */2389function sc_dirname(p) {2390 var i = p.lastIndexOf('/');2391 if(i >= 0)2392 return p.substring(0, i);2393 else2394 return '';2395}2396/* ----------------------------------------------------------------------------*/2397/*** META ((export #t)) */2398function sc_withInputFromPort(p, thunk) {2399 try {2400 var tmp = SC_DEFAULT_IN; // THREAD: shared var.2401 SC_DEFAULT_IN = p;2402 return thunk();2403 } finally {2404 SC_DEFAULT_IN = tmp;2405 }2406}2407/*** META ((export #t)) */2408function sc_withInputFromString(s, thunk) {2409 return sc_withInputFromPort(new sc_StringInputPort(sc_string2jsstring(s)), thunk);2410}2411/*** META ((export #t)) */2412function sc_withOutputToPort(p, thunk) {2413 try {2414 var tmp = SC_DEFAULT_OUT; // THREAD: shared var.2415 SC_DEFAULT_OUT = p;2416 return thunk();2417 } finally {2418 SC_DEFAULT_OUT = tmp;2419 }2420}2421/*** META ((export #t)) */2422function sc_withOutputToString(thunk) {2423 var p = new sc_StringOutputPort();2424 sc_withOutputToPort(p, thunk);2425 return p.close();2426}2427/*** META ((export #t)) */2428function sc_withOutputToProcedure(proc, thunk) {2429 var t = function(s) { proc(sc_jsstring2string(s)); };2430 return sc_withOutputToPort(new sc_GenericOutputPort(t), thunk);2431}2432/*** META ((export #t)2433 (peephole (hole 0 "new sc_StringOutputPort()")))2434*/2435function sc_openOutputString() {2436 return new sc_StringOutputPort();2437}2438/*** META ((export #t)) */2439function sc_openInputString(str) {2440 return new sc_StringInputPort(sc_string2jsstring(str));2441}2442/* ----------------------------------------------------------------------------*/2443function sc_OutputPort() {2444}2445sc_OutputPort.prototype = new sc_Port();2446sc_OutputPort.prototype.appendJSString = function(obj) {2447 /* do nothing */2448}2449sc_OutputPort.prototype.close = function() {2450 /* do nothing */2451}2452function sc_StringOutputPort() {2453 this.res = "";2454}2455sc_StringOutputPort.prototype = new sc_OutputPort();2456sc_StringOutputPort.prototype.appendJSString = function(s) {2457 this.res += s;2458}2459sc_StringOutputPort.prototype.close = function() {2460 return sc_jsstring2string(this.res);2461}2462/*** META ((export #t)) */2463function sc_getOutputString(sp) {2464 return sc_jsstring2string(sp.res);2465}2466 2467function sc_ErrorOutputPort() {2468}2469sc_ErrorOutputPort.prototype = new sc_OutputPort();2470sc_ErrorOutputPort.prototype.appendJSString = function(s) {2471 throw "don't write on ErrorPort!";2472}2473sc_ErrorOutputPort.prototype.close = function() {2474 /* do nothing */2475}2476function sc_GenericOutputPort(appendJSString, close) {2477 this.appendJSString = appendJSString;2478 if (close)2479 this.close = close;2480}2481sc_GenericOutputPort.prototype = new sc_OutputPort();2482/*** META ((export #t)2483 (type bool)2484 (peephole (postfix " instanceof sc_OutputPort")))2485*/2486function sc_isOutputPort(o) {2487 return (o instanceof sc_OutputPort);2488}2489/*** META ((export #t)2490 (peephole (postfix ".close()")))2491*/2492function sc_closeOutputPort(p) {2493 return p.close();2494}2495/* ------------------ write ---------------------------------------------------*/2496/*** META ((export #t)) */2497function sc_write(o, p) {2498 if (p === undefined) // we assume not given2499 p = SC_DEFAULT_OUT;2500 p.appendJSString(sc_toWriteString(o));2501}2502function sc_toWriteString(o) {2503 if (o === null)2504 return "()";2505 else if (o === true)2506 return "#t";2507 else if (o === false)2508 return "#f";2509 else if (o === undefined)2510 return "#unspecified";2511 else if (typeof o === 'function')2512 return "#<procedure " + sc_hash(o) + ">";2513 else if (o.sc_toWriteString)2514 return o.sc_toWriteString();2515 else2516 return o.toString();2517}2518function sc_escapeWriteString(s) {2519 var res = "";2520 var j = 0;2521 for (i = 0; i < s.length; i++) {2522 switch (s.charAt(i)) {2523 case "\0": res += s.substring(j, i) + "\\0"; j = i + 1; break;2524 case "\b": res += s.substring(j, i) + "\\b"; j = i + 1; break;2525 case "\f": res += s.substring(j, i) + "\\f"; j = i + 1; break;2526 case "\n": res += s.substring(j, i) + "\\n"; j = i + 1; break;2527 case "\r": res += s.substring(j, i) + "\\r"; j = i + 1; break;2528 case "\t": res += s.substring(j, i) + "\\t"; j = i + 1; break;2529 case "\v": res += s.substring(j, i) + "\\v"; j = i + 1; break;2530 case '"': res += s.substring(j, i) + '\\"'; j = i + 1; break;2531 case "\\": res += s.substring(j, i) + "\\\\"; j = i + 1; break;2532 default:2533 var c = s.charAt(i);2534 if ("\a" !== "a" && c == "\a") {2535 res += s.substring(j, i) + "\\a"; j = i + 1; continue;2536 }2537 if ("\v" !== "v" && c == "\v") {2538 res += s.substring(j, i) + "\\v"; j = i + 1; continue;2539 }2540 //if (s.charAt(i) < ' ' || s.charCodeAt(i) > 127) {2541 // CARE: Manuel is this OK with HOP?2542 if (s.charAt(i) < ' ') {2543 /* non printable character and special chars */2544 res += s.substring(j, i) + "\\x" + s.charCodeAt(i).toString(16);2545 j = i + 1;2546 }2547 // else just let i increase...2548 }2549 }2550 res += s.substring(j, i);2551 return res;2552}2553/* ------------------ display ---------------------------------------------------*/2554/*** META ((export #t)) */2555function sc_display(o, p) {2556 if (p === undefined) // we assume not given2557 p = SC_DEFAULT_OUT;2558 p.appendJSString(sc_toDisplayString(o));2559}2560function sc_toDisplayString(o) {2561 if (o === null)2562 return "()";2563 else if (o === true)2564 return "#t";2565 else if (o === false)2566 return "#f";2567 else if (o === undefined)2568 return "#unspecified";2569 else if (typeof o === 'function')2570 return "#<procedure " + sc_hash(o) + ">";2571 else if (o.sc_toDisplayString)2572 return o.sc_toDisplayString();2573 else2574 return o.toString();2575}2576/* ------------------ newline ---------------------------------------------------*/2577/*** META ((export #t)) */2578function sc_newline(p) {2579 if (p === undefined) // we assume not given2580 p = SC_DEFAULT_OUT;2581 p.appendJSString("\n");2582}2583 2584/* ------------------ write-char ---------------------------------------------------*/2585/*** META ((export #t)) */2586function sc_writeChar(c, p) {2587 if (p === undefined) // we assume not given2588 p = SC_DEFAULT_OUT;2589 p.appendJSString(c.val);2590}2591/* ------------------ write-circle ---------------------------------------------------*/2592/*** META ((export #t)) */2593function sc_writeCircle(o, p) {2594 if (p === undefined) // we assume not given2595 p = SC_DEFAULT_OUT;2596 p.appendJSString(sc_toWriteCircleString(o));2597}2598function sc_toWriteCircleString(o) {2599 var symb = sc_gensym("writeCircle");2600 var nbPointer = new Object();2601 nbPointer.nb = 0;2602 sc_prepWriteCircle(o, symb, nbPointer);2603 return sc_genToWriteCircleString(o, symb);2604}2605function sc_prepWriteCircle(o, symb, nbPointer) {2606 // TODO sc_Struct2607 if (o instanceof sc_Pair ||2608 o instanceof sc_Vector) {2609 if (o[symb] !== undefined) {2610 // not the first visit.2611 o[symb]++;2612 // unless there is already a number, assign one.2613 if (!o[symb + "nb"]) o[symb + "nb"] = nbPointer.nb++;2614 return;2615 }2616 o[symb] = 0;2617 if (o instanceof sc_Pair) {2618 sc_prepWriteCircle(o.car, symb, nbPointer);2619 sc_prepWriteCircle(o.cdr, symb, nbPointer);2620 } else {2621 for (var i = 0; i < o.length; i++)2622 sc_prepWriteCircle(o[i], symb, nbPointer);2623 }2624 }2625}2626function sc_genToWriteCircleString(o, symb) {2627 if (!(o instanceof sc_Pair ||2628 o instanceof sc_Vector))2629 return sc_toWriteString(o);2630 return o.sc_toWriteCircleString(symb);2631}2632sc_Pair.prototype.sc_toWriteCircleString = function(symb, inList) {2633 if (this[symb + "use"]) { // use-flag is set. Just use it.2634 var nb = this[symb + "nb"];2635 if (this[symb]-- === 0) { // if we are the last use. remove all fields.2636 delete this[symb];2637 delete this[symb + "nb"];2638 delete this[symb + "use"];2639 }2640 if (inList)2641 return '. #' + nb + '#';2642 else2643 return '#' + nb + '#';2644 }2645 if (this[symb]-- === 0) { // if we are the last use. remove all fields.2646 delete this[symb];2647 delete this[symb + "nb"];2648 delete this[symb + "use"];2649 }2650 var res = "";2651 2652 if (this[symb] !== undefined) { // implies > 02653 this[symb + "use"] = true;2654 if (inList)2655 res += '. #' + this[symb + "nb"] + '=';2656 else2657 res += '#' + this[symb + "nb"] + '=';2658 inList = false;2659 }2660 if (!inList)2661 res += "(";2662 2663 // print car2664 res += sc_genToWriteCircleString(this.car, symb);2665 2666 if (sc_isPair(this.cdr)) {2667 res += " " + this.cdr.sc_toWriteCircleString(symb, true);2668 } else if (this.cdr !== null) {2669 res += " . " + sc_genToWriteCircleString(this.cdr, symb);2670 }2671 if (!inList)2672 res += ")";2673 return res;2674};2675sc_Vector.prototype.sc_toWriteCircleString = function(symb) {2676 if (this[symb + "use"]) { // use-flag is set. Just use it.2677 var nb = this[symb + "nb"];2678 if (this[symb]-- === 0) { // if we are the last use. remove all fields.2679 delete this[symb];2680 delete this[symb + "nb"];2681 delete this[symb + "use"];2682 }2683 return '#' + nb + '#';2684 }2685 if (this[symb]-- === 0) { // if we are the last use. remove all fields.2686 delete this[symb];2687 delete this[symb + "nb"];2688 delete this[symb + "use"];2689 }2690 var res = "";2691 if (this[symb] !== undefined) { // implies > 02692 this[symb + "use"] = true;2693 res += '#' + this[symb + "nb"] + '=';2694 }2695 res += "#(";2696 for (var i = 0; i < this.length; i++) {2697 res += sc_genToWriteCircleString(this[i], symb);2698 if (i < this.length - 1) res += " ";2699 }2700 res += ")";2701 return res;2702};2703/* ------------------ print ---------------------------------------------------*/2704/*** META ((export #t)) */2705function sc_print(s) {2706 if (arguments.length === 1) {2707 sc_display(s);2708 sc_newline();2709 }2710 else {2711 for (var i = 0; i < arguments.length; i++)2712 sc_display(arguments[i]);2713 sc_newline();2714 }2715}2716/* ------------------ format ---------------------------------------------------*/2717/*** META ((export #t)) */2718function sc_format(s, args) {2719 var len = s.length;2720 var p = new sc_StringOutputPort();2721 var i = 0, j = 1;2722 while( i < len ) {2723 var i2 = s.indexOf("~", i);2724 if (i2 == -1) {2725 p.appendJSString( s.substring( i, len ) );2726 return p.close();2727 } else {2728 if (i2 > i) {2729 if (i2 == (len - 1)) {2730 p.appendJSString(s.substring(i, len));2731 return p.close();2732 } else {2733 p.appendJSString(s.substring(i, i2));2734 i = i2;2735 }2736 }2737 switch(s.charCodeAt(i2 + 1)) {2738 case 65:2739 case 97:2740 // a2741 sc_display(arguments[j], p);2742 i += 2; j++;2743 break;2744 case 83:2745 case 115:2746 // s2747 sc_write(arguments[j], p);2748 i += 2; j++;2749 break;2750 case 86:2751 case 118:2752 // v2753 sc_display(arguments[j], p);2754 p.appendJSString("\n");2755 i += 2; j++;2756 break;2757 case 67:2758 case 99:2759 // c2760 p.appendJSString(String.fromCharCode(arguments[j]));2761 i += 2; j++;2762 break;2763 case 88:2764 case 120:2765 // x2766 p.appendJSString(arguments[j].toString(6));2767 i += 2; j++;2768 break;2769 case 79:2770 case 111:2771 // o2772 p.appendJSString(arguments[j].toString(8));2773 i += 2; j++;2774 break;2775 case 66:2776 case 98:2777 // b2778 p.appendJSString(arguments[j].toString(2));2779 i += 2; j++;2780 break;2781 2782 case 37:2783 case 110:2784 // %, n2785 p.appendJSString("\n");2786 i += 2; break;2787 case 114:2788 // r2789 p.appendJSString("\r");2790 i += 2; break;2791 case 126:2792 // ~2793 p.appendJSString("~");2794 i += 2; break;2795 default:2796 sc_error( "format: illegal ~"2797 + String.fromCharCode(s.charCodeAt(i2 + 1))2798 + " sequence" );2799 return "";2800 }2801 }2802 }2803 return p.close();2804}2805/* ------------------ global ports ---------------------------------------------------*/2806var SC_DEFAULT_IN = new sc_ErrorInputPort();2807var SC_DEFAULT_OUT = new sc_ErrorOutputPort();2808var SC_ERROR_OUT = new sc_ErrorOutputPort();2809var sc_SYMBOL_PREFIX = "\u1E9C";2810var sc_KEYWORD_PREFIX = "\u1E9D";2811/*** META ((export #t)2812 (peephole (id))) */2813function sc_jsstring2string(s) {2814 return s;2815}2816/*** META ((export #t)2817 (peephole (prefix "'\\u1E9C' +")))2818*/2819function sc_jsstring2symbol(s) {2820 return sc_SYMBOL_PREFIX + s;2821}2822/*** META ((export #t)2823 (peephole (id)))2824*/2825function sc_string2jsstring(s) {2826 return s;2827}2828/*** META ((export #t)2829 (peephole (symbol2jsstring_immutable)))2830*/2831function sc_symbol2jsstring(s) {2832 return s.slice(1);2833}2834/*** META ((export #t)2835 (peephole (postfix ".slice(1)")))2836*/2837function sc_keyword2jsstring(k) {2838 return k.slice(1);2839}2840/*** META ((export #t)2841 (peephole (prefix "'\\u1E9D' +")))2842*/2843function sc_jsstring2keyword(s) {2844 return sc_KEYWORD_PREFIX + s;2845}2846/*** META ((export #t)2847 (type bool))2848*/2849function sc_isKeyword(s) {2850 return (typeof s === "string") &&2851 (s.charAt(0) === sc_KEYWORD_PREFIX);2852}2853/*** META ((export #t)) */2854var sc_gensym = function() {2855 var counter = 1000;2856 return function(sym) {2857 counter++;2858 if (!sym) sym = sc_SYMBOL_PREFIX;2859 return sym + "s" + counter + "~" + "^sC-GeNsYm ";2860 };2861}();2862/*** META ((export #t)2863 (type bool))2864*/2865function sc_isEqual(o1, o2) {2866 return ((o1 === o2) ||2867 (sc_isPair(o1) && sc_isPair(o2)2868 && sc_isPairEqual(o1, o2, sc_isEqual)) ||2869 (sc_isVector(o1) && sc_isVector(o2)2870 && sc_isVectorEqual(o1, o2, sc_isEqual)));2871}2872/*** META ((export number->symbol integer->symbol)) */2873function sc_number2symbol(x, radix) {2874 return sc_SYMBOL_PREFIX + sc_number2jsstring(x, radix);2875}2876 2877/*** META ((export number->string integer->string)) */2878var sc_number2string = sc_number2jsstring;2879/*** META ((export #t)) */2880function sc_symbol2number(s, radix) {2881 return sc_jsstring2number(s.slice(1), radix);2882}2883/*** META ((export #t)) */2884var sc_string2number = sc_jsstring2number;2885/*** META ((export #t)2886 (peephole (prefix "+" s)))2887 ;; peephole will only apply if no radix is given.2888*/2889function sc_string2integer(s, radix) {2890 if (!radix) return +s;2891 return parseInt(s, radix);2892}2893/*** META ((export #t)2894 (peephole (prefix "+")))2895*/2896function sc_string2real(s) {2897 return +s;2898}2899/*** META ((export #t)2900 (type bool))2901*/2902function sc_isSymbol(s) {2903 return (typeof s === "string") &&2904 (s.charAt(0) === sc_SYMBOL_PREFIX);2905}2906/*** META ((export #t)2907 (peephole (symbol2string_immutable)))2908*/2909function sc_symbol2string(s) {2910 return s.slice(1);2911}2912/*** META ((export #t)2913 (peephole (prefix "'\\u1E9C' +")))2914*/2915function sc_string2symbol(s) {2916 return sc_SYMBOL_PREFIX + s;2917}2918/*** META ((export symbol-append)2919 (peephole (symbolAppend_immutable)))2920*/2921function sc_symbolAppend() {2922 var res = sc_SYMBOL_PREFIX;2923 for (var i = 0; i < arguments.length; i++)2924 res += arguments[i].slice(1);2925 return res;2926}2927/*** META ((export #t)2928 (peephole (postfix ".val")))2929*/2930function sc_char2string(c) { return c.val; }2931/*** META ((export #t)2932 (peephole (hole 1 "'\\u1E9C' + " c ".val")))2933*/2934function sc_char2symbol(c) { return sc_SYMBOL_PREFIX + c.val; }2935/*** META ((export #t)2936 (type bool))2937*/2938function sc_isString(s) {2939 return (typeof s === "string") &&2940 (s.charAt(0) !== sc_SYMBOL_PREFIX);2941}2942/*** META ((export #t)) */2943var sc_makeString = sc_makejsString;2944/*** META ((export #t)) */2945function sc_string() {2946 for (var i = 0; i < arguments.length; i++)2947 arguments[i] = arguments[i].val;2948 return "".concat.apply("", arguments);2949}2950/*** META ((export #t)2951 (peephole (postfix ".length")))2952*/2953function sc_stringLength(s) { return s.length; }2954/*** META ((export #t)) */2955function sc_stringRef(s, k) {2956 return new sc_Char(s.charAt(k));2957}2958/* there's no stringSet in the immutable version2959function sc_stringSet(s, k, c)2960*/2961/*** META ((export string=?)2962 (type bool)2963 (peephole (hole 2 str1 " === " str2)))2964*/2965function sc_isStringEqual(s1, s2) {2966 return s1 === s2;2967}2968/*** META ((export string<?)2969 (type bool)2970 (peephole (hole 2 str1 " < " str2)))2971*/2972function sc_isStringLess(s1, s2) {2973 return s1 < s2;2974}2975/*** META ((export string>?)2976 (type bool)2977 (peephole (hole 2 str1 " > " str2)))2978*/2979function sc_isStringGreater(s1, s2) {2980 return s1 > s2;2981}2982/*** META ((export string<=?)2983 (type bool)2984 (peephole (hole 2 str1 " <= " str2)))2985*/2986function sc_isStringLessEqual(s1, s2) {2987 return s1 <= s2;2988}2989/*** META ((export string>=?)2990 (type bool)2991 (peephole (hole 2 str1 " >= " str2)))2992*/2993function sc_isStringGreaterEqual(s1, s2) {2994 return s1 >= s2;2995}2996/*** META ((export string-ci=?)2997 (type bool)2998 (peephole (hole 2 str1 ".toLowerCase() === " str2 ".toLowerCase()")))2999*/3000function sc_isStringCIEqual(s1, s2) {3001 return s1.toLowerCase() === s2.toLowerCase();3002}3003/*** META ((export string-ci<?)3004 (type bool)3005 (peephole (hole 2 str1 ".toLowerCase() < " str2 ".toLowerCase()")))3006*/3007function sc_isStringCILess(s1, s2) {3008 return s1.toLowerCase() < s2.toLowerCase();3009}3010/*** META ((export string-ci>?)3011 (type bool)3012 (peephole (hole 2 str1 ".toLowerCase() > " str2 ".toLowerCase()")))3013*/3014function sc_isStringCIGreater(s1, s2) {3015 return s1.toLowerCase() > s2.toLowerCase();3016}3017/*** META ((export string-ci<=?)3018 (type bool)3019 (peephole (hole 2 str1 ".toLowerCase() <= " str2 ".toLowerCase()")))3020*/3021function sc_isStringCILessEqual(s1, s2) {3022 return s1.toLowerCase() <= s2.toLowerCase();3023}3024/*** META ((export string-ci>=?)3025 (type bool)3026 (peephole (hole 2 str1 ".toLowerCase() >= " str2 ".toLowerCase()")))3027*/3028function sc_isStringCIGreaterEqual(s1, s2) {3029 return s1.toLowerCase() >= s2.toLowerCase();3030}3031/*** META ((export #t)3032 (peephole (hole 3 s ".substring(" start ", " end ")")))3033*/3034function sc_substring(s, start, end) {3035 return s.substring(start, end);3036}3037/*** META ((export #t))3038*/3039function sc_isSubstring_at(s1, s2, i) {3040 return s2 == s1.substring(i, i+ s2.length);3041}3042/*** META ((export #t)3043 (peephole (infix 0 #f "+" "''")))3044*/3045function sc_stringAppend() {3046 return "".concat.apply("", arguments);3047}3048/*** META ((export #t)) */3049var sc_string2list = sc_jsstring2list;3050/*** META ((export #t)) */3051var sc_list2string = sc_list2jsstring;3052/*** META ((export #t)3053 (peephole (id)))3054*/3055function sc_stringCopy(s) {3056 return s;3057}3058/* there's no string-fill in the immutable version3059function sc_stringFill(s, c)3060*/3061/*** META ((export #t)3062 (peephole (postfix ".slice(1)")))3063*/3064function sc_keyword2string(o) {3065 return o.slice(1);3066}3067/*** META ((export #t)3068 (peephole (prefix "'\\u1E9D' +")))3069*/3070function sc_string2keyword(o) {3071 return sc_KEYWORD_PREFIX + o;3072}3073String.prototype.sc_toDisplayString = function() {3074 if (this.charAt(0) === sc_SYMBOL_PREFIX)3075 // TODO: care for symbols with spaces (escape-chars symbols).3076 return this.slice(1);3077 else if (this.charAt(0) === sc_KEYWORD_PREFIX)3078 return ":" + this.slice(1);3079 else3080 return this.toString();3081};3082String.prototype.sc_toWriteString = function() {3083 if (this.charAt(0) === sc_SYMBOL_PREFIX)3084 // TODO: care for symbols with spaces (escape-chars symbols).3085 return this.slice(1);3086 else if (this.charAt(0) === sc_KEYWORD_PREFIX)3087 return ":" + this.slice(1);3088 else3089 return '"' + sc_escapeWriteString(this) + '"';3090};3091/* Exported Variables */3092var BgL_testzd2boyerzd2;3093var BgL_nboyerzd2benchmarkzd2;3094var BgL_setupzd2boyerzd2;3095/* End Exports */3096var translate_term_nboyer;3097var translate_args_nboyer;3098var untranslate_term_nboyer;3099var BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer;3100var BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer;3101var translate_alist_nboyer;3102var apply_subst_nboyer;3103var apply_subst_lst_nboyer;3104var tautologyp_nboyer;3105var if_constructor_nboyer;3106var rewrite_count_nboyer;3107var rewrite_nboyer;3108var rewrite_args_nboyer;3109var unify_subst_nboyer;3110var one_way_unify1_nboyer;3111var false_term_nboyer;3112var true_term_nboyer;3113var trans_of_implies1_nboyer;3114var is_term_equal_nboyer;3115var is_term_member_nboyer;3116var const_nboyer;3117var sc_const_3_nboyer;3118var sc_const_4_nboyer;3119{3120 (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)))))));3121 (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))))))));3122 (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)))))))))));3123 BgL_nboyerzd2benchmarkzd2 = function() {3124 var args = null;3125 for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {3126 args = sc_cons(arguments[sc_tmp], args);3127 }3128 var n;3129 return ((n = ((args === null)?(0):(args.car))), (BgL_setupzd2boyerzd2()), (BgL_runzd2benchmarkzd2(("nboyer"+(sc_number2string(n))), (1), function() {3130 return (BgL_testzd2boyerzd2(n));3131 }, function(rewrites) {3132 if ((sc_isNumber(rewrites)))3133 switch (n) {3134 case (0):3135 return (rewrites===(95024));3136 break;3137 case (1):3138 return (rewrites===(591777));3139 break;3140 case (2):3141 return (rewrites===(1813975));3142 break;3143 case (3):3144 return (rewrites===(5375678));3145 break;3146 case (4):3147 return (rewrites===(16445406));3148 break;3149 case (5):3150 return (rewrites===(51507739));3151 break;3152 default:3153 return true;3154 break;3155 }3156 else3157 return false;3158 })));3159 };3160 BgL_setupzd2boyerzd2 = function() {3161 return true;3162 };3163 BgL_testzd2boyerzd2 = function() {3164 return true;3165 };3166 translate_term_nboyer = function(term) {3167 var lst;3168 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))))))))));3169 };3170 translate_args_nboyer = function(lst) {3171 var sc_lst_5;3172 var term;3173 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))))))))));3174 };3175 untranslate_term_nboyer = function(term) {3176 var optrOpnd;3177 var tail1131;3178 var L1127;3179 var falseHead1130;3180 var symbol_record;3181 if (!(term instanceof sc_Pair))3182 return term;3183 else3184 {3185 (falseHead1130 = (new sc_Pair(null, null)));3186 (L1127 = (term.cdr));3187 (tail1131 = falseHead1130);3188 while (!(L1127 === null)) {3189 {3190 (tail1131.cdr = (new sc_Pair((untranslate_term_nboyer((L1127.car))), null)));3191 (tail1131 = (tail1131.cdr));3192 (L1127 = (L1127.cdr));3193 }3194 }3195 (optrOpnd = (falseHead1130.cdr));3196 return (new sc_Pair(((symbol_record = (term.car)), (symbol_record[(0)])), optrOpnd));3197 }3198 };3199 BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer = function(sym) {3200 var r;3201 var x;3202 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)));3203 };3204 (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);3205 translate_alist_nboyer = function(alist) {3206 var sc_alist_6;3207 var term;3208 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))))))))));3209 };3210 apply_subst_nboyer = function(alist, term) {3211 var lst;3212 var temp_temp;3213 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))))))))));3214 };3215 apply_subst_lst_nboyer = function(alist, lst) {3216 var sc_lst_7;3217 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))))))))));3218 };3219 tautologyp_nboyer = function(sc_x_11, true_lst, false_lst) {3220 var tmp1125;3221 var x;3222 var tmp1126;3223 var sc_x_8;3224 var sc_tmp1125_9;3225 var sc_tmp1126_10;3226 var sc_x_11;3227 var true_lst;3228 var false_lst;3229 while (true) {3230 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))3231 return true;3232 else3233 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))3234 return false;3235 else3236 if (!(sc_x_11 instanceof sc_Pair))3237 return false;3238 else3239 if (((sc_x_11.car)===if_constructor_nboyer))3240 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))3241 (sc_x_11 = (sc_x_11.cdr.cdr.car));3242 else3243 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))3244 (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));3245 else3246 if (((tautologyp_nboyer((sc_x_11.cdr.cdr.car), (new sc_Pair((sc_x_11.cdr.car), true_lst)), false_lst))!== false))3247 {3248 (false_lst = (new sc_Pair((sc_x_11.cdr.car), false_lst)));3249 (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));3250 }3251 else3252 return false;3253 else3254 return false;3255 }3256 };3257 (if_constructor_nboyer = "\u1E9C*");3258 (rewrite_count_nboyer = (0));3259 rewrite_nboyer = function(term) {3260 var term2;3261 var sc_term_12;3262 var lst;3263 var symbol_record;3264 var sc_lst_13;3265 {3266 (++rewrite_count_nboyer);3267 if (!(term instanceof sc_Pair))3268 return term;3269 else3270 {3271 (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))))))))));3272 (lst = ((symbol_record = (term.car)), (symbol_record[(1)])));3273 while (true) {3274 if ((lst === null))3275 return sc_term_12;3276 else3277 if ((((term2 = ((lst.car).cdr.car)), (unify_subst_nboyer = null), (one_way_unify1_nboyer(sc_term_12, term2)))!== false))3278 return (rewrite_nboyer((apply_subst_nboyer(unify_subst_nboyer, ((lst.car).cdr.cdr.car)))));3279 else3280 (lst = (lst.cdr));3281 }3282 }3283 }3284 };3285 rewrite_args_nboyer = function(lst) {3286 var sc_lst_14;3287 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))))))))));3288 };3289 (unify_subst_nboyer = "\u1E9C*");3290 one_way_unify1_nboyer = function(term1, term2) {3291 var lst1;3292 var lst2;3293 var temp_temp;3294 if (!(term2 instanceof sc_Pair))3295 {3296 (temp_temp = (sc_assq(term2, unify_subst_nboyer)));3297 if ((temp_temp!== false))3298 return (is_term_equal_nboyer(term1, (temp_temp.cdr)));3299 else3300 if ((sc_isNumber(term2)))3301 return (sc_isEqual(term1, term2));3302 else3303 {3304 (unify_subst_nboyer = (new sc_Pair((new sc_Pair(term2, term1)), unify_subst_nboyer)));3305 return true;3306 }3307 }3308 else3309 if (!(term1 instanceof sc_Pair))3310 return false;3311 else3312 if (((term1.car)===(term2.car)))3313 {3314 (lst1 = (term1.cdr));3315 (lst2 = (term2.cdr));3316 while (true) {3317 if ((lst1 === null))3318 return (lst2 === null);3319 else3320 if ((lst2 === null))3321 return false;3322 else3323 if (((one_way_unify1_nboyer((lst1.car), (lst2.car)))!== false))3324 {3325 (lst1 = (lst1.cdr));3326 (lst2 = (lst2.cdr));3327 }3328 else3329 return false;3330 }3331 }3332 else3333 return false;3334 };3335 (false_term_nboyer = "\u1E9C*");3336 (true_term_nboyer = "\u1E9C*");3337 trans_of_implies1_nboyer = function(n) {3338 var sc_n_15;3339 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)))))))))));3340 };3341 is_term_equal_nboyer = function(x, y) {3342 var lst1;3343 var lst2;3344 var r2;3345 var r1;3346 if ((x instanceof sc_Pair))3347 if ((y instanceof sc_Pair))3348 if ((((r1 = (x.car)), (r2 = (y.car)), (r1===r2))!== false))3349 {3350 (lst1 = (x.cdr));3351 (lst2 = (y.cdr));3352 while (true) {3353 if ((lst1 === null))3354 return (lst2 === null);3355 else3356 if ((lst2 === null))3357 return false;3358 else3359 if (((is_term_equal_nboyer((lst1.car), (lst2.car)))!== false))3360 {3361 (lst1 = (lst1.cdr));3362 (lst2 = (lst2.cdr));3363 }3364 else3365 return false;3366 }3367 }3368 else3369 return false;3370 else3371 return false;3372 else3373 return (sc_isEqual(x, y));3374 };3375 is_term_member_nboyer = function(x, lst) {3376 var x;3377 var lst;3378 while (true) {3379 if ((lst === null))3380 return false;3381 else3382 if (((is_term_equal_nboyer(x, (lst.car)))!== false))3383 return true;3384 else3385 (lst = (lst.cdr));3386 }3387 };3388 BgL_setupzd2boyerzd2 = function() {3389 var symbol_record;3390 var value;3391 var BgL_sc_symbolzd2record_16zd2;3392 var sym;3393 var sc_sym_17;3394 var term;3395 var lst;3396 var sc_term_18;3397 var sc_term_19;3398 {3399 (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);3400 (if_constructor_nboyer = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer("\u1E9Cif")));3401 (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))))))));3402 (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))))))));3403 (lst = sc_const_3_nboyer);3404 while (!(lst === null)) {3405 {3406 (term = (lst.car));3407 if (((term instanceof sc_Pair)&&(((term.car)==="\u1E9Cequal")&&((term.cdr.car) instanceof sc_Pair))))3408 {3409 (sc_sym_17 = ((term.cdr.car).car));3410 (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)])))));3411 (symbol_record = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sc_sym_17)));3412 (symbol_record[(1)] = value);3413 }3414 else3415 (sc_error("ADD-LEMMA did not like term: ", term));3416 (lst = (lst.cdr));3417 }3418 }3419 return true;3420 }3421 };3422 BgL_testzd2boyerzd2 = function(n) {3423 var optrOpnd;3424 var term;3425 var sc_n_20;3426 var answer;3427 var sc_term_21;3428 var sc_term_22;3429 {3430 (rewrite_count_nboyer = (0));3431 (term = sc_const_4_nboyer);3432 (sc_n_20 = n);3433 while (!(sc_n_20=== 0)) {3434 {3435 (term = (sc_list("\u1E9Cor", term, (new sc_Pair("\u1E9Cf",null)))));3436 (--sc_n_20);3437 }3438 }3439 (sc_term_22 = term);3440 if (!(sc_term_22 instanceof sc_Pair))3441 (optrOpnd = sc_term_22);3442 else3443 (optrOpnd = (new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_22.car))), (translate_args_nboyer((sc_term_22.cdr))))));3444 (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)));3445 (answer = (tautologyp_nboyer((rewrite_nboyer(sc_term_21)), null, null)));3446 (sc_write(rewrite_count_nboyer));3447 (sc_display(" rewrites"));3448 (sc_newline());3449 if ((answer!== false))3450 return rewrite_count_nboyer;3451 else3452 return false;3453 }3454 };3455}3456/* Exported Variables */3457var BgL_parsezd2ze3nbzd2treesze3;3458var BgL_earleyzd2benchmarkzd2;3459var BgL_parsezd2ze3parsedzf3zc2;3460var test;3461var BgL_parsezd2ze3treesz31;3462var BgL_makezd2parserzd2;3463/* End Exports */3464var const_earley;3465{3466 (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)));3467 BgL_makezd2parserzd2 = function(grammar, lexer) {3468 var i;3469 var parser_descr;3470 var def_loop;3471 var nb_nts;3472 var names;3473 var steps;3474 var predictors;3475 var enders;3476 var starters;3477 var nts;3478 var sc_names_1;3479 var sc_steps_2;3480 var sc_predictors_3;3481 var sc_enders_4;3482 var sc_starters_5;3483 var nb_confs;3484 var BgL_sc_defzd2loop_6zd2;3485 var BgL_sc_nbzd2nts_7zd2;3486 var sc_nts_8;3487 var BgL_sc_defzd2loop_9zd2;3488 var ind;3489 {3490 ind = function(nt, sc_nts_10) {3491 var i;3492 {3493 (i = ((sc_nts_10.length)-(1)));3494 while (true) {3495 if ((i>=(0)))3496 if ((sc_isEqual((sc_nts_10[i]), nt)))3497 return i;3498 else3499 (--i);3500 else3501 return false;3502 }3503 }3504 };3505 (sc_nts_8 = ((BgL_sc_defzd2loop_9zd2 = function(defs, sc_nts_11) {3506 var rule_loop;3507 var head;3508 var def;3509 return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, sc_nts_12) {3510 var nt;3511 var l;3512 var sc_nts_13;3513 var rule;3514 if ((rules instanceof sc_Pair))3515 {3516 (rule = (rules.car));3517 (l = rule);3518 (sc_nts_13 = sc_nts_12);3519 while ((l instanceof sc_Pair)) {3520 {3521 (nt = (l.car));3522 (l = (l.cdr));3523 (sc_nts_13 = (((sc_member(nt, sc_nts_13))!== false)?sc_nts_13:(new sc_Pair(nt, sc_nts_13))));3524 }3525 }3526 return (rule_loop((rules.cdr), sc_nts_13));3527 }3528 else3529 return (BgL_sc_defzd2loop_9zd2((defs.cdr), sc_nts_12));3530 }), (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)))));3531 }), (BgL_sc_defzd2loop_9zd2(grammar, null))));3532 (BgL_sc_nbzd2nts_7zd2 = (sc_nts_8.length));3533 (nb_confs = (((BgL_sc_defzd2loop_6zd2 = function(defs, BgL_sc_nbzd2confs_14zd2) {3534 var rule_loop;3535 var def;3536 return ((defs instanceof sc_Pair)?((def = (defs.car)), (rule_loop = function(rules, BgL_sc_nbzd2confs_15zd2) {3537 var l;3538 var BgL_sc_nbzd2confs_16zd2;3539 var rule;3540 if ((rules instanceof sc_Pair))3541 {3542 (rule = (rules.car));3543 (l = rule);3544 (BgL_sc_nbzd2confs_16zd2 = BgL_sc_nbzd2confs_15zd2);3545 while ((l instanceof sc_Pair)) {3546 {3547 (l = (l.cdr));3548 (++BgL_sc_nbzd2confs_16zd2);3549 }3550 }3551 return (rule_loop((rules.cdr), (BgL_sc_nbzd2confs_16zd2+(1))));3552 }3553 else3554 return (BgL_sc_defzd2loop_6zd2((defs.cdr), BgL_sc_nbzd2confs_15zd2));3555 }), (rule_loop((def.cdr), BgL_sc_nbzd2confs_14zd2))):BgL_sc_nbzd2confs_14zd2);3556 }), (BgL_sc_defzd2loop_6zd2(grammar, (0))))+BgL_sc_nbzd2nts_7zd2));3557 (sc_starters_5 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));3558 (sc_enders_4 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));3559 (sc_predictors_3 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));3560 (sc_steps_2 = (sc_makeVector(nb_confs, false)));3561 (sc_names_1 = (sc_makeVector(nb_confs, false)));3562 (nts = sc_nts_8);3563 (starters = sc_starters_5);3564 (enders = sc_enders_4);3565 (predictors = sc_predictors_3);3566 (steps = sc_steps_2);3567 (names = sc_names_1);3568 (nb_nts = (sc_nts_8.length));3569 (i = (nb_nts-(1)));3570 while ((i>=(0))) {3571 {3572 (sc_steps_2[i] = (i-nb_nts));3573 (sc_names_1[i] = (sc_list((sc_nts_8[i]), (0))));3574 (sc_enders_4[i] = (sc_list(i)));3575 (--i);3576 }3577 }3578 def_loop = function(defs, conf) {3579 var rule_loop;3580 var head;3581 var def;3582 return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, conf, rule_num) {3583 var i;3584 var sc_i_17;3585 var nt;3586 var l;3587 var sc_conf_18;3588 var sc_i_19;3589 var rule;3590 if ((rules instanceof sc_Pair))3591 {3592 (rule = (rules.car));3593 (names[conf] = (sc_list(head, rule_num)));3594 (sc_i_19 = (ind(head, nts)));3595 (starters[sc_i_19] = (new sc_Pair(conf, (starters[sc_i_19]))));3596 (l = rule);3597 (sc_conf_18 = conf);3598 while ((l instanceof sc_Pair)) {3599 {3600 (nt = (l.car));3601 (steps[sc_conf_18] = (ind(nt, nts)));3602 (sc_i_17 = (ind(nt, nts)));3603 (predictors[sc_i_17] = (new sc_Pair(sc_conf_18, (predictors[sc_i_17]))));3604 (l = (l.cdr));3605 (++sc_conf_18);3606 }3607 }3608 (steps[sc_conf_18] = ((ind(head, nts))-nb_nts));3609 (i = (ind(head, nts)));3610 (enders[i] = (new sc_Pair(sc_conf_18, (enders[i]))));3611 return (rule_loop((rules.cdr), (sc_conf_18+(1)), (rule_num+(1))));3612 }3613 else3614 return (def_loop((defs.cdr), conf));3615 }), (rule_loop((def.cdr), conf, (1)))):undefined);3616 };3617 (def_loop(grammar, (sc_nts_8.length)));3618 (parser_descr = [lexer, sc_nts_8, sc_starters_5, sc_enders_4, sc_predictors_3, sc_steps_2, sc_names_1]);3619 return function(input) {3620 var optrOpnd;3621 var sc_optrOpnd_20;3622 var sc_optrOpnd_21;3623 var sc_optrOpnd_22;3624 var loop1;3625 var BgL_sc_stateza2_23za2;3626 var toks;3627 var BgL_sc_nbzd2nts_24zd2;3628 var sc_steps_25;3629 var sc_enders_26;3630 var state_num;3631 var BgL_sc_statesza2_27za2;3632 var states;3633 var i;3634 var conf;3635 var l;3636 var tok_nts;3637 var sc_i_28;3638 var sc_i_29;3639 var l1;3640 var l2;3641 var tok;3642 var tail1129;3643 var L1125;3644 var goal_enders;3645 var BgL_sc_statesza2_30za2;3646 var BgL_sc_nbzd2nts_31zd2;3647 var BgL_sc_nbzd2confs_32zd2;3648 var nb_toks;3649 var goal_starters;3650 var sc_states_33;3651 var BgL_sc_nbzd2confs_34zd2;3652 var BgL_sc_nbzd2toks_35zd2;3653 var sc_toks_36;3654 var falseHead1128;3655 var sc_names_37;3656 var sc_steps_38;3657 var sc_predictors_39;3658 var sc_enders_40;3659 var sc_starters_41;3660 var sc_nts_42;3661 var lexer;3662 var sc_ind_43;3663 var make_states;3664 var BgL_sc_confzd2setzd2getza2_44za2;3665 var conf_set_merge_new_bang;3666 var conf_set_adjoin;3667 var BgL_sc_confzd2setzd2adjoinza2_45za2;3668 var BgL_sc_confzd2setzd2adjoinza2za2_46z00;3669 var conf_set_union;3670 var forw;3671 var is_parsed;3672 var deriv_trees;3673 var BgL_sc_derivzd2treesza2_47z70;3674 var nb_deriv_trees;3675 var BgL_sc_nbzd2derivzd2treesza2_48za2;3676 {3677 sc_ind_43 = function(nt, sc_nts_49) {3678 var i;3679 {3680 (i = ((sc_nts_49.length)-(1)));3681 while (true) {3682 if ((i>=(0)))3683 if ((sc_isEqual((sc_nts_49[i]), nt)))3684 return i;3685 else3686 (--i);3687 else3688 return false;3689 }3690 }3691 };3692 make_states = function(BgL_sc_nbzd2toks_50zd2, BgL_sc_nbzd2confs_51zd2) {3693 var v;3694 var i;3695 var sc_states_52;3696 {3697 (sc_states_52 = (sc_makeVector((BgL_sc_nbzd2toks_50zd2+(1)), false)));3698 (i = BgL_sc_nbzd2toks_50zd2);3699 while ((i>=(0))) {3700 {3701 (v = (sc_makeVector((BgL_sc_nbzd2confs_51zd2+(1)), false)));3702 (v[(0)] = (-1));3703 (sc_states_52[i] = v);3704 (--i);3705 }3706 }3707 return sc_states_52;3708 }3709 };3710 BgL_sc_confzd2setzd2getza2_44za2 = function(state, BgL_sc_statezd2num_53zd2, sc_conf_54) {3711 var conf_set;3712 var BgL_sc_confzd2set_55zd2;3713 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)));3714 };3715 conf_set_merge_new_bang = function(conf_set) {3716 return ((conf_set[((conf_set[(1)])+(5))] = (conf_set[(4)])), (conf_set[(1)] = (conf_set[(3)])), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1)));3717 };3718 conf_set_adjoin = function(state, conf_set, sc_conf_56, i) {3719 var tail;3720 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));3721 };3722 BgL_sc_confzd2setzd2adjoinza2_45za2 = function(sc_states_57, BgL_sc_statezd2num_58zd2, l, i) {3723 var conf_set;3724 var sc_conf_59;3725 var l1;3726 var state;3727 {3728 (state = (sc_states_57[BgL_sc_statezd2num_58zd2]));3729 (l1 = l);3730 while ((l1 instanceof sc_Pair)) {3731 {3732 (sc_conf_59 = (l1.car));3733 (conf_set = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_58zd2, sc_conf_59)));3734 if (((conf_set[(i+(5))])=== false))3735 {3736 (conf_set_adjoin(state, conf_set, sc_conf_59, i));3737 (l1 = (l1.cdr));3738 }3739 else3740 (l1 = (l1.cdr));3741 }3742 }3743 return undefined;3744 }3745 };3746 BgL_sc_confzd2setzd2adjoinza2za2_46z00 = function(sc_states_60, BgL_sc_statesza2_61za2, BgL_sc_statezd2num_62zd2, sc_conf_63, i) {3747 var BgL_sc_confzd2setza2_64z70;3748 var BgL_sc_stateza2_65za2;3749 var conf_set;3750 var state;3751 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));3752 };3753 conf_set_union = function(state, conf_set, sc_conf_66, other_set) {3754 var i;3755 {3756 (i = (other_set[(2)]));3757 while ((i>=(0))) {3758 if (((conf_set[(i+(5))])=== false))3759 {3760 (conf_set_adjoin(state, conf_set, sc_conf_66, i));3761 (i = (other_set[(i+(5))]));3762 }3763 else3764 (i = (other_set[(i+(5))]));3765 }3766 return undefined;3767 }3768 };3769 forw = function(sc_states_67, BgL_sc_statezd2num_68zd2, sc_starters_69, sc_enders_70, sc_predictors_71, sc_steps_72, sc_nts_73) {3770 var next_set;3771 var next;3772 var conf_set;3773 var ender;3774 var l;3775 var starter_set;3776 var starter;3777 var sc_l_74;3778 var sc_loop1_75;3779 var head;3780 var BgL_sc_confzd2set_76zd2;3781 var BgL_sc_statezd2num_77zd2;3782 var state;3783 var sc_states_78;3784 var preds;3785 var BgL_sc_confzd2set_79zd2;3786 var step;3787 var sc_conf_80;3788 var BgL_sc_nbzd2nts_81zd2;3789 var sc_state_82;3790 {3791 (sc_state_82 = (sc_states_67[BgL_sc_statezd2num_68zd2]));3792 (BgL_sc_nbzd2nts_81zd2 = (sc_nts_73.length));3793 while (true) {3794 {3795 (sc_conf_80 = (sc_state_82[(0)]));3796 if ((sc_conf_80>=(0)))3797 {3798 (step = (sc_steps_72[sc_conf_80]));3799 (BgL_sc_confzd2set_79zd2 = (sc_state_82[(sc_conf_80+(1))]));3800 (head = (BgL_sc_confzd2set_79zd2[(4)]));3801 (sc_state_82[(0)] = (BgL_sc_confzd2set_79zd2[(0)]));3802 (conf_set_merge_new_bang(BgL_sc_confzd2set_79zd2));3803 if ((step>=(0)))3804 {3805 (sc_l_74 = (sc_starters_69[step]));3806 while ((sc_l_74 instanceof sc_Pair)) {3807 {3808 (starter = (sc_l_74.car));3809 (starter_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, starter)));3810 if (((starter_set[(BgL_sc_statezd2num_68zd2+(5))])=== false))3811 {3812 (conf_set_adjoin(sc_state_82, starter_set, starter, BgL_sc_statezd2num_68zd2));3813 (sc_l_74 = (sc_l_74.cdr));3814 }3815 else3816 (sc_l_74 = (sc_l_74.cdr));3817 }3818 }3819 (l = (sc_enders_70[step]));3820 while ((l instanceof sc_Pair)) {3821 {3822 (ender = (l.car));3823 if ((((conf_set = (sc_state_82[(ender+(1))])), ((conf_set!== false)?(conf_set[(BgL_sc_statezd2num_68zd2+(5))]):false))!== false))3824 {3825 (next = (sc_conf_80+(1)));3826 (next_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, next)));3827 (conf_set_union(sc_state_82, next_set, next, BgL_sc_confzd2set_79zd2));3828 (l = (l.cdr));3829 }3830 else3831 (l = (l.cdr));3832 }3833 }3834 }3835 else3836 {3837 (preds = (sc_predictors_71[(step+BgL_sc_nbzd2nts_81zd2)]));3838 (sc_states_78 = sc_states_67);3839 (state = sc_state_82);3840 (BgL_sc_statezd2num_77zd2 = BgL_sc_statezd2num_68zd2);3841 (BgL_sc_confzd2set_76zd2 = BgL_sc_confzd2set_79zd2);3842 sc_loop1_75 = function(l) {3843 var sc_state_83;3844 var BgL_sc_nextzd2set_84zd2;3845 var sc_next_85;3846 var pred_set;3847 var i;3848 var pred;3849 if ((l instanceof sc_Pair))3850 {3851 (pred = (l.car));3852 (i = head);3853 while ((i>=(0))) {3854 {3855 (pred_set = ((sc_state_83 = (sc_states_78[i])), (sc_state_83[(pred+(1))])));3856 if ((pred_set!== false))3857 {3858 (sc_next_85 = (pred+(1)));3859 (BgL_sc_nextzd2set_84zd2 = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_77zd2, sc_next_85)));3860 (conf_set_union(state, BgL_sc_nextzd2set_84zd2, sc_next_85, pred_set));3861 }3862 (i = (BgL_sc_confzd2set_76zd2[(i+(5))]));3863 }3864 }3865 return (sc_loop1_75((l.cdr)));3866 }3867 else3868 return undefined;3869 };3870 (sc_loop1_75(preds));3871 }3872 }3873 else3874 return undefined;3875 }3876 }3877 }3878 };3879 is_parsed = function(nt, i, j, sc_nts_86, sc_enders_87, sc_states_88) {3880 var conf_set;3881 var state;3882 var sc_conf_89;3883 var l;3884 var BgL_sc_ntza2_90za2;3885 {3886 (BgL_sc_ntza2_90za2 = (sc_ind_43(nt, sc_nts_86)));3887 if ((BgL_sc_ntza2_90za2!== false))3888 {3889 (sc_nts_86.length);3890 (l = (sc_enders_87[BgL_sc_ntza2_90za2]));3891 while (true) {3892 if ((l instanceof sc_Pair))3893 {3894 (sc_conf_89 = (l.car));3895 if ((((state = (sc_states_88[j])), (conf_set = (state[(sc_conf_89+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))3896 return true;3897 else3898 (l = (l.cdr));3899 }3900 else3901 return false;3902 }3903 }3904 else3905 return false;3906 }3907 };3908 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) {3909 var sc_loop1_98;3910 var prev;3911 var name;3912 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) {3913 var loop2;3914 var ender_set;3915 var state;3916 var ender;3917 var l1;3918 var l2;3919 while (true) {3920 if ((l1 instanceof sc_Pair))3921 {3922 (ender = (l1.car));3923 (ender_set = ((state = (sc_states_96[j])), (state[(ender+(1))])));3924 if ((ender_set!== false))3925 {3926 loop2 = function(k, l2) {3927 var loop3;3928 var ender_trees;3929 var prev_trees;3930 var conf_set;3931 var sc_state_99;3932 var k;3933 var l2;3934 while (true) {3935 if ((k>=(0)))3936 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)))3937 {3938 (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)));3939 (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)));3940 loop3 = function(l3, l2) {3941 var l4;3942 var sc_l2_100;3943 var ender_tree;3944 if ((l3 instanceof sc_Pair))3945 {3946 (ender_tree = (sc_list((l3.car))));3947 (l4 = prev_trees);3948 (sc_l2_100 = l2);3949 while ((l4 instanceof sc_Pair)) {3950 {3951 (sc_l2_100 = (new sc_Pair((sc_append((l4.car), ender_tree)), sc_l2_100)));3952 (l4 = (l4.cdr));3953 }3954 }3955 return (loop3((l3.cdr), sc_l2_100));3956 }3957 else3958 return (loop2((ender_set[(k+(5))]), l2));3959 };3960 return (loop3(ender_trees, l2));3961 }3962 else3963 (k = (ender_set[(k+(5))]));3964 else3965 return (sc_loop1_98((l1.cdr), l2));3966 }3967 };3968 return (loop2((ender_set[(2)]), l2));3969 }3970 else3971 (l1 = (l1.cdr));3972 }3973 else3974 return l2;3975 }3976 }), (sc_loop1_98((sc_enders_92[(sc_steps_93[prev])]), null)))));3977 };3978 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) {3979 var conf_set;3980 var state;3981 var sc_conf_107;3982 var l;3983 var trees;3984 var BgL_sc_nbzd2nts_108zd2;3985 var BgL_sc_ntza2_109za2;3986 {3987 (BgL_sc_ntza2_109za2 = (sc_ind_43(nt, sc_nts_101)));3988 if ((BgL_sc_ntza2_109za2!== false))3989 {3990 (BgL_sc_nbzd2nts_108zd2 = (sc_nts_101.length));3991 (l = (sc_enders_102[BgL_sc_ntza2_109za2]));3992 (trees = null);3993 while ((l instanceof sc_Pair)) {3994 {3995 (sc_conf_107 = (l.car));3996 if ((((state = (sc_states_106[j])), (conf_set = (state[(sc_conf_107+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))3997 {3998 (l = (l.cdr));3999 (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)));4000 }4001 else4002 (l = (l.cdr));4003 }4004 }4005 return trees;4006 }4007 else4008 return false;4009 }4010 };4011 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) {4012 var sc_loop1_116;4013 var tmp1124;4014 var prev;4015 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) {4016 var nb_ender_trees;4017 var nb_prev_trees;4018 var conf_set;4019 var state;4020 var k;4021 var n;4022 var ender_set;4023 var sc_state_117;4024 var ender;4025 var l;4026 var sc_n_118;4027 while (true) {4028 if ((l instanceof sc_Pair))4029 {4030 (ender = (l.car));4031 (ender_set = ((sc_state_117 = (sc_states_114[j])), (sc_state_117[(ender+(1))])));4032 if ((ender_set!== false))4033 {4034 (k = (ender_set[(2)]));4035 (n = sc_n_118);4036 while ((k>=(0))) {4037 if (((k>=i)&&(((state = (sc_states_114[k])), (conf_set = (state[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)))4038 {4039 (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)));4040 (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)));4041 (k = (ender_set[(k+(5))]));4042 (n +=(nb_prev_trees*nb_ender_trees));4043 }4044 else4045 (k = (ender_set[(k+(5))]));4046 }4047 return (sc_loop1_116((l.cdr), n));4048 }4049 else4050 (l = (l.cdr));4051 }4052 else4053 return sc_n_118;4054 }4055 }), (sc_loop1_116((sc_enders_111[(sc_steps_112[prev])]), (0))))));4056 };4057 BgL_sc_nbzd2derivzd2treesza2_48za2 = function(nt, i, j, sc_nts_119, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123) {4058 var conf_set;4059 var state;4060 var sc_conf_124;4061 var l;4062 var nb_trees;4063 var BgL_sc_nbzd2nts_125zd2;4064 var BgL_sc_ntza2_126za2;4065 {4066 (BgL_sc_ntza2_126za2 = (sc_ind_43(nt, sc_nts_119)));4067 if ((BgL_sc_ntza2_126za2!== false))4068 {4069 (BgL_sc_nbzd2nts_125zd2 = (sc_nts_119.length));4070 (l = (sc_enders_120[BgL_sc_ntza2_126za2]));4071 (nb_trees = (0));4072 while ((l instanceof sc_Pair)) {4073 {4074 (sc_conf_124 = (l.car));4075 if ((((state = (sc_states_123[j])), (conf_set = (state[(sc_conf_124+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))4076 {4077 (l = (l.cdr));4078 (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));4079 }4080 else4081 (l = (l.cdr));4082 }4083 }4084 return nb_trees;4085 }4086 else4087 return false;4088 }4089 };4090 (lexer = (parser_descr[(0)]));4091 (sc_nts_42 = (parser_descr[(1)]));4092 (sc_starters_41 = (parser_descr[(2)]));4093 (sc_enders_40 = (parser_descr[(3)]));4094 (sc_predictors_39 = (parser_descr[(4)]));4095 (sc_steps_38 = (parser_descr[(5)]));4096 (sc_names_37 = (parser_descr[(6)]));4097 (falseHead1128 = (new sc_Pair(null, null)));4098 (L1125 = (lexer(input)));4099 (tail1129 = falseHead1128);4100 while (!(L1125 === null)) {4101 {4102 (tok = (L1125.car));4103 (l1 = (tok.cdr));4104 (l2 = null);4105 while ((l1 instanceof sc_Pair)) {4106 {4107 (sc_i_29 = (sc_ind_43((l1.car), sc_nts_42)));4108 if ((sc_i_29!== false))4109 {4110 (l1 = (l1.cdr));4111 (l2 = (new sc_Pair(sc_i_29, l2)));4112 }4113 else4114 (l1 = (l1.cdr));4115 }4116 }4117 (sc_optrOpnd_22 = (new sc_Pair((tok.car), (sc_reverse(l2)))));4118 (sc_optrOpnd_21 = (new sc_Pair(sc_optrOpnd_22, null)));4119 (tail1129.cdr = sc_optrOpnd_21);4120 (tail1129 = (tail1129.cdr));4121 (L1125 = (L1125.cdr));4122 }4123 }4124 (sc_optrOpnd_20 = (falseHead1128.cdr));4125 (sc_toks_36 = (sc_list2vector(sc_optrOpnd_20)));4126 (BgL_sc_nbzd2toks_35zd2 = (sc_toks_36.length));4127 (BgL_sc_nbzd2confs_34zd2 = (sc_steps_38.length));4128 (sc_states_33 = (make_states(BgL_sc_nbzd2toks_35zd2, BgL_sc_nbzd2confs_34zd2)));4129 (goal_starters = (sc_starters_41[(0)]));4130 (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (0), goal_starters, (0)));4131 (forw(sc_states_33, (0), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42));4132 (sc_i_28 = (0));4133 while ((sc_i_28<BgL_sc_nbzd2toks_35zd2)) {4134 {4135 (tok_nts = ((sc_toks_36[sc_i_28]).cdr));4136 (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (sc_i_28+(1)), tok_nts, sc_i_28));4137 (forw(sc_states_33, (sc_i_28+(1)), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42));4138 (++sc_i_28);4139 }4140 }4141 (nb_toks = (sc_toks_36.length));4142 (BgL_sc_nbzd2confs_32zd2 = (sc_steps_38.length));4143 (BgL_sc_nbzd2nts_31zd2 = (sc_nts_42.length));4144 (BgL_sc_statesza2_30za2 = (make_states(nb_toks, BgL_sc_nbzd2confs_32zd2)));4145 (goal_enders = (sc_enders_40[(0)]));4146 (l = goal_enders);4147 while ((l instanceof sc_Pair)) {4148 {4149 (conf = (l.car));4150 (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_33, BgL_sc_statesza2_30za2, nb_toks, conf, (0)));4151 (l = (l.cdr));4152 }4153 }4154 (i = nb_toks);4155 while ((i>=(0))) {4156 {4157 (states = sc_states_33);4158 (BgL_sc_statesza2_27za2 = BgL_sc_statesza2_30za2);4159 (state_num = i);4160 (sc_enders_26 = sc_enders_40);4161 (sc_steps_25 = sc_steps_38);4162 (BgL_sc_nbzd2nts_24zd2 = BgL_sc_nbzd2nts_31zd2);4163 (toks = sc_toks_36);4164 (BgL_sc_stateza2_23za2 = (BgL_sc_statesza2_30za2[i]));4165 loop1 = function() {4166 var sc_loop1_127;4167 var prev;4168 var BgL_sc_statesza2_128za2;4169 var sc_states_129;4170 var j;4171 var i;4172 var sc_i_130;4173 var head;4174 var conf_set;4175 var sc_conf_131;4176 {4177 (sc_conf_131 = (BgL_sc_stateza2_23za2[(0)]));4178 if ((sc_conf_131>=(0)))4179 {4180 (conf_set = (BgL_sc_stateza2_23za2[(sc_conf_131+(1))]));4181 (head = (conf_set[(4)]));4182 (BgL_sc_stateza2_23za2[(0)] = (conf_set[(0)]));4183 (conf_set_merge_new_bang(conf_set));4184 (sc_i_130 = head);4185 while ((sc_i_130>=(0))) {4186 {4187 (i = sc_i_130);4188 (j = state_num);4189 (sc_states_129 = states);4190 (BgL_sc_statesza2_128za2 = BgL_sc_statesza2_27za2);4191 (prev = (sc_conf_131-(1)));4192 if (((sc_conf_131>=BgL_sc_nbzd2nts_24zd2)&&((sc_steps_25[prev])>=(0))))4193 {4194 sc_loop1_127 = function(l) {4195 var k;4196 var ender_set;4197 var state;4198 var ender;4199 var l;4200 while (true) {4201 if ((l instanceof sc_Pair))4202 {4203 (ender = (l.car));4204 (ender_set = ((state = (sc_states_129[j])), (state[(ender+(1))])));4205 if ((ender_set!== false))4206 {4207 (k = (ender_set[(2)]));4208 while ((k>=(0))) {4209 {4210 if ((k>=i))4211 if (((BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, k, prev, i))!== false))4212 (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, j, ender, k));4213 (k = (ender_set[(k+(5))]));4214 }4215 }4216 return (sc_loop1_127((l.cdr)));4217 }4218 else4219 (l = (l.cdr));4220 }4221 else4222 return undefined;4223 }4224 };4225 (sc_loop1_127((sc_enders_26[(sc_steps_25[prev])])));4226 }4227 (sc_i_130 = (conf_set[(sc_i_130+(5))]));4228 }4229 }4230 return (loop1());4231 }4232 else4233 return undefined;4234 }4235 };4236 (loop1());4237 (--i);4238 }4239 }4240 (optrOpnd = BgL_sc_statesza2_30za2);4241 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];4242 }4243 };4244 }4245 };4246 BgL_parsezd2ze3parsedzf3zc2 = function(parse, nt, i, j) {4247 var is_parsed;4248 var states;4249 var enders;4250 var nts;4251 return ((nts = (parse[(0)])), (enders = (parse[(2)])), (states = (parse[(7)])), (is_parsed = (parse[(8)])), (is_parsed(nt, i, j, nts, enders, states)));4252 };4253 BgL_parsezd2ze3treesz31 = function(parse, nt, i, j) {4254 var BgL_sc_derivzd2treesza2_132z70;4255 var states;4256 var toks;4257 var names;4258 var steps;4259 var enders;4260 var nts;4261 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)));4262 };4263 BgL_parsezd2ze3nbzd2treesze3 = function(parse, nt, i, j) {4264 var BgL_sc_nbzd2derivzd2treesza2_133za2;4265 var states;4266 var toks;4267 var steps;4268 var enders;4269 var nts;4270 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)));4271 };4272 test = function(k) {4273 var x;4274 var p;4275 return ((p = (BgL_makezd2parserzd2(const_earley, function(l) {4276 var sc_x_134;4277 var tail1134;4278 var L1130;4279 var falseHead1133;4280 {4281 (falseHead1133 = (new sc_Pair(null, null)));4282 (tail1134 = falseHead1133);4283 (L1130 = l);4284 while (!(L1130 === null)) {4285 {4286 (tail1134.cdr = (new sc_Pair(((sc_x_134 = (L1130.car)), (sc_list(sc_x_134, sc_x_134))), null)));4287 (tail1134 = (tail1134.cdr));4288 (L1130 = (L1130.cdr));4289 }4290 }4291 return (falseHead1133.cdr);4292 }4293 }))), (x = (p((sc_vector2list((sc_makeVector(k, "\u1E9Ca"))))))), (sc_length((BgL_parsezd2ze3treesz31(x, "\u1E9Cs", (0), k)))));4294 };4295 BgL_earleyzd2benchmarkzd2 = function() {4296 var args = null;4297 for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {4298 args = sc_cons(arguments[sc_tmp], args);4299 }4300 var k;4301 return ((k = ((args === null)?(7):(args.car))), (BgL_runzd2benchmarkzd2("earley", (1), function() {4302 return (test(k));4303 }, function(result) {4304 return ((sc_display(result)), (sc_newline()), result == 132);4305 })));4306 };4307}4308/************* END OF GENERATED CODE *************/4309// Invoke this function to run a benchmark.4310// The first argument is a string identifying the benchmark.4311// The second argument is the number of times to run the benchmark.4312// The third argument is a function that runs the benchmark.4313// The fourth argument is a unary function that warns if the result4314// returned by the benchmark is incorrect.4315//4316// Example:4317// RunBenchmark("new Array()",4318// 1,4319// function () { new Array(1000000); }4320// function (v) {4321// return (v instanceof Array) && (v.length == 1000000);4322// });4323SC_DEFAULT_OUT = new sc_GenericOutputPort(function(s) {});4324SC_ERROR_OUT = SC_DEFAULT_OUT;4325function RunBenchmark(name, count, run, warn) {4326 for (var n = 0; n < count; ++n) {4327 result = run();4328 if (!warn(result)) {4329 throw new Error("Earley or Boyer did incorrect number of rewrites");4330 }4331 }4332}4333var BgL_runzd2benchmarkzd2 = RunBenchmark;4334for (var i = 0; i < 4; ++i) {4335 BgL_earleyzd2benchmarkzd2();4336 BgL_nboyerzd2benchmarkzd2();...
iban.js
Source:iban.js
1// iban.html & iban.js 1.5 - Create or check International Bank Account Numbers2// Copyright (C) 2002-2010, Thomas Günther <tom@toms-cafe.de>3// This program is free software; you can redistribute it and/or modify4// it under the terms of the GNU General Public License as published by5// the Free Software Foundation; either version 2 of the License, or6// (at your option) any later version.7// This program is distributed in the hope that it will be useful,8// but WITHOUT ANY WARRANTY; without even the implied warranty of9// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10// GNU General Public License for more details.11// You should have received a copy of the GNU General Public License along12// with this program; if not, write to the Free Software Foundation, Inc.,13// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.14// Interface functions for iban.html:15// CreateIBAN16// CheckIBAN17// WriteCountrySelectionBar18// WriteCountryFormatTable19// WriteExampleTestTable20// Required tags in iban.html:21// Form ibanform22// Selection bar ibanform.country23// Input field ibanform.bank24// Input field ibanform.account25// Input field ibanform.iban26// Output field ibanform.alt_iban27// Image bban_img28// Image iban_img29// Used images:30// okay.png check-mark in ibanform31// error.png question-mark in ibanform32// blank.png erase check-mark and question-mark33// arrows_lr.png arrows in examples table34// Preload images35var okay_img = new Image(); okay_img.src = "okay.png";36var error_img = new Image(); error_img.src = "error.png";37var blank_img = new Image(); blank_img.src = "blank.png";38var arrow_img = new Image(); arrow_img.src = "arrows_lr.png";39 arrow_img.width = "50";40 arrow_img.height = "20";41// JavaScript Object for country specific iban data.42function Country(name, code, bank_form, acc_form)43{44 // Constructor for Country objects.45 //46 // Arguments:47 // name - Name of the country48 // code - Country Code from ISO 316649 // bank_form - Format of bank/branch code part (e.g. "0 4a 0 ")50 // acc_form - Format of account number part (e.g. "0 11 2n")51 this.name = name;52 this.code = code;53 this.bank = Country_decode_format(bank_form);54 this.acc = Country_decode_format(acc_form);55 this.bank_lng = Country_calc_length(this.bank);56 this.acc_lng = Country_calc_length(this.acc);57 this.total_lng = 4 + this.bank_lng + this.acc_lng;58}59function Country_decode_format(form)60{61 var form_list = new Array();62 var parts = form.split(" ");63 for (var i = 0; i < parts.length; ++i)64 {65 var part = parts[i];66 if (part != "")67 {68 var typ = part.charAt(part.length - 1);69 if (typ == "a" || typ == "n")70 part = part.substring(0, part.length - 1);71 else72 typ = "c";73 var lng = parseInt(part);74 form_list[form_list.length] = new Array(lng, typ);75 }76 }77 return form_list;78}79function Country_calc_length(form_list)80{81 var sum = 0;82 for (var i = 0; i < form_list.length; ++i)83 sum += form_list[i][0];84 return sum;85}86// BBAN data from ISO 13616, Country codes from ISO 3166 (www.iso.org).87var iban_data = new Array(88 new Country("Andorra", "AD", "0 4n 4n", "0 12 0 "),89 new Country("Albania", "AL", "0 8n 0 ", "0 16 0 "),90 new Country("Austria", "AT", "0 5n 0 ", "0 11n 0 "),91 new Country("Bosnia and Herzegovina",92 "BA", "0 3n 3n", "0 8n 2n"),93 new Country("Belgium", "BE", "0 3n 0 ", "0 7n 2n"),94 new Country("Bulgaria", "BG", "0 4a 4n", "2n 8 0 "),95 new Country("Switzerland", "CH", "0 5n 0 ", "0 12 0 "),96 new Country("Cyprus", "CY", "0 3n 5n", "0 16 0 "),97 new Country("Czech Republic", "CZ", "0 4n 0 ", "0 16n 0 "),98 new Country("Germany", "DE", "0 8n 0 ", "0 10n 0 "),99 new Country("Denmark", "DK", "0 4n 0 ", "0 9n 1n"),100 new Country("Estonia", "EE", "0 2n 0 ", "2n 11n 1n"),101 new Country("Spain", "ES", "0 4n 4n", "2n 10n 0 "),102 new Country("Finland", "FI", "0 6n 0 ", "0 7n 1n"),103 new Country("Faroe Islands", "FO", "0 4n 0 ", "0 9n 1n"),104 new Country("France", "FR", "0 5n 5n", "0 11 2n"),105 new Country("United Kingdom", "GB", "0 4a 6n", "0 8n 0 "),106 new Country("Georgia", "GE", "0 2a 0 ", "0 16n 0 "),107 new Country("Gibraltar", "GI", "0 4a 0 ", "0 15 0 "),108 new Country("Greenland", "GL", "0 4n 0 ", "0 9n 1n"),109 new Country("Greece", "GR", "0 3n 4n", "0 16 0 "),110 new Country("Croatia", "HR", "0 7n 0 ", "0 10n 0 "),111 new Country("Hungary", "HU", "0 3n 4n", "1n 15n 1n"),112 new Country("Ireland", "IE", "0 4a 6n", "0 8n 0 "),113 new Country("Israel", "IL", "0 3n 3n", "0 13n 0 "),114 new Country("Iceland", "IS", "0 4n 0 ", "2n 16n 0 "),115 new Country("Italy", "IT", "1a 5n 5n", "0 12 0 "),116 new Country("Kuwait", "KW", "0 4a 0 ", "0 22 0 "),117 new Country("Kazakhstan", "KZ", "0 3n 0 ", "0 13 0 "),118 new Country("Lebanon", "LB", "0 4n 0 ", "0 20 0 "),119 new Country("Liechtenstein", "LI", "0 5n 0 ", "0 12 0 "),120 new Country("Lithuania", "LT", "0 5n 0 ", "0 11n 0 "),121 new Country("Luxembourg", "LU", "0 3n 0 ", "0 13 0 "),122 new Country("Latvia", "LV", "0 4a 0 ", "0 13 0 "),123 new Country("Monaco", "MC", "0 5n 5n", "0 11 2n"),124 new Country("Montenegro", "ME", "0 3n 0 ", "0 13n 2n"),125 new Country("Macedonia, Former Yugoslav Republic of",126 "MK", "0 3n 0 ", "0 10 2n"),127 new Country("Mauritania", "MR", "0 5n 5n", "0 11n 2n"),128 new Country("Malta", "MT", "0 4a 5n", "0 18 0 "),129 new Country("Mauritius", "MU", "0 4a 4n", "0 15n 3a"),130 new Country("Netherlands", "NL", "0 4a 0 ", "0 10n 0 "),131 new Country("Norway", "NO", "0 4n 0 ", "0 6n 1n"),132 new Country("Poland", "PL", "0 8n 0 ", "0 16n 0 "),133 new Country("Portugal", "PT", "0 4n 4n", "0 11n 2n"),134 new Country("Romania", "RO", "0 4a 0 ", "0 16 0 "),135 new Country("Serbia", "RS", "0 3n 0 ", "0 13n 2n"),136 new Country("Saudi Arabia", "SA", "0 2n 0 ", "0 18 0 "),137 new Country("Sweden", "SE", "0 3n 0 ", "0 16n 1n"),138 new Country("Slovenia", "SI", "0 5n 0 ", "0 8n 2n"),139 new Country("Slovak Republic",140 "SK", "0 4n 0 ", "0 16n 0 "),141 new Country("San Marino", "SM", "1a 5n 5n", "0 12 0 "),142 new Country("Tunisia", "TN", "0 2n 3n", "0 13n 2n"),143 new Country("Turkey", "TR", "0 5n 0 ", "1 16 0 "));144// Search the country code in the iban_data list.145function CountryData(code)146{147 for (var i = 0; i < iban_data.length; ++i)148 if (iban_data[i].code == code)149 return iban_data[i];150 return null;151}152// Modulo 97 for huge numbers given as digit strings.153function mod97(digit_string)154{155 var m = 0;156 for (var i = 0; i < digit_string.length; ++i)157 m = (m * 10 + parseInt(digit_string.charAt(i))) % 97;158 return m;159}160// Convert a capital letter into digits: A -> 10 ... Z -> 35 (ISO 13616).161function capital2digits(ch)162{163 var capitals = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";164 for (var i = 0; i < capitals.length; ++i)165 if (ch == capitals.charAt(i))166 break;167 return i + 10;168}169// Fill the string with leading zeros until length is reached.170function fill0(s, l)171{172 while (s.length < l)173 s = "0" + s;174 return s;175}176// Compare two strings respecting german umlauts.177function strcmp(s1, s2)178{179 var chars = "AaÄäBbCcDdEeFfGgHhIiJjKkLlMmNnOoÖöPpQqRrSsßTtUuÜüVvWwXxYyZz";180 var lng = (s1.length < s2.length) ? s1.length : s2.length;181 for (var i = 0; i < lng; ++i)182 {183 var d = chars.indexOf(s1.charAt(i)) - chars.indexOf(s2.charAt(i));184 if (d != 0)185 return d;186 }187 return s1.length - s2.length;188}189// Create an index table of the iban_data list sorted by country names.190function CountryIndexTable()191{192 var tab = new Array();193 var i, j, t;194 for (i = 0; i < iban_data.length; ++i)195 tab[i] = i;196 for (i = tab.length - 1; i > 0; --i)197 for (j = 0; j < i; ++j)198 if (strcmp(iban_data[tab[j]].name, iban_data[tab[j+1]].name) > 0)199 t = tab[j], tab[j] = tab[j+1], tab[j+1] = t;200 return tab;201}202// Calculate 2-digit checksum of an IBAN.203function ChecksumIBAN(iban)204{205 var code = iban.substring(0, 2);206 var checksum = iban.substring(2, 4);207 var bban = iban.substring(4);208 // Assemble digit string209 var digits = "";210 for (var i = 0; i < bban.length; ++i)211 {212 var ch = bban.charAt(i).toUpperCase();213 if ("0" <= ch && ch <= "9")214 digits += ch;215 else216 digits += capital2digits(ch);217 }218 for (var i = 0; i < code.length; ++i)219 {220 var ch = code.charAt(i);221 digits += capital2digits(ch);222 }223 digits += checksum;224 // Calculate checksum225 checksum = 98 - mod97(digits);226 return fill0("" + checksum, 2);227}228// Fill the account number part of IBAN with leading zeros.229function FillAccount(country, account)230{231 return fill0(account, country.acc_lng);232}233// Check if syntax of the part of IBAN is invalid.234function InvalidPart(form_list, iban_part)235{236 for (var f = 0; f < form_list.length; ++f)237 {238 var lng = form_list[f][0], typ = form_list[f][1];239 if (lng > iban_part.length)240 lng = iban_part.length;241 for (var i = 0; i < lng; ++i)242 {243 var ch = iban_part.charAt(i);244 var a = ("A" <= ch && ch <= "Z");245 var n = ("0" <= ch && ch <= "9");246 var c = n || a || ("a" <= ch && ch <= "z");247 if ((!c && typ == "c") || (!a && typ == "a") || (!n && typ == "n"))248 return true;249 }250 iban_part = iban_part.substring(lng);251 }252 return false;253}254// Check if length of the bank/branch code part of IBAN is invalid.255function InvalidBankLength(country, bank)256{257 return (bank.length != country.bank_lng);258}259// Check if syntax of the bank/branch code part of IBAN is invalid.260function InvalidBank(country, bank)261{262 return (InvalidBankLength(country, bank) ||263 InvalidPart(country.bank, bank));264}265// Check if length of the account number part of IBAN is invalid.266function InvalidAccountLength(country, account)267{268 return (account.length < 1 || account.length > country.acc_lng);269}270// Check if syntax of the account number part of IBAN is invalid.271function InvalidAccount(country, account)272{273 return (InvalidAccountLength(country, account) ||274 InvalidPart(country.acc, FillAccount(country, account)));275}276// Check if length of IBAN is invalid.277function InvalidIBANlength(country, iban)278{279 return (iban.length != country.total_lng);280}281// Convert iban from intern value to string format (IBAN XXXX XXXX ...).282function extern(intern)283{284 var s = "IBAN";285 for (var i = 0; i < intern.length; ++i)286 {287 if (i % 4 == 0)288 s += " ";289 s += intern.charAt(i);290 }291 return s;292}293// Convert iban from string format to intern value.294function intern(extern)295{296 if (extern.substring(0, 4) == "IBAN")297 extern = extern.substring(4);298 var s = "";299 for (var i = 0; i < extern.length; ++i)300 if (extern.charAt(i) != " ")301 s += extern.charAt(i);302 return s;303}304// Calculate the checksum and assemble the IBAN.305function CalcIBAN(country, bank, account)306{307 var fill_acc = FillAccount(country, account);308 var checksum = ChecksumIBAN(country.code + "00" + bank + fill_acc);309 return country.code + checksum + bank + fill_acc;310}311function CalcAltIBAN(country, bank, account)312{313 var fill_acc = FillAccount(country, account);314 var checksum = ChecksumIBAN(country.code + "00" + bank + fill_acc);315 checksum = fill0("" + mod97(checksum), 2);316 return country.code + checksum + bank + fill_acc;317}318// Check the checksum of an IBAN.319function IBANokay(iban)320{321 return ChecksumIBAN(iban) == "97";322}323// Check the input, calculate the checksum and assemble the IBAN.324function CreateIBAN()325{326 var form = document.ibanform;327 var code = form.country.options[form.country.selectedIndex].value;328 var bank = intern(form.bank.value);329 var account = intern(form.account.value);330 var country = CountryData(code);331 var err = null, err_focus = null;332 if (country == null)333 {334 err = _("Unknown Country Code: ") + code;335 err_focus = form.country;336 }337 else if (InvalidBankLength(country, bank))338 {339 err = _("Bank/Branch Code length ") + bank.length +340 _(" is not correct for ") + country.name +341 " (" + country.bank_lng + ")";342 err_focus = form.bank;343 }344 else if (InvalidBank(country, bank))345 {346 err = _("Bank/Branch Code ") + bank + _(" is not correct for ") +347 country.name;348 err_focus = form.bank;349 }350 else if (InvalidAccountLength(country, account))351 {352 err = _("Account Number length ") + account.length +353 _(" is not correct for ") + country.name +354 " (" + country.acc_lng + ")";355 err_focus = form.account;356 }357 else if (InvalidAccount(country, account))358 {359 err = _("Account Number ") + account + _(" is not correct for ") +360 country.name;361 err_focus = form.account;362 }363 if (err)364 {365 // Set error image on BBAN side366 document.bban_img.src = error_img.src;367 document.iban_img.src = blank_img.src;368 // Clear destination fields, set focus to wrong field369 form.iban.value = "";370 form.alt_iban.value = "";371 err_focus.focus();372 // Show message box with error message373 alert(err);374 }375 else376 {377 // Set okay image on IBAN side378 document.iban_img.src = okay_img.src;379 document.bban_img.src = blank_img.src;380 // Calculate IBAN, write results in form fields381 form.bank.value = bank;382 form.account.value = FillAccount(country, account);383 form.iban.value = extern(CalcIBAN(country, bank, account));384 // Calculate alternative IBAN, write warning if not the same385 form.alt_iban.value = extern(CalcAltIBAN(country, bank, account));386 if (form.alt_iban.value != form.iban.value)387 form.alt_iban.value += " (*)";388 else389 form.alt_iban.value = "";390 // Check for dispensable global variables in debug modus391 if (debug_output)392 debug_check_vars();393 }394}395// Check the syntax and the checksum of the IBAN.396function CheckIBAN()397{398 var form = document.ibanform;399 var iban = intern(form.iban.value);400 var code = iban.substring(0, 2);401 var checksum = iban.substring(2, 4);402 var bban = iban.substring(4);403 var country = CountryData(code);404 var err = null;405 if (country == null)406 err = _("Unknown Country Code: ") + code;407 else if (InvalidIBANlength(country, iban))408 err = _("IBAN length ") + iban.length + _(" is not correct for ") +409 country.name + " (" + country.total_lng + ")";410 else411 {412 var bank_lng = country.bank_lng;413 var bank = bban.substring(0, bank_lng);414 var account = bban.substring(bank_lng);415 if (InvalidBank(country, bank))416 err = _("Bank/Branch Code ") + bank + _(" is not correct for ") +417 country.name;418 else if (InvalidAccount(country, account))419 err = _("Account Number ") + account + _(" is not correct for ") +420 country.name;421 else if (!IBANokay(iban))422 err = _("Checksum of IBAN incorrect");423 }424 if (err)425 {426 // Set error image on IBAN side427 document.iban_img.src = error_img.src;428 document.bban_img.src = blank_img.src;429 // Clear destination fields, set focus to wrong field430 form.country.selectedIndex = 0;431 form.bank.value = "";432 form.account.value = "";433 form.alt_iban.value = "";434 form.iban.focus();435 // Show message box with error message436 alert(err);437 }438 else439 {440 // Set okay image on BBAN side441 document.bban_img.src = okay_img.src;442 document.iban_img.src = blank_img.src;443 // Write results in form fields444 form.iban.value = extern(iban);445 for (var i = form.country.options.length - 1; i > 0; --i)446 if (form.country.options[i].value == code)447 break;448 form.country.selectedIndex = i;449 form.bank.value = bank;450 form.account.value = account;451 // Calculate alternative IBAN, write warning if not the same452 form.alt_iban.value = extern(CalcAltIBAN(country, bank, account));453 if (form.alt_iban.value != form.iban.value)454 form.alt_iban.value += " (*)";455 else456 form.alt_iban.value = "";457 // Check for dispensable global variables in debug modus458 if (debug_output)459 debug_check_vars();460 }461}462// Write the selection bar into the form.463function WriteCountrySelectionBar()464{465 document.write('<select name="country" size="1">');466 document.write('<option value="??"> </option>');467 var tab = CountryIndexTable();468 for (var i = 0; i < tab.length; ++i)469 {470 var country = iban_data[tab[i]];471 document.write('<option value="' + country.code + '">' +472 country.name + ' (' + country.code + ')</option>');473 }474 document.write('</select>');475}476// Write a table with the country specific iban format.477function WriteCountryFormatTable()478{479 document.write('<table bgcolor="#99FFCC" width="100%" border="4">' +480 ' <tr>' +481 ' <th rowspan="2"> </th>' +482 ' <th rowspan="2">' + _("Country") + '<BR />Code</th>' +483 ' <th colspan="3">' + _("Bank/Branch Code") + '</th>' +484 ' <th colspan="3">' + _("Account Number") + '</th>' +485 ' </tr>' +486 ' <tr>' +487 ' <th>' + _("check1") + '</th><th>' + _("bank") + '</th>' +488 ' <th>' + _("branch") + '</th><th>' + _("check2") + '</th>' +489 ' <th>' + _("number") + '</th><th>' + _("check3") + '</th>' +490 ' </tr>');491 var tab = CountryIndexTable();492 for (var i = 0; i < tab.length; ++i)493 {494 var country = iban_data[tab[i]];495 document.write(' <tr>' +496 ' <td>' + country.name + '</td>' +497 ' <td align="center">' + country.code + '</td>');498 for (var f = 0; f < country.bank.length; ++f)499 {500 var lng = country.bank[f][0], typ = country.bank[f][1];501 if (lng > 0)502 document.write(' <td align="center">' + lng + ' ' + typ + '</td>');503 else504 document.write(' <td align="center">-</td>');505 }506 for (var f = 0; f < country.acc.length; ++f)507 {508 var lng = country.acc[f][0], typ = country.acc[f][1];509 if (lng > 0)510 document.write(' <td align="center">' + lng + ' ' + typ + '</td>');511 else512 document.write(' <td align="center">-</td>');513 }514 }515 document.write(' <tr>' +516 ' <td colspan="2"> </td>' +517 ' <td colspan="8" align="center">' +518 _("a = A-Z, n = 0-9, c = A-Z/a-z/0-9") +519 ' </td>' +520 ' </tr>' +521 '</table>');522}523// Write a table with iban test data.524function WriteTestTable(data)525{526 document.write('<table bgcolor="#99FFCC" width="100%" border="4">' +527 ' <tr>' +528 ' <th>' + _('Country Code') + '</th>' +529 ' <th>' + _('Bank/Branch Code') + '</th>' +530 ' <th>' + _('Account Number') + '</th>' +531 ' <th> </th>' +532 ' <th>' + _('International Bank Account Number') + '</th>' +533 ' <th>' + _('Checksum') + '</th>' +534 ' </tr>');535 for (var i = 0; i < data.length; ++i)536 {537 var code = data[i][0];538 var bank = data[i][1];539 var account = data[i][2];540 var checksum = data[i][3];541 var country = CountryData(code);542 var iban = "", err = null;543 if (country == null)544 err = _("Unknown Country Code");545 else if (InvalidBank(country, bank))546 err = _("Incorrect Bank/Branch Code");547 else if (InvalidAccount(country, account))548 err = _("Incorrect Account Number");549 else550 {551 iban = CalcIBAN(country, bank, account);552 if (iban.substring(2, 4) != checksum)553 {554 var alt_iban = CalcAltIBAN(country, bank, account);555 if (alt_iban.substring(2, 4) == checksum)556 iban = alt_iban;557 }558 if (iban.substring(0, 2) != code)559 err = _("Country code changed");560 else if (InvalidIBANlength(country, iban))561 err = _("Incorrect IBAN length: ") + iban.length +562 " (" + country.total_lng + ")";563 else564 {565 var bban = iban.substring(4);566 var bank_lng = country.bank_lng;567 if (bban.substring(0, bank_lng) != bank)568 err = _("Bank/Branch Code changed");569 else if (bban.substring(bank_lng) != FillAccount(country, account))570 err = _("Account Number changed");571 else if (!IBANokay(iban))572 err = _("Incorrect checksum");573 else if (iban.substring(2, 4) != checksum)574 err = _("Checksum changed");575 }576 }577 document.write(' <tr>' +578 ' <td align="center">' + code + '</td>' +579 ' <td align="center">' + bank + '</td>' +580 ' <td align="center">' + account + '</td>');581 if (err)582 document.write(' <td colspan="3" align="center">' + err + '</td>');583 else584 document.write(' <td align="center">' +585 ' <img src="' + arrow_img.src + '"' +586 ' width="' + arrow_img.width + '"' +587 ' height="' + arrow_img.height +'"' +588 ' border="0" alt="<==>" />' +589 ' </td>' +590 ' <td align="center">' + extern(iban) + '</td>' +591 ' <td align="center">' + checksum + '</td>');592 document.write(' </tr>');593 }594 document.write('</table>');595}596// Write a table with an example for each country.597function WriteExampleTestTable()598{599 WriteTestTable(examples);600 // Write table with test data only in debug modus601 if (debug_output)602 WriteTestTable(test_data);603}604// Examples of IBANs for each country.605var examples = new Array(606 new Array("AD", "00012030", "200359100100", "12"),607 new Array("AL", "21211009", "0000000235698741", "47"),608 new Array("AT", "19043", "00234573201", "61"),609 new Array("BA", "129007", "9401028494", "39"),610 new Array("BE", "539", "007547034", "68"),611 new Array("BG", "BNBG9661", "1020345678", "80"),612 new Array("CH", "00762", "011623852957", "93"),613 new Array("CY", "00200128", "0000001200527600", "17"),614 new Array("CZ", "0800", "0000192000145399", "65"),615 new Array("DE", "37040044", "0532013000", "89"),616 new Array("DK", "0040", "0440116243", "50"),617 new Array("EE", "22", "00221020145685", "38"),618 new Array("ES", "21000418", "450200051332", "91"),619 new Array("FI", "123456", "00000785", "21"),620 new Array("FO", "6460", "0001631634", "62"),621 new Array("FR", "2004101005", "0500013M02606", "14"),622 new Array("GB", "NWBK601613", "31926819", "29"),623 new Array("GE", "NB", "0000000101904917", "29"),624 new Array("GI", "NWBK", "000000007099453", "75"),625 new Array("GL", "6471", "0001000206", "89"),626 new Array("GR", "0110125", "0000000012300695", "16"),627 new Array("HR", "1001005", "1863000160", "12"),628 new Array("HU", "1177301", "61111101800000000", "42"),629 new Array("IE", "AIBK931152", "12345678", "29"),630 new Array("IL", "010800", "0000099999999", "62"),631 new Array("IS", "0159", "260076545510730339", "14"),632 new Array("IT", "X0542811101", "000000123456", "60"),633 new Array("KW", "CBKU", "0000000000001234560101", "81"),634 new Array("KZ", "125", "KZT5004100100", "86"),635 new Array("LB", "0999", "00000001001901229114", "62"),636 new Array("LI", "08810", "0002324013AA", "21"),637 new Array("LT", "10000", "11101001000", "12"),638 new Array("LU", "001", "9400644750000", "28"),639 new Array("LV", "BANK", "0000435195001", "80"),640 new Array("MC", "1273900070", "0011111000h79", "11"),641 new Array("ME", "505", "000012345678951", "25"),642 new Array("MK", "250", "120000058984", "07"),643 new Array("MR", "0002000101", "0000123456753", "13"),644 new Array("MT", "MALT01100", "0012345MTLCAST001S", "84"),645 new Array("MU", "BOMM0101", "101030300200000MUR", "17"),646 new Array("NL", "ABNA", "0417164300", "91"),647 new Array("NO", "8601", "1117947", "93"),648 new Array("PL", "10901014", "0000071219812874", "61"),649 new Array("PT", "00020123", "1234567890154", "50"),650 new Array("RO", "AAAA", "1B31007593840000", "49"),651 new Array("RS", "260", "005601001611379", "35"),652 new Array("SA", "80", "000000608010167519", "03"),653 new Array("SE", "500", "00000058398257466", "45"),654 new Array("SI", "19100", "0000123438", "56"),655 new Array("SK", "1200", "0000198742637541", "31"),656 new Array("SM", "U0322509800", "000000270100", "86"),657 new Array("TN", "10006", "035183598478831", "59"),658 new Array("TR", "00061", "00519786457841326", "33"));659// Test data for each country.660var test_data = new Array(661 new Array("XY", "1", "2", "33"),662 new Array("AD", "11112222", "C3C3C3C3C3C3", "11"),663 new Array("AD", "1111222", "C3C3C3C3C3C3", "11"),664 new Array("AD", "X1112222", "C3C3C3C3C3C3", "11"),665 new Array("AD", "111@2222", "C3C3C3C3C3C3", "11"),666 new Array("AD", "1111X222", "C3C3C3C3C3C3", "11"),667 new Array("AD", "1111222@", "C3C3C3C3C3C3", "11"),668 new Array("AD", "11112222", "@3C3C3C3C3C3", "11"),669 new Array("AD", "11112222", "C3C3C3C3C3C@", "11"),670 new Array("AL", "11111111", "B2B2B2B2B2B2B2B2", "54"),671 new Array("AL", "1111111", "B2B2B2B2B2B2B2B2", "54"),672 new Array("AL", "X1111111", "B2B2B2B2B2B2B2B2", "54"),673 new Array("AL", "1111111@", "B2B2B2B2B2B2B2B2", "54"),674 new Array("AL", "11111111", "@2B2B2B2B2B2B2B2", "54"),675 new Array("AL", "11111111", "B2B2B2B2B2B2B2B@", "54"),676 new Array("AT", "11111", "22222222222", "17"),677 new Array("AT", "1111", "22222222222", "17"),678 new Array("AT", "X1111", "22222222222", "17"),679 new Array("AT", "1111@", "22222222222", "17"),680 new Array("AT", "11111", "X2222222222", "17"),681 new Array("AT", "11111", "2222222222@", "17"),682 new Array("BA", "111222", "3333333344", "79"),683 new Array("BA", "11122", "3333333344", "79"),684 new Array("BA", "X11222", "3333333344", "79"),685 new Array("BA", "11@222", "3333333344", "79"),686 new Array("BA", "111X22", "3333333344", "79"),687 new Array("BA", "11122@", "3333333344", "79"),688 new Array("BA", "111222", "X333333344", "79"),689 new Array("BA", "111222", "3333333@44", "79"),690 new Array("BA", "111222", "33333333X4", "79"),691 new Array("BA", "111222", "333333334@", "79"),692 new Array("BE", "111", "222222233", "93"),693 new Array("BE", "11", "222222233", "93"),694 new Array("BE", "X11", "222222233", "93"),695 new Array("BE", "11@", "222222233", "93"),696 new Array("BE", "111", "X22222233", "93"),697 new Array("BE", "111", "222222@33", "93"),698 new Array("BE", "111", "2222222X3", "93"),699 new Array("BE", "111", "22222223@", "93"),700 new Array("BG", "AAAA2222", "33D4D4D4D4", "20"),701 new Array("BG", "AAAA222", "33D4D4D4D4", "20"),702 new Array("BG", "8AAA2222", "33D4D4D4D4", "20"),703 new Array("BG", "AAA@2222", "33D4D4D4D4", "20"),704 new Array("BG", "AAAAX222", "33D4D4D4D4", "20"),705 new Array("BG", "AAAA222@", "33D4D4D4D4", "20"),706 new Array("BG", "AAAA2222", "X3D4D4D4D4", "20"),707 new Array("BG", "AAAA2222", "3@D4D4D4D4", "20"),708 new Array("BG", "AAAA2222", "33@4D4D4D4", "20"),709 new Array("BG", "AAAA2222", "33D4D4D4D@", "20"),710 new Array("CH", "11111", "B2B2B2B2B2B2", "60"),711 new Array("CH", "1111", "B2B2B2B2B2B2", "60"),712 new Array("CH", "X1111", "B2B2B2B2B2B2", "60"),713 new Array("CH", "1111@", "B2B2B2B2B2B2", "60"),714 new Array("CH", "11111", "@2B2B2B2B2B2", "60"),715 new Array("CH", "11111", "B2B2B2B2B2B@", "60"),716 new Array("CY", "11122222", "C3C3C3C3C3C3C3C3", "29"),717 new Array("CY", "1112222", "C3C3C3C3C3C3C3C3", "29"),718 new Array("CY", "X1122222", "C3C3C3C3C3C3C3C3", "29"),719 new Array("CY", "11@22222", "C3C3C3C3C3C3C3C3", "29"),720 new Array("CY", "111X2222", "C3C3C3C3C3C3C3C3", "29"),721 new Array("CY", "1112222@", "C3C3C3C3C3C3C3C3", "29"),722 new Array("CY", "11122222", "@3C3C3C3C3C3C3C3", "29"),723 new Array("CY", "11122222", "C3C3C3C3C3C3C3C@", "29"),724 new Array("CZ", "1111", "2222222222222222", "68"),725 new Array("CZ", "111", "2222222222222222", "68"),726 new Array("CZ", "X111", "2222222222222222", "68"),727 new Array("CZ", "111@", "2222222222222222", "68"),728 new Array("CZ", "1111", "X222222222222222", "68"),729 new Array("CZ", "1111", "222222222222222@", "68"),730 new Array("DE", "11111111", "2222222222", "16"),731 new Array("DE", "1111111", "2222222222", "16"),732 new Array("DE", "X1111111", "2222222222", "16"),733 new Array("DE", "1111111@", "2222222222", "16"),734 new Array("DE", "11111111", "X222222222", "16"),735 new Array("DE", "11111111", "222222222@", "16"),736 new Array("DK", "1111", "2222222223", "79"),737 new Array("DK", "111", "2222222223", "79"),738 new Array("DK", "X111", "2222222223", "79"),739 new Array("DK", "111@", "2222222223", "79"),740 new Array("DK", "1111", "X222222223", "79"),741 new Array("DK", "1111", "22222222@3", "79"),742 new Array("DK", "1111", "222222222X", "79"),743 new Array("EE", "11", "22333333333334", "96"),744 new Array("EE", "1", "22333333333334", "96"),745 new Array("EE", "X1", "22333333333334", "96"),746 new Array("EE", "1@", "22333333333334", "96"),747 new Array("EE", "11", "X2333333333334", "96"),748 new Array("EE", "11", "2@333333333334", "96"),749 new Array("EE", "11", "22X33333333334", "96"),750 new Array("EE", "11", "223333333333@4", "96"),751 new Array("EE", "11", "2233333333333X", "96"),752 new Array("ES", "11112222", "334444444444", "71"),753 new Array("ES", "1111222", "334444444444", "71"),754 new Array("ES", "X1112222", "334444444444", "71"),755 new Array("ES", "111@2222", "334444444444", "71"),756 new Array("ES", "1111X222", "334444444444", "71"),757 new Array("ES", "1111222@", "334444444444", "71"),758 new Array("ES", "11112222", "X34444444444", "71"),759 new Array("ES", "11112222", "3@4444444444", "71"),760 new Array("ES", "11112222", "33X444444444", "71"),761 new Array("ES", "11112222", "33444444444@", "71"),762 new Array("FI", "111111", "22222223", "68"),763 new Array("FI", "11111", "22222223", "68"),764 new Array("FI", "X11111", "22222223", "68"),765 new Array("FI", "11111@", "22222223", "68"),766 new Array("FI", "111111", "X2222223", "68"),767 new Array("FI", "111111", "222222@3", "68"),768 new Array("FI", "111111", "2222222X", "68"),769 new Array("FO", "1111", "2222222223", "49"),770 new Array("FO", "111", "2222222223", "49"),771 new Array("FO", "X111", "2222222223", "49"),772 new Array("FO", "111@", "2222222223", "49"),773 new Array("FO", "1111", "X222222223", "49"),774 new Array("FO", "1111", "22222222@3", "49"),775 new Array("FO", "1111", "222222222X", "49"),776 new Array("FR", "1111122222", "C3C3C3C3C3C44", "44"),777 new Array("FR", "111112222", "C3C3C3C3C3C44", "44"),778 new Array("FR", "X111122222", "C3C3C3C3C3C44", "44"),779 new Array("FR", "1111@22222", "C3C3C3C3C3C44", "44"),780 new Array("FR", "11111X2222", "C3C3C3C3C3C44", "44"),781 new Array("FR", "111112222@", "C3C3C3C3C3C44", "44"),782 new Array("FR", "1111122222", "@3C3C3C3C3C44", "44"),783 new Array("FR", "1111122222", "C3C3C3C3C3@44", "44"),784 new Array("FR", "1111122222", "C3C3C3C3C3CX4", "44"),785 new Array("FR", "1111122222", "C3C3C3C3C3C4@", "44"),786 new Array("GB", "AAAA222222", "33333333", "45"),787 new Array("GB", "AAAA22222", "33333333", "45"),788 new Array("GB", "8AAA222222", "33333333", "45"),789 new Array("GB", "AAA@222222", "33333333", "45"),790 new Array("GB", "AAAAX22222", "33333333", "45"),791 new Array("GB", "AAAA22222@", "33333333", "45"),792 new Array("GB", "AAAA222222", "X3333333", "45"),793 new Array("GB", "AAAA222222", "3333333@", "45"),794 new Array("GE", "AA", "2222222222222222", "98"),795 new Array("GE", "A", "2222222222222222", "98"),796 new Array("GE", "8A", "2222222222222222", "98"),797 new Array("GE", "A@", "2222222222222222", "98"),798 new Array("GE", "AA", "X222222222222222", "98"),799 new Array("GE", "AA", "222222222222222@", "98"),800 new Array("GI", "AAAA", "B2B2B2B2B2B2B2B", "72"),801 new Array("GI", "AAA", "B2B2B2B2B2B2B2B", "72"),802 new Array("GI", "8AAA", "B2B2B2B2B2B2B2B", "72"),803 new Array("GI", "AAA@", "B2B2B2B2B2B2B2B", "72"),804 new Array("GI", "AAAA", "@2B2B2B2B2B2B2B", "72"),805 new Array("GI", "AAAA", "B2B2B2B2B2B2B2@", "72"),806 new Array("GL", "1111", "2222222223", "49"),807 new Array("GL", "111", "2222222223", "49"),808 new Array("GL", "X111", "2222222223", "49"),809 new Array("GL", "111@", "2222222223", "49"),810 new Array("GL", "1111", "X222222223", "49"),811 new Array("GL", "1111", "22222222@3", "49"),812 new Array("GL", "1111", "222222222X", "49"),813 new Array("GR", "1112222", "C3C3C3C3C3C3C3C3", "61"),814 new Array("GR", "111222", "C3C3C3C3C3C3C3C3", "61"),815 new Array("GR", "X112222", "C3C3C3C3C3C3C3C3", "61"),816 new Array("GR", "11@2222", "C3C3C3C3C3C3C3C3", "61"),817 new Array("GR", "111X222", "C3C3C3C3C3C3C3C3", "61"),818 new Array("GR", "111222@", "C3C3C3C3C3C3C3C3", "61"),819 new Array("GR", "1112222", "@3C3C3C3C3C3C3C3", "61"),820 new Array("GR", "1112222", "C3C3C3C3C3C3C3C@", "61"),821 new Array("HR", "1111111", "2222222222", "94"),822 new Array("HR", "111111", "2222222222", "94"),823 new Array("HR", "X111111", "2222222222", "94"),824 new Array("HR", "111111@", "2222222222", "94"),825 new Array("HR", "1111111", "X222222222", "94"),826 new Array("HR", "1111111", "222222222@", "94"),827 new Array("HU", "1112222", "34444444444444445", "35"),828 new Array("HU", "111222", "34444444444444445", "35"),829 new Array("HU", "X112222", "34444444444444445", "35"),830 new Array("HU", "11@2222", "34444444444444445", "35"),831 new Array("HU", "111X222", "34444444444444445", "35"),832 new Array("HU", "111222@", "34444444444444445", "35"),833 new Array("HU", "1112222", "X4444444444444445", "35"),834 new Array("HU", "1112222", "3X444444444444445", "35"),835 new Array("HU", "1112222", "344444444444444@5", "35"),836 new Array("HU", "1112222", "3444444444444444X", "35"),837 new Array("IE", "AAAA222222", "33333333", "18"),838 new Array("IE", "AAAA22222", "33333333", "18"),839 new Array("IE", "8AAA222222", "33333333", "18"),840 new Array("IE", "AAA@222222", "33333333", "18"),841 new Array("IE", "AAAAX22222", "33333333", "18"),842 new Array("IE", "AAAA22222@", "33333333", "18"),843 new Array("IE", "AAAA222222", "X3333333", "18"),844 new Array("IE", "AAAA222222", "3333333@", "18"),845 new Array("IL", "111222", "3333333344", "64"),846 new Array("IL", "11122", "3333333344", "64"),847 new Array("IL", "X11222", "3333333344", "64"),848 new Array("IL", "11@222", "3333333344", "64"),849 new Array("IL", "111X22", "3333333344", "64"),850 new Array("IL", "11122@", "3333333344", "64"),851 new Array("IL", "111222", "X333333333333", "64"),852 new Array("IL", "111222", "333333333333@", "64"),853 new Array("IS", "1111", "223333333333333333", "12"),854 new Array("IS", "111", "223333333333333333", "12"),855 new Array("IS", "X111", "223333333333333333", "12"),856 new Array("IS", "111@", "223333333333333333", "12"),857 new Array("IS", "1111", "X23333333333333333", "12"),858 new Array("IS", "1111", "2@3333333333333333", "12"),859 new Array("IS", "1111", "22X333333333333333", "12"),860 new Array("IS", "1111", "22333333333333333@", "12"),861 new Array("IT", "A2222233333", "D4D4D4D4D4D4", "43"),862 new Array("IT", "A222223333", "D4D4D4D4D4D4", "43"),863 new Array("IT", "82222233333", "D4D4D4D4D4D4", "43"),864 new Array("IT", "AX222233333", "D4D4D4D4D4D4", "43"),865 new Array("IT", "A2222@33333", "D4D4D4D4D4D4", "43"),866 new Array("IT", "A22222X3333", "D4D4D4D4D4D4", "43"),867 new Array("IT", "A222223333@", "D4D4D4D4D4D4", "43"),868 new Array("IT", "A2222233333", "@4D4D4D4D4D4", "43"),869 new Array("IT", "A2222233333", "D4D4D4D4D4D@", "43"),870 new Array("KW", "AAAA", "B2B2B2B2B2B2B2B2B2B2B2", "93"),871 new Array("KW", "AAA", "B2B2B2B2B2B2B2B2B2B2B2", "93"),872 new Array("KW", "8AAA", "B2B2B2B2B2B2B2B2B2B2B2", "93"),873 new Array("KW", "AAA@", "B2B2B2B2B2B2B2B2B2B2B2", "93"),874 new Array("KW", "AAAA", "@2B2B2B2B2B2B2B2B2B2B2", "93"),875 new Array("KW", "AAAA", "B2B2B2B2B2B2B2B2B2B2B@", "93"),876 new Array("KZ", "111", "B2B2B2B2B2B2B", "21"),877 new Array("KZ", "11", "B2B2B2B2B2B2B", "21"),878 new Array("KZ", "X11", "B2B2B2B2B2B2B", "21"),879 new Array("KZ", "11@", "B2B2B2B2B2B2B", "21"),880 new Array("KZ", "111", "@2B2B2B2B2B2B", "21"),881 new Array("KZ", "111", "B2B2B2B2B2B2@", "21"),882 new Array("LB", "1111", "B2B2B2B2B2B2B2B2B2B2", "88"),883 new Array("LB", "111", "B2B2B2B2B2B2B2B2B2B2", "88"),884 new Array("LB", "X111", "B2B2B2B2B2B2B2B2B2B2", "88"),885 new Array("LB", "111@", "B2B2B2B2B2B2B2B2B2B2", "88"),886 new Array("LB", "1111", "@2B2B2B2B2B2B2B2B2B2", "88"),887 new Array("LB", "1111", "B2B2B2B2B2B2B2B2B2B@", "88"),888 new Array("LI", "11111", "B2B2B2B2B2B2", "73"),889 new Array("LI", "1111", "B2B2B2B2B2B2", "73"),890 new Array("LI", "X1111", "B2B2B2B2B2B2", "73"),891 new Array("LI", "1111@", "B2B2B2B2B2B2", "73"),892 new Array("LI", "11111", "@2B2B2B2B2B2", "73"),893 new Array("LI", "11111", "B2B2B2B2B2B@", "73"),894 new Array("LT", "11111", "22222222222", "15"),895 new Array("LT", "1111", "22222222222", "15"),896 new Array("LT", "X1111", "22222222222", "15"),897 new Array("LT", "1111@", "22222222222", "15"),898 new Array("LT", "11111", "X2222222222", "15"),899 new Array("LT", "11111", "2222222222@", "15"),900 new Array("LU", "111", "B2B2B2B2B2B2B", "27"),901 new Array("LU", "11", "B2B2B2B2B2B2B", "27"),902 new Array("LU", "X11", "B2B2B2B2B2B2B", "27"),903 new Array("LU", "11@", "B2B2B2B2B2B2B", "27"),904 new Array("LU", "111", "@2B2B2B2B2B2B", "27"),905 new Array("LU", "111", "B2B2B2B2B2B2@", "27"),906 new Array("LV", "AAAA", "B2B2B2B2B2B2B", "86"),907 new Array("LV", "AAA", "B2B2B2B2B2B2B", "86"),908 new Array("LV", "8AAA", "B2B2B2B2B2B2B", "86"),909 new Array("LV", "AAA@", "B2B2B2B2B2B2B", "86"),910 new Array("LV", "AAAA", "@2B2B2B2B2B2B", "86"),911 new Array("LV", "AAAA", "B2B2B2B2B2B2@", "86"),912 new Array("MC", "1111122222", "C3C3C3C3C3C44", "26"),913 new Array("MC", "111112222", "C3C3C3C3C3C44", "26"),914 new Array("MC", "X111122222", "C3C3C3C3C3C44", "26"),915 new Array("MC", "1111@22222", "C3C3C3C3C3C44", "26"),916 new Array("MC", "11111X2222", "C3C3C3C3C3C44", "26"),917 new Array("MC", "111112222@", "C3C3C3C3C3C44", "26"),918 new Array("MC", "1111122222", "@3C3C3C3C3C44", "26"),919 new Array("MC", "1111122222", "C3C3C3C3C3@44", "26"),920 new Array("MC", "1111122222", "C3C3C3C3C3CX4", "26"),921 new Array("MC", "1111122222", "C3C3C3C3C3C4@", "26"),922 new Array("ME", "111", "222222222222233", "38"),923 new Array("ME", "11", "222222222222233", "38"),924 new Array("ME", "X11", "222222222222233", "38"),925 new Array("ME", "11@", "222222222222233", "38"),926 new Array("ME", "111", "X22222222222233", "38"),927 new Array("ME", "111", "222222222222@33", "38"),928 new Array("ME", "111", "2222222222222X3", "38"),929 new Array("ME", "111", "22222222222223@", "38"),930 new Array("MK", "111", "B2B2B2B2B233", "41"),931 new Array("MK", "11", "B2B2B2B2B233", "41"),932 new Array("MK", "X11", "B2B2B2B2B233", "41"),933 new Array("MK", "11@", "B2B2B2B2B233", "41"),934 new Array("MK", "111", "@2B2B2B2B233", "41"),935 new Array("MK", "111", "B2B2B2B2B@33", "41"),936 new Array("MK", "111", "B2B2B2B2B2X3", "41"),937 new Array("MK", "111", "B2B2B2B2B23@", "41"),938 new Array("MR", "1111122222", "3333333333344", "21"),939 new Array("MR", "111112222", "3333333333344", "21"),940 new Array("MR", "X111122222", "3333333333344", "21"),941 new Array("MR", "1111@22222", "3333333333344", "21"),942 new Array("MR", "11111X2222", "3333333333344", "21"),943 new Array("MR", "111112222@", "3333333333344", "21"),944 new Array("MR", "1111122222", "X333333333344", "21"),945 new Array("MR", "1111122222", "3333333333@44", "21"),946 new Array("MR", "1111122222", "33333333333X4", "21"),947 new Array("MR", "1111122222", "333333333334@", "21"),948 new Array("MT", "AAAA22222", "C3C3C3C3C3C3C3C3C3", "39"),949 new Array("MT", "AAAA2222", "C3C3C3C3C3C3C3C3C3", "39"),950 new Array("MT", "8AAA22222", "C3C3C3C3C3C3C3C3C3", "39"),951 new Array("MT", "AAA@22222", "C3C3C3C3C3C3C3C3C3", "39"),952 new Array("MT", "AAAAX2222", "C3C3C3C3C3C3C3C3C3", "39"),953 new Array("MT", "AAAA2222@", "C3C3C3C3C3C3C3C3C3", "39"),954 new Array("MT", "AAAA22222", "@3C3C3C3C3C3C3C3C3", "39"),955 new Array("MT", "AAAA22222", "C3C3C3C3C3C3C3C3C@", "39"),956 new Array("MU", "AAAA2222", "333333333333333DDD", "37"),957 new Array("MU", "AAAA222", "333333333333333DDD", "37"),958 new Array("MU", "8AAA2222", "333333333333333DDD", "37"),959 new Array("MU", "AAA@2222", "333333333333333DDD", "37"),960 new Array("MU", "AAAAX222", "333333333333333DDD", "37"),961 new Array("MU", "AAAA222@", "333333333333333DDD", "37"),962 new Array("MU", "AAAA2222", "X33333333333333DDD", "37"),963 new Array("MU", "AAAA2222", "33333333333333@DDD", "37"),964 new Array("MU", "AAAA2222", "3333333333333338DD", "37"),965 new Array("MU", "AAAA2222", "333333333333333DD@", "37"),966 new Array("NL", "AAAA", "2222222222", "57"),967 new Array("NL", "AAA", "2222222222", "57"),968 new Array("NL", "8AAA", "2222222222", "57"),969 new Array("NL", "AAA@", "2222222222", "57"),970 new Array("NL", "AAAA", "X222222222", "57"),971 new Array("NL", "AAAA", "222222222@", "57"),972 new Array("NO", "1111", "2222223", "40"),973 new Array("NO", "111", "2222223", "40"),974 new Array("NO", "X111", "2222223", "40"),975 new Array("NO", "111@", "2222223", "40"),976 new Array("NO", "1111", "X222223", "40"),977 new Array("NO", "1111", "22222@3", "40"),978 new Array("NO", "1111", "222222X", "40"),979 new Array("PL", "11111111", "2222222222222222", "84"),980 new Array("PL", "1111111", "2222222222222222", "84"),981 new Array("PL", "X1111111", "2222222222222222", "84"),982 new Array("PL", "1111111@", "2222222222222222", "84"),983 new Array("PL", "11111111", "X222222222222222", "84"),984 new Array("PL", "11111111", "222222222222222@", "84"),985 new Array("PT", "11112222", "3333333333344", "59"),986 new Array("PT", "1111222", "3333333333344", "59"),987 new Array("PT", "X1112222", "3333333333344", "59"),988 new Array("PT", "111@2222", "3333333333344", "59"),989 new Array("PT", "1111X222", "3333333333344", "59"),990 new Array("PT", "1111222@", "3333333333344", "59"),991 new Array("PT", "11112222", "X333333333344", "59"),992 new Array("PT", "11112222", "3333333333@44", "59"),993 new Array("PT", "11112222", "33333333333X4", "59"),994 new Array("PT", "11112222", "333333333334@", "59"),995 new Array("RO", "AAAA", "B2B2B2B2B2B2B2B2", "91"),996 new Array("RO", "AAA", "B2B2B2B2B2B2B2B2", "91"),997 new Array("RO", "8AAA", "B2B2B2B2B2B2B2B2", "91"),998 new Array("RO", "AAA@", "B2B2B2B2B2B2B2B2", "91"),999 new Array("RO", "AAAA", "@2B2B2B2B2B2B2B2", "91"),1000 new Array("RO", "AAAA", "B2B2B2B2B2B2B2B@", "91"),1001 new Array("RS", "111", "222222222222233", "48"),1002 new Array("RS", "11", "222222222222233", "48"),1003 new Array("RS", "X11", "222222222222233", "48"),1004 new Array("RS", "11@", "222222222222233", "48"),1005 new Array("RS", "111", "X22222222222233", "48"),1006 new Array("RS", "111", "222222222222@33", "48"),1007 new Array("RS", "111", "2222222222222X3", "48"),1008 new Array("RS", "111", "22222222222223@", "48"),1009 new Array("SA", "11", "B2B2B2B2B2B2B2B2B2", "46"),1010 new Array("SA", "1", "B2B2B2B2B2B2B2B2B2", "46"),1011 new Array("SA", "X1", "B2B2B2B2B2B2B2B2B2", "46"),1012 new Array("SA", "1@", "B2B2B2B2B2B2B2B2B2", "46"),1013 new Array("SA", "11", "@2B2B2B2B2B2B2B2B2", "46"),1014 new Array("SA", "11", "B2B2B2B2B2B2B2B2B@", "46"),1015 new Array("SE", "111", "22222222222222223", "32"),1016 new Array("SE", "11", "22222222222222223", "32"),1017 new Array("SE", "X11", "22222222222222223", "32"),1018 new Array("SE", "11@", "22222222222222223", "32"),1019 new Array("SE", "111", "X2222222222222223", "32"),1020 new Array("SE", "111", "222222222222222@3", "32"),1021 new Array("SE", "111", "2222222222222222X", "32"),1022 new Array("SI", "11111", "2222222233", "92"),1023 new Array("SI", "1111", "2222222233", "92"),1024 new Array("SI", "X1111", "2222222233", "92"),1025 new Array("SI", "1111@", "2222222233", "92"),1026 new Array("SI", "11111", "X222222233", "92"),1027 new Array("SI", "11111", "2222222@33", "92"),1028 new Array("SI", "11111", "22222222X3", "92"),1029 new Array("SI", "11111", "222222223@", "92"),1030 new Array("SK", "1111", "2222222222222222", "66"),1031 new Array("SK", "111", "2222222222222222", "66"),1032 new Array("SK", "X111", "2222222222222222", "66"),1033 new Array("SK", "111@", "2222222222222222", "66"),1034 new Array("SK", "1111", "X222222222222222", "66"),1035 new Array("SK", "1111", "222222222222222@", "66"),1036 new Array("SM", "A2222233333", "D4D4D4D4D4D4", "71"),1037 new Array("SM", "A222223333", "D4D4D4D4D4D4", "71"),1038 new Array("SM", "82222233333", "D4D4D4D4D4D4", "71"),1039 new Array("SM", "AX222233333", "D4D4D4D4D4D4", "71"),1040 new Array("SM", "A2222@33333", "D4D4D4D4D4D4", "71"),1041 new Array("SM", "A22222X3333", "D4D4D4D4D4D4", "71"),1042 new Array("SM", "A222223333@", "D4D4D4D4D4D4", "71"),1043 new Array("SM", "A2222233333", "@4D4D4D4D4D4", "71"),1044 new Array("SM", "A2222233333", "D4D4D4D4D4D@", "71"),1045 new Array("TN", "11222", "333333333333344", "23"),1046 new Array("TN", "1122", "333333333333344", "23"),1047 new Array("TN", "X1222", "333333333333344", "23"),1048 new Array("TN", "1@222", "333333333333344", "23"),1049 new Array("TN", "11X22", "333333333333344", "23"),1050 new Array("TN", "1122@", "333333333333344", "23"),1051 new Array("TN", "11222", "X33333333333344", "23"),1052 new Array("TN", "11222", "333333333333@44", "23"),1053 new Array("TN", "11222", "3333333333333X4", "23"),1054 new Array("TN", "11222", "33333333333334@", "23"),1055 new Array("TR", "11111", "BC3C3C3C3C3C3C3C3", "95"),1056 new Array("TR", "1111", "BC3C3C3C3C3C3C3C3", "95"),1057 new Array("TR", "X1111", "BC3C3C3C3C3C3C3C3", "95"),1058 new Array("TR", "1111@", "BC3C3C3C3C3C3C3C3", "95"),1059 new Array("TR", "11111", "@C3C3C3C3C3C3C3C3", "95"),1060 new Array("TR", "11111", "B@3C3C3C3C3C3C3C3", "95"),1061 new Array("TR", "11111", "BC3C3C3C3C3C3C3C@", "95"),1062 new Array("DE", "12345678", "5", "06"),1063 new Array("DE", "12345678", "16", "97"),1064 new Array("DE", "12345678", "16", "00"),1065 new Array("DE", "12345678", "95", "98"),1066 new Array("DE", "12345678", "95", "01"));1067// Translation table and translation function for localized versions1068var trans_tab = new Array();1069function _(s)1070{1071 var t = trans_tab[s];1072 if (t)1073 s = t;1074 return s;1075}1076// Fill the translation table1077function fill_trans_tab(trans_data)1078{1079 for (var i = 0; i < trans_data.length / 2; ++i)1080 trans_tab[trans_data[2 * i]] = trans_data[2 * i + 1];1081 // Translate the country names in the iban_data list1082 for (var i = 0; i < iban_data.length; ++i)1083 iban_data[i].name = _(iban_data[i].name);1084}1085// Set debug_output = true if location ends with a hash or a quotation mark1086var debug_output = (location.href.charAt(location.href.length - 1) == "#") ||1087 (location.href.charAt(location.href.length - 1) == "?");1088if (debug_output)1089 debug_iban_data();1090function debug_iban_data()1091{1092 var s = "";1093 for (var i = 0; i < iban_data.length; ++i)1094 {1095 var country = iban_data[i];1096 s += country.name + " / " + country.code + " / ";1097 for (var f = 0; f < country.bank.length; ++f)1098 s += country.bank[f][0] + country.bank[f][1];1099 s += " = " + country.bank_lng + " / ";1100 for (var f = 0; f < country.acc.length; ++f)1101 s += country.acc[f][0] + country.acc[f][1];1102 s += " = " + country.acc_lng + " / " + country.total_lng + "\n";1103 }1104 alert(s);1105}1106function debug_check_vars()1107{1108 var o = false;1109 var s = "";1110 for (var v in window)1111 {1112 if (o)1113 s += "" + v + "=" + window[v] + "\n";1114 if (v == "debug_check_vars")1115 o = true;1116 }1117 if (s != "")1118 alert("vars:\n" + s);1119 else1120 alert("no vars");...
taxi-data.js
Source:taxi-data.js
1var taxiData = [2 new google.maps.LatLng(37.782551, -122.445368),3 new google.maps.LatLng(37.782745, -122.444586),4 new google.maps.LatLng(37.782842, -122.443688),5 new google.maps.LatLng(37.782919, -122.442815),6 new google.maps.LatLng(37.782992, -122.442112),7 new google.maps.LatLng(37.783100, -122.441461),8 new google.maps.LatLng(37.783206, -122.440829),9 new google.maps.LatLng(37.783273, -122.440324),10 new google.maps.LatLng(37.783316, -122.440023),11 new google.maps.LatLng(37.783357, -122.439794),12 new google.maps.LatLng(37.783371, -122.439687),13 new google.maps.LatLng(37.783368, -122.439666),14 new google.maps.LatLng(37.783383, -122.439594),15 new google.maps.LatLng(37.783508, -122.439525),16 new google.maps.LatLng(37.783842, -122.439591),17 new google.maps.LatLng(37.784147, -122.439668),18 new google.maps.LatLng(37.784206, -122.439686),19 new google.maps.LatLng(37.784386, -122.439790),20 new google.maps.LatLng(37.784701, -122.439902),21 new google.maps.LatLng(37.784965, -122.439938),22 new google.maps.LatLng(37.785010, -122.439947),23 new google.maps.LatLng(37.785360, -122.439952),24 new google.maps.LatLng(37.785715, -122.440030),25 new google.maps.LatLng(37.786117, -122.440119),26 new google.maps.LatLng(37.786564, -122.440209),27 new google.maps.LatLng(37.786905, -122.440270),28 new google.maps.LatLng(37.786956, -122.440279),29 new google.maps.LatLng(37.800224, -122.433520),30 new google.maps.LatLng(37.800155, -122.434101),31 new google.maps.LatLng(37.800160, -122.434430),32 new google.maps.LatLng(37.800378, -122.434527),33 new google.maps.LatLng(37.800738, -122.434598),34 new google.maps.LatLng(37.800938, -122.434650),35 new google.maps.LatLng(37.801024, -122.434889),36 new google.maps.LatLng(37.800955, -122.435392),37 new google.maps.LatLng(37.800886, -122.435959),38 new google.maps.LatLng(37.800811, -122.436275),39 new google.maps.LatLng(37.800788, -122.436299),40 new google.maps.LatLng(37.800719, -122.436302),41 new google.maps.LatLng(37.800702, -122.436298),42 new google.maps.LatLng(37.800661, -122.436273),43 new google.maps.LatLng(37.800395, -122.436172),44 new google.maps.LatLng(37.800228, -122.436116),45 new google.maps.LatLng(37.800169, -122.436130),46 new google.maps.LatLng(37.800066, -122.436167),47 new google.maps.LatLng(37.784345, -122.422922),48 new google.maps.LatLng(37.784389, -122.422926),49 new google.maps.LatLng(37.784437, -122.422924),50 new google.maps.LatLng(37.784746, -122.422818),51 new google.maps.LatLng(37.785436, -122.422959),52 new google.maps.LatLng(37.786120, -122.423112),53 new google.maps.LatLng(37.786433, -122.423029),54 new google.maps.LatLng(37.786631, -122.421213),55 new google.maps.LatLng(37.786660, -122.421033),56 new google.maps.LatLng(37.786801, -122.420141),57 new google.maps.LatLng(37.786823, -122.420034),58 new google.maps.LatLng(37.786831, -122.419916),59 new google.maps.LatLng(37.787034, -122.418208),60 new google.maps.LatLng(37.787056, -122.418034),61 new google.maps.LatLng(37.787169, -122.417145),62 new google.maps.LatLng(37.787217, -122.416715),63 new google.maps.LatLng(37.786144, -122.416403),64 new google.maps.LatLng(37.785292, -122.416257),65 new google.maps.LatLng(37.780666, -122.390374),66 new google.maps.LatLng(37.780501, -122.391281),67 new google.maps.LatLng(37.780148, -122.392052),68 new google.maps.LatLng(37.780173, -122.391148),69 new google.maps.LatLng(37.780693, -122.390592),70 new google.maps.LatLng(37.781261, -122.391142),71 new google.maps.LatLng(37.781808, -122.391730),72 new google.maps.LatLng(37.782340, -122.392341),73 new google.maps.LatLng(37.782812, -122.393022),74 new google.maps.LatLng(37.783300, -122.393672),75 new google.maps.LatLng(37.783809, -122.394275),76 new google.maps.LatLng(37.784246, -122.394979),77 new google.maps.LatLng(37.784791, -122.395958),78 new google.maps.LatLng(37.785675, -122.396746),79 new google.maps.LatLng(37.786262, -122.395780),80 new google.maps.LatLng(37.786776, -122.395093),81 new google.maps.LatLng(37.787282, -122.394426),82 new google.maps.LatLng(37.787783, -122.393767),83 new google.maps.LatLng(37.788343, -122.393184),84 new google.maps.LatLng(37.788895, -122.392506),85 new google.maps.LatLng(37.789371, -122.391701),86 new google.maps.LatLng(37.789722, -122.390952),87 new google.maps.LatLng(37.790315, -122.390305),88 new google.maps.LatLng(37.790738, -122.389616),89 new google.maps.LatLng(37.779448, -122.438702),90 new google.maps.LatLng(37.779023, -122.438585),91 new google.maps.LatLng(37.778542, -122.438492),92 new google.maps.LatLng(37.778100, -122.438411),93 new google.maps.LatLng(37.777986, -122.438376),94 new google.maps.LatLng(37.777680, -122.438313),95 new google.maps.LatLng(37.777316, -122.438273),96 new google.maps.LatLng(37.777135, -122.438254),97 new google.maps.LatLng(37.776987, -122.438303),98 new google.maps.LatLng(37.776946, -122.438404),99 new google.maps.LatLng(37.776944, -122.438467),100 new google.maps.LatLng(37.776892, -122.438459),101 new google.maps.LatLng(37.776842, -122.438442),102 new google.maps.LatLng(37.776822, -122.438391),103 new google.maps.LatLng(37.776814, -122.438412),104 new google.maps.LatLng(37.776787, -122.438628),105 new google.maps.LatLng(37.776729, -122.438650),106 new google.maps.LatLng(37.776759, -122.438677),107 new google.maps.LatLng(37.776772, -122.438498),108 new google.maps.LatLng(37.776787, -122.438389),109 new google.maps.LatLng(37.776848, -122.438283),110 new google.maps.LatLng(37.776870, -122.438239),111 new google.maps.LatLng(37.777015, -122.438198),112 new google.maps.LatLng(37.777333, -122.438256),113 new google.maps.LatLng(37.777595, -122.438308),114 new google.maps.LatLng(37.777797, -122.438344),115 new google.maps.LatLng(37.778160, -122.438442),116 new google.maps.LatLng(37.778414, -122.438508),117 new google.maps.LatLng(37.778445, -122.438516),118 new google.maps.LatLng(37.778503, -122.438529),119 new google.maps.LatLng(37.778607, -122.438549),120 new google.maps.LatLng(37.778670, -122.438644),121 new google.maps.LatLng(37.778847, -122.438706),122 new google.maps.LatLng(37.779240, -122.438744),123 new google.maps.LatLng(37.779738, -122.438822),124 new google.maps.LatLng(37.780201, -122.438882),125 new google.maps.LatLng(37.780400, -122.438905),126 new google.maps.LatLng(37.780501, -122.438921),127 new google.maps.LatLng(37.780892, -122.438986),128 new google.maps.LatLng(37.781446, -122.439087),129 new google.maps.LatLng(37.781985, -122.439199),130 new google.maps.LatLng(37.782239, -122.439249),131 new google.maps.LatLng(37.782286, -122.439266),132 new google.maps.LatLng(37.797847, -122.429388),133 new google.maps.LatLng(37.797874, -122.429180),134 new google.maps.LatLng(37.797885, -122.429069),135 new google.maps.LatLng(37.797887, -122.429050),136 new google.maps.LatLng(37.797933, -122.428954),137 new google.maps.LatLng(37.798242, -122.428990),138 new google.maps.LatLng(37.798617, -122.429075),139 new google.maps.LatLng(37.798719, -122.429092),140 new google.maps.LatLng(37.798944, -122.429145),141 new google.maps.LatLng(37.799320, -122.429251),142 new google.maps.LatLng(37.799590, -122.429309),143 new google.maps.LatLng(37.799677, -122.429324),144 new google.maps.LatLng(37.799966, -122.429360),145 new google.maps.LatLng(37.800288, -122.429430),146 new google.maps.LatLng(37.800443, -122.429461),147 new google.maps.LatLng(37.800465, -122.429474),148 new google.maps.LatLng(37.800644, -122.429540),149 new google.maps.LatLng(37.800948, -122.429620),150 new google.maps.LatLng(37.801242, -122.429685),151 new google.maps.LatLng(37.801375, -122.429702),152 new google.maps.LatLng(37.801400, -122.429703),153 new google.maps.LatLng(37.801453, -122.429707),154 new google.maps.LatLng(37.801473, -122.429709),155 new google.maps.LatLng(37.801532, -122.429707),156 new google.maps.LatLng(37.801852, -122.429729),157 new google.maps.LatLng(37.802173, -122.429789),158 new google.maps.LatLng(37.802459, -122.429847),159 new google.maps.LatLng(37.802554, -122.429825),160 new google.maps.LatLng(37.802647, -122.429549),161 new google.maps.LatLng(37.802693, -122.429179),162 new google.maps.LatLng(37.802729, -122.428751),163 new google.maps.LatLng(37.766104, -122.409291),164 new google.maps.LatLng(37.766103, -122.409268),165 new google.maps.LatLng(37.766138, -122.409229),166 new google.maps.LatLng(37.766183, -122.409231),167 new google.maps.LatLng(37.766153, -122.409276),168 new google.maps.LatLng(37.766005, -122.409365),169 new google.maps.LatLng(37.765897, -122.409570),170 new google.maps.LatLng(37.765767, -122.409739),171 new google.maps.LatLng(37.765693, -122.410389),172 new google.maps.LatLng(37.765615, -122.411201),173 new google.maps.LatLng(37.765533, -122.412121),174 new google.maps.LatLng(37.765467, -122.412939),175 new google.maps.LatLng(37.765444, -122.414821),176 new google.maps.LatLng(37.765444, -122.414964),177 new google.maps.LatLng(37.765318, -122.415424),178 new google.maps.LatLng(37.763961, -122.415296),179 new google.maps.LatLng(37.763115, -122.415196),180 new google.maps.LatLng(37.762967, -122.415183),181 new google.maps.LatLng(37.762278, -122.415127),182 new google.maps.LatLng(37.761675, -122.415055),183 new google.maps.LatLng(37.760932, -122.414988),184 new google.maps.LatLng(37.759337, -122.414862),185 new google.maps.LatLng(37.773187, -122.421922),186 new google.maps.LatLng(37.773043, -122.422118),187 new google.maps.LatLng(37.773007, -122.422165),188 new google.maps.LatLng(37.772979, -122.422219),189 new google.maps.LatLng(37.772865, -122.422394),190 new google.maps.LatLng(37.772779, -122.422503),191 new google.maps.LatLng(37.772676, -122.422701),192 new google.maps.LatLng(37.772606, -122.422806),193 new google.maps.LatLng(37.772566, -122.422840),194 new google.maps.LatLng(37.772508, -122.422852),195 new google.maps.LatLng(37.772387, -122.423011),196 new google.maps.LatLng(37.772099, -122.423328),197 new google.maps.LatLng(37.771704, -122.423783),198 new google.maps.LatLng(37.771481, -122.424081),199 new google.maps.LatLng(37.771400, -122.424179),200 new google.maps.LatLng(37.771352, -122.424220),201 new google.maps.LatLng(37.771248, -122.424327),202 new google.maps.LatLng(37.770904, -122.424781),203 new google.maps.LatLng(37.770520, -122.425283),204 new google.maps.LatLng(37.770337, -122.425553),205 new google.maps.LatLng(37.770128, -122.425832),206 new google.maps.LatLng(37.769756, -122.426331),207 new google.maps.LatLng(37.769300, -122.426902),208 new google.maps.LatLng(37.769132, -122.427065),209 new google.maps.LatLng(37.769092, -122.427103),210 new google.maps.LatLng(37.768979, -122.427172),211 new google.maps.LatLng(37.768595, -122.427634),212 new google.maps.LatLng(37.768372, -122.427913),213 new google.maps.LatLng(37.768337, -122.427961),214 new google.maps.LatLng(37.768244, -122.428138),215 new google.maps.LatLng(37.767942, -122.428581),216 new google.maps.LatLng(37.767482, -122.429094),217 new google.maps.LatLng(37.767031, -122.429606),218 new google.maps.LatLng(37.766732, -122.429986),219 new google.maps.LatLng(37.766680, -122.430058),220 new google.maps.LatLng(37.766633, -122.430109),221 new google.maps.LatLng(37.766580, -122.430211),222 new google.maps.LatLng(37.766367, -122.430594),223 new google.maps.LatLng(37.765910, -122.431137),224 new google.maps.LatLng(37.765353, -122.431806),225 new google.maps.LatLng(37.764962, -122.432298),226 new google.maps.LatLng(37.764868, -122.432486),227 new google.maps.LatLng(37.764518, -122.432913),228 new google.maps.LatLng(37.763435, -122.434173),229 new google.maps.LatLng(37.762847, -122.434953),230 new google.maps.LatLng(37.762291, -122.435935),231 new google.maps.LatLng(37.762224, -122.436074),232 new google.maps.LatLng(37.761957, -122.436892),233 new google.maps.LatLng(37.761652, -122.438886),234 new google.maps.LatLng(37.761284, -122.439955),235 new google.maps.LatLng(37.761210, -122.440068),236 new google.maps.LatLng(37.761064, -122.440720),237 new google.maps.LatLng(37.761040, -122.441411),238 new google.maps.LatLng(37.761048, -122.442324),239 new google.maps.LatLng(37.760851, -122.443118),240 new google.maps.LatLng(37.759977, -122.444591),241 new google.maps.LatLng(37.759913, -122.444698),242 new google.maps.LatLng(37.759623, -122.445065),243 new google.maps.LatLng(37.758902, -122.445158),244 new google.maps.LatLng(37.758428, -122.444570),245 new google.maps.LatLng(37.757687, -122.443340),246 new google.maps.LatLng(37.757583, -122.443240),247 new google.maps.LatLng(37.757019, -122.442787),248 new google.maps.LatLng(37.756603, -122.442322),249 new google.maps.LatLng(37.756380, -122.441602),250 new google.maps.LatLng(37.755790, -122.441382),251 new google.maps.LatLng(37.754493, -122.442133),252 new google.maps.LatLng(37.754361, -122.442206),253 new google.maps.LatLng(37.753719, -122.442650),254 new google.maps.LatLng(37.753096, -122.442915),255 new google.maps.LatLng(37.751617, -122.443211),256 new google.maps.LatLng(37.751496, -122.443246),257 new google.maps.LatLng(37.750733, -122.443428),258 new google.maps.LatLng(37.750126, -122.443536),259 new google.maps.LatLng(37.750103, -122.443784),260 new google.maps.LatLng(37.750390, -122.444010),261 new google.maps.LatLng(37.750448, -122.444013),262 new google.maps.LatLng(37.750536, -122.444040),263 new google.maps.LatLng(37.750493, -122.444141),264 new google.maps.LatLng(37.790859, -122.402808),265 new google.maps.LatLng(37.790864, -122.402768),266 new google.maps.LatLng(37.790995, -122.402539),267 new google.maps.LatLng(37.791148, -122.402172),268 new google.maps.LatLng(37.791385, -122.401312),269 new google.maps.LatLng(37.791405, -122.400776),270 new google.maps.LatLng(37.791288, -122.400528),271 new google.maps.LatLng(37.791113, -122.400441),272 new google.maps.LatLng(37.791027, -122.400395),273 new google.maps.LatLng(37.791094, -122.400311),274 new google.maps.LatLng(37.791211, -122.400183),275 new google.maps.LatLng(37.791060, -122.399334),276 new google.maps.LatLng(37.790538, -122.398718),277 new google.maps.LatLng(37.790095, -122.398086),278 new google.maps.LatLng(37.789644, -122.397360),279 new google.maps.LatLng(37.789254, -122.396844),280 new google.maps.LatLng(37.788855, -122.396397),281 new google.maps.LatLng(37.788483, -122.395963),282 new google.maps.LatLng(37.788015, -122.395365),283 new google.maps.LatLng(37.787558, -122.394735),284 new google.maps.LatLng(37.787472, -122.394323),285 new google.maps.LatLng(37.787630, -122.394025),286 new google.maps.LatLng(37.787767, -122.393987),287 new google.maps.LatLng(37.787486, -122.394452),288 new google.maps.LatLng(37.786977, -122.395043),289 new google.maps.LatLng(37.786583, -122.395552),290 new google.maps.LatLng(37.786540, -122.395610),291 new google.maps.LatLng(37.786516, -122.395659),292 new google.maps.LatLng(37.786378, -122.395707),293 new google.maps.LatLng(37.786044, -122.395362),294 new google.maps.LatLng(37.785598, -122.394715),295 new google.maps.LatLng(37.785321, -122.394361),296 new google.maps.LatLng(37.785207, -122.394236),297 new google.maps.LatLng(37.785751, -122.394062),298 new google.maps.LatLng(37.785996, -122.393881),299 new google.maps.LatLng(37.786092, -122.393830),300 new google.maps.LatLng(37.785998, -122.393899),301 new google.maps.LatLng(37.785114, -122.394365),302 new google.maps.LatLng(37.785022, -122.394441),303 new google.maps.LatLng(37.784823, -122.394635),304 new google.maps.LatLng(37.784719, -122.394629),305 new google.maps.LatLng(37.785069, -122.394176),306 new google.maps.LatLng(37.785500, -122.393650),307 new google.maps.LatLng(37.785770, -122.393291),308 new google.maps.LatLng(37.785839, -122.393159),309 new google.maps.LatLng(37.782651, -122.400628),310 new google.maps.LatLng(37.782616, -122.400599),311 new google.maps.LatLng(37.782702, -122.400470),312 new google.maps.LatLng(37.782915, -122.400192),313 new google.maps.LatLng(37.783137, -122.399887),314 new google.maps.LatLng(37.783414, -122.399519),315 new google.maps.LatLng(37.783629, -122.399237),316 new google.maps.LatLng(37.783688, -122.399157),317 new google.maps.LatLng(37.783716, -122.399106),318 new google.maps.LatLng(37.783798, -122.399072),319 new google.maps.LatLng(37.783997, -122.399186),320 new google.maps.LatLng(37.784271, -122.399538),321 new google.maps.LatLng(37.784577, -122.399948),322 new google.maps.LatLng(37.784828, -122.400260),323 new google.maps.LatLng(37.784999, -122.400477),324 new google.maps.LatLng(37.785113, -122.400651),325 new google.maps.LatLng(37.785155, -122.400703),326 new google.maps.LatLng(37.785192, -122.400749),327 new google.maps.LatLng(37.785278, -122.400839),328 new google.maps.LatLng(37.785387, -122.400857),329 new google.maps.LatLng(37.785478, -122.400890),330 new google.maps.LatLng(37.785526, -122.401022),331 new google.maps.LatLng(37.785598, -122.401148),332 new google.maps.LatLng(37.785631, -122.401202),333 new google.maps.LatLng(37.785660, -122.401267),334 new google.maps.LatLng(37.803986, -122.426035),335 new google.maps.LatLng(37.804102, -122.425089),336 new google.maps.LatLng(37.804211, -122.424156),337 new google.maps.LatLng(37.803861, -122.423385),338 new google.maps.LatLng(37.803151, -122.423214),339 new google.maps.LatLng(37.802439, -122.423077),340 new google.maps.LatLng(37.801740, -122.422905),341 new google.maps.LatLng(37.801069, -122.422785),342 new google.maps.LatLng(37.800345, -122.422649),343 new google.maps.LatLng(37.799633, -122.422603),344 new google.maps.LatLng(37.799750, -122.421700),345 new google.maps.LatLng(37.799885, -122.420854),346 new google.maps.LatLng(37.799209, -122.420607),347 new google.maps.LatLng(37.795656, -122.400395),348 new google.maps.LatLng(37.795203, -122.400304),349 new google.maps.LatLng(37.778738, -122.415584),350 new google.maps.LatLng(37.778812, -122.415189),351 new google.maps.LatLng(37.778824, -122.415092),352 new google.maps.LatLng(37.778833, -122.414932),353 new google.maps.LatLng(37.778834, -122.414898),354 new google.maps.LatLng(37.778740, -122.414757),355 new google.maps.LatLng(37.778501, -122.414433),356 new google.maps.LatLng(37.778182, -122.414026),357 new google.maps.LatLng(37.777851, -122.413623),358 new google.maps.LatLng(37.777486, -122.413166),359 new google.maps.LatLng(37.777109, -122.412674),360 new google.maps.LatLng(37.776743, -122.412186),361 new google.maps.LatLng(37.776440, -122.411800),362 new google.maps.LatLng(37.776295, -122.411614),363 new google.maps.LatLng(37.776158, -122.411440),364 new google.maps.LatLng(37.775806, -122.410997),365 new google.maps.LatLng(37.775422, -122.410484),366 new google.maps.LatLng(37.775126, -122.410087),367 new google.maps.LatLng(37.775012, -122.409854),368 new google.maps.LatLng(37.775164, -122.409573),369 new google.maps.LatLng(37.775498, -122.409180),370 new google.maps.LatLng(37.775868, -122.408730),371 new google.maps.LatLng(37.776256, -122.408240),372 new google.maps.LatLng(37.776519, -122.407928),373 new google.maps.LatLng(37.776539, -122.407904),374 new google.maps.LatLng(37.776595, -122.407854),375 new google.maps.LatLng(37.776853, -122.407547),376 new google.maps.LatLng(37.777234, -122.407087),377 new google.maps.LatLng(37.777644, -122.406558),378 new google.maps.LatLng(37.778066, -122.406017),379 new google.maps.LatLng(37.778468, -122.405499),380 new google.maps.LatLng(37.778866, -122.404995),381 new google.maps.LatLng(37.779295, -122.404455),382 new google.maps.LatLng(37.779695, -122.403950),383 new google.maps.LatLng(37.779982, -122.403584),384 new google.maps.LatLng(37.780295, -122.403223),385 new google.maps.LatLng(37.780664, -122.402766),386 new google.maps.LatLng(37.781043, -122.402288),387 new google.maps.LatLng(37.781399, -122.401823),388 new google.maps.LatLng(37.781727, -122.401407),389 new google.maps.LatLng(37.781853, -122.401247),390 new google.maps.LatLng(37.781894, -122.401195),391 new google.maps.LatLng(37.782076, -122.400977),392 new google.maps.LatLng(37.782338, -122.400603),393 new google.maps.LatLng(37.782666, -122.400133),394 new google.maps.LatLng(37.783048, -122.399634),395 new google.maps.LatLng(37.783450, -122.399198),396 new google.maps.LatLng(37.783791, -122.398998),397 new google.maps.LatLng(37.784177, -122.398959),398 new google.maps.LatLng(37.784388, -122.398971),399 new google.maps.LatLng(37.784404, -122.399128),400 new google.maps.LatLng(37.784586, -122.399524),401 new google.maps.LatLng(37.784835, -122.399927),402 new google.maps.LatLng(37.785116, -122.400307),403 new google.maps.LatLng(37.785282, -122.400539),404 new google.maps.LatLng(37.785346, -122.400692),405 new google.maps.LatLng(37.765769, -122.407201),406 new google.maps.LatLng(37.765790, -122.407414),407 new google.maps.LatLng(37.765802, -122.407755),408 new google.maps.LatLng(37.765791, -122.408219),409 new google.maps.LatLng(37.765763, -122.408759),410 new google.maps.LatLng(37.765726, -122.409348),411 new google.maps.LatLng(37.765716, -122.409882),412 new google.maps.LatLng(37.765708, -122.410202),413 new google.maps.LatLng(37.765705, -122.410253),414 new google.maps.LatLng(37.765707, -122.410369),415 new google.maps.LatLng(37.765692, -122.410720),416 new google.maps.LatLng(37.765699, -122.411215),417 new google.maps.LatLng(37.765687, -122.411789),418 new google.maps.LatLng(37.765666, -122.412373),419 new google.maps.LatLng(37.765598, -122.412883),420 new google.maps.LatLng(37.765543, -122.413039),421 new google.maps.LatLng(37.765532, -122.413125),422 new google.maps.LatLng(37.765500, -122.413553),423 new google.maps.LatLng(37.765448, -122.414053),424 new google.maps.LatLng(37.765388, -122.414645),425 new google.maps.LatLng(37.765323, -122.415250),426 new google.maps.LatLng(37.765303, -122.415847),427 new google.maps.LatLng(37.765251, -122.416439),428 new google.maps.LatLng(37.765204, -122.417020),429 new google.maps.LatLng(37.765172, -122.417556),430 new google.maps.LatLng(37.765164, -122.418075),431 new google.maps.LatLng(37.765153, -122.418618),432 new google.maps.LatLng(37.765136, -122.419112),433 new google.maps.LatLng(37.765129, -122.419378),434 new google.maps.LatLng(37.765119, -122.419481),435 new google.maps.LatLng(37.765100, -122.419852),436 new google.maps.LatLng(37.765083, -122.420349),437 new google.maps.LatLng(37.765045, -122.420930),438 new google.maps.LatLng(37.764992, -122.421481),439 new google.maps.LatLng(37.764980, -122.421695),440 new google.maps.LatLng(37.764993, -122.421843),441 new google.maps.LatLng(37.764986, -122.422255),442 new google.maps.LatLng(37.764975, -122.422823),443 new google.maps.LatLng(37.764939, -122.423411),444 new google.maps.LatLng(37.764902, -122.424014),445 new google.maps.LatLng(37.764853, -122.424576),446 new google.maps.LatLng(37.764826, -122.424922),447 new google.maps.LatLng(37.764796, -122.425375),448 new google.maps.LatLng(37.764782, -122.425869),449 new google.maps.LatLng(37.764768, -122.426089),450 new google.maps.LatLng(37.764766, -122.426117),451 new google.maps.LatLng(37.764723, -122.426276),452 new google.maps.LatLng(37.764681, -122.426649),453 new google.maps.LatLng(37.782012, -122.404200),454 new google.maps.LatLng(37.781574, -122.404911),455 new google.maps.LatLng(37.781055, -122.405597),456 new google.maps.LatLng(37.780479, -122.406341),457 new google.maps.LatLng(37.779996, -122.406939),458 new google.maps.LatLng(37.779459, -122.407613),459 new google.maps.LatLng(37.778953, -122.408228),460 new google.maps.LatLng(37.778409, -122.408839),461 new google.maps.LatLng(37.777842, -122.409501),462 new google.maps.LatLng(37.777334, -122.410181),463 new google.maps.LatLng(37.776809, -122.410836),464 new google.maps.LatLng(37.776240, -122.411514),465 new google.maps.LatLng(37.775725, -122.412145),466 new google.maps.LatLng(37.775190, -122.412805),467 new google.maps.LatLng(37.774672, -122.413464),468 new google.maps.LatLng(37.774084, -122.414186),469 new google.maps.LatLng(37.773533, -122.413636),470 new google.maps.LatLng(37.773021, -122.413009),471 new google.maps.LatLng(37.772501, -122.412371),472 new google.maps.LatLng(37.771964, -122.411681),473 new google.maps.LatLng(37.771479, -122.411078),474 new google.maps.LatLng(37.770992, -122.410477),475 new google.maps.LatLng(37.770467, -122.409801),476 new google.maps.LatLng(37.770090, -122.408904),477 new google.maps.LatLng(37.769657, -122.408103),478 new google.maps.LatLng(37.769132, -122.407276),479 new google.maps.LatLng(37.768564, -122.406469),480 new google.maps.LatLng(37.767980, -122.405745),481 new google.maps.LatLng(37.767380, -122.405299),482 new google.maps.LatLng(37.766604, -122.405297),483 new google.maps.LatLng(37.765838, -122.405200),484 new google.maps.LatLng(37.765139, -122.405139),485 new google.maps.LatLng(37.764457, -122.405094),486 new google.maps.LatLng(37.763716, -122.405142),487 new google.maps.LatLng(37.762932, -122.405398),488 new google.maps.LatLng(37.762126, -122.405813),489 new google.maps.LatLng(37.761344, -122.406215),490 new google.maps.LatLng(37.760556, -122.406495),491 new google.maps.LatLng(37.759732, -122.406484),492 new google.maps.LatLng(37.758910, -122.406228),493 new google.maps.LatLng(37.758182, -122.405695),494 new google.maps.LatLng(37.757676, -122.405118),495 new google.maps.LatLng(37.757039, -122.404346),496 new google.maps.LatLng(37.756335, -122.403719),497 new google.maps.LatLng(37.755503, -122.403406),498 new google.maps.LatLng(37.754665, -122.403242),499 new google.maps.LatLng(37.753837, -122.403172),500 new google.maps.LatLng(37.752986, -122.403112),501 new google.maps.LatLng(37.751266, -122.403355)...
wcdma_list.js
Source:wcdma_list.js
1/* combined all protocol into this database */2function gen_country_list(){3 countrylist = new Array();4 countrylist.push(["Others", ""]);5 countrylist.push(["Australia", "AU"]);6 countrylist.push(["Austria", "AT"]);7 countrylist.push(["Bosnia and Herzegovina", "BA"]);8 countrylist.push(["Brazil", "BR"]);9 countrylist.push(["Brunei", "BN"]);10 countrylist.push(["Bulgaria", "BG"]);11 countrylist.push(["Canada", "CA"]);12 countrylist.push(["China", "CN"]);13 countrylist.push(["Czech", "CZ"]);14 countrylist.push(["Denmark", "DK"]);15 countrylist.push(["Dominican Republic", "DO"]);16 countrylist.push(["Egypt", "EG"]);17 countrylist.push(["Finland", "FI"]);18 countrylist.push(["Germany", "DE"]);19 countrylist.push(["Greece", "GR"]);20 countrylist.push(["Hong Kong", "HK"]);21 countrylist.push(["India", "IN"]);22 countrylist.push(["Indonesia", "ID"]);23 countrylist.push(["Israel", "IL"]);24 countrylist.push(["Italy", "IT"]);25 countrylist.push(["Japan", "JP"]);26 countrylist.push(["Malaysia", "MY"]);27 countrylist.push(["Netherlands", "NL"]);28 countrylist.push(["New Zealand", "NZ"]);29 countrylist.push(["Norway", "NO"]);30 countrylist.push(["Philippines", "PH"]);31 countrylist.push(["Poland", "PL"]);32 countrylist.push(["Portugal", "PT"]);33 countrylist.push(["Romania", "RO"]);34 countrylist.push(["Russia", "RU"]);35 countrylist.push(["Singapore", "SG"]);36 countrylist.push(["Slovakia", "SK"]);37 countrylist.push(["South Africa", "ZA"]);38 countrylist.push(["Spain", "ES"]);39 countrylist.push(["Sweden", "SE"]);40 countrylist.push(["Taiwan", "TW"]);41 countrylist.push(["Thailand", "TH"]);42 countrylist.push(["Turkey", "TR"]);43 countrylist.push(["Ukraine", "UA"]);44 countrylist.push(["United Kingdom", "UK"]);45 countrylist.push(["USA", "US"]);46 countrylist.push(["Vietnam", "VN"]);47 var got_country = 0;48 free_options(document.form.modem_country);49 document.form.modem_country.options.length = countrylist.length;50 for(var i = 0; i < countrylist.length; i++){51 document.form.modem_country.options[i] = new Option(countrylist[i][0], countrylist[i][1]);52 if(countrylist[i][1] == country){53 got_country = 1;54 document.form.modem_country.options[i].selected = "1";55 }56 }57 if(!got_country)58 document.form.modem_country.options[0].selected = "1";59}60// 1:WCDMA 2:CMDA2000 3.TD-SCDMA 4.WiMAX61function gen_list(){62 var country = document.form.modem_country.value;63 if(country == "AU"){64 protolist = new Array("1", "1", "1", "1", "1", "1", "1", "1", "1", "1");65 isplist = new Array("Telstra", "Optus", "3", "3 PrePaid", "Vodafone", "iburst", "Dodo", "Exetel", "Internode", "TPG");66 apnlist = new Array("telstra.internet", "Internet", "3netaccess", "3services", "vfprepaymbb", "internet", "DODOLNS1", "exetel1", "splns333a1", "internet")67 daillist = new Array("*99#", "*99#", "*99***1#", "*99***1#", "*99#", "*99***1#", "*99#", "*99***1#", "*99***1#", "*99***1#")68 userlist = new Array("", "", "", "", "", "", "", "", "", "");69 passlist = new Array("", "", "", "", "", "", "", "", "", "");70 }71 else if(country == "AT"){72 protolist = new Array("1", "1", "1", "1", "1", "1", "1", "1");73 isplist = new Array("T-Mobile", "Orange APN", "Mobilkom Austria (A1)", "3 Ãsterreich", "Ge org", "Bob.at", "tele.ring", "yesss");74 apnlist = new Array("gprsinternet", "web.one.at", "a1.net", "drei.at", "web", "bob.at", "WEB", "web.yesss.at");75 daillist = new Array("*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#");76 userlist = new Array("gprs", "web", "ppp@a1plus.at", "", "web@telering.at", "data@bob.at", "web@telering.at", "");77 passlist = new Array("", "web", "ppp", "", "d2Vi", "ppp", "web", "");78 }79 else if(country == "BA"){80 protolist = new Array("1");81 isplist = new Array("T3");82 apnlist = new Array("");83 daillist = new Array("#777");84 userlist = new Array("t3net");85 passlist = new Array("t3net");86 }87 else if(country == "BR"){88 protolist = new Array("1", "1", "1", "1");89 isplist = new Array("Vivo", "TIM", "Oi", "Claro BR");90 apnlist = new Array("zap.vivo.com.br", "tim.br", "gprs.oi.com.br", "bandalarga.claro.com.br");91 daillist = new Array("*99#", "*99#", "*99***1#", "*99***1#");92 userlist = new Array("vivo", "tim", "oi", "claro");93 passlist = new Array("vivo", "tim", "oi", "claro");94 }95 else if(country == "BN"){96 protolist = new Array("1");97 isplist = new Array("B-Mobile");98 apnlist = new Array("dm.jplat.net");99 daillist = new Array("*99***1#");100 userlist = new Array("bmobile@u300");101 passlist = new Array("bmobile");102 }103 else if(country == "BG"){104 protolist = new Array("1", "1", "1");105 isplist = new Array("GLOBUL", "M-Tel", "Vivacom");106 apnlist = new Array("internet.globul.bg", "inet-gprs.mtel.bg", "internet.vivatel.bg");107 daillist = new Array("359891000", "359881000", "359871000");108 userlist = new Array("globul", "", "vivatel");109 passlist = new Array("", "", "vivatel");110 }111 else if(country == "CA"){112 protolist = new Array("1");113 isplist = new Array("Rogers Wireless");114 apnlist = new Array("internet.com");115 daillist = new Array("*99***1#");116 userlist = new Array("wapuser1");117 passlist = new Array("wap");118 }119 else if(country == "CN"){120 protolist = new Array("1", "3", "2");121 isplist = new Array("China Unicom", "China Mobile", "China Telecom");122 apnlist = new Array("3gnet", "cmnet", "ctnet");123 daillist = new Array("*99#", "*99#", "#777");124 userlist = new Array("", "net", "card");125 passlist = new Array("", "net", "card");126 }127 else if(country == "CZ"){128 protolist = new Array("1", "1", "1", "2");129 isplist = new Array("T-Mobile", "O2", "Vodafone", "Ufon");130 apnlist = new Array("internet.t-mobile.cz", "internet", "internet", "");131 daillist = new Array("*99#", "*99#", "*99***1#", "#777");132 userlist = new Array("gprs", "", "", "ufon");133 passlist = new Array("gprs", "", "", "ufon");134 }135 else if(country == "DK"){136 protolist = new Array("1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1");137 isplist = new Array("3", "TDC", "Orange", "Telia", "Telenor", "Callme", "Onfone", "CBB", "Oister", "Bibob", "Happii mobil");138 apnlist = new Array("data.tre.dk", "internet", "web.orange.dk", "www.internet.mtelia.dk", "Internet", ["Callme Internet&&websp", "Callme MMS&&mmssp"], ["Onfone GPRS&&internet.sp.dk", "Onfone MMS&&mms.sp.dk"], ["Telenor internet&&internet", "Telenor MMS&&Telenor"], ["Oister&&data.dk", "OisterMMS&&data.dk"], ["Bibob Internet&&internet.bibob.dk", "Bibob MMS&&mms.bibob.dk"], ["Happii Internet&&internet", "Happii MMS&&mms"]);139 daillist = new Array("*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#");140 userlist = new Array("", "", "", "", "", "", "", "", "", "", "");141 passlist = new Array("", "", "", "", "", "", "", "", "", "", "");142 }143 else if(country == "DO"){144 protolist = new Array("1");145 isplist = new Array("Claro");146 apnlist = new Array("internet.ideasclaro.com.do");147 daillist = new Array("*99#");148 userlist = new Array("");149 passlist = new Array("");150 }151 else if(country == "EG"){152 protolist = new Array("1", "1", "1");153 isplist = new Array("Mobinil", "Vodafone", "Etisalat");154 apnlist = new Array("mobinilweb", "internet.vodafone.net", "internet");155 daillist = new Array("*99***1#", "*99***1#", "*99***1#");156 userlist = new Array("", "internet", "");157 passlist = new Array("", "internet", "");158 }159 else if(country == "FI"){160 protolist = new Array("1", "1", "1", "1", "1", "1", "1", "1");161 isplist = new Array("DNA", "Saunalahti", "Elisa", "Sonera", "AinaCom/Sonera", "AINA", "TDC/DNA", "Dicame");162 apnlist = new Array("internet", "internet.saunalahti", "internet", "internet", "internet", "internet.aina.fi", "inet.tdc.fi", "internet.dicame.fi");163 daillist = new Array("*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#");164 userlist = new Array("", "", "", "", "", "", "", "");165 passlist = new Array("", "", "", "", "", "", "", "");166 }167 else if(country == "DE"){168 protolist = new Array("1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1");169 isplist = new Array("Call & Surf via Funk LTE", "T-Mobile MagentaMobil", "T-Mobile Data Comfort", "T-Mobile Xtra Prepaid", "congstar", "congstar LTE", "klarmobile (0151)", "Callmobile", "ja!mobile", "Vodafone Vertragstarife", "Vodafone Websessions", "1&1 D-Netz", "klarmobile (0152)", "Bildmobil (auch RTL)", "Fyve Mobil", "otelo Smartphone", "otelo Datentarife", "Edeka Mobil", "BASE Prepaid", "1&1 E-Netz", "Simyo", "Blau", "Blau Tages-Surfflat", "Ay Yildiz", "Aldi Talk", "Aldi Talk Tages-Surfflat", "O2 Blue (Smartphone)", "O2 go mobil", "O2 Prepaid", "Fonic", "klarmobile (0176)", "Tschibo Prepaid", "Tschibo Vertrag", "Lidl Mobil", "Saturn Daten Tarif LTE", "Mediamarkt Datentarif LTE");170 apnlist = new Array("internet.home", "internet.telekom", "internet.telekom", "internet.t-mobile", "internet.t-mobile", "internet.telekom", "internet.t-d1.de", "internet.t-mobile", "internet.t-mobile", "web.vodafone.de", "event.vodafone.de", "web.vodafone.de", "web.vodafone.de", "event.vodafone.de", "event.vodafone.de", "web.vodafone.de", "data.otelo.de", "data.access.de", "internet.eplus.de", "internet.eplus.de", "internet.eplus.de", "internet.eplus.de", "tagesflat.eplus.de", "internet.eplus.de", "internet.eplus.de", "tagesflat.eplus.de", "internet", "surfo2", "pinternet.interkom.de", "pinternet.interkom.de", "internet.mobilcom", "webmobil1", "surfmobil2", "pinternet.interkom.de", "surfo2", "surfo2");171 daillist = new Array("*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#");172 userlist = new Array("tmobile", "tmobile", "tmobile", "tmobile", "tmobile", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "simyo", "blau", "", "eplus", "eplus", "", "", "", "", "", "", "", "", "", "", "");173 passlist = new Array("tm", "tm", "tm", "tm", "tm", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "simyo", "blau", "", "gprs", "gprs", "", "", "", "", "", "", "", "", "", "", "");174 }175 else if(country == "GR"){176 protolist = new Array("1");177 isplist = new Array("WIND");178 apnlist = new Array("gint.b-online.gr");179 daillist = new Array("*99#");180 userlist = new Array("");181 passlist = new Array("");182 }183 else if(country == "HK"){184 protolist = new Array("1", "1", "1", "1", "1", "1", "1", "1");185 isplist = new Array("SmarTone", "3", "One2Free", "PCCW mobile", "New World Mobility", "CSL", "CMCC HK", "All 3G ISP support");186 apnlist = new Array("internet", "ipc.three.com.hk", "internet", "pccw", "internet", "internet", "internet", "");187 daillist = new Array("*99***1#", "*99***1#", "*99***1#", "*99#", "*99***1#", "*99***1#", "*99***1#", "*99***1#");188 userlist = new Array("", "", "", "", "", "", "", "");189 passlist = new Array("", "", "", "", "", "", "", "");190 }191 else if(country == "IL"){192 protolist = new Array("1");193 isplist = new Array("Cellcom");194 apnlist = new Array("sphone");195 daillist = new Array("*99#");196 userlist = new Array("");197 passlist = new Array("");198 }199 else if(country == "IN"){200 protolist = new Array("2", "2", "2", "1", "1", "1");201 isplist = new Array("Reliance", "TATA DOCOMO", "MTS", "AirTel", "IDEA", "MTNL");202 apnlist = new Array("reliance", "TATA", "", "airtelgprs.com", "Internet", "gprsppsmum");203 daillist = new Array("#777", "#777", "#777", "*99#", "*99#", "*99#");204 userlist = new Array("", "internet", "internet@internet.mtsindia.in", "", "", "mtnl");205 passlist = new Array("", "internet", "mts", "", "", "mtnl123");206 }207 else if(country == "ID"){208 protolist = new Array("1", "1", "1", "1", "1", "2", "1", "2", "2", "2", "2");209 isplist = new Array("IM2", "INDOSAT", "XL", "Telkomsel", "3", "SMARTFREN", "AXIS", "Esia", "StarOne", "TelkomFlexi", "AHA");210 apnlist = new Array("indosatm2", "indosat3g", "www.xlgprs.net", "flash", "3gprs", "", "AXIS", "", "", "", "AHA");211 daillist = new Array("*99#", "*99#", "*99#", "*99#", "*99***1#", "#777", "*99***1#", "#777", "#777", "#777", "#777");212 userlist = new Array("", "indosat", "xlgprs", "", "3gprs", "smart", "axis", "esia", "starone", "telkomnet@flexi", "aha@aha.co.id");213 passlist = new Array("", "indosat", "proxl", "", "3gprs", "smart", "123456", "esia", "indosat", "telkom", "aha");214 }215 else if(country == "IT"){216 protolist = new Array("1", "1", "1", "1");217 isplist = new Array("Vodafone", "TIM", "Wind", "3");218 apnlist = new Array("web.omnitel.it", "ibox.tim.it", "internet.wind", "tre.it");219 daillist = new Array("*99#", "*99#", "*99#", "*99#");220 userlist = new Array("", "", "", "");221 passlist = new Array("", "", "", "");222 }223 else if(country == "JP"){224 protolist = new Array("1", "1");225 isplist = new Array("SoftBank", "au");226 apnlist = new Array("emb.ne.jp", "au.NET");227 daillist = new Array("*99***1#", "*99**24#");228 userlist = new Array("em", "au@au-win.ne.jp");229 passlist = new Array("em", "au");230 }231 else if(country == "MY"){232 protolist = new Array("1", "1", "1", "1", "4");233 isplist = new Array("Celcom", "Maxis", "DiGi", "U Mobile", "Yes");234 apnlist = new Array("celcom3g", "unet", "3gdgnet", "my3g", "");235 daillist = new Array("*99***1#", "*99***1#", "*99#", "*99#", "");236 userlist = new Array("", "maxis", "", "", "");237 passlist = new Array("", "wap", "", "", "");238 }239 else if(country == "NL"){240 protolist = new Array("1", "1", "1", "1");241 isplist = new Array("T-Mobile", "KPN", "Telfort", "Vodafone");242 apnlist = new Array("internet", "internet", "internet", "internet");243 daillist = new Array("*99***1#", "*99***1#", "*99***1#", "*99***1#");244 userlist = new Array("", "", "", "");245 passlist = new Array("", "", "", "");246 }247 else if(country == "NZ"){248 protolist = new Array("1", "1", "1");249 isplist = new Array("2degrees", "Spark", "Vodafone");250 apnlist = new Array("internet", "internet", "internet");251 daillist = new Array("*99#", "*99#", "*99#");252 userlist = new Array("", "", "");253 passlist = new Array("", "", "");254 }255 else if(country == "NO"){256 protolist = new Array("1", "1", "1", "1", "1", "1");257 isplist = new Array("Tele2", "NetCom", "Chess", "Telenor", "Network Norway", "One Call");258 apnlist = new Array("internet.tele2.no", "netcom", "netcom", "telenor", "internet", "internet");259 daillist = new Array("*99#", "*99#", "*99#", "*99#", "*99#", "*99#");260 userlist = new Array("", "", "", "", "", "");261 passlist = new Array("", "", "", "", "", "");262 }263 else if(country == "PH"){264 protolist = new Array("1", "1", "1", "1", "1", "1");265 isplist = new Array("Globe", "Globe Prepaid", "Smart", "Smart Bro", "Sun", "Sun Prepaid");266 apnlist = new Array("internet.globe.com.ph", "http.globe.com.ph", "internet", "smartbro", "fbband", "minternet");267 daillist = new Array("*99***1#", "*99***1#", "*99#", "*99#", "*99#", "*99#");268 userlist = new Array("", "", "", "", "", "");269 passlist = new Array("", "", "", "", "", "");270 }271 else if(country == "PL"){272 protolist = new Array("1", "1", "1", "1", "1", "1", "1", "1", "1");273 isplist = new Array("Play", "Cyfrowy Polsat", "T-Mobile", "Orange", "Plus", "Heyah", "Aster", "SAMISWOI", "Aero2");274 apnlist = new Array("internet", "multi.internet", "internet", "internet", "internet", "internet", "aster.internet", "www.plusgsm.pl", "darmowy");275 daillist = new Array("*99#", "*99***1#", "*99***1#", "*99#", "*99***1#", "*99***1#", "*99#", "*99***1#", "*99#");276 userlist = new Array("", "", "", "internet", "plusgsm", "heyah", "internet", "internet", "");277 passlist = new Array("", "", "", "internet", "plusgsm", "heyah", "internet", "internet", "");278 }279 else if(country == "PT"){280 protolist = new Array("1", "1", "1");281 isplist = new Array("TMN", "Optimus", "Vodafone");282 apnlist = new Array("internet", "myconnection", "net2.vodafone.pt");283 daillist = new Array("*99#", "*99#", "*99#");284 userlist = new Array("", "", "vodafone");285 passlist = new Array("", "", "vodafone");286 }287 else if(country == "RO"){288 protolist = new Array("1", "1", "1", "1");289 isplist = new Array("Vodafone", "Orange", "Cosmote", "RCS-RDS");290 apnlist = new Array("internet.vodafone.ro", "internet", "broadband", "internet");291 daillist = new Array("*99#", "*99#", "*99#", "*99#");292 userlist = new Array("internet.vodafone.ro", "", "", "");293 passlist = new Array("vodafone", "", "", "");294 }295 else if(country == "RU"){296 protolist = new Array("1", "1", "1", "1", "4");297 isplist = new Array("Beeline", "MegaFon", "MTS", "PrimTel", "Yota");298 apnlist = new Array("internet.beeline.ru", "internet.nw", "internet.mts.ru", "internet.primtel.ru", "");299 daillist = new Array("*99***1#", "*99***1#", "*99***1#", "*99***1#", "");300 userlist = new Array("beeline", "", "", "", "");301 passlist = new Array("beeline", "", "", "", "");302 }303 else if(country == "SG"){304 protolist = new Array("1", "1", "1", "1");305 isplist = new Array("M1", "SingTel", "StarHub", "Grid");306 apnlist = new Array("sunsurf", "internet", "shinternet", "internet");307 daillist = new Array("*99#", "*99#", "*99#", "*99***1#");308 userlist = new Array("65", "", "", "");309 passlist = new Array("user123", "", "", "");310 }311 else if(country == "SK"){312 protolist = new Array("1", "1", "1");313 isplist = new Array("O2", "Orange", "T-Mobile");314 apnlist = new Array("o2internet", "internet", "internet");315 daillist = new Array("*99***1#", "*99#", "*99***1#");316 userlist = new Array("", "", "");317 passlist = new Array("", "", "");318 }319 else if(country == "ZA"){320 protolist = new Array("1", "1", "1");321 isplist = new Array("Vodacom", "MTN", "Cell C");322 apnlist = new Array("internet", "internet", "internet");323 daillist = new Array("*99#", "*99#", "*99#");324 userlist = new Array("", "", "");325 passlist = new Array("", "", "");326 }327 else if(country == "ES"){328 protolist = new Array("1", "1", "1", "1");329 isplist = new Array("Vodafone", "movistar", "Simyo", "ONO");330 apnlist = new Array("airtelnet.es", "movistar.es", "gprs-service.com", "internet.ono.com");331 daillist = new Array("*99#", "*99#", "*99#", "*99#");332 userlist = new Array("vodafone", "movistar", "", "");333 passlist = new Array("vodafone", "movistar", "", "");334 }335 else if(country == "SE"){336 protolist = new Array("1", "1", "1", "1", "1", "1", "1", "1", "1", "1", "1");337 isplist = new Array("3", "Telia", "Telenor", "Tele2", "Glocalnet", "Halebop", "Ventelo", "Spring Mobile", "UVTC (Universal Telecom)", "TDC", "Cellip");338 apnlist = new Array("data.tre.se", "online.telia.se", "internet.telenor.se", "internet.tele2.se", "internet.glocalnet.se", "halebop.telia.se", "internet.ventelo.se", "data.springmobil.se", "-services sp", "internet.se", "-services sp");339 daillist = new Array("*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "*99#");340 userlist = new Array("", "", "", "", "", "", "", "", "", "", "");341 passlist = new Array("", "", "", "", "", "", "", "", "", "", "");342 }343 else if(country == "TW"){344 protolist = new Array("1", "1", "1", "1", "4");345 isplist = new Array("Far EasTone", "Chunghwa Telecom", "TW Mobile", "T Star", "GMC");346 apnlist = new Array("internet", "internet", "internet", "internet", "");347 daillist = new Array("*99#", "*99***1#", "*99#", "*99#", "");348 userlist = new Array("", "", "", "", "");349 passlist = new Array("", "", "", "", "");350 }351 else if(country == "TH"){352 protolist = new Array("1", "1", "1");353 isplist = new Array("AIS", "dtac", "truemove H");354 apnlist = new Array("internet", "www.dtac.co.th", "hinternet");355 daillist = new Array("*99#", "*99#", "*99#");356 userlist = new Array("", "", "true");357 passlist = new Array("", "", "true");358 }359 else if(country == "TR"){360 protolist = new Array("1", "1", "1");361 isplist = new Array("Turkcell", "Vodafone", "Avea");362 apnlist = new Array("mgb", "internet", "internet");363 daillist = new Array("*99#", "*99#", "*99#");364 userlist = new Array("", "", "");365 passlist = new Array("", "", "");366 }367 else if(country == "UA"){368 protolist = new Array("1", "1", "1", "1", "1", "1", "2", "1", "2", "2", "2", "1", "2", "4", "4");369 isplist = new Array("Beeline", "Kyivstar", "Kyivstar Prepaid", "Kyivstar XL", "Kyivstart 3G", "Djuice", "MTS", "Utel", "PEOPLEnet", "Intertelecom", "Intertelecom.Rev.B", "life", "CDMA Ukraine", "FreshTel", "Giraffe");370 apnlist = new Array("internet.beeline.ua", "www.kyivstar.net", "www.ab.kyivstar.net", "xl.kyivstar.net", "3g.kyivstar.net", "www.djuice.com.ua", "", "3g.utel.ua", "", "", "", "Internet", "", "", "");371 daillist = new Array("*99#", "*99#", "*99#", "*99#", "*99#", "*99#", "#777", "*99#", "#777", "#777", "#777", "*99#", "#777", "", "");372 userlist = new Array("mobile", "", "", "", "", "", "mobile", "", "", "IT", "3G_TURBO", "", "", "freshtel", "");373 passlist = new Array("internet", "", "", "", "", "", "internet", "", "000000", "IT", "3G_TURBO", "", "", "freshtel", "");374 }375 else if(country == "UK"){376 protolist = new Array("1", "1", "1", "1");377 isplist = new Array("3", "O2", "Vodafone", "Orange");378 apnlist = new Array("orangenet", "m-bb.o2.co.uk", "PPBUNDLE.INTERNET", "internetvpn");379 daillist = new Array("*99#", "*99#", "*99#", "*99#");380 userlist = new Array("", "o2bb", "web", "");381 passlist = new Array("", "password", "web", "");382 }383 else if(country == "US"){384 protolist = new Array("1", "1", "1", "1", "1", "2", "1", "2");385 isplist = new Array("Telecom Italia Mobile", "Bell Mobility" ,"Cellular One" ,"Cincinnati Bell" ,"T-Mobile" ,"Verizon", "AT&T", "Sprint");386 apnlist = new Array("proxy", "", "cellular1wap", "wap.gocbw.com", "epc.tmobile.com", "", "broadband", "");387 daillist = new Array("*99***1#", "*99***1#", "*99***1#", "*99***1#", "*99***1#", "#777", "*99***1#", "#777");388 userlist = new Array("", "", "", "", "", "", "", "");389 passlist = new Array("", "", "", "", "", "", "", "");390 }391 else if(country == "VN"){392 protolist = new Array("1", "1", "1");393 isplist = new Array("MobiFone", "Vinaphone", "Viettel Mobile");394 apnlist = new Array("m-wap", "m3-card", "e-connect");395 daillist = new Array("*99#", "*99#", "*99#");396 userlist = new Array("mms", "mms", "");397 passlist = new Array("mms", "mms", "");398 }399 else{400 isplist = new Array("");401 apnlist = new Array("");402 daillist = new Array("");403 userlist = new Array("");404 passlist = new Array("");405 }...
15.6.2.js
Source:15.6.2.js
1/* The contents of this file are subject to the Netscape Public2 * License Version 1.1 (the "License"); you may not use this file3 * except in compliance with the License. You may obtain a copy of4 * the License at http://www.mozilla.org/NPL/5 *6 * Software distributed under the License is distributed on an "AS7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or8 * implied. See the License for the specific language governing9 * rights and limitations under the License.10 *11 * The Original Code is Mozilla Communicator client code, released March12 * 31, 1998.13 *14 * The Initial Developer of the Original Code is Netscape Communications15 * Corporation. Portions created by Netscape are16 * Copyright (C) 1998 Netscape Communications Corporation. All17 * Rights Reserved.18 *19 * Contributor(s): 20 * 21 */22/**23 File Name: 15.6.2.js24 ECMA Section: 15.6.2 The Boolean Constructor25 15.6.2.1 new Boolean( value )26 15.6.2.2 new Boolean()27 This test verifies that the Boolean constructor28 initializes a new object (typeof should return29 "object"). The prototype of the new object should30 be Boolean.prototype. The value of the object31 should be ToBoolean( value ) (a boolean value).32 Description:33 Author: christine@netscape.com34 Date: june 27, 199735*/36 var SECTION = "15.6.2";37 var VERSION = "ECMA_1";38 startTest();39 var TITLE = "15.6.2 The Boolean Constructor; 15.6.2.1 new Boolean( value ); 15.6.2.2 new Boolean()";40 writeHeaderToLog( SECTION + " "+ TITLE);41 var testcases = getTestCases();42 test();43function getTestCases() {44 var array = new Array();45 var item = 0;46 array[item++] = new TestCase( SECTION, "typeof (new Boolean(1))", "object", typeof (new Boolean(1)) );47 array[item++] = new TestCase( SECTION, "(new Boolean(1)).constructor", Boolean.prototype.constructor, (new Boolean(1)).constructor );48 array[item++] = new TestCase( SECTION,49 "TESTBOOL=new Boolean(1);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",50 "[object Boolean]",51 eval("TESTBOOL=new Boolean(1);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );52 array[item++] = new TestCase( SECTION, "(new Boolean(1)).valueOf()", true, (new Boolean(1)).valueOf() );53 array[item++] = new TestCase( SECTION, "typeof new Boolean(1)", "object", typeof new Boolean(1) );54 array[item++] = new TestCase( SECTION, "(new Boolean(0)).constructor", Boolean.prototype.constructor, (new Boolean(0)).constructor );55 array[item++] = new TestCase( SECTION,56 "TESTBOOL=new Boolean(0);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",57 "[object Boolean]",58 eval("TESTBOOL=new Boolean(0);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );59 array[item++] = new TestCase( SECTION, "(new Boolean(0)).valueOf()", false, (new Boolean(0)).valueOf() );60 array[item++] = new TestCase( SECTION, "typeof new Boolean(0)", "object", typeof new Boolean(0) );61 array[item++] = new TestCase( SECTION, "(new Boolean(-1)).constructor", Boolean.prototype.constructor, (new Boolean(-1)).constructor );62 array[item++] = new TestCase( SECTION,63 "TESTBOOL=new Boolean(-1);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",64 "[object Boolean]",65 eval("TESTBOOL=new Boolean(-1);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );66 array[item++] = new TestCase( SECTION, "(new Boolean(-1)).valueOf()", true, (new Boolean(-1)).valueOf() );67 array[item++] = new TestCase( SECTION, "typeof new Boolean(-1)", "object", typeof new Boolean(-1) );68 array[item++] = new TestCase( SECTION, "(new Boolean('1')).constructor", Boolean.prototype.constructor, (new Boolean('1')).constructor );69 array[item++] = new TestCase( SECTION,70 "TESTBOOL=new Boolean('1');TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",71 "[object Boolean]",72 eval("TESTBOOL=new Boolean('1');TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );73 array[item++] = new TestCase( SECTION, "(new Boolean('1')).valueOf()", true, (new Boolean('1')).valueOf() );74 array[item++] = new TestCase( SECTION, "typeof new Boolean('1')", "object", typeof new Boolean('1') );75 array[item++] = new TestCase( SECTION, "(new Boolean('0')).constructor", Boolean.prototype.constructor, (new Boolean('0')).constructor );76 array[item++] = new TestCase( SECTION,77 "TESTBOOL=new Boolean('0');TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",78 "[object Boolean]",79 eval("TESTBOOL=new Boolean('0');TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );80 array[item++] = new TestCase( SECTION, "(new Boolean('0')).valueOf()", true, (new Boolean('0')).valueOf() );81 array[item++] = new TestCase( SECTION, "typeof new Boolean('0')", "object", typeof new Boolean('0') );82 array[item++] = new TestCase( SECTION, "(new Boolean('-1')).constructor", Boolean.prototype.constructor, (new Boolean('-1')).constructor );83 array[item++] = new TestCase( SECTION,84 "TESTBOOL=new Boolean('-1');TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",85 "[object Boolean]",86 eval("TESTBOOL=new Boolean('-1');TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );87 array[item++] = new TestCase( SECTION, "(new Boolean('-1')).valueOf()", true, (new Boolean('-1')).valueOf() );88 array[item++] = new TestCase( SECTION, "typeof new Boolean('-1')", "object", typeof new Boolean('-1') );89 array[item++] = new TestCase( SECTION, "(new Boolean(new Boolean(true))).constructor", Boolean.prototype.constructor, (new Boolean(new Boolean(true))).constructor );90 array[item++] = new TestCase( SECTION,91 "TESTBOOL=new Boolean(new Boolean(true));TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",92 "[object Boolean]",93 eval("TESTBOOL=new Boolean(new Boolean(true));TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );94 array[item++] = new TestCase( SECTION, "(new Boolean(new Boolean(true))).valueOf()", true, (new Boolean(new Boolean(true))).valueOf() );95 array[item++] = new TestCase( SECTION, "typeof new Boolean(new Boolean(true))", "object", typeof new Boolean(new Boolean(true)) );96 array[item++] = new TestCase( SECTION, "(new Boolean(Number.NaN)).constructor", Boolean.prototype.constructor, (new Boolean(Number.NaN)).constructor );97 array[item++] = new TestCase( SECTION,98 "TESTBOOL=new Boolean(Number.NaN);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",99 "[object Boolean]",100 eval("TESTBOOL=new Boolean(Number.NaN);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );101 array[item++] = new TestCase( SECTION, "(new Boolean(Number.NaN)).valueOf()", false, (new Boolean(Number.NaN)).valueOf() );102 array[item++] = new TestCase( SECTION, "typeof new Boolean(Number.NaN)", "object", typeof new Boolean(Number.NaN) );103 array[item++] = new TestCase( SECTION, "(new Boolean(null)).constructor", Boolean.prototype.constructor, (new Boolean(null)).constructor );104 array[item++] = new TestCase( SECTION,105 "TESTBOOL=new Boolean(null);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",106 "[object Boolean]",107 eval("TESTBOOL=new Boolean(null);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );108 array[item++] = new TestCase( SECTION, "(new Boolean(null)).valueOf()", false, (new Boolean(null)).valueOf() );109 array[item++] = new TestCase( SECTION, "typeof new Boolean(null)", "object", typeof new Boolean(null) );110 array[item++] = new TestCase( SECTION, "(new Boolean(void 0)).constructor", Boolean.prototype.constructor, (new Boolean(void 0)).constructor );111 array[item++] = new TestCase( SECTION,112 "TESTBOOL=new Boolean(void 0);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",113 "[object Boolean]",114 eval("TESTBOOL=new Boolean(void 0);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );115 array[item++] = new TestCase( SECTION, "(new Boolean(void 0)).valueOf()", false, (new Boolean(void 0)).valueOf() );116 array[item++] = new TestCase( SECTION, "typeof new Boolean(void 0)", "object", typeof new Boolean(void 0) );117 array[item++] = new TestCase( SECTION, "(new Boolean(Number.POSITIVE_INFINITY)).constructor", Boolean.prototype.constructor, (new Boolean(Number.POSITIVE_INFINITY)).constructor );118 array[item++] = new TestCase( SECTION,119 "TESTBOOL=new Boolean(Number.POSITIVE_INFINITY);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",120 "[object Boolean]",121 eval("TESTBOOL=new Boolean(Number.POSITIVE_INFINITY);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );122 array[item++] = new TestCase( SECTION, "(new Boolean(Number.POSITIVE_INFINITY)).valueOf()", true, (new Boolean(Number.POSITIVE_INFINITY)).valueOf() );123 array[item++] = new TestCase( SECTION, "typeof new Boolean(Number.POSITIVE_INFINITY)", "object", typeof new Boolean(Number.POSITIVE_INFINITY) );124 array[item++] = new TestCase( SECTION, "(new Boolean(Number.NEGATIVE_INFINITY)).constructor", Boolean.prototype.constructor, (new Boolean(Number.NEGATIVE_INFINITY)).constructor );125 array[item++] = new TestCase( SECTION,126 "TESTBOOL=new Boolean(Number.NEGATIVE_INFINITY);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",127 "[object Boolean]",128 eval("TESTBOOL=new Boolean(Number.NEGATIVE_INFINITY);TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );129 array[item++] = new TestCase( SECTION, "(new Boolean(Number.NEGATIVE_INFINITY)).valueOf()", true, (new Boolean(Number.NEGATIVE_INFINITY)).valueOf() );130 array[item++] = new TestCase( SECTION, "typeof new Boolean(Number.NEGATIVE_INFINITY)", "object", typeof new Boolean(Number.NEGATIVE_INFINITY) );131 array[item++] = new TestCase( SECTION, "(new Boolean(Number.NEGATIVE_INFINITY)).constructor", Boolean.prototype.constructor, (new Boolean(Number.NEGATIVE_INFINITY)).constructor );132 array[item++] = new TestCase( "15.6.2.2",133 "TESTBOOL=new Boolean();TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()",134 "[object Boolean]",135 eval("TESTBOOL=new Boolean();TESTBOOL.toString=Object.prototype.toString;TESTBOOL.toString()") );136 array[item++] = new TestCase( "15.6.2.2", "(new Boolean()).valueOf()", false, (new Boolean()).valueOf() );137 array[item++] = new TestCase( "15.6.2.2", "typeof new Boolean()", "object", typeof new Boolean() );138 return ( array );139}140function test() {141 for ( tc = 0; tc < testcases.length; tc++ ) {142 testcases[tc].passed = writeTestCaseResult(143 testcases[tc].expect,144 testcases[tc].actual,145 testcases[tc].description +" = "+ testcases[tc].actual );146 testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";147 }148 stopTest();149 return ( testcases );...
15.7.2.js
Source:15.7.2.js
1/* The contents of this file are subject to the Netscape Public2 * License Version 1.1 (the "License"); you may not use this file3 * except in compliance with the License. You may obtain a copy of4 * the License at http://www.mozilla.org/NPL/5 *6 * Software distributed under the License is distributed on an "AS7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or8 * implied. See the License for the specific language governing9 * rights and limitations under the License.10 *11 * The Original Code is Mozilla Communicator client code, released March12 * 31, 1998.13 *14 * The Initial Developer of the Original Code is Netscape Communications15 * Corporation. Portions created by Netscape are16 * Copyright (C) 1998 Netscape Communications Corporation. All17 * Rights Reserved.18 *19 * Contributor(s): 20 * 21 */22/**23 File Name: 15.7.2.js24 ECMA Section: 15.7.2 The Number Constructor25 15.7.2.126 15.7.2.227 Description: 15.7.2 When Number is called as part of a new28 expression, it is a constructor: it initializes29 the newly created object.30 15.7.2.1 The [[Prototype]] property of the newly31 constructed object is set to othe original Number32 prototype object, the one that is the initial value33 of Number.prototype(0). The [[Class]] property is34 set to "Number". The [[Value]] property of the35 newly constructed object is set to ToNumber(value)36 15.7.2.2 new Number(). same as in 15.7.2.1, except37 the [[Value]] property is set to +0.38 need to add more test cases. see the testcases for39 TypeConversion ToNumber.40 Author: christine@netscape.com41 Date: 29 september 199742*/43 var SECTION = "15.7.2";44 var VERSION = "ECMA_1";45 startTest();46 var TITLE = "The Number Constructor";47 writeHeaderToLog( SECTION + " "+ TITLE);48 var testcases = getTestCases();49 test();50function getTestCases() {51 var array = new Array();52 var item = 0;53 // To verify that the object's prototype is the Number.prototype, check to see if the object's54 // constructor property is the same as Number.prototype.constructor.55 array[item++] = new TestCase(SECTION, "(new Number()).constructor", Number.prototype.constructor, (new Number()).constructor );56 array[item++] = new TestCase(SECTION, "typeof (new Number())", "object", typeof (new Number()) );57 array[item++] = new TestCase(SECTION, "(new Number()).valueOf()", 0, (new Number()).valueOf() );58 array[item++] = new TestCase(SECTION,59 "NUMB = new Number();NUMB.toString=Object.prototype.toString;NUMB.toString()",60 "[object Number]",61 eval("NUMB = new Number();NUMB.toString=Object.prototype.toString;NUMB.toString()") );62 array[item++] = new TestCase(SECTION, "(new Number(0)).constructor", Number.prototype.constructor, (new Number(0)).constructor );63 array[item++] = new TestCase(SECTION, "typeof (new Number(0))", "object", typeof (new Number(0)) );64 array[item++] = new TestCase(SECTION, "(new Number(0)).valueOf()", 0, (new Number(0)).valueOf() );65 array[item++] = new TestCase(SECTION,66 "NUMB = new Number(0);NUMB.toString=Object.prototype.toString;NUMB.toString()",67 "[object Number]",68 eval("NUMB = new Number(0);NUMB.toString=Object.prototype.toString;NUMB.toString()") );69 array[item++] = new TestCase(SECTION, "(new Number(1)).constructor", Number.prototype.constructor, (new Number(1)).constructor );70 array[item++] = new TestCase(SECTION, "typeof (new Number(1))", "object", typeof (new Number(1)) );71 array[item++] = new TestCase(SECTION, "(new Number(1)).valueOf()", 1, (new Number(1)).valueOf() );72 array[item++] = new TestCase(SECTION,73 "NUMB = new Number(1);NUMB.toString=Object.prototype.toString;NUMB.toString()",74 "[object Number]",75 eval("NUMB = new Number(1);NUMB.toString=Object.prototype.toString;NUMB.toString()") );76 array[item++] = new TestCase(SECTION, "(new Number(-1)).constructor", Number.prototype.constructor, (new Number(-1)).constructor );77 array[item++] = new TestCase(SECTION, "typeof (new Number(-1))", "object", typeof (new Number(-1)) );78 array[item++] = new TestCase(SECTION, "(new Number(-1)).valueOf()", -1, (new Number(-1)).valueOf() );79 array[item++] = new TestCase(SECTION,80 "NUMB = new Number(-1);NUMB.toString=Object.prototype.toString;NUMB.toString()",81 "[object Number]",82 eval("NUMB = new Number(-1);NUMB.toString=Object.prototype.toString;NUMB.toString()") );83 array[item++] = new TestCase(SECTION, "(new Number(Number.NaN)).constructor", Number.prototype.constructor, (new Number(Number.NaN)).constructor );84 array[item++] = new TestCase(SECTION, "typeof (new Number(Number.NaN))", "object", typeof (new Number(Number.NaN)) );85 array[item++] = new TestCase(SECTION, "(new Number(Number.NaN)).valueOf()", Number.NaN, (new Number(Number.NaN)).valueOf() );86 array[item++] = new TestCase(SECTION,87 "NUMB = new Number(Number.NaN);NUMB.toString=Object.prototype.toString;NUMB.toString()",88 "[object Number]",89 eval("NUMB = new Number(Number.NaN);NUMB.toString=Object.prototype.toString;NUMB.toString()") );90 array[item++] = new TestCase(SECTION, "(new Number('string')).constructor", Number.prototype.constructor, (new Number('string')).constructor );91 array[item++] = new TestCase(SECTION, "typeof (new Number('string'))", "object", typeof (new Number('string')) );92 array[item++] = new TestCase(SECTION, "(new Number('string')).valueOf()", Number.NaN, (new Number('string')).valueOf() );93 array[item++] = new TestCase(SECTION,94 "NUMB = new Number('string');NUMB.toString=Object.prototype.toString;NUMB.toString()",95 "[object Number]",96 eval("NUMB = new Number('string');NUMB.toString=Object.prototype.toString;NUMB.toString()") );97 array[item++] = new TestCase(SECTION, "(new Number(new String())).constructor", Number.prototype.constructor, (new Number(new String())).constructor );98 array[item++] = new TestCase(SECTION, "typeof (new Number(new String()))", "object", typeof (new Number(new String())) );99 array[item++] = new TestCase(SECTION, "(new Number(new String())).valueOf()", 0, (new Number(new String())).valueOf() );100 array[item++] = new TestCase(SECTION,101 "NUMB = new Number(new String());NUMB.toString=Object.prototype.toString;NUMB.toString()",102 "[object Number]",103 eval("NUMB = new Number(new String());NUMB.toString=Object.prototype.toString;NUMB.toString()") );104 array[item++] = new TestCase(SECTION, "(new Number('')).constructor", Number.prototype.constructor, (new Number('')).constructor );105 array[item++] = new TestCase(SECTION, "typeof (new Number(''))", "object", typeof (new Number('')) );106 array[item++] = new TestCase(SECTION, "(new Number('')).valueOf()", 0, (new Number('')).valueOf() );107 array[item++] = new TestCase(SECTION,108 "NUMB = new Number('');NUMB.toString=Object.prototype.toString;NUMB.toString()",109 "[object Number]",110 eval("NUMB = new Number('');NUMB.toString=Object.prototype.toString;NUMB.toString()") );111 array[item++] = new TestCase(SECTION, "(new Number(Number.POSITIVE_INFINITY)).constructor", Number.prototype.constructor, (new Number(Number.POSITIVE_INFINITY)).constructor );112 array[item++] = new TestCase(SECTION, "typeof (new Number(Number.POSITIVE_INFINITY))", "object", typeof (new Number(Number.POSITIVE_INFINITY)) );113 array[item++] = new TestCase(SECTION, "(new Number(Number.POSITIVE_INFINITY)).valueOf()", Number.POSITIVE_INFINITY, (new Number(Number.POSITIVE_INFINITY)).valueOf() );114 array[item++] = new TestCase(SECTION,115 "NUMB = new Number(Number.POSITIVE_INFINITY);NUMB.toString=Object.prototype.toString;NUMB.toString()",116 "[object Number]",117 eval("NUMB = new Number(Number.POSITIVE_INFINITY);NUMB.toString=Object.prototype.toString;NUMB.toString()") );118 array[item++] = new TestCase(SECTION, "(new Number(Number.NEGATIVE_INFINITY)).constructor", Number.prototype.constructor, (new Number(Number.NEGATIVE_INFINITY)).constructor );119 array[item++] = new TestCase(SECTION, "typeof (new Number(Number.NEGATIVE_INFINITY))", "object", typeof (new Number(Number.NEGATIVE_INFINITY)) );120 array[item++] = new TestCase(SECTION, "(new Number(Number.NEGATIVE_INFINITY)).valueOf()", Number.NEGATIVE_INFINITY, (new Number(Number.NEGATIVE_INFINITY)).valueOf() );121 array[item++] = new TestCase(SECTION,122 "NUMB = new Number(Number.NEGATIVE_INFINITY);NUMB.toString=Object.prototype.toString;NUMB.toString()",123 "[object Number]",124 eval("NUMB = new Number(Number.NEGATIVE_INFINITY);NUMB.toString=Object.prototype.toString;NUMB.toString()") );125 array[item++] = new TestCase(SECTION, "(new Number()).constructor", Number.prototype.constructor, (new Number()).constructor );126 array[item++] = new TestCase(SECTION, "typeof (new Number())", "object", typeof (new Number()) );127 array[item++] = new TestCase(SECTION, "(new Number()).valueOf()", 0, (new Number()).valueOf() );128 array[item++] = new TestCase(SECTION,129 "NUMB = new Number();NUMB.toString=Object.prototype.toString;NUMB.toString()",130 "[object Number]",131 eval("NUMB = new Number();NUMB.toString=Object.prototype.toString;NUMB.toString()") );132 return ( array );133}134function test() {135 for ( tc=0; tc < testcases.length; tc++ ) {136 testcases[tc].passed = writeTestCaseResult(137 testcases[tc].expect,138 testcases[tc].actual,139 testcases[tc].description +" = "+140 testcases[tc].actual );141 testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";142 }143 stopTest();144 return ( testcases );...
11.6.2-1.js
Source:11.6.2-1.js
1/* The contents of this file are subject to the Netscape Public2 * License Version 1.1 (the "License"); you may not use this file3 * except in compliance with the License. You may obtain a copy of4 * the License at http://www.mozilla.org/NPL/5 *6 * Software distributed under the License is distributed on an "AS7 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or8 * implied. See the License for the specific language governing9 * rights and limitations under the License.10 *11 * The Original Code is Mozilla Communicator client code, released March12 * 31, 1998.13 *14 * The Initial Developer of the Original Code is Netscape Communications15 * Corporation. Portions created by Netscape are16 * Copyright (C) 1998 Netscape Communications Corporation. All17 * Rights Reserved.18 *19 * Contributor(s): 20 * 21 */22/**23 File Name: 11.6.2-1.js24 ECMA Section: 11.6.2 The Subtraction operator ( - )25 Description:26 The production AdditiveExpression : AdditiveExpression -27 MultiplicativeExpression is evaluated as follows:28 1. Evaluate AdditiveExpression.29 2. Call GetValue(Result(1)).30 3. Evaluate MultiplicativeExpression.31 4. Call GetValue(Result(3)).32 5. Call ToNumber(Result(2)).33 6. Call ToNumber(Result(4)).34 7. Apply the subtraction operation to Result(5) and Result(6). See the35 discussion below (11.6.3).36 8. Return Result(7).37 Author: christine@netscape.com38 Date: 12 november 199739*/40 var SECTION = "11.6.2-1";41 var VERSION = "ECMA_1";42 startTest();43 var testcases = getTestCases();44 writeHeaderToLog( SECTION + " The subtraction operator ( - )");45 test();46function test() {47 for ( tc=0; tc < testcases.length; tc++ ) {48 testcases[tc].passed = writeTestCaseResult(49 testcases[tc].expect,50 testcases[tc].actual,51 testcases[tc].description +" = "+52 testcases[tc].actual );53 testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";54 }55 stopTest();56 return ( testcases );57}58function getTestCases() {59 var array = new Array();60 var item = 0;61 // tests for boolean primitive, boolean object, Object object, a "MyObject" whose value is62 // a boolean primitive and a boolean object, and "MyValuelessObject", where the value is63 // set in the object's prototype, not the object itself.64 array[item++] = new TestCase( SECTION,65 "var EXP_1 = true; var EXP_2 = false; EXP_1 - EXP_2",66 1,67 eval("var EXP_1 = true; var EXP_2 = false; EXP_1 - EXP_2") );68 array[item++] = new TestCase( SECTION,69 "var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); EXP_1 - EXP_2",70 1,71 eval("var EXP_1 = new Boolean(true); var EXP_2 = new Boolean(false); EXP_1 - EXP_2") );72 array[item++] = new TestCase( SECTION,73 "var EXP_1 = new Object(true); var EXP_2 = new Object(false); EXP_1 - EXP_2",74 1,75 eval("var EXP_1 = new Object(true); var EXP_2 = new Object(false); EXP_1 - EXP_2") );76 array[item++] = new TestCase( SECTION,77 "var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); EXP_1 - EXP_2",78 1,79 eval("var EXP_1 = new Object(new Boolean(true)); var EXP_2 = new Object(new Boolean(false)); EXP_1 - EXP_2") );80 array[item++] = new TestCase( SECTION,81 "var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); EXP_1 - EXP_2",82 1,83 eval("var EXP_1 = new MyObject(true); var EXP_2 = new MyObject(false); EXP_1 - EXP_2") );84 array[item++] = new TestCase( SECTION,85 "var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 - EXP_2",86 Number.NaN,87 eval("var EXP_1 = new MyObject(new Boolean(true)); var EXP_2 = new MyObject(new Boolean(false)); EXP_1 - EXP_2") );88 array[item++] = new TestCase( SECTION,89 "var EXP_1 = new MyOtherObject(new Boolean(true)); var EXP_2 = new MyOtherObject(new Boolean(false)); EXP_1 - EXP_2",90 Number.NaN,91 eval("var EXP_1 = new MyOtherObject(new Boolean(true)); var EXP_2 = new MyOtherObject(new Boolean(false)); EXP_1 - EXP_2") );92 array[item++] = new TestCase( SECTION,93 "var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); EXP_1 - EXP_2",94 1,95 eval("var EXP_1 = new MyValuelessObject(true); var EXP_2 = new MyValuelessObject(false); EXP_1 - EXP_2") );96 array[item++] = new TestCase( SECTION,97 "var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 - EXP_2",98 Number.NaN,99 eval("var EXP_1 = new MyValuelessObject(new Boolean(true)); var EXP_2 = new MyValuelessObject(new Boolean(false)); EXP_1 - EXP_2") );100 // tests for number primitive, number object, Object object, a "MyObject" whose value is101 // a number primitive and a number object, and "MyValuelessObject", where the value is102 // set in the object's prototype, not the object itself.103 array[item++] = new TestCase( SECTION,104 "var EXP_1 = 100; var EXP_2 = 1; EXP_1 - EXP_2",105 99,106 eval("var EXP_1 = 100; var EXP_2 = 1; EXP_1 - EXP_2") );107 array[item++] = new TestCase( SECTION,108 "var EXP_1 = new Number(100); var EXP_2 = new Number(1); EXP_1 - EXP_2",109 99,110 eval("var EXP_1 = new Number(100); var EXP_2 = new Number(1); EXP_1 - EXP_2") );111 array[item++] = new TestCase( SECTION,112 "var EXP_1 = new Object(100); var EXP_2 = new Object(1); EXP_1 - EXP_2",113 99,114 eval("var EXP_1 = new Object(100); var EXP_2 = new Object(1); EXP_1 - EXP_2") );115 array[item++] = new TestCase( SECTION,116 "var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(1)); EXP_1 - EXP_2",117 99,118 eval("var EXP_1 = new Object(new Number(100)); var EXP_2 = new Object(new Number(1)); EXP_1 - EXP_2") );119 array[item++] = new TestCase( SECTION,120 "var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(1); EXP_1 - EXP_2",121 99,122 eval("var EXP_1 = new MyObject(100); var EXP_2 = new MyObject(1); EXP_1 - EXP_2") );123 array[item++] = new TestCase( SECTION,124 "var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(1)); EXP_1 - EXP_2",125 Number.NaN,126 eval("var EXP_1 = new MyObject(new Number(100)); var EXP_2 = new MyObject(new Number(1)); EXP_1 - EXP_2") );127 array[item++] = new TestCase( SECTION,128 "var EXP_1 = new MyOtherObject(new Number(100)); var EXP_2 = new MyOtherObject(new Number(1)); EXP_1 - EXP_2",129 99,130 eval("var EXP_1 = new MyOtherObject(new Number(100)); var EXP_2 = new MyOtherObject(new Number(1)); EXP_1 - EXP_2") );131 array[item++] = new TestCase( SECTION,132 "var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(1); EXP_1 - EXP_2",133 99,134 eval("var EXP_1 = new MyValuelessObject(100); var EXP_2 = new MyValuelessObject(1); EXP_1 - EXP_2") );135/*136 array[item++] = new TestCase( SECTION,137 "var EXP_1 = new MyValuelessObject(new Number(100)); var EXP_2 = new MyValuelessObject(new Number(1)); EXP_1 - EXP_2",138 Number.NaN,139 eval("var EXP_1 = new MyValuelessObject(new Number(100)); var EXP_2 = new MyValuelessObject(new Number(1)); EXP_1 - EXP_2") );140*/141 // same thing with string!142 array[item++] = new TestCase( SECTION,143 "var EXP_1 = new MyOtherObject(new String('0xff')); var EXP_2 = new MyOtherObject(new String('1'); EXP_1 - EXP_2",144 254,145 eval("var EXP_1 = new MyOtherObject(new String('0xff')); var EXP_2 = new MyOtherObject(new String('1')); EXP_1 - EXP_2") );146 return ( array );147}148function MyProtoValuelessObject() {149 this.valueOf = new Function ( "" );150 this.__proto__ = null;151}152function MyProtolessObject( value ) {153 this.valueOf = new Function( "return this.value" );154 this.__proto__ = null;155 this.value = value;156}157function MyValuelessObject(value) {158 this.__proto__ = new MyPrototypeObject(value);159}160function MyPrototypeObject(value) {161 this.valueOf = new Function( "return this.value;" );162 this.toString = new Function( "return (this.value + '');" );163 this.value = value;164}165function MyObject( value ) {166 this.valueOf = new Function( "return this.value" );167 this.value = value;168}169function MyOtherObject( value ) {170 this.valueOf = new Function( "return this.value" );171 this.toString = new Function ( "return this.value + ''" );172 this.value = value;...
Using AI Code Generation
1import { MockBuilder, MockRender } from 'ng-mocks';2import { AppModule } from './app.module';3import { AppComponent } from './app.component';4describe('AppComponent', () => {5 beforeEach(() => MockBuilder(AppComponent, AppModule));6 it('should create the app', () => {7 const fixture = MockRender(AppComponent);8 const app = fixture.point.componentInstance;9 expect(app).toBeTruthy();10 });11});12import { MockBuilder, MockRender } from 'ng-mocks';13import { AppModule } from './app.module';14import { AppComponent } from './app.component';15describe('AppComponent', () => {16 beforeEach(() => MockBuilder(AppComponent, AppModule));17 it('should create the app', () => {18 const fixture = MockRender(AppComponent);19 const app = fixture.point.componentInstance;20 expect(app).toBeTruthy();21 });22});23import { MockBuilder, MockRender } from 'ng-mocks';24import { AppModule } from './app.module';25import { AppComponent } from './app.component';26describe('AppComponent', () => {27 beforeEach(() => MockBuilder(AppComponent, AppModule));28 it('should create the app', () => {29 const fixture = MockRender(AppComponent);30 const app = fixture.point.componentInstance;31 expect(app).toBeTruthy();32 });33});34import { MockBuilder, MockRender } from 'ng-mocks';35import { AppModule } from './app.module';36import { AppComponent } from './app.component';37describe('AppComponent', () => {38 beforeEach(() => MockBuilder(AppComponent, AppModule));39 it('should create the app', () => {40 const fixture = MockRender(AppComponent);41 const app = fixture.point.componentInstance;42 expect(app).toBeTruthy();43 });44});45import { MockBuilder, MockRender } from 'ng-mocks';46import { AppModule } from './app.module';47import { AppComponent } from './app.component';48describe('AppComponent', () => {49 beforeEach(() => MockBuilder(AppComponent, AppModule));50 it('should create the app', () => {51 const fixture = MockRender(AppComponent);52 const app = fixture.point.componentInstance;53 expect(app).toBeTruthy();54 });55});56import { MockBuilder, MockRender } from 'ng-mocks';57import { AppModule } from './app.module';58import
Using AI Code Generation
1import { MockBuilder, MockRender } from 'ng-mocks';2import { AppModule } from './app.module';3import { AppComponent } from './app.component';4describe('AppComponent', () => {5 beforeEach(() => MockBuilder(AppComponent, AppModule));6 it('should create the app', () => {7 const fixture = MockRender(AppComponent);8 const app = fixture.debugElement.componentInstance;9 expect(app).toBeTruthy();10 });11});12import { MockBuilder, MockRender } from 'ng-mocks';13import { AppModule } from './app.module';14import { AppComponent } from './app.component';15describe('AppComponent', () => {16 beforeEach(() => MockBuilder(AppComponent, AppModule));17 it('should create the app', () => {18 const fixture = MockRender(AppComponent);19 const app = fixture.debugElement.componentInstance;20 expect(app).toBeTruthy();21 });22});23import { NgModule } from '@angular/core';24import { BrowserModule } from '@angular/platform-browser';25import { AppComponent } from './app.component';26@NgModule({27 imports: [BrowserModule],28})29export class AppModule {}30import { Component } from '@angular/core';31@Component({32})33export class AppComponent {34 title = 'my-app';35}36 Welcome to {{ title }}!37/* You can add global styles to this file, and also import other style files */38body {39 margin: 0;40 Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';41 font-size: 14px;42 color: #333;43 box-sizing: border-box;44 -webkit-font-smoothing: antialiased;45 -moz-osx-font-smoothing: grayscale;46}47import { TestBed } from '@angular/core/testing';48import { AppComponent } from './app.component';49describe('AppComponent', () => {50 beforeEach(async () => {51 await TestBed.configureTestingModule({52 }).compileComponents();
Using AI Code Generation
1import { MockBuilder, MockRender } from 'ng-mocks';2import { AppModule } from './app.module';3describe('AppModule', () => {4 beforeEach(() => MockBuilder(AppModule));5 it('should render', () => {6 const fixture = MockRender(AppModule);7 expect(fixture).toBeDefined();8 });9});10module.exports = {11 globals: {12 'ts-jest': {13 astTransformers: {14 },15 },16 },17 transform: {18 '^.+\\.(ts|js|html)$': 'ts-jest',19 },20 testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'],21};22import 'jest-preset-angular';23import './jestGlobalMocks';24Object.defineProperty(window, 'matchMedia', {25 value: jest.fn().mockImplementation((query) => ({26 addEventListener: jest.fn(),27 removeEventListener: jest.fn(),28 dispatchEvent: jest.fn(),29 })),30});31module.exports = function (config) {32 config.set({
Using AI Code Generation
1import { MockBuilder, MockRender } from 'ng-mocks';2import { MyComponent } from './my.component';3import { MyModule } from './my.module';4beforeEach(() => MockBuilder(MyComponent, MyModule));5it('works', () => {6 const fixture = MockRender(MyComponent);7 expect(fixture.nativeElement).toBeDefined();8});9import { CommonModule } from '@angular/common';10import { NgModule } from '@angular/core';11import { MyComponent } from './my.component';12@NgModule({13 imports: [CommonModule],14})15export class MyModule {}16import { Component } from '@angular/core';17@Component({18})19export class MyComponent {}20import { MockBuilder, MockedComponentFixture, MockRender } from 'ng-mocks';21import { MyComponent } from './my.component';22import { MyModule } from './my.module';23describe('MyComponent', () => {24 let fixture: MockedComponentFixture<MyComponent>;25 beforeEach(() => MockBuilder(MyComponent, MyModule));26 beforeEach(() => {27 fixture = MockRender(MyComponent);28 });29 it('works', () => {30 expect(fixture.nativeElement).toBeDefined();31 });32});33import { MockBuilder, MockedComponentFixture, MockRender } from 'ng-mocks';34import { MyComponent } from './my.component';35import { MyModule } from './my.module';36describe('MyComponent', () => {37 let fixture: MockedComponentFixture<MyComponent>;38 beforeEach(() => MockBuilder(MyComponent, MyModule));39 beforeEach(() => {40 fixture = MockRender(MyComponent);41 });42 it('works', () => {43 expect(fixture.nativeElement).toBeDefined();44 });45});46import { MockBuilder, MockedComponentFixture, MockRender } from 'ng-mocks';47import { MyComponent } from './my.component';48import { MyModule } from './my.module';49describe('My
Using AI Code Generation
1import { MockBuilder } from 'ng-mocks';2import { AppModule } from './app.module';3import { AppComponent } from './app.component';4beforeEach(() => MockBuilder(AppComponent).keep(AppModule));5import { MockRender } from 'ng-mocks';6import { AppComponent } from './app.component';7it('renders the component', () => {8 const fixture = MockRender(AppComponent);9 expect(fixture.point.componentInstance).toBeDefined();10});11import { MockRender } from 'ng-mocks';12import { AppComponent } from './app.component';13it('renders the component', () => {14 const fixture = MockRender(AppComponent);15 expect(fixture.debugElement.nativeElement.innerHTML).toContain('Hello world!');16});17import { MockRender } from 'ng-mocks';18import { AppComponent } from './app.component';19it('renders the component', () => {20 const fixture = MockRender(AppComponent);21 expect(fixture.debugElement.nativeElement.innerHTML).toContain('Hello world!');22});23import { MockRender } from 'ng-mocks';24import { AppComponent } from './app.component';25it('renders the component', () => {26 const fixture = MockRender(AppComponent);27 expect(fixture.debugElement.nativeElement.innerHTML).toContain('Hello world!');28});29import { MockRender } from 'ng-mocks';30import { AppComponent } from './app.component';31it('renders the component', () => {32 const fixture = MockRender(AppComponent);33 expect(fixture.debugElement.nativeElement.innerHTML).toContain('Hello world!');34});35import { MockRender } from 'ng-mocks';36import { AppComponent } from './app.component';37it('renders the component', () => {38 const fixture = MockRender(AppComponent);39 expect(fixture.debugElement.nativeElement.innerHTML).toContain('Hello world!');40});41import { MockRender } from 'ng-mocks';42import { AppComponent } from './app.component';43it('renders the component', () => {44 const fixture = MockRender(AppComponent);45 expect(fixture.debugElement.nativeElement.innerHTML).toContain('Hello world!');46});47import { MockRender } from 'ng-mocks';48import { AppComponent } from './app.component';49it('renders the component', () => {
Using AI Code Generation
1import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';2describe('test', () => {3 beforeEach(() => MockBuilder(MyComponent));4 it('should work', () => {5 const fixture = MockRender(MyComponent);6 const component = ngMocks.findInstance(MyComponent);7 expect(component).toBeDefined();8 });9});10If you want to get rid of the ngMocks namespace, you can import the method directly:11import { findInstance } from 'ng-mocks';12describe('test', () => {13 beforeEach(() => MockBuilder(MyComponent));14 it('should work', () => {15 const fixture = MockRender(MyComponent);16 const component = findInstance(MyComponent);17 expect(component).toBeDefined();18 });19});20If you want to use the old syntax, you can do so by importing the ngMocks object:21import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';22describe('test', () => {23 beforeEach(() => MockBuilder(MyComponent));24 it('should work', () => {25 const fixture = MockRender(MyComponent);26 const component = ngMocks.findInstance(MyComponent);27 expect(component).toBeDefined();28 });29});30If you want to get rid of the ngMocks namespace, you can import the method directly:31import { findInstance } from 'ng-mocks';32describe('test', () => {33 beforeEach(() => MockBuilder(MyComponent));34 it('should work', () => {35 const fixture = MockRender(MyComponent);36 const component = findInstance(MyComponent);37 expect(component).toBeDefined();38 });39});
Using AI Code Generation
1import { mockComponent } from 'ng-mocks';2import { MyComponent } from './my-component';3const MyMockComponent = mockComponent(MyComponent);4import { MockComponent } from 'ng-mocks';5const MyMockComponent = MockComponent(MyComponent);6import { Component, Input } from '@angular/core';7@Component({8 <div>{{ name }}</div>9})10export class MyComponent {11 @Input()12 public name: string;13}14import { MyComponent } from './my-component';15import { MyMockComponent } from './test';16describe('MyComponent', () => {17 it('should render name', () => {18 const fixture = MockRender(MyMockComponent, {19 });20 expect(fixture.point.componentInstance.name).toEqual('John');21 expect(fixture.nativeElement.innerHTML).toContain('John');22 });23});24import 'jest-preset-angular';25import 'jest-preset-angular/setup-jest';26module.exports = {27 transformIgnorePatterns: ['node_modules/(?!@ngrx)'],28 globals: {29 'ts-jest': {30 astTransformers: {31 },32 },33 },34 collectCoverageFrom: ['src/app/**/*.{ts,html}', '!src/app/**/*.module.ts', '!src/app/**/index.ts'],35};36{37 "compilerOptions": {
Using AI Code Generation
1import {ngMocks} from 'ng-mocks';2import {MyService} from './my.service';3describe('MyService', () => {4 let service: MyService;5 beforeEach(() => {6 service = ngMocks.defaultMock(MyService);7 ngMocks.stub(service, 'getValue').and.returnValue('stubbed value');8 });9 it('should return stubbed value from the mock', () => {10 expect(service.getValue()).toEqual('stubbed value');11 });12});13import {Injectable} from '@angular/core';14@Injectable()15export class MyService {16 getValue(): string {17 return 'real value';18 }19}
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!