js/src/v8/earley-boyer.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/v8/earley-boyer.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,4684 @@
     1.4 +// This file is automatically generated by scheme2js, except for the
     1.5 +// benchmark harness code at the beginning and end of the file.
     1.6 +
     1.7 +var EarleyBoyer = new BenchmarkSuite('EarleyBoyer', 666463, [
     1.8 +  new Benchmark("Earley", function () { BgL_earleyzd2benchmarkzd2(); }),
     1.9 +  new Benchmark("Boyer", function () { BgL_nboyerzd2benchmarkzd2(); })
    1.10 +]);
    1.11 +
    1.12 +
    1.13 +/************* GENERATED FILE - DO NOT EDIT *************/
    1.14 +/************* GENERATED FILE - DO NOT EDIT *************/
    1.15 +/************* GENERATED FILE - DO NOT EDIT *************/
    1.16 +/************* GENERATED FILE - DO NOT EDIT *************/
    1.17 +/************* GENERATED FILE - DO NOT EDIT *************/
    1.18 +/************* GENERATED FILE - DO NOT EDIT *************/
    1.19 +/************* GENERATED FILE - DO NOT EDIT *************/
    1.20 +/************* GENERATED FILE - DO NOT EDIT *************/
    1.21 +/*
    1.22 + * To use write/prints/... the default-output port has to be set first.
    1.23 + * Simply setting SC_DEFAULT_OUT and SC_ERROR_OUT to the desired values
    1.24 + * should do the trick.
    1.25 + * In the following example the std-out and error-port are redirected to
    1.26 + * a DIV.
    1.27 +function initRuntime() {
    1.28 +    function escapeHTML(s) {
    1.29 +	var tmp = s;
    1.30 +	tmp = tmp.replace(/&/g, "&");
    1.31 +	tmp = tmp.replace(/</g, "&lt;");
    1.32 +	tmp = tmp.replace(/>/g, "&gt;");
    1.33 +	tmp = tmp.replace(/ /g, "&nbsp;");
    1.34 +	tmp = tmp.replace(/\n/g, "<br />");
    1.35 +	tmp = tmp.replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp");
    1.36 +	return tmp;
    1.37 +	
    1.38 +    }
    1.39 +
    1.40 +    document.write("<div id='stdout'></div>");
    1.41 +    SC_DEFAULT_OUT = new sc_GenericOutputPort(
    1.42 +	function(s) {
    1.43 +	    var stdout = document.getElementById('stdout');
    1.44 +	    stdout.innerHTML = stdout.innerHTML + escapeHTML(s);
    1.45 +	});
    1.46 +    SC_ERROR_OUT = SC_DEFAULT_OUT;
    1.47 +}
    1.48 +*/
    1.49 +
    1.50 +
    1.51 +function sc_print_debug() {
    1.52 +    sc_print.apply(null, arguments);
    1.53 +}
    1.54 +/*** META ((export *js*)) */
    1.55 +var sc_JS_GLOBALS = this;
    1.56 +
    1.57 +var __sc_LINE=-1;
    1.58 +var __sc_FILE="";
    1.59 +
    1.60 +/*** META ((export #t)) */
    1.61 +function sc_alert() {
    1.62 +   var len = arguments.length;
    1.63 +   var s = "";
    1.64 +   var i;
    1.65 +
    1.66 +   for( i = 0; i < len; i++ ) {
    1.67 +       s += sc_toDisplayString(arguments[ i ]);
    1.68 +   }
    1.69 +
    1.70 +   return alert( s );
    1.71 +}
    1.72 +
    1.73 +/*** META ((export #t)) */
    1.74 +function sc_typeof( x ) {
    1.75 +   return typeof x;
    1.76 +}
    1.77 +
    1.78 +/*** META ((export #t)) */
    1.79 +function sc_error() {
    1.80 +    var a = [sc_jsstring2symbol("*error*")];
    1.81 +    for (var i = 0; i < arguments.length; i++) {
    1.82 +	a[i+1] = arguments[i];
    1.83 +    }
    1.84 +    throw a;
    1.85 +}
    1.86 +
    1.87 +/*** META ((export #t)
    1.88 +           (peephole (prefix "throw ")))
    1.89 +*/
    1.90 +function sc_raise(obj) {
    1.91 +    throw obj;
    1.92 +}
    1.93 +
    1.94 +/*** META ((export with-handler-lambda)) */
    1.95 +function sc_withHandlerLambda(handler, body) {
    1.96 +    try {
    1.97 +	return body();
    1.98 +    } catch(e) {
    1.99 +	if (!e._internalException)
   1.100 +	    return handler(e);
   1.101 +	else
   1.102 +	    throw e;
   1.103 +    }
   1.104 +}
   1.105 +
   1.106 +var sc_properties = new Object();
   1.107 +
   1.108 +/*** META ((export #t)) */
   1.109 +function sc_putpropBang(sym, key, val) {
   1.110 +    var ht = sc_properties[sym];
   1.111 +    if (!ht) {
   1.112 +	ht = new Object();
   1.113 +	sc_properties[sym] = ht;
   1.114 +    }
   1.115 +    ht[key] = val;
   1.116 +}
   1.117 +
   1.118 +/*** META ((export #t)) */
   1.119 +function sc_getprop(sym, key) {
   1.120 +    var ht = sc_properties[sym];
   1.121 +    if (ht) {
   1.122 +	if (key in ht)
   1.123 +	    return ht[key];
   1.124 +	else
   1.125 +	    return false;
   1.126 +    } else
   1.127 +	return false;
   1.128 +}
   1.129 +
   1.130 +/*** META ((export #t)) */
   1.131 +function sc_rempropBang(sym, key) {
   1.132 +    var ht = sc_properties[sym];
   1.133 +    if (ht)
   1.134 +	delete ht[key];
   1.135 +}
   1.136 +
   1.137 +/*** META ((export #t)) */
   1.138 +function sc_any2String(o) {
   1.139 +    return jsstring2string(sc_toDisplayString(o));
   1.140 +}
   1.141 +
   1.142 +/*** META ((export #t)
   1.143 +           (peephole (infix 2 2 "==="))
   1.144 +           (type bool))
   1.145 +*/
   1.146 +function sc_isEqv(o1, o2) {
   1.147 +    return (o1 === o2);
   1.148 +}
   1.149 +
   1.150 +/*** META ((export #t)
   1.151 +           (peephole (infix 2 2 "==="))
   1.152 +           (type bool))
   1.153 +*/
   1.154 +function sc_isEq(o1, o2) {
   1.155 +    return (o1 === o2);
   1.156 +}
   1.157 +
   1.158 +/*** META ((export #t)
   1.159 +           (type bool))
   1.160 +*/
   1.161 +function sc_isNumber(n) {
   1.162 +    return (typeof n === "number");
   1.163 +}
   1.164 +
   1.165 +/*** META ((export #t)
   1.166 +           (type bool))
   1.167 +*/
   1.168 +function sc_isComplex(n) {
   1.169 +    return sc_isNumber(n);
   1.170 +}
   1.171 +
   1.172 +/*** META ((export #t)
   1.173 +           (type bool))
   1.174 +*/
   1.175 +function sc_isReal(n) {
   1.176 +    return sc_isNumber(n);
   1.177 +}
   1.178 +
   1.179 +/*** META ((export #t)
   1.180 +           (type bool))
   1.181 +*/
   1.182 +function sc_isRational(n) {
   1.183 +    return sc_isReal(n);
   1.184 +}
   1.185 +
   1.186 +/*** META ((export #t)
   1.187 +           (type bool))
   1.188 +*/
   1.189 +function sc_isInteger(n) {
   1.190 +    return (parseInt(n) === n);
   1.191 +}
   1.192 +
   1.193 +/*** META ((export #t)
   1.194 +           (type bool)
   1.195 +           (peephole (postfix ", false")))
   1.196 +*/
   1.197 +// we don't have exact numbers...
   1.198 +function sc_isExact(n) {
   1.199 +    return false;
   1.200 +}
   1.201 +
   1.202 +/*** META ((export #t)
   1.203 +           (peephole (postfix ", true"))
   1.204 +	   (type bool))
   1.205 +*/
   1.206 +function sc_isInexact(n) {
   1.207 +    return true;
   1.208 +}
   1.209 +
   1.210 +/*** META ((export = =fx =fl)
   1.211 +           (type bool)
   1.212 +           (peephole (infix 2 2 "===")))
   1.213 +*/
   1.214 +function sc_equal(x) {
   1.215 +    for (var i = 1; i < arguments.length; i++)
   1.216 +	if (x !== arguments[i])
   1.217 +	    return false;
   1.218 +    return true;
   1.219 +}
   1.220 +
   1.221 +/*** META ((export < <fx <fl)
   1.222 +           (type bool)
   1.223 +           (peephole (infix 2 2 "<")))
   1.224 +*/
   1.225 +function sc_less(x) {
   1.226 +    for (var i = 1; i < arguments.length; i++) {
   1.227 +	if (x >= arguments[i])
   1.228 +	    return false;
   1.229 +	x = arguments[i];
   1.230 +    }
   1.231 +    return true;
   1.232 +}
   1.233 +
   1.234 +/*** META ((export > >fx >fl)
   1.235 +           (type bool)
   1.236 +           (peephole (infix 2 2 ">")))
   1.237 +*/
   1.238 +function sc_greater(x, y) {
   1.239 +    for (var i = 1; i < arguments.length; i++) {
   1.240 +	if (x <= arguments[i])
   1.241 +	    return false;
   1.242 +	x = arguments[i];
   1.243 +    }
   1.244 +    return true;
   1.245 +}
   1.246 +
   1.247 +/*** META ((export <= <=fx <=fl)
   1.248 +           (type bool)
   1.249 +           (peephole (infix 2 2 "<=")))
   1.250 +*/
   1.251 +function sc_lessEqual(x, y) {
   1.252 +    for (var i = 1; i < arguments.length; i++) {
   1.253 +	if (x > arguments[i])
   1.254 +	    return false;
   1.255 +	x = arguments[i];
   1.256 +    }
   1.257 +    return true;
   1.258 +}
   1.259 +
   1.260 +/*** META ((export >= >=fl >=fx)
   1.261 +           (type bool)
   1.262 +           (peephole (infix 2 2 ">=")))
   1.263 +*/
   1.264 +function sc_greaterEqual(x, y) {
   1.265 +    for (var i = 1; i < arguments.length; i++) {
   1.266 +	if (x < arguments[i])
   1.267 +	    return false;
   1.268 +	x = arguments[i];
   1.269 +    }
   1.270 +    return true;
   1.271 +}
   1.272 +
   1.273 +/*** META ((export #t)
   1.274 +           (type bool)
   1.275 +           (peephole (postfix "=== 0")))
   1.276 +*/
   1.277 +function sc_isZero(x) {
   1.278 +    return (x === 0);
   1.279 +}
   1.280 +
   1.281 +/*** META ((export #t)
   1.282 +           (type bool)
   1.283 +           (peephole (postfix "> 0")))
   1.284 +*/
   1.285 +function sc_isPositive(x) {
   1.286 +    return (x > 0);
   1.287 +}
   1.288 +
   1.289 +/*** META ((export #t)
   1.290 +           (type bool)
   1.291 +           (peephole (postfix "< 0")))
   1.292 +*/
   1.293 +function sc_isNegative(x) {
   1.294 +    return (x < 0);
   1.295 +}
   1.296 +
   1.297 +/*** META ((export #t)
   1.298 +           (type bool)
   1.299 +           (peephole (postfix "%2===1")))
   1.300 +*/
   1.301 +function sc_isOdd(x) {
   1.302 +    return (x % 2 === 1);
   1.303 +}
   1.304 +
   1.305 +/*** META ((export #t)
   1.306 +           (type bool)
   1.307 +           (peephole (postfix "%2===0")))
   1.308 +*/
   1.309 +function sc_isEven(x) {
   1.310 +    return (x % 2 === 0);
   1.311 +}
   1.312 +
   1.313 +/*** META ((export #t)) */
   1.314 +var sc_max = Math.max;
   1.315 +/*** META ((export #t)) */
   1.316 +var sc_min = Math.min;
   1.317 +
   1.318 +/*** META ((export + +fx +fl)
   1.319 +           (peephole (infix 0 #f "+" "0")))
   1.320 +*/
   1.321 +function sc_plus() {
   1.322 +    var sum = 0;
   1.323 +    for (var i = 0; i < arguments.length; i++)
   1.324 +	sum += arguments[i];
   1.325 +    return sum;
   1.326 +}
   1.327 +
   1.328 +/*** META ((export * *fx *fl)
   1.329 +           (peephole (infix 0 #f "*" "1")))
   1.330 +*/
   1.331 +function sc_multi() {
   1.332 +    var product = 1;
   1.333 +    for (var i = 0; i < arguments.length; i++)
   1.334 +	product *= arguments[i];
   1.335 +    return product;
   1.336 +}
   1.337 +
   1.338 +/*** META ((export - -fx -fl)
   1.339 +           (peephole (minus)))
   1.340 +*/
   1.341 +function sc_minus(x) {
   1.342 +    if (arguments.length === 1)
   1.343 +	return -x;
   1.344 +    else {
   1.345 +	var res = x;
   1.346 +	for (var i = 1; i < arguments.length; i++)
   1.347 +	    res -= arguments[i];
   1.348 +	return res;
   1.349 +    }
   1.350 +}
   1.351 +
   1.352 +/*** META ((export / /fl)
   1.353 +           (peephole (div)))
   1.354 +*/
   1.355 +function sc_div(x) {
   1.356 +    if (arguments.length === 1)
   1.357 +	return 1/x;
   1.358 +    else {
   1.359 +	var res = x;
   1.360 +	for (var i = 1; i < arguments.length; i++)
   1.361 +	    res /= arguments[i];
   1.362 +	return res;
   1.363 +    }
   1.364 +}
   1.365 +
   1.366 +/*** META ((export #t)) */
   1.367 +var sc_abs = Math.abs;
   1.368 +
   1.369 +/*** META ((export quotient /fx)
   1.370 +           (peephole (hole 2 "parseInt(" x "/" y ")")))
   1.371 +*/
   1.372 +function sc_quotient(x, y) {
   1.373 +    return parseInt(x / y);
   1.374 +}
   1.375 +
   1.376 +/*** META ((export #t)
   1.377 +           (peephole (infix 2 2 "%")))
   1.378 +*/
   1.379 +function sc_remainder(x, y) {
   1.380 +    return x % y;
   1.381 +}
   1.382 +
   1.383 +/*** META ((export #t)
   1.384 +           (peephole (modulo)))
   1.385 +*/
   1.386 +function sc_modulo(x, y) {
   1.387 +    var remainder = x % y;
   1.388 +    // if they don't have the same sign
   1.389 +    if ((remainder * y) < 0)
   1.390 +	return remainder + y;
   1.391 +    else
   1.392 +	return remainder;
   1.393 +}
   1.394 +
   1.395 +function sc_euclid_gcd(a, b) {
   1.396 +    var temp;
   1.397 +    if (a === 0) return b;
   1.398 +    if (b === 0) return a;
   1.399 +    if (a < 0) {a = -a;};
   1.400 +    if (b < 0) {b = -b;};
   1.401 +    if (b > a) {temp = a; a = b; b = temp;};
   1.402 +    while (true) {
   1.403 +	a %= b;
   1.404 +	if(a === 0) {return b;};
   1.405 +	b %= a;
   1.406 +	if(b === 0) {return a;};
   1.407 +    };
   1.408 +    return b;
   1.409 +}
   1.410 +
   1.411 +/*** META ((export #t)) */
   1.412 +function sc_gcd() {
   1.413 +    var gcd = 0;
   1.414 +    for (var i = 0; i < arguments.length; i++)
   1.415 +	gcd = sc_euclid_gcd(gcd, arguments[i]);
   1.416 +    return gcd;
   1.417 +}
   1.418 +
   1.419 +/*** META ((export #t)) */
   1.420 +function sc_lcm() {
   1.421 +    var lcm = 1;
   1.422 +    for (var i = 0; i < arguments.length; i++) {
   1.423 +	var f = Math.round(arguments[i] / sc_euclid_gcd(arguments[i], lcm));
   1.424 +	lcm *= Math.abs(f);
   1.425 +    }
   1.426 +    return lcm;
   1.427 +}
   1.428 +
   1.429 +// LIMITATION: numerator and denominator don't make sense in floating point world.
   1.430 +//var SC_MAX_DECIMALS = 1000000
   1.431 +//
   1.432 +// function sc_numerator(x) {
   1.433 +//     var rounded = Math.round(x * SC_MAX_DECIMALS);
   1.434 +//     return Math.round(rounded / sc_euclid_gcd(rounded, SC_MAX_DECIMALS));
   1.435 +// }
   1.436 +
   1.437 +// function sc_denominator(x) {
   1.438 +//     var rounded = Math.round(x * SC_MAX_DECIMALS);
   1.439 +//     return Math.round(SC_MAX_DECIMALS / sc_euclid_gcd(rounded, SC_MAX_DECIMALS));
   1.440 +// }
   1.441 +
   1.442 +/*** META ((export #t)) */
   1.443 +var sc_floor = Math.floor;
   1.444 +/*** META ((export #t)) */
   1.445 +var sc_ceiling = Math.ceil;
   1.446 +/*** META ((export #t)) */
   1.447 +var sc_truncate = parseInt;
   1.448 +/*** META ((export #t)) */
   1.449 +var sc_round = Math.round;
   1.450 +
   1.451 +// LIMITATION: sc_rationalize doesn't make sense in a floating point world.
   1.452 +
   1.453 +/*** META ((export #t)) */
   1.454 +var sc_exp = Math.exp;
   1.455 +/*** META ((export #t)) */
   1.456 +var sc_log = Math.log;
   1.457 +/*** META ((export #t)) */
   1.458 +var sc_sin = Math.sin;
   1.459 +/*** META ((export #t)) */
   1.460 +var sc_cos = Math.cos;
   1.461 +/*** META ((export #t)) */
   1.462 +var sc_tan = Math.tan;
   1.463 +/*** META ((export #t)) */
   1.464 +var sc_asin = Math.asin;
   1.465 +/*** META ((export #t)) */
   1.466 +var sc_acos = Math.acos;
   1.467 +/*** META ((export #t)) */
   1.468 +var sc_atan = Math.atan;
   1.469 +
   1.470 +/*** META ((export #t)) */
   1.471 +var sc_sqrt = Math.sqrt;
   1.472 +/*** META ((export #t)) */
   1.473 +var sc_expt = Math.pow;
   1.474 +
   1.475 +// LIMITATION: we don't have complex numbers.
   1.476 +// LIMITATION: the following functions are hence not implemented.
   1.477 +// LIMITATION: make-rectangular, make-polar, real-part, imag-part, magnitude, angle
   1.478 +// LIMITATION: 2 argument atan
   1.479 +
   1.480 +/*** META ((export #t)
   1.481 +           (peephole (id)))
   1.482 +*/
   1.483 +function sc_exact2inexact(x) {
   1.484 +    return x;
   1.485 +}
   1.486 +
   1.487 +/*** META ((export #t)
   1.488 +           (peephole (id)))
   1.489 +*/
   1.490 +function sc_inexact2exact(x) {
   1.491 +    return x;
   1.492 +}
   1.493 +
   1.494 +function sc_number2jsstring(x, radix) {
   1.495 +    if (radix)
   1.496 +	return x.toString(radix);
   1.497 +    else
   1.498 +	return x.toString();
   1.499 +}
   1.500 +
   1.501 +function sc_jsstring2number(s, radix) {
   1.502 +    if (s === "") return false;
   1.503 +
   1.504 +    if (radix) {
   1.505 +	var t = parseInt(s, radix);
   1.506 +	if (!t && t !== 0) return false;
   1.507 +	// verify that each char is in range. (parseInt ignores leading
   1.508 +	// white and trailing chars)
   1.509 +	var allowedChars = "01234567890abcdefghijklmnopqrstuvwxyz".substring(0, radix+1);
   1.510 +	if ((new RegExp("^["+allowedChars+"]*$", "i")).test(s))
   1.511 +	    return t;
   1.512 +	else return false;
   1.513 +    } else {
   1.514 +	var t = +s; // does not ignore trailing chars.
   1.515 +	if (!t && t !== 0) return false;
   1.516 +	// simply verify that first char is not whitespace.
   1.517 +	var c = s.charAt(0);
   1.518 +	// if +c is 0, but the char is not "0", then we have a whitespace.
   1.519 +	if (+c === 0 && c !== "0") return false;
   1.520 +	return t;
   1.521 +    }
   1.522 +}
   1.523 +
   1.524 +/*** META ((export #t)
   1.525 +           (type bool)
   1.526 +           (peephole (not)))
   1.527 +*/
   1.528 +function sc_not(b) {
   1.529 +    return b === false;
   1.530 +}
   1.531 +
   1.532 +/*** META ((export #t)
   1.533 +           (type bool))
   1.534 +*/
   1.535 +function sc_isBoolean(b) {
   1.536 +    return (b === true) || (b === false);
   1.537 +}
   1.538 +
   1.539 +function sc_Pair(car, cdr) {
   1.540 +    this.car = car;
   1.541 +    this.cdr = cdr;
   1.542 +}
   1.543 +
   1.544 +sc_Pair.prototype.toString = function() {
   1.545 +    return sc_toDisplayString(this);
   1.546 +};
   1.547 +sc_Pair.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {
   1.548 +    var current = this;
   1.549 +
   1.550 +    var res = "(";
   1.551 +
   1.552 +    while(true) {
   1.553 +	res += writeOrDisplay(current.car);
   1.554 +	if (sc_isPair(current.cdr)) {
   1.555 +	    res += " ";
   1.556 +	    current = current.cdr;
   1.557 +	} else if (current.cdr !== null) {
   1.558 +	    res += " . " + writeOrDisplay(current.cdr);
   1.559 +	    break;
   1.560 +	} else // current.cdr == null
   1.561 +	    break;
   1.562 +    }
   1.563 +	
   1.564 +    res += ")";
   1.565 +
   1.566 +    return res;
   1.567 +};
   1.568 +sc_Pair.prototype.sc_toDisplayString = function() {
   1.569 +    return this.sc_toWriteOrDisplayString(sc_toDisplayString);
   1.570 +};
   1.571 +sc_Pair.prototype.sc_toWriteString = function() {
   1.572 +    return this.sc_toWriteOrDisplayString(sc_toWriteString);
   1.573 +};
   1.574 +// sc_Pair.prototype.sc_toWriteCircleString in IO.js
   1.575 +
   1.576 +/*** META ((export #t)
   1.577 +           (type bool)
   1.578 +           (peephole (postfix " instanceof sc_Pair")))
   1.579 +*/
   1.580 +function sc_isPair(p) {
   1.581 +    return (p instanceof sc_Pair);
   1.582 +}
   1.583 +
   1.584 +function sc_isPairEqual(p1, p2, comp) {
   1.585 +    return (comp(p1.car, p2.car) && comp(p1.cdr, p2.cdr));
   1.586 +}
   1.587 +
   1.588 +/*** META ((export #t)
   1.589 +           (peephole (hole 2 "new sc_Pair(" car ", " cdr ")")))
   1.590 +*/
   1.591 +function sc_cons(car, cdr) {
   1.592 +    return new sc_Pair(car, cdr);
   1.593 +}
   1.594 +
   1.595 +/*** META ((export cons*)) */
   1.596 +function sc_consStar() {
   1.597 +    var res = arguments[arguments.length - 1];
   1.598 +    for (var i = arguments.length-2; i >= 0; i--)
   1.599 +	res = new sc_Pair(arguments[i], res);
   1.600 +    return res;
   1.601 +}
   1.602 +
   1.603 +/*** META ((export #t)
   1.604 +           (peephole (postfix ".car")))
   1.605 +*/
   1.606 +function sc_car(p) {
   1.607 +    return p.car;
   1.608 +}
   1.609 +
   1.610 +/*** META ((export #t)
   1.611 +           (peephole (postfix ".cdr")))
   1.612 +*/
   1.613 +function sc_cdr(p) {
   1.614 +    return p.cdr;
   1.615 +}
   1.616 +
   1.617 +/*** META ((export #t)
   1.618 +           (peephole (hole 2 p ".car = " val)))
   1.619 +*/
   1.620 +function sc_setCarBang(p, val) {
   1.621 +    p.car = val;
   1.622 +}
   1.623 +
   1.624 +/*** META ((export #t)
   1.625 +           (peephole (hole 2 p ".cdr = " val)))
   1.626 +*/
   1.627 +function sc_setCdrBang(p, val) {
   1.628 +    p.cdr = val;
   1.629 +}
   1.630 +
   1.631 +/*** META ((export #t)
   1.632 +           (peephole (postfix ".car.car")))
   1.633 +*/
   1.634 +function sc_caar(p) { return p.car.car; }
   1.635 +/*** META ((export #t)
   1.636 +           (peephole (postfix ".cdr.car")))
   1.637 +*/
   1.638 +function sc_cadr(p) { return p.cdr.car; }
   1.639 +/*** META ((export #t)
   1.640 +           (peephole (postfix ".car.cdr")))
   1.641 +*/
   1.642 +function sc_cdar(p) { return p.car.cdr; }
   1.643 +/*** META ((export #t)
   1.644 +           (peephole (postfix ".cdr.cdr")))
   1.645 +*/
   1.646 +function sc_cddr(p) { return p.cdr.cdr; }
   1.647 +/*** META ((export #t)
   1.648 +           (peephole (postfix ".car.car.car")))
   1.649 +*/
   1.650 +function sc_caaar(p) { return p.car.car.car; }
   1.651 +/*** META ((export #t)
   1.652 +           (peephole (postfix ".car.cdr.car")))
   1.653 +*/
   1.654 +function sc_cadar(p) { return p.car.cdr.car; }
   1.655 +/*** META ((export #t)
   1.656 +           (peephole (postfix ".cdr.car.car")))
   1.657 +*/
   1.658 +function sc_caadr(p) { return p.cdr.car.car; }
   1.659 +/*** META ((export #t)
   1.660 +           (peephole (postfix ".cdr.cdr.car")))
   1.661 +*/
   1.662 +function sc_caddr(p) { return p.cdr.cdr.car; }
   1.663 +/*** META ((export #t)
   1.664 +           (peephole (postfix ".car.car.cdr")))
   1.665 +*/
   1.666 +function sc_cdaar(p) { return p.car.car.cdr; }
   1.667 +/*** META ((export #t)
   1.668 +           (peephole (postfix ".cdr.car.cdr")))
   1.669 +*/
   1.670 +function sc_cdadr(p) { return p.cdr.car.cdr; }
   1.671 +/*** META ((export #t)
   1.672 +           (peephole (postfix ".car.cdr.cdr")))
   1.673 +*/
   1.674 +function sc_cddar(p) { return p.car.cdr.cdr; }
   1.675 +/*** META ((export #t)
   1.676 +           (peephole (postfix ".cdr.cdr.cdr")))
   1.677 +*/
   1.678 +function sc_cdddr(p) { return p.cdr.cdr.cdr; }
   1.679 +/*** META ((export #t)
   1.680 +           (peephole (postfix ".car.car.car.car")))
   1.681 +*/
   1.682 +function sc_caaaar(p) { return p.car.car.car.car; }
   1.683 +/*** META ((export #t)
   1.684 +           (peephole (postfix ".car.cdr.car.car")))
   1.685 +*/
   1.686 +function sc_caadar(p) { return p.car.cdr.car.car; }
   1.687 +/*** META ((export #t)
   1.688 +           (peephole (postfix ".cdr.car.car.car")))
   1.689 +*/
   1.690 +function sc_caaadr(p) { return p.cdr.car.car.car; }
   1.691 +/*** META ((export #t)
   1.692 +           (peephole (postfix ".cdr.cdr.car.car")))
   1.693 +*/
   1.694 +function sc_caaddr(p) { return p.cdr.cdr.car.car; }
   1.695 +/*** META ((export #t)
   1.696 +           (peephole (postfix ".car.car.car.cdr")))
   1.697 +*/
   1.698 +function sc_cdaaar(p) { return p.car.car.car.cdr; }
   1.699 +/*** META ((export #t)
   1.700 +           (peephole (postfix ".car.cdr.car.cdr")))
   1.701 +*/
   1.702 +function sc_cdadar(p) { return p.car.cdr.car.cdr; }
   1.703 +/*** META ((export #t)
   1.704 +           (peephole (postfix ".cdr.car.car.cdr")))
   1.705 +*/
   1.706 +function sc_cdaadr(p) { return p.cdr.car.car.cdr; }
   1.707 +/*** META ((export #t)
   1.708 +           (peephole (postfix ".cdr.cdr.car.cdr")))
   1.709 +*/
   1.710 +function sc_cdaddr(p) { return p.cdr.cdr.car.cdr; }
   1.711 +/*** META ((export #t)
   1.712 +           (peephole (postfix ".car.car.cdr.car")))
   1.713 +*/
   1.714 +function sc_cadaar(p) { return p.car.car.cdr.car; }
   1.715 +/*** META ((export #t)
   1.716 +           (peephole (postfix ".car.cdr.cdr.car")))
   1.717 +*/
   1.718 +function sc_caddar(p) { return p.car.cdr.cdr.car; }
   1.719 +/*** META ((export #t)
   1.720 +           (peephole (postfix ".cdr.car.cdr.car")))
   1.721 +*/
   1.722 +function sc_cadadr(p) { return p.cdr.car.cdr.car; }
   1.723 +/*** META ((export #t)
   1.724 +           (peephole (postfix ".cdr.cdr.cdr.car")))
   1.725 +*/
   1.726 +function sc_cadddr(p) { return p.cdr.cdr.cdr.car; }
   1.727 +/*** META ((export #t)
   1.728 +           (peephole (postfix ".car.car.cdr.cdr")))
   1.729 +*/
   1.730 +function sc_cddaar(p) { return p.car.car.cdr.cdr; }
   1.731 +/*** META ((export #t)
   1.732 +           (peephole (postfix ".car.cdr.cdr.cdr")))
   1.733 +*/
   1.734 +function sc_cdddar(p) { return p.car.cdr.cdr.cdr; }
   1.735 +/*** META ((export #t)
   1.736 +           (peephole (postfix ".cdr.car.cdr.cdr")))
   1.737 +*/
   1.738 +function sc_cddadr(p) { return p.cdr.car.cdr.cdr; }
   1.739 +/*** META ((export #t)
   1.740 +           (peephole (postfix ".cdr.cdr.cdr.cdr")))
   1.741 +*/
   1.742 +function sc_cddddr(p) { return p.cdr.cdr.cdr.cdr; }
   1.743 +
   1.744 +/*** META ((export #t)) */
   1.745 +function sc_lastPair(l) {
   1.746 +    if (!sc_isPair(l)) sc_error("sc_lastPair: pair expected");
   1.747 +    var res = l;
   1.748 +    var cdr = l.cdr;
   1.749 +    while (sc_isPair(cdr)) {
   1.750 +	res = cdr;
   1.751 +	cdr = res.cdr;
   1.752 +    }
   1.753 +    return res;
   1.754 +}
   1.755 +
   1.756 +/*** META ((export #t)
   1.757 +           (type bool)
   1.758 +           (peephole (postfix " === null")))
   1.759 +*/
   1.760 +function sc_isNull(o) {
   1.761 +    return (o === null);
   1.762 +}
   1.763 +
   1.764 +/*** META ((export #t)
   1.765 +           (type bool))
   1.766 +*/
   1.767 +function sc_isList(o) {
   1.768 +    var rabbit;
   1.769 +    var turtle;
   1.770 +
   1.771 +    var rabbit = o;
   1.772 +    var turtle = o;
   1.773 +    while (true) {
   1.774 +	if (rabbit === null ||
   1.775 +	    (rabbit instanceof sc_Pair && rabbit.cdr === null))
   1.776 +	    return true;  // end of list
   1.777 +	else if ((rabbit instanceof sc_Pair) &&
   1.778 +		 (rabbit.cdr instanceof sc_Pair)) {
   1.779 +	    rabbit = rabbit.cdr.cdr;
   1.780 +	    turtle = turtle.cdr;
   1.781 +	    if (rabbit === turtle) return false; // cycle
   1.782 +	} else
   1.783 +	    return false; // not pair
   1.784 +    }
   1.785 +}
   1.786 +
   1.787 +/*** META ((export #t)) */
   1.788 +function sc_list() {
   1.789 +    var res = null;
   1.790 +    var a = arguments;
   1.791 +    for (var i = a.length-1; i >= 0; i--)
   1.792 +	res = new sc_Pair(a[i], res);
   1.793 +    return res;
   1.794 +}
   1.795 +
   1.796 +/*** META ((export #t)) */
   1.797 +function sc_iota(num, init) {
   1.798 +   var res = null;
   1.799 +   if (!init) init = 0;
   1.800 +   for (var i = num - 1; i >= 0; i--)
   1.801 +      res = new sc_Pair(i + init, res);
   1.802 +   return res;
   1.803 +}
   1.804 +
   1.805 +/*** META ((export #t)) */
   1.806 +function sc_makeList(nbEls, fill) {
   1.807 +    var res = null;
   1.808 +    for (var i = 0; i < nbEls; i++)
   1.809 +	res = new sc_Pair(fill, res);
   1.810 +    return res;
   1.811 +}
   1.812 +
   1.813 +/*** META ((export #t)) */
   1.814 +function sc_length(l) {
   1.815 +    var res = 0;
   1.816 +    while (l !== null) {
   1.817 +	res++;
   1.818 +	l = l.cdr;
   1.819 +    }
   1.820 +    return res;
   1.821 +}
   1.822 +
   1.823 +/*** META ((export #t)) */
   1.824 +function sc_remq(o, l) {
   1.825 +    var dummy = { cdr : null };
   1.826 +    var tail = dummy;
   1.827 +    while (l !== null) {
   1.828 +	if (l.car !== o) {
   1.829 +	    tail.cdr = sc_cons(l.car, null);
   1.830 +	    tail = tail.cdr;
   1.831 +	}
   1.832 +	l = l.cdr;
   1.833 +    }
   1.834 +    return dummy.cdr;
   1.835 +}
   1.836 +
   1.837 +/*** META ((export #t)) */
   1.838 +function sc_remqBang(o, l) {
   1.839 +    var dummy = { cdr : null };
   1.840 +    var tail = dummy;
   1.841 +    var needsAssig = true;
   1.842 +    while (l !== null) {
   1.843 +	if (l.car === o) {
   1.844 +	    needsAssig = true;
   1.845 +	} else {
   1.846 +	    if (needsAssig) {
   1.847 +		tail.cdr = l;
   1.848 +		needsAssig = false;
   1.849 +	    }
   1.850 +	    tail = l;
   1.851 +	}
   1.852 +	l = l.cdr;
   1.853 +    }
   1.854 +    tail.cdr = null;
   1.855 +    return dummy.cdr;
   1.856 +}
   1.857 +
   1.858 +/*** META ((export #t)) */
   1.859 +function sc_delete(o, l) {
   1.860 +    var dummy = { cdr : null };
   1.861 +    var tail = dummy;
   1.862 +    while (l !== null) {
   1.863 +	if (!sc_isEqual(l.car, o)) {
   1.864 +	    tail.cdr = sc_cons(l.car, null);
   1.865 +	    tail = tail.cdr;
   1.866 +	}
   1.867 +	l = l.cdr;
   1.868 +    }
   1.869 +    return dummy.cdr;
   1.870 +}
   1.871 +
   1.872 +/*** META ((export #t)) */
   1.873 +function sc_deleteBang(o, l) {
   1.874 +    var dummy = { cdr : null };
   1.875 +    var tail = dummy;
   1.876 +    var needsAssig = true;
   1.877 +    while (l !== null) {
   1.878 +	if (sc_isEqual(l.car, o)) {
   1.879 +	    needsAssig = true;
   1.880 +	} else {
   1.881 +	    if (needsAssig) {
   1.882 +		tail.cdr = l;
   1.883 +		needsAssig = false;
   1.884 +	    }
   1.885 +	    tail = l;
   1.886 +	}
   1.887 +	l = l.cdr;
   1.888 +    }
   1.889 +    tail.cdr = null;
   1.890 +    return dummy.cdr;
   1.891 +}
   1.892 +
   1.893 +function sc_reverseAppendBang(l1, l2) {
   1.894 +    var res = l2;
   1.895 +    while (l1 !== null) {
   1.896 +	var tmp = res;
   1.897 +	res = l1;
   1.898 +	l1 = l1.cdr;
   1.899 +	res.cdr = tmp;
   1.900 +    }
   1.901 +    return res;
   1.902 +}
   1.903 +	
   1.904 +function sc_dualAppend(l1, l2) {
   1.905 +    if (l1 === null) return l2;
   1.906 +    if (l2 === null) return l1;
   1.907 +    var rev = sc_reverse(l1);
   1.908 +    return sc_reverseAppendBang(rev, l2);
   1.909 +}
   1.910 +
   1.911 +/*** META ((export #t)) */
   1.912 +function sc_append() {
   1.913 +    if (arguments.length === 0)
   1.914 +	return null;
   1.915 +    var res = arguments[arguments.length - 1];
   1.916 +    for (var i = arguments.length - 2; i >= 0; i--)
   1.917 +	res = sc_dualAppend(arguments[i], res);
   1.918 +    return res;
   1.919 +}
   1.920 +
   1.921 +function sc_dualAppendBang(l1, l2) {
   1.922 +    if (l1 === null) return l2;
   1.923 +    if (l2 === null) return l1;
   1.924 +    var tmp = l1;
   1.925 +    while (tmp.cdr !== null) tmp=tmp.cdr;
   1.926 +    tmp.cdr = l2;
   1.927 +    return l1;
   1.928 +}
   1.929 +
   1.930 +/*** META ((export #t)) */
   1.931 +function sc_appendBang() {
   1.932 +    var res = null;
   1.933 +    for (var i = 0; i < arguments.length; i++)
   1.934 +	res = sc_dualAppendBang(res, arguments[i]);
   1.935 +    return res;
   1.936 +}
   1.937 +
   1.938 +/*** META ((export #t)) */
   1.939 +function sc_reverse(l1) {
   1.940 +    var res = null;
   1.941 +    while (l1 !== null) {
   1.942 +	res = sc_cons(l1.car, res);
   1.943 +	l1 = l1.cdr;
   1.944 +    }
   1.945 +    return res;
   1.946 +}
   1.947 +
   1.948 +/*** META ((export #t)) */
   1.949 +function sc_reverseBang(l) {
   1.950 +    return sc_reverseAppendBang(l, null);
   1.951 +}
   1.952 +
   1.953 +/*** META ((export #t)) */
   1.954 +function sc_listTail(l, k) {
   1.955 +    var res = l;
   1.956 +    for (var i = 0; i < k; i++) {
   1.957 +	res = res.cdr;
   1.958 +    }
   1.959 +    return res;
   1.960 +}
   1.961 +
   1.962 +/*** META ((export #t)) */
   1.963 +function sc_listRef(l, k) {
   1.964 +    return sc_listTail(l, k).car;
   1.965 +}
   1.966 +
   1.967 +/* // unoptimized generic versions
   1.968 +function sc_memX(o, l, comp) {
   1.969 +    while (l != null) {
   1.970 +	if (comp(l.car, o))
   1.971 +	    return l;
   1.972 +	l = l.cdr;
   1.973 +    }
   1.974 +    return false;
   1.975 +}
   1.976 +function sc_memq(o, l) { return sc_memX(o, l, sc_isEq); }
   1.977 +function sc_memv(o, l) { return sc_memX(o, l, sc_isEqv); }
   1.978 +function sc_member(o, l) { return sc_memX(o, l, sc_isEqual); }
   1.979 +*/
   1.980 +
   1.981 +/* optimized versions */
   1.982 +/*** META ((export #t)) */
   1.983 +function sc_memq(o, l) {
   1.984 +    while (l !== null) {
   1.985 +	if (l.car === o)
   1.986 +	    return l;
   1.987 +	l = l.cdr;
   1.988 +    }
   1.989 +    return false;
   1.990 +}
   1.991 +/*** META ((export #t)) */
   1.992 +function sc_memv(o, l) {
   1.993 +    while (l !== null) {
   1.994 +	if (l.car === o)
   1.995 +	    return l;
   1.996 +	l = l.cdr;
   1.997 +    }
   1.998 +    return false;
   1.999 +}
  1.1000 +/*** META ((export #t)) */
  1.1001 +function sc_member(o, l) {
  1.1002 +    while (l !== null) {
  1.1003 +	if (sc_isEqual(l.car,o))
  1.1004 +	    return l;
  1.1005 +	l = l.cdr;
  1.1006 +    }
  1.1007 +    return false;
  1.1008 +}
  1.1009 +
  1.1010 +/* // generic unoptimized versions
  1.1011 +function sc_assX(o, al, comp) {
  1.1012 +    while (al != null) {
  1.1013 +	if (comp(al.car.car, o))
  1.1014 +	    return al.car;
  1.1015 +	al = al.cdr;
  1.1016 +    }
  1.1017 +    return false;
  1.1018 +}
  1.1019 +function sc_assq(o, al) { return sc_assX(o, al, sc_isEq); }
  1.1020 +function sc_assv(o, al) { return sc_assX(o, al, sc_isEqv); }
  1.1021 +function sc_assoc(o, al) { return sc_assX(o, al, sc_isEqual); }
  1.1022 +*/
  1.1023 +// optimized versions
  1.1024 +/*** META ((export #t)) */
  1.1025 +function sc_assq(o, al) {
  1.1026 +    while (al !== null) {
  1.1027 +	if (al.car.car === o)
  1.1028 +	    return al.car;
  1.1029 +	al = al.cdr;
  1.1030 +    }
  1.1031 +    return false;
  1.1032 +}
  1.1033 +/*** META ((export #t)) */
  1.1034 +function sc_assv(o, al) {
  1.1035 +    while (al !== null) {
  1.1036 +	if (al.car.car === o)
  1.1037 +	    return al.car;
  1.1038 +	al = al.cdr;
  1.1039 +    }
  1.1040 +    return false;
  1.1041 +}
  1.1042 +/*** META ((export #t)) */
  1.1043 +function sc_assoc(o, al) {
  1.1044 +    while (al !== null) {
  1.1045 +	if (sc_isEqual(al.car.car, o))
  1.1046 +	    return al.car;
  1.1047 +	al = al.cdr;
  1.1048 +    }
  1.1049 +    return false;
  1.1050 +}
  1.1051 +
  1.1052 +/* can be used for mutable strings and characters */
  1.1053 +function sc_isCharStringEqual(cs1, cs2) { return cs1.val === cs2.val; }
  1.1054 +function sc_isCharStringLess(cs1, cs2) { return cs1.val < cs2.val; }
  1.1055 +function sc_isCharStringGreater(cs1, cs2) { return cs1.val > cs2.val; }
  1.1056 +function sc_isCharStringLessEqual(cs1, cs2) { return cs1.val <= cs2.val; }
  1.1057 +function sc_isCharStringGreaterEqual(cs1, cs2) { return cs1.val >= cs2.val; }
  1.1058 +function sc_isCharStringCIEqual(cs1, cs2)
  1.1059 +    { return cs1.val.toLowerCase() === cs2.val.toLowerCase(); }
  1.1060 +function sc_isCharStringCILess(cs1, cs2)
  1.1061 +    { return cs1.val.toLowerCase() < cs2.val.toLowerCase(); }
  1.1062 +function sc_isCharStringCIGreater(cs1, cs2)
  1.1063 +    { return cs1.val.toLowerCase() > cs2.val.toLowerCase(); }
  1.1064 +function sc_isCharStringCILessEqual(cs1, cs2)
  1.1065 +    { return cs1.val.toLowerCase() <= cs2.val.toLowerCase(); }
  1.1066 +function sc_isCharStringCIGreaterEqual(cs1, cs2)
  1.1067 +    { return cs1.val.toLowerCase() >= cs2.val.toLowerCase(); }
  1.1068 +
  1.1069 +
  1.1070 +
  1.1071 +
  1.1072 +function sc_Char(c) {
  1.1073 +    var cached = sc_Char.lazy[c];
  1.1074 +    if (cached)
  1.1075 +	return cached;
  1.1076 +    this.val = c;
  1.1077 +    sc_Char.lazy[c] = this;
  1.1078 +    // add return, so FF does not complain.
  1.1079 +    return undefined;
  1.1080 +}
  1.1081 +sc_Char.lazy = new Object();
  1.1082 +// thanks to Eric
  1.1083 +sc_Char.char2readable = {
  1.1084 +    "\000": "#\\null",
  1.1085 +    "\007": "#\\bell",
  1.1086 +    "\010": "#\\backspace",
  1.1087 +    "\011": "#\\tab",
  1.1088 +    "\012": "#\\newline",
  1.1089 +    "\014": "#\\page",
  1.1090 +    "\015": "#\\return",
  1.1091 +    "\033": "#\\escape",
  1.1092 +    "\040": "#\\space",
  1.1093 +    "\177": "#\\delete",
  1.1094 +
  1.1095 +  /* poeticless names */
  1.1096 +    "\001": "#\\soh",
  1.1097 +    "\002": "#\\stx",
  1.1098 +    "\003": "#\\etx",
  1.1099 +    "\004": "#\\eot",
  1.1100 +    "\005": "#\\enq",
  1.1101 +    "\006": "#\\ack",
  1.1102 +
  1.1103 +    "\013": "#\\vt",
  1.1104 +    "\016": "#\\so",
  1.1105 +    "\017": "#\\si",
  1.1106 +
  1.1107 +    "\020": "#\\dle",
  1.1108 +    "\021": "#\\dc1",
  1.1109 +    "\022": "#\\dc2",
  1.1110 +    "\023": "#\\dc3",
  1.1111 +    "\024": "#\\dc4",
  1.1112 +    "\025": "#\\nak",
  1.1113 +    "\026": "#\\syn",
  1.1114 +    "\027": "#\\etb",
  1.1115 +
  1.1116 +    "\030": "#\\can",
  1.1117 +    "\031": "#\\em",
  1.1118 +    "\032": "#\\sub",
  1.1119 +    "\033": "#\\esc",
  1.1120 +    "\034": "#\\fs",
  1.1121 +    "\035": "#\\gs",
  1.1122 +    "\036": "#\\rs",
  1.1123 +    "\037": "#\\us"};
  1.1124 +
  1.1125 +sc_Char.readable2char = {
  1.1126 +    "null": "\000",
  1.1127 +    "bell": "\007",
  1.1128 +    "backspace": "\010",
  1.1129 +    "tab": "\011",
  1.1130 +    "newline": "\012",
  1.1131 +    "page": "\014",
  1.1132 +    "return": "\015",
  1.1133 +    "escape": "\033",
  1.1134 +    "space": "\040",
  1.1135 +    "delete": "\000",
  1.1136 +    "soh": "\001",
  1.1137 +    "stx": "\002",
  1.1138 +    "etx": "\003",
  1.1139 +    "eot": "\004",
  1.1140 +    "enq": "\005",
  1.1141 +    "ack": "\006",
  1.1142 +    "bel": "\007",
  1.1143 +    "bs": "\010",
  1.1144 +    "ht": "\011",
  1.1145 +    "nl": "\012",
  1.1146 +    "vt": "\013",
  1.1147 +    "np": "\014",
  1.1148 +    "cr": "\015",
  1.1149 +    "so": "\016",
  1.1150 +    "si": "\017",
  1.1151 +    "dle": "\020",
  1.1152 +    "dc1": "\021",
  1.1153 +    "dc2": "\022",
  1.1154 +    "dc3": "\023",
  1.1155 +    "dc4": "\024",
  1.1156 +    "nak": "\025",
  1.1157 +    "syn": "\026",
  1.1158 +    "etb": "\027",
  1.1159 +    "can": "\030",
  1.1160 +    "em": "\031",
  1.1161 +    "sub": "\032",
  1.1162 +    "esc": "\033",
  1.1163 +    "fs": "\034",
  1.1164 +    "gs": "\035",
  1.1165 +    "rs": "\036",
  1.1166 +    "us": "\037",
  1.1167 +    "sp": "\040",
  1.1168 +    "del": "\177"};
  1.1169 +
  1.1170 +sc_Char.prototype.toString = function() {
  1.1171 +    return this.val;
  1.1172 +};
  1.1173 +// sc_toDisplayString == toString
  1.1174 +sc_Char.prototype.sc_toWriteString = function() {
  1.1175 +    var entry = sc_Char.char2readable[this.val];
  1.1176 +    if (entry)
  1.1177 +	return entry;
  1.1178 +    else
  1.1179 +	return "#\\" + this.val;
  1.1180 +};
  1.1181 +
  1.1182 +/*** META ((export #t)
  1.1183 +           (type bool)
  1.1184 +           (peephole (postfix "instanceof sc_Char")))
  1.1185 +*/
  1.1186 +function sc_isChar(c) {
  1.1187 +    return (c instanceof sc_Char);
  1.1188 +}
  1.1189 +
  1.1190 +/*** META ((export char=?)
  1.1191 +           (type bool)
  1.1192 +           (peephole (hole 2 c1 ".val === " c2 ".val")))
  1.1193 +*/
  1.1194 +var sc_isCharEqual = sc_isCharStringEqual;
  1.1195 +/*** META ((export char<?)
  1.1196 +           (type bool)
  1.1197 +           (peephole (hole 2 c1 ".val < " c2 ".val")))
  1.1198 +*/
  1.1199 +var sc_isCharLess = sc_isCharStringLess;
  1.1200 +/*** META ((export char>?)
  1.1201 +           (type bool)
  1.1202 +           (peephole (hole 2 c1 ".val > " c2 ".val")))
  1.1203 +*/
  1.1204 +var sc_isCharGreater = sc_isCharStringGreater;
  1.1205 +/*** META ((export char<=?)
  1.1206 +           (type bool)
  1.1207 +           (peephole (hole 2 c1 ".val <= " c2 ".val")))
  1.1208 +*/
  1.1209 +var sc_isCharLessEqual = sc_isCharStringLessEqual;
  1.1210 +/*** META ((export char>=?)
  1.1211 +           (type bool)
  1.1212 +           (peephole (hole 2 c1 ".val >= " c2 ".val")))
  1.1213 +*/
  1.1214 +var sc_isCharGreaterEqual = sc_isCharStringGreaterEqual;
  1.1215 +/*** META ((export char-ci=?)
  1.1216 +           (type bool)
  1.1217 +           (peephole (hole 2 c1 ".val.toLowerCase() === " c2 ".val.toLowerCase()")))
  1.1218 +*/
  1.1219 +var sc_isCharCIEqual = sc_isCharStringCIEqual;
  1.1220 +/*** META ((export char-ci<?)
  1.1221 +           (type bool)
  1.1222 +           (peephole (hole 2 c1 ".val.toLowerCase() < " c2 ".val.toLowerCase()")))
  1.1223 +*/
  1.1224 +var sc_isCharCILess = sc_isCharStringCILess;
  1.1225 +/*** META ((export char-ci>?)
  1.1226 +           (type bool)
  1.1227 +           (peephole (hole 2 c1 ".val.toLowerCase() > " c2 ".val.toLowerCase()")))
  1.1228 +*/
  1.1229 +var sc_isCharCIGreater = sc_isCharStringCIGreater;
  1.1230 +/*** META ((export char-ci<=?)
  1.1231 +           (type bool)
  1.1232 +           (peephole (hole 2 c1 ".val.toLowerCase() <= " c2 ".val.toLowerCase()")))
  1.1233 +*/
  1.1234 +var sc_isCharCILessEqual = sc_isCharStringCILessEqual;
  1.1235 +/*** META ((export char-ci>=?)
  1.1236 +           (type bool)
  1.1237 +           (peephole (hole 2 c1 ".val.toLowerCase() >= " c2 ".val.toLowerCase()")))
  1.1238 +*/
  1.1239 +var sc_isCharCIGreaterEqual = sc_isCharStringCIGreaterEqual;
  1.1240 +
  1.1241 +var SC_NUMBER_CLASS = "0123456789";
  1.1242 +var SC_WHITESPACE_CLASS = ' \r\n\t\f';
  1.1243 +var SC_LOWER_CLASS = 'abcdefghijklmnopqrstuvwxyz';
  1.1244 +var SC_UPPER_CLASS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  1.1245 +
  1.1246 +function sc_isCharOfClass(c, cl) { return (cl.indexOf(c) != -1); }
  1.1247 +/*** META ((export #t)
  1.1248 +           (type bool))
  1.1249 +*/
  1.1250 +function sc_isCharAlphabetic(c)
  1.1251 +    { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) ||
  1.1252 +	  sc_isCharOfClass(c.val, SC_UPPER_CLASS); }
  1.1253 +/*** META ((export #t)
  1.1254 +           (type bool)
  1.1255 +           (peephole (hole 1 "SC_NUMBER_CLASS.indexOf(" c ".val) != -1")))
  1.1256 +*/
  1.1257 +function sc_isCharNumeric(c)
  1.1258 +    { return sc_isCharOfClass(c.val, SC_NUMBER_CLASS); }
  1.1259 +/*** META ((export #t)
  1.1260 +           (type bool))
  1.1261 +*/
  1.1262 +function sc_isCharWhitespace(c) {
  1.1263 +    var tmp = c.val;
  1.1264 +    return tmp === " " || tmp === "\r" || tmp === "\n" || tmp === "\t" || tmp === "\f";
  1.1265 +}
  1.1266 +/*** META ((export #t)
  1.1267 +           (type bool)
  1.1268 +           (peephole (hole 1 "SC_UPPER_CLASS.indexOf(" c ".val) != -1")))
  1.1269 +*/
  1.1270 +function sc_isCharUpperCase(c)
  1.1271 +    { return sc_isCharOfClass(c.val, SC_UPPER_CLASS); }
  1.1272 +/*** META ((export #t)
  1.1273 +           (type bool)
  1.1274 +           (peephole (hole 1 "SC_LOWER_CLASS.indexOf(" c ".val) != -1")))
  1.1275 +*/
  1.1276 +function sc_isCharLowerCase(c)
  1.1277 +    { return sc_isCharOfClass(c.val, SC_LOWER_CLASS); }
  1.1278 +
  1.1279 +/*** META ((export #t)
  1.1280 +           (peephole (postfix ".val.charCodeAt(0)")))
  1.1281 +*/
  1.1282 +function sc_char2integer(c)
  1.1283 +    { return c.val.charCodeAt(0); }
  1.1284 +/*** META ((export #t)
  1.1285 +           (peephole (hole 1 "new sc_Char(String.fromCharCode(" n "))")))
  1.1286 +*/
  1.1287 +function sc_integer2char(n)
  1.1288 +    { return new sc_Char(String.fromCharCode(n)); }
  1.1289 +
  1.1290 +/*** META ((export #t)
  1.1291 +           (peephole (hole 1 "new sc_Char(" c ".val.toUpperCase())")))
  1.1292 +*/
  1.1293 +function sc_charUpcase(c)
  1.1294 +    { return new sc_Char(c.val.toUpperCase()); }
  1.1295 +/*** META ((export #t)
  1.1296 +           (peephole (hole 1 "new sc_Char(" c ".val.toLowerCase())")))
  1.1297 +*/
  1.1298 +function sc_charDowncase(c)
  1.1299 +    { return new sc_Char(c.val.toLowerCase()); }
  1.1300 +
  1.1301 +function sc_makeJSStringOfLength(k, c) {
  1.1302 +    var fill;
  1.1303 +    if (c === undefined)
  1.1304 +	fill = " ";
  1.1305 +    else
  1.1306 +	fill = c;
  1.1307 +    var res = "";
  1.1308 +    var len = 1;
  1.1309 +    // every round doubles the size of fill.
  1.1310 +    while (k >= len) {
  1.1311 +	if (k & len)
  1.1312 +	    res = res.concat(fill);
  1.1313 +	fill = fill.concat(fill);
  1.1314 +	len *= 2;
  1.1315 +    }
  1.1316 +    return res;
  1.1317 +}
  1.1318 +
  1.1319 +function sc_makejsString(k, c) {
  1.1320 +    var fill;
  1.1321 +    if (c)
  1.1322 +	fill = c.val;
  1.1323 +    else
  1.1324 +	fill = " ";
  1.1325 +    return sc_makeJSStringOfLength(k, fill);
  1.1326 +}
  1.1327 +
  1.1328 +function sc_jsstring2list(s) {
  1.1329 +    var res = null;
  1.1330 +    for (var i = s.length - 1; i >= 0; i--)
  1.1331 +	res = sc_cons(new sc_Char(s.charAt(i)), res);
  1.1332 +    return res;
  1.1333 +}
  1.1334 +
  1.1335 +function sc_list2jsstring(l) {
  1.1336 +    var a = new Array();
  1.1337 +    while(l !== null) {
  1.1338 +	a.push(l.car.val);
  1.1339 +	l = l.cdr;
  1.1340 +    }
  1.1341 +    return "".concat.apply("", a);
  1.1342 +}
  1.1343 +
  1.1344 +var sc_Vector = Array;
  1.1345 +
  1.1346 +sc_Vector.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) {
  1.1347 +    if (this.length === 0) return "#()";
  1.1348 +
  1.1349 +    var res = "#(" + writeOrDisplay(this[0]);
  1.1350 +    for (var i = 1; i < this.length; i++)
  1.1351 +	res += " " + writeOrDisplay(this[i]);
  1.1352 +    res += ")";
  1.1353 +    return res;
  1.1354 +};
  1.1355 +sc_Vector.prototype.sc_toDisplayString = function() {
  1.1356 +    return this.sc_toWriteOrDisplayString(sc_toDisplayString);
  1.1357 +};
  1.1358 +sc_Vector.prototype.sc_toWriteString = function() {
  1.1359 +    return this.sc_toWriteOrDisplayString(sc_toWriteString);
  1.1360 +};
  1.1361 +
  1.1362 +/*** META ((export vector? array?)
  1.1363 +           (type bool)
  1.1364 +           (peephole (postfix " instanceof sc_Vector")))
  1.1365 +*/
  1.1366 +function sc_isVector(v) {
  1.1367 +    return (v instanceof sc_Vector);
  1.1368 +}
  1.1369 +
  1.1370 +// only applies to vectors
  1.1371 +function sc_isVectorEqual(v1, v2, comp) {
  1.1372 +    if (v1.length !== v2.length) return false;
  1.1373 +    for (var i = 0; i < v1.length; i++)
  1.1374 +	if (!comp(v1[i], v2[i])) return false;
  1.1375 +    return true;
  1.1376 +}
  1.1377 +
  1.1378 +/*** META ((export make-vector make-array)) */
  1.1379 +function sc_makeVector(size, fill) {
  1.1380 +    var a = new sc_Vector(size);
  1.1381 +    if (fill !== undefined)
  1.1382 +	sc_vectorFillBang(a, fill);
  1.1383 +    return a;
  1.1384 +}
  1.1385 +
  1.1386 +/*** META ((export vector array)
  1.1387 +           (peephole (vector)))
  1.1388 +*/
  1.1389 +function sc_vector() {
  1.1390 +    var a = new sc_Vector();
  1.1391 +    for (var i = 0; i < arguments.length; i++)
  1.1392 +	a.push(arguments[i]);
  1.1393 +    return a;
  1.1394 +}
  1.1395 +
  1.1396 +/*** META ((export vector-length array-length)
  1.1397 +           (peephole (postfix ".length")))
  1.1398 +*/
  1.1399 +function sc_vectorLength(v) {
  1.1400 +    return v.length;
  1.1401 +}
  1.1402 +
  1.1403 +/*** META ((export vector-ref array-ref)
  1.1404 +           (peephole (hole 2 v "[" pos "]")))
  1.1405 +*/
  1.1406 +function sc_vectorRef(v, pos) {
  1.1407 +    return v[pos];
  1.1408 +}
  1.1409 +
  1.1410 +/*** META ((export vector-set! array-set!)
  1.1411 +           (peephole (hole 3 v "[" pos "] = " val)))
  1.1412 +*/
  1.1413 +function sc_vectorSetBang(v, pos, val) {
  1.1414 +    v[pos] = val;
  1.1415 +}
  1.1416 +
  1.1417 +/*** META ((export vector->list array->list)) */
  1.1418 +function sc_vector2list(a) {
  1.1419 +    var res = null;
  1.1420 +    for (var i = a.length-1; i >= 0; i--)
  1.1421 +	res = sc_cons(a[i], res);
  1.1422 +    return res;
  1.1423 +}
  1.1424 +
  1.1425 +/*** META ((export list->vector list->array)) */
  1.1426 +function sc_list2vector(l) {
  1.1427 +    var a = new sc_Vector();
  1.1428 +    while(l !== null) {
  1.1429 +	a.push(l.car);
  1.1430 +	l = l.cdr;
  1.1431 +    }
  1.1432 +    return a;
  1.1433 +}
  1.1434 +
  1.1435 +/*** META ((export vector-fill! array-fill!)) */
  1.1436 +function sc_vectorFillBang(a, fill) {
  1.1437 +    for (var i = 0; i < a.length; i++)
  1.1438 +	a[i] = fill;
  1.1439 +}
  1.1440 +
  1.1441 +
  1.1442 +/*** META ((export #t)) */
  1.1443 +function sc_copyVector(a, len) {
  1.1444 +    if (len <= a.length)
  1.1445 +	return a.slice(0, len);
  1.1446 +    else {
  1.1447 +	var tmp = a.concat();
  1.1448 +	tmp.length = len;
  1.1449 +	return tmp;
  1.1450 +    }
  1.1451 +}
  1.1452 +
  1.1453 +/*** META ((export #t)
  1.1454 +           (peephole (hole 3 a ".slice(" start "," end ")")))
  1.1455 +*/
  1.1456 +function sc_vectorCopy(a, start, end) {
  1.1457 +    return a.slice(start, end);
  1.1458 +}
  1.1459 +
  1.1460 +/*** META ((export #t)) */
  1.1461 +function sc_vectorCopyBang(target, tstart, source, sstart, send) {
  1.1462 +    if (!sstart) sstart = 0;
  1.1463 +    if (!send) send = source.length;
  1.1464 +
  1.1465 +    // if target == source we don't want to overwrite not yet copied elements.
  1.1466 +    if (tstart <= sstart) {
  1.1467 +	for (var i = tstart, j = sstart; j < send; i++, j++) {
  1.1468 +	    target[i] = source[j];
  1.1469 +	}
  1.1470 +    } else {
  1.1471 +	var diff = send - sstart;
  1.1472 +	for (var i = tstart + diff - 1, j = send - 1;
  1.1473 +	     j >= sstart;
  1.1474 +	     i--, j--) {
  1.1475 +	    target[i] = source[j];
  1.1476 +	}
  1.1477 +    }
  1.1478 +    return target;
  1.1479 +}
  1.1480 +
  1.1481 +/*** META ((export #t)
  1.1482 +           (type bool)
  1.1483 +           (peephole (hole 1 "typeof " o " === 'function'")))
  1.1484 +*/
  1.1485 +function sc_isProcedure(o) {
  1.1486 +    return (typeof o === "function");
  1.1487 +}
  1.1488 +
  1.1489 +/*** META ((export #t)) */
  1.1490 +function sc_apply(proc) {
  1.1491 +    var args = new Array();
  1.1492 +    // first part of arguments are not in list-form.
  1.1493 +    for (var i = 1; i < arguments.length - 1; i++)
  1.1494 +	args.push(arguments[i]);
  1.1495 +    var l = arguments[arguments.length - 1];
  1.1496 +    while (l !== null) {
  1.1497 +	args.push(l.car);
  1.1498 +	l = l.cdr;
  1.1499 +    }
  1.1500 +    return proc.apply(null, args);
  1.1501 +}
  1.1502 +
  1.1503 +/*** META ((export #t)) */
  1.1504 +function sc_map(proc, l1) {
  1.1505 +    if (l1 === undefined)
  1.1506 +	return null;
  1.1507 +    // else
  1.1508 +    var nbApplyArgs = arguments.length - 1;
  1.1509 +    var applyArgs = new Array(nbApplyArgs);
  1.1510 +    var revres = null;
  1.1511 +    while (l1 !== null) {
  1.1512 +	for (var i = 0; i < nbApplyArgs; i++) {
  1.1513 +	    applyArgs[i] = arguments[i + 1].car;
  1.1514 +	    arguments[i + 1] = arguments[i + 1].cdr;
  1.1515 +	}
  1.1516 +	revres = sc_cons(proc.apply(null, applyArgs), revres);
  1.1517 +    }
  1.1518 +    return sc_reverseAppendBang(revres, null);
  1.1519 +}
  1.1520 +
  1.1521 +/*** META ((export #t)) */
  1.1522 +function sc_mapBang(proc, l1) {
  1.1523 +    if (l1 === undefined)
  1.1524 +	return null;
  1.1525 +    // else
  1.1526 +    var l1_orig = l1;
  1.1527 +    var nbApplyArgs = arguments.length - 1;
  1.1528 +    var applyArgs = new Array(nbApplyArgs);
  1.1529 +    while (l1 !== null) {
  1.1530 +	var tmp = l1;
  1.1531 +	for (var i = 0; i < nbApplyArgs; i++) {
  1.1532 +	    applyArgs[i] = arguments[i + 1].car;
  1.1533 +	    arguments[i + 1] = arguments[i + 1].cdr;
  1.1534 +	}
  1.1535 +	tmp.car = proc.apply(null, applyArgs);
  1.1536 +    }
  1.1537 +    return l1_orig;
  1.1538 +}
  1.1539 +
  1.1540 +/*** META ((export #t)) */
  1.1541 +function sc_forEach(proc, l1) {
  1.1542 +    if (l1 === undefined)
  1.1543 +	return undefined;
  1.1544 +    // else
  1.1545 +    var nbApplyArgs = arguments.length - 1;
  1.1546 +    var applyArgs = new Array(nbApplyArgs);
  1.1547 +    while (l1 !== null) {
  1.1548 +	for (var i = 0; i < nbApplyArgs; i++) {
  1.1549 +	    applyArgs[i] = arguments[i + 1].car;
  1.1550 +	    arguments[i + 1] = arguments[i + 1].cdr;
  1.1551 +	}
  1.1552 +	proc.apply(null, applyArgs);
  1.1553 +    }
  1.1554 +    // add return so FF does not complain.
  1.1555 +    return undefined;
  1.1556 +}
  1.1557 +
  1.1558 +/*** META ((export #t)) */
  1.1559 +function sc_filter(proc, l1) {
  1.1560 +    var dummy = { cdr : null };
  1.1561 +    var tail = dummy;
  1.1562 +    while (l1 !== null) {
  1.1563 +	if (proc(l1.car) !== false) {
  1.1564 +	    tail.cdr = sc_cons(l1.car, null);
  1.1565 +	    tail = tail.cdr;
  1.1566 +	}
  1.1567 +	l1 = l1.cdr;
  1.1568 +    }
  1.1569 +    return dummy.cdr;
  1.1570 +}
  1.1571 +
  1.1572 +/*** META ((export #t)) */
  1.1573 +function sc_filterBang(proc, l1) {
  1.1574 +    var head = sc_cons("dummy", l1);
  1.1575 +    var it = head;
  1.1576 +    var next = l1;
  1.1577 +    while (next !== null) {
  1.1578 +        if (proc(next.car) !== false) {
  1.1579 +	    it.cdr = next
  1.1580 +	    it = next;
  1.1581 +	}
  1.1582 +	next = next.cdr;
  1.1583 +    }
  1.1584 +    it.cdr = null;
  1.1585 +    return head.cdr;
  1.1586 +}
  1.1587 +
  1.1588 +function sc_filterMap1(proc, l1) {
  1.1589 +    var revres = null;
  1.1590 +    while (l1 !== null) {
  1.1591 +        var tmp = proc(l1.car)
  1.1592 +        if (tmp !== false) revres = sc_cons(tmp, revres);
  1.1593 +        l1 = l1.cdr;
  1.1594 +    }
  1.1595 +    return sc_reverseAppendBang(revres, null);
  1.1596 +}
  1.1597 +function sc_filterMap2(proc, l1, l2) {
  1.1598 +    var revres = null;
  1.1599 +    while (l1 !== null) {
  1.1600 +        var tmp = proc(l1.car, l2.car);
  1.1601 +        if(tmp !== false) revres = sc_cons(tmp, revres);
  1.1602 +	l1 = l1.cdr;
  1.1603 +	l2 = l2.cdr
  1.1604 +    }
  1.1605 +    return sc_reverseAppendBang(revres, null);
  1.1606 +}
  1.1607 +
  1.1608 +/*** META ((export #t)) */
  1.1609 +function sc_filterMap(proc, l1, l2, l3) {
  1.1610 +    if (l2 === undefined)
  1.1611 +	return sc_filterMap1(proc, l1);
  1.1612 +    else if (l3 === undefined)
  1.1613 +	return sc_filterMap2(proc, l1, l2);
  1.1614 +    // else
  1.1615 +    var nbApplyArgs = arguments.length - 1;
  1.1616 +    var applyArgs = new Array(nbApplyArgs);
  1.1617 +    var revres = null;
  1.1618 +    while (l1 !== null) {
  1.1619 +	for (var i = 0; i < nbApplyArgs; i++) {
  1.1620 +	    applyArgs[i] = arguments[i + 1].car;
  1.1621 +	    arguments[i + 1] = arguments[i + 1].cdr;
  1.1622 +	}
  1.1623 +	var tmp = proc.apply(null, applyArgs);
  1.1624 +	if(tmp !== false) revres = sc_cons(tmp, revres);
  1.1625 +    }
  1.1626 +    return sc_reverseAppendBang(revres, null);
  1.1627 +}
  1.1628 +
  1.1629 +/*** META ((export #t)) */
  1.1630 +function sc_any(proc, l) {
  1.1631 +    var revres = null;
  1.1632 +    while (l !== null) {
  1.1633 +        var tmp = proc(l.car);
  1.1634 +        if(tmp !== false) return tmp;
  1.1635 +	l = l.cdr;
  1.1636 +    }
  1.1637 +    return false;
  1.1638 +}
  1.1639 +
  1.1640 +/*** META ((export any?)
  1.1641 +           (peephole (hole 2 "sc_any(" proc "," l ") !== false")))
  1.1642 +*/
  1.1643 +function sc_anyPred(proc, l) {
  1.1644 +    return sc_any(proc, l)!== false;
  1.1645 +}
  1.1646 +
  1.1647 +/*** META ((export #t)) */
  1.1648 +function sc_every(proc, l) {
  1.1649 +    var revres = null;
  1.1650 +    var tmp = true;
  1.1651 +    while (l !== null) {
  1.1652 +        tmp = proc(l.car);
  1.1653 +        if (tmp === false) return false;
  1.1654 +	l = l.cdr;
  1.1655 +    }
  1.1656 +    return tmp;
  1.1657 +}
  1.1658 +
  1.1659 +/*** META ((export every?)
  1.1660 +           (peephole (hole 2 "sc_every(" proc "," l ") !== false")))
  1.1661 +*/
  1.1662 +function sc_everyPred(proc, l) {
  1.1663 +    var tmp = sc_every(proc, l);
  1.1664 +    if (tmp !== false) return true;
  1.1665 +    return false;
  1.1666 +}
  1.1667 +
  1.1668 +/*** META ((export #t)
  1.1669 +           (peephole (postfix "()")))
  1.1670 +*/
  1.1671 +function sc_force(o) {
  1.1672 +    return o();
  1.1673 +}
  1.1674 +
  1.1675 +/*** META ((export #t)) */
  1.1676 +function sc_makePromise(proc) {
  1.1677 +    var isResultReady = false;
  1.1678 +    var result = undefined;
  1.1679 +    return function() {
  1.1680 +	if (!isResultReady) {
  1.1681 +	    var tmp = proc();
  1.1682 +	    if (!isResultReady) {
  1.1683 +		isResultReady = true;
  1.1684 +		result = tmp;
  1.1685 +	    }
  1.1686 +	}
  1.1687 +	return result;
  1.1688 +    };
  1.1689 +}
  1.1690 +
  1.1691 +function sc_Values(values) {
  1.1692 +    this.values = values;
  1.1693 +}
  1.1694 +
  1.1695 +/*** META ((export #t)
  1.1696 +           (peephole (values)))
  1.1697 +*/
  1.1698 +function sc_values() {
  1.1699 +    if (arguments.length === 1)
  1.1700 +	return arguments[0];
  1.1701 +    else
  1.1702 +	return new sc_Values(arguments);
  1.1703 +}
  1.1704 +
  1.1705 +/*** META ((export #t)) */
  1.1706 +function sc_callWithValues(producer, consumer) {
  1.1707 +    var produced = producer();
  1.1708 +    if (produced instanceof sc_Values)
  1.1709 +	return consumer.apply(null, produced.values);
  1.1710 +    else
  1.1711 +	return consumer(produced);
  1.1712 +}
  1.1713 +
  1.1714 +/*** META ((export #t)) */
  1.1715 +function sc_dynamicWind(before, thunk, after) {
  1.1716 +    before();
  1.1717 +    try {
  1.1718 +	var res = thunk();
  1.1719 +	return res;
  1.1720 +    } finally {
  1.1721 +	after();
  1.1722 +    }
  1.1723 +}
  1.1724 +
  1.1725 +
  1.1726 +// TODO: eval/scheme-report-environment/null-environment/interaction-environment
  1.1727 +
  1.1728 +// LIMITATION: 'load' doesn't exist without files.
  1.1729 +// LIMITATION: transcript-on/transcript-off doesn't exist without files.
  1.1730 +
  1.1731 +
  1.1732 +function sc_Struct(name) {
  1.1733 +    this.name = name;
  1.1734 +}
  1.1735 +sc_Struct.prototype.sc_toDisplayString = function() {
  1.1736 +    return "#<struct" + sc_hash(this) + ">";
  1.1737 +};
  1.1738 +sc_Struct.prototype.sc_toWriteString = sc_Struct.prototype.sc_toDisplayString;
  1.1739 +
  1.1740 +/*** META ((export #t)
  1.1741 +           (peephole (hole 1 "new sc_Struct(" name ")")))
  1.1742 +*/
  1.1743 +function sc_makeStruct(name) {
  1.1744 +    return new sc_Struct(name);
  1.1745 +}
  1.1746 +
  1.1747 +/*** META ((export #t)
  1.1748 +           (type bool)
  1.1749 +           (peephole (postfix " instanceof sc_Struct")))
  1.1750 +*/
  1.1751 +function sc_isStruct(o) {
  1.1752 +    return (o instanceof sc_Struct);
  1.1753 +}
  1.1754 +
  1.1755 +/*** META ((export #t)
  1.1756 +           (type bool)
  1.1757 +           (peephole (hole 2 "(" 1 " instanceof sc_Struct) && ( " 1 ".name === " 0 ")")))
  1.1758 +*/
  1.1759 +function sc_isStructNamed(name, s) {
  1.1760 +    return ((s instanceof sc_Struct) && (s.name === name));
  1.1761 +}
  1.1762 +
  1.1763 +/*** META ((export struct-field)
  1.1764 +           (peephole (hole 3 0 "[" 2 "]")))
  1.1765 +*/
  1.1766 +function sc_getStructField(s, name, field) {
  1.1767 +    return s[field];
  1.1768 +}
  1.1769 +
  1.1770 +/*** META ((export struct-field-set!)
  1.1771 +           (peephole (hole 4 0 "[" 2 "] = " 3)))
  1.1772 +*/
  1.1773 +function sc_setStructFieldBang(s, name, field, val) {
  1.1774 +    s[field] = val;
  1.1775 +}
  1.1776 +
  1.1777 +/*** META ((export #t)
  1.1778 +           (peephole (prefix "~")))
  1.1779 +*/
  1.1780 +function sc_bitNot(x) {
  1.1781 +    return ~x;
  1.1782 +}
  1.1783 +
  1.1784 +/*** META ((export #t)
  1.1785 +           (peephole (infix 2 2 "&")))
  1.1786 +*/
  1.1787 +function sc_bitAnd(x, y) {
  1.1788 +    return x & y;
  1.1789 +}
  1.1790 +
  1.1791 +/*** META ((export #t)
  1.1792 +           (peephole (infix 2 2 "|")))
  1.1793 +*/
  1.1794 +function sc_bitOr(x, y) {
  1.1795 +    return x | y;
  1.1796 +}
  1.1797 +
  1.1798 +/*** META ((export #t)
  1.1799 +           (peephole (infix 2 2 "^")))
  1.1800 +*/
  1.1801 +function sc_bitXor(x, y) {
  1.1802 +    return x ^ y;
  1.1803 +}
  1.1804 +
  1.1805 +/*** META ((export #t)
  1.1806 +           (peephole (infix 2 2 "<<")))
  1.1807 +*/
  1.1808 +function sc_bitLsh(x, y) {
  1.1809 +    return x << y;
  1.1810 +}
  1.1811 +
  1.1812 +/*** META ((export #t)
  1.1813 +           (peephole (infix 2 2 ">>")))
  1.1814 +*/
  1.1815 +function sc_bitRsh(x, y) {
  1.1816 +    return x >> y;
  1.1817 +}
  1.1818 +
  1.1819 +/*** META ((export #t)
  1.1820 +           (peephole (infix 2 2 ">>>")))
  1.1821 +*/
  1.1822 +function sc_bitUrsh(x, y) {
  1.1823 +    return x >>> y;
  1.1824 +}
  1.1825 +
  1.1826 +/*** META ((export js-field js-property)
  1.1827 +           (peephole (hole 2 o "[" field "]")))
  1.1828 +*/
  1.1829 +function sc_jsField(o, field) {
  1.1830 +    return o[field];
  1.1831 +}
  1.1832 +
  1.1833 +/*** META ((export js-field-set! js-property-set!)
  1.1834 +           (peephole (hole 3 o "[" field "] = " val)))
  1.1835 +*/
  1.1836 +function sc_setJsFieldBang(o, field, val) {
  1.1837 +    return o[field] = val;
  1.1838 +}
  1.1839 +
  1.1840 +/*** META ((export js-field-delete! js-property-delete!)
  1.1841 +           (peephole (hole 2 "delete" o "[" field "]")))
  1.1842 +*/
  1.1843 +function sc_deleteJsFieldBang(o, field) {
  1.1844 +    delete o[field];
  1.1845 +}
  1.1846 +
  1.1847 +/*** META ((export #t)
  1.1848 +           (peephole (jsCall)))
  1.1849 +*/
  1.1850 +function sc_jsCall(o, fun) {
  1.1851 +    var args = new Array();
  1.1852 +    for (var i = 2; i < arguments.length; i++)
  1.1853 +	args[i-2] = arguments[i];
  1.1854 +    return fun.apply(o, args);
  1.1855 +}
  1.1856 +
  1.1857 +/*** META ((export #t)
  1.1858 +           (peephole (jsMethodCall)))
  1.1859 +*/
  1.1860 +function sc_jsMethodCall(o, field) {
  1.1861 +    var args = new Array();
  1.1862 +    for (var i = 2; i < arguments.length; i++)
  1.1863 +	args[i-2] = arguments[i];
  1.1864 +    return o[field].apply(o, args);
  1.1865 +}
  1.1866 +
  1.1867 +/*** META ((export new js-new)
  1.1868 +           (peephole (jsNew)))
  1.1869 +*/
  1.1870 +function sc_jsNew(c) {
  1.1871 +    var evalStr = "new c(";
  1.1872 +    evalStr +=arguments.length > 1? "arguments[1]": "";
  1.1873 +    for (var i = 2; i < arguments.length; i++)
  1.1874 +	evalStr += ", arguments[" + i + "]";
  1.1875 +    evalStr +=")";
  1.1876 +    return eval(evalStr);
  1.1877 +}
  1.1878 +
  1.1879 +// ======================== RegExp ====================
  1.1880 +/*** META ((export #t)) */
  1.1881 +function sc_pregexp(re) {
  1.1882 +    return new RegExp(sc_string2jsstring(re));
  1.1883 +}
  1.1884 +
  1.1885 +/*** META ((export #t)) */
  1.1886 +function sc_pregexpMatch(re, s) {
  1.1887 +    var reg = (re instanceof RegExp) ? re : sc_pregexp(re);
  1.1888 +    var tmp = reg.exec(sc_string2jsstring(s));
  1.1889 +
  1.1890 +    if (tmp == null) return false;
  1.1891 +
  1.1892 +    var res = null;
  1.1893 +    for (var i = tmp.length-1; i >= 0; i--) {
  1.1894 +	if (tmp[i] !== null) {
  1.1895 +	    res = sc_cons(sc_jsstring2string(tmp[i]), res);
  1.1896 +	} else {
  1.1897 +	    res = sc_cons(false, res);
  1.1898 +	}
  1.1899 +    }
  1.1900 +    return res;
  1.1901 +}
  1.1902 +
  1.1903 +/*** META ((export #t)) */
  1.1904 +function sc_pregexpReplace(re, s1, s2) {
  1.1905 +   var reg;
  1.1906 +   var jss1 = sc_string2jsstring(s1);
  1.1907 +   var jss2 = sc_string2jsstring(s2);
  1.1908 +
  1.1909 +   if (re instanceof RegExp) {
  1.1910 +       if (re.global)
  1.1911 +	   reg = re;
  1.1912 +       else
  1.1913 +	   reg = new RegExp(re.source);
  1.1914 +   } else {
  1.1915 +       reg = new RegExp(sc_string2jsstring(re));
  1.1916 +   }
  1.1917 +
  1.1918 +   return jss1.replace(reg, jss2);
  1.1919 +}
  1.1920 +
  1.1921 +/*** META ((export pregexp-replace*)) */
  1.1922 +function sc_pregexpReplaceAll(re, s1, s2) {
  1.1923 +   var reg;
  1.1924 +   var jss1 = sc_string2jsstring(s1);
  1.1925 +   var jss2 = sc_string2jsstring(s2);
  1.1926 +
  1.1927 +   if (re instanceof RegExp) {
  1.1928 +      if (re.global)
  1.1929 +	  reg = re;
  1.1930 +      else
  1.1931 +	  reg = new RegExp(re.source, "g");
  1.1932 +   } else {
  1.1933 +       reg = new RegExp(sc_string2jsstring(re), "g");
  1.1934 +   }
  1.1935 +
  1.1936 +   return jss1.replace(reg, jss2);
  1.1937 +}
  1.1938 +
  1.1939 +/*** META ((export #t)) */
  1.1940 +function sc_pregexpSplit(re, s) {
  1.1941 +   var reg = ((re instanceof RegExp) ?
  1.1942 +	      re :
  1.1943 +	      new RegExp(sc_string2jsstring(re)));
  1.1944 +   var jss = sc_string2jsstring(s);
  1.1945 +   var tmp = jss.split(reg);
  1.1946 +
  1.1947 +   if (tmp == null) return false;
  1.1948 +
  1.1949 +   return sc_vector2list(tmp);
  1.1950 +}
  1.1951 +
  1.1952 +
  1.1953 +/* =========================================================================== */
  1.1954 +/* Other library stuff */
  1.1955 +/* =========================================================================== */
  1.1956 +
  1.1957 +/*** META ((export #t)
  1.1958 +           (peephole (hole 1 "Math.floor(Math.random()*" 'n ")")))
  1.1959 +*/
  1.1960 +function sc_random(n) {
  1.1961 +    return Math.floor(Math.random()*n);
  1.1962 +}
  1.1963 +
  1.1964 +/*** META ((export current-date)
  1.1965 +           (peephole (hole 0 "new Date()")))
  1.1966 +*/
  1.1967 +function sc_currentDate() {
  1.1968 +   return new Date();
  1.1969 +}
  1.1970 +
  1.1971 +function sc_Hashtable() {
  1.1972 +}
  1.1973 +sc_Hashtable.prototype.toString = function() {
  1.1974 +    return "#{%hashtable}";
  1.1975 +};
  1.1976 +// sc_toWriteString == sc_toDisplayString == toString
  1.1977 +
  1.1978 +function sc_HashtableElement(key, val) {
  1.1979 +    this.key = key;
  1.1980 +    this.val = val;
  1.1981 +}
  1.1982 +
  1.1983 +/*** META ((export #t)
  1.1984 +           (peephole (hole 0 "new sc_Hashtable()")))
  1.1985 +*/
  1.1986 +function sc_makeHashtable() {
  1.1987 +    return new sc_Hashtable();
  1.1988 +}
  1.1989 +
  1.1990 +/*** META ((export #t)) */
  1.1991 +function sc_hashtablePutBang(ht, key, val) {
  1.1992 +    var hash = sc_hash(key);
  1.1993 +    ht[hash] = new sc_HashtableElement(key, val);
  1.1994 +}
  1.1995 +
  1.1996 +/*** META ((export #t)) */
  1.1997 +function sc_hashtableGet(ht, key) {
  1.1998 +    var hash = sc_hash(key);
  1.1999 +    if (hash in ht)
  1.2000 +	return ht[hash].val;
  1.2001 +    else
  1.2002 +	return false;
  1.2003 +}
  1.2004 +
  1.2005 +/*** META ((export #t)) */
  1.2006 +function sc_hashtableForEach(ht, f) {
  1.2007 +    for (var v in ht) {
  1.2008 +	if (ht[v] instanceof sc_HashtableElement)
  1.2009 +	    f(ht[v].key, ht[v].val);
  1.2010 +    }
  1.2011 +}
  1.2012 +
  1.2013 +/*** META ((export hashtable-contains?)
  1.2014 +           (peephole (hole 2 "sc_hash(" 1 ") in " 0)))
  1.2015 +*/
  1.2016 +function sc_hashtableContains(ht, key) {
  1.2017 +    var hash = sc_hash(key);
  1.2018 +    if (hash in ht)
  1.2019 +	return true;
  1.2020 +    else
  1.2021 +	return false;
  1.2022 +}
  1.2023 +
  1.2024 +var SC_HASH_COUNTER = 0;
  1.2025 +
  1.2026 +function sc_hash(o) {
  1.2027 +    if (o === null)
  1.2028 +	return "null";
  1.2029 +    else if (o === undefined)
  1.2030 +	return "undefined";
  1.2031 +    else if (o === true)
  1.2032 +	return "true";
  1.2033 +    else if (o === false)
  1.2034 +	return "false";
  1.2035 +    else if (typeof o === "number")
  1.2036 +	return "num-" + o;
  1.2037 +    else if (typeof o === "string")
  1.2038 +	return "jsstr-" + o;
  1.2039 +    else if (o.sc_getHash)
  1.2040 +	return o.sc_getHash();
  1.2041 +    else
  1.2042 +	return sc_counterHash.call(o);
  1.2043 +}
  1.2044 +function sc_counterHash() {
  1.2045 +    if (!this.sc_hash) {
  1.2046 +	this.sc_hash = "hash-" + SC_HASH_COUNTER;
  1.2047 +	SC_HASH_COUNTER++;
  1.2048 +    }
  1.2049 +    return this.sc_hash;
  1.2050 +}
  1.2051 +
  1.2052 +function sc_Trampoline(args, maxTailCalls) {
  1.2053 +    this['__trampoline return__'] = true;
  1.2054 +    this.args = args;
  1.2055 +    this.MAX_TAIL_CALLs = maxTailCalls;
  1.2056 +}
  1.2057 +// TODO: call/cc stuff
  1.2058 +sc_Trampoline.prototype.restart = function() {
  1.2059 +    var o = this;
  1.2060 +    while (true) {
  1.2061 +	// set both globals.
  1.2062 +	SC_TAIL_OBJECT.calls = o.MAX_TAIL_CALLs-1;
  1.2063 +	var fun = o.args.callee;
  1.2064 +	var res = fun.apply(SC_TAIL_OBJECT, o.args);
  1.2065 +	if (res instanceof sc_Trampoline)
  1.2066 +	    o = res;
  1.2067 +	else
  1.2068 +	    return res;
  1.2069 +    }
  1.2070 +}
  1.2071 +
  1.2072 +/*** META ((export bind-exit-lambda)) */
  1.2073 +function sc_bindExitLambda(proc) {
  1.2074 +    var escape_obj = new sc_BindExitException();
  1.2075 +    var escape = function(res) {
  1.2076 +	escape_obj.res = res;
  1.2077 +	throw escape_obj;
  1.2078 +    };
  1.2079 +    try {
  1.2080 +	return proc(escape);
  1.2081 +    } catch(e) {
  1.2082 +	if (e === escape_obj) {
  1.2083 +	    return e.res;
  1.2084 +	}
  1.2085 +	throw e;
  1.2086 +    }
  1.2087 +}
  1.2088 +function sc_BindExitException() {
  1.2089 +    this._internalException = true;
  1.2090 +}
  1.2091 +
  1.2092 +var SC_SCM2JS_GLOBALS = new Object();
  1.2093 +
  1.2094 +// default tail-call depth.
  1.2095 +// normally the program should set it again. but just in case...
  1.2096 +var SC_TAIL_OBJECT = new Object();
  1.2097 +SC_SCM2JS_GLOBALS.TAIL_OBJECT = SC_TAIL_OBJECT;
  1.2098 +// ======================== I/O =======================
  1.2099 +
  1.2100 +/*------------------------------------------------------------------*/
  1.2101 +
  1.2102 +function sc_EOF() {
  1.2103 +}
  1.2104 +var SC_EOF_OBJECT = new sc_EOF();
  1.2105 +
  1.2106 +function sc_Port() {
  1.2107 +}
  1.2108 +
  1.2109 +/* --------------- Input ports -------------------------------------*/
  1.2110 +
  1.2111 +function sc_InputPort() {
  1.2112 +}
  1.2113 +sc_InputPort.prototype = new sc_Port();
  1.2114 +
  1.2115 +sc_InputPort.prototype.peekChar = function() {
  1.2116 +    if (!("peeked" in this))
  1.2117 +	this.peeked = this.getNextChar();
  1.2118 +    return this.peeked;
  1.2119 +}
  1.2120 +sc_InputPort.prototype.readChar = function() {
  1.2121 +    var tmp = this.peekChar();
  1.2122 +    delete this.peeked;
  1.2123 +    return tmp;
  1.2124 +}
  1.2125 +sc_InputPort.prototype.isCharReady = function() {
  1.2126 +    return true;
  1.2127 +}
  1.2128 +sc_InputPort.prototype.close = function() {
  1.2129 +    // do nothing
  1.2130 +}
  1.2131 +
  1.2132 +/* .............. String port ..........................*/
  1.2133 +function sc_ErrorInputPort() {
  1.2134 +};
  1.2135 +sc_ErrorInputPort.prototype = new sc_InputPort();
  1.2136 +sc_ErrorInputPort.prototype.getNextChar = function() {
  1.2137 +    throw "can't read from error-port.";
  1.2138 +};
  1.2139 +sc_ErrorInputPort.prototype.isCharReady = function() {
  1.2140 +    return false;
  1.2141 +};
  1.2142 +
  1.2143 +
  1.2144 +/* .............. String port ..........................*/
  1.2145 +
  1.2146 +function sc_StringInputPort(jsStr) {
  1.2147 +    // we are going to do some charAts on the str.
  1.2148 +    // instead of recreating all the time a String-object, we
  1.2149 +    // create one in the beginning. (not sure, if this is really an optim)
  1.2150 +    this.str = new String(jsStr);
  1.2151 +    this.pos = 0;
  1.2152 +}
  1.2153 +sc_StringInputPort.prototype = new sc_InputPort();
  1.2154 +sc_StringInputPort.prototype.getNextChar = function() {
  1.2155 +    if (this.pos >= this.str.length)
  1.2156 +	return SC_EOF_OBJECT;
  1.2157 +    return this.str.charAt(this.pos++);
  1.2158 +};
  1.2159 +
  1.2160 +/* ------------- Read and other lib-funs  -------------------------------*/
  1.2161 +function sc_Token(type, val, pos) {
  1.2162 +    this.type = type;
  1.2163 +    this.val = val;
  1.2164 +    this.pos = pos;
  1.2165 +}
  1.2166 +sc_Token.EOF = 0/*EOF*/;
  1.2167 +sc_Token.OPEN_PAR = 1/*OPEN_PAR*/;
  1.2168 +sc_Token.CLOSE_PAR = 2/*CLOSE_PAR*/;
  1.2169 +sc_Token.OPEN_BRACE = 3/*OPEN_BRACE*/;
  1.2170 +sc_Token.CLOSE_BRACE = 4/*CLOSE_BRACE*/;
  1.2171 +sc_Token.OPEN_BRACKET = 5/*OPEN_BRACKET*/;
  1.2172 +sc_Token.CLOSE_BRACKET = 6/*CLOSE_BRACKET*/;
  1.2173 +sc_Token.WHITESPACE = 7/*WHITESPACE*/;
  1.2174 +sc_Token.QUOTE = 8/*QUOTE*/;
  1.2175 +sc_Token.ID = 9/*ID*/;
  1.2176 +sc_Token.DOT = 10/*DOT*/;
  1.2177 +sc_Token.STRING = 11/*STRING*/;
  1.2178 +sc_Token.NUMBER = 12/*NUMBER*/;
  1.2179 +sc_Token.ERROR = 13/*ERROR*/;
  1.2180 +sc_Token.VECTOR_BEGIN = 14/*VECTOR_BEGIN*/;
  1.2181 +sc_Token.TRUE = 15/*TRUE*/;
  1.2182 +sc_Token.FALSE = 16/*FALSE*/;
  1.2183 +sc_Token.UNSPECIFIED = 17/*UNSPECIFIED*/;
  1.2184 +sc_Token.REFERENCE = 18/*REFERENCE*/;
  1.2185 +sc_Token.STORE = 19/*STORE*/;
  1.2186 +sc_Token.CHAR = 20/*CHAR*/;
  1.2187 +
  1.2188 +var SC_ID_CLASS = SC_LOWER_CLASS + SC_UPPER_CLASS + "!$%*+-./:<=>?@^_~";
  1.2189 +function sc_Tokenizer(port) {
  1.2190 +    this.port = port;
  1.2191 +}
  1.2192 +sc_Tokenizer.prototype.peekToken = function() {
  1.2193 +    if (this.peeked)
  1.2194 +	return this.peeked;
  1.2195 +    var newToken = this.nextToken();
  1.2196 +    this.peeked = newToken;
  1.2197 +    return newToken;
  1.2198 +};
  1.2199 +sc_Tokenizer.prototype.readToken = function() {
  1.2200 +    var tmp = this.peekToken();
  1.2201 +    delete this.peeked;
  1.2202 +    return tmp;
  1.2203 +};
  1.2204 +sc_Tokenizer.prototype.nextToken = function() {
  1.2205 +    var port = this.port;
  1.2206 +
  1.2207 +    function isNumberChar(c) {
  1.2208 +	return (c >= "0" && c <= "9");
  1.2209 +    };
  1.2210 +    function isIdOrNumberChar(c) {
  1.2211 +	return SC_ID_CLASS.indexOf(c) != -1 || // ID-char
  1.2212 +	    (c >= "0" && c <= "9");
  1.2213 +    }
  1.2214 +    function isWhitespace(c) {
  1.2215 +	return c === " " || c === "\r" || c === "\n" || c === "\t" || c === "\f";
  1.2216 +    };
  1.2217 +    function isWhitespaceOrEOF(c) {
  1.2218 +	return isWhitespace(c) || c === SC_EOF_OBJECT;
  1.2219 +    };
  1.2220 +
  1.2221 +    function readString() {
  1.2222 +	res = "";
  1.2223 +	while (true) {
  1.2224 +	    var c = port.readChar();
  1.2225 +	    switch (c) {
  1.2226 +	    case '"':
  1.2227 +		return new sc_Token(11/*STRING*/, res);
  1.2228 +	    case "\\":
  1.2229 +		var tmp = port.readChar();
  1.2230 +		switch (tmp) {
  1.2231 +		case '0': res += "\0"; break;
  1.2232 +		case 'a': res += "\a"; break;
  1.2233 +		case 'b': res += "\b"; break;
  1.2234 +		case 'f': res += "\f"; break;
  1.2235 +		case 'n': res += "\n"; break;
  1.2236 +		case 'r': res += "\r"; break;
  1.2237 +		case 't': res += "\t"; break;
  1.2238 +		case 'v': res += "\v"; break;
  1.2239 +		case '"': res += '"'; break;
  1.2240 +		case '\\': res += '\\'; break;
  1.2241 +		case 'x':
  1.2242 +		    /* hexa-number */
  1.2243 +		    var nb = 0;
  1.2244 +		    while (true) {
  1.2245 +			var hexC = port.peekChar();
  1.2246 +			if (hexC >= '0' && hexC <= '9') {
  1.2247 +			    port.readChar();
  1.2248 +			    nb = nb * 16 + hexC.charCodeAt(0) - '0'.charCodeAt(0);
  1.2249 +			} else if (hexC >= 'a' && hexC <= 'f') {
  1.2250 +			    port.readChar();
  1.2251 +			    nb = nb * 16 + hexC.charCodeAt(0) - 'a'.charCodeAt(0);
  1.2252 +			} else if (hexC >= 'A' && hexC <= 'F') {
  1.2253 +			    port.readChar();
  1.2254 +			    nb = nb * 16 + hexC.charCodeAt(0) - 'A'.charCodeAt(0);
  1.2255 +			} else {
  1.2256 +			    // next char isn't part of hex.
  1.2257 +			    res += String.fromCharCode(nb);
  1.2258 +			    break;
  1.2259 +			}
  1.2260 +		    }
  1.2261 +		    break;
  1.2262 +		default:
  1.2263 +		    if (tmp === SC_EOF_OBJECT) {
  1.2264 +			return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);
  1.2265 +		    }
  1.2266 +		    res += tmp;
  1.2267 +		}
  1.2268 +		break;
  1.2269 +	    default:
  1.2270 +		if (c === SC_EOF_OBJECT) {
  1.2271 +		    return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res);
  1.2272 +		}
  1.2273 +		res += c;
  1.2274 +	    }
  1.2275 +	}
  1.2276 +    };
  1.2277 +    function readIdOrNumber(firstChar) {
  1.2278 +	var res = firstChar;
  1.2279 +	while (isIdOrNumberChar(port.peekChar()))
  1.2280 +	    res += port.readChar();
  1.2281 +	if (isNaN(res))
  1.2282 +	    return new sc_Token(9/*ID*/, res);
  1.2283 +	else
  1.2284 +	    return new sc_Token(12/*NUMBER*/, res - 0);
  1.2285 +    };
  1.2286 +
  1.2287 +    function skipWhitespaceAndComments() {
  1.2288 +	var done = false;
  1.2289 +	while (!done) {
  1.2290 +	    done = true;
  1.2291 +	    while (isWhitespace(port.peekChar()))
  1.2292 +		port.readChar();
  1.2293 +	    if (port.peekChar() === ';') {
  1.2294 +		port.readChar();
  1.2295 +		done = false;
  1.2296 +		while (true) {
  1.2297 +		    curChar = port.readChar();
  1.2298 +		    if (curChar === SC_EOF_OBJECT ||
  1.2299 +			curChar === '\n')
  1.2300 +			break;
  1.2301 +		}
  1.2302 +	    }
  1.2303 +	}
  1.2304 +    };
  1.2305 +
  1.2306 +    function readDot() {
  1.2307 +	if (isWhitespace(port.peekChar()))
  1.2308 +	    return new sc_Token(10/*DOT*/);
  1.2309 +	else
  1.2310 +	    return readIdOrNumber(".");
  1.2311 +    };
  1.2312 +
  1.2313 +    function readSharp() {
  1.2314 +	var c = port.readChar();
  1.2315 +	if (isWhitespace(c))
  1.2316 +	    return new sc_Token(13/*ERROR*/, "bad #-pattern0.");
  1.2317 +
  1.2318 +	// reference
  1.2319 +	if (isNumberChar(c)) {
  1.2320 +	    var nb = c - 0;
  1.2321 +	    while (isNumberChar(port.peekChar()))
  1.2322 +		nb = nb*10 + (port.readChar() - 0);
  1.2323 +	    switch (port.readChar()) {
  1.2324 +	    case '#':
  1.2325 +		return new sc_Token(18/*REFERENCE*/, nb);
  1.2326 +	    case '=':
  1.2327 +		return new sc_Token(19/*STORE*/, nb);
  1.2328 +	    default:
  1.2329 +		return new sc_Token(13/*ERROR*/, "bad #-pattern1." + nb);
  1.2330 +	    }
  1.2331 +	}
  1.2332 +
  1.2333 +	if (c === "(")
  1.2334 +	    return new sc_Token(14/*VECTOR_BEGIN*/);
  1.2335 +	
  1.2336 +	if (c === "\\") { // character
  1.2337 +	    var tmp = ""
  1.2338 +	    while (!isWhitespaceOrEOF(port.peekChar()))
  1.2339 +		tmp += port.readChar();
  1.2340 +	    switch (tmp.length) {
  1.2341 +	    case 0: // it's escaping a whitespace char:
  1.2342 +		if (sc_isEOFObject(port.peekChar))
  1.2343 +		    return new sc_Token(13/*ERROR*/, "bad #-pattern2.");
  1.2344 +		else
  1.2345 +		    return new sc_Token(20/*CHAR*/, port.readChar());
  1.2346 +	    case 1:
  1.2347 +		return new sc_Token(20/*CHAR*/, tmp);
  1.2348 +	    default:
  1.2349 +		var entry = sc_Char.readable2char[tmp.toLowerCase()];
  1.2350 +		if (entry)
  1.2351 +		    return new sc_Token(20/*CHAR*/, entry);
  1.2352 +		else
  1.2353 +		    return new sc_Token(13/*ERROR*/, "unknown character description: #\\" + tmp);
  1.2354 +	    }
  1.2355 +	}
  1.2356 +
  1.2357 +	// some constants (#t, #f, #unspecified)
  1.2358 +	var res;
  1.2359 +	var needing;
  1.2360 +	switch (c) {
  1.2361 +	case 't': res = new sc_Token(15/*TRUE*/, true); needing = ""; break;
  1.2362 +	case 'f': res = new sc_Token(16/*FALSE*/, false); needing = ""; break;
  1.2363 +	case 'u': res = new sc_Token(17/*UNSPECIFIED*/, undefined); needing = "nspecified"; break;
  1.2364 +	default:
  1.2365 +	    return new sc_Token(13/*ERROR*/, "bad #-pattern3: " + c);
  1.2366 +	}
  1.2367 +	while(true) {
  1.2368 +	    c = port.peekChar();
  1.2369 +	    if ((isWhitespaceOrEOF(c) || c === ')') &&
  1.2370 +		needing == "")
  1.2371 +		return res;
  1.2372 +	    else if (isWhitespace(c) || needing == "")
  1.2373 +		return new sc_Token(13/*ERROR*/, "bad #-pattern4 " + c + " " + needing);
  1.2374 +	    else if (needing.charAt(0) == c) {
  1.2375 +		port.readChar(); // consume
  1.2376 +		needing = needing.slice(1);
  1.2377 +	    } else
  1.2378 +		return new sc_Token(13/*ERROR*/, "bad #-pattern5");
  1.2379 +	}
  1.2380 +	
  1.2381 +    };
  1.2382 +
  1.2383 +    skipWhitespaceAndComments();
  1.2384 +    var curChar = port.readChar();
  1.2385 +    if (curChar === SC_EOF_OBJECT)
  1.2386 +	return new sc_Token(0/*EOF*/, curChar);
  1.2387 +    switch (curChar)
  1.2388 +    {
  1.2389 +    case " ":
  1.2390 +    case "\n":
  1.2391 +    case "\t":
  1.2392 +	return readWhitespace();
  1.2393 +    case "(":
  1.2394 +	return new sc_Token(1/*OPEN_PAR*/);
  1.2395 +    case ")":
  1.2396 +	return new sc_Token(2/*CLOSE_PAR*/);
  1.2397 +    case "{":
  1.2398 +	return new sc_Token(3/*OPEN_BRACE*/);
  1.2399 +    case "}":
  1.2400 +	return new sc_Token(4/*CLOSE_BRACE*/);
  1.2401 +    case "[":
  1.2402 +	return new sc_Token(5/*OPEN_BRACKET*/);
  1.2403 +    case "]":
  1.2404 +	return new sc_Token(6/*CLOSE_BRACKET*/);
  1.2405 +    case "'":
  1.2406 +	return new sc_Token(8/*QUOTE*/);
  1.2407 +    case "#":
  1.2408 +	return readSharp();
  1.2409 +    case ".":
  1.2410 +	return readDot();
  1.2411 +    case '"':
  1.2412 +	return readString();
  1.2413 +    default:
  1.2414 +	if (isIdOrNumberChar(curChar))
  1.2415 +	    return readIdOrNumber(curChar);
  1.2416 +	throw "unexpected character: " + curChar;
  1.2417 +    }
  1.2418 +};
  1.2419 +
  1.2420 +function sc_Reader(tokenizer) {
  1.2421 +    this.tokenizer = tokenizer;
  1.2422 +    this.backref = new Array();
  1.2423 +}
  1.2424 +sc_Reader.prototype.read = function() {
  1.2425 +    function readList(listBeginType) {
  1.2426 +	function matchesPeer(open, close) {
  1.2427 +	    return open === 1/*OPEN_PAR*/ && close === 2/*CLOSE_PAR*/
  1.2428 +	    	|| open === 3/*OPEN_BRACE*/ && close === 4/*CLOSE_BRACE*/
  1.2429 +		|| open === 5/*OPEN_BRACKET*/ && close === 6/*CLOSE_BRACKET*/;
  1.2430 +	};
  1.2431 +	var res = null;
  1.2432 +
  1.2433 +	while (true) {
  1.2434 +	    var token = tokenizer.peekToken();
  1.2435 +
  1.2436 +	    switch (token.type) {
  1.2437 +	    case 2/*CLOSE_PAR*/:
  1.2438 +	    case 4/*CLOSE_BRACE*/:
  1.2439 +	    case 6/*CLOSE_BRACKET*/:
  1.2440 +		if (matchesPeer(listBeginType, token.type)) {
  1.2441 +		    tokenizer.readToken(); // consume token
  1.2442 +		    return sc_reverseBang(res);
  1.2443 +		} else
  1.2444 +		    throw "closing par doesn't match: " + listBeginType
  1.2445 +			+ " " + listEndType;
  1.2446 +
  1.2447 +	    case 0/*EOF*/:
  1.2448 +		throw "unexpected end of file";
  1.2449 +
  1.2450 +	    case 10/*DOT*/:
  1.2451 +		tokenizer.readToken(); // consume token
  1.2452 +		var cdr = this.read();
  1.2453 +		var par = tokenizer.readToken();
  1.2454 +		if (!matchesPeer(listBeginType, par.type))
  1.2455 +		    throw "closing par doesn't match: " + listBeginType
  1.2456 +			+ " " + par.type;
  1.2457 +		else
  1.2458 +		    return sc_reverseAppendBang(res, cdr);
  1.2459 +		
  1.2460 +
  1.2461 +	    default:
  1.2462 +		res = sc_cons(this.read(), res);
  1.2463 +	    }
  1.2464 +	}
  1.2465 +    };
  1.2466 +    function readQuote() {
  1.2467 +	return sc_cons("quote", sc_cons(this.read(), null));
  1.2468 +    };
  1.2469 +    function readVector() {
  1.2470 +	// opening-parenthesis is already consumed
  1.2471 +	var a = new Array();
  1.2472 +	while (true) {
  1.2473 +	    var token = tokenizer.peekToken();
  1.2474 +	    switch (token.type) {
  1.2475 +	    case 2/*CLOSE_PAR*/:
  1.2476 +		tokenizer.readToken();
  1.2477 +		return a;
  1.2478 +		
  1.2479 +	    default:
  1.2480 +		a.push(this.read());
  1.2481 +	    }
  1.2482 +	}
  1.2483 +    };
  1.2484 +
  1.2485 +    function storeRefence(nb) {
  1.2486 +	var tmp = this.read();
  1.2487 +	this.backref[nb] = tmp;
  1.2488 +	return tmp;
  1.2489 +    };
  1.2490 +	
  1.2491 +    function readReference(nb) {
  1.2492 +	if (nb in this.backref)
  1.2493 +	    return this.backref[nb];
  1.2494 +	else
  1.2495 +	    throw "bad reference: " + nb;
  1.2496 +    };
  1.2497 +
  1.2498 +    var tokenizer = this.tokenizer;
  1.2499 +
  1.2500 +    var token = tokenizer.readToken();
  1.2501 +
  1.2502 +    // handle error
  1.2503 +    if (token.type === 13/*ERROR*/)
  1.2504 +	throw token.val;
  1.2505 +
  1.2506 +    switch (token.type) {
  1.2507 +    case 1/*OPEN_PAR*/:
  1.2508 +    case 3/*OPEN_BRACE*/:
  1.2509 +    case 5/*OPEN_BRACKET*/:
  1.2510 +	return readList.call(this, token.type);
  1.2511 +    case 8/*QUOTE*/:
  1.2512 +	return readQuote.call(this);
  1.2513 +    case 11/*STRING*/:
  1.2514 +	return sc_jsstring2string(token.val);
  1.2515 +    case 20/*CHAR*/:
  1.2516 +	return new sc_Char(token.val);
  1.2517 +    case 14/*VECTOR_BEGIN*/:
  1.2518 +	return readVector.call(this);
  1.2519 +    case 18/*REFERENCE*/:
  1.2520 +	return readReference.call(this, token.val);
  1.2521 +    case 19/*STORE*/:
  1.2522 +	return storeRefence.call(this, token.val);
  1.2523 +    case 9/*ID*/:
  1.2524 +	return sc_jsstring2symbol(token.val);
  1.2525 +    case 0/*EOF*/:
  1.2526 +    case 12/*NUMBER*/:
  1.2527 +    case 15/*TRUE*/:
  1.2528 +    case 16/*FALSE*/:
  1.2529 +    case 17/*UNSPECIFIED*/:
  1.2530 +	return token.val;
  1.2531 +    default:
  1.2532 +	throw "unexpected token " + token.type + " " + token.val;
  1.2533 +    }
  1.2534 +};
  1.2535 +
  1.2536 +/*** META ((export #t)) */
  1.2537 +function sc_read(port) {
  1.2538 +    if (port === undefined) // we assume the port hasn't been given.
  1.2539 +	port = SC_DEFAULT_IN; // THREAD: shared var...
  1.2540 +    var reader = new sc_Reader(new sc_Tokenizer(port));
  1.2541 +    return reader.read();
  1.2542 +}
  1.2543 +/*** META ((export #t)) */
  1.2544 +function sc_readChar(port) {
  1.2545 +    if (port === undefined) // we assume the port hasn't been given.
  1.2546 +	port = SC_DEFAULT_IN; // THREAD: shared var...
  1.2547 +    var t = port.readChar();
  1.2548 +    return t === SC_EOF_OBJECT? t: new sc_Char(t);
  1.2549 +}
  1.2550 +/*** META ((export #t)) */
  1.2551 +function sc_peekChar(port) {
  1.2552 +    if (port === undefined) // we assume the port hasn't been given.
  1.2553 +	port = SC_DEFAULT_IN; // THREAD: shared var...
  1.2554 +    var t = port.peekChar();
  1.2555 +    return t === SC_EOF_OBJECT? t: new sc_Char(t);
  1.2556 +}
  1.2557 +/*** META ((export #t)
  1.2558 +           (type bool))
  1.2559 +*/
  1.2560 +function sc_isCharReady(port) {
  1.2561 +    if (port === undefined) // we assume the port hasn't been given.
  1.2562 +	port = SC_DEFAULT_IN; // THREAD: shared var...
  1.2563 +    return port.isCharReady();
  1.2564 +}
  1.2565 +/*** META ((export #t)
  1.2566 +           (peephole (postfix ".close()")))
  1.2567 +*/
  1.2568 +function sc_closeInputPort(p) {
  1.2569 +    return p.close();
  1.2570 +}
  1.2571 +
  1.2572 +/*** META ((export #t)
  1.2573 +           (type bool)
  1.2574 +           (peephole (postfix " instanceof sc_InputPort")))
  1.2575 +*/
  1.2576 +function sc_isInputPort(o) {
  1.2577 +    return (o instanceof sc_InputPort);
  1.2578 +}
  1.2579 +
  1.2580 +/*** META ((export eof-object?)
  1.2581 +           (type bool)
  1.2582 +           (peephole (postfix " === SC_EOF_OBJECT")))
  1.2583 +*/
  1.2584 +function sc_isEOFObject(o) {
  1.2585 +    return o === SC_EOF_OBJECT;
  1.2586 +}
  1.2587 +
  1.2588 +/*** META ((export #t)
  1.2589 +           (peephole (hole 0 "SC_DEFAULT_IN")))
  1.2590 +*/
  1.2591 +function sc_currentInputPort() {
  1.2592 +    return SC_DEFAULT_IN;
  1.2593 +}
  1.2594 +
  1.2595 +/* ------------ file operations are not supported -----------*/
  1.2596 +/*** META ((export #t)) */
  1.2597 +function sc_callWithInputFile(s, proc) {
  1.2598 +    throw "can't open " + s;
  1.2599 +}
  1.2600 +
  1.2601 +/*** META ((export #t)) */
  1.2602 +function sc_callWithOutputFile(s, proc) {
  1.2603 +    throw "can't open " + s;
  1.2604 +}
  1.2605 +
  1.2606 +/*** META ((export #t)) */
  1.2607 +function sc_withInputFromFile(s, thunk) {
  1.2608 +    throw "can't open " + s;
  1.2609 +}
  1.2610 +
  1.2611 +/*** META ((export #t)) */
  1.2612 +function sc_withOutputToFile(s, thunk) {
  1.2613 +    throw "can't open " + s;
  1.2614 +}
  1.2615 +
  1.2616 +/*** META ((export #t)) */
  1.2617 +function sc_openInputFile(s) {
  1.2618 +    throw "can't open " + s;
  1.2619 +}
  1.2620 +
  1.2621 +/*** META ((export #t)) */
  1.2622 +function sc_openOutputFile(s) {
  1.2623 +    throw "can't open " + s;
  1.2624 +}
  1.2625 +
  1.2626 +/* ----------------------------------------------------------------------------*/
  1.2627 +/*** META ((export #t)) */
  1.2628 +function sc_basename(p) {
  1.2629 +   var i = p.lastIndexOf('/');
  1.2630 +
  1.2631 +   if(i >= 0)
  1.2632 +      return p.substring(i + 1, p.length);
  1.2633 +   else
  1.2634 +      return '';
  1.2635 +}
  1.2636 +
  1.2637 +/*** META ((export #t)) */
  1.2638 +function sc_dirname(p) {
  1.2639 +   var i = p.lastIndexOf('/');
  1.2640 +
  1.2641 +   if(i >= 0)
  1.2642 +      return p.substring(0, i);
  1.2643 +   else
  1.2644 +      return '';
  1.2645 +}
  1.2646 +
  1.2647 +/* ----------------------------------------------------------------------------*/
  1.2648 +
  1.2649 +/*** META ((export #t)) */
  1.2650 +function sc_withInputFromPort(p, thunk) {
  1.2651 +    try {
  1.2652 +	var tmp = SC_DEFAULT_IN; // THREAD: shared var.
  1.2653 +	SC_DEFAULT_IN = p;
  1.2654 +	return thunk();
  1.2655 +    } finally {
  1.2656 +	SC_DEFAULT_IN = tmp;
  1.2657 +    }
  1.2658 +}
  1.2659 +
  1.2660 +/*** META ((export #t)) */
  1.2661 +function sc_withInputFromString(s, thunk) {
  1.2662 +    return sc_withInputFromPort(new sc_StringInputPort(sc_string2jsstring(s)), thunk);
  1.2663 +}
  1.2664 +
  1.2665 +/*** META ((export #t)) */
  1.2666 +function sc_withOutputToPort(p, thunk) {
  1.2667 +    try {
  1.2668 +	var tmp = SC_DEFAULT_OUT; // THREAD: shared var.
  1.2669 +	SC_DEFAULT_OUT = p;
  1.2670 +	return thunk();
  1.2671 +    } finally {
  1.2672 +	SC_DEFAULT_OUT = tmp;
  1.2673 +    }
  1.2674 +}
  1.2675 +
  1.2676 +/*** META ((export #t)) */
  1.2677 +function sc_withOutputToString(thunk) {
  1.2678 +    var p = new sc_StringOutputPort();
  1.2679 +    sc_withOutputToPort(p, thunk);
  1.2680 +    return p.close();
  1.2681 +}
  1.2682 +
  1.2683 +/*** META ((export #t)) */
  1.2684 +function sc_withOutputToProcedure(proc, thunk) {
  1.2685 +    var t = function(s) { proc(sc_jsstring2string(s)); };
  1.2686 +    return sc_withOutputToPort(new sc_GenericOutputPort(t), thunk);
  1.2687 +}
  1.2688 +
  1.2689 +/*** META ((export #t)
  1.2690 +           (peephole (hole 0 "new sc_StringOutputPort()")))
  1.2691 +*/
  1.2692 +function sc_openOutputString() {
  1.2693 +    return new sc_StringOutputPort();
  1.2694 +}
  1.2695 +
  1.2696 +/*** META ((export #t)) */
  1.2697 +function sc_openInputString(str) {
  1.2698 +    return new sc_StringInputPort(sc_string2jsstring(str));
  1.2699 +}
  1.2700 +
  1.2701 +/* ----------------------------------------------------------------------------*/
  1.2702 +
  1.2703 +function sc_OutputPort() {
  1.2704 +}
  1.2705 +sc_OutputPort.prototype = new sc_Port();
  1.2706 +sc_OutputPort.prototype.appendJSString = function(obj) {
  1.2707 +    /* do nothing */
  1.2708 +}
  1.2709 +sc_OutputPort.prototype.close = function() {
  1.2710 +    /* do nothing */
  1.2711 +}
  1.2712 +
  1.2713 +function sc_StringOutputPort() {
  1.2714 +    this.res = "";
  1.2715 +}
  1.2716 +sc_StringOutputPort.prototype = new sc_OutputPort();
  1.2717 +sc_StringOutputPort.prototype.appendJSString = function(s) {
  1.2718 +    this.res += s;
  1.2719 +}
  1.2720 +sc_StringOutputPort.prototype.close = function() {
  1.2721 +    return sc_jsstring2string(this.res);
  1.2722 +}
  1.2723 +
  1.2724 +/*** META ((export #t)) */
  1.2725 +function sc_getOutputString(sp) {
  1.2726 +    return sc_jsstring2string(sp.res);
  1.2727 +}
  1.2728 +
  1.2729 +
  1.2730 +function sc_ErrorOutputPort() {
  1.2731 +}
  1.2732 +sc_ErrorOutputPort.prototype = new sc_OutputPort();
  1.2733 +sc_ErrorOutputPort.prototype.appendJSString = function(s) {
  1.2734 +    throw "don't write on ErrorPort!";
  1.2735 +}
  1.2736 +sc_ErrorOutputPort.prototype.close = function() {
  1.2737 +    /* do nothing */
  1.2738 +}
  1.2739 +
  1.2740 +function sc_GenericOutputPort(appendJSString, close) {
  1.2741 +    this.appendJSString = appendJSString;
  1.2742 +    if (close)
  1.2743 +	this.close = close;
  1.2744 +}
  1.2745 +sc_GenericOutputPort.prototype = new sc_OutputPort();
  1.2746 +
  1.2747 +/*** META ((export #t)
  1.2748 +           (type bool)
  1.2749 +           (peephole (postfix " instanceof sc_OutputPort")))
  1.2750 +*/
  1.2751 +function sc_isOutputPort(o) {
  1.2752 +    return (o instanceof sc_OutputPort);
  1.2753 +}
  1.2754 +
  1.2755 +/*** META ((export #t)
  1.2756 +           (peephole (postfix ".close()")))
  1.2757 +*/
  1.2758 +function sc_closeOutputPort(p) {
  1.2759 +    return p.close();
  1.2760 +}
  1.2761 +
  1.2762 +/* ------------------ write ---------------------------------------------------*/
  1.2763 +
  1.2764 +/*** META ((export #t)) */
  1.2765 +function sc_write(o, p) {
  1.2766 +    if (p === undefined) // we assume not given
  1.2767 +	p = SC_DEFAULT_OUT;
  1.2768 +    p.appendJSString(sc_toWriteString(o));
  1.2769 +}
  1.2770 +
  1.2771 +function sc_toWriteString(o) {
  1.2772 +    if (o === null)
  1.2773 +	return "()";
  1.2774 +    else if (o === true)
  1.2775 +	return "#t";
  1.2776 +    else if (o === false)
  1.2777 +	return "#f";
  1.2778 +    else if (o === undefined)
  1.2779 +	return "#unspecified";
  1.2780 +    else if (typeof o === 'function')
  1.2781 +	return "#<procedure " + sc_hash(o) + ">";
  1.2782 +    else if (o.sc_toWriteString)
  1.2783 +	return o.sc_toWriteString();
  1.2784 +    else
  1.2785 +	return o.toString();
  1.2786 +}
  1.2787 +
  1.2788 +function sc_escapeWriteString(s) {
  1.2789 +    var res = "";
  1.2790 +    var j = 0;
  1.2791 +    for (i = 0; i < s.length; i++) {
  1.2792 +	switch (s.charAt(i)) {
  1.2793 +	case "\0": res += s.substring(j, i) + "\\0"; j = i + 1; break;
  1.2794 +	case "\b": res += s.substring(j, i) + "\\b"; j = i + 1; break;
  1.2795 +	case "\f": res += s.substring(j, i) + "\\f"; j = i + 1; break;
  1.2796 +	case "\n": res += s.substring(j, i) + "\\n"; j = i + 1; break;
  1.2797 +	case "\r": res += s.substring(j, i) + "\\r"; j = i + 1; break;
  1.2798 +	case "\t": res += s.substring(j, i) + "\\t"; j = i + 1; break;
  1.2799 +	case "\v": res += s.substring(j, i) + "\\v"; j = i + 1; break;
  1.2800 +	case '"': res += s.substring(j, i) + '\\"'; j = i + 1; break;
  1.2801 +	case "\\": res += s.substring(j, i) + "\\\\"; j = i + 1; break;
  1.2802 +	default:
  1.2803 +	    var c = s.charAt(i);
  1.2804 +	    if ("\a" !== "a" && c == "\a") {
  1.2805 +		res += s.substring(j, i) + "\\a"; j = i + 1; continue;
  1.2806 +	    }
  1.2807 +	    if ("\v" !== "v" && c == "\v") {
  1.2808 +		res += s.substring(j, i) + "\\v"; j = i + 1; continue;
  1.2809 +	    }
  1.2810 +	    //if (s.charAt(i) < ' ' || s.charCodeAt(i) > 127) {
  1.2811 +	    // CARE: Manuel is this OK with HOP?
  1.2812 +	    if (s.charAt(i) < ' ') {
  1.2813 +		/* non printable character and special chars */
  1.2814 +		res += s.substring(j, i) + "\\x" + s.charCodeAt(i).toString(16);
  1.2815 +		j = i + 1;
  1.2816 +	    }
  1.2817 +	    // else just let i increase...
  1.2818 +	}
  1.2819 +    }
  1.2820 +    res += s.substring(j, i);
  1.2821 +    return res;
  1.2822 +}
  1.2823 +
  1.2824 +/* ------------------ display ---------------------------------------------------*/
  1.2825 +
  1.2826 +/*** META ((export #t)) */
  1.2827 +function sc_display(o, p) {
  1.2828 +    if (p === undefined) // we assume not given
  1.2829 +	p = SC_DEFAULT_OUT;
  1.2830 +    p.appendJSString(sc_toDisplayString(o));
  1.2831 +}
  1.2832 +
  1.2833 +function sc_toDisplayString(o) {
  1.2834 +    if (o === null)
  1.2835 +	return "()";
  1.2836 +    else if (o === true)
  1.2837 +	return "#t";
  1.2838 +    else if (o === false)
  1.2839 +	return "#f";
  1.2840 +    else if (o === undefined)
  1.2841 +	return "#unspecified";
  1.2842 +    else if (typeof o === 'function')
  1.2843 +	return "#<procedure " + sc_hash(o) + ">";
  1.2844 +    else if (o.sc_toDisplayString)
  1.2845 +	return o.sc_toDisplayString();
  1.2846 +    else
  1.2847 +	return o.toString();
  1.2848 +}
  1.2849 +
  1.2850 +/* ------------------ newline ---------------------------------------------------*/
  1.2851 +
  1.2852 +/*** META ((export #t)) */
  1.2853 +function sc_newline(p) {
  1.2854 +    if (p === undefined) // we assume not given
  1.2855 +	p = SC_DEFAULT_OUT;
  1.2856 +    p.appendJSString("\n");
  1.2857 +}
  1.2858 +
  1.2859 +/* ------------------ write-char ---------------------------------------------------*/
  1.2860 +
  1.2861 +/*** META ((export #t)) */
  1.2862 +function sc_writeChar(c, p) {
  1.2863 +    if (p === undefined) // we assume not given
  1.2864 +	p = SC_DEFAULT_OUT;
  1.2865 +    p.appendJSString(c.val);
  1.2866 +}
  1.2867 +
  1.2868 +/* ------------------ write-circle ---------------------------------------------------*/
  1.2869 +
  1.2870 +/*** META ((export #t)) */
  1.2871 +function sc_writeCircle(o, p) {
  1.2872 +    if (p === undefined) // we assume not given
  1.2873 +	p = SC_DEFAULT_OUT;
  1.2874 +    p.appendJSString(sc_toWriteCircleString(o));
  1.2875 +}
  1.2876 +
  1.2877 +function sc_toWriteCircleString(o) {
  1.2878 +    var symb = sc_gensym("writeCircle");
  1.2879 +    var nbPointer = new Object();
  1.2880 +    nbPointer.nb = 0;
  1.2881 +    sc_prepWriteCircle(o, symb, nbPointer);
  1.2882 +    return sc_genToWriteCircleString(o, symb);
  1.2883 +}
  1.2884 +
  1.2885 +function sc_prepWriteCircle(o, symb, nbPointer) {
  1.2886 +    // TODO sc_Struct
  1.2887 +    if (o instanceof sc_Pair ||
  1.2888 +	o instanceof sc_Vector) {
  1.2889 +	if (o[symb] !== undefined) {
  1.2890 +	    // not the first visit.
  1.2891 +	    o[symb]++;
  1.2892 +	    // unless there is already a number, assign one.
  1.2893 +	    if (!o[symb + "nb"]) o[symb + "nb"] = nbPointer.nb++;
  1.2894 +	    return;
  1.2895 +	}
  1.2896 +	o[symb] = 0;
  1.2897 +	if (o instanceof sc_Pair) {
  1.2898 +	    sc_prepWriteCircle(o.car, symb, nbPointer);
  1.2899 +	    sc_prepWriteCircle(o.cdr, symb, nbPointer);
  1.2900 +	} else {
  1.2901 +	    for (var i = 0; i < o.length; i++)
  1.2902 +		sc_prepWriteCircle(o[i], symb, nbPointer);
  1.2903 +	}
  1.2904 +    }
  1.2905 +}
  1.2906 +
  1.2907 +function sc_genToWriteCircleString(o, symb) {
  1.2908 +    if (!(o instanceof sc_Pair ||
  1.2909 +	  o instanceof sc_Vector))
  1.2910 +	return sc_toWriteString(o);
  1.2911 +    return o.sc_toWriteCircleString(symb);
  1.2912 +}
  1.2913 +sc_Pair.prototype.sc_toWriteCircleString = function(symb, inList) {
  1.2914 +    if (this[symb + "use"]) { // use-flag is set. Just use it.
  1.2915 +	var nb = this[symb + "nb"];
  1.2916 +	if (this[symb]-- === 0) { // if we are the last use. remove all fields.
  1.2917 +	    delete this[symb];
  1.2918 +	    delete this[symb + "nb"];
  1.2919 +	    delete this[symb + "use"];
  1.2920 +	}
  1.2921 +	if (inList)
  1.2922 +	    return '. #' + nb + '#';
  1.2923 +	else
  1.2924 +	    return '#' + nb + '#';
  1.2925 +    }
  1.2926 +    if (this[symb]-- === 0) { // if we are the last use. remove all fields.
  1.2927 +	delete this[symb];
  1.2928 +	delete this[symb + "nb"];
  1.2929 +	delete this[symb + "use"];
  1.2930 +    }
  1.2931 +
  1.2932 +    var res = "";
  1.2933 +
  1.2934 +    if (this[symb] !== undefined) { // implies > 0
  1.2935 +	this[symb + "use"] = true;
  1.2936 +	if (inList)
  1.2937 +	    res += '. #' + this[symb + "nb"] + '=';
  1.2938 +	else
  1.2939 +	    res += '#' + this[symb + "nb"] + '=';
  1.2940 +	inList = false;
  1.2941 +    }
  1.2942 +
  1.2943 +    if (!inList)
  1.2944 +	res += "(";
  1.2945 +
  1.2946 +    // print car
  1.2947 +    res += sc_genToWriteCircleString(this.car, symb);
  1.2948 +
  1.2949 +    if (sc_isPair(this.cdr)) {
  1.2950 +	res += " " + this.cdr.sc_toWriteCircleString(symb, true);
  1.2951 +    } else if (this.cdr !== null) {
  1.2952 +	res += " . " + sc_genToWriteCircleString(this.cdr, symb);
  1.2953 +    }
  1.2954 +    if (!inList)
  1.2955 +	res += ")";
  1.2956 +    return res;
  1.2957 +};
  1.2958 +sc_Vector.prototype.sc_toWriteCircleString = function(symb) {
  1.2959 +    if (this[symb + "use"]) { // use-flag is set. Just use it.
  1.2960 +	var nb = this[symb + "nb"];
  1.2961 +	if (this[symb]-- === 0) { // if we are the last use. remove all fields.
  1.2962 +	    delete this[symb];
  1.2963 +	    delete this[symb + "nb"];
  1.2964 +	    delete this[symb + "use"];
  1.2965 +	}
  1.2966 +	return '#' + nb + '#';
  1.2967 +    }
  1.2968 +    if (this[symb]-- === 0) { // if we are the last use. remove all fields.
  1.2969 +	delete this[symb];
  1.2970 +	delete this[symb + "nb"];
  1.2971 +	delete this[symb + "use"];
  1.2972 +    }
  1.2973 +
  1.2974 +    var res = "";
  1.2975 +    if (this[symb] !== undefined) { // implies > 0
  1.2976 +	this[symb + "use"] = true;
  1.2977 +	res += '#' + this[symb + "nb"] + '=';
  1.2978 +    }
  1.2979 +    res += "#(";
  1.2980 +    for (var i = 0; i < this.length; i++) {
  1.2981 +	res += sc_genToWriteCircleString(this[i], symb);
  1.2982 +	if (i < this.length - 1) res += " ";
  1.2983 +    }
  1.2984 +    res += ")";
  1.2985 +    return res;
  1.2986 +};
  1.2987 +
  1.2988 +
  1.2989 +/* ------------------ print ---------------------------------------------------*/
  1.2990 +
  1.2991 +/*** META ((export #t)) */
  1.2992 +function sc_print(s) {
  1.2993 +    if (arguments.length === 1) {
  1.2994 +	sc_display(s);
  1.2995 +	sc_newline();
  1.2996 +    }
  1.2997 +    else {
  1.2998 +	for (var i = 0; i < arguments.length; i++)
  1.2999 +	    sc_display(arguments[i]);
  1.3000 +	sc_newline();
  1.3001 +    }
  1.3002 +}
  1.3003 +
  1.3004 +/* ------------------ format ---------------------------------------------------*/
  1.3005 +/*** META ((export #t)) */
  1.3006 +function sc_format(s, args) {
  1.3007 +   var len = s.length;
  1.3008 +   var p = new sc_StringOutputPort();
  1.3009 +   var i = 0, j = 1;
  1.3010 +
  1.3011 +   while( i < len ) {
  1.3012 +      var i2 = s.indexOf("~", i);
  1.3013 +
  1.3014 +      if (i2 == -1) {
  1.3015 +	  p.appendJSString( s.substring( i, len ) );
  1.3016 +	  return p.close();
  1.3017 +      } else {
  1.3018 +	 if (i2 > i) {
  1.3019 +	    if (i2 == (len - 1)) {
  1.3020 +		p.appendJSString(s.substring(i, len));
  1.3021 +		return p.close();
  1.3022 +	    } else {
  1.3023 +	       p.appendJSString(s.substring(i, i2));
  1.3024 +	       i = i2;
  1.3025 +	    }
  1.3026 +	 }
  1.3027 +
  1.3028 +	 switch(s.charCodeAt(i2 + 1)) {
  1.3029 +	    case 65:
  1.3030 +	    case 97:
  1.3031 +	       // a
  1.3032 +	       sc_display(arguments[j], p);
  1.3033 +	       i += 2; j++;
  1.3034 +	       break;
  1.3035 +
  1.3036 +	    case 83:
  1.3037 +	    case 115:
  1.3038 +	       // s
  1.3039 +	       sc_write(arguments[j], p);
  1.3040 +	       i += 2; j++;
  1.3041 +	       break;
  1.3042 +
  1.3043 +	    case 86:
  1.3044 +	    case 118:
  1.3045 +	       // v
  1.3046 +	       sc_display(arguments[j], p);
  1.3047 +	       p.appendJSString("\n");
  1.3048 +	       i += 2; j++;
  1.3049 +	       break;
  1.3050 +
  1.3051 +	    case 67:
  1.3052 +	    case 99:
  1.3053 +	       // c
  1.3054 +	       p.appendJSString(String.fromCharCode(arguments[j]));
  1.3055 +	       i += 2; j++;
  1.3056 +	       break;
  1.3057 +
  1.3058 +	    case 88:
  1.3059 +	    case 120:
  1.3060 +	       // x
  1.3061 +	       p.appendJSString(arguments[j].toString(6));
  1.3062 +	       i += 2; j++;
  1.3063 +	       break;
  1.3064 +
  1.3065 +	    case 79:
  1.3066 +	    case 111:
  1.3067 +	       // o
  1.3068 +	       p.appendJSString(arguments[j].toString(8));
  1.3069 +	       i += 2; j++;
  1.3070 +	       break;
  1.3071 +
  1.3072 +	    case 66:
  1.3073 +	    case 98:
  1.3074 +	       // b
  1.3075 +	       p.appendJSString(arguments[j].toString(2));
  1.3076 +	       i += 2; j++;
  1.3077 +	       break;
  1.3078 +
  1.3079 +	    case 37:
  1.3080 +	    case 110:
  1.3081 +	       // %, n
  1.3082 +	       p.appendJSString("\n");
  1.3083 +	       i += 2; break;
  1.3084 +
  1.3085 +	    case 114:
  1.3086 +	       // r
  1.3087 +	       p.appendJSString("\r");
  1.3088 +	       i += 2; break;
  1.3089 +
  1.3090 +	    case 126:
  1.3091 +	       // ~
  1.3092 +	       p.appendJSString("~");
  1.3093 +	       i += 2; break;
  1.3094 +
  1.3095 +	    default:
  1.3096 +	       sc_error( "format: illegal ~"
  1.3097 +			 + String.fromCharCode(s.charCodeAt(i2 + 1))
  1.3098 +			 + " sequence" );
  1.3099 +	       return "";
  1.3100 +	 }
  1.3101 +      }
  1.3102 +   }
  1.3103 +
  1.3104 +   return p.close();
  1.3105 +}
  1.3106 +
  1.3107 +/* ------------------ global ports ---------------------------------------------------*/
  1.3108 +
  1.3109 +var SC_DEFAULT_IN = new sc_ErrorInputPort();
  1.3110 +var SC_DEFAULT_OUT = new sc_ErrorOutputPort();
  1.3111 +var SC_ERROR_OUT = new sc_ErrorOutputPort();
  1.3112 +
  1.3113 +var sc_SYMBOL_PREFIX = "\u1E9C";
  1.3114 +var sc_KEYWORD_PREFIX = "\u1E9D";
  1.3115 +
  1.3116 +/*** META ((export #t)
  1.3117 +           (peephole (id))) */
  1.3118 +function sc_jsstring2string(s) {
  1.3119 +    return s;
  1.3120 +}
  1.3121 +
  1.3122 +/*** META ((export #t)
  1.3123 +           (peephole (prefix "'\\u1E9C' +")))
  1.3124 +*/
  1.3125 +function sc_jsstring2symbol(s) {
  1.3126 +    return sc_SYMBOL_PREFIX + s;
  1.3127 +}
  1.3128 +
  1.3129 +/*** META ((export #t)
  1.3130 +           (peephole (id)))
  1.3131 +*/
  1.3132 +function sc_string2jsstring(s) {
  1.3133 +    return s;
  1.3134 +}
  1.3135 +
  1.3136 +/*** META ((export #t)
  1.3137 +           (peephole (symbol2jsstring_immutable)))
  1.3138 +*/
  1.3139 +function sc_symbol2jsstring(s) {
  1.3140 +    return s.slice(1);
  1.3141 +}
  1.3142 +
  1.3143 +/*** META ((export #t)
  1.3144 +           (peephole (postfix ".slice(1)")))
  1.3145 +*/
  1.3146 +function sc_keyword2jsstring(k) {
  1.3147 +    return k.slice(1);
  1.3148 +}
  1.3149 +
  1.3150 +/*** META ((export #t)
  1.3151 +           (peephole (prefix "'\\u1E9D' +")))
  1.3152 +*/
  1.3153 +function sc_jsstring2keyword(s) {
  1.3154 +    return sc_KEYWORD_PREFIX + s;
  1.3155 +}
  1.3156 +
  1.3157 +/*** META ((export #t)
  1.3158 +           (type bool))
  1.3159 +*/
  1.3160 +function sc_isKeyword(s) {
  1.3161 +    return (typeof s === "string") &&
  1.3162 +	(s.charAt(0) === sc_KEYWORD_PREFIX);
  1.3163 +}
  1.3164 +
  1.3165 +
  1.3166 +/*** META ((export #t)) */
  1.3167 +var sc_gensym = function() {
  1.3168 +    var counter = 1000;
  1.3169 +    return function(sym) {
  1.3170 +	counter++;
  1.3171 +	if (!sym) sym = sc_SYMBOL_PREFIX;
  1.3172 +	return sym + "s" + counter + "~" + "^sC-GeNsYm ";
  1.3173 +    };
  1.3174 +}();
  1.3175 +
  1.3176 +
  1.3177 +/*** META ((export #t)
  1.3178 +           (type bool))
  1.3179 +*/
  1.3180 +function sc_isEqual(o1, o2) {
  1.3181 +    return ((o1 === o2) ||
  1.3182 +	    (sc_isPair(o1) && sc_isPair(o2)
  1.3183 +	     && sc_isPairEqual(o1, o2, sc_isEqual)) ||
  1.3184 +	    (sc_isVector(o1) && sc_isVector(o2)
  1.3185 +	     && sc_isVectorEqual(o1, o2, sc_isEqual)));
  1.3186 +}
  1.3187 +
  1.3188 +/*** META ((export number->symbol integer->symbol)) */
  1.3189 +function sc_number2symbol(x, radix) {
  1.3190 +    return sc_SYMBOL_PREFIX + sc_number2jsstring(x, radix);
  1.3191 +}
  1.3192 +
  1.3193 +/*** META ((export number->string integer->string)) */
  1.3194 +var sc_number2string = sc_number2jsstring;
  1.3195 +
  1.3196 +/*** META ((export #t)) */
  1.3197 +function sc_symbol2number(s, radix) {
  1.3198 +    return sc_jsstring2number(s.slice(1), radix);
  1.3199 +}
  1.3200 +
  1.3201 +/*** META ((export #t)) */
  1.3202 +var sc_string2number = sc_jsstring2number;
  1.3203 +
  1.3204 +/*** META ((export #t)
  1.3205 +           (peephole (prefix "+" s)))
  1.3206 +           ;; peephole will only apply if no radix is given.
  1.3207 +*/
  1.3208 +function sc_string2integer(s, radix) {
  1.3209 +    if (!radix) return +s;
  1.3210 +    return parseInt(s, radix);
  1.3211 +}
  1.3212 +
  1.3213 +/*** META ((export #t)
  1.3214 +           (peephole (prefix "+")))
  1.3215 +*/
  1.3216 +function sc_string2real(s) {
  1.3217 +    return +s;
  1.3218 +}
  1.3219 +
  1.3220 +
  1.3221 +/*** META ((export #t)
  1.3222 +           (type bool))
  1.3223 +*/
  1.3224 +function sc_isSymbol(s) {
  1.3225 +    return (typeof s === "string") &&
  1.3226 +	(s.charAt(0) === sc_SYMBOL_PREFIX);
  1.3227 +}
  1.3228 +
  1.3229 +/*** META ((export #t)
  1.3230 +           (peephole (symbol2string_immutable)))
  1.3231 +*/
  1.3232 +function sc_symbol2string(s) {
  1.3233 +    return s.slice(1);
  1.3234 +}
  1.3235 +
  1.3236 +/*** META ((export #t)
  1.3237 +           (peephole (prefix "'\\u1E9C' +")))
  1.3238 +*/
  1.3239 +function sc_string2symbol(s) {
  1.3240 +    return sc_SYMBOL_PREFIX + s;
  1.3241 +}
  1.3242 +
  1.3243 +/*** META ((export symbol-append)
  1.3244 +           (peephole (symbolAppend_immutable)))
  1.3245 +*/
  1.3246 +function sc_symbolAppend() {
  1.3247 +    var res = sc_SYMBOL_PREFIX;
  1.3248 +    for (var i = 0; i < arguments.length; i++)
  1.3249 +	res += arguments[i].slice(1);
  1.3250 +    return res;
  1.3251 +}
  1.3252 +
  1.3253 +/*** META ((export #t)
  1.3254 +           (peephole (postfix ".val")))
  1.3255 +*/
  1.3256 +function sc_char2string(c) { return c.val; }
  1.3257 +
  1.3258 +/*** META ((export #t)
  1.3259 +           (peephole (hole 1 "'\\u1E9C' + " c ".val")))
  1.3260 +*/
  1.3261 +function sc_char2symbol(c) { return sc_SYMBOL_PREFIX + c.val; }
  1.3262 +
  1.3263 +/*** META ((export #t)
  1.3264 +           (type bool))
  1.3265 +*/
  1.3266 +function sc_isString(s) {
  1.3267 +    return (typeof s === "string") &&
  1.3268 +	(s.charAt(0) !== sc_SYMBOL_PREFIX);
  1.3269 +}
  1.3270 +
  1.3271 +/*** META ((export #t)) */
  1.3272 +var sc_makeString = sc_makejsString;
  1.3273 +
  1.3274 +
  1.3275 +/*** META ((export #t)) */
  1.3276 +function sc_string() {
  1.3277 +    for (var i = 0; i < arguments.length; i++)
  1.3278 +	arguments[i] = arguments[i].val;
  1.3279 +    return "".concat.apply("", arguments);
  1.3280 +}
  1.3281 +
  1.3282 +/*** META ((export #t)
  1.3283 +           (peephole (postfix ".length")))
  1.3284 +*/
  1.3285 +function sc_stringLength(s) { return s.length; }
  1.3286 +
  1.3287 +/*** META ((export #t)) */
  1.3288 +function sc_stringRef(s, k) {
  1.3289 +    return new sc_Char(s.charAt(k));
  1.3290 +}
  1.3291 +
  1.3292 +/* there's no stringSet in the immutable version
  1.3293 +function sc_stringSet(s, k, c)
  1.3294 +*/
  1.3295 +
  1.3296 +
  1.3297 +/*** META ((export string=?)
  1.3298 +	   (type bool)
  1.3299 +           (peephole (hole 2 str1 " === " str2)))
  1.3300 +*/
  1.3301 +function sc_isStringEqual(s1, s2) {
  1.3302 +    return s1 === s2;
  1.3303 +}
  1.3304 +/*** META ((export string<?)
  1.3305 +	   (type bool)
  1.3306 +           (peephole (hole 2 str1 " < " str2)))
  1.3307 +*/
  1.3308 +function sc_isStringLess(s1, s2) {
  1.3309 +    return s1 < s2;
  1.3310 +}
  1.3311 +/*** META ((export string>?)
  1.3312 +	   (type bool)
  1.3313 +           (peephole (hole 2 str1 " > " str2)))
  1.3314 +*/
  1.3315 +function sc_isStringGreater(s1, s2) {
  1.3316 +    return s1 > s2;
  1.3317 +}
  1.3318 +/*** META ((export string<=?)
  1.3319 +	   (type bool)
  1.3320 +           (peephole (hole 2 str1 " <= " str2)))
  1.3321 +*/
  1.3322 +function sc_isStringLessEqual(s1, s2) {
  1.3323 +    return s1 <= s2;
  1.3324 +}
  1.3325 +/*** META ((export string>=?)
  1.3326 +	   (type bool)
  1.3327 +           (peephole (hole 2 str1 " >= " str2)))
  1.3328 +*/
  1.3329 +function sc_isStringGreaterEqual(s1, s2) {
  1.3330 +    return s1 >= s2;
  1.3331 +}
  1.3332 +/*** META ((export string-ci=?)
  1.3333 +	   (type bool)
  1.3334 +           (peephole (hole 2 str1 ".toLowerCase() === " str2 ".toLowerCase()")))
  1.3335 +*/
  1.3336 +function sc_isStringCIEqual(s1, s2) {
  1.3337 +    return s1.toLowerCase() === s2.toLowerCase();
  1.3338 +}
  1.3339 +/*** META ((export string-ci<?)
  1.3340 +	   (type bool)
  1.3341 +           (peephole (hole 2 str1 ".toLowerCase() < " str2 ".toLowerCase()")))
  1.3342 +*/
  1.3343 +function sc_isStringCILess(s1, s2) {
  1.3344 +    return s1.toLowerCase() < s2.toLowerCase();
  1.3345 +}
  1.3346 +/*** META ((export string-ci>?)
  1.3347 +	   (type bool)
  1.3348 +           (peephole (hole 2 str1 ".toLowerCase() > " str2 ".toLowerCase()")))
  1.3349 +*/
  1.3350 +function sc_isStringCIGreater(s1, s2) {
  1.3351 +    return s1.toLowerCase() > s2.toLowerCase();
  1.3352 +}
  1.3353 +/*** META ((export string-ci<=?)
  1.3354 +	   (type bool)
  1.3355 +           (peephole (hole 2 str1 ".toLowerCase() <= " str2 ".toLowerCase()")))
  1.3356 +*/
  1.3357 +function sc_isStringCILessEqual(s1, s2) {
  1.3358 +    return s1.toLowerCase() <= s2.toLowerCase();
  1.3359 +}
  1.3360 +/*** META ((export string-ci>=?)
  1.3361 +	   (type bool)
  1.3362 +           (peephole (hole 2 str1 ".toLowerCase() >= " str2 ".toLowerCase()")))
  1.3363 +*/
  1.3364 +function sc_isStringCIGreaterEqual(s1, s2) {
  1.3365 +    return s1.toLowerCase() >= s2.toLowerCase();
  1.3366 +}
  1.3367 +
  1.3368 +/*** META ((export #t)
  1.3369 +           (peephole (hole 3 s ".substring(" start ", " end ")")))
  1.3370 +*/
  1.3371 +function sc_substring(s, start, end) {
  1.3372 +    return s.substring(start, end);
  1.3373 +}
  1.3374 +
  1.3375 +/*** META ((export #t))
  1.3376 +*/
  1.3377 +function sc_isSubstring_at(s1, s2, i) {
  1.3378 +    return s2 == s1.substring(i, i+ s2.length);
  1.3379 +}
  1.3380 +
  1.3381 +/*** META ((export #t)
  1.3382 +           (peephole (infix 0 #f "+" "''")))
  1.3383 +*/
  1.3384 +function sc_stringAppend() {
  1.3385 +    return "".concat.apply("", arguments);
  1.3386 +}
  1.3387 +
  1.3388 +/*** META ((export #t)) */
  1.3389 +var sc_string2list = sc_jsstring2list;
  1.3390 +
  1.3391 +/*** META ((export #t)) */
  1.3392 +var sc_list2string = sc_list2jsstring;
  1.3393 +
  1.3394 +/*** META ((export #t)
  1.3395 +           (peephole (id)))
  1.3396 +*/
  1.3397 +function sc_stringCopy(s) {
  1.3398 +    return s;
  1.3399 +}
  1.3400 +
  1.3401 +/* there's no string-fill in the immutable version
  1.3402 +function sc_stringFill(s, c)
  1.3403 +*/
  1.3404 +
  1.3405 +/*** META ((export #t)
  1.3406 +           (peephole (postfix ".slice(1)")))
  1.3407 +*/
  1.3408 +function sc_keyword2string(o) {
  1.3409 +    return o.slice(1);
  1.3410 +}
  1.3411 +
  1.3412 +/*** META ((export #t)
  1.3413 +           (peephole (prefix "'\\u1E9D' +")))
  1.3414 +*/
  1.3415 +function sc_string2keyword(o) {
  1.3416 +    return sc_KEYWORD_PREFIX + o;
  1.3417 +}
  1.3418 +
  1.3419 +String.prototype.sc_toDisplayString = function() {
  1.3420 +    if (this.charAt(0) === sc_SYMBOL_PREFIX)
  1.3421 +	// TODO: care for symbols with spaces (escape-chars symbols).
  1.3422 +	return this.slice(1);
  1.3423 +    else if (this.charAt(0) === sc_KEYWORD_PREFIX)
  1.3424 +	return ":" + this.slice(1);
  1.3425 +    else
  1.3426 +	return this.toString();
  1.3427 +};
  1.3428 +
  1.3429 +String.prototype.sc_toWriteString = function() {
  1.3430 +    if (this.charAt(0) === sc_SYMBOL_PREFIX)
  1.3431 +	// TODO: care for symbols with spaces (escape-chars symbols).
  1.3432 +	return this.slice(1);
  1.3433 +    else if (this.charAt(0) === sc_KEYWORD_PREFIX)
  1.3434 +	return ":" + this.slice(1);
  1.3435 +    else
  1.3436 +	return '"' + sc_escapeWriteString(this) + '"';
  1.3437 +};
  1.3438 +/* Exported Variables */
  1.3439 +var BgL_testzd2boyerzd2;
  1.3440 +var BgL_nboyerzd2benchmarkzd2;
  1.3441 +var BgL_setupzd2boyerzd2;
  1.3442 +/* End Exports */
  1.3443 +
  1.3444 +var translate_term_nboyer;
  1.3445 +var translate_args_nboyer;
  1.3446 +var untranslate_term_nboyer;
  1.3447 +var BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer;
  1.3448 +var BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer;
  1.3449 +var translate_alist_nboyer;
  1.3450 +var apply_subst_nboyer;
  1.3451 +var apply_subst_lst_nboyer;
  1.3452 +var tautologyp_nboyer;
  1.3453 +var if_constructor_nboyer;
  1.3454 +var rewrite_count_nboyer;
  1.3455 +var rewrite_nboyer;
  1.3456 +var rewrite_args_nboyer;
  1.3457 +var unify_subst_nboyer;
  1.3458 +var one_way_unify1_nboyer;
  1.3459 +var false_term_nboyer;
  1.3460 +var true_term_nboyer;
  1.3461 +var trans_of_implies1_nboyer;
  1.3462 +var is_term_equal_nboyer;
  1.3463 +var is_term_member_nboyer;
  1.3464 +var const_nboyer;
  1.3465 +var sc_const_3_nboyer;
  1.3466 +var sc_const_4_nboyer;
  1.3467 +{
  1.3468 +    (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)))))));
  1.3469 +    (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))))))));
  1.3470 +    (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)))))))))));
  1.3471 +    BgL_nboyerzd2benchmarkzd2 = function() {
  1.3472 +        var args = null;
  1.3473 +        for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {
  1.3474 +            args = sc_cons(arguments[sc_tmp], args);
  1.3475 +        }
  1.3476 +        var n;
  1.3477 +        return ((n = ((args === null)?(0):(args.car))), (BgL_setupzd2boyerzd2()), (BgL_runzd2benchmarkzd2(("nboyer"+(sc_number2string(n))), (1), function() {
  1.3478 +            return (BgL_testzd2boyerzd2(n));
  1.3479 +        }, function(rewrites) {
  1.3480 +            if ((sc_isNumber(rewrites)))
  1.3481 +                switch (n) {
  1.3482 +                case (0):
  1.3483 +                    return (rewrites===(95024));
  1.3484 +                    break;
  1.3485 +                case (1):
  1.3486 +                    return (rewrites===(591777));
  1.3487 +                    break;
  1.3488 +                case (2):
  1.3489 +                    return (rewrites===(1813975));
  1.3490 +                    break;
  1.3491 +                case (3):
  1.3492 +                    return (rewrites===(5375678));
  1.3493 +                    break;
  1.3494 +                case (4):
  1.3495 +                    return (rewrites===(16445406));
  1.3496 +                    break;
  1.3497 +                case (5):
  1.3498 +                    return (rewrites===(51507739));
  1.3499 +                    break;
  1.3500 +                default:
  1.3501 +                    return true;
  1.3502 +                    break;
  1.3503 +                }
  1.3504 +            else
  1.3505 +                return false;
  1.3506 +        })));
  1.3507 +    };
  1.3508 +    BgL_setupzd2boyerzd2 = function() {
  1.3509 +        return true;
  1.3510 +    };
  1.3511 +    BgL_testzd2boyerzd2 = function() {
  1.3512 +        return true;
  1.3513 +    };
  1.3514 +    translate_term_nboyer = function(term) {
  1.3515 +        var lst;
  1.3516 +        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))))))))));
  1.3517 +    };
  1.3518 +    translate_args_nboyer = function(lst) {
  1.3519 +        var sc_lst_5;
  1.3520 +        var term;
  1.3521 +        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))))))))));
  1.3522 +    };
  1.3523 +    untranslate_term_nboyer = function(term) {
  1.3524 +        var optrOpnd;
  1.3525 +        var tail1131;
  1.3526 +        var L1127;
  1.3527 +        var falseHead1130;
  1.3528 +        var symbol_record;
  1.3529 +        if (!(term instanceof sc_Pair))
  1.3530 +            return term;
  1.3531 +        else
  1.3532 +            {
  1.3533 +                (falseHead1130 = (new sc_Pair(null, null)));
  1.3534 +                (L1127 = (term.cdr));
  1.3535 +                (tail1131 = falseHead1130);
  1.3536 +                while (!(L1127 === null)) {
  1.3537 +                    {
  1.3538 +                        (tail1131.cdr = (new sc_Pair((untranslate_term_nboyer((L1127.car))), null)));
  1.3539 +                        (tail1131 = (tail1131.cdr));
  1.3540 +                        (L1127 = (L1127.cdr));
  1.3541 +                    }
  1.3542 +                }
  1.3543 +                (optrOpnd = (falseHead1130.cdr));
  1.3544 +                return (new sc_Pair(((symbol_record = (term.car)), (symbol_record[(0)])), optrOpnd));
  1.3545 +            }
  1.3546 +    };
  1.3547 +    BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer = function(sym) {
  1.3548 +        var r;
  1.3549 +        var x;
  1.3550 +        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)));
  1.3551 +    };
  1.3552 +    (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);
  1.3553 +    translate_alist_nboyer = function(alist) {
  1.3554 +        var sc_alist_6;
  1.3555 +        var term;
  1.3556 +        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))))))))));
  1.3557 +    };
  1.3558 +    apply_subst_nboyer = function(alist, term) {
  1.3559 +        var lst;
  1.3560 +        var temp_temp;
  1.3561 +        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))))))))));
  1.3562 +    };
  1.3563 +    apply_subst_lst_nboyer = function(alist, lst) {
  1.3564 +        var sc_lst_7;
  1.3565 +        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))))))))));
  1.3566 +    };
  1.3567 +    tautologyp_nboyer = function(sc_x_11, true_lst, false_lst) {
  1.3568 +        var tmp1125;
  1.3569 +        var x;
  1.3570 +        var tmp1126;
  1.3571 +        var sc_x_8;
  1.3572 +        var sc_tmp1125_9;
  1.3573 +        var sc_tmp1126_10;
  1.3574 +        var sc_x_11;
  1.3575 +        var true_lst;
  1.3576 +        var false_lst;
  1.3577 +        while (true) {
  1.3578 +            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))
  1.3579 +                return true;
  1.3580 +            else
  1.3581 +                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))
  1.3582 +                    return false;
  1.3583 +                else
  1.3584 +                    if (!(sc_x_11 instanceof sc_Pair))
  1.3585 +                        return false;
  1.3586 +                    else
  1.3587 +                        if (((sc_x_11.car)===if_constructor_nboyer))
  1.3588 +                            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))
  1.3589 +                                (sc_x_11 = (sc_x_11.cdr.cdr.car));
  1.3590 +                            else
  1.3591 +                                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))
  1.3592 +                                    (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));
  1.3593 +                                else
  1.3594 +                                    if (((tautologyp_nboyer((sc_x_11.cdr.cdr.car), (new sc_Pair((sc_x_11.cdr.car), true_lst)), false_lst))!== false))
  1.3595 +                                        {
  1.3596 +                                            (false_lst = (new sc_Pair((sc_x_11.cdr.car), false_lst)));
  1.3597 +                                            (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car));
  1.3598 +                                        }
  1.3599 +                                    else
  1.3600 +                                        return false;
  1.3601 +                        else
  1.3602 +                            return false;
  1.3603 +        }
  1.3604 +    };
  1.3605 +    (if_constructor_nboyer = "\u1E9C*");
  1.3606 +    (rewrite_count_nboyer = (0));
  1.3607 +    rewrite_nboyer = function(term) {
  1.3608 +        var term2;
  1.3609 +        var sc_term_12;
  1.3610 +        var lst;
  1.3611 +        var symbol_record;
  1.3612 +        var sc_lst_13;
  1.3613 +        {
  1.3614 +            (++rewrite_count_nboyer);
  1.3615 +            if (!(term instanceof sc_Pair))
  1.3616 +                return term;
  1.3617 +            else
  1.3618 +                {
  1.3619 +                    (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))))))))));
  1.3620 +                    (lst = ((symbol_record = (term.car)), (symbol_record[(1)])));
  1.3621 +                    while (true) {
  1.3622 +                        if ((lst === null))
  1.3623 +                            return sc_term_12;
  1.3624 +                        else
  1.3625 +                            if ((((term2 = ((lst.car).cdr.car)), (unify_subst_nboyer = null), (one_way_unify1_nboyer(sc_term_12, term2)))!== false))
  1.3626 +                                return (rewrite_nboyer((apply_subst_nboyer(unify_subst_nboyer, ((lst.car).cdr.cdr.car)))));
  1.3627 +                            else
  1.3628 +                                (lst = (lst.cdr));
  1.3629 +                    }
  1.3630 +                }
  1.3631 +        }
  1.3632 +    };
  1.3633 +    rewrite_args_nboyer = function(lst) {
  1.3634 +        var sc_lst_14;
  1.3635 +        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))))))))));
  1.3636 +    };
  1.3637 +    (unify_subst_nboyer = "\u1E9C*");
  1.3638 +    one_way_unify1_nboyer = function(term1, term2) {
  1.3639 +        var lst1;
  1.3640 +        var lst2;
  1.3641 +        var temp_temp;
  1.3642 +        if (!(term2 instanceof sc_Pair))
  1.3643 +            {
  1.3644 +                (temp_temp = (sc_assq(term2, unify_subst_nboyer)));
  1.3645 +                if ((temp_temp!== false))
  1.3646 +                    return (is_term_equal_nboyer(term1, (temp_temp.cdr)));
  1.3647 +                else
  1.3648 +                    if ((sc_isNumber(term2)))
  1.3649 +                        return (sc_isEqual(term1, term2));
  1.3650 +                    else
  1.3651 +                        {
  1.3652 +                            (unify_subst_nboyer = (new sc_Pair((new sc_Pair(term2, term1)), unify_subst_nboyer)));
  1.3653 +                            return true;
  1.3654 +                        }
  1.3655 +            }
  1.3656 +        else
  1.3657 +            if (!(term1 instanceof sc_Pair))
  1.3658 +                return false;
  1.3659 +            else
  1.3660 +                if (((term1.car)===(term2.car)))
  1.3661 +                    {
  1.3662 +                        (lst1 = (term1.cdr));
  1.3663 +                        (lst2 = (term2.cdr));
  1.3664 +                        while (true) {
  1.3665 +                            if ((lst1 === null))
  1.3666 +                                return (lst2 === null);
  1.3667 +                            else
  1.3668 +                                if ((lst2 === null))
  1.3669 +                                    return false;
  1.3670 +                                else
  1.3671 +                                    if (((one_way_unify1_nboyer((lst1.car), (lst2.car)))!== false))
  1.3672 +                                        {
  1.3673 +                                            (lst1 = (lst1.cdr));
  1.3674 +                                            (lst2 = (lst2.cdr));
  1.3675 +                                        }
  1.3676 +                                    else
  1.3677 +                                        return false;
  1.3678 +                        }
  1.3679 +                    }
  1.3680 +                else
  1.3681 +                    return false;
  1.3682 +    };
  1.3683 +    (false_term_nboyer = "\u1E9C*");
  1.3684 +    (true_term_nboyer = "\u1E9C*");
  1.3685 +    trans_of_implies1_nboyer = function(n) {
  1.3686 +        var sc_n_15;
  1.3687 +        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)))))))))));
  1.3688 +    };
  1.3689 +    is_term_equal_nboyer = function(x, y) {
  1.3690 +        var lst1;
  1.3691 +        var lst2;
  1.3692 +        var r2;
  1.3693 +        var r1;
  1.3694 +        if ((x instanceof sc_Pair))
  1.3695 +            if ((y instanceof sc_Pair))
  1.3696 +                if ((((r1 = (x.car)), (r2 = (y.car)), (r1===r2))!== false))
  1.3697 +                    {
  1.3698 +                        (lst1 = (x.cdr));
  1.3699 +                        (lst2 = (y.cdr));
  1.3700 +                        while (true) {
  1.3701 +                            if ((lst1 === null))
  1.3702 +                                return (lst2 === null);
  1.3703 +                            else
  1.3704 +                                if ((lst2 === null))
  1.3705 +                                    return false;
  1.3706 +                                else
  1.3707 +                                    if (((is_term_equal_nboyer((lst1.car), (lst2.car)))!== false))
  1.3708 +                                        {
  1.3709 +                                            (lst1 = (lst1.cdr));
  1.3710 +                                            (lst2 = (lst2.cdr));
  1.3711 +                                        }
  1.3712 +                                    else
  1.3713 +                                        return false;
  1.3714 +                        }
  1.3715 +                    }
  1.3716 +                else
  1.3717 +                    return false;
  1.3718 +            else
  1.3719 +                return false;
  1.3720 +        else
  1.3721 +            return (sc_isEqual(x, y));
  1.3722 +    };
  1.3723 +    is_term_member_nboyer = function(x, lst) {
  1.3724 +        var x;
  1.3725 +        var lst;
  1.3726 +        while (true) {
  1.3727 +            if ((lst === null))
  1.3728 +                return false;
  1.3729 +            else
  1.3730 +                if (((is_term_equal_nboyer(x, (lst.car)))!== false))
  1.3731 +                    return true;
  1.3732 +                else
  1.3733 +                    (lst = (lst.cdr));
  1.3734 +        }
  1.3735 +    };
  1.3736 +    BgL_setupzd2boyerzd2 = function() {
  1.3737 +        var symbol_record;
  1.3738 +        var value;
  1.3739 +        var BgL_sc_symbolzd2record_16zd2;
  1.3740 +        var sym;
  1.3741 +        var sc_sym_17;
  1.3742 +        var term;
  1.3743 +        var lst;
  1.3744 +        var sc_term_18;
  1.3745 +        var sc_term_19;
  1.3746 +        {
  1.3747 +            (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null);
  1.3748 +            (if_constructor_nboyer = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer("\u1E9Cif")));
  1.3749 +            (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))))))));
  1.3750 +            (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))))))));
  1.3751 +            (lst = sc_const_3_nboyer);
  1.3752 +            while (!(lst === null)) {
  1.3753 +                {
  1.3754 +                    (term = (lst.car));
  1.3755 +                    if (((term instanceof sc_Pair)&&(((term.car)==="\u1E9Cequal")&&((term.cdr.car) instanceof sc_Pair))))
  1.3756 +                        {
  1.3757 +                            (sc_sym_17 = ((term.cdr.car).car));
  1.3758 +                            (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)])))));
  1.3759 +                            (symbol_record = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sc_sym_17)));
  1.3760 +                            (symbol_record[(1)] = value);
  1.3761 +                        }
  1.3762 +                    else
  1.3763 +                        (sc_error("ADD-LEMMA did not like term:  ", term));
  1.3764 +                    (lst = (lst.cdr));
  1.3765 +                }
  1.3766 +            }
  1.3767 +            return true;
  1.3768 +        }
  1.3769 +    };
  1.3770 +    BgL_testzd2boyerzd2 = function(n) {
  1.3771 +        var optrOpnd;
  1.3772 +        var term;
  1.3773 +        var sc_n_20;
  1.3774 +        var answer;
  1.3775 +        var sc_term_21;
  1.3776 +        var sc_term_22;
  1.3777 +        {
  1.3778 +            (rewrite_count_nboyer = (0));
  1.3779 +            (term = sc_const_4_nboyer);
  1.3780 +            (sc_n_20 = n);
  1.3781 +            while (!(sc_n_20=== 0)) {
  1.3782 +                {
  1.3783 +                    (term = (sc_list("\u1E9Cor", term, (new sc_Pair("\u1E9Cf",null)))));
  1.3784 +                    (--sc_n_20);
  1.3785 +                }
  1.3786 +            }
  1.3787 +            (sc_term_22 = term);
  1.3788 +            if (!(sc_term_22 instanceof sc_Pair))
  1.3789 +                (optrOpnd = sc_term_22);
  1.3790 +            else
  1.3791 +                (optrOpnd = (new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_22.car))), (translate_args_nboyer((sc_term_22.cdr))))));
  1.3792 +            (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)));
  1.3793 +            (answer = (tautologyp_nboyer((rewrite_nboyer(sc_term_21)), null, null)));
  1.3794 +            (sc_write(rewrite_count_nboyer));
  1.3795 +            (sc_display(" rewrites"));
  1.3796 +            (sc_newline());
  1.3797 +            if ((answer!== false))
  1.3798 +                return rewrite_count_nboyer;
  1.3799 +            else
  1.3800 +                return false;
  1.3801 +        }
  1.3802 +    };
  1.3803 +}
  1.3804 +/* Exported Variables */
  1.3805 +var BgL_parsezd2ze3nbzd2treesze3;
  1.3806 +var BgL_earleyzd2benchmarkzd2;
  1.3807 +var BgL_parsezd2ze3parsedzf3zc2;
  1.3808 +var test;
  1.3809 +var BgL_parsezd2ze3treesz31;
  1.3810 +var BgL_makezd2parserzd2;
  1.3811 +/* End Exports */
  1.3812 +
  1.3813 +var const_earley;
  1.3814 +{
  1.3815 +    (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)));
  1.3816 +    BgL_makezd2parserzd2 = function(grammar, lexer) {
  1.3817 +        var i;
  1.3818 +        var parser_descr;
  1.3819 +        var def_loop;
  1.3820 +        var nb_nts;
  1.3821 +        var names;
  1.3822 +        var steps;
  1.3823 +        var predictors;
  1.3824 +        var enders;
  1.3825 +        var starters;
  1.3826 +        var nts;
  1.3827 +        var sc_names_1;
  1.3828 +        var sc_steps_2;
  1.3829 +        var sc_predictors_3;
  1.3830 +        var sc_enders_4;
  1.3831 +        var sc_starters_5;
  1.3832 +        var nb_confs;
  1.3833 +        var BgL_sc_defzd2loop_6zd2;
  1.3834 +        var BgL_sc_nbzd2nts_7zd2;
  1.3835 +        var sc_nts_8;
  1.3836 +        var BgL_sc_defzd2loop_9zd2;
  1.3837 +        var ind;
  1.3838 +        {
  1.3839 +            ind = function(nt, sc_nts_10) {
  1.3840 +                var i;
  1.3841 +                {
  1.3842 +                    (i = ((sc_nts_10.length)-(1)));
  1.3843 +                    while (true) {
  1.3844 +                        if ((i>=(0)))
  1.3845 +                            if ((sc_isEqual((sc_nts_10[i]), nt)))
  1.3846 +                                return i;
  1.3847 +                            else
  1.3848 +                                (--i);
  1.3849 +                        else
  1.3850 +                            return false;
  1.3851 +                    }
  1.3852 +                }
  1.3853 +            };
  1.3854 +            (sc_nts_8 = ((BgL_sc_defzd2loop_9zd2 = function(defs, sc_nts_11) {
  1.3855 +                var rule_loop;
  1.3856 +                var head;
  1.3857 +                var def;
  1.3858 +                return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, sc_nts_12) {
  1.3859 +                    var nt;
  1.3860 +                    var l;
  1.3861 +                    var sc_nts_13;
  1.3862 +                    var rule;
  1.3863 +                    if ((rules instanceof sc_Pair))
  1.3864 +                        {
  1.3865 +                            (rule = (rules.car));
  1.3866 +                            (l = rule);
  1.3867 +                            (sc_nts_13 = sc_nts_12);
  1.3868 +                            while ((l instanceof sc_Pair)) {
  1.3869 +                                {
  1.3870 +                                    (nt = (l.car));
  1.3871 +                                    (l = (l.cdr));
  1.3872 +                                    (sc_nts_13 = (((sc_member(nt, sc_nts_13))!== false)?sc_nts_13:(new sc_Pair(nt, sc_nts_13))));
  1.3873 +                                }
  1.3874 +                            }
  1.3875 +                            return (rule_loop((rules.cdr), sc_nts_13));
  1.3876 +                        }
  1.3877 +                    else
  1.3878 +                        return (BgL_sc_defzd2loop_9zd2((defs.cdr), sc_nts_12));
  1.3879 +                }), (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)))));
  1.3880 +            }), (BgL_sc_defzd2loop_9zd2(grammar, null))));
  1.3881 +            (BgL_sc_nbzd2nts_7zd2 = (sc_nts_8.length));
  1.3882 +            (nb_confs = (((BgL_sc_defzd2loop_6zd2 = function(defs, BgL_sc_nbzd2confs_14zd2) {
  1.3883 +                var rule_loop;
  1.3884 +                var def;
  1.3885 +                return ((defs instanceof sc_Pair)?((def = (defs.car)), (rule_loop = function(rules, BgL_sc_nbzd2confs_15zd2) {
  1.3886 +                    var l;
  1.3887 +                    var BgL_sc_nbzd2confs_16zd2;
  1.3888 +                    var rule;
  1.3889 +                    if ((rules instanceof sc_Pair))
  1.3890 +                        {
  1.3891 +                            (rule = (rules.car));
  1.3892 +                            (l = rule);
  1.3893 +                            (BgL_sc_nbzd2confs_16zd2 = BgL_sc_nbzd2confs_15zd2);
  1.3894 +                            while ((l instanceof sc_Pair)) {
  1.3895 +                                {
  1.3896 +                                    (l = (l.cdr));
  1.3897 +                                    (++BgL_sc_nbzd2confs_16zd2);
  1.3898 +                                }
  1.3899 +                            }
  1.3900 +                            return (rule_loop((rules.cdr), (BgL_sc_nbzd2confs_16zd2+(1))));
  1.3901 +                        }
  1.3902 +                    else
  1.3903 +                        return (BgL_sc_defzd2loop_6zd2((defs.cdr), BgL_sc_nbzd2confs_15zd2));
  1.3904 +                }), (rule_loop((def.cdr), BgL_sc_nbzd2confs_14zd2))):BgL_sc_nbzd2confs_14zd2);
  1.3905 +            }), (BgL_sc_defzd2loop_6zd2(grammar, (0))))+BgL_sc_nbzd2nts_7zd2));
  1.3906 +            (sc_starters_5 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));
  1.3907 +            (sc_enders_4 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));
  1.3908 +            (sc_predictors_3 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null)));
  1.3909 +            (sc_steps_2 = (sc_makeVector(nb_confs, false)));
  1.3910 +            (sc_names_1 = (sc_makeVector(nb_confs, false)));
  1.3911 +            (nts = sc_nts_8);
  1.3912 +            (starters = sc_starters_5);
  1.3913 +            (enders = sc_enders_4);
  1.3914 +            (predictors = sc_predictors_3);
  1.3915 +            (steps = sc_steps_2);
  1.3916 +            (names = sc_names_1);
  1.3917 +            (nb_nts = (sc_nts_8.length));
  1.3918 +            (i = (nb_nts-(1)));
  1.3919 +            while ((i>=(0))) {
  1.3920 +                {
  1.3921 +                    (sc_steps_2[i] = (i-nb_nts));
  1.3922 +                    (sc_names_1[i] = (sc_list((sc_nts_8[i]), (0))));
  1.3923 +                    (sc_enders_4[i] = (sc_list(i)));
  1.3924 +                    (--i);
  1.3925 +                }
  1.3926 +            }
  1.3927 +            def_loop = function(defs, conf) {
  1.3928 +                var rule_loop;
  1.3929 +                var head;
  1.3930 +                var def;
  1.3931 +                return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, conf, rule_num) {
  1.3932 +                    var i;
  1.3933 +                    var sc_i_17;
  1.3934 +                    var nt;
  1.3935 +                    var l;
  1.3936 +                    var sc_conf_18;
  1.3937 +                    var sc_i_19;
  1.3938 +                    var rule;
  1.3939 +                    if ((rules instanceof sc_Pair))
  1.3940 +                        {
  1.3941 +                            (rule = (rules.car));
  1.3942 +                            (names[conf] = (sc_list(head, rule_num)));
  1.3943 +                            (sc_i_19 = (ind(head, nts)));
  1.3944 +                            (starters[sc_i_19] = (new sc_Pair(conf, (starters[sc_i_19]))));
  1.3945 +                            (l = rule);
  1.3946 +                            (sc_conf_18 = conf);
  1.3947 +                            while ((l instanceof sc_Pair)) {
  1.3948 +                                {
  1.3949 +                                    (nt = (l.car));
  1.3950 +                                    (steps[sc_conf_18] = (ind(nt, nts)));
  1.3951 +                                    (sc_i_17 = (ind(nt, nts)));
  1.3952 +                                    (predictors[sc_i_17] = (new sc_Pair(sc_conf_18, (predictors[sc_i_17]))));
  1.3953 +                                    (l = (l.cdr));
  1.3954 +                                    (++sc_conf_18);
  1.3955 +                                }
  1.3956 +                            }
  1.3957 +                            (steps[sc_conf_18] = ((ind(head, nts))-nb_nts));
  1.3958 +                            (i = (ind(head, nts)));
  1.3959 +                            (enders[i] = (new sc_Pair(sc_conf_18, (enders[i]))));
  1.3960 +                            return (rule_loop((rules.cdr), (sc_conf_18+(1)), (rule_num+(1))));
  1.3961 +                        }
  1.3962 +                    else
  1.3963 +                        return (def_loop((defs.cdr), conf));
  1.3964 +                }), (rule_loop((def.cdr), conf, (1)))):undefined);
  1.3965 +            };
  1.3966 +            (def_loop(grammar, (sc_nts_8.length)));
  1.3967 +            (parser_descr = [lexer, sc_nts_8, sc_starters_5, sc_enders_4, sc_predictors_3, sc_steps_2, sc_names_1]);
  1.3968 +            return function(input) {
  1.3969 +                var optrOpnd;
  1.3970 +                var sc_optrOpnd_20;
  1.3971 +                var sc_optrOpnd_21;
  1.3972 +                var sc_optrOpnd_22;
  1.3973 +                var loop1;
  1.3974 +                var BgL_sc_stateza2_23za2;
  1.3975 +                var toks;
  1.3976 +                var BgL_sc_nbzd2nts_24zd2;
  1.3977 +                var sc_steps_25;
  1.3978 +                var sc_enders_26;
  1.3979 +                var state_num;
  1.3980 +                var BgL_sc_statesza2_27za2;
  1.3981 +                var states;
  1.3982 +                var i;
  1.3983 +                var conf;
  1.3984 +                var l;
  1.3985 +                var tok_nts;
  1.3986 +                var sc_i_28;
  1.3987 +                var sc_i_29;
  1.3988 +                var l1;
  1.3989 +                var l2;
  1.3990 +                var tok;
  1.3991 +                var tail1129;
  1.3992 +                var L1125;
  1.3993 +                var goal_enders;
  1.3994 +                var BgL_sc_statesza2_30za2;
  1.3995 +                var BgL_sc_nbzd2nts_31zd2;
  1.3996 +                var BgL_sc_nbzd2confs_32zd2;
  1.3997 +                var nb_toks;
  1.3998 +                var goal_starters;
  1.3999 +                var sc_states_33;
  1.4000 +                var BgL_sc_nbzd2confs_34zd2;
  1.4001 +                var BgL_sc_nbzd2toks_35zd2;
  1.4002 +                var sc_toks_36;
  1.4003 +                var falseHead1128;
  1.4004 +                var sc_names_37;
  1.4005 +                var sc_steps_38;
  1.4006 +                var sc_predictors_39;
  1.4007 +                var sc_enders_40;
  1.4008 +                var sc_starters_41;
  1.4009 +                var sc_nts_42;
  1.4010 +                var lexer;
  1.4011 +                var sc_ind_43;
  1.4012 +                var make_states;
  1.4013 +                var BgL_sc_confzd2setzd2getza2_44za2;
  1.4014 +                var conf_set_merge_new_bang;
  1.4015 +                var conf_set_adjoin;
  1.4016 +                var BgL_sc_confzd2setzd2adjoinza2_45za2;
  1.4017 +                var BgL_sc_confzd2setzd2adjoinza2za2_46z00;
  1.4018 +                var conf_set_union;
  1.4019 +                var forw;
  1.4020 +                var is_parsed;
  1.4021 +                var deriv_trees;
  1.4022 +                var BgL_sc_derivzd2treesza2_47z70;
  1.4023 +                var nb_deriv_trees;
  1.4024 +                var BgL_sc_nbzd2derivzd2treesza2_48za2;
  1.4025 +                {
  1.4026 +                    sc_ind_43 = function(nt, sc_nts_49) {
  1.4027 +                        var i;
  1.4028 +                        {
  1.4029 +                            (i = ((sc_nts_49.length)-(1)));
  1.4030 +                            while (true) {
  1.4031 +                                if ((i>=(0)))
  1.4032 +                                    if ((sc_isEqual((sc_nts_49[i]), nt)))
  1.4033 +                                        return i;
  1.4034 +                                    else
  1.4035 +                                        (--i);
  1.4036 +                                else
  1.4037 +                                    return false;
  1.4038 +                            }
  1.4039 +                        }
  1.4040 +                    };
  1.4041 +                    make_states = function(BgL_sc_nbzd2toks_50zd2, BgL_sc_nbzd2confs_51zd2) {
  1.4042 +                        var v;
  1.4043 +                        var i;
  1.4044 +                        var sc_states_52;
  1.4045 +                        {
  1.4046 +                            (sc_states_52 = (sc_makeVector((BgL_sc_nbzd2toks_50zd2+(1)), false)));
  1.4047 +                            (i = BgL_sc_nbzd2toks_50zd2);
  1.4048 +                            while ((i>=(0))) {
  1.4049 +                                {
  1.4050 +                                    (v = (sc_makeVector((BgL_sc_nbzd2confs_51zd2+(1)), false)));
  1.4051 +                                    (v[(0)] = (-1));
  1.4052 +                                    (sc_states_52[i] = v);
  1.4053 +                                    (--i);
  1.4054 +                                }
  1.4055 +                            }
  1.4056 +                            return sc_states_52;
  1.4057 +                        }
  1.4058 +                    };
  1.4059 +                    BgL_sc_confzd2setzd2getza2_44za2 = function(state, BgL_sc_statezd2num_53zd2, sc_conf_54) {
  1.4060 +                        var conf_set;
  1.4061 +                        var BgL_sc_confzd2set_55zd2;
  1.4062 +                        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)));
  1.4063 +                    };
  1.4064 +                    conf_set_merge_new_bang = function(conf_set) {
  1.4065 +                        return ((conf_set[((conf_set[(1)])+(5))] = (conf_set[(4)])), (conf_set[(1)] = (conf_set[(3)])), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1)));
  1.4066 +                    };
  1.4067 +                    conf_set_adjoin = function(state, conf_set, sc_conf_56, i) {
  1.4068 +                        var tail;
  1.4069 +                        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));
  1.4070 +                    };
  1.4071 +                    BgL_sc_confzd2setzd2adjoinza2_45za2 = function(sc_states_57, BgL_sc_statezd2num_58zd2, l, i) {
  1.4072 +                        var conf_set;
  1.4073 +                        var sc_conf_59;
  1.4074 +                        var l1;
  1.4075 +                        var state;
  1.4076 +                        {
  1.4077 +                            (state = (sc_states_57[BgL_sc_statezd2num_58zd2]));
  1.4078 +                            (l1 = l);
  1.4079 +                            while ((l1 instanceof sc_Pair)) {
  1.4080 +                                {
  1.4081 +                                    (sc_conf_59 = (l1.car));
  1.4082 +                                    (conf_set = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_58zd2, sc_conf_59)));
  1.4083 +                                    if (((conf_set[(i+(5))])=== false))
  1.4084 +                                        {
  1.4085 +                                            (conf_set_adjoin(state, conf_set, sc_conf_59, i));
  1.4086 +                                            (l1 = (l1.cdr));
  1.4087 +                                        }
  1.4088 +                                    else
  1.4089 +                                        (l1 = (l1.cdr));
  1.4090 +                                }
  1.4091 +                            }
  1.4092 +                            return undefined;
  1.4093 +                        }
  1.4094 +                    };
  1.4095 +                    BgL_sc_confzd2setzd2adjoinza2za2_46z00 = function(sc_states_60, BgL_sc_statesza2_61za2, BgL_sc_statezd2num_62zd2, sc_conf_63, i) {
  1.4096 +                        var BgL_sc_confzd2setza2_64z70;
  1.4097 +                        var BgL_sc_stateza2_65za2;
  1.4098 +                        var conf_set;
  1.4099 +                        var state;
  1.4100 +                        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));
  1.4101 +                    };
  1.4102 +                    conf_set_union = function(state, conf_set, sc_conf_66, other_set) {
  1.4103 +                        var i;
  1.4104 +                        {
  1.4105 +                            (i = (other_set[(2)]));
  1.4106 +                            while ((i>=(0))) {
  1.4107 +                                if (((conf_set[(i+(5))])=== false))
  1.4108 +                                    {
  1.4109 +                                        (conf_set_adjoin(state, conf_set, sc_conf_66, i));
  1.4110 +                                        (i = (other_set[(i+(5))]));
  1.4111 +                                    }
  1.4112 +                                else
  1.4113 +                                    (i = (other_set[(i+(5))]));
  1.4114 +                            }
  1.4115 +                            return undefined;
  1.4116 +                        }
  1.4117 +                    };
  1.4118 +                    forw = function(sc_states_67, BgL_sc_statezd2num_68zd2, sc_starters_69, sc_enders_70, sc_predictors_71, sc_steps_72, sc_nts_73) {
  1.4119 +                        var next_set;
  1.4120 +                        var next;
  1.4121 +                        var conf_set;
  1.4122 +                        var ender;
  1.4123 +                        var l;
  1.4124 +                        var starter_set;
  1.4125 +                        var starter;
  1.4126 +                        var sc_l_74;
  1.4127 +                        var sc_loop1_75;
  1.4128 +                        var head;
  1.4129 +                        var BgL_sc_confzd2set_76zd2;
  1.4130 +                        var BgL_sc_statezd2num_77zd2;
  1.4131 +                        var state;
  1.4132 +                        var sc_states_78;
  1.4133 +                        var preds;
  1.4134 +                        var BgL_sc_confzd2set_79zd2;
  1.4135 +                        var step;
  1.4136 +                        var sc_conf_80;
  1.4137 +                        var BgL_sc_nbzd2nts_81zd2;
  1.4138 +                        var sc_state_82;
  1.4139 +                        {
  1.4140 +                            (sc_state_82 = (sc_states_67[BgL_sc_statezd2num_68zd2]));
  1.4141 +                            (BgL_sc_nbzd2nts_81zd2 = (sc_nts_73.length));
  1.4142 +                            while (true) {
  1.4143 +                                {
  1.4144 +                                    (sc_conf_80 = (sc_state_82[(0)]));
  1.4145 +                                    if ((sc_conf_80>=(0)))
  1.4146 +                                        {
  1.4147 +                                            (step = (sc_steps_72[sc_conf_80]));
  1.4148 +                                            (BgL_sc_confzd2set_79zd2 = (sc_state_82[(sc_conf_80+(1))]));
  1.4149 +                                            (head = (BgL_sc_confzd2set_79zd2[(4)]));
  1.4150 +                                            (sc_state_82[(0)] = (BgL_sc_confzd2set_79zd2[(0)]));
  1.4151 +                                            (conf_set_merge_new_bang(BgL_sc_confzd2set_79zd2));
  1.4152 +                                            if ((step>=(0)))
  1.4153 +                                                {
  1.4154 +                                                    (sc_l_74 = (sc_starters_69[step]));
  1.4155 +                                                    while ((sc_l_74 instanceof sc_Pair)) {
  1.4156 +                                                        {
  1.4157 +                                                            (starter = (sc_l_74.car));
  1.4158 +                                                            (starter_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, starter)));
  1.4159 +                                                            if (((starter_set[(BgL_sc_statezd2num_68zd2+(5))])=== false))
  1.4160 +                                                                {
  1.4161 +                                                                    (conf_set_adjoin(sc_state_82, starter_set, starter, BgL_sc_statezd2num_68zd2));
  1.4162 +                                                                    (sc_l_74 = (sc_l_74.cdr));
  1.4163 +                                                                }
  1.4164 +                                                            else
  1.4165 +                                                                (sc_l_74 = (sc_l_74.cdr));
  1.4166 +                                                        }
  1.4167 +                                                    }
  1.4168 +                                                    (l = (sc_enders_70[step]));
  1.4169 +                                                    while ((l instanceof sc_Pair)) {
  1.4170 +                                                        {
  1.4171 +                                                            (ender = (l.car));
  1.4172 +                                                            if ((((conf_set = (sc_state_82[(ender+(1))])), ((conf_set!== false)?(conf_set[(BgL_sc_statezd2num_68zd2+(5))]):false))!== false))
  1.4173 +                                                                {
  1.4174 +                                                                    (next = (sc_conf_80+(1)));
  1.4175 +                                                                    (next_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, next)));
  1.4176 +                                                                    (conf_set_union(sc_state_82, next_set, next, BgL_sc_confzd2set_79zd2));
  1.4177 +                                                                    (l = (l.cdr));
  1.4178 +                                                                }
  1.4179 +                                                            else
  1.4180 +                                                                (l = (l.cdr));
  1.4181 +                                                        }
  1.4182 +                                                    }
  1.4183 +                                                }
  1.4184 +                                            else
  1.4185 +                                                {
  1.4186 +                                                    (preds = (sc_predictors_71[(step+BgL_sc_nbzd2nts_81zd2)]));
  1.4187 +                                                    (sc_states_78 = sc_states_67);
  1.4188 +                                                    (state = sc_state_82);
  1.4189 +                                                    (BgL_sc_statezd2num_77zd2 = BgL_sc_statezd2num_68zd2);
  1.4190 +                                                    (BgL_sc_confzd2set_76zd2 = BgL_sc_confzd2set_79zd2);
  1.4191 +                                                    sc_loop1_75 = function(l) {
  1.4192 +                                                        var sc_state_83;
  1.4193 +                                                        var BgL_sc_nextzd2set_84zd2;
  1.4194 +                                                        var sc_next_85;
  1.4195 +                                                        var pred_set;
  1.4196 +                                                        var i;
  1.4197 +                                                        var pred;
  1.4198 +                                                        if ((l instanceof sc_Pair))
  1.4199 +                                                            {
  1.4200 +                                                                (pred = (l.car));
  1.4201 +                                                                (i = head);
  1.4202 +                                                                while ((i>=(0))) {
  1.4203 +                                                                    {
  1.4204 +                                                                        (pred_set = ((sc_state_83 = (sc_states_78[i])), (sc_state_83[(pred+(1))])));
  1.4205 +                                                                        if ((pred_set!== false))
  1.4206 +                                                                            {
  1.4207 +                                                                                (sc_next_85 = (pred+(1)));
  1.4208 +                                                                                (BgL_sc_nextzd2set_84zd2 = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_77zd2, sc_next_85)));
  1.4209 +                                                                                (conf_set_union(state, BgL_sc_nextzd2set_84zd2, sc_next_85, pred_set));
  1.4210 +                                                                            }
  1.4211 +                                                                        (i = (BgL_sc_confzd2set_76zd2[(i+(5))]));
  1.4212 +                                                                    }
  1.4213 +                                                                }
  1.4214 +                                                                return (sc_loop1_75((l.cdr)));
  1.4215 +                                                            }
  1.4216 +                                                        else
  1.4217 +                                                            return undefined;
  1.4218 +                                                    };
  1.4219 +                                                    (sc_loop1_75(preds));
  1.4220 +                                                }
  1.4221 +                                        }
  1.4222 +                                    else
  1.4223 +                                        return undefined;
  1.4224 +                                }
  1.4225 +                            }
  1.4226 +                        }
  1.4227 +                    };
  1.4228 +                    is_parsed = function(nt, i, j, sc_nts_86, sc_enders_87, sc_states_88) {
  1.4229 +                        var conf_set;
  1.4230 +                        var state;
  1.4231 +                        var sc_conf_89;
  1.4232 +                        var l;
  1.4233 +                        var BgL_sc_ntza2_90za2;
  1.4234 +                        {
  1.4235 +                            (BgL_sc_ntza2_90za2 = (sc_ind_43(nt, sc_nts_86)));
  1.4236 +                            if ((BgL_sc_ntza2_90za2!== false))
  1.4237 +                                {
  1.4238 +                                    (sc_nts_86.length);
  1.4239 +                                    (l = (sc_enders_87[BgL_sc_ntza2_90za2]));
  1.4240 +                                    while (true) {
  1.4241 +                                        if ((l instanceof sc_Pair))
  1.4242 +                                            {
  1.4243 +                                                (sc_conf_89 = (l.car));
  1.4244 +                                                if ((((state = (sc_states_88[j])), (conf_set = (state[(sc_conf_89+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))
  1.4245 +                                                    return true;
  1.4246 +                                                else
  1.4247 +                                                    (l = (l.cdr));
  1.4248 +                                            }
  1.4249 +                                        else
  1.4250 +                                            return false;
  1.4251 +                                    }
  1.4252 +                                }
  1.4253 +                            else
  1.4254 +                                return false;
  1.4255 +                        }
  1.4256 +                    };
  1.4257 +                    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) {
  1.4258 +                        var sc_loop1_98;
  1.4259 +                        var prev;
  1.4260 +                        var name;
  1.4261 +                        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) {
  1.4262 +                            var loop2;
  1.4263 +                            var ender_set;
  1.4264 +                            var state;
  1.4265 +                            var ender;
  1.4266 +                            var l1;
  1.4267 +                            var l2;
  1.4268 +                            while (true) {
  1.4269 +                                if ((l1 instanceof sc_Pair))
  1.4270 +                                    {
  1.4271 +                                        (ender = (l1.car));
  1.4272 +                                        (ender_set = ((state = (sc_states_96[j])), (state[(ender+(1))])));
  1.4273 +                                        if ((ender_set!== false))
  1.4274 +                                            {
  1.4275 +                                                loop2 = function(k, l2) {
  1.4276 +                                                    var loop3;
  1.4277 +                                                    var ender_trees;
  1.4278 +                                                    var prev_trees;
  1.4279 +                                                    var conf_set;
  1.4280 +                                                    var sc_state_99;
  1.4281 +                                                    var k;
  1.4282 +                                                    var l2;
  1.4283 +                                                    while (true) {
  1.4284 +                                                        if ((k>=(0)))
  1.4285 +                                                            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)))
  1.4286 +                                                                {
  1.4287 +                                                                    (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)));
  1.4288 +                                                                    (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)));
  1.4289 +                                                                    loop3 = function(l3, l2) {
  1.4290 +                                                                        var l4;
  1.4291 +                                                                        var sc_l2_100;
  1.4292 +                                                                        var ender_tree;
  1.4293 +                                                                        if ((l3 instanceof sc_Pair))
  1.4294 +                                                                            {
  1.4295 +                                                                                (ender_tree = (sc_list((l3.car))));
  1.4296 +                                                                                (l4 = prev_trees);
  1.4297 +                                                                                (sc_l2_100 = l2);
  1.4298 +                                                                                while ((l4 instanceof sc_Pair)) {
  1.4299 +                                                                                    {
  1.4300 +                                                                                        (sc_l2_100 = (new sc_Pair((sc_append((l4.car), ender_tree)), sc_l2_100)));
  1.4301 +                                                                                        (l4 = (l4.cdr));
  1.4302 +                                                                                    }
  1.4303 +                                                                                }
  1.4304 +                                                                                return (loop3((l3.cdr), sc_l2_100));
  1.4305 +                                                                            }
  1.4306 +                                                                        else
  1.4307 +                                                                            return (loop2((ender_set[(k+(5))]), l2));
  1.4308 +                                                                    };
  1.4309 +                                                                    return (loop3(ender_trees, l2));
  1.4310 +                                                                }
  1.4311 +                                                            else
  1.4312 +                                                                (k = (ender_set[(k+(5))]));
  1.4313 +                                                        else
  1.4314 +                                                            return (sc_loop1_98((l1.cdr), l2));
  1.4315 +                                                    }
  1.4316 +                                                };
  1.4317 +                                                return (loop2((ender_set[(2)]), l2));
  1.4318 +                                            }
  1.4319 +                                        else
  1.4320 +                                            (l1 = (l1.cdr));
  1.4321 +                                    }
  1.4322 +                                else
  1.4323 +                                    return l2;
  1.4324 +                            }
  1.4325 +                        }), (sc_loop1_98((sc_enders_92[(sc_steps_93[prev])]), null)))));
  1.4326 +                    };
  1.4327 +                    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) {
  1.4328 +                        var conf_set;
  1.4329 +                        var state;
  1.4330 +                        var sc_conf_107;
  1.4331 +                        var l;
  1.4332 +                        var trees;
  1.4333 +                        var BgL_sc_nbzd2nts_108zd2;
  1.4334 +                        var BgL_sc_ntza2_109za2;
  1.4335 +                        {
  1.4336 +                            (BgL_sc_ntza2_109za2 = (sc_ind_43(nt, sc_nts_101)));
  1.4337 +                            if ((BgL_sc_ntza2_109za2!== false))
  1.4338 +                                {
  1.4339 +                                    (BgL_sc_nbzd2nts_108zd2 = (sc_nts_101.length));
  1.4340 +                                    (l = (sc_enders_102[BgL_sc_ntza2_109za2]));
  1.4341 +                                    (trees = null);
  1.4342 +                                    while ((l instanceof sc_Pair)) {
  1.4343 +                                        {
  1.4344 +                                            (sc_conf_107 = (l.car));
  1.4345 +                                            if ((((state = (sc_states_106[j])), (conf_set = (state[(sc_conf_107+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))
  1.4346 +                                                {
  1.4347 +                                                    (l = (l.cdr));
  1.4348 +                                                    (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)));
  1.4349 +                                                }
  1.4350 +                                            else
  1.4351 +                                                (l = (l.cdr));
  1.4352 +                                        }
  1.4353 +                                    }
  1.4354 +                                    return trees;
  1.4355 +                                }
  1.4356 +                            else
  1.4357 +                                return false;
  1.4358 +                        }
  1.4359 +                    };
  1.4360 +                    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) {
  1.4361 +                        var sc_loop1_116;
  1.4362 +                        var tmp1124;
  1.4363 +                        var prev;
  1.4364 +                        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) {
  1.4365 +                            var nb_ender_trees;
  1.4366 +                            var nb_prev_trees;
  1.4367 +                            var conf_set;
  1.4368 +                            var state;
  1.4369 +                            var k;
  1.4370 +                            var n;
  1.4371 +                            var ender_set;
  1.4372 +                            var sc_state_117;
  1.4373 +                            var ender;
  1.4374 +                            var l;
  1.4375 +                            var sc_n_118;
  1.4376 +                            while (true) {
  1.4377 +                                if ((l instanceof sc_Pair))
  1.4378 +                                    {
  1.4379 +                                        (ender = (l.car));
  1.4380 +                                        (ender_set = ((sc_state_117 = (sc_states_114[j])), (sc_state_117[(ender+(1))])));
  1.4381 +                                        if ((ender_set!== false))
  1.4382 +                                            {
  1.4383 +                                                (k = (ender_set[(2)]));
  1.4384 +                                                (n = sc_n_118);
  1.4385 +                                                while ((k>=(0))) {
  1.4386 +                                                    if (((k>=i)&&(((state = (sc_states_114[k])), (conf_set = (state[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)))
  1.4387 +                                                        {
  1.4388 +                                                            (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)));
  1.4389 +                                                            (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)));
  1.4390 +                                                            (k = (ender_set[(k+(5))]));
  1.4391 +                                                            (n +=(nb_prev_trees*nb_ender_trees));
  1.4392 +                                                        }
  1.4393 +                                                    else
  1.4394 +                                                        (k = (ender_set[(k+(5))]));
  1.4395 +                                                }
  1.4396 +                                                return (sc_loop1_116((l.cdr), n));
  1.4397 +                                            }
  1.4398 +                                        else
  1.4399 +                                            (l = (l.cdr));
  1.4400 +                                    }
  1.4401 +                                else
  1.4402 +                                    return sc_n_118;
  1.4403 +                            }
  1.4404 +                        }), (sc_loop1_116((sc_enders_111[(sc_steps_112[prev])]), (0))))));
  1.4405 +                    };
  1.4406 +                    BgL_sc_nbzd2derivzd2treesza2_48za2 = function(nt, i, j, sc_nts_119, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123) {
  1.4407 +                        var conf_set;
  1.4408 +                        var state;
  1.4409 +                        var sc_conf_124;
  1.4410 +                        var l;
  1.4411 +                        var nb_trees;
  1.4412 +                        var BgL_sc_nbzd2nts_125zd2;
  1.4413 +                        var BgL_sc_ntza2_126za2;
  1.4414 +                        {
  1.4415 +                            (BgL_sc_ntza2_126za2 = (sc_ind_43(nt, sc_nts_119)));
  1.4416 +                            if ((BgL_sc_ntza2_126za2!== false))
  1.4417 +                                {
  1.4418 +                                    (BgL_sc_nbzd2nts_125zd2 = (sc_nts_119.length));
  1.4419 +                                    (l = (sc_enders_120[BgL_sc_ntza2_126za2]));
  1.4420 +                                    (nb_trees = (0));
  1.4421 +                                    while ((l instanceof sc_Pair)) {
  1.4422 +                                        {
  1.4423 +                                            (sc_conf_124 = (l.car));
  1.4424 +                                            if ((((state = (sc_states_123[j])), (conf_set = (state[(sc_conf_124+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))
  1.4425 +                                                {
  1.4426 +                                                    (l = (l.cdr));
  1.4427 +                                                    (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));
  1.4428 +                                                }
  1.4429 +                                            else
  1.4430 +                                                (l = (l.cdr));
  1.4431 +                                        }
  1.4432 +                                    }
  1.4433 +                                    return nb_trees;
  1.4434 +                                }
  1.4435 +                            else
  1.4436 +                                return false;
  1.4437 +                        }
  1.4438 +                    };
  1.4439 +                    (lexer = (parser_descr[(0)]));
  1.4440 +                    (sc_nts_42 = (parser_descr[(1)]));
  1.4441 +                    (sc_starters_41 = (parser_descr[(2)]));
  1.4442 +                    (sc_enders_40 = (parser_descr[(3)]));
  1.4443 +                    (sc_predictors_39 = (parser_descr[(4)]));
  1.4444 +                    (sc_steps_38 = (parser_descr[(5)]));
  1.4445 +                    (sc_names_37 = (parser_descr[(6)]));
  1.4446 +                    (falseHead1128 = (new sc_Pair(null, null)));
  1.4447 +                    (L1125 = (lexer(input)));
  1.4448 +                    (tail1129 = falseHead1128);
  1.4449 +                    while (!(L1125 === null)) {
  1.4450 +                        {
  1.4451 +                            (tok = (L1125.car));
  1.4452 +                            (l1 = (tok.cdr));
  1.4453 +                            (l2 = null);
  1.4454 +                            while ((l1 instanceof sc_Pair)) {
  1.4455 +                                {
  1.4456 +                                    (sc_i_29 = (sc_ind_43((l1.car), sc_nts_42)));
  1.4457 +                                    if ((sc_i_29!== false))
  1.4458 +                                        {
  1.4459 +                                            (l1 = (l1.cdr));
  1.4460 +                                            (l2 = (new sc_Pair(sc_i_29, l2)));
  1.4461 +                                        }
  1.4462 +                                    else
  1.4463 +                                        (l1 = (l1.cdr));
  1.4464 +                                }
  1.4465 +                            }
  1.4466 +                            (sc_optrOpnd_22 = (new sc_Pair((tok.car), (sc_reverse(l2)))));
  1.4467 +                            (sc_optrOpnd_21 = (new sc_Pair(sc_optrOpnd_22, null)));
  1.4468 +                            (tail1129.cdr = sc_optrOpnd_21);
  1.4469 +                            (tail1129 = (tail1129.cdr));
  1.4470 +                            (L1125 = (L1125.cdr));
  1.4471 +                        }
  1.4472 +                    }
  1.4473 +                    (sc_optrOpnd_20 = (falseHead1128.cdr));
  1.4474 +                    (sc_toks_36 = (sc_list2vector(sc_optrOpnd_20)));
  1.4475 +                    (BgL_sc_nbzd2toks_35zd2 = (sc_toks_36.length));
  1.4476 +                    (BgL_sc_nbzd2confs_34zd2 = (sc_steps_38.length));
  1.4477 +                    (sc_states_33 = (make_states(BgL_sc_nbzd2toks_35zd2, BgL_sc_nbzd2confs_34zd2)));
  1.4478 +                    (goal_starters = (sc_starters_41[(0)]));
  1.4479 +                    (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (0), goal_starters, (0)));
  1.4480 +                    (forw(sc_states_33, (0), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42));
  1.4481 +                    (sc_i_28 = (0));
  1.4482 +                    while ((sc_i_28<BgL_sc_nbzd2toks_35zd2)) {
  1.4483 +                        {
  1.4484 +                            (tok_nts = ((sc_toks_36[sc_i_28]).cdr));
  1.4485 +                            (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (sc_i_28+(1)), tok_nts, sc_i_28));
  1.4486 +                            (forw(sc_states_33, (sc_i_28+(1)), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42));
  1.4487 +                            (++sc_i_28);
  1.4488 +                        }
  1.4489 +                    }
  1.4490 +                    (nb_toks = (sc_toks_36.length));
  1.4491 +                    (BgL_sc_nbzd2confs_32zd2 = (sc_steps_38.length));
  1.4492 +                    (BgL_sc_nbzd2nts_31zd2 = (sc_nts_42.length));
  1.4493 +                    (BgL_sc_statesza2_30za2 = (make_states(nb_toks, BgL_sc_nbzd2confs_32zd2)));
  1.4494 +                    (goal_enders = (sc_enders_40[(0)]));
  1.4495 +                    (l = goal_enders);
  1.4496 +                    while ((l instanceof sc_Pair)) {
  1.4497 +                        {
  1.4498 +                            (conf = (l.car));
  1.4499 +                            (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_33, BgL_sc_statesza2_30za2, nb_toks, conf, (0)));
  1.4500 +                            (l = (l.cdr));
  1.4501 +                        }
  1.4502 +                    }
  1.4503 +                    (i = nb_toks);
  1.4504 +                    while ((i>=(0))) {
  1.4505 +                        {
  1.4506 +                            (states = sc_states_33);
  1.4507 +                            (BgL_sc_statesza2_27za2 = BgL_sc_statesza2_30za2);
  1.4508 +                            (state_num = i);
  1.4509 +                            (sc_enders_26 = sc_enders_40);
  1.4510 +                            (sc_steps_25 = sc_steps_38);
  1.4511 +                            (BgL_sc_nbzd2nts_24zd2 = BgL_sc_nbzd2nts_31zd2);
  1.4512 +                            (toks = sc_toks_36);
  1.4513 +                            (BgL_sc_stateza2_23za2 = (BgL_sc_statesza2_30za2[i]));
  1.4514 +                            loop1 = function() {
  1.4515 +                                var sc_loop1_127;
  1.4516 +                                var prev;
  1.4517 +                                var BgL_sc_statesza2_128za2;
  1.4518 +                                var sc_states_129;
  1.4519 +                                var j;
  1.4520 +                                var i;
  1.4521 +                                var sc_i_130;
  1.4522 +                                var head;
  1.4523 +                                var conf_set;
  1.4524 +                                var sc_conf_131;
  1.4525 +                                {
  1.4526 +                                    (sc_conf_131 = (BgL_sc_stateza2_23za2[(0)]));
  1.4527 +                                    if ((sc_conf_131>=(0)))
  1.4528 +                                        {
  1.4529 +                                            (conf_set = (BgL_sc_stateza2_23za2[(sc_conf_131+(1))]));
  1.4530 +                                            (head = (conf_set[(4)]));
  1.4531 +                                            (BgL_sc_stateza2_23za2[(0)] = (conf_set[(0)]));
  1.4532 +                                            (conf_set_merge_new_bang(conf_set));
  1.4533 +                                            (sc_i_130 = head);
  1.4534 +                                            while ((sc_i_130>=(0))) {
  1.4535 +                                                {
  1.4536 +                                                    (i = sc_i_130);
  1.4537 +                                                    (j = state_num);
  1.4538 +                                                    (sc_states_129 = states);
  1.4539 +                                                    (BgL_sc_statesza2_128za2 = BgL_sc_statesza2_27za2);
  1.4540 +                                                    (prev = (sc_conf_131-(1)));
  1.4541 +                                                    if (((sc_conf_131>=BgL_sc_nbzd2nts_24zd2)&&((sc_steps_25[prev])>=(0))))
  1.4542 +                                                        {
  1.4543 +                                                            sc_loop1_127 = function(l) {
  1.4544 +                                                                var k;
  1.4545 +                                                                var ender_set;
  1.4546 +                                                                var state;
  1.4547 +                                                                var ender;
  1.4548 +                                                                var l;
  1.4549 +                                                                while (true) {
  1.4550 +                                                                    if ((l instanceof sc_Pair))
  1.4551 +                                                                        {
  1.4552 +                                                                            (ender = (l.car));
  1.4553 +                                                                            (ender_set = ((state = (sc_states_129[j])), (state[(ender+(1))])));
  1.4554 +                                                                            if ((ender_set!== false))
  1.4555 +                                                                                {
  1.4556 +                                                                                    (k = (ender_set[(2)]));
  1.4557 +                                                                                    while ((k>=(0))) {
  1.4558 +                                                                                        {
  1.4559 +                                                                                            if ((k>=i))
  1.4560 +                                                                                                if (((BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, k, prev, i))!== false))
  1.4561 +                                                                                                    (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, j, ender, k));
  1.4562 +                                                                                            (k = (ender_set[(k+(5))]));
  1.4563 +                                                                                        }
  1.4564 +                                                                                    }
  1.4565 +                                                                                    return (sc_loop1_127((l.cdr)));
  1.4566 +                                                                                }
  1.4567 +                                                                            else
  1.4568 +                                                                                (l = (l.cdr));
  1.4569 +                                                                        }
  1.4570 +                                                                    else
  1.4571 +                                                                        return undefined;
  1.4572 +                                                                }
  1.4573 +                                                            };
  1.4574 +                                                            (sc_loop1_127((sc_enders_26[(sc_steps_25[prev])])));
  1.4575 +                                                        }
  1.4576 +                                                    (sc_i_130 = (conf_set[(sc_i_130+(5))]));
  1.4577 +                                                }
  1.4578 +                                            }
  1.4579 +                                            return (loop1());
  1.4580 +                                        }
  1.4581 +                                    else
  1.4582 +                                        return undefined;
  1.4583 +                                }
  1.4584 +                            };
  1.4585 +                            (loop1());
  1.4586 +                            (--i);
  1.4587 +                        }
  1.4588 +                    }
  1.4589 +                    (optrOpnd = BgL_sc_statesza2_30za2);
  1.4590 +                    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];
  1.4591 +                }
  1.4592 +            };
  1.4593 +        }
  1.4594 +    };
  1.4595 +    BgL_parsezd2ze3parsedzf3zc2 = function(parse, nt, i, j) {
  1.4596 +        var is_parsed;
  1.4597 +        var states;
  1.4598 +        var enders;
  1.4599 +        var nts;
  1.4600 +        return ((nts = (parse[(0)])), (enders = (parse[(2)])), (states = (parse[(7)])), (is_parsed = (parse[(8)])), (is_parsed(nt, i, j, nts, enders, states)));
  1.4601 +    };
  1.4602 +    BgL_parsezd2ze3treesz31 = function(parse, nt, i, j) {
  1.4603 +        var BgL_sc_derivzd2treesza2_132z70;
  1.4604 +        var states;
  1.4605 +        var toks;
  1.4606 +        var names;
  1.4607 +        var steps;
  1.4608 +        var enders;
  1.4609 +        var nts;
  1.4610 +        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)));
  1.4611 +    };
  1.4612 +    BgL_parsezd2ze3nbzd2treesze3 = function(parse, nt, i, j) {
  1.4613 +        var BgL_sc_nbzd2derivzd2treesza2_133za2;
  1.4614 +        var states;
  1.4615 +        var toks;
  1.4616 +        var steps;
  1.4617 +        var enders;
  1.4618 +        var nts;
  1.4619 +        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)));
  1.4620 +    };
  1.4621 +    test = function(k) {
  1.4622 +        var x;
  1.4623 +        var p;
  1.4624 +        return ((p = (BgL_makezd2parserzd2(const_earley, function(l) {
  1.4625 +            var sc_x_134;
  1.4626 +            var tail1134;
  1.4627 +            var L1130;
  1.4628 +            var falseHead1133;
  1.4629 +            {
  1.4630 +                (falseHead1133 = (new sc_Pair(null, null)));
  1.4631 +                (tail1134 = falseHead1133);
  1.4632 +                (L1130 = l);
  1.4633 +                while (!(L1130 === null)) {
  1.4634 +                    {
  1.4635 +                        (tail1134.cdr = (new sc_Pair(((sc_x_134 = (L1130.car)), (sc_list(sc_x_134, sc_x_134))), null)));
  1.4636 +                        (tail1134 = (tail1134.cdr));
  1.4637 +                        (L1130 = (L1130.cdr));
  1.4638 +                    }
  1.4639 +                }
  1.4640 +                return (falseHead1133.cdr);
  1.4641 +            }
  1.4642 +        }))), (x = (p((sc_vector2list((sc_makeVector(k, "\u1E9Ca"))))))), (sc_length((BgL_parsezd2ze3treesz31(x, "\u1E9Cs", (0), k)))));
  1.4643 +    };
  1.4644 +    BgL_earleyzd2benchmarkzd2 = function() {
  1.4645 +        var args = null;
  1.4646 +        for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) {
  1.4647 +            args = sc_cons(arguments[sc_tmp], args);
  1.4648 +        }
  1.4649 +        var k;
  1.4650 +        return ((k = ((args === null)?(7):(args.car))), (BgL_runzd2benchmarkzd2("earley", (1), function() {
  1.4651 +            return (test(k));
  1.4652 +        }, function(result) {
  1.4653 +            return ((sc_display(result)), (sc_newline()), result == 132);
  1.4654 +        })));
  1.4655 +    };
  1.4656 +}
  1.4657 +
  1.4658 +
  1.4659 +/************* END OF GENERATED CODE *************/
  1.4660 +// Invoke this function to run a benchmark.
  1.4661 +// The first argument is a string identifying the benchmark.
  1.4662 +// The second argument is the number of times to run the benchmark.
  1.4663 +// The third argument is a function that runs the benchmark.
  1.4664 +// The fourth argument is a unary function that warns if the result
  1.4665 +// returned by the benchmark is incorrect.
  1.4666 +//
  1.4667 +// Example:
  1.4668 +// RunBenchmark("new Array()",
  1.4669 +//              1,
  1.4670 +//              function () { new Array(1000000); }
  1.4671 +//              function (v) {
  1.4672 +//                return (v instanceof Array) && (v.length == 1000000);
  1.4673 +//              });
  1.4674 +
  1.4675 +SC_DEFAULT_OUT = new sc_GenericOutputPort(function(s) {});
  1.4676 +SC_ERROR_OUT = SC_DEFAULT_OUT;
  1.4677 +
  1.4678 +function RunBenchmark(name, count, run, warn) {
  1.4679 +  for (var n = 0; n < count; ++n) {
  1.4680 +    result = run();
  1.4681 +    if (!warn(result)) {
  1.4682 +      throw new Error("Earley or Boyer did incorrect number of rewrites");
  1.4683 +    }
  1.4684 +  }
  1.4685 +}
  1.4686 +
  1.4687 +var BgL_runzd2benchmarkzd2 = RunBenchmark;

mercurial