Input:
    void run_sequence_search(int solveKind, SimpleNode kind, SearchItem si) {
	singleSearch = false;
	this.si = si;
	if (options.getVerbose()) {
	    String solve="notKnown";
	    switch (solveKind) {
	    case 0: solve = "%% satisfy"; break;
	    case 1:
		solve = "%% minimize("+ getCost((ASTSolveExpr)kind.jjtGetChild(0))+") "; break;
	    case 2:
		solve = "%% maximize("+ getCost((ASTSolveExpr)kind.jjtGetChild(0))+") "; break;
	    }
	    System.out.println(solve + " : seq_search([" + si + "])");
	}
	DepthFirstSearch<Var> masterLabel = null;
	DepthFirstSearch<Var> last_search = null;
	SelectChoicePoint<Var> masterSelect = null;
	list_seq_searches = new ArrayList<Search<Var>>();
	for (int i=0; i<si.getSearchItems().size(); i++) {
	    if (i == 0) {
		masterLabel = sub_search(si.getSearchItems().get(i), masterLabel, true);
		last_search = masterLabel;
		masterSelect = variable_selection;
		if (!print_search_info) masterLabel.setPrintInfo(false);
	    }
	    else {
		DepthFirstSearch<Var> label = sub_search(si.getSearchItems().get(i), last_search, false);
		last_search.addChildSearch(label);
		last_search = label;
		if (!print_search_info) last_search.setPrintInfo(false);
	    }
	}
 	DepthFirstSearch<Var>[] complementary_search = setSubSearchForAll(last_search, options);
        for (DepthFirstSearch<Var> aComplementary_search : complementary_search) {
            if (aComplementary_search != null) {
                list_seq_searches.add(aComplementary_search);
                if (!print_search_info) aComplementary_search.setPrintInfo(false);
            }
        }
	Result = false;
	IntVar cost;
	optimization = false;
	Search<Var> final_search_seq = list_seq_searches.get(list_seq_searches.size()-1);
	tread = java.lang.Thread.currentThread();
	java.lang.management.ThreadMXBean b = java.lang.management.ManagementFactory.getThreadMXBean();
	searchTimeMeter = b;
	startCPU = b.getThreadCpuTime(tread.getId());
	int to = options.getTimeOut();
	if (to > 0)
	    for (Search s : list_seq_searches)
		s.setTimeOut(to);
	int ns = options.getNumberSolutions();
	if (si.exploration() == null || si.exploration().equals("complete"))
	    switch (solveKind) {
	    case 0:
 		if (options.getAll() ) {
  		    for (int i=0; i<si.getSearchItems().size(); i++) {
  			list_seq_searches.get(i).getSolutionListener().searchAll(true);
  			list_seq_searches.get(i).getSolutionListener().recordSolutions(false);
       			if ( ns>0 )
     			    list_seq_searches.get(i).getSolutionListener().setSolutionLimit(ns);
 		    }
 		}
		Result = masterLabel.labeling(store, masterSelect);
		break;
	    case 1:
		optimization = true;
		cost = getCost((ASTSolveExpr)kind.jjtGetChild(0));
		for (Search<Var> list_seq_searche : list_seq_searches)
		    list_seq_searche.setOptimize(true);
		if (ns > 0) {
		    for (int i=0; i<list_seq_searches.size()-1; i++)
		     	((DepthFirstSearch)list_seq_searches.get(i)).respectSolutionListenerAdvice = true;
		    final_search_seq.getSolutionListener().setSolutionLimit(ns);
		    ((DepthFirstSearch)final_search_seq).respectSolutionListenerAdvice = true;
		}
		Result = masterLabel.labeling(store, masterSelect, cost);
		break;
	    case 2:
		optimization = true;
		cost = getCost((ASTSolveExpr)kind.jjtGetChild(0));
		IntVar max_cost = new IntVar(store, "-"+cost.id(), IntDomain.MinInt,
		 						 IntDomain.MaxInt);
		pose(new XplusYeqC(max_cost, cost, 0));
            for (Search<Var> list_seq_searche : list_seq_searches)
                list_seq_searche.setOptimize(true);
		if (ns > 0) {
		    for (int i=0; i<list_seq_searches.size()-1; i++)
			((DepthFirstSearch)list_seq_searches.get(i)).respectSolutionListenerAdvice=true;
		    final_search_seq.getSolutionListener().setSolutionLimit(ns);
		    ((DepthFirstSearch)final_search_seq).respectSolutionListenerAdvice=true;
		}
		Result = masterLabel.labeling(store, masterSelect, max_cost);
		break;
	    }
	else {
	    System.err.println("Not recognized or supported "+si.exploration()+
			       " search explorarion strategy ; compilation aborted");
	    System.exit(0);
	}
	printStatisticsForSeqSearch(false);
    }
    void printStatisticsForSeqSearch(boolean interrupted) {
	if (list_seq_searches == null) {
	    System.out.println ("%% =====INTERRUPTED=====\n%% Model not yet posed..");
	    return;
	}
	if (Result) {
	    if (!optimization && options.getAll()) {
		if (!heuristicSeqSearch)
		    if (! anyTimeOutOccured(list_seq_searches)) {
			if (options.getNumberSolutions() == -1 || options.getNumberSolutions() > final_search_seq.getSolutionListener().solutionsNo())
			    System.out.println("==========");
		    }
		    else
			System.out.println("%% =====TIME-OUT=====");
		else
		    if (anyTimeOutOccured(list_seq_searches))
			System.out.println("%% =====TIME-OUT=====");
	    }
	    else if (optimization) {
		if (!heuristicSeqSearch)
		    if (! anyTimeOutOccured(list_seq_searches)) {
			if (options.getNumberSolutions() == -1 || options.getNumberSolutions() > final_search_seq.getSolutionListener().solutionsNo())
			    System.out.println("==========");
		    }
		    else
			System.out.println("%% =====TIME-OUT=====");
		else
		    if (anyTimeOutOccured(list_seq_searches))
			System.out.println("%% =====TIME-OUT=====");
	    }
	}
	else
	    if (anyTimeOutOccured(list_seq_searches)) {
		System.out.println("=====UNKNOWN=====");
		System.out.println("%% =====TIME-OUT=====");
	    }
	    else
		if (interrupted)
		    System.out.println ("%% =====INTERRUPTED=====");
		else
		    System.out.println("=====UNSATISFIABLE=====");
	if (options.getStatistics()) {
	    int nodes=0, decisions=0, wrong=0, backtracks=0, depth=0,solutions=0;
        for (Search<Var> label : list_seq_searches) {
            nodes += label.getNodes();
            decisions += label.getDecisions();
            wrong += label.getWrongDecisions();
            backtracks += label.getBacktracks();
            depth += label.getMaximumDepth();
            solutions = label.getSolutionListener().solutionsNo();
        }
	System.out.println("\n%% Model variables : "+ (store.size()+ NumberBoolVariables) +
			   "\n%% Model constraints : "+initNumberConstraints+
			   "\n\n%% Search CPU time : " + (searchTimeMeter.getThreadCpuTime(tread.getId()) - startCPU)/(long)1e+6 + "ms"+
			   "\n%% Search nodes : "+nodes+
			   "\n%% Search decisions : "+decisions+
			   "\n%% Wrong search decisions : "+wrong+
			   "\n%% Search backtracks : "+backtracks+
			   "\n%% Max search depth : "+depth+
			   "\n%% Number solutions : "+ solutions
			   );
	}
    }
    boolean anyTimeOutOccured(ArrayList<Search<Var>> list_seq_searches) {
        for (Search<Var> list_seq_searche : list_seq_searches)
            if (((DepthFirstSearch) list_seq_searche).timeOutOccured)
                return true;
	return false;
    }
    DepthFirstSearch<Var> sub_search(SearchItem si, DepthFirstSearch<Var> l, boolean master) {
	DepthFirstSearch<Var> last_search = l;
	DepthFirstSearch<Var> label = null;
	if (si.type().equals("int_search") || si.type().equals("bool_search")) {
	    label = int_search(si);
	    if (!master) label.setSelectChoicePoint(variable_selection);
	    if (si.exploration().equals("lds")) {
		lds_search(label, si.ldsValue);
		heuristicSeqSearch = true;
	    }
	    if (si.exploration().equals("credit")) {
		credit_search(label, si.creditValue, si.bbsValue);
		heuristicSeqSearch = true;
	    }
	    list_seq_searches.add(label);
	}
	else if (si.type().equals("set_search")) {
	    setSearch=true;
	    label = set_search(si);
	    if (!master)
		label.setSelectChoicePoint(variable_selection);
	    if (si.exploration().equals("lds")) {
		lds_search(label, si.ldsValue);
		heuristicSeqSearch = true;
	    }
	    if (si.exploration().equals("credit")) {
		credit_search(label, si.creditValue, si.bbsValue);
		heuristicSeqSearch = true;
	    }
	    list_seq_searches.add(label);
	}
	else if (si.type().equals("seq_search")) {
	    for (int i=0; i<si.getSearchItems().size(); i++)
		if (i == 0) {
		    DepthFirstSearch<Var> label_seq = sub_search(si.getSearchItems().get(i), last_search, false);
		    last_search = label_seq;
		    label = label_seq;
		}
		else {
		    DepthFirstSearch<Var> label_seq = sub_search(si.getSearchItems().get(i), last_search, false);
		    last_search.addChildSearch(label_seq);
		    last_search = label_seq;
		}
	}
	else {
	    System.err.println("Not recognized or supported search type \""+si.type()+"\"; compilation aborted");
	    System.exit(0);
	}
	return label;
    }
    DepthFirstSearch<Var> int_search(SearchItem si) {
        variable_selection = si.getIntSelect();
        return new DepthFirstSearch<Var>();
    }
    DepthFirstSearch<Var> set_search(SearchItem si) {
        variable_selection = si.getSetSelect();
        return new DepthFirstSearch<Var>();
    }
    void printSolution() {
	if (dictionary.outputVariables.size() > 0)
	    for (int i=0; i<dictionary.outputVariables.size(); i++) {
		Var v = dictionary.outputVariables.get(i);
 		if (v instanceof BooleanVar) {
		    String boolVar = v.id()+" = ";
		    if (v.singleton())
			switch ( ((BooleanVar)v).value()) {
			case 0: boolVar += "false";
			    break;
			case 1: boolVar += "true";
			    break;
			default: boolVar += v.dom();
			}
		    else
			boolVar += "false..true";
		    System.out.println(boolVar+";");
		}
		else if (v instanceof SetVar) {
		    String setVar = v.id() + " = ";
		    if (v.singleton()) {
			IntDomain glb = ((SetVar)v).dom().glb();
			setVar += "{";
			for (ValueEnumeration e = glb.valueEnumeration(); e.hasMoreElements();) {
			    int element = e.nextElement();
			    setVar += element;
			    if (e.hasMoreElements())
				setVar += ", ";
			}
			setVar += "}";
		    }
		    else
			setVar += v.dom().toString();
		    System.out.println(setVar+";");
		}
		else
		    System.out.println(v+";");
	    }
	for (int i=0; i<dictionary.outputArray.size(); i++) {
	    OutputArrayAnnotation a = dictionary.outputArray.get(i);
	    System.out.println(a);
	}
    }
    int getKind(String k) {
	if (k.equals("satisfy"))
	    return 0;
	else if (k.equals("minimize"))
	    return 1;
	else if (k.equals("maximize"))
	    return 2;
	else {
	    System.err.println("Not supported search kind; compilation aborted");
	    System.exit(0);
	    return -1;
	}
    }
    IntVar getCost(ASTSolveExpr node) {
	if (node.getType() == 0)
	    return dictionary.getVariable(node.getIdent());
	else if (node.getType() == 1)
	    return dictionary.getVariableArray(node.getIdent())[node.getIndex()];
	else {
	    System.err.println("Wrong cost function specification " + node);
	    System.exit(0);
	    return new IntVar(store);
	}
    }
    void pose(Constraint c) {
	store.impose(c);
	if (debug)
	    System.out.println(c);
    }
    void lds_search(DepthFirstSearch<Var> label, int lds_value) {
	LDS<Var> lds = new LDS<Var>(lds_value);
	if (label.getExitChildListener() == null)
	    label.setExitChildListener(lds);
	else
	    label.getExitChildListener().setChildrenListeners(lds);
    }
    void credit_search(DepthFirstSearch<Var> label, int creditValue, int bbsValue) {
	int maxDepth = 1000;
	CreditCalculator<Var> credit = new CreditCalculator<Var>(creditValue, bbsValue, maxDepth);
	if (label.getConsistencyListener() == null)
	    label.setConsistencyListener(credit);
	else
	    label.getConsistencyListener().setChildrenListeners(credit);
	label.setExitChildListener(credit);
	label.setTimeOutListener(credit);
    }
    void setNumberBoolVariables(int n) {
	NumberBoolVariables = n;
    }
    void printSearch(Search label) {
	int N = 1;
	System.out.println (N++ + ". " + label);
	java.util.LinkedHashSet<Search<? extends Var>> l =
	    new java.util.LinkedHashSet<Search<? extends Var>>();
	l.add(label);
	while (l.size() != 0) {
	    java.util.LinkedHashSet<Search<? extends Var>> ns =
		new java.util.LinkedHashSet<Search<? extends Var>>();
	    for (Search s1 : l) {
		Search<? extends Var>[] child = ((DepthFirstSearch)s1).childSearches;
		if (child != null)
		    for (Search s : child) {
			System.out.println (N + ". " + s);
			ns.add(s);
		    }
	    }
	    N++;
	    l = ns;
	}
    }
    int FinalNumberSolutions = 0;
    public class CostListener<T extends Var> extends SimpleSolutionListener<T> {
	public boolean executeAfterSolution(Search<T> search, SelectChoicePoint<T> select) {
	    boolean returnCode = super.executeAfterSolution(search, select);
	    if (costVariable != null)
		costValue = ((IntVar)costVariable).value();
	    FinalNumberSolutions++;
	    printSolution();
	    System.out.println("----------");
	    return returnCode;
	}
    }
    class DomainSizeComparator<T extends Var> implements Comparator<T> {
	DomainSizeComparator() { }
	public int compare(T o1, T o2) {
	    int v1 = o1.getSize();
	    int v2 = o2.getSize();
	    return v1 - v2;
	}
    }
}

Output:
    void run_sequence_search(int solveKind, SimpleNode kind, SearchItem si) {
	singleSearch = false;
	this.si = si;
	if (options.getVerbose()) {
	    String solve="notKnown";
	    switch (solveKind) {
	    case 0: solve = "%% satisfy"; break;
	    case 1:
		solve = "%% minimize("+ getCost((ASTSolveExpr)kind.jjtGetChild(0))+") "; break;
	    case 2:
		solve = "%% maximize("+ getCost((ASTSolveExpr)kind.jjtGetChild(0))+") "; break;
	    }
	    System.out.println(solve + " : seq_search([" + si + "])");
	}
	DepthFirstSearch<Var> masterLabel = null;
	DepthFirstSearch<Var> last_search = null;
	SelectChoicePoint<Var> masterSelect = null;
	list_seq_searches = new ArrayList<Search<Var>>();
	for (int i=0; i<si.getSearchItems().size(); i++) {
	    if (i == 0) {
		masterLabel = sub_search(si.getSearchItems().get(i), masterLabel, true);
		last_search = masterLabel;
		masterSelect = variable_selection;
		if (!print_search_info) masterLabel.setPrintInfo(false);
	    }
	    else {
		DepthFirstSearch<Var> label = sub_search(si.getSearchItems().get(i), last_search, false);
		last_search.addChildSearch(label);
		last_search = label;
		if (!print_search_info) last_search.setPrintInfo(false);
	    }
	}
 	DepthFirstSearch<Var>[] complementary_search = setSubSearchForAll(last_search, options);
        for (DepthFirstSearch<Var> aComplementary_search : complementary_search) {
            if (aComplementary_search != null) {
                list_seq_searches.add(aComplementary_search);
                if (!print_search_info) aComplementary_search.setPrintInfo(false);
            }
        }
	Result = false;
	IntVar cost;
	optimization = false;
	final_search_seq = list_seq_searches.get(list_seq_searches.size()-1);
	tread = java.lang.Thread.currentThread();
	java.lang.management.ThreadMXBean b = java.lang.management.ManagementFactory.getThreadMXBean();
	searchTimeMeter = b;
	startCPU = b.getThreadCpuTime(tread.getId());
	int to = options.getTimeOut();
	if (to > 0)
	    for (Search s : list_seq_searches)
		s.setTimeOut(to);
	int ns = options.getNumberSolutions();
	if (si.exploration() == null || si.exploration().equals("complete"))
	    switch (solveKind) {
	    case 0:
 		if (options.getAll() ) {
  		    for (int i=0; i<si.getSearchItems().size(); i++) {
  			list_seq_searches.get(i).getSolutionListener().searchAll(true);
  			list_seq_searches.get(i).getSolutionListener().recordSolutions(false);
       			if ( ns>0 )
     			    list_seq_searches.get(i).getSolutionListener().setSolutionLimit(ns);
 		    }
 		}
		Result = masterLabel.labeling(store, masterSelect);
		break;
	    case 1:
		optimization = true;
		cost = getCost((ASTSolveExpr)kind.jjtGetChild(0));
		for (Search<Var> list_seq_searche : list_seq_searches)
		    list_seq_searche.setOptimize(true);
		if (ns > 0) {
		    for (int i=0; i<list_seq_searches.size()-1; i++)
		     	((DepthFirstSearch)list_seq_searches.get(i)).respectSolutionListenerAdvice = true;
		    final_search_seq.getSolutionListener().setSolutionLimit(ns);
		    ((DepthFirstSearch)final_search_seq).respectSolutionListenerAdvice = true;
		}
		Result = masterLabel.labeling(store, masterSelect, cost);
		break;
	    case 2:
		optimization = true;
		cost = getCost((ASTSolveExpr)kind.jjtGetChild(0));
		IntVar max_cost = new IntVar(store, "-"+cost.id(), IntDomain.MinInt,
		 						 IntDomain.MaxInt);
		pose(new XplusYeqC(max_cost, cost, 0));
            for (Search<Var> list_seq_searche : list_seq_searches)
                list_seq_searche.setOptimize(true);
		if (ns > 0) {
		    for (int i=0; i<list_seq_searches.size()-1; i++)
			((DepthFirstSearch)list_seq_searches.get(i)).respectSolutionListenerAdvice=true;
		    final_search_seq.getSolutionListener().setSolutionLimit(ns);
		    ((DepthFirstSearch)final_search_seq).respectSolutionListenerAdvice=true;
		}
		Result = masterLabel.labeling(store, masterSelect, max_cost);
		break;
	    }
	else {
	    System.err.println("Not recognized or supported "+si.exploration()+
			       " search explorarion strategy ; compilation aborted");
	    System.exit(0);
	}
	printStatisticsForSeqSearch(false);
    }
    void printStatisticsForSeqSearch(boolean interrupted) {
	if (list_seq_searches == null) {
	    System.out.println ("%% =====INTERRUPTED=====\n%% Model not yet posed..");
	    return;
	}
	if (Result) {
	    if (!optimization && options.getAll()) {
		if (!heuristicSeqSearch)
		    if (! anyTimeOutOccured(list_seq_searches)) {
			if (options.getNumberSolutions() == -1 || options.getNumberSolutions() > final_search_seq.getSolutionListener().solutionsNo())
			    System.out.println("==========");
		    }
		    else
			System.out.println("%% =====TIME-OUT=====");
		else
		    if (anyTimeOutOccured(list_seq_searches))
			System.out.println("%% =====TIME-OUT=====");
	    }
	    else if (optimization) {
		if (!heuristicSeqSearch)
		    if (! anyTimeOutOccured(list_seq_searches)) {
			if (options.getNumberSolutions() == -1 || options.getNumberSolutions() > final_search_seq.getSolutionListener().solutionsNo())
			    System.out.println("==========");
		    }
		    else
			System.out.println("%% =====TIME-OUT=====");
		else
		    if (anyTimeOutOccured(list_seq_searches))
			System.out.println("%% =====TIME-OUT=====");
	    }
	}
	else
	    if (anyTimeOutOccured(list_seq_searches)) {
		System.out.println("=====UNKNOWN=====");
		System.out.println("%% =====TIME-OUT=====");
	    }
	    else
		if (interrupted)
		    System.out.println ("%% =====INTERRUPTED=====");
		else
		    System.out.println("=====UNSATISFIABLE=====");
	if (options.getStatistics()) {
	    int nodes=0, decisions=0, wrong=0, backtracks=0, depth=0,solutions=0;
        for (Search<Var> label : list_seq_searches) {
            nodes += label.getNodes();
            decisions += label.getDecisions();
            wrong += label.getWrongDecisions();
            backtracks += label.getBacktracks();
            depth += label.getMaximumDepth();
            solutions = label.getSolutionListener().solutionsNo();
        }
	System.out.println("\n%% Model variables : "+ (store.size()+ NumberBoolVariables) +
			   "\n%% Model constraints : "+initNumberConstraints+
			   "\n\n%% Search CPU time : " + (searchTimeMeter.getThreadCpuTime(tread.getId()) - startCPU)/(long)1e+6 + "ms"+
			   "\n%% Search nodes : "+nodes+
			   "\n%% Search decisions : "+decisions+
			   "\n%% Wrong search decisions : "+wrong+
			   "\n%% Search backtracks : "+backtracks+
			   "\n%% Max search depth : "+depth+
			   "\n%% Number solutions : "+ solutions
			   );
	}
    }
    boolean anyTimeOutOccured(ArrayList<Search<Var>> list_seq_searches) {
        for (Search<Var> list_seq_searche : list_seq_searches)
            if (((DepthFirstSearch) list_seq_searche).timeOutOccured)
                return true;
	return false;
    }
    DepthFirstSearch<Var> sub_search(SearchItem si, DepthFirstSearch<Var> l, boolean master) {
	DepthFirstSearch<Var> last_search = l;
	DepthFirstSearch<Var> label = null;
	if (si.type().equals("int_search") || si.type().equals("bool_search")) {
	    label = int_search(si);
	    if (!master) label.setSelectChoicePoint(variable_selection);
	    if (si.exploration().equals("lds")) {
		lds_search(label, si.ldsValue);
		heuristicSeqSearch = true;
	    }
	    if (si.exploration().equals("credit")) {
		credit_search(label, si.creditValue, si.bbsValue);
		heuristicSeqSearch = true;
	    }
	    list_seq_searches.add(label);
	}
	else if (si.type().equals("set_search")) {
	    setSearch=true;
	    label = set_search(si);
	    if (!master)
		label.setSelectChoicePoint(variable_selection);
	    if (si.exploration().equals("lds")) {
		lds_search(label, si.ldsValue);
		heuristicSeqSearch = true;
	    }
	    if (si.exploration().equals("credit")) {
		credit_search(label, si.creditValue, si.bbsValue);
		heuristicSeqSearch = true;
	    }
	    list_seq_searches.add(label);
	}
	else if (si.type().equals("seq_search")) {
	    for (int i=0; i<si.getSearchItems().size(); i++)
		if (i == 0) {
		    DepthFirstSearch<Var> label_seq = sub_search(si.getSearchItems().get(i), last_search, false);
		    last_search = label_seq;
		    label = label_seq;
		}
		else {
		    DepthFirstSearch<Var> label_seq = sub_search(si.getSearchItems().get(i), last_search, false);
		    last_search.addChildSearch(label_seq);
		    last_search = label_seq;
		}
	}
	else {
	    System.err.println("Not recognized or supported search type \""+si.type()+"\"; compilation aborted");
	    System.exit(0);
	}
	return label;
    }
    DepthFirstSearch<Var> int_search(SearchItem si) {
        variable_selection = si.getIntSelect();
        return new DepthFirstSearch<Var>();
    }
    DepthFirstSearch<Var> set_search(SearchItem si) {
        variable_selection = si.getSetSelect();
        return new DepthFirstSearch<Var>();
    }
    void printSolution() {
	if (dictionary.outputVariables.size() > 0)
	    for (int i=0; i<dictionary.outputVariables.size(); i++) {
		Var v = dictionary.outputVariables.get(i);
 		if (v instanceof BooleanVar) {
		    String boolVar = v.id()+" = ";
		    if (v.singleton())
			switch ( ((BooleanVar)v).value()) {
			case 0: boolVar += "false";
			    break;
			case 1: boolVar += "true";
			    break;
			default: boolVar += v.dom();
			}
		    else
			boolVar += "false..true";
		    System.out.println(boolVar+";");
		}
		else if (v instanceof SetVar) {
		    String setVar = v.id() + " = ";
		    if (v.singleton()) {
			IntDomain glb = ((SetVar)v).dom().glb();
			setVar += "{";
			for (ValueEnumeration e = glb.valueEnumeration(); e.hasMoreElements();) {
			    int element = e.nextElement();
			    setVar += element;
			    if (e.hasMoreElements())
				setVar += ", ";
			}
			setVar += "}";
		    }
		    else
			setVar += v.dom().toString();
		    System.out.println(setVar+";");
		}
		else
		    System.out.println(v+";");
	    }
	for (int i=0; i<dictionary.outputArray.size(); i++) {
	    OutputArrayAnnotation a = dictionary.outputArray.get(i);
	    System.out.println(a);
	}
    }
    int getKind(String k) {
	if (k.equals("satisfy"))
	    return 0;
	else if (k.equals("minimize"))
	    return 1;
	else if (k.equals("maximize"))
	    return 2;
	else {
	    System.err.println("Not supported search kind; compilation aborted");
	    System.exit(0);
	    return -1;
	}
    }
    IntVar getCost(ASTSolveExpr node) {
	if (node.getType() == 0)
	    return dictionary.getVariable(node.getIdent());
	else if (node.getType() == 1)
	    return dictionary.getVariableArray(node.getIdent())[node.getIndex()];
	else {
	    System.err.println("Wrong cost function specification " + node);
	    System.exit(0);
	    return new IntVar(store);
	}
    }
    void pose(Constraint c) {
	store.impose(c);
	if (debug)
	    System.out.println(c);
    }
    void lds_search(DepthFirstSearch<Var> label, int lds_value) {
	LDS<Var> lds = new LDS<Var>(lds_value);
	if (label.getExitChildListener() == null)
	    label.setExitChildListener(lds);
	else
	    label.getExitChildListener().setChildrenListeners(lds);
    }
    void credit_search(DepthFirstSearch<Var> label, int creditValue, int bbsValue) {
	int maxDepth = 1000;
	CreditCalculator<Var> credit = new CreditCalculator<Var>(creditValue, bbsValue, maxDepth);
	if (label.getConsistencyListener() == null)
	    label.setConsistencyListener(credit);
	else
	    label.getConsistencyListener().setChildrenListeners(credit);
	label.setExitChildListener(credit);
	label.setTimeOutListener(credit);
    }
    void setNumberBoolVariables(int n) {
	NumberBoolVariables = n;
    }
    void printSearch(Search label) {
	int N = 1;
	System.out.println (N++ + ". " + label);
	java.util.LinkedHashSet<Search<? extends Var>> l =
	    new java.util.LinkedHashSet<Search<? extends Var>>();
	l.add(label);
	while (l.size() != 0) {
	    java.util.LinkedHashSet<Search<? extends Var>> ns =
		new java.util.LinkedHashSet<Search<? extends Var>>();
	    for (Search s1 : l) {
		Search<? extends Var>[] child = ((DepthFirstSearch)s1).childSearches;
		if (child != null)
		    for (Search s : child) {
			System.out.println (N + ". " + s);
			ns.add(s);
		    }
	    }
	    N++;
	    l = ns;
	}
    }
    int FinalNumberSolutions = 0;
    public class CostListener<T extends Var> extends SimpleSolutionListener<T> {
	public boolean executeAfterSolution(Search<T> search, SelectChoicePoint<T> select) {
	    boolean returnCode = super.executeAfterSolution(search, select);
	    if (costVariable != null)
		costValue = ((IntVar)costVariable).value();
	    FinalNumberSolutions++;
	    printSolution();
	    System.out.println("----------");
	    return returnCode;
	}
    }
    class DomainSizeComparator<T extends Var> implements Comparator<T> {
	DomainSizeComparator() { }
	public int compare(T o1, T o2) {
	    int v1 = o1.getSize();
	    int v2 = o2.getSize();
	    return v1 - v2;
	}
    }
}


Input:
	private <V> void requestAsynchronously(final AsyncCallback<V> callback,
			final HttpUriRequest request,
			final ResponseProcessor<V> responseProcessor) {
		Thread thread = new Thread() {
			public void run() {
				try {
					Log.d(TAG, "requesting asynchronously " + request.getURI());
					HttpResponse response = httpClient.execute(request);
					int statusCode = response.getStatusLine().getStatusCode();
					Log.d(TAG, "got response code " + statusCode);
					if (statusCode == 200) {
						V result = null;
						if (responseProcessor != null) {
							Log.d(TAG, "processing response");
							result = responseProcessor
									.processResponse(response);
						}
						Log.d(TAG, "onSuccess");
						callback.onSuccess(result);
					} else {
						Log.d(TAG, "onFailure");
						callback.onFailure(null);
					}
					if (response.getEntity() != null) {
						response.getEntity().consumeContent();
					}
				} catch (ClientProtocolException e) {
					callback.onFailure(e);
				} catch (IOException e) {
					callback.onFailure(e);
				} catch (IllegalStateException e) {
					callback.onFailure(e);
				} catch (JSONException e) {
					callback.onFailure(e);
				}
			}
		};
		thread.start();
	}

Output:
	private <V> void requestAsynchronously(final AsyncCallback<V> callback,
			final HttpUriRequest request,
			final ResponseProcessor<V> responseProcessor) {
		Thread thread = new Thread() {
			public void run() {
				try {
					Log.d(TAG, "requesting asynchronously " + request.getURI());
					HttpResponse response = httpClient.execute(request);
					int statusCode = response.getStatusLine().getStatusCode();
					Log.d(TAG, "got response code " + statusCode);
					if (statusCode == 200) {
						V result = null;
						if (responseProcessor != null) {
							Log.d(TAG, "processing response");
							result = responseProcessor
									.processResponse(response);
						}
						Log.d(TAG, "onSuccess");
						callback.onSuccess(result);
					} else {
						Log.d(TAG, "onFailure");
						callback.onFailure(new Throwable("Unexpected status code: " + statusCode));
					}
					if (response.getEntity() != null) {
						response.getEntity().consumeContent();
					}
				} catch (ClientProtocolException e) {
					callback.onFailure(e);
				} catch (IOException e) {
					callback.onFailure(e);
				} catch (IllegalStateException e) {
					callback.onFailure(e);
				} catch (JSONException e) {
					callback.onFailure(e);
				}
			}
		};
		thread.start();
	}


Input:
    public Serializer newSerializer( final Class<?> type ) {
        if ( Component.class.isAssignableFrom( type ) ) {
            return new ReferenceFieldSerializerReflectionFactorySupport( _kryo, type );
        }
        return null;
    }

Output:
    public Serializer newSerializer( final Class<?> type ) {
        if ( Component.class.isAssignableFrom( type ) ) {
            final ReferenceFieldSerializerReflectionFactorySupport result = new ReferenceFieldSerializerReflectionFactorySupport( _kryo, type );
            result.setIgnoreSyntheticFields( false );
            return result;
        }
        return null;
    }


Input:
    public PlayheadView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        final Resources resources = context.getResources();
        mLinePaint = new Paint();
        mLinePaint.setColor(resources.getColor(R.color.playhead_tick_color));
        mLinePaint.setStrokeWidth(2);
        mLinePaint.setStyle(Paint.Style.STROKE);
        mTextPaint = new Paint();
        mTextPaint.setAntiAlias(true);
        mTextPaint.setColor(resources.getColor(R.color.playhead_tick_color));
        mTextPaint.setTextSize(18);
        mTicksHeight = (int)resources.getDimension(R.dimen.playhead_tick_height);
        final Display display = ((WindowManager)context.getSystemService(
                Context.WINDOW_SERVICE)).getDefaultDisplay();
        final DisplayMetrics metrics = new DisplayMetrics();
        display.getMetrics(metrics);
        mScreenWidth = metrics.widthPixels;
        mScrollListener = new ScrollViewListener() {
            public void onScrollBegin(View view, int scrollX, int scrollY, boolean appScroll) {
            }
            public void onScrollProgress(View view, int scrollX, int scrollY, boolean appScroll) {
                mScrollX = scrollX;
            }
            public void onScrollEnd(View view, int scrollX, int scrollY, boolean appScroll) {
                mScrollX = scrollX;
                invalidate();
            }
        };
    }

Output:
    public PlayheadView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        final Resources resources = context.getResources();
        mLinePaint = new Paint();
        mLinePaint.setColor(resources.getColor(R.color.playhead_tick_color));
        mLinePaint.setStrokeWidth(2);
        mLinePaint.setStyle(Paint.Style.STROKE);
        mTextPaint = new Paint();
        mTextPaint.setAntiAlias(true);
        mTextPaint.setColor(resources.getColor(R.color.playhead_tick_color));
        mTextPaint.setTextSize(18);
        mTicksHeight = (int)resources.getDimension(R.dimen.playhead_tick_height);
        final Display display = ((WindowManager)context.getSystemService(
                Context.WINDOW_SERVICE)).getDefaultDisplay();
        final DisplayMetrics metrics = new DisplayMetrics();
        display.getMetrics(metrics);
        mScreenWidth = metrics.widthPixels;
        mScrollListener = new ScrollViewListener() {
            public void onScrollBegin(View view, int scrollX, int scrollY, boolean appScroll) {
            }
            public void onScrollProgress(View view, int scrollX, int scrollY, boolean appScroll) {
                mScrollX = scrollX;
                invalidate();
            }
            public void onScrollEnd(View view, int scrollX, int scrollY, boolean appScroll) {
                mScrollX = scrollX;
                invalidate();
            }
        };
    }


Input:
	public void neighbourChanged(Tile tile) {
		final Tile w = level.getTile(x - 1, y);
		final Tile n = level.getTile(x, y - 1);
		final Tile s = level.getTile(x, y + 1);
		final Tile e = level.getTile(x + 1, y);
		int index = 0;
		if (w != null && w.castShadow())
			index |= 0x4;
		if (n != null && n.castShadow())
			index |= 0x2;
		if (e != null && e.castShadow())
			index |= 0x1;
		if (n instanceof SandTile) {
			img = 4 + 8;
			index = 0;
		}
		if (s instanceof SandTile) {
			img = 5 + 8;
			index = 0;
		}
		if (index > 0) {
			int imageIndex = shadowImages[index];
			if (imageIndex < 4)
				img = Art.floorTiles.length + (imageIndex & 3);
			else
				img = 2 * Art.floorTiles.length + (imageIndex & 3);
		}
		minimapColor = Art.floorTileColors[img & 7][img / 8];
	}

Output:
	public void neighbourChanged(Tile tile) {
		final Tile w = level.getTile(x - 1, y);
		final Tile n = level.getTile(x, y - 1);
		final Tile s = level.getTile(x, y + 1);
		final Tile e = level.getTile(x + 1, y);
		int index = 0;
		if (w != null && w.castShadow())
			index |= 0x4;
		if (n != null && n.castShadow())
			index |= 0x2;
		if (e != null && e.castShadow())
			index |= 0x1;
		if (n instanceof SandTile) {
			img = 4 + 8;
			index = 0;
		}
		if (s instanceof SandTile) {
			img = 5 + 8;
			index = 0;
		}
		if (index > 0) {
			int imageIndex = shadowImages[index];
			if (imageIndex < 4)
				img = Art.floorTiles.length + (imageIndex & 3);
			else
				img = 2 * Art.floorTiles.length + (imageIndex & 3);
		} else {
		    img = 3;
		}
		minimapColor = Art.floorTileColors[img & 7][img / 8];
	}