- 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)));