]> matita.cs.unibo.it Git - logicplayer.git/blob - mainActivity/src/com/example/furt/myapplication/RuleNotElimination.java
ec5034b9482190866a545f3ae673cc083cebeb2a
[logicplayer.git] / mainActivity / src / com / example / furt / myapplication / RuleNotElimination.java
1 package com.example.furt.myapplication;
2
3 public class RuleNotElimination implements EliminationRule
4 {
5     String ruleName;
6     public String getName()
7     {
8         return ruleName;
9     }
10     FormulaNot Fn;
11     RuleNotElimination(FormulaNot F)
12     {
13         Fn=F;
14         ruleName="¬e";
15     }
16     public Node createNodes(Formula F,askFormula ask)
17     {
18         Formula C=ask.Ask();
19         if ((C.toString().equals("⊥"))&&(F==null ||F==Fn.Operand)) //top-down con nodo attuale bottom o bottom-up con nodi attuali Fn e !Fn
20         {
21             Node elNode=new Node(Fn);
22             Node cNode=new Node(Fn.Operand);
23             Node rNode=new Node(C);
24             rNode.addChild(elNode);
25             rNode.addChild(cNode);
26             rNode.ruleName=ruleName;
27             return rNode;
28         }
29         else
30             return null;
31     }
32 }
33