src-gu/mir-reasoner/src/reasoner/LocalReasoner.java
//Adds to the provenance map if the articulation isn't Given
Adds to the provenance map if the articulation isn't Given
Adds to the provenance map if the articulation isn ' t Given
private void addProvenance(TaxonPair tp, Taxon t1, String articulation, Taxon t2){
		if(isNewArticulation){
			String reason = t1.toString() + " " + articulation + " " + t2.toString() + ", ";
			if(provenance.containsKey(tp)){
				if(!provenance.get(tp).equals("Given")){
					if(!provenance.get(tp).contains(reason.substring(0, reason.length()-2)))
						provenance.put(tp, provenance.get(tp) + ", " + reason);
					else
						return;
				}
			}
			else{
				provenance.put(tp, reason);
			}
			if(tp.getTaxon1().equals(t1)){
				if(t1.getNamespace().equals(T1Namespace)){
					for(Map.Entry<TaxonPair, String> entry : T2Intrarelations.entrySet()){
						if(entry.getKey().getTaxon1().equals(t2) && entry.getKey().getTaxon2().equals(tp.getTaxon2())){
							String reason2 = entry.getKey().getTaxon1() + " " + entry.getValue() + " " + entry.getKey().getTaxon2() + ", ";
							if(!provenance.get(tp).equals("Given")){
								provenance.put(tp, provenance.get(tp) + reason2);
							}
						}
					}
				}
				else if(t1.getNamespace().equals(T2Namespace)){
					for(Map.Entry<TaxonPair, String> entry : T1Intrarelations.entrySet()){
						if(entry.getKey().getTaxon1().equals(t2) && entry.getKey().getTaxon2().equals(tp.getTaxon2())){
							String reason2 = entry.getKey().getTaxon1() + " " + entry.getValue() + " " + entry.getKey().getTaxon2() + ", ";
							if(!provenance.get(tp).equals("Given")){
								provenance.put(tp, provenance.get(tp) + reason2);
							}
						}
					}
				}
			}
			else if(tp.getTaxon2().equals(t2)){
				if(t2.getNamespace().equals(T1Namespace)){
					for(Map.Entry<TaxonPair, String> entry : T2Intrarelations.entrySet()){
						if(entry.getKey().getTaxon2().equals(t1) && entry.getKey().getTaxon1().equals(tp.getTaxon1())){
							String reason2 = entry.getKey().getTaxon1() + " " + entry.getValue() + " " + entry.getKey().getTaxon2() + ", ";
							if(!provenance.get(tp).equals("Given")){
								provenance.put(tp, provenance.get(tp) + reason2);
							}
						}
					}
				}
				else if(t2.getNamespace().equals(T2Namespace)){
					for(Map.Entry<TaxonPair, String> entry : T1Intrarelations.entrySet()){
						if(entry.getKey().getTaxon2().equals(t1) && entry.getKey().getTaxon1().equals(tp.getTaxon1())){
							String reason2 = entry.getKey().getTaxon1() + " " + entry.getValue() + " " + entry.getKey().getTaxon2() + ", ";
							if(!provenance.get(tp).equals("Given")){
								provenance.put(tp, provenance.get(tp) + reason2);
							}
						}
					}
				}
			}
		}
	}
private void addProvenance ( TaxonPair tp , Taxon t1 , String articulation , Taxon t2 ) { if ( isNewArticulation ) { String reason = t1 . toString ( ) + " " + articulation + " " + t2 . toString ( ) + ", " ; if ( provenance . containsKey ( tp ) ) { if ( ! provenance . get ( tp ) . equals ( "Given" ) ) { if ( ! provenance . get ( tp ) . contains ( reason . substring ( 0 , reason . length ( ) - 2 ) ) ) provenance . put ( tp , provenance . get ( tp ) + ", " + reason ) ; else return ; } } else { provenance . put ( tp , reason ) ; } if ( tp . getTaxon1 ( ) . equals ( t1 ) ) { if ( t1 . getNamespace ( ) . equals ( T1Namespace ) ) { for ( Map . Entry < TaxonPair , String > entry : T2Intrarelations . entrySet ( ) ) { if ( entry . getKey ( ) . getTaxon1 ( ) . equals ( t2 ) && entry . getKey ( ) . getTaxon2 ( ) . equals ( tp . getTaxon2 ( ) ) ) { String reason2 = entry . getKey ( ) . getTaxon1 ( ) + " " + entry . getValue ( ) + " " + entry . getKey ( ) . getTaxon2 ( ) + ", " ; if ( ! provenance . get ( tp ) . equals ( "Given" ) ) { provenance . put ( tp , provenance . get ( tp ) + reason2 ) ; } } } } else if ( t1 . getNamespace ( ) . equals ( T2Namespace ) ) { for ( Map . Entry < TaxonPair , String > entry : T1Intrarelations . entrySet ( ) ) { if ( entry . getKey ( ) . getTaxon1 ( ) . equals ( t2 ) && entry . getKey ( ) . getTaxon2 ( ) . equals ( tp . getTaxon2 ( ) ) ) { String reason2 = entry . getKey ( ) . getTaxon1 ( ) + " " + entry . getValue ( ) + " " + entry . getKey ( ) . getTaxon2 ( ) + ", " ; if ( ! provenance . get ( tp ) . equals ( "Given" ) ) { provenance . put ( tp , provenance . get ( tp ) + reason2 ) ; } } } } } else if ( tp . getTaxon2 ( ) . equals ( t2 ) ) { if ( t2 . getNamespace ( ) . equals ( T1Namespace ) ) { for ( Map . Entry < TaxonPair , String > entry : T2Intrarelations . entrySet ( ) ) { if ( entry . getKey ( ) . getTaxon2 ( ) . equals ( t1 ) && entry . getKey ( ) . getTaxon1 ( ) . equals ( tp . getTaxon1 ( ) ) ) { String reason2 = entry . getKey ( ) . getTaxon1 ( ) + " " + entry . getValue ( ) + " " + entry . getKey ( ) . getTaxon2 ( ) + ", " ; if ( ! provenance . get ( tp ) . equals ( "Given" ) ) { provenance . put ( tp , provenance . get ( tp ) + reason2 ) ; } } } } else if ( t2 . getNamespace ( ) . equals ( T2Namespace ) ) { for ( Map . Entry < TaxonPair , String > entry : T1Intrarelations . entrySet ( ) ) { if ( entry . getKey ( ) . getTaxon2 ( ) . equals ( t1 ) && entry . getKey ( ) . getTaxon1 ( ) . equals ( tp . getTaxon1 ( ) ) ) { String reason2 = entry . getKey ( ) . getTaxon1 ( ) + " " + entry . getValue ( ) + " " + entry . getKey ( ) . getTaxon2 ( ) + ", " ; if ( ! provenance . get ( tp ) . equals ( "Given" ) ) { provenance . put ( tp , provenance . get ( tp ) + reason2 ) ; } } } } } } }
Adds to the provenance map if the articulation isn't Given
Adds to the provenance map if the articulation isn ' t Given