diff --git a/changelog b/changelog index 903092c..cce7da1 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,6 @@ +20091028 tpd src/axiom-website/patches.html 20091028.04.tpd.patch +20091028 tpd src/input/Makefile add finitegraph.input +20091028 tpd src/input/finitegraph.input added 20091028 tpd src/axiom-website/patches.html 20091028.03.tpd.patch 20091028 tpd src/input/Makefile add newtonlisp.input 20091028 tpd src/input/newtonlisp.input added diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index 526219a..e0493a9 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -2185,5 +2185,7 @@ src/input/cachedf.input added
src/input/nonlinhomodiffeq.input added
20091028.03.tpd.patch src/input/newtonlisp.input added
+20091028.04.tpd.patch +src/input/finitegraph.input added
diff --git a/src/input/Makefile.pamphlet b/src/input/Makefile.pamphlet index 7835c49..4412128 100644 --- a/src/input/Makefile.pamphlet +++ b/src/input/Makefile.pamphlet @@ -315,7 +315,8 @@ REGRES= algaggr.regress algbrbf.regress algfacob.regress alist.regress \ expexpan.regress explim.regress expr1.regress exprode.regress \ expr.regress exseries.regress exsum.regress exprpoly.regress \ farray.regress ffdemo.regress fferr.regress ffx72.regress \ - fib.regress file.regress fixed.regress \ + fib.regress finitegraph.regress \ + file.regress fixed.regress \ float1.regress float2.regress \ float.regress fname1.regress fname.regress fnla.regress \ fns.regress fparfrac.regress fparfrc.regress \ @@ -593,7 +594,8 @@ FILES= ${OUT}/algaggr.input ${OUT}/algbrbf.input ${OUT}/algfacob.input \ ${OUT}/expr1.input ${OUT}/exprpoly.input \ ${OUT}/farray.input ${OUT}/ffdemo.input \ ${OUT}/fferr.input ${OUT}/ffrac.input ${OUT}/ffx72.input \ - ${OUT}/fib.input ${OUT}/fixed.input \ + ${OUT}/fib.input ${OUT}/finitegraph.input \ + ${OUT}/fixed.input \ ${OUT}/file.input ${OUT}/float2.input \ ${OUT}/float.input ${OUT}/float1.input ${OUT}/fname.input \ ${OUT}/fname1.input ${OUT}/fnla.input ${OUT}/folium.input \ @@ -889,6 +891,7 @@ DOCFILES= \ ${DOC}/farray.input.dvi ${DOC}/ffdemo.input.dvi \ ${DOC}/fferr.input.dvi ${DOC}/ffrac.input.dvi \ ${DOC}/ffx72.input.dvi ${DOC}/fib.input.dvi \ + ${DOC}/finitegraph.input.dvi \ ${DOC}/file.input.dvi ${DOC}/fixed.input.dvi \ ${DOC}/float1.input.dvi ${DOC}/float2.input.dvi \ ${DOC}/float.input.dvi ${DOC}/fname1.input.dvi \ diff --git a/src/input/finitegraph.input.pamphlet b/src/input/finitegraph.input.pamphlet new file mode 100644 index 0000000..2548ed4 --- /dev/null +++ b/src/input/finitegraph.input.pamphlet @@ -0,0 +1,148 @@ +\documentclass{article} +\usepackage{axiom} +\begin{document} +\title{\$SPAD/src/input finitegraph.input} +\author{Unknown} +\maketitle +\begin{abstract} +\end{abstract} +\eject +\tableofcontents +\eject +\begin{chunk}{fgraf.spad} +)abbrev category GRAPHS GraphCategory +GraphCategory(nodes:Type, edges:Type): Category == with + source:edges->nodes + target:edges->nodes + +)abbrev domain FGRAPHS FiniteGraph +FiniteGraph(nodes: BasicType): Exports == Implementation where + edges ==> Record(source:nodes, target:nodes) + Exports == GraphCategory(nodes,edges) with + new: () -> % + addNode: (%,List nodes) -> List nodes + addNode: (%,nodes) -> List nodes + addEdge: (%,nodes,nodes) -> edges + edgeList: (%) -> List edges + nodeList: (%) -> List nodes + Implementation == add + Rep == Record(node: List nodes, edge: List edges) + + new: % == + n:List(nodes):=[] + e:List(edges):=[] + [n,e]$Rep pretend % + + addNode(g:%,n:List nodes):List nodes == + G:Rep:=g pretend Rep + if #G.node=0 then + G.node:=n + else + concat!(G.node,n) + n + + addNode(g:%,n:nodes):List nodes == addNode(g,[n]) + + addEdge(g:%,src:nodes,tar:nodes):edges == + G:Rep:=g pretend Rep + if #G.edge=0 then + G.edge:=[[src,tar]$edges] + else + concat!(G.edge,[[src,tar]$edges]) + [src,tar]$edges + + edgeList(g:%):List edges == + G:Rep:=g pretend Rep + G.edge + + nodeList(g:%):List nodes == + G:Rep:=g pretend Rep + G.node + + source(ed:edges):nodes == ed.source + target(ed:edges):nodes == ed.target + +\end{chunk} + +\begin{chunk}{*} +)set break resume +)spool finitegraph.output +)set message test on +)set message auto off +)clear all +)sys cp $AXIOM/../../src/input/finitegraph.input.pamphlet . +)lisp (tangle "finitegraph.input.pamphlet" "fgraf.spad" "fgraf.spad") +)co fgraf + +--S 1 of 8 +g:FiniteGraph(INT):=new(); +--R +--R +--R Type: FiniteGraph Integer +--E 1 + +--S 2 of 8 +addNode(g,1) +--R +--R +--R (2) [1] +--R Type: List Integer +--E 2 + +--S 3 of 8 +addNode(g,2) +--R +--R +--R (3) [2] +--R Type: List Integer +--E 3 + +--S 4 of 8 +e:=addEdge(g,1,2) +--R +--R +--R (4) [source= 1,target= 2] +--R Type: Record(source: Integer,target: Integer) +--E 4 + +--S 5 of 8 +source(e)$FiniteGraph(INT) +--R +--R +--R (5) 1 +--R Type: Integer +--E 5 + +--S 6 of 8 +target(e)$FiniteGraph(INT) +--R +--R +--R (6) 2 +--R Type: Integer +--E 6 + +--S 7 of 8 +edgeList(g) +--R +--R +--R (7) [[source= 1,target= 2]] +--R Type: List Record(source: Integer,target: Integer) +--E 7 + +--S 8 of 8 +nodeList(g) +--R +--R +--R (8) [1,2] +--R Type: List Integer +--E 8 + +)spool +)lisp (bye) + +\end{chunk} +\eject +\begin{thebibliography}{99} +\bibitem{1} http://axiom-wiki.newsynthesis.org/SandBoxCategoryOfGraphsInSPAD +\end{thebibliography} +\end{document}