public static SemanticContext or(SemanticContext a, SemanticContext b) {if ( a == null ) return b;if ( b == null ) return a;if ( a == NONE || b == NONE ) return NONE;OR result = new OR(a, b);if (result.opnds.length == 1) {return result.opnds[0];}return result;}

public OR(SemanticContext a, SemanticContext b){HashSet<SemanticContext> operands = new HashSet<SemanticContext>();if (a is SemanticContext.OR){operands.UnionWith(((OR)a).opnds);}else{operands.Add(a);}if (b is SemanticContext.OR){operands.UnionWith(((OR)b).opnds);}else{operands.Add(b);}IList<SemanticContext.PrecedencePredicate> precedencePredicates = FilterPrecedencePredicates(operands);if (precedencePredicates.Count > 0){SemanticContext.PrecedencePredicate reduced = precedencePredicates.Max();operands.Add(reduced);}this.opnds = operands.ToArray();}
