internal override IEnumerable <LiteralVertexPair <T_Identifier> > GetSuccessors( Vertex vertex) { LiteralVertexPair <T_Identifier>[] literalVertexPairArray = new LiteralVertexPair <T_Identifier> [2]; Vertex child1 = vertex.Children[0]; Vertex child2 = vertex.Children[1]; this.InitializeInverseVariableMap(); Literal <T_Identifier> literal1 = new Literal <T_Identifier>(this._inverseVariableMap[vertex.Variable], true); literalVertexPairArray[0] = new LiteralVertexPair <T_Identifier>(child1, literal1); Literal <T_Identifier> literal2 = literal1.MakeNegated(); literalVertexPairArray[1] = new LiteralVertexPair <T_Identifier>(child2, literal2); return((IEnumerable <LiteralVertexPair <T_Identifier> >)literalVertexPairArray); }
internal override IEnumerable<LiteralVertexPair<T_Identifier>> GetSuccessors(Vertex vertex) { var successors = new LiteralVertexPair<T_Identifier>[2]; Debug.Assert(2 == vertex.Children.Length); var then = vertex.Children[0]; var @else = vertex.Children[1]; // get corresponding term expression InitializeInverseVariableMap(); var term = _inverseVariableMap[vertex.Variable]; // add positive successor (then) var literal = new Literal<T_Identifier>(term, true); successors[0] = new LiteralVertexPair<T_Identifier>(then, literal); // add negative successor (else) literal = literal.MakeNegated(); successors[1] = new LiteralVertexPair<T_Identifier>(@else, literal); return successors; }