src-gu/mir-reasoner/src/reasoner/ApplyMIRReasonerPW.java
//Recursive function to find all possible worlds
Recursive function to find all possible worlds
Recursive function to find all possible worlds
private static void runPW(TaxonomyInfo original, TaxonomyInfo input, PrintStream output, String outputType, Map<TaxonPair, String> localProvenance, Map<TaxonPair, String> globalProvenance) throws IOException{
		MIRReasoner reasoner = new MIRReasoner(true);
		PossibleWorlds pw = new PossibleWorlds(input);
		long numWorlds = pw.getNumWorlds();
		if(numWorlds != 1){
			ArrayList<TaxonomyInfo> worlds = pw.createAllWorlds(input);
			for(TaxonomyInfo ti : worlds){
				reasoner.setEverythingPW(original, ti, localProvenance, globalProvenance);
				if(!reasoner.runReasoner()){}
				else{
					runPW(original, createTaxonomyInfo(reasoner.getArticulations(), reasoner.getT1(), reasoner.getT2()), output, outputType, reasoner.getLocalProvenance(), reasoner.getGlobalProvenance());
				}
			}
		}
		else{
				input.printTaxonomiesPW(output, getFormatType(outputType), input.getT1(), input.getT2(), pw.createArticulations(input), localProvenance, globalProvenance, worldNum++, isProvenance);
		}
	}
private static void runPW ( TaxonomyInfo original , TaxonomyInfo input , PrintStream output , String outputType , Map < TaxonPair , String > localProvenance , Map < TaxonPair , String > globalProvenance ) throws IOException { MIRReasoner reasoner = new MIRReasoner ( true ) ; PossibleWorlds pw = new PossibleWorlds ( input ) ; long numWorlds = pw . getNumWorlds ( ) ; if ( numWorlds != 1 ) { ArrayList < TaxonomyInfo > worlds = pw . createAllWorlds ( input ) ; for ( TaxonomyInfo ti : worlds ) { reasoner . setEverythingPW ( original , ti , localProvenance , globalProvenance ) ; if ( ! reasoner . runReasoner ( ) ) { } else { runPW ( original , createTaxonomyInfo ( reasoner . getArticulations ( ) , reasoner . getT1 ( ) , reasoner . getT2 ( ) ) , output , outputType , reasoner . getLocalProvenance ( ) , reasoner . getGlobalProvenance ( ) ) ; } } } else { input . printTaxonomiesPW ( output , getFormatType ( outputType ) , input . getT1 ( ) , input . getT2 ( ) , pw . createArticulations ( input ) , localProvenance , globalProvenance , worldNum ++ , isProvenance ) ; } }
Recursive function to find all possible worlds
Recursive function to find all possible worlds
//if(numWorlds != 1 && maxWorlds > 0){ //if(maxWorlds > 0) //maxWorlds--;