home *** CD-ROM | disk | FTP | other *** search
- // xu: map(string,set(string))
-
- add_mod(m,ms) {xu[m]=ms;};
-
- uses(m) {return xu[m];};
-
- used_by(m) {return {ms:ms<-dom xu;m in xu[ms]};};
-
- rec_mod() {return {m:m<-dom xu;reaches(m,m)};};
-
- reaches(m1,m2) {return ((m2 in xu[m1]) || (exists m in xu[m1];
- reaches(m,m2)));};
- add_mod("top",{"mid1","mid2"});
- add_mod("mid1",{"bot1","bot2","mid1"}); // a recursive reference, e.g.
- // "mid1" must not be the "first"
- // item in the second argument
- add_mod("mid2",{"bot2"});
- add_mod("bot1",{"top","mid1"});
- add_mod("bot2",{});
- end