Commit 8acd2a74 authored by Vincent Zweije's avatar Vincent Zweije
Browse files

This commit was generated by cvs2svn to compensate for changes in r618,

which included commits to RCS files with non-trunk default branches.
parent 26f1b3df
......@@ -2,6 +2,7 @@ definition module graph
// $Id$
from pfun import Pfun
from StdOverloaded import ==
// A rule associating a replacement with a pattern
......@@ -214,4 +215,6 @@ compilegraph :: ![(var,Node sym var)] -> Graph sym var
*/
extgraph :: (Graph sym var) (Graph sym pvar) [pvar] (Pfun pvar var) (Graph sym var) -> Graph sym var | == var & == pvar
instance == (Graph sym var) | == sym & == var
......@@ -359,22 +359,17 @@ Uses in Miranda:
`Extgraph' is excluded in most import statements,
but there doesn't seem to be any other definition of it.
> extgraph :: graph * ** -> graph * *** -> [***] -> pfun *** ** -> graph * ** -> graph * **
> extgraph sgraph pattern pnodes matching graph
> = foldr addnode graph pnodes
> where addnode pnode
> = total id (postcomp addnode' matching) pnode, if fst (nodecontents pattern pnode)
> = id, otherwise
> addnode' snode
> = updategraph snode scont, if sdef
> = id, otherwise
>|| = error "extgraph: closed node mapped to open node", otherwise
> || Could have used id, but let's report error when there is one...
> where (sdef,scont) = nodecontents sgraph snode
*/
extgraph :: (Graph sym var) (Graph sym pvar) [pvar] (Pfun pvar var) (Graph sym var) -> Graph sym var | == var & == pvar
extgraph sgraph pattern pnodes matching graph
= foldr addnode graph pnodes
where addnode pnode
= if (fst (varcontents pattern pnode)) (total id (postcomp addnode` matching) pnode) id
addnode` snode
= if sdef (updategraph snode scont) id
where (sdef,scont) = varcontents sgraph snode
mapgraph ::
!( (Pfun var1 (sym1,[var1]))
-> Pfun .var2 (.sym2,[.var2])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment