protected void ambiguity(Symbol[] sentence, int from, int to, NonTerminal nt, String workerId) {
		int len = to - from;
		SymbolString s = new SymbolString(len);
		for (int z = 0; z < len; z++) {
			s.add(sentence[z + from]);
		}
		
		boolean isnew;
		Relation<Symbol,SymbolString> r = possibleAmbiguities.get(len);
		synchronized(r) {
			isnew = !r.contains(nt, s);
			if (isnew) {
				r.add(nt, s);
			}
		}
	
		if (isnew) {
			Pair<Boolean, ParseTree> p = parse(s, nt); 
			if (p.a) {
				boolean reallyAmbiguous = true; // this is to compensate a bug in prefer/avoid filtering during sentence generation
				if (p.b != null) {
					ParseTreeNode n = p.b.getMinimalParseTree();
					if (n == null) {
						//System.out.println(workerId + ": Possible ambiguity found for " + nt + ": ");
						//System.out.println(p.b.top.prettyPrint());
						reallyAmbiguous = false;
					} else {
						monitor.ambiguousString(config, n.yield(), (NonTerminal) n.getRootSymbol(), "" + workerId + ": ");
					}
				} else {
					monitor.ambiguousString(config, s, nt, "" + workerId + ": ");
				}
				if (reallyAmbiguous) {
					synchronized(ambiguities) {
						ambiguities.add(p.b.getAmbiguousCore());
						//ambiguities.add(nt, s);
					}
				}
			}
		}
	}