diff --git a/src/main/jastadd/hanoi/Realtion.jrag b/src/main/jastadd/hanoi/Realtion.jrag new file mode 100644 index 0000000000000000000000000000000000000000..86e5eb0c6f0aa721a6bc85f1dfa3696808d3315a --- /dev/null +++ b/src/main/jastadd/hanoi/Realtion.jrag @@ -0,0 +1,22 @@ +import java.util.*; +aspect Relation{ + uncache Relation.eval(); + syn boolean Relation.eval(); + eq Subsetof.eval(){ + Set left=new HashSet<>(); + for(String element : this.getLeft().Set()){ + left.add(element); + } + Set right=new HashSet<>(); + for(String element : this.getRight().Set()){ + right.add(element); + } + return right.containsAll(left); + } + eq Compare.eval(){ + return (this.getLeft().eval() - this.getRight().eval())<0; + } + eq Equal.eval(){ + return this.getLeft().eval() - this.getRight().eval()==0; + } +} \ No newline at end of file