diff --git a/src/main/jastadd/hanoi/Connective.jrag b/src/main/jastadd/hanoi/Connective.jrag new file mode 100644 index 0000000000000000000000000000000000000000..1f8049cdb884cfb201c958965d3e706601602917 --- /dev/null +++ b/src/main/jastadd/hanoi/Connective.jrag @@ -0,0 +1,18 @@ +import java.util.*; +aspect Connective{ + uncache Connective.eval(); + syn boolean Connective.eval(); + eq Conjunction.eval(){ + return this.getLeft().eval() && this.getRight().eval(); + } + eq Disjunction.eval(){ + return this.getLeft().eval() || this.getRight().eval(); + } + eq Implication.eval(){ + return (!this.getLeft().eval()) || this.getRight().eval(); + } + eq Negation.eval()= !getConnective().eval(); + eq Atom.eval(){ + return this.getRelation().eval(); + } +} \ No newline at end of file