aboutsummaryrefslogtreecommitdiff
path: root/sucl
diff options
context:
space:
mode:
authorzweije2001-08-10 14:33:09 +0000
committerzweije2001-08-10 14:33:09 +0000
commite955c754a99031b88bf4ac0f9c0badf6f64c4695 (patch)
treecad1a85bb67a0053fb038b3628751e2c6430ea2c /sucl
parentThis commit was generated by cvs2svn to compensate for changes in r599, (diff)
This commit was generated by cvs2svn to compensate for changes in r601,
which included commits to RCS files with non-trunk default branches. git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@602 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'sucl')
-rw-r--r--sucl/pfun.dcl2
-rw-r--r--sucl/pfun.icl8
2 files changed, 10 insertions, 0 deletions
diff --git a/sucl/pfun.dcl b/sucl/pfun.dcl
index baea62f..022188a 100644
--- a/sucl/pfun.dcl
+++ b/sucl/pfun.dcl
@@ -45,3 +45,5 @@ instance toString Pfun dom ran | toString dom & toString ran
on the nodes in `dom' for which it is defined.
*/
idpfun :: !.[dom] .(Pfun dom dom) -> Bool | == dom
+
+instance == (Pfun dom ran) | == dom & == ran
diff --git a/sucl/pfun.icl b/sucl/pfun.icl
index c303b7d..053799f 100644
--- a/sucl/pfun.icl
+++ b/sucl/pfun.icl
@@ -82,3 +82,11 @@ idpfun :: !.[dom] .(Pfun dom dom) -> Bool | == dom
idpfun domain pfun
= all idelem domain
where idelem x = total True (postcomp ((==) x) pfun) x
+
+instance == (Pfun dom ran) | == dom & == ran
+where (==) EmptyPfun EmptyPfun = True
+ (==) (Extend x1 y1 pf1) (Extend x2 y2 pf2)
+ = x1==x2 && y1==y2 && pf1==pf2
+ (==) (Restrict x1 pf1) (Restrict x2 pf2)
+ = x1==x2 && pf1==pf2
+ (==) _ _ = False