Index: src/ResolvExpr/AlternativeFinder.cc
===================================================================
--- src/ResolvExpr/AlternativeFinder.cc	(revision eba74ba03a2c29999def828ffaf6afc87e2b40d1)
+++ src/ResolvExpr/AlternativeFinder.cc	(revision 1ed958c38e6aaf12525b373df228b8bdfe25d2fb)
@@ -462,9 +462,5 @@
 	}
 
-	// /// Map of declaration uniqueIds (intended to be the assertions in an AssertionSet) to their parents and the number of times they've been included
-	//typedef std::unordered_map< UniqueId, std::unordered_map< UniqueId, unsigned > > AssertionParentSet;
-
 	static const int recursionLimit = /*10*/ 4;  ///< Limit to depth of recursion satisfaction
-	//static const unsigned recursionParentLimit = 1;  ///< Limit to the number of times an assertion can recursively use itself
 
 	void addToIndexer( AssertionSet &assertSet, SymTab::Indexer &indexer ) {
@@ -477,6 +473,5 @@
 
 	template< typename ForwardIterator, typename OutputIterator >
-	void inferRecursive( ForwardIterator begin, ForwardIterator end, const Alternative &newAlt, OpenVarSet &openVars, const SymTab::Indexer &decls, const AssertionSet &newNeed, /*const AssertionParentSet &needParents,*/
-						 int level, const SymTab::Indexer &indexer, OutputIterator out ) {
+	void inferRecursive( ForwardIterator begin, ForwardIterator end, const Alternative &newAlt, OpenVarSet &openVars, const SymTab::Indexer &decls, const AssertionSet &newNeed, int level, const SymTab::Indexer &indexer, OutputIterator out ) {
 		if ( begin == end ) {
 			if ( newNeed.empty() ) {
@@ -496,5 +491,5 @@
 					printAssertionSet( newNeed, std::cerr, 8 );
 				)
-				inferRecursive( newNeed.begin(), newNeed.end(), newAlt, openVars, decls, newerNeed, /*needParents,*/ level+1, indexer, out );
+				inferRecursive( newNeed.begin(), newNeed.end(), newAlt, openVars, decls, newerNeed, level+1, indexer, out );
 				return;
 			}
@@ -503,5 +498,5 @@
 		ForwardIterator cur = begin++;
 		if ( ! cur->second.isUsed ) {
-			inferRecursive( begin, end, newAlt, openVars, decls, newNeed, /*needParents,*/ level, indexer, out );
+			inferRecursive( begin, end, newAlt, openVars, decls, newNeed, level, indexer, out );
 			return; // xxx - should this continue? previously this wasn't here, and it looks like it should be
 		}
@@ -556,9 +551,4 @@
 				}
 
-				//AssertionParentSet newNeedParents( needParents );
-				// skip repeatingly-self-recursive assertion satisfaction
-				// DOESN'T WORK: grandchild nodes conflict with their cousins
-				//if ( newNeedParents[ curDecl->get_uniqueId() ][ candDecl->get_uniqueId() ]++ > recursionParentLimit ) continue;
-
 				Expression *varExpr = data.combine( newerAlt.cvtCost );
 				varExpr->set_result( adjType->clone() );
@@ -575,7 +565,7 @@
 					inferParameters = (*inferParameters)[ id ].inferParams.get();
 				}
-				// XXX: this is a memory leak, but adjType can't be deleted because it might contain assertions
+				
 				(*inferParameters)[ curDecl->get_uniqueId() ] = ParamEntry( candidate->get_uniqueId(), adjType->clone(), curDecl->get_type()->clone(), varExpr );
-				inferRecursive( begin, end, newerAlt, newOpenVars, newDecls, newerNeed, /*newNeedParents,*/ level, indexer, out );
+				inferRecursive( begin, end, newerAlt, newOpenVars, newDecls, newerNeed, level, indexer, out );
 			}
 		}
@@ -597,5 +587,4 @@
 		addToIndexer( have, decls );
 		AssertionSet newNeed;
-		//AssertionParentSet needParents;
 		PRINT(
 			std::cerr << "env is: " << std::endl;
@@ -604,5 +593,5 @@
 		)
 
-		inferRecursive( need.begin(), need.end(), newAlt, openVars, decls, newNeed, /*needParents,*/ 0, indexer, out );
+		inferRecursive( need.begin(), need.end(), newAlt, openVars, decls, newNeed, 0, indexer, out );
 //	PRINT(
 //	    std::cerr << "declaration 14 is ";
@@ -637,10 +626,10 @@
 
 		ArgPack()
-			: parent(0), expr(), cost(Cost::zero), env(), need(), have(), openVars(), nextArg(0),
-			  tupleStart(0), nextExpl(0), explAlt(0) {}
+			: parent(0), expr(nullptr), cost(Cost::zero), env(), need(), have(), openVars(), 
+			  nextArg(0), tupleStart(0), nextExpl(0), explAlt(0) {}
 
 		ArgPack(const TypeEnvironment& env, const AssertionSet& need, const AssertionSet& have,
 				const OpenVarSet& openVars)
-			: parent(0), expr(), cost(Cost::zero), env(env), need(need), have(have),
+			: parent(0), expr(nullptr), cost(Cost::zero), env(env), need(need), have(have),
 			  openVars(openVars), nextArg(0), tupleStart(0), nextExpl(0), explAlt(0) {}
 
@@ -649,5 +638,5 @@
 				unsigned tupleStart = 0, Cost cost = Cost::zero, unsigned nextExpl = 0,
 				unsigned explAlt = 0 )
-			: parent(parent), expr(expr->clone()), cost(cost), env(move(env)), need(move(need)),
+			: parent(parent), expr(expr), cost(cost), env(move(env)), need(move(need)),
 			  have(move(have)), openVars(move(openVars)), nextArg(nextArg), tupleStart(tupleStart),
 			  nextExpl(nextExpl), explAlt(explAlt) {}
@@ -655,7 +644,7 @@
 		ArgPack(const ArgPack& o, TypeEnvironment&& env, AssertionSet&& need, AssertionSet&& have,
 				OpenVarSet&& openVars, unsigned nextArg, Cost added )
-			: parent(o.parent), expr(o.expr ? o.expr->clone() : nullptr), cost(o.cost + added),
-			  env(move(env)), need(move(need)), have(move(have)), openVars(move(openVars)),
-			  nextArg(nextArg), tupleStart(o.tupleStart), nextExpl(0), explAlt(0) {}
+			: parent(o.parent), expr(o.expr), cost(o.cost + added), env(move(env)), 
+			  need(move(need)), have(move(have)), openVars(move(openVars)), nextArg(nextArg), 
+			  tupleStart(o.tupleStart), nextExpl(0), explAlt(0) {}
 
 		/// true iff this pack is in the middle of an exploded argument
