// This file is automatically generated by DemeterJ.

SubgraphVisitor {
  {{
    private java.util.Stack history = new java.util.Stack();
    public SubgraphVisitor(Object obj) {
      history.push(obj);
    }
  }}

  before -> CSP, constraintsatisfactionproblem_list, ConstraintSatisfactionProblem_List {{
    if (is_equal) {
      CSP obj = (CSP) history.peek();
      Object temp1 = obj.get_constraintsatisfactionproblem_list();
      if(temp1==null) { is_equal = false; return; }
      history.push(temp1);
    }
  }}
  after -> CSP, constraintsatisfactionproblem_list, ConstraintSatisfactionProblem_List {{
    if (is_equal) history.pop();
  }}

  before CSP {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> ConstraintSatisfactionProblem, preamble, Preamble {{
    if (is_equal) {
      ConstraintSatisfactionProblem obj = (ConstraintSatisfactionProblem) history.peek();
      Object temp2 = obj.get_preamble();
      if(temp2==null) { is_equal = false; return; }
      history.push(temp2);
    }
  }}
  after -> ConstraintSatisfactionProblem, preamble, Preamble {{
    if (is_equal) history.pop();
  }}

  before -> ConstraintSatisfactionProblem, constraints, Constraint_List {{
    if (is_equal) {
      ConstraintSatisfactionProblem obj = (ConstraintSatisfactionProblem) history.peek();
      Object temp3 = obj.get_constraints();
      if(temp3==null) { is_equal = false; return; }
      history.push(temp3);
    }
  }}
  after -> ConstraintSatisfactionProblem, constraints, Constraint_List {{
    if (is_equal) history.pop();
  }}

  before ConstraintSatisfactionProblem {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> Constraint, weight, Weight {{
    if (is_equal) {
      Constraint obj = (Constraint) history.peek();
      Object temp4 = obj.get_weight();
      if(temp4==null) { is_equal = false; return; }
      history.push(temp4);
    }
  }}
  after -> Constraint, weight, Weight {{
    if (is_equal) history.pop();
  }}

  before Constraint {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> Preamble, relationname_list, RelationName_List {{
    if (is_equal) {
      Preamble obj = (Preamble) history.peek();
      Object temp5 = obj.get_relationname_list();
      if(temp5==null) { is_equal = false; return; }
      history.push(temp5);
    }
  }}
  after -> Preamble, relationname_list, RelationName_List {{
    if (is_equal) history.pop();
  }}

  before -> Preamble, variableAssignment, Literal {{
    if (is_equal) {
      Preamble obj = (Preamble) history.peek();
      Object temp6 = obj.get_variableAssignment();
      if(temp6==null) { is_equal = false; return; }
      history.push(temp6);
    }
  }}
  after -> Preamble, variableAssignment, Literal {{
    if (is_equal) history.pop();
  }}

  before Preamble {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_numVariables() == ((Preamble) obj).get_numVariables();
    is_equal = is_equal && host.get_numConstraints() == ((Preamble) obj).get_numConstraints();
  }}

  before -> ProperConstraint, relationname, RelationName {{
    if (is_equal) {
      ProperConstraint obj = (ProperConstraint) history.peek();
      Object temp7 = obj.get_relationname();
      if(temp7==null) { is_equal = false; return; }
      history.push(temp7);
    }
  }}
  after -> ProperConstraint, relationname, RelationName {{
    if (is_equal) history.pop();
  }}

  before -> ProperConstraint, literals, Literal_List {{
    if (is_equal) {
      ProperConstraint obj = (ProperConstraint) history.peek();
      Object temp8 = obj.get_literals();
      if(temp8==null) { is_equal = false; return; }
      history.push(temp8);
    }
  }}
  after -> ProperConstraint, literals, Literal_List {{
    if (is_equal) history.pop();
  }}

  before ProperConstraint {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> Literal, variable, Variable {{
    if (is_equal) {
      Literal obj = (Literal) history.peek();
      Object temp9 = obj.get_variable();
      if(temp9==null) { is_equal = false; return; }
      history.push(temp9);
    }
  }}
  after -> Literal, variable, Variable {{
    if (is_equal) history.pop();
  }}

  before Literal {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before Pos {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before Neg {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before Satisfied {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before Unsatisfied {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before Variable {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    Object temp10 = host.get_v();
    Object temp11 = ((Variable) obj).get_v();
    if(temp10 == null && temp11 == null) {}
    else if(temp10 == null ||
            temp11 == null ||
            !temp10.equals(temp11)) { is_equal = false; return; }
  }}

  before RelationName {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    Object temp12 = host.get_v();
    Object temp13 = ((RelationName) obj).get_v();
    if(temp12 == null && temp13 == null) {}
    else if(temp12 == null ||
            temp13 == null ||
            !temp12.equals(temp13)) { is_equal = false; return; }
  }}

  before Weight {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_v() == ((Weight) obj).get_v();
  }}

  before Main {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before PrintVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_indent() == ((PrintVisitor) obj).get_indent();
    is_equal = is_equal && host.get_needSpace() == ((PrintVisitor) obj).get_needSpace();
  }}

  before CopyVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    Object temp14 = host.get_copy();
    Object temp15 = ((CopyVisitor) obj).get_copy();
    if(temp14 == null && temp15 == null) {}
    else if(temp14 == null ||
            temp15 == null ||
            !temp14.equals(temp15)) { is_equal = false; return; }
  }}

  before SubgraphVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_is_equal() == ((SubgraphVisitor) obj).get_is_equal();
  }}

  before EqualVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_is_equal() == ((EqualVisitor) obj).get_is_equal();
  }}

  before DisplayVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_indent() == ((DisplayVisitor) obj).get_indent();
  }}

  before TraceVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
    is_equal = is_equal && host.get_indent() == ((TraceVisitor) obj).get_indent();
  }}

  before UniversalVisitor {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> ConstraintSatisfactionProblem_List, first, Nonempty_ConstraintSatisfactionProblem_List {{
    if (is_equal) {
      ConstraintSatisfactionProblem_List obj = (ConstraintSatisfactionProblem_List) history.peek();
      Object temp16 = obj.get_first();
      if(temp16==null) { is_equal = false; return; }
      history.push(temp16);
    }
  }}
  after -> ConstraintSatisfactionProblem_List, first, Nonempty_ConstraintSatisfactionProblem_List {{
    if (is_equal) history.pop();
  }}

  before ConstraintSatisfactionProblem_List {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> Constraint_List, first, Nonempty_Constraint_List {{
    if (is_equal) {
      Constraint_List obj = (Constraint_List) history.peek();
      Object temp17 = obj.get_first();
      if(temp17==null) { is_equal = false; return; }
      history.push(temp17);
    }
  }}
  after -> Constraint_List, first, Nonempty_Constraint_List {{
    if (is_equal) history.pop();
  }}

  before Constraint_List {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> RelationName_List, first, Nonempty_RelationName_List {{
    if (is_equal) {
      RelationName_List obj = (RelationName_List) history.peek();
      Object temp18 = obj.get_first();
      if(temp18==null) { is_equal = false; return; }
      history.push(temp18);
    }
  }}
  after -> RelationName_List, first, Nonempty_RelationName_List {{
    if (is_equal) history.pop();
  }}

  before RelationName_List {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> Literal_List, first, Nonempty_Literal_List {{
    if (is_equal) {
      Literal_List obj = (Literal_List) history.peek();
      Object temp19 = obj.get_first();
      if(temp19==null) { is_equal = false; return; }
      history.push(temp19);
    }
  }}
  after -> Literal_List, first, Nonempty_Literal_List {{
    if (is_equal) history.pop();
  }}

  before Literal_List {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> Nonempty_ConstraintSatisfactionProblem_List, it, ConstraintSatisfactionProblem {{
    if (is_equal) {
      Nonempty_ConstraintSatisfactionProblem_List obj = (Nonempty_ConstraintSatisfactionProblem_List) history.peek();
      Object temp20 = obj.get_it();
      if(temp20==null) { is_equal = false; return; }
      history.push(temp20);
    }
  }}
  after -> Nonempty_ConstraintSatisfactionProblem_List, it, ConstraintSatisfactionProblem {{
    if (is_equal) history.pop();
  }}

  before -> Nonempty_ConstraintSatisfactionProblem_List, next, Nonempty_ConstraintSatisfactionProblem_List {{
    if (is_equal) {
      Nonempty_ConstraintSatisfactionProblem_List obj = (Nonempty_ConstraintSatisfactionProblem_List) history.peek();
      Object temp21 = obj.get_next();
      if(temp21==null) { is_equal = false; return; }
      history.push(temp21);
    }
  }}
  after -> Nonempty_ConstraintSatisfactionProblem_List, next, Nonempty_ConstraintSatisfactionProblem_List {{
    if (is_equal) history.pop();
  }}

  before Nonempty_ConstraintSatisfactionProblem_List {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> Nonempty_Constraint_List, it, Constraint {{
    if (is_equal) {
      Nonempty_Constraint_List obj = (Nonempty_Constraint_List) history.peek();
      Object temp22 = obj.get_it();
      if(temp22==null) { is_equal = false; return; }
      history.push(temp22);
    }
  }}
  after -> Nonempty_Constraint_List, it, Constraint {{
    if (is_equal) history.pop();
  }}

  before -> Nonempty_Constraint_List, next, Nonempty_Constraint_List {{
    if (is_equal) {
      Nonempty_Constraint_List obj = (Nonempty_Constraint_List) history.peek();
      Object temp23 = obj.get_next();
      if(temp23==null) { is_equal = false; return; }
      history.push(temp23);
    }
  }}
  after -> Nonempty_Constraint_List, next, Nonempty_Constraint_List {{
    if (is_equal) history.pop();
  }}

  before Nonempty_Constraint_List {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> Nonempty_RelationName_List, it, RelationName {{
    if (is_equal) {
      Nonempty_RelationName_List obj = (Nonempty_RelationName_List) history.peek();
      Object temp24 = obj.get_it();
      if(temp24==null) { is_equal = false; return; }
      history.push(temp24);
    }
  }}
  after -> Nonempty_RelationName_List, it, RelationName {{
    if (is_equal) history.pop();
  }}

  before -> Nonempty_RelationName_List, next, Nonempty_RelationName_List {{
    if (is_equal) {
      Nonempty_RelationName_List obj = (Nonempty_RelationName_List) history.peek();
      Object temp25 = obj.get_next();
      if(temp25==null) { is_equal = false; return; }
      history.push(temp25);
    }
  }}
  after -> Nonempty_RelationName_List, next, Nonempty_RelationName_List {{
    if (is_equal) history.pop();
  }}

  before Nonempty_RelationName_List {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  before -> Nonempty_Literal_List, it, Literal {{
    if (is_equal) {
      Nonempty_Literal_List obj = (Nonempty_Literal_List) history.peek();
      Object temp26 = obj.get_it();
      if(temp26==null) { is_equal = false; return; }
      history.push(temp26);
    }
  }}
  after -> Nonempty_Literal_List, it, Literal {{
    if (is_equal) history.pop();
  }}

  before -> Nonempty_Literal_List, next, Nonempty_Literal_List {{
    if (is_equal) {
      Nonempty_Literal_List obj = (Nonempty_Literal_List) history.peek();
      Object temp27 = obj.get_next();
      if(temp27==null) { is_equal = false; return; }
      history.push(temp27);
    }
  }}
  after -> Nonempty_Literal_List, next, Nonempty_Literal_List {{
    if (is_equal) history.pop();
  }}

  before Nonempty_Literal_List {{
    Object obj = history.peek();
    is_equal = is_equal && obj.getClass().equals(host.getClass());
    if(!is_equal) return;
  }}

  return boolean {{ is_equal }}
}