From 4242e6bb36602ec6330a92fea0182c281cfc9ce1 Mon Sep 17 00:00:00 2001 From: Yingjian Wang <yingjian.wang@mailbox.tu-dresden.de> Date: Wed, 19 Jan 2022 00:25:57 +0100 Subject: [PATCH] Upload New File --- src/main/jastadd/hanoi/Connective.jrag | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/main/jastadd/hanoi/Connective.jrag diff --git a/src/main/jastadd/hanoi/Connective.jrag b/src/main/jastadd/hanoi/Connective.jrag new file mode 100644 index 0000000..1f8049c --- /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 -- GitLab