Artifact 61511a059b739b3bf5740e04004c751befcd19d7bed59efa44a14f7d736c85b3:
- File
psl-1983/3-1/util/graph-tree.sl
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 889) [annotate] [blame] [check-ins using] [more...]
- File
psl-1983/util/graph-tree.sl
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 889) [annotate] [blame] [check-ins using]
% Needs USEFUL at compile time (fluid '(graph-nodes* node-index*)) (de graph-to-tree (u) (let ((graph-nodes* nil)(node-index* 0)) (graph-to-tree-1 u))) (de graph-to-tree-1 (u) (let ((x)) (cond ((not (or (pairp u) (vectorp u))) u) ((setf x (atsoc u graph-nodes*)) (when (null (cdr x)) (setf (cdr x) (incr node-index*))) (newid (bldmsg "<%w>" (cdr x)))) (t (let* ((p (ncons u)) (graph-nodes* (cons p graph-nodes*)) (v (if (vectorp u) (for (from i 0 (upbv u)) (with (v (mkvect (upbv u)))) (do (setf (getv v i) (graph-to-tree-1 (getv u i)))) (returns v)) (cons (graph-to-tree-1 (car u)) (graph-to-tree-1 (cdr u)))))) (if (cdr p) (list (newid (bldmsg "<%w>:" (cdr p))) v) v)))))) (de cprint (u) (let ((currentscantable* lispscantable*)) (prettyprint (graph-to-tree u)) nil))