/** * Returns a (deterministic) automaton that accepts the intersection of the * language of <code>a1</code> and the complement of the language of * <code>a2</code>. As a side-effect, the automata may be determinized, if not * already deterministic. * <p> * Complexity: quadratic in number of states if a2 already deterministic and * exponential in number of a2's states otherwise. */ static public Automaton minus(Automaton a1, Automaton a2, int maxDeterminizedStates) { if (Operations.isEmpty(a1) || a1 == a2) { return Automata.makeEmpty(); } if (Operations.isEmpty(a2)) { return a1; } return intersection(a1, complement(a2, maxDeterminizedStates)); }
return isEmpty(a1);
if (Operations.isEmpty(a)) { return new Automaton();
if (Operations.isEmpty(automaton)) {
/** * Returns a (deterministic) automaton that accepts the intersection of the * language of <code>a1</code> and the complement of the language of * <code>a2</code>. As a side-effect, the automata may be determinized, if not * already deterministic. * <p> * Complexity: quadratic in number of states if a2 already deterministic and * exponential in number of a2's states otherwise. */ static public Automaton minus(Automaton a1, Automaton a2, int maxDeterminizedStates) { if (Operations.isEmpty(a1) || a1 == a2) { return Automata.makeEmpty(); } if (Operations.isEmpty(a2)) { return a1; } return intersection(a1, complement(a2, maxDeterminizedStates)); }
/** * Returns a (deterministic) automaton that accepts the intersection of the * language of <code>a1</code> and the complement of the language of * <code>a2</code>. As a side-effect, the automata may be determinized, if not * already deterministic. * <p> * Complexity: quadratic in number of states if a2 already deterministic and * exponential in number of a2's states otherwise. */ static public Automaton minus(Automaton a1, Automaton a2, int maxDeterminizedStates) { if (Operations.isEmpty(a1) || a1 == a2) { return Automata.makeEmpty(); } if (Operations.isEmpty(a2)) { return a1; } return intersection(a1, complement(a2, maxDeterminizedStates)); }
/** * Returns a (deterministic) automaton that accepts the intersection of the * language of <code>a1</code> and the complement of the language of * <code>a2</code>. As a side-effect, the automata may be determinized, if not * already deterministic. * <p> * Complexity: quadratic in number of states if a2 already deterministic and * exponential in number of a2's states otherwise. */ static public Automaton minus(Automaton a1, Automaton a2, int maxDeterminizedStates) { if (Operations.isEmpty(a1) || a1 == a2) { return Automata.makeEmpty(); } if (Operations.isEmpty(a2)) { return a1; } return intersection(a1, complement(a2, maxDeterminizedStates)); }
return isEmpty(a1);
public Query rewrite(IndexReader reader) throws IOException { if (Operations.isEmpty(det)) { return new MatchNoDocsQuery();
if (Operations.isEmpty(a)) { return new Automaton();
if (Operations.isEmpty(a)) { return new Automaton();
if (Operations.isEmpty(a)) { return new Automaton();
if (Operations.isEmpty(automaton)) {
if (Operations.isEmpty(automaton)) {
if (Operations.isEmpty(automaton)) {