- this.to_string_funct = function () {
- if (this.body.to_string_funct) {
- return this.bound.to_string() + " " + this.body.to_string_funct();
+ this.to_dotted = function () {
+ if (this.body.to_dotted) {
+ return this.bound.to_string() + " " + this.body.to_dotted();
return expr.eval_cbv(cbv > 1);
} else {
// return expr.eval_loop([], eta);
return expr.eval_cbv(cbv > 1);
} else {
// return expr.eval_loop([], eta);
var to_eval = expr, res = [[], eta];
while (to_eval !== null) {
res = to_eval.eval_loop.apply(to_eval, res);
var to_eval = expr, res = [[], eta];
while (to_eval !== null) {
res = to_eval.eval_loop.apply(to_eval, res);
- if (isBindingForm(tree))
- return (new cons (tree.car,
+ if (isBindingForm(tree))
+ return (new cons (tree.car,
if (isConvertable(tree)) {
return (sub(tree.car.cdr.cdr.car, tree.car.cdr.car.cdr, tree.cdr.car));}
else return(tree);
if (isConvertable(tree)) {
return (sub(tree.car.cdr.cdr.car, tree.car.cdr.car.cdr, tree.cdr.car));}
else return(tree);
// Is of form (lambda var body)?
function isBindingForm(tree) {
if (tree == null) return (false);
if (tree.car == null) return (false);
if (tree.car.car != null) return (false);
// Is of form (lambda var body)?
function isBindingForm(tree) {
if (tree == null) return (false);
if (tree.car == null) return (false);
if (tree.car.car != null) return (false);
&& (tree.car.cdr != "let")
&& (tree.car.cdr != "exists")
&& (tree.car.cdr != "forall")
&& (tree.car.cdr != "let")
&& (tree.car.cdr != "exists")
&& (tree.car.cdr != "forall")
function treeToString(tree) {
if (tree == null) return ("")
if (tree.car == null) return (tree.cdr)
function treeToString(tree) {
if (tree == null) return ("")
if (tree.car == null) return (tree.cdr)
return (treeToString(tree.car) + " " + treeToString(tree.cdr))
return ("(" + treeToString(tree.car) + ")" + treeToString(tree.cdr))
}
return (treeToString(tree.car) + " " + treeToString(tree.cdr))
return ("(" + treeToString(tree.car) + ")" + treeToString(tree.cdr))
}
function treeToStringRaw(tree) {
if (tree == null) return ("@")
if (typeof(tree) == "string") return (tree);
function treeToStringRaw(tree) {
if (tree == null) return ("@")
if (typeof(tree) == "string") return (tree);
i = 0;
form.result.value = formatTree((stringToTree(form.input.value)));
// form.result.value = formatTree(fixedPoint(stringToTree(form.input.value)));
i = 0;
form.result.value = formatTree((stringToTree(form.input.value)));
// form.result.value = formatTree(fixedPoint(stringToTree(form.input.value)));