package at.ac.tuwien.dbai.alternation.examples;

atm BipartiteArgumentationCredulousElementary(BipartiteGraph.Node<Integer> x,
                                              BipartiteGraph<Integer> AF) {

    BipartiteGraph.Node<Integer> argument=x;
    BipartiteGraph.Node<Integer> guard=null;

    state ForallAttackers {
        if(argument==guard){accept;}
        forall { // Attackers
            for (BipartiteGraph.Node<Integer> attacker : argument.getParents()){
                ExistsGuard{
                    argument=attacker;
                }
            }
        }
    }

    state ExistsGuard{
        exists{
            ExistsDefender{}

            ExistsDefender{
                    guard=argument;
            }
        }
    }

    state ExistsDefender {
        if(argument==guard){accept;}
        exists{ //Defender
            for (BipartiteGraph.Node<Integer> defender : argument.getParents()){
                ForallAttackers{
                    argument=defender;
                }
            }
            for (BipartiteGraph.Node<Integer> defender : argument.getParents()){
                ForallAttackers{
                    guard=argument;
                    argument=defender;
                }
            }
        }
    }
}