Index: translator/ArgTweak/FunctionFixer.cc
===================================================================
--- translator/ArgTweak/FunctionFixer.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ArgTweak/FunctionFixer.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -56,5 +56,5 @@
 						if ( ( candidateExists = align( f->get_parameters(), untypedExpr->get_args(), Matcher() ) ) ) break;
 
-					if ( !candidateExists ) throw SemanticError("Error in function call");
+					if ( ! candidateExists ) throw SemanticError("Error in function call");
 				} // if
 			} // for
Index: translator/CodeGen/CodeGenerator2.cc
===================================================================
--- translator/CodeGen/CodeGenerator2.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/CodeGen/CodeGenerator2.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -553,5 +553,5 @@
 	    before << "do" ;
 	else {
-	    before << "while(" ;
+	    before << "while (" ;
 	    whileStmt->get_condition()->accept(*this );
 	    after += ")";
@@ -565,5 +565,5 @@
 
 	if ( whileStmt->get_isDoWhile() ) {
-	    before << " while(" ;
+	    before << " while (" ;
 	    whileStmt->get_condition()->accept(*this );
 	    after += ");";
Index: translator/CodeGen/CodeGenerator2.h
===================================================================
--- translator/CodeGen/CodeGenerator2.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/CodeGen/CodeGenerator2.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -97,5 +97,5 @@
     inline bool doSemicolon( Declaration* decl ) {
 	if ( FunctionDecl* func = dynamic_cast< FunctionDecl* >( decl ) ) {
-	    return !func->get_statements();
+	    return ! func->get_statements();
 	}
 	return true;
Index: translator/CodeGen/FixNames.cc
===================================================================
--- translator/CodeGen/FixNames.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/CodeGen/FixNames.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -32,6 +32,6 @@
 fixDWT( DeclarationWithType *dwt )
 {
-  if( dwt->get_name() != "" ) {
-    if( LinkageSpec::isDecoratable( dwt->get_linkage() ) ) {
+  if ( dwt->get_name() != "" ) {
+    if ( LinkageSpec::isDecoratable( dwt->get_linkage() ) ) {
       dwt->set_mangleName( SymTab::Mangler::mangle( dwt ) );
     }
Index: translator/CodeGen/OperatorTable.cc
===================================================================
--- translator/CodeGen/OperatorTable.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/CodeGen/OperatorTable.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -64,5 +64,5 @@
 initialize()
 {
-  for( int i = 0; i < numOps; ++i ) {
+  for ( int i = 0; i < numOps; ++i ) {
     table[ tableValues[i].inputName ] = tableValues[i];
   }
@@ -75,9 +75,9 @@
 {
   static bool init = false;
-  if( !init ) {
+  if ( ! init ) {
     initialize();
   }
   std::map< std::string, OperatorInfo >::const_iterator i = table.find( funcName );
-  if( i == table.end() ) {
+  if ( i == table.end() ) {
     return false;
   } else {
Index: translator/Common/utility.h
===================================================================
--- translator/Common/utility.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Common/utility.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -22,5 +22,5 @@
 maybeClone( const T *orig )
 {
-  if( orig ) {
+  if ( orig ) {
     return orig->clone();
   } else {
@@ -33,5 +33,5 @@
 maybeBuild( const U *orig )
 {
-  if( orig ) {
+  if ( orig ) {
     return orig->build();
   } else {
@@ -44,5 +44,5 @@
 printEnums( Input_iterator begin, Input_iterator end, const char * const *name_array, std::ostream &os )
 {
-  for( Input_iterator i = begin; i != end; ++i ) {
+  for ( Input_iterator i = begin; i != end; ++i ) {
     os << name_array[ *i ] << ' ';
   }
@@ -53,5 +53,5 @@
 deleteAll( Container &container )
 {
-  for( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
+  for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
     delete *i;
   }
@@ -62,6 +62,6 @@
 printAll( const Container &container, std::ostream &os, int indent = 0 )
 {
-  for( typename Container::const_iterator i = container.begin(); i != container.end(); ++i ) {
-    if( *i ) {
+  for ( typename Container::const_iterator i = container.begin(); i != container.end(); ++i ) {
+    if ( *i ) {
       os << std::string(indent,  ' ');
       (*i)->print( os, indent + 2 );
@@ -77,5 +77,5 @@
   typename SrcContainer::const_iterator in = src.begin();
   std::back_insert_iterator< DestContainer > out( dest );
-  while( in != src.end() ) {
+  while ( in != src.end() ) {
     *out++ = (*in++)->clone();
   }
@@ -87,6 +87,6 @@
 {
   int count = 0;
-  for( typename Container::const_iterator i = container.begin(); i != container.end(); ++i ) {
-    if( !(*i) ) {
+  for ( typename Container::const_iterator i = container.begin(); i != container.end(); ++i ) {
+    if ( !(*i) ) {
       std::cerr << count << " is null" << std::endl;
     }
@@ -97,5 +97,5 @@
 assign_strptr( std::string *str )
 {
-  if( str == 0 ) {
+  if ( str == 0 ) {
     return "";
   } else {
@@ -115,5 +115,5 @@
 std::list<T> tail( std::list<T> l )
 {
-  if(! l.empty()){
+  if (! l.empty()){
     std::list<T> ret(++(l.begin()), l.end());
     return ret;
@@ -127,5 +127,5 @@
   Ts ret;
 
-  switch( l.size() ){
+  switch ( l.size() ){
   case 0:
     return ret;
@@ -193,5 +193,5 @@
 {
   while ( begin++ != end )
-    if( pred(*begin) ) *out++ = *begin;
+    if ( pred(*begin) ) *out++ = *begin;
 
   return;
@@ -200,5 +200,5 @@
 template< class InputIterator1, class InputIterator2, class OutputIterator >
 void zip( InputIterator1 b1, InputIterator1 e1, InputIterator2 b2, InputIterator2 e2, OutputIterator out ) {
-  while( b1 != e1 && b2 != e2 )
+  while ( b1 != e1 && b2 != e2 )
     *out++ = std::pair<typename InputIterator1::value_type, typename InputIterator2::value_type>(*b1++, *b2++);
 }
@@ -206,5 +206,5 @@
 template< class InputIterator1, class InputIterator2, class OutputIterator, class BinFunction >
 void zipWith( InputIterator1 b1, InputIterator1 e1, InputIterator2 b2, InputIterator2 e2, OutputIterator out, BinFunction func ) {
-  while( b1 != e1 && b2 != e2 )
+  while ( b1 != e1 && b2 != e2 )
     *out++ = func(*b1++, *b2++);
 }
Index: translator/ControlStruct/CaseRangeMutator.cc
===================================================================
--- translator/ControlStruct/CaseRangeMutator.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ControlStruct/CaseRangeMutator.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -117,5 +117,5 @@
 			if ( ch_lo > ch_hi ) { char t=ch_lo; ch_lo=ch_hi; ch_hi=t; }
 
-			for( char c = ch_lo; c <=  ch_hi; c++ ){
+			for ( char c = ch_lo; c <=  ch_hi; c++ ){
 			    Type::Qualifiers q;
 			    Constant cnst( new BasicType(q, BasicType::Char),
@@ -154,5 +154,5 @@
 		  if ( i_lo > i_hi ) { int t=i_lo; i_lo=i_hi; i_hi=t; }
 
-		  for( int c = i_lo; c <=  i_hi; c++ ){
+		  for ( int c = i_lo; c <=  i_hi; c++ ){
 		      Type::Qualifiers q;
 		      Constant cnst( new BasicType(q, ty_hi->get_kind()), // figure can't hurt (used to think in positives)
Index: translator/ControlStruct/MLEMutator.cc
===================================================================
--- translator/ControlStruct/MLEMutator.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ControlStruct/MLEMutator.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -23,5 +23,5 @@
 	    *k = (*k)->acceptMutator(*this);
 
-	    if ( !get_breakLabel().empty() ) {
+	    if ( ! get_breakLabel().empty() ) {
 		std::list< Statement * >::iterator next = k; next++;
 		if ( next == kids.end() ) {
@@ -98,5 +98,5 @@
 
 	Label newLabel;
-	switch( branchStmt->get_type() ) {
+	switch ( branchStmt->get_type() ) {
 	  case BranchStmt::Break:
 	    if ( check->get_breakExit() != "" )
Index: translator/GenPoly/Box.cc
===================================================================
--- translator/GenPoly/Box.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/GenPoly/Box.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -110,5 +110,5 @@
     void printAllNotBuiltin( const std::list< Declaration *>& translationUnit, std::ostream &os ) {
 	for ( std::list< Declaration *>::const_iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) {
-	    if ( !LinkageSpec::isBuiltin( (*i)->get_linkage() ) ) {
+	    if ( ! LinkageSpec::isBuiltin( (*i)->get_linkage() ) ) {
 		(*i)->print( os );
 		os << std::endl;
@@ -135,5 +135,5 @@
 	bool isPolyRet( FunctionType *function, std::string &name, const TyVarMap &otherTyVars ) {
 	    bool doTransform = false;
-	    if ( !function->get_returnVals().empty() ) {
+	    if ( ! function->get_returnVals().empty() ) {
 		if ( TypeInstType *typeInst = dynamic_cast< TypeInstType *>( function->get_returnVals().front()->get_type() ) ) {
     
@@ -146,5 +146,5 @@
 			} // if
 		    } // for
-		    if ( !doTransform && otherTyVars.find( typeInst->get_name() ) != otherTyVars.end() ) {
+		    if ( ! doTransform && otherTyVars.find( typeInst->get_name() ) != otherTyVars.end() ) {
 			doTransform = true;
 		    } // if
@@ -304,5 +304,5 @@
 		ObjectDecl *newObj = makeTemporary( retType->clone() );
 		Expression *paramExpr = new VariableExpr( newObj );
-		if ( !isPolyType( newObj->get_type(), env, scopeTyVars ) ) {
+		if ( ! isPolyType( newObj->get_type(), env, scopeTyVars ) ) {
 		    paramExpr = new AddressExpr( paramExpr );
 		} // if
@@ -330,5 +330,5 @@
 	Expression *Pass1::applyAdapter( ApplicationExpr *appExpr, FunctionType *function, std::list< Expression *>::iterator &arg, const TyVarMap &tyVars ) {
 	    Expression *ret = appExpr;
-	    if ( !function->get_returnVals().empty() && isPolyVal( function->get_returnVals().front()->get_type(), tyVars ) ) {
+	    if ( ! function->get_returnVals().empty() && isPolyVal( function->get_returnVals().front()->get_type(), tyVars ) ) {
 		ret = addRetParam( appExpr, function, function->get_returnVals().front()->get_type(), arg );
 	    } // if
@@ -343,6 +343,6 @@
 
 	void Pass1::boxParam( Type *param, Expression *&arg, const TyVarMap &exprTyVars ) {
-	    assert( !arg->get_results().empty() );
-///   if ( !dynamic_cast< PointerType *>( arg->get_results().front() ) ) {
+	    assert( ! arg->get_results().empty() );
+///   if ( ! dynamic_cast< PointerType *>( arg->get_results().front() ) ) {
 	    TypeInstType *typeInst = dynamic_cast< TypeInstType *>( param );
 	    if ( typeInst && exprTyVars.find( typeInst->get_name() ) != exprTyVars.end() ) {
@@ -373,5 +373,5 @@
 	    // any function mentioning a polymorphic type
 	    findAndReplaceFunction( newType, functions, tyVars, needsAdapter );
-	    if ( !functions.empty() ) {
+	    if ( ! functions.empty() ) {
 		actual = new CastExpr( actual, newType );
 	    } else {
@@ -422,5 +422,5 @@
 	    // actually make the adapter type
 	    FunctionType *adapter = adaptee->clone();
-	    if ( !adapter->get_returnVals().empty() && isPolyVal( adapter->get_returnVals().front()->get_type(), tyVars ) ) {
+	    if ( ! adapter->get_returnVals().empty() && isPolyVal( adapter->get_returnVals().front()->get_type(), tyVars ) ) {
 		makeRetParm( adapter );
 	    } // if
@@ -611,9 +611,9 @@
 		if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic ) {
 		    if ( varExpr->get_var()->get_name() == "?[?]" ) {
-			assert( !appExpr->get_results().empty() );
+			assert( ! appExpr->get_results().empty() );
 			assert( appExpr->get_args().size() == 2 );
 			TypeInstType *typeInst1 = isPolyPtr( appExpr->get_args().front()->get_results().front(), env, scopeTyVars );
 			TypeInstType *typeInst2 = isPolyPtr( appExpr->get_args().back()->get_results().front(), env, scopeTyVars );
-			assert( !typeInst1 || !typeInst2 );
+			assert( ! typeInst1 || ! typeInst2 );
 			UntypedExpr *ret = 0;
 			if ( typeInst1 || typeInst2 ) {
@@ -644,6 +644,6 @@
 			} // if
 		    } else if ( varExpr->get_var()->get_name() == "*?" ) {
-			assert( !appExpr->get_results().empty() );
-			assert( !appExpr->get_args().empty() );
+			assert( ! appExpr->get_results().empty() );
+			assert( ! appExpr->get_args().empty() );
 			if ( isPolyType( appExpr->get_results().front(), env, scopeTyVars ) ) {
 			    Expression *ret = appExpr->get_args().front();
@@ -659,5 +659,5 @@
 			} // if
 		    } else if ( varExpr->get_var()->get_name() == "?++" || varExpr->get_var()->get_name() == "?--" ) {
-			assert( !appExpr->get_results().empty() );
+			assert( ! appExpr->get_results().empty() );
 			assert( appExpr->get_args().size() == 1 );
 			if ( TypeInstType *typeInst = isPolyPtr( appExpr->get_results().front(), env, scopeTyVars ) ) {
@@ -679,5 +679,5 @@
 			} // if
 		    } else if ( varExpr->get_var()->get_name() == "++?" || varExpr->get_var()->get_name() == "--?" ) {
-			assert( !appExpr->get_results().empty() );
+			assert( ! appExpr->get_results().empty() );
 			assert( appExpr->get_args().size() == 1 );
 			if ( TypeInstType *typeInst = isPolyPtr( appExpr->get_results().front(), env, scopeTyVars ) ) {
@@ -685,5 +685,5 @@
 			} // if
 		    } else if ( varExpr->get_var()->get_name() == "?+?" || varExpr->get_var()->get_name() == "?-?" ) {
-			assert( !appExpr->get_results().empty() );
+			assert( ! appExpr->get_results().empty() );
 			assert( appExpr->get_args().size() == 2 );
 			TypeInstType *typeInst1 = isPolyPtr( appExpr->get_args().front()->get_results().front(), env, scopeTyVars );
@@ -711,5 +711,5 @@
 			} // if
 		    } else if ( varExpr->get_var()->get_name() == "?+=?" || varExpr->get_var()->get_name() == "?-=?" ) {
-			assert( !appExpr->get_results().empty() );
+			assert( ! appExpr->get_results().empty() );
 			assert( appExpr->get_args().size() == 2 );
 			TypeInstType *typeInst = isPolyPtr( appExpr->get_results().front(), env, scopeTyVars );
@@ -739,5 +739,5 @@
 	    useRetval = oldUseRetval;
   
-	    assert( !appExpr->get_function()->get_results().empty() );
+	    assert( ! appExpr->get_function()->get_results().empty() );
 	    PointerType *pointer = dynamic_cast< PointerType *>( appExpr->get_function()->get_results().front() );
 	    assert( pointer );
@@ -784,5 +784,5 @@
 
 	Expression *Pass1::mutate( UntypedExpr *expr ) {
-	    if ( !expr->get_results().empty() && isPolyType( expr->get_results().front(), env, scopeTyVars ) ) {
+	    if ( ! expr->get_results().empty() && isPolyType( expr->get_results().front(), env, scopeTyVars ) ) {
 		if ( NameExpr *name = dynamic_cast< NameExpr *>( expr->get_function() ) ) {
 		    if ( name->get_name() == "*?" ) {
@@ -798,5 +798,5 @@
 
 	Expression *Pass1::mutate( AddressExpr *addrExpr ) {
-	    assert( !addrExpr->get_arg()->get_results().empty() );
+	    assert( ! addrExpr->get_arg()->get_results().empty() );
 	    addrExpr->set_arg( mutateExpression( addrExpr->get_arg() ) );
 	    if ( isPolyType( addrExpr->get_arg()->get_results().front(), env, scopeTyVars ) ) {
@@ -823,5 +823,5 @@
 	    }
 	    if ( retval && retStmt->get_expr() ) {
-		assert( !retStmt->get_expr()->get_results().empty() );
+		assert( ! retStmt->get_expr()->get_results().empty() );
 		if ( retStmt->get_expr()->get_results().front()->get_isLvalue() ) {
 ///       retStmt->set_expr( mutateExpression( retStmt->get_expr() ) );
Index: translator/GenPoly/CopyParams.cc
===================================================================
--- translator/GenPoly/CopyParams.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/GenPoly/CopyParams.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -46,5 +46,5 @@
 		    } // if
 		} // for
-		for( std::list< DeclarationWithType* >::iterator param = funcDecl->get_functionType()->get_parameters().begin(); param != funcDecl->get_functionType()->get_parameters().end(); ++param ) {
+		for ( std::list< DeclarationWithType* >::iterator param = funcDecl->get_functionType()->get_parameters().begin(); param != funcDecl->get_functionType()->get_parameters().end(); ++param ) {
 		    std::set< UniqueId >::const_iterator var = modVars.find( (*param)->get_uniqueId() );
 		    if ( var != modVars.end() ) {
Index: translator/GenPoly/FindFunction.cc
===================================================================
--- translator/GenPoly/FindFunction.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/GenPoly/FindFunction.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -52,7 +52,7 @@
 FindFunction::handleForall( const std::list< TypeDecl* > &forall )
 {
-  for( std::list< TypeDecl* >::const_iterator i = forall.begin(); i != forall.end(); ++i ) {
+  for ( std::list< TypeDecl* >::const_iterator i = forall.begin(); i != forall.end(); ++i ) {
     TyVarMap::iterator var = tyVars.find( (*i)->get_name() );
-    if( var != tyVars.end() ) {
+    if ( var != tyVars.end() ) {
       tyVars.erase( var );
     }
@@ -67,7 +67,7 @@
   mutateAll( functionType->get_returnVals(), *this );
   Type *ret = functionType;
-  if( predicate( functionType, tyVars ) ) {
+  if ( predicate( functionType, tyVars ) ) {
     functions.push_back( functionType );
-    if( replaceMode ) {
+    if ( replaceMode ) {
       ret = new FunctionType( Type::Qualifiers(), true );
     }
Index: translator/GenPoly/GenPoly.cc
===================================================================
--- translator/GenPoly/GenPoly.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/GenPoly/GenPoly.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -26,6 +26,6 @@
 isPolyVal( Type *type, const TyVarMap &tyVars, bool considerAllTyVars )
 {
-  if( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) {
-    if( tyVars.find( typeInst->get_name() ) != tyVars.end() ) {
+  if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) {
+    if ( tyVars.find( typeInst->get_name() ) != tyVars.end() ) {
       return true;
     }
@@ -41,9 +41,9 @@
 {
   bool needsAdapter = false;
-  if( !adaptee->get_returnVals().empty() && isPolyVal( adaptee->get_returnVals().front()->get_type(), tyVars, considerAllTyVars ) ) {
+  if ( ! adaptee->get_returnVals().empty() && isPolyVal( adaptee->get_returnVals().front()->get_type(), tyVars, considerAllTyVars ) ) {
     needsAdapter = true;
   }
-  for( std::list< DeclarationWithType* >::const_iterator innerArg = adaptee->get_parameters().begin(); !needsAdapter && innerArg != adaptee->get_parameters().end(); ++innerArg ) {
-    if( isPolyVal( (*innerArg)->get_type(), tyVars, considerAllTyVars ) ) {
+  for ( std::list< DeclarationWithType* >::const_iterator innerArg = adaptee->get_parameters().begin(); ! needsAdapter && innerArg != adaptee->get_parameters().end(); ++innerArg ) {
+    if ( isPolyVal( (*innerArg)->get_type(), tyVars, considerAllTyVars ) ) {
       needsAdapter = true;
     }
@@ -56,5 +56,5 @@
 printTyVarMap( std::ostream &os, const TyVarMap &tyVarMap )
 {
-  for( TyVarMap::const_iterator i = tyVarMap.begin(); i != tyVarMap.end(); ++i ) {
+  for ( TyVarMap::const_iterator i = tyVarMap.begin(); i != tyVarMap.end(); ++i ) {
     os << i->first << " (" << i->second << ") ";
   }
Index: translator/GenPoly/Lvalue.cc
===================================================================
--- translator/GenPoly/Lvalue.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/GenPoly/Lvalue.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -67,5 +67,5 @@
 isLvalueRet( FunctionType *function )
 {
-  if( !function->get_returnVals().empty() ) {
+  if ( ! function->get_returnVals().empty() ) {
     return function->get_returnVals().front()->get_type()->get_isLvalue();
   } else {
@@ -77,5 +77,5 @@
 isIntrinsicApp( ApplicationExpr *appExpr )
 {
-  if( VariableExpr *varExpr = dynamic_cast< VariableExpr* >( appExpr->get_function() ) ) {
+  if ( VariableExpr *varExpr = dynamic_cast< VariableExpr* >( appExpr->get_function() ) ) {
     return varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic;
   } else {
@@ -91,8 +91,8 @@
 Pass1::mutate( FunctionDecl *funcDecl )
 {
-  if( funcDecl->get_statements() ) {
+  if ( funcDecl->get_statements() ) {
     DeclarationWithType* oldRetval = retval;
     retval = 0;
-    if( !LinkageSpec::isBuiltin( funcDecl->get_linkage() ) && isLvalueRet( funcDecl->get_functionType() ) ) {
+    if ( ! LinkageSpec::isBuiltin( funcDecl->get_linkage() ) && isLvalueRet( funcDecl->get_functionType() ) ) {
       retval = funcDecl->get_functionType()->get_returnVals().front();
     }
@@ -110,5 +110,5 @@
   mutateAll( appExpr->get_args(), *this );
   
-  assert( !appExpr->get_function()->get_results().empty() );
+  assert( ! appExpr->get_function()->get_results().empty() );
 
   PointerType *pointer = dynamic_cast< PointerType* >( appExpr->get_function()->get_results().front() );
@@ -118,5 +118,5 @@
 
   std::string typeName;
-  if( isLvalueRet( function ) && !isIntrinsicApp( appExpr ) ) {
+  if ( isLvalueRet( function ) && ! isIntrinsicApp( appExpr ) ) {
     UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) );
     deref->get_results().push_back( appExpr->get_results().front() );
@@ -132,7 +132,7 @@
 Pass1::mutate(ReturnStmt *retStmt)
 {
-  if( retval && retStmt->get_expr() ) {
-    assert( !retStmt->get_expr()->get_results().empty() );
-    while( CastExpr *castExpr = dynamic_cast< CastExpr* >( retStmt->get_expr() ) ) {
+  if ( retval && retStmt->get_expr() ) {
+    assert( ! retStmt->get_expr()->get_results().empty() );
+    while ( CastExpr *castExpr = dynamic_cast< CastExpr* >( retStmt->get_expr() ) ) {
       retStmt->set_expr( castExpr->get_arg() );
       retStmt->get_expr()->set_env( castExpr->get_env() );
@@ -141,5 +141,5 @@
       delete castExpr;
     }
-    if( retStmt->get_expr()->get_results().front()->get_isLvalue() ) {
+    if ( retStmt->get_expr()->get_results().front()->get_isLvalue() ) {
       retStmt->set_expr( new AddressExpr( retStmt->get_expr()->acceptMutator( *this ) ) );
     } else {
@@ -154,5 +154,5 @@
 {
   std::string typeName;
-  if( isLvalueRet( funType ) ) {
+  if ( isLvalueRet( funType ) ) {
     DeclarationWithType *retParm = funType->get_returnVals().front();
     
Index: translator/GenPoly/PolyMutator.cc
===================================================================
--- translator/GenPoly/PolyMutator.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/GenPoly/PolyMutator.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -28,14 +28,14 @@
 PolyMutator::mutateStatementList( std::list< Statement* > &statements )
 {
-  for( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) {
-    if( !stmtsToAddAfter.empty() ) {
+  for ( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) {
+    if ( ! stmtsToAddAfter.empty() ) {
       statements.splice( i, stmtsToAddAfter );
     }
     *i = (*i)->acceptMutator( *this );
-    if( !stmtsToAdd.empty() ) {
+    if ( ! stmtsToAdd.empty() ) {
       statements.splice( i, stmtsToAdd );
     }
   }
-  if( !stmtsToAddAfter.empty() ) {
+  if ( ! stmtsToAddAfter.empty() ) {
     statements.splice( statements.end(), stmtsToAddAfter );
   }
@@ -46,5 +46,5 @@
 {
   Statement *newStmt = maybeMutate( stmt, *this );
-  if( !stmtsToAdd.empty() || !stmtsToAddAfter.empty() ) {
+  if ( ! stmtsToAdd.empty() || ! stmtsToAddAfter.empty() ) {
     CompoundStmt *compound = new CompoundStmt( noLabels );
     compound->get_kids().splice( compound->get_kids().end(), stmtsToAdd );
@@ -61,6 +61,6 @@
 PolyMutator::mutateExpression( Expression *expr )
 {
-  if( expr ) {
-    if( expr->get_env() ) {
+  if ( expr ) {
+    if ( expr->get_env() ) {
       env = expr->get_env();
     }
@@ -167,5 +167,5 @@
 PolyMutator::mutate(UntypedExpr *untypedExpr)
 {
-  for( std::list< Expression* >::iterator i = untypedExpr->get_args().begin(); i != untypedExpr->get_args().end(); ++i ) {
+  for ( std::list< Expression* >::iterator i = untypedExpr->get_args().begin(); i != untypedExpr->get_args().end(); ++i ) {
     *i = mutateExpression( *i );
   }
@@ -177,9 +177,9 @@
 PolyMutator::makeTyVarMap( Type *type, TyVarMap &tyVarMap )
 {
-  for( std::list< TypeDecl* >::const_iterator tyVar = type->get_forall().begin(); tyVar != type->get_forall().end(); ++tyVar ) {
+  for ( std::list< TypeDecl* >::const_iterator tyVar = type->get_forall().begin(); tyVar != type->get_forall().end(); ++tyVar ) {
     assert( *tyVar );
     tyVarMap[ (*tyVar)->get_name() ] = (*tyVar)->get_kind();
   }
-  if( PointerType *pointer = dynamic_cast< PointerType* >( type ) ) {
+  if ( PointerType *pointer = dynamic_cast< PointerType* >( type ) ) {
     makeTyVarMap( pointer->get_base(), tyVarMap );
   }
Index: translator/GenPoly/ScrubTyVars.cc
===================================================================
--- translator/GenPoly/ScrubTyVars.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/GenPoly/ScrubTyVars.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -11,5 +11,5 @@
 	TyVarMap::const_iterator tyVar = tyVars.find( typeInst->get_name() );
 	if ( doAll || tyVar != tyVars.end() ) {
-	    switch( tyVar->second ) {
+	    switch ( tyVar->second ) {
 	      case TypeDecl::Any:
 	      case TypeDecl::Dtype:
Index: translator/GenPoly/Specialize.cc
===================================================================
--- translator/GenPoly/Specialize.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/GenPoly/Specialize.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -61,5 +61,5 @@
 needsSpecialization( Type *formalType, Type *actualType, TypeSubstitution *env )
 {
-  if( env ) {
+  if ( env ) {
     using namespace ResolvExpr;
     OpenVarSet openVars, closedVars;
@@ -67,9 +67,9 @@
     findOpenVars( formalType, openVars, closedVars, need, have, false );
     findOpenVars( actualType, openVars, closedVars, need, have, true );
-    for( OpenVarSet::const_iterator openVar = openVars.begin(); openVar != openVars.end(); ++openVar ) {
+    for ( OpenVarSet::const_iterator openVar = openVars.begin(); openVar != openVars.end(); ++openVar ) {
       Type *boundType = env->lookup( openVar->first );
-      if( !boundType ) continue;
-      if( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( boundType ) ) {
-        if( closedVars.find( typeInst->get_name() ) == closedVars.end() ) {
+      if ( ! boundType ) continue;
+      if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( boundType ) ) {
+        if ( closedVars.find( typeInst->get_name() ) == closedVars.end() ) {
           return true;
         }
@@ -87,10 +87,10 @@
 Specialize::doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams )
 {
-  if( needsSpecialization( formalType, actual->get_results().front(), env ) ) {
+  if ( needsSpecialization( formalType, actual->get_results().front(), env ) ) {
     PointerType *ptrType;
     FunctionType *funType;
-    if( ( ptrType = dynamic_cast< PointerType* >( formalType ) ) && ( funType = dynamic_cast< FunctionType* >( ptrType->get_base() ) ) ) {
+    if ( ( ptrType = dynamic_cast< PointerType* >( formalType ) ) && ( funType = dynamic_cast< FunctionType* >( ptrType->get_base() ) ) ) {
       FunctionType *newType = funType->clone();
-      if( env ) {
+      if ( env ) {
         TypeSubstitution newEnv( *env );
         // it is important to replace only occurrences of type variables that occur free in the
@@ -103,10 +103,10 @@
       UniqueName paramNamer( paramPrefix );
       ApplicationExpr *appExpr = new ApplicationExpr( actual );
-      for( std::list< DeclarationWithType* >::iterator param = thunkFunc->get_functionType()->get_parameters().begin(); param != thunkFunc->get_functionType()->get_parameters().end(); ++param ) {
+      for ( std::list< DeclarationWithType* >::iterator param = thunkFunc->get_functionType()->get_parameters().begin(); param != thunkFunc->get_functionType()->get_parameters().end(); ++param ) {
         (*param)->set_name( paramNamer.newName() );
         appExpr->get_args().push_back( new VariableExpr( *param ) );
       }
       appExpr->set_env( maybeClone( env ) );
-      if( inferParams ) {
+      if ( inferParams ) {
         appExpr->get_inferParams() = *inferParams;
       }
@@ -123,5 +123,5 @@
       
       Statement *appStmt;
-      if( funType->get_returnVals().empty() ) {
+      if ( funType->get_returnVals().empty() ) {
         appStmt = new ExprStmt( noLabels, appExpr );
       } else {
@@ -143,5 +143,5 @@
 {
   // create thunks for the explicit parameters
-  assert( !appExpr->get_function()->get_results().empty() );
+  assert( ! appExpr->get_function()->get_results().empty() );
   PointerType *pointer = dynamic_cast< PointerType* >( appExpr->get_function()->get_results().front() );
   assert( pointer );
@@ -149,5 +149,5 @@
   std::list< DeclarationWithType* >::iterator formal;
   std::list< Expression* >::iterator actual;
-  for( formal = function->get_parameters().begin(), actual = appExpr->get_args().begin(); formal != function->get_parameters().end() && actual != appExpr->get_args().end(); ++formal, ++actual ) {
+  for ( formal = function->get_parameters().begin(), actual = appExpr->get_args().begin(); formal != function->get_parameters().end() && actual != appExpr->get_args().end(); ++formal, ++actual ) {
     *actual = doSpecialization( (*formal)->get_type(), *actual, &appExpr->get_inferParams() );
   }
@@ -161,5 +161,5 @@
   
   // create thunks for the inferred parameters
-  for( InferredParams::iterator inferParam = appExpr->get_inferParams().begin(); inferParam != appExpr->get_inferParams().end(); ++inferParam ) {
+  for ( InferredParams::iterator inferParam = appExpr->get_inferParams().begin(); inferParam != appExpr->get_inferParams().end(); ++inferParam ) {
     inferParam->second.expr = doSpecialization( inferParam->second.formalType, inferParam->second.expr, &appExpr->get_inferParams() );
   }
Index: translator/InitTweak/Association.h
===================================================================
--- translator/InitTweak/Association.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/InitTweak/Association.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -70,5 +70,5 @@
 
   virtual long int add_single( long int idx, Expression *newExpr) {
-    if( expr == 0 ) //|| *expr == *newExpr )
+    if ( expr == 0 ) //|| *expr == *newExpr )
       expr = newExpr;
     return 0;
@@ -76,5 +76,5 @@
 
   virtual long int add_single( std::string str, Expression *newExpr) {
-    if( expr == 0 ) //|| *expr == *newExpr )
+    if ( expr == 0 ) //|| *expr == *newExpr )
       expr = newExpr;
     return 0;
@@ -114,5 +114,5 @@
     long int ret;
 
-    if( idx >= (long int)ordering.size() ) throw AssocException("extra (spurious) members");
+    if ( idx >= (long int)ordering.size() ) throw AssocException("extra (spurious) members");
 
     if ( ordering[ idx ] == "")
@@ -127,5 +127,5 @@
 
   virtual long int add_single( std::string idx, Expression *expr) {
-    if( idx == "" )
+    if ( idx == "" )
       std::cerr << "Checkpoint 1" << std::endl;
     else {
@@ -143,5 +143,5 @@
     if ( table.find( str ) != table.end() ) return;
     ordering.push_back( str );
-    if( str != "" ) {
+    if ( str != "" ) {
       std::pair<long int, Association *> p( ordering.size() - 1, 0 );
       table.insert( std::pair< std::string, std::pair<long int, Association *> >(str, p) );
@@ -151,5 +151,5 @@
 
   virtual void set_member( std::string str, Association *assoc ) {
-    if( str == "" )
+    if ( str == "" )
       anonym.push_back( assoc );
     else  if ( table.find( str ) == table.end() )
@@ -162,5 +162,5 @@
 
   virtual Association *operator[]( int idx ) {
-    if( ordering[idx] == "" ) {
+    if ( ordering[idx] == "" ) {
       std::cerr << "Error, anonymous members not implemented yet" << std::endl;
       throw 0;
@@ -187,5 +187,5 @@
   virtual void display( std::ostream &os ) {
     os << "Point association: " << std::endl;
-    for( map_type::iterator i = table.begin(); i != table.end(); i++ ) {
+    for ( map_type::iterator i = table.begin(); i != table.end(); i++ ) {
       os << "Member [" << i->first << ", index = " << i->second.first << "]";
       if ( i->second.second != 0 )
@@ -244,5 +244,5 @@
   diet::diet_tree<int> tree;
   /*
-  for( diet_tree<int>::iterator i = tree.begin(); i != tree.end(); i++ )
+  for ( diet_tree<int>::iterator i = tree.begin(); i != tree.end(); i++ )
     std::cout << "--(" << (*i).first << ", " << (*i).second << ")--" << std::endl;
   diet_tree<int> tree;
Index: translator/InitTweak/BasicInit.cc
===================================================================
--- translator/InitTweak/BasicInit.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/InitTweak/BasicInit.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -50,5 +50,5 @@
     ObjectDecl *odecl = 0;
 
-    if( ( odecl = dynamic_cast<ObjectDecl *>(declStmt->get_decl()) ) != 0 ){
+    if ( ( odecl = dynamic_cast<ObjectDecl *>(declStmt->get_decl()) ) != 0 ){
 
       Initializer *init = odecl->get_init();
@@ -133,5 +133,5 @@
 
     ReferenceToType *reftype;
-    if( (reftype = dynamic_cast< StructInstType * >( objdecl->get_type() )) != 0 ){
+    if ( (reftype = dynamic_cast< StructInstType * >( objdecl->get_type() )) != 0 ){
       StructDecl *strDecl = index->lookupStruct( reftype->get_name() );
       if ( strDecl != 0 ) {
@@ -169,5 +169,5 @@
 
       if ( li != 0 ) {
-	for( std::list<Initializer *>::iterator i = li->begin_initializers();
+	for ( std::list<Initializer *>::iterator i = li->begin_initializers();
 	                                                 i != li->end_initializers();
 	      i++) {
@@ -181,5 +181,5 @@
 			    std::back_inserter( des ), cast_ptr<Expression, NameExpr > );
 
-	    for( std::list<NameExpr *>::iterator j = des.begin(); j != des.end(); j++ ) {
+	    for ( std::list<NameExpr *>::iterator j = des.begin(); j != des.end(); j++ ) {
 	      // check for existence of the element
 
@@ -230,5 +230,5 @@
     if ( col->isComposite() ) {
       VariousNames *vc = dynamic_cast< VariousNames * >( col ); 
-      for( VariousNames::key_iterator it = vc->keys_begin(); it != vc->keys_end(); it++ ) {
+      for ( VariousNames::key_iterator it = vc->keys_begin(); it != vc->keys_end(); it++ ) {
 	prefix.push_back( *it );
 	if ( (*assoc)[ *it ] != 0 )
Index: translator/InitTweak/BasicInit.h
===================================================================
--- translator/InitTweak/BasicInit.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/InitTweak/BasicInit.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -102,5 +102,5 @@
       std::list<Expression *> temp;
 
-      if( ( sinit=dynamic_cast< SingleInit * >(_init) ) != 0 ) {
+      if ( ( sinit=dynamic_cast< SingleInit * >(_init) ) != 0 ) {
 	kind = SINGLE;
 	temp = sinit->get_designators();
@@ -179,5 +179,5 @@
 	  blown_struct.push_front( me->get_member() );
 	  prfx = me->get_aggregate();
-	} while( prfx != 0 );
+	} while ( prfx != 0 );
 
 	NameExpr *ne;
Index: translator/InitTweak/DeclarationHoister.cc
===================================================================
--- translator/InitTweak/DeclarationHoister.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/InitTweak/DeclarationHoister.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -24,5 +24,5 @@
 
     while ( result !=  kids.end() ) {
-      result = std::find_if(result, kids.end(), cast_ptr< Statement, DeclStmt > );
+      result = std::find_if (result, kids.end(), cast_ptr< Statement, DeclStmt > );
 
       if ( result != kids.end() ) {
@@ -32,5 +32,5 @@
     } 
 
-    for( std::list< stmt_it >::reverse_iterator i = decls.rbegin(); i!= decls.rend(); i++ ){
+    for ( std::list< stmt_it >::reverse_iterator i = decls.rbegin(); i!= decls.rend(); i++ ){
       kids.push_front( **i );
       kids.erase( *i );
Index: translator/InitTweak/InitExpander.cc
===================================================================
--- translator/InitTweak/InitExpander.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/InitTweak/InitExpander.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -18,5 +18,5 @@
     index.visit( objectDecl );
 
-    if( objectDecl->get_init() == 0 ) return objectDecl;
+    if ( objectDecl->get_init() == 0 ) return objectDecl;
 
     InitModelBuilder builder( objectDecl );
Index: translator/InitTweak/InitModel.cc
===================================================================
--- translator/InitTweak/InitModel.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/InitTweak/InitModel.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -16,9 +16,9 @@
 
     /* this to be replaced by dynamic dispatch */
-    if( dynamic_cast< BasicType * >(objectType) != 0 ) {
-      if( building == 0 ) building = new SingleName;
-    } else if( ReferenceToType *rt = dynamic_cast< ReferenceToType * >(objectType) ) {
+    if ( dynamic_cast< BasicType * >(objectType) != 0 ) {
+      if ( building == 0 ) building = new SingleName;
+    } else if ( ReferenceToType *rt = dynamic_cast< ReferenceToType * >(objectType) ) {
       rt->accept( *this );
-    } else if( ArrayType *at = dynamic_cast< ArrayType * >(objectType) ) {
+    } else if ( ArrayType *at = dynamic_cast< ArrayType * >(objectType) ) {
       at->accept( *this );
     } else // if (tuples)
@@ -28,5 +28,5 @@
   }
 
-  InitModelBuilder::~InitModelBuilder() { if( !taken ) { delete building; building = 0; } }
+  InitModelBuilder::~InitModelBuilder() { if ( ! taken ) { delete building; building = 0; } }
 
   void InitModelBuilder::init() {
@@ -37,5 +37,5 @@
   // Visitor interface
   void InitModelBuilder::visit( ArrayType *at ) {
-    if( building == 0 ) building = new RangeAssociation(interpretDimension( at->get_dimension() ));
+    if ( building == 0 ) building = new RangeAssociation(interpretDimension( at->get_dimension() ));
     decl = 0;
     return;
@@ -43,5 +43,5 @@
 
   void InitModelBuilder::visit( StructInstType *st ) {
-    if( building == 0 ) building = new PointAssociation;
+    if ( building == 0 ) building = new PointAssociation;
     decl = st->get_baseStruct();
     return;
@@ -59,5 +59,5 @@
     std::list< Declaration * > mem = aggregateDecl->get_members();
 
-    for( std::list<Declaration *>::iterator i = mem.begin(); i != mem.end(); i++ ) {
+    for ( std::list<Declaration *>::iterator i = mem.begin(); i != mem.end(); i++ ) {
       pa->add_member( (*i)->get_name() );
       InitModelBuilder rec(*i);
@@ -76,5 +76,5 @@
     assert (c != 0);
     if ( BasicType *bt = dynamic_cast<BasicType *>( c->get_type() ) ) {
-      if( bt->isInteger() ) {
+      if ( bt->isInteger() ) {
 	// need more intelligence here, not necessarily base 10
 	value = std::strtol( c->get_value().c_str(), NULL, 10 );
@@ -102,5 +102,5 @@
     std::list< Expression *> &des = singleInit->get_designators();
 
-    if( topLevel ) {
+    if ( topLevel ) {
       assert ( des.empty() );
       assert ( dynamic_cast< SingleName * >(model) != 0 );
@@ -113,5 +113,5 @@
     }
 
-    if( des.empty() ) {
+    if ( des.empty() ) {
       assert( model != 0 );
       try {
@@ -160,5 +160,5 @@
       for ( std::list<Expression *>::iterator i = des2.begin(); i != des2.end(); i++ ) {
 	Association * newModel = 0;
-	if( NameExpr *n = dynamic_cast< NameExpr * >( *i ) )
+	if ( NameExpr *n = dynamic_cast< NameExpr * >( *i ) )
 	  try {
 	    newModel = (*model)[ n->get_name() ];
@@ -166,5 +166,5 @@
 	    std::cerr << "Didn't find member: " << e.get_what() << std::endl;
 	  }
-	else // if( RangeExpr *r = dynamic_cast< RangeExpr * >( *i ) )
+	else // if ( RangeExpr *r = dynamic_cast< RangeExpr * >( *i ) )
 	  std::cerr << "Invalid designator specification" << std::endl;
 
@@ -193,5 +193,5 @@
 
     std::list< Initializer * > contents;
-    for( int i = 0; i < pa->size(); i++ )
+    for ( int i = 0; i < pa->size(); i++ )
       if ( (*pa)[i] != 0 ) {
 	InitUnspooler rec;
Index: translator/InitTweak/InitModel.h
===================================================================
--- translator/InitTweak/InitModel.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/InitTweak/InitModel.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -92,5 +92,5 @@
       public:
 	InitUnspooler() : init(0), taken( false ) {}
-	virtual ~InitUnspooler() { if (!taken && (init != 0)) { delete init; init = 0; } }
+	virtual ~InitUnspooler() { if (! taken && (init != 0)) { delete init; init = 0; } }
 	Initializer *get_initializer() { return init; }
 	Initializer *grab_initializer() { taken = true; return init; }
Index: translator/InitTweak/RemoveInit.cc
===================================================================
--- translator/InitTweak/RemoveInit.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/InitTweak/RemoveInit.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -19,11 +19,11 @@
 
 void RemoveInit::mutateStatementList( std::list< Statement* > &statements ) {
-  for( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) {
-    if( !stmtsToAddAfter.empty() ) {
+  for ( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) {
+    if ( ! stmtsToAddAfter.empty() ) {
       statements.splice( i, stmtsToAddAfter );
     }
     *i = (*i)->acceptMutator( *this );
   }
-  if( !stmtsToAddAfter.empty() ) {
+  if ( ! stmtsToAddAfter.empty() ) {
     statements.splice( statements.end(), stmtsToAddAfter );
   }
Index: translator/InitTweak/diet_map.h
===================================================================
--- translator/InitTweak/diet_map.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/InitTweak/diet_map.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -34,7 +34,7 @@
     diet_tree() : root(0), left(0), right(0) {}
     ~diet_tree() {
-      if( root != 0 ) { delete root; root = 0; }
-      if( left != 0 ) { delete left; left = 0; }
-      if( right != 0 ) { delete right; right = 0; }
+      if ( root != 0 ) { delete root; root = 0; }
+      if ( left != 0 ) { delete left; left = 0; }
+      if ( right != 0 ) { delete right; right = 0; }
     }
 
@@ -45,6 +45,6 @@
       else {
 	value_type lo = root->get_lo(), hi = root->get_hi();
-	if( _lo < lo ) {
-	  if( _hi > hi ) {
+	if ( _lo < lo ) {
+	  if ( _hi > hi ) {
 	    /* can either minimize the work or minimize the number of nodes.
 	       Let's minimize the work. */
@@ -54,8 +54,8 @@
 	    right->insert( _hi, hi );
 	    return;
-	  } else if( _hi < lo ) {
+	  } else if ( _hi < lo ) {
 	    if ( left == 0 ) left = new diet_tree<T>();
 	    left->insert( _lo, _hi );
-	  } else if( _hi <= hi ) {
+	  } else if ( _hi <= hi ) {
 	    if ( left == 0 ) left = new diet_tree<T>();
 	    left->insert( _lo, _hi );
@@ -65,8 +65,8 @@
 	  root->set_range(_lo,_hi);
 	} else if ( _hi > hi) {
-	  if( _lo > hi ) {
+	  if ( _lo > hi ) {
 	    if ( right == 0 ) right = new diet_tree<T>();
 	    right->insert( _lo, _hi );
-	  } else if( _lo < hi ) {
+	  } else if ( _lo < hi ) {
 	    root->set_range(lo, _lo);
 	    if ( right == 0 ) right = new diet_tree<T>();
@@ -152,5 +152,5 @@
       assert(current != 0);
       if ( current->right == 0 )
-	if ( !st.empty() )
+	if ( ! st.empty() )
 	  { current = st.top(); st.pop(); }
 	else
@@ -173,5 +173,5 @@
       assert(current != 0);
       diet_tree<T> *next = 0;
-      while( current->left != 0 ) {
+      while ( current->left != 0 ) {
 	next = current->left; st.push( current ); current = next;
       }
Index: translator/MakeLibCfa.cc
===================================================================
--- translator/MakeLibCfa.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/MakeLibCfa.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -48,5 +48,5 @@
 		bool lookResult = CodeGen::operatorLookup( funcDecl->get_name(), opInfo );
 		assert( lookResult );
-		assert( !funcDecl->get_statements() );
+		assert( ! funcDecl->get_statements() );
 		UntypedExpr *newExpr = new UntypedExpr( new NameExpr( funcDecl->get_name() ) );
 		UniqueName paramNamer( "_p" );
@@ -59,5 +59,5 @@
 		} // if
 
-		switch( opInfo.type ) {
+		switch ( opInfo.type ) {
 		  case CodeGen::OT_INDEX:
 		  case CodeGen::OT_CALL:
@@ -97,5 +97,5 @@
   
 		ObjectDecl *objDecl = origObjDecl->clone();
-		assert( !objDecl->get_init() );
+		assert( ! objDecl->get_init() );
 		std::list< Expression* > noDesignators;
 		objDecl->set_init( new SingleInit( new NameExpr( objDecl->get_name() ), noDesignators ) );
Index: translator/Parser/DeclarationNode.cc
===================================================================
--- translator/Parser/DeclarationNode.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Parser/DeclarationNode.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -531,5 +531,5 @@
 		TypeData *prevBase = type;
 		TypeData *curBase = type->base;
-		while( curBase != 0 ) {
+		while ( curBase != 0 ) {
 			prevBase = curBase;
 			curBase = curBase->base;
@@ -591,5 +591,5 @@
 	assert( a );
 	TypeData *cur = a;
-	while( cur->base ) {
+	while ( cur->base ) {
 		cur = cur->base;
 	}
@@ -660,5 +660,5 @@
 	DeclarationNode *newnode = new DeclarationNode;
 	TypeData *srcType = type;
-	while( srcType->base ) {
+	while ( srcType->base ) {
 		srcType = srcType->base;
 	}
@@ -686,5 +686,5 @@
 		if ( type ) {
 			TypeData *srcType = type;
-			while( srcType->base ) {
+			while ( srcType->base ) {
 				srcType = srcType->base;
 			}
@@ -763,5 +763,5 @@
 	std::back_insert_iterator< std::list< Declaration* > > out( outputList );
 	const DeclarationNode *cur = firstNode;
-	while( cur ) {
+	while ( cur ) {
 		try {
 			if ( DeclarationNode *extr = cur->extractAggregate() ) {
@@ -790,5 +790,5 @@
 	std::back_insert_iterator< std::list< DeclarationWithType* > > out( outputList );
 	const DeclarationNode *cur = firstNode;
-	while( cur ) {
+	while ( cur ) {
 		try {
 ///       if ( DeclarationNode *extr = cur->extractAggregate() ) {
@@ -827,5 +827,5 @@
 	std::back_insert_iterator< std::list< Type* > > out( outputList );
 	const DeclarationNode *cur = firstNode;
-	while( cur ) {
+	while ( cur ) {
 		try {
 			*out++ = cur->buildType();
Index: translator/Parser/ExpressionNode.cc
===================================================================
--- translator/Parser/ExpressionNode.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Parser/ExpressionNode.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -120,5 +120,5 @@
 			int i = str.length() - 1;
 
-			while ( i >= 0 && !isxdigit( c = str.at( i--)) )
+			while ( i >= 0 && ! isxdigit( c = str.at( i--)) )
 				sfx += c;
 
@@ -371,5 +371,5 @@
 		  case OperatorNode::OrAssn:
 			// the rewrite rules for these expressions specify that the first argument has its address taken
-			assert( !args.empty() );
+			assert( ! args.empty() );
 			args.front() = new AddressExpr( args.front() );
 			break;
@@ -490,5 +490,5 @@
 				VarRefNode *var = dynamic_cast<VarRefNode *>( get_args());
 				assert( var );
-				if ( !get_args()->get_link() ) {
+				if ( ! get_args()->get_link() ) {
 					return new AttrExpr( var->build(), ( Expression*)0);
 				} else if ( TypeValueNode * arg = dynamic_cast<TypeValueNode *>( get_args()->get_link()) ) {
Index: translator/Parser/InitializerNode.cc
===================================================================
--- translator/Parser/InitializerNode.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Parser/InitializerNode.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -56,5 +56,5 @@
 			os << "designated by: (";
 			ExpressionNode *curdes = designator;
-			while( curdes != 0) {
+			while ( curdes != 0) {
 				curdes->printOneLine(os);
 				curdes = (ExpressionNode *)(curdes->get_link());
Index: translator/Parser/ParseNode.cc
===================================================================
--- translator/Parser/ParseNode.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Parser/ParseNode.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -50,5 +50,5 @@
     ParseNode *current = this;
 
-    while( current->get_link() != 0 )
+    while ( current->get_link() != 0 )
 	current = current->get_link();
 
Index: translator/Parser/ParseNode.h
===================================================================
--- translator/Parser/ParseNode.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Parser/ParseNode.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -493,5 +493,5 @@
 		cur = dynamic_cast< NodeType *>( cur->get_link() );
 	} // while
-	if ( !errors.isEmpty() ) {
+	if ( ! errors.isEmpty() ) {
 		throw errors;
 	} // if
Index: translator/Parser/StatementNode.cc
===================================================================
--- translator/Parser/StatementNode.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Parser/StatementNode.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -171,14 +171,14 @@
 void StatementNode::print( std::ostream &os, int indent ) const {
 	if ( labels != 0 )
-		if (!labels->empty()) {
+		if (! labels->empty()) {
 			std::list<std::string>::const_iterator i;
 
 			os << '\r' << string( indent, ' ');
-			for( i = labels->begin(); i != labels->end(); i++ )
+			for ( i = labels->begin(); i != labels->end(); i++ )
 				os << *i << ":";
 			os << endl;
 		}
 
-	switch( type ) {
+	switch ( type ) {
 	  case Decl:
 		decl->print( os, indent );
@@ -232,5 +232,5 @@
 	buildList<Statement, StatementNode>( get_block(), branches );
 
-	switch( type ) {
+	switch ( type ) {
 	  case Decl:
 		return new DeclStmt( labs, maybeBuild< Declaration >( decl ) );
@@ -251,5 +251,5 @@
 			thenb = branches.front();
 			branches.pop_front();
-			if ( !branches.empty() ) {
+			if ( ! branches.empty() ) {
 				elseb = branches.front();
 				branches.pop_front();
Index: translator/Parser/TypeData.cc
===================================================================
--- translator/Parser/TypeData.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Parser/TypeData.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -405,5 +405,5 @@
 	switch ( kind ) {
 	  case Aggregate:
-		if ( !toplevel && aggregate->members ) {
+		if ( ! toplevel && aggregate->members ) {
 			ret = clone();
 			ret->qualifiers.clear();
@@ -411,5 +411,5 @@
 		break;
 	  case Enum:
-		if ( !toplevel && enumeration->constants ) {
+		if ( ! toplevel && enumeration->constants ) {
 			ret = clone();
 			ret->qualifiers.clear();
@@ -556,8 +556,8 @@
 
 	for ( std::list< DeclarationNode::BasicType >::const_iterator i = basic->typeSpec.begin(); i != basic->typeSpec.end(); ++i ) {
-		if ( !init ) {
+		if ( ! init ) {
 			init = true;
 			if ( *i == DeclarationNode::Void ) {
-				if ( basic->typeSpec.size() != 1 || !basic->modifiers.empty() ) {
+				if ( basic->typeSpec.size() != 1 || ! basic->modifiers.empty() ) {
 					throw SemanticError( "invalid type specifier \"void\" in type: ", this );
 				} else {
@@ -635,5 +635,5 @@
 		switch ( *i ) {
 		  case DeclarationNode::Long:
-			if ( !init ) {
+			if ( ! init ) {
 				init = true;
 				ret = BasicType::LongSignedInt;
@@ -667,5 +667,5 @@
 			break;
 		  case DeclarationNode::Short:
-			if ( !init ) {
+			if ( ! init ) {
 				init = true;
 				ret = BasicType::ShortSignedInt;
@@ -684,5 +684,5 @@
 			break;
 		  case DeclarationNode::Signed:
-			if ( !init ) {
+			if ( ! init ) {
 				init = true;
 				ret = BasicType::SignedInt;
@@ -709,5 +709,5 @@
 			break;
 		  case DeclarationNode::Unsigned:
-			if ( !init ) {
+			if ( ! init ) {
 				init = true;
 				ret = BasicType::UnsignedInt;
@@ -744,5 +744,5 @@
 
 	BasicType *bt;
-	if ( !init ) {
+	if ( ! init ) {
 		bt = new BasicType( buildQualifiers(), BasicType::SignedInt );
 	} else {
@@ -781,5 +781,5 @@
 	assert( kind == Function );
 	bool hasEllipsis = function->params ? function->params->get_hasEllipsis() : true;
-	if ( !function->params ) hasEllipsis = !function->newStyle;
+	if ( ! function->params ) hasEllipsis = ! function->newStyle;
 	FunctionType *ft = new FunctionType( buildQualifiers(), hasEllipsis );
 	buildList( function->params, ft->get_parameters() );
Index: translator/Parser/TypedefTable.cc
===================================================================
--- translator/Parser/TypedefTable.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Parser/TypedefTable.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -64,5 +64,5 @@
 		} else {
 			list<Entry>::iterator listPos = (*curPos ).second.begin();
-			while( listPos != (*curPos ).second.end() && listPos->scope > scope ) {
+			while ( listPos != (*curPos ).second.end() && listPos->scope > scope ) {
 				listPos++;
 			}
@@ -123,5 +123,5 @@
 	for ( tableType::iterator i = table.begin(); i != table.end(); ) {
 		list<Entry> &declList = (*i ).second;
-		while (!declList.empty() && declList.front().scope == currentScope ) {
+		while (! declList.empty() && declList.front().scope == currentScope ) {
 			declList.pop_front();
 		}
Index: translator/ResolvExpr/AdjustExprType.cc
===================================================================
--- translator/ResolvExpr/AdjustExprType.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/AdjustExprType.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// AdjustExprType.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sat May 16 23:41:42 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sat May 16 23:54:02 2015
+// Update Count     : 3
+// 
+
 #include "typeops.h"
 #include "SynTree/Type.h"
@@ -5,94 +20,100 @@
 
 namespace ResolvExpr {
-    class AdjustExprType : public Mutator {
-	typedef Mutator Parent;
-      public:
-	AdjustExprType( const TypeEnvironment &env, const SymTab::Indexer &indexer );
-      private:
-	virtual Type* mutate(VoidType *voidType);
-	virtual Type* mutate(BasicType *basicType);
-	virtual Type* mutate(PointerType *pointerType);
-	virtual Type* mutate(ArrayType *arrayType);
-	virtual Type* mutate(FunctionType *functionType);
-	virtual Type* mutate(StructInstType *aggregateUseType);
-	virtual Type* mutate(UnionInstType *aggregateUseType);
-	virtual Type* mutate(EnumInstType *aggregateUseType);
-	virtual Type* mutate(ContextInstType *aggregateUseType);
-	virtual Type* mutate(TypeInstType *aggregateUseType);
-	virtual Type* mutate(TupleType *tupleType);
-  
-	const TypeEnvironment &env;
-	const SymTab::Indexer &indexer;
-    };
+	class AdjustExprType : public Mutator {
+		typedef Mutator Parent;
+	  public:
+		AdjustExprType( const TypeEnvironment &env, const SymTab::Indexer &indexer );
+	  private:
+		virtual Type* mutate( VoidType *voidType );
+		virtual Type* mutate( BasicType *basicType );
+		virtual Type* mutate( PointerType *pointerType );
+		virtual Type* mutate( ArrayType *arrayType );
+		virtual Type* mutate( FunctionType *functionType );
+		virtual Type* mutate( StructInstType *aggregateUseType );
+		virtual Type* mutate( UnionInstType *aggregateUseType );
+		virtual Type* mutate( EnumInstType *aggregateUseType );
+		virtual Type* mutate( ContextInstType *aggregateUseType );
+		virtual Type* mutate( TypeInstType *aggregateUseType );
+		virtual Type* mutate( TupleType *tupleType );
 
-    void adjustExprType( Type *&type, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
-	AdjustExprType adjuster( env, indexer );
-	Type *newType = type->acceptMutator( adjuster );
-	type = newType;
-    }
+		const TypeEnvironment &env;
+		const SymTab::Indexer &indexer;
+	};
 
-    AdjustExprType::AdjustExprType( const TypeEnvironment &env, const SymTab::Indexer &indexer )
-	: env( env ), indexer( indexer ) {
-    }
+	void adjustExprType( Type *&type, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
+		AdjustExprType adjuster( env, indexer );
+		Type *newType = type->acceptMutator( adjuster );
+		type = newType;
+	}
 
-    Type *AdjustExprType::mutate(VoidType *voidType) {
-	return voidType;
-    }
+	AdjustExprType::AdjustExprType( const TypeEnvironment &env, const SymTab::Indexer &indexer )
+		: env( env ), indexer( indexer ) {
+	}
 
-    Type *AdjustExprType::mutate(BasicType *basicType) {
-	return basicType;
-    }
+	Type *AdjustExprType::mutate( VoidType *voidType ) {
+		return voidType;
+	}
 
-    Type *AdjustExprType::mutate(PointerType *pointerType) {
-	return pointerType;
-    }
+	Type *AdjustExprType::mutate( BasicType *basicType ) {
+		return basicType;
+	}
 
-    Type *AdjustExprType::mutate(ArrayType *arrayType) {
-	PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->get_base()->clone() );
-	delete arrayType;
-	return pointerType;
-    }
+	Type *AdjustExprType::mutate( PointerType *pointerType ) {
+		return pointerType;
+	}
 
-    Type *AdjustExprType::mutate(FunctionType *functionType) {
-	PointerType *pointerType = new PointerType( Type::Qualifiers(), functionType );
-	return pointerType;
-    }
+	Type *AdjustExprType::mutate( ArrayType *arrayType ) {
+		PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->get_base()->clone() );
+		delete arrayType;
+		return pointerType;
+	}
 
-    Type *AdjustExprType::mutate(StructInstType *aggregateUseType) {
-	return aggregateUseType;
-    }
+	Type *AdjustExprType::mutate( FunctionType *functionType ) {
+		PointerType *pointerType = new PointerType( Type::Qualifiers(), functionType );
+		return pointerType;
+	}
 
-    Type *AdjustExprType::mutate(UnionInstType *aggregateUseType) {
-	return aggregateUseType;
-    }
+	Type *AdjustExprType::mutate( StructInstType *aggregateUseType ) {
+		return aggregateUseType;
+	}
 
-    Type *AdjustExprType::mutate(EnumInstType *aggregateUseType) {
-	return aggregateUseType;
-    }
+	Type *AdjustExprType::mutate( UnionInstType *aggregateUseType ) {
+		return aggregateUseType;
+	}
 
-    Type *AdjustExprType::mutate(ContextInstType *aggregateUseType) {
-	return aggregateUseType;
-    }
+	Type *AdjustExprType::mutate( EnumInstType *aggregateUseType ) {
+		return aggregateUseType;
+	}
 
-    Type *AdjustExprType::mutate(TypeInstType *typeInst) {
-	EqvClass eqvClass;
-	if ( env.lookup( typeInst->get_name(), eqvClass ) ) {
-	    if ( eqvClass.kind == TypeDecl::Ftype ) {
-		PointerType *pointerType = new PointerType( Type::Qualifiers(), typeInst );
-		return pointerType;
-	    }
-	} else if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) {
-	    if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) {
-		if ( tyDecl->get_kind() == TypeDecl::Ftype ) {
-		    PointerType *pointerType = new PointerType( Type::Qualifiers(), typeInst );
-		    return pointerType;
-		}
-	    }
+	Type *AdjustExprType::mutate( ContextInstType *aggregateUseType ) {
+		return aggregateUseType;
 	}
-	return typeInst;
-    }
 
-    Type *AdjustExprType::mutate(TupleType *tupleType) {
-	return tupleType;
-    }
+	Type *AdjustExprType::mutate( TypeInstType *typeInst ) {
+		EqvClass eqvClass;
+		if ( env.lookup( typeInst->get_name(), eqvClass ) ) {
+			if ( eqvClass.kind == TypeDecl::Ftype ) {
+				PointerType *pointerType = new PointerType( Type::Qualifiers(), typeInst );
+				return pointerType;
+			}
+		} else if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) {
+			if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) {
+				if ( tyDecl->get_kind() == TypeDecl::Ftype ) {
+					PointerType *pointerType = new PointerType( Type::Qualifiers(), typeInst );
+					return pointerType;
+				} // if
+			} // if
+		} // if
+		return typeInst;
+	}
+
+	Type *AdjustExprType::mutate( TupleType *tupleType ) {
+		return tupleType;
+	}
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/Alternative.cc
===================================================================
--- translator/ResolvExpr/Alternative.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/Alternative.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Alternative.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sat May 16 23:44:23 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sat May 16 23:54:23 2015
+// Update Count     : 2
+// 
+
 #include "Alternative.h"
 #include "SynTree/Type.h"
@@ -5,46 +20,52 @@
 
 namespace ResolvExpr {
-    Alternative::Alternative() : expr( 0 ) {}
+	Alternative::Alternative() : expr( 0 ) {}
 
-    Alternative::Alternative( Expression *expr, const TypeEnvironment &env, const Cost& cost )
-	: cost( cost ), cvtCost( Cost::zero ), expr( expr ), env( env ) {}
+	Alternative::Alternative( Expression *expr, const TypeEnvironment &env, const Cost& cost )
+		: cost( cost ), cvtCost( Cost::zero ), expr( expr ), env( env ) {}
 
-    Alternative::Alternative( Expression *expr, const TypeEnvironment &env, const Cost& cost, const Cost &cvtCost )
-	: cost( cost ), cvtCost( cvtCost ), expr( expr ), env( env ) {}
+	Alternative::Alternative( Expression *expr, const TypeEnvironment &env, const Cost& cost, const Cost &cvtCost )
+		: cost( cost ), cvtCost( cvtCost ), expr( expr ), env( env ) {}
 
-    Alternative::Alternative( const Alternative &other ) {
-	initialize( other, *this );
-    }
+	Alternative::Alternative( const Alternative &other ) {
+		initialize( other, *this );
+	}
 
-    Alternative &Alternative::operator=( const Alternative &other ) {
-	if ( &other == this ) return *this;
-	initialize( other, *this );
-	return *this;
-    }
+	Alternative &Alternative::operator=( const Alternative &other ) {
+		if ( &other == this ) return *this;
+		initialize( other, *this );
+		return *this;
+	}
 
-    void Alternative::initialize( const Alternative &src, Alternative &dest ) {
-	dest.cost = src.cost;
-	dest.cvtCost = src.cvtCost;
-	dest.expr = maybeClone( src.expr );
-	dest.env = src.env;
-    }
+	void Alternative::initialize( const Alternative &src, Alternative &dest ) {
+		dest.cost = src.cost;
+		dest.cvtCost = src.cvtCost;
+		dest.expr = maybeClone( src.expr );
+		dest.env = src.env;
+	}
 
-    Alternative::~Alternative() {
-	delete expr;
-    }
+	Alternative::~Alternative() {
+		delete expr;
+	}
 
-    void Alternative::print( std::ostream &os, int indent ) const {
-	os << std::string( indent, ' ' ) << "Cost " << cost << ": ";
-	if ( expr ) {
-	    expr->print( os, indent );
-	    os << "(types:" << std::endl;
-	    printAll( expr->get_results(), os, indent + 4 );
-	    os << ")" << std::endl;
-	} else {
-	    os << "Null expression!" << std::endl;
+	void Alternative::print( std::ostream &os, int indent ) const {
+		os << std::string( indent, ' ' ) << "Cost " << cost << ": ";
+		if ( expr ) {
+			expr->print( os, indent );
+			os << "(types:" << std::endl;
+			printAll( expr->get_results(), os, indent + 4 );
+			os << ")" << std::endl;
+		} else {
+			os << "Null expression!" << std::endl;
+		} // if
+		os << std::string( indent, ' ' ) << "Environment: ";
+		env.print( os, indent+2 );
+		os << std::endl;
 	}
-	os << std::string( indent, ' ' ) << "Environment: ";
-	env.print( os, indent+2 );
-	os << std::endl;
-    }
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/Alternative.h
===================================================================
--- translator/ResolvExpr/Alternative.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/Alternative.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,4 +1,19 @@
-#ifndef RESOLVEXPR_ALTERNATIVE_H
-#define RESOLVEXPR_ALTERNATIVE_H
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Alternative.h -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sat May 16 23:45:43 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sat May 16 23:54:39 2015
+// Update Count     : 2
+// 
+
+#ifndef ALTERNATIVE_H
+#define ALTERNATIVE_H
 
 #include <list>
@@ -8,25 +23,31 @@
 
 namespace ResolvExpr {
-    struct Alternative;
-    typedef std::list< Alternative > AltList;
+	struct Alternative;
+	typedef std::list< Alternative > AltList;
 
-    struct Alternative {
-	Alternative();
-	Alternative( Expression *expr, const TypeEnvironment &env, const Cost& cost );
-	Alternative( Expression *expr, const TypeEnvironment &env, const Cost& cost, const Cost &cvtCost );
-	Alternative( const Alternative &other );
-	Alternative &operator=( const Alternative &other );
-	~Alternative();
+	struct Alternative {
+		Alternative();
+		Alternative( Expression *expr, const TypeEnvironment &env, const Cost &cost );
+		Alternative( Expression *expr, const TypeEnvironment &env, const Cost &cost, const Cost &cvtCost );
+		Alternative( const Alternative &other );
+		Alternative &operator=( const Alternative &other );
+		~Alternative();
   
-	void initialize( const Alternative &src, Alternative &dest );
+		void initialize( const Alternative &src, Alternative &dest );
   
-	void print( std::ostream &os, int indent = 0 ) const;
+		void print( std::ostream &os, int indent = 0 ) const;
   
-	Cost cost;
-	Cost cvtCost;
-	Expression *expr;
-	TypeEnvironment env;
-    };
+		Cost cost;
+		Cost cvtCost;
+		Expression *expr;
+		TypeEnvironment env;
+	};
 } // namespace ResolvExpr
 
-#endif // RESOLVEXPR_ALTERNATIVE_H
+#endif // ALTERNATIVE_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/AlternativeFinder.cc
===================================================================
--- translator/ResolvExpr/AlternativeFinder.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/AlternativeFinder.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// AlternativeFinder.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sat May 16 23:52:08 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sat May 16 23:55:30 2015
+// Update Count     : 3
+//
+
 #include <list>
 #include <iterator>
@@ -30,472 +45,472 @@
 
 namespace ResolvExpr {
-    Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ) {
-	CastExpr *castToVoid = new CastExpr( expr );
-
-	AlternativeFinder finder( indexer, env );
-	finder.findWithAdjustment( castToVoid );
-
-	// it's a property of the language that a cast expression has either 1 or 0 interpretations; if it has 0
-	// interpretations, an exception has already been thrown.
-	assert( finder.get_alternatives().size() == 1 );
-	CastExpr *newExpr = dynamic_cast< CastExpr* >( finder.get_alternatives().front().expr );
-	assert( newExpr );
-	env = finder.get_alternatives().front().env;
-	return newExpr->get_arg()->clone();
-    }
-
-    namespace {
-	void printAlts( const AltList &list, std::ostream &os, int indent = 0 ) {
-	    for ( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) {
-		i->print( os, indent );
-		os << std::endl;
-	    }
-	}
-
-	void makeExprList( const AltList &in, std::list< Expression* > &out ) {
-	    for ( AltList::const_iterator i = in.begin(); i != in.end(); ++i ) {
-		out.push_back( i->expr->clone() );
-	    }
-	}
-
-	Cost sumCost( const AltList &in ) {
-	    Cost total;
-	    for ( AltList::const_iterator i = in.begin(); i != in.end(); ++i ) {
-		total += i->cost;
-	    }
-	    return total;
-	}
-
-	struct PruneStruct {
-	    bool isAmbiguous;
-	    AltList::iterator candidate;
-	    PruneStruct() {}
-	    PruneStruct( AltList::iterator candidate ): isAmbiguous( false ), candidate( candidate ) {}
-	};
+	Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ) {
+		CastExpr *castToVoid = new CastExpr( expr );
+
+		AlternativeFinder finder( indexer, env );
+		finder.findWithAdjustment( castToVoid );
+
+		// it's a property of the language that a cast expression has either 1 or 0 interpretations; if it has 0
+		// interpretations, an exception has already been thrown.
+		assert( finder.get_alternatives().size() == 1 );
+		CastExpr *newExpr = dynamic_cast< CastExpr* >( finder.get_alternatives().front().expr );
+		assert( newExpr );
+		env = finder.get_alternatives().front().env;
+		return newExpr->get_arg()->clone();
+	}
+
+	namespace {
+		void printAlts( const AltList &list, std::ostream &os, int indent = 0 ) {
+			for ( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) {
+				i->print( os, indent );
+				os << std::endl;
+			}
+		}
+
+		void makeExprList( const AltList &in, std::list< Expression* > &out ) {
+			for ( AltList::const_iterator i = in.begin(); i != in.end(); ++i ) {
+				out.push_back( i->expr->clone() );
+			}
+		}
+
+		Cost sumCost( const AltList &in ) {
+			Cost total;
+			for ( AltList::const_iterator i = in.begin(); i != in.end(); ++i ) {
+				total += i->cost;
+			}
+			return total;
+		}
+
+		struct PruneStruct {
+			bool isAmbiguous;
+			AltList::iterator candidate;
+			PruneStruct() {}
+			PruneStruct( AltList::iterator candidate ): isAmbiguous( false ), candidate( candidate ) {}
+		};
+
+		template< typename InputIterator, typename OutputIterator >
+		void pruneAlternatives( InputIterator begin, InputIterator end, OutputIterator out, const SymTab::Indexer &indexer ) {
+			// select the alternatives that have the minimum conversion cost for a particular set of result types
+			std::map< std::string, PruneStruct > selected;
+			for ( AltList::iterator candidate = begin; candidate != end; ++candidate ) {
+				PruneStruct current( candidate );
+				std::string mangleName;
+				for ( std::list< Type* >::const_iterator retType = candidate->expr->get_results().begin(); retType != candidate->expr->get_results().end(); ++retType ) {
+					Type *newType = (*retType)->clone();
+					candidate->env.apply( newType );
+					mangleName += SymTab::Mangler::mangle( newType );
+					delete newType;
+				}
+				std::map< std::string, PruneStruct >::iterator mapPlace = selected.find( mangleName );
+				if ( mapPlace != selected.end() ) {
+					if ( candidate->cost < mapPlace->second.candidate->cost ) {
+						PRINT(
+							std::cout << "cost " << candidate->cost << " beats " << mapPlace->second.candidate->cost << std::endl;
+							)
+							selected[ mangleName ] = current;
+					} else if ( candidate->cost == mapPlace->second.candidate->cost ) {
+						PRINT(
+							std::cout << "marking ambiguous" << std::endl;
+							)
+							mapPlace->second.isAmbiguous = true;
+					}
+				} else {
+					selected[ mangleName ] = current;
+				}
+			}
+
+			PRINT(
+				std::cout << "there are " << selected.size() << " alternatives before elimination" << std::endl;
+				)
+
+				// accept the alternatives that were unambiguous
+				for ( std::map< std::string, PruneStruct >::iterator target = selected.begin(); target != selected.end(); ++target ) {
+					if ( ! target->second.isAmbiguous ) {
+						Alternative &alt = *target->second.candidate;
+						for ( std::list< Type* >::iterator result = alt.expr->get_results().begin(); result != alt.expr->get_results().end(); ++result ) {
+							alt.env.applyFree( *result );
+						}
+						*out++ = alt;
+					}
+				}
+
+		}
+
+		template< typename InputIterator, typename OutputIterator >
+		void findMinCost( InputIterator begin, InputIterator end, OutputIterator out ) {
+			AltList alternatives;
+
+			// select the alternatives that have the minimum parameter cost
+			Cost minCost = Cost::infinity;
+			for ( AltList::iterator i = begin; i != end; ++i ) {
+				if ( i->cost < minCost ) {
+					minCost = i->cost;
+					i->cost = i->cvtCost;
+					alternatives.clear();
+					alternatives.push_back( *i );
+				} else if ( i->cost == minCost ) {
+					i->cost = i->cvtCost;
+					alternatives.push_back( *i );
+				}
+			}
+			std::copy( alternatives.begin(), alternatives.end(), out );
+		}
+
+		template< typename InputIterator >
+		void simpleCombineEnvironments( InputIterator begin, InputIterator end, TypeEnvironment &result ) {
+			while ( begin != end ) {
+				result.simpleCombine( (*begin++).env );
+			}
+		}
+
+		void renameTypes( Expression *expr ) {
+			for ( std::list< Type* >::iterator i = expr->get_results().begin(); i != expr->get_results().end(); ++i ) {
+				(*i)->accept( global_renamer );
+			}
+		}
+	}
 
 	template< typename InputIterator, typename OutputIterator >
-	void pruneAlternatives( InputIterator begin, InputIterator end, OutputIterator out, const SymTab::Indexer &indexer ) {
-	    // select the alternatives that have the minimum conversion cost for a particular set of result types
-	    std::map< std::string, PruneStruct > selected;
-	    for ( AltList::iterator candidate = begin; candidate != end; ++candidate ) {
-		PruneStruct current( candidate );
-		std::string mangleName;
-		for ( std::list< Type* >::const_iterator retType = candidate->expr->get_results().begin(); retType != candidate->expr->get_results().end(); ++retType ) {
-		    Type *newType = (*retType)->clone();
-		    candidate->env.apply( newType );
-		    mangleName += SymTab::Mangler::mangle( newType );
-		    delete newType;
-		}
-		std::map< std::string, PruneStruct >::iterator mapPlace = selected.find( mangleName );
-		if ( mapPlace != selected.end() ) {
-		    if ( candidate->cost < mapPlace->second.candidate->cost ) {
+	void AlternativeFinder::findSubExprs( InputIterator begin, InputIterator end, OutputIterator out ) {
+		while ( begin != end ) {
+			AlternativeFinder finder( indexer, env );
+			finder.findWithAdjustment( *begin );
+			// XXX  either this
+			//Designators::fixDesignations( finder, (*begin++)->get_argName() );
+			// or XXX this
+			begin++;
 			PRINT(
-			    std::cout << "cost " << candidate->cost << " beats " << mapPlace->second.candidate->cost << std::endl;
-			    )
-			selected[ mangleName ] = current;
-		    } else if ( candidate->cost == mapPlace->second.candidate->cost ) {
+				std::cout << "findSubExprs" << std::endl;
+				printAlts( finder.alternatives, std::cout );
+				)
+				*out++ = finder;
+		}
+	}
+
+	AlternativeFinder::AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env )
+		: indexer( indexer ), env( env ) {
+	}
+
+	void AlternativeFinder::find( Expression *expr, bool adjust ) {
+		expr->accept( *this );
+		if ( alternatives.empty() ) {
+			throw SemanticError( "No reasonable alternatives for expression ", expr );
+		}
+		for ( AltList::iterator i = alternatives.begin(); i != alternatives.end(); ++i ) {
+			if ( adjust ) {
+				adjustExprTypeList( i->expr->get_results().begin(), i->expr->get_results().end(), i->env, indexer );
+			}
+		}
+		PRINT(
+			std::cout << "alternatives before prune:" << std::endl;
+			printAlts( alternatives, std::cout );
+			)
+			AltList::iterator oldBegin = alternatives.begin();
+		pruneAlternatives( alternatives.begin(), alternatives.end(), front_inserter( alternatives ), indexer );
+		if ( alternatives.begin() == oldBegin ) {
+			std::ostrstream stream;
+			stream << "Can't choose between alternatives for expression ";
+			expr->print( stream );
+			stream << "Alternatives are:";
+			AltList winners;
+			findMinCost( alternatives.begin(), alternatives.end(), back_inserter( winners ) );
+			printAlts( winners, stream, 8 );
+			throw SemanticError( std::string( stream.str(), stream.pcount() ) );
+		}
+		alternatives.erase( oldBegin, alternatives.end() );
+		PRINT(
+			std::cout << "there are " << alternatives.size() << " alternatives after elimination" << std::endl;
+			)
+			}
+
+	void AlternativeFinder::findWithAdjustment( Expression *expr ) {
+		find( expr, true );
+	}
+
+	template< typename StructOrUnionType >
+	void AlternativeFinder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const std::string &name ) {
+		std::list< Declaration* > members;
+		aggInst->lookup( name, members );
+		for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i ) {
+			if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( *i ) ) {
+				alternatives.push_back( Alternative( new MemberExpr( dwt->clone(), expr->clone() ), env, newCost ) );
+				renameTypes( alternatives.back().expr );
+			} else {
+				assert( false );
+			}
+		}
+	}
+
+	void AlternativeFinder::visit( ApplicationExpr *applicationExpr ) {
+		alternatives.push_back( Alternative( applicationExpr->clone(), env, Cost::zero ) );
+	}
+
+	Cost computeConversionCost( Alternative &alt, const SymTab::Indexer &indexer ) {
+		ApplicationExpr *appExpr = dynamic_cast< ApplicationExpr* >( alt.expr );
+		assert( appExpr );
+		PointerType *pointer = dynamic_cast< PointerType* >( appExpr->get_function()->get_results().front() );
+		assert( pointer );
+		FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() );
+		assert( function );
+
+		Cost convCost( 0, 0, 0 );
+		std::list< DeclarationWithType* >& formals = function->get_parameters();
+		std::list< DeclarationWithType* >::iterator formal = formals.begin();
+		std::list< Expression* >& actuals = appExpr->get_args();
+		for ( std::list< Expression* >::iterator actualExpr = actuals.begin(); actualExpr != actuals.end(); ++actualExpr ) {
 			PRINT(
-			    std::cout << "marking ambiguous" << std::endl;
-			    )
-			mapPlace->second.isAmbiguous = true;
-		    }
-		} else {
-		    selected[ mangleName ] = current;
-		}
-	    }
-
-	    PRINT(
-		std::cout << "there are " << selected.size() << " alternatives before elimination" << std::endl;
-		)
-
-	    // accept the alternatives that were unambiguous
-	    for ( std::map< std::string, PruneStruct >::iterator target = selected.begin(); target != selected.end(); ++target ) {
-		if ( !target->second.isAmbiguous ) {
-		    Alternative &alt = *target->second.candidate;
-		    for ( std::list< Type* >::iterator result = alt.expr->get_results().begin(); result != alt.expr->get_results().end(); ++result ) {
-			alt.env.applyFree( *result );
-		    }
-		    *out++ = alt;
-		}
-	    }
-
-	}
-
-	template< typename InputIterator, typename OutputIterator >
-	void findMinCost( InputIterator begin, InputIterator end, OutputIterator out ) {
-	    AltList alternatives;
-
-	    // select the alternatives that have the minimum parameter cost
-	    Cost minCost = Cost::infinity;
-	    for ( AltList::iterator i = begin; i != end; ++i ) {
-		if ( i->cost < minCost ) {
-		    minCost = i->cost;
-		    i->cost = i->cvtCost;
-		    alternatives.clear();
-		    alternatives.push_back( *i );
-		} else if ( i->cost == minCost ) {
-		    i->cost = i->cvtCost;
-		    alternatives.push_back( *i );
-		}
-	    }
-	    std::copy( alternatives.begin(), alternatives.end(), out );
-	}
-
-	template< typename InputIterator >
-	void simpleCombineEnvironments( InputIterator begin, InputIterator end, TypeEnvironment &result ) {
-	    while ( begin != end ) {
-		result.simpleCombine( (*begin++).env );
-	    }
-	}
-
-	void renameTypes( Expression *expr ) {
-	    for ( std::list< Type* >::iterator i = expr->get_results().begin(); i != expr->get_results().end(); ++i ) {
-		(*i)->accept( global_renamer );
-	    }
-	}
-    }
-
-    template< typename InputIterator, typename OutputIterator >
-    void AlternativeFinder::findSubExprs( InputIterator begin, InputIterator end, OutputIterator out ) {
-	while ( begin != end ) {
-	    AlternativeFinder finder( indexer, env );
-	    finder.findWithAdjustment( *begin );
-	    // XXX  either this
-	    //Designators::fixDesignations( finder, (*begin++)->get_argName() );
-	    // or XXX this
-	    begin++;
-	    PRINT(
-		std::cout << "findSubExprs" << std::endl;
-		printAlts( finder.alternatives, std::cout );
-		)
-	    *out++ = finder;
-	}
-    }
-
-    AlternativeFinder::AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env )
-	: indexer( indexer ), env( env ) {
-    }
-
-    void AlternativeFinder::find( Expression *expr, bool adjust ) {
-	expr->accept( *this );
-	if ( alternatives.empty() ) {
-	    throw SemanticError( "No reasonable alternatives for expression ", expr );
-	}
-	for ( AltList::iterator i = alternatives.begin(); i != alternatives.end(); ++i ) {
-	    if ( adjust ) {
-		adjustExprTypeList( i->expr->get_results().begin(), i->expr->get_results().end(), i->env, indexer );
-	    }
-	}
-	PRINT(
-	    std::cout << "alternatives before prune:" << std::endl;
-	    printAlts( alternatives, std::cout );
-	    )
-	AltList::iterator oldBegin = alternatives.begin();
-	pruneAlternatives( alternatives.begin(), alternatives.end(), front_inserter( alternatives ), indexer );
-	if ( alternatives.begin() == oldBegin ) {
-	    std::ostrstream stream;
-	    stream << "Can't choose between alternatives for expression ";
-	    expr->print( stream );
-	    stream << "Alternatives are:";
-	    AltList winners;
-	    findMinCost( alternatives.begin(), alternatives.end(), back_inserter( winners ) );
-	    printAlts( winners, stream, 8 );
-	    throw SemanticError( std::string( stream.str(), stream.pcount() ) );
-	}
-	alternatives.erase( oldBegin, alternatives.end() );
-	PRINT(
-	    std::cout << "there are " << alternatives.size() << " alternatives after elimination" << std::endl;
-	    )
-    }
-
-    void AlternativeFinder::findWithAdjustment( Expression *expr ) {
-	find( expr, true );
-    }
-
-    template< typename StructOrUnionType >
-    void AlternativeFinder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const std::string &name ) {
-	std::list< Declaration* > members;
-	aggInst->lookup( name, members );
-	for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i ) {
-	    if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( *i ) ) {
-		alternatives.push_back( Alternative( new MemberExpr( dwt->clone(), expr->clone() ), env, newCost ) );
-		renameTypes( alternatives.back().expr );
-	    } else {
-		assert( false );
-	    }
-	}
-    }
-
-    void AlternativeFinder::visit( ApplicationExpr *applicationExpr ) {
-	alternatives.push_back( Alternative( applicationExpr->clone(), env, Cost::zero ) );
-    }
-
-    Cost computeConversionCost( Alternative &alt, const SymTab::Indexer &indexer ) {
-	ApplicationExpr *appExpr = dynamic_cast< ApplicationExpr* >( alt.expr );
-	assert( appExpr );
-	PointerType *pointer = dynamic_cast< PointerType* >( appExpr->get_function()->get_results().front() );
-	assert( pointer );
-	FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() );
-	assert( function );
-
-	Cost convCost( 0, 0, 0 );
-	std::list< DeclarationWithType* >& formals = function->get_parameters();
-	std::list< DeclarationWithType* >::iterator formal = formals.begin();
-	std::list< Expression* >& actuals = appExpr->get_args();
-	for ( std::list< Expression* >::iterator actualExpr = actuals.begin(); actualExpr != actuals.end(); ++actualExpr ) {
-	    PRINT(
-		std::cout << "actual expression:" << std::endl;
-		(*actualExpr)->print( std::cout, 8 );
-		std::cout << "--- results are" << std::endl;
-		printAll( (*actualExpr)->get_results(), std::cout, 8 );
-		)
-	    std::list< DeclarationWithType* >::iterator startFormal = formal;
-	    Cost actualCost;
-	    for ( std::list< Type* >::iterator actual = (*actualExpr)->get_results().begin(); actual != (*actualExpr)->get_results().end(); ++actual ) {
-		if ( formal == formals.end() ) {
-		    if ( function->get_isVarArgs() ) {
-			convCost += Cost( 1, 0, 0 );
-			break;
-		    } else {
+				std::cout << "actual expression:" << std::endl;
+				(*actualExpr)->print( std::cout, 8 );
+				std::cout << "--- results are" << std::endl;
+				printAll( (*actualExpr)->get_results(), std::cout, 8 );
+				)
+				std::list< DeclarationWithType* >::iterator startFormal = formal;
+			Cost actualCost;
+			for ( std::list< Type* >::iterator actual = (*actualExpr)->get_results().begin(); actual != (*actualExpr)->get_results().end(); ++actual ) {
+				if ( formal == formals.end() ) {
+					if ( function->get_isVarArgs() ) {
+						convCost += Cost( 1, 0, 0 );
+						break;
+					} else {
+						return Cost::infinity;
+					}
+				}
+				PRINT(
+					std::cout << std::endl << "converting ";
+					(*actual)->print( std::cout, 8 );
+					std::cout << std::endl << " to ";
+					(*formal)->get_type()->print( std::cout, 8 );
+					)
+					Cost newCost = conversionCost( *actual, (*formal)->get_type(), indexer, alt.env );
+				PRINT(
+					std::cout << std::endl << "cost is" << newCost << std::endl;
+					)
+
+					if ( newCost == Cost::infinity ) {
+						return newCost;
+					}
+				convCost += newCost;
+				actualCost += newCost;
+
+				convCost += Cost( 0, polyCost( (*formal)->get_type(), alt.env, indexer ) + polyCost( *actual, alt.env, indexer ), 0 );
+
+				formal++;
+			}
+			if ( actualCost != Cost( 0, 0, 0 ) ) {
+				std::list< DeclarationWithType* >::iterator startFormalPlusOne = startFormal;
+				startFormalPlusOne++;
+				if ( formal == startFormalPlusOne ) {
+					// not a tuple type
+					Type *newType = (*startFormal)->get_type()->clone();
+					alt.env.apply( newType );
+					*actualExpr = new CastExpr( *actualExpr, newType );
+				} else {
+					TupleType *newType = new TupleType( Type::Qualifiers() );
+					for ( std::list< DeclarationWithType* >::iterator i = startFormal; i != formal; ++i ) {
+						newType->get_types().push_back( (*i)->get_type()->clone() );
+					}
+					alt.env.apply( newType );
+					*actualExpr = new CastExpr( *actualExpr, newType );
+				}
+			}
+
+		}
+		if ( formal != formals.end() ) {
 			return Cost::infinity;
-		    }
-		}
+		}
+
+		for ( InferredParams::const_iterator assert = appExpr->get_inferParams().begin(); assert != appExpr->get_inferParams().end(); ++assert ) {
+			PRINT(
+				std::cout << std::endl << "converting ";
+				assert->second.actualType->print( std::cout, 8 );
+				std::cout << std::endl << " to ";
+				assert->second.formalType->print( std::cout, 8 );
+				)
+				Cost newCost = conversionCost( assert->second.actualType, assert->second.formalType, indexer, alt.env );
+			PRINT(
+				std::cout << std::endl << "cost of conversion is " << newCost << std::endl;
+				)
+				if ( newCost == Cost::infinity ) {
+					return newCost;
+				}
+			convCost += newCost;
+
+			convCost += Cost( 0, polyCost( assert->second.formalType, alt.env, indexer ) + polyCost( assert->second.actualType, alt.env, indexer ), 0 );
+		}
+
+		return convCost;
+	}
+
+	void makeUnifiableVars( Type *type, OpenVarSet &unifiableVars, AssertionSet &needAssertions ) {
+		for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
+			unifiableVars[ (*tyvar)->get_name() ] = (*tyvar)->get_kind();
+			for ( std::list< DeclarationWithType* >::iterator assert = (*tyvar)->get_assertions().begin(); assert != (*tyvar)->get_assertions().end(); ++assert ) {
+				needAssertions[ *assert ] = true;
+			}
+///     needAssertions.insert( needAssertions.end(), (*tyvar)->get_assertions().begin(), (*tyvar)->get_assertions().end() );
+		}
+	}
+
+	bool AlternativeFinder::instantiateFunction( std::list< DeclarationWithType* >& formals, /*const*/ AltList &actuals, bool isVarArgs, OpenVarSet& openVars, TypeEnvironment &resultEnv, AssertionSet &resultNeed, AssertionSet &resultHave ) {
+		std::list< TypeEnvironment > toBeDone;
+		simpleCombineEnvironments( actuals.begin(), actuals.end(), resultEnv );
+		// make sure we don't widen any existing bindings
+		for ( TypeEnvironment::iterator i = resultEnv.begin(); i != resultEnv.end(); ++i ) {
+			i->allowWidening = false;
+		}
+		resultEnv.extractOpenVars( openVars );
+
+		/*
+		  Tuples::NameMatcher matcher( formals );
+		  try {
+		  matcher.match( actuals );
+		  } catch ( Tuples::NoMatch &e ) {
+		  std::cerr << "Alternative doesn't match: " << e.message << std::endl;
+		  }
+		*/
+		std::list< DeclarationWithType* >::iterator formal = formals.begin();
+		for ( AltList::const_iterator actualExpr = actuals.begin(); actualExpr != actuals.end(); ++actualExpr ) {
+			for ( std::list< Type* >::iterator actual = actualExpr->expr->get_results().begin(); actual != actualExpr->expr->get_results().end(); ++actual ) {
+				if ( formal == formals.end() ) {
+					return isVarArgs;
+				}
+				PRINT(
+					std::cerr << "formal type is ";
+					(*formal)->get_type()->print( std::cerr );
+					std::cerr << std::endl << "actual type is ";
+					(*actual)->print( std::cerr );
+					std::cerr << std::endl;
+					)
+					if ( ! unify( (*formal)->get_type(), *actual, resultEnv, resultNeed, resultHave, openVars, indexer ) ) {
+						return false;
+					}
+				formal++;
+			}
+		}
+		// Handling of default values
+		while ( formal != formals.end() ) {
+			if ( ObjectDecl *od = dynamic_cast<ObjectDecl *>( *formal ) )
+				if ( SingleInit *si = dynamic_cast<SingleInit *>( od->get_init() ))
+					// so far, only constant expressions are accepted as default values
+					if ( ConstantExpr *cnstexpr = dynamic_cast<ConstantExpr *>( si->get_value()) )
+						if ( Constant *cnst = dynamic_cast<Constant *>( cnstexpr->get_constant() ) )
+							if ( unify( (*formal)->get_type(), cnst->get_type(), resultEnv, resultNeed, resultHave, openVars, indexer ) ) {
+								// XXX Don't know if this is right
+								actuals.push_back( Alternative( cnstexpr->clone(), env, Cost::zero ) );
+								formal++;
+								if ( formal == formals.end()) break;
+							}
+			return false;
+		}
+		return true;
+	}
+
+	static const int recursionLimit = 10;
+
+	void addToIndexer( AssertionSet &assertSet, SymTab::Indexer &indexer ) {
+		for ( AssertionSet::iterator i = assertSet.begin(); i != assertSet.end(); ++i ) {
+			if ( i->second == true ) {
+				i->first->accept( indexer );
+			}
+		}
+	}
+
+	template< typename ForwardIterator, typename OutputIterator >
+	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() ) {
+				*out++ = newAlt;
+				return;
+			} else if ( level >= recursionLimit ) {
+				throw SemanticError( "Too many recursive assertions" );
+			} else {
+				AssertionSet newerNeed;
+				PRINT(
+					std::cerr << "recursing with new set:" << std::endl;
+					printAssertionSet( newNeed, std::cerr, 8 );
+					)
+					inferRecursive( newNeed.begin(), newNeed.end(), newAlt, openVars, decls, newerNeed, level+1, indexer, out );
+				return;
+			}
+		}
+
+		ForwardIterator cur = begin++;
+		if ( ! cur->second ) {
+			inferRecursive( begin, end, newAlt, openVars, decls, newNeed, level, indexer, out );
+		}
+		DeclarationWithType *curDecl = cur->first;
 		PRINT(
-		    std::cout << std::endl << "converting ";
-		    (*actual)->print( std::cout, 8 );
-		    std::cout << std::endl << " to ";
-		    (*formal)->get_type()->print( std::cout, 8 );
-		    )
-		Cost newCost = conversionCost( *actual, (*formal)->get_type(), indexer, alt.env );
-		PRINT(
-		    std::cout << std::endl << "cost is" << newCost << std::endl;
-		    )
-
-		if ( newCost == Cost::infinity ) {
-		    return newCost;
-		}
-		convCost += newCost;
-		actualCost += newCost;
-
-		convCost += Cost( 0, polyCost( (*formal)->get_type(), alt.env, indexer ) + polyCost( *actual, alt.env, indexer ), 0 );
-
-		formal++;
-	    }
-	    if ( actualCost != Cost( 0, 0, 0 ) ) {
-		std::list< DeclarationWithType* >::iterator startFormalPlusOne = startFormal;
-		startFormalPlusOne++;
-		if ( formal == startFormalPlusOne ) {
-		    // not a tuple type
-		    Type *newType = (*startFormal)->get_type()->clone();
-		    alt.env.apply( newType );
-		    *actualExpr = new CastExpr( *actualExpr, newType );
-		} else {
-		    TupleType *newType = new TupleType( Type::Qualifiers() );
-		    for ( std::list< DeclarationWithType* >::iterator i = startFormal; i != formal; ++i ) {
-			newType->get_types().push_back( (*i)->get_type()->clone() );
-		    }
-		    alt.env.apply( newType );
-		    *actualExpr = new CastExpr( *actualExpr, newType );
-		}
-	    }
-
-	}
-	if ( formal != formals.end() ) {
-	    return Cost::infinity;
-	}
-
-	for ( InferredParams::const_iterator assert = appExpr->get_inferParams().begin(); assert != appExpr->get_inferParams().end(); ++assert ) {
-	    PRINT(
-		std::cout << std::endl << "converting ";
-		assert->second.actualType->print( std::cout, 8 );
-		std::cout << std::endl << " to ";
-		assert->second.formalType->print( std::cout, 8 );
-		)
-	    Cost newCost = conversionCost( assert->second.actualType, assert->second.formalType, indexer, alt.env );
-	    PRINT(
-		std::cout << std::endl << "cost of conversion is " << newCost << std::endl;
-		)
-	    if ( newCost == Cost::infinity ) {
-		return newCost;
-	    }
-	    convCost += newCost;
-
-	    convCost += Cost( 0, polyCost( assert->second.formalType, alt.env, indexer ) + polyCost( assert->second.actualType, alt.env, indexer ), 0 );
-	}
-
-	return convCost;
-    }
-
-    void makeUnifiableVars( Type *type, OpenVarSet &unifiableVars, AssertionSet &needAssertions ) {
-	for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
-	    unifiableVars[ (*tyvar)->get_name() ] = (*tyvar)->get_kind();
-	    for ( std::list< DeclarationWithType* >::iterator assert = (*tyvar)->get_assertions().begin(); assert != (*tyvar)->get_assertions().end(); ++assert ) {
-		needAssertions[ *assert ] = true;
-	    }
-///     needAssertions.insert( needAssertions.end(), (*tyvar)->get_assertions().begin(), (*tyvar)->get_assertions().end() );
-	}
-    }
-
-    bool AlternativeFinder::instantiateFunction( std::list< DeclarationWithType* >& formals, /*const*/ AltList &actuals, bool isVarArgs, OpenVarSet& openVars, TypeEnvironment &resultEnv, AssertionSet &resultNeed, AssertionSet &resultHave ) {
-	std::list< TypeEnvironment > toBeDone;
-	simpleCombineEnvironments( actuals.begin(), actuals.end(), resultEnv );
-	// make sure we don't widen any existing bindings
-	for ( TypeEnvironment::iterator i = resultEnv.begin(); i != resultEnv.end(); ++i ) {
-	    i->allowWidening  = false;
-	}
-	resultEnv.extractOpenVars( openVars );
-
-	/*
-	  Tuples::NameMatcher matcher( formals );
-	  try {
-	  matcher.match( actuals );
-	  } catch ( Tuples::NoMatch &e ) {
-	  std::cerr << "Alternative doesn't match: " << e.message << std::endl;
-	  }
-	*/
-	std::list< DeclarationWithType* >::iterator formal = formals.begin();
-	for ( AltList::const_iterator actualExpr = actuals.begin(); actualExpr != actuals.end(); ++actualExpr ) {
-	    for ( std::list< Type* >::iterator actual = actualExpr->expr->get_results().begin(); actual != actualExpr->expr->get_results().end(); ++actual ) {
-		if ( formal == formals.end() ) {
-		    return isVarArgs;
-		}
-		PRINT(
-		    std::cerr << "formal type is ";
-		    (*formal)->get_type()->print( std::cerr );
-		    std::cerr << std::endl << "actual type is ";
-		    (*actual)->print( std::cerr );
-		    std::cerr << std::endl;
-		    )
-		if ( !unify( (*formal)->get_type(), *actual, resultEnv, resultNeed, resultHave, openVars, indexer ) ) {
-		    return false;
-		}
-		formal++;
-	    }
-	}
-	// Handling of default values
-	while ( formal != formals.end() ) {
-	    if ( ObjectDecl *od = dynamic_cast<ObjectDecl *>( *formal ) )
-		if ( SingleInit *si = dynamic_cast<SingleInit *>( od->get_init() ))
-		    // so far, only constant expressions are accepted as default values
-		    if ( ConstantExpr *cnstexpr = dynamic_cast<ConstantExpr *>( si->get_value()) )
-			if ( Constant *cnst = dynamic_cast<Constant *>( cnstexpr->get_constant() ) )
-			    if ( unify( (*formal)->get_type(), cnst->get_type(), resultEnv, resultNeed, resultHave, openVars, indexer ) ) {
-				// XXX Don't know if this is right
-				actuals.push_back( Alternative( cnstexpr->clone(), env, Cost::zero ) );
-				formal++;
-				if ( formal == formals.end()) break;
-			    }
-	    return false;
-	}
-	return true;
-    }
-
-    static const int recursionLimit = 10;
-
-    void addToIndexer( AssertionSet &assertSet, SymTab::Indexer &indexer ) {
-	for ( AssertionSet::iterator i = assertSet.begin(); i != assertSet.end(); ++i ) {
-	    if ( i->second == true ) {
-		i->first->accept( indexer );
-	    }
-	}
-    }
-
-    template< typename ForwardIterator, typename OutputIterator >
-    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() ) {
-		*out++ = newAlt;
-		return;
-	    } else if ( level >= recursionLimit ) {
-		throw SemanticError( "Too many recursive assertions" );
-	    } else {
-		AssertionSet newerNeed;
-		PRINT(
-		    std::cerr << "recursing with new set:" << std::endl;
-		    printAssertionSet( newNeed, std::cerr, 8 );
-		    )
-		inferRecursive( newNeed.begin(), newNeed.end(), newAlt, openVars, decls, newerNeed, level+1, indexer, out );
-		return;
-	    }
-	}
-
-	ForwardIterator cur = begin++;
-	if ( !cur->second ) {
-	    inferRecursive( begin, end, newAlt, openVars, decls, newNeed, level, indexer, out );
-	}
-	DeclarationWithType *curDecl = cur->first;
-	PRINT(
-	    std::cerr << "inferRecursive: assertion is ";
-	    curDecl->print( std::cerr );
-	    std::cerr << std::endl;
-	    )
-	std::list< DeclarationWithType* > candidates;
-	decls.lookupId( curDecl->get_name(), candidates );
+			std::cerr << "inferRecursive: assertion is ";
+			curDecl->print( std::cerr );
+			std::cerr << std::endl;
+			)
+			std::list< DeclarationWithType* > candidates;
+		decls.lookupId( curDecl->get_name(), candidates );
 ///   if ( candidates.empty() ) { std::cout << "no candidates!" << std::endl; }
-	for ( std::list< DeclarationWithType* >::const_iterator candidate = candidates.begin(); candidate != candidates.end(); ++candidate ) {
-	    PRINT(
-		std::cout << "inferRecursive: candidate is ";
-		(*candidate)->print( std::cout );
-		std::cout << std::endl;
-		)
-	    AssertionSet newHave, newerNeed( newNeed );
-	    TypeEnvironment newEnv( newAlt.env );
-	    OpenVarSet newOpenVars( openVars );
-	    Type *adjType = (*candidate)->get_type()->clone();
-	    adjustExprType( adjType, newEnv, indexer );
-	    adjType->accept( global_renamer );
-	    PRINT(
-		std::cerr << "unifying ";
-		curDecl->get_type()->print( std::cerr );
-		std::cerr << " with ";
-		adjType->print( std::cerr );
-		std::cerr << std::endl;
-		)
-	    if ( unify( curDecl->get_type(), adjType, newEnv, newerNeed, newHave, newOpenVars, indexer ) ) {
-		PRINT(
-		    std::cerr << "success!" << std::endl;
-		    )
-		SymTab::Indexer newDecls( decls );
-		addToIndexer( newHave, newDecls );
-		Alternative newerAlt( newAlt );
-		newerAlt.env = newEnv;
-		assert( (*candidate)->get_uniqueId() );
-		Expression *varExpr = new VariableExpr( static_cast< DeclarationWithType* >( Declaration::declFromId( (*candidate)->get_uniqueId() ) ) );
-		deleteAll( varExpr->get_results() );
-		varExpr->get_results().clear();
-		varExpr->get_results().push_front( adjType->clone() );
-		PRINT(
-		    std::cout << "satisfying assertion " << curDecl->get_uniqueId() << " ";
-		    curDecl->print( std::cout );
-		    std::cout << " with declaration " << (*candidate)->get_uniqueId() << " ";
-		    (*candidate)->print( std::cout );
-		    std::cout << std::endl;
-		    )
-		ApplicationExpr *appExpr = static_cast< ApplicationExpr* >( newerAlt.expr );
-		// XXX: this is a memory leak, but adjType can't be deleted because it might contain assertions
-		appExpr->get_inferParams()[ curDecl->get_uniqueId() ] = ParamEntry( (*candidate)->get_uniqueId(), adjType->clone(), curDecl->get_type()->clone(), varExpr );
-		inferRecursive( begin, end, newerAlt, newOpenVars, newDecls, newerNeed, level, indexer, out );
-	    } else {
-		delete adjType;
-	    }
-	}
-    }
-
-    template< typename OutputIterator >
-    void AlternativeFinder::inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ) {
+		for ( std::list< DeclarationWithType* >::const_iterator candidate = candidates.begin(); candidate != candidates.end(); ++candidate ) {
+			PRINT(
+				std::cout << "inferRecursive: candidate is ";
+				(*candidate)->print( std::cout );
+				std::cout << std::endl;
+				)
+				AssertionSet newHave, newerNeed( newNeed );
+			TypeEnvironment newEnv( newAlt.env );
+			OpenVarSet newOpenVars( openVars );
+			Type *adjType = (*candidate)->get_type()->clone();
+			adjustExprType( adjType, newEnv, indexer );
+			adjType->accept( global_renamer );
+			PRINT(
+				std::cerr << "unifying ";
+				curDecl->get_type()->print( std::cerr );
+				std::cerr << " with ";
+				adjType->print( std::cerr );
+				std::cerr << std::endl;
+				)
+				if ( unify( curDecl->get_type(), adjType, newEnv, newerNeed, newHave, newOpenVars, indexer ) ) {
+					PRINT(
+						std::cerr << "success!" << std::endl;
+						)
+						SymTab::Indexer newDecls( decls );
+					addToIndexer( newHave, newDecls );
+					Alternative newerAlt( newAlt );
+					newerAlt.env = newEnv;
+					assert( (*candidate)->get_uniqueId() );
+					Expression *varExpr = new VariableExpr( static_cast< DeclarationWithType* >( Declaration::declFromId( (*candidate)->get_uniqueId() ) ) );
+					deleteAll( varExpr->get_results() );
+					varExpr->get_results().clear();
+					varExpr->get_results().push_front( adjType->clone() );
+					PRINT(
+						std::cout << "satisfying assertion " << curDecl->get_uniqueId() << " ";
+						curDecl->print( std::cout );
+						std::cout << " with declaration " << (*candidate)->get_uniqueId() << " ";
+						(*candidate)->print( std::cout );
+						std::cout << std::endl;
+						)
+						ApplicationExpr *appExpr = static_cast< ApplicationExpr* >( newerAlt.expr );
+					// XXX: this is a memory leak, but adjType can't be deleted because it might contain assertions
+					appExpr->get_inferParams()[ curDecl->get_uniqueId() ] = ParamEntry( (*candidate)->get_uniqueId(), adjType->clone(), curDecl->get_type()->clone(), varExpr );
+					inferRecursive( begin, end, newerAlt, newOpenVars, newDecls, newerNeed, level, indexer, out );
+				} else {
+					delete adjType;
+				}
+		}
+	}
+
+	template< typename OutputIterator >
+	void AlternativeFinder::inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out ) {
 //	PRINT(
 //	    std::cout << "inferParameters: assertions needed are" << std::endl;
 //	    printAll( need, std::cout, 8 );
 //	    )
-	SymTab::Indexer decls( indexer );
-	PRINT(
-	    std::cout << "============= original indexer" << std::endl;
-	    indexer.print( std::cout );
-	    std::cout << "============= new indexer" << std::endl;
-	    decls.print( std::cout );
-	    )
-	addToIndexer( have, decls );
-	AssertionSet newNeed;
-	inferRecursive( need.begin(), need.end(), newAlt, openVars, decls, newNeed, 0, indexer, out );
+		SymTab::Indexer decls( indexer );
+		PRINT(
+			std::cout << "============= original indexer" << std::endl;
+			indexer.print( std::cout );
+			std::cout << "============= new indexer" << std::endl;
+			decls.print( std::cout );
+			)
+			addToIndexer( have, decls );
+		AssertionSet newNeed;
+		inferRecursive( need.begin(), need.end(), newAlt, openVars, decls, newNeed, 0, indexer, out );
 //	PRINT(
 //	    std::cout << "declaration 14 is ";
@@ -503,401 +518,405 @@
 //	    *out++ = newAlt;
 //	    )
-    }
-
-    template< typename OutputIterator >
-    void AlternativeFinder::makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, AltList &actualAlt, OutputIterator out ) {
-	OpenVarSet openVars;
-	AssertionSet resultNeed, resultHave;
-	TypeEnvironment resultEnv;
-	makeUnifiableVars( funcType, openVars, resultNeed );
-	if ( instantiateFunction( funcType->get_parameters(), actualAlt, funcType->get_isVarArgs(), openVars, resultEnv, resultNeed, resultHave ) ) {
-	    ApplicationExpr *appExpr = new ApplicationExpr( func.expr->clone() );
-	    Alternative newAlt( appExpr, resultEnv, sumCost( actualAlt ) );
-	    makeExprList( actualAlt, appExpr->get_args() );
-	    PRINT(
-		std::cout << "need assertions:" << std::endl;
-		printAssertionSet( resultNeed, std::cout, 8 );
-		)
-	    inferParameters( resultNeed, resultHave, newAlt, openVars, out );
-	}
-    }
-
-    void AlternativeFinder::visit( UntypedExpr *untypedExpr ) {
-	bool doneInit = false;
-	AlternativeFinder funcOpFinder( indexer, env );
-
-	AlternativeFinder funcFinder( indexer, env ); {
-	    NameExpr *fname;
-	    if ( ( fname = dynamic_cast<NameExpr *>( untypedExpr->get_function()))
-		 && ( fname->get_name() == std::string("LabAddress")) ) {
-		alternatives.push_back( Alternative( untypedExpr, env, Cost()) );
-		return;
-	    }
-	}
-
-	funcFinder.findWithAdjustment( untypedExpr->get_function() );
-	std::list< AlternativeFinder > argAlternatives;
-	findSubExprs( untypedExpr->begin_args(), untypedExpr->end_args(), back_inserter( argAlternatives ) );
-
-	std::list< AltList > possibilities;
-	combos( argAlternatives.begin(), argAlternatives.end(), back_inserter( possibilities ) );
-
-	Tuples::TupleAssignSpotter tassign( this );
-	if ( tassign.isTupleAssignment( untypedExpr, possibilities ) ) {
-	    // take care of possible tuple assignments, or discard expression
-	    return;
-	} // else ...
-
-	AltList candidates;
-
-	for ( AltList::const_iterator func = funcFinder.alternatives.begin(); func != funcFinder.alternatives.end(); ++func ) {
-	    PRINT(
-		std::cout << "working on alternative: " << std::endl;
-		func->print( std::cout, 8 );
-		)
-	    // check if the type is pointer to function
-	    PointerType *pointer;
-	    if ( func->expr->get_results().size() == 1 && ( pointer = dynamic_cast< PointerType* >( func->expr->get_results().front() ) ) ) {
-		if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
-		    for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
-			// XXX
-			//Designators::check_alternative( function, *actualAlt );
-			makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
-		    }
-		} else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( pointer->get_base() ) ) {
-		    EqvClass eqvClass;
-		    if ( func->env.lookup( typeInst->get_name(), eqvClass ) && eqvClass.type ) {
-			if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.type ) ) {
-			    for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
-				makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
-			    }
-			}
-		    }
-		}
-	    } else {
-		// seek a function operator that's compatible
-		if ( !doneInit ) {
-		    doneInit = true;
-		    NameExpr *opExpr = new NameExpr( "?()" );
-		    try {
-			funcOpFinder.findWithAdjustment( opExpr );
-		    } catch( SemanticError &e ) {
-			// it's ok if there aren't any defined function ops
-		    }
-		    PRINT(
-			std::cout << "known function ops:" << std::endl;
-			printAlts( funcOpFinder.alternatives, std::cout, 8 );
+	}
+
+	template< typename OutputIterator >
+	void AlternativeFinder::makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, AltList &actualAlt, OutputIterator out ) {
+		OpenVarSet openVars;
+		AssertionSet resultNeed, resultHave;
+		TypeEnvironment resultEnv;
+		makeUnifiableVars( funcType, openVars, resultNeed );
+		if ( instantiateFunction( funcType->get_parameters(), actualAlt, funcType->get_isVarArgs(), openVars, resultEnv, resultNeed, resultHave ) ) {
+			ApplicationExpr *appExpr = new ApplicationExpr( func.expr->clone() );
+			Alternative newAlt( appExpr, resultEnv, sumCost( actualAlt ) );
+			makeExprList( actualAlt, appExpr->get_args() );
+			PRINT(
+				std::cout << "need assertions:" << std::endl;
+				printAssertionSet( resultNeed, std::cout, 8 );
+				)
+				inferParameters( resultNeed, resultHave, newAlt, openVars, out );
+		}
+	}
+
+	void AlternativeFinder::visit( UntypedExpr *untypedExpr ) {
+		bool doneInit = false;
+		AlternativeFinder funcOpFinder( indexer, env );
+
+		AlternativeFinder funcFinder( indexer, env ); {
+			NameExpr *fname;
+			if ( ( fname = dynamic_cast<NameExpr *>( untypedExpr->get_function()))
+				 && ( fname->get_name() == std::string("LabAddress")) ) {
+				alternatives.push_back( Alternative( untypedExpr, env, Cost()) );
+				return;
+			}
+		}
+
+		funcFinder.findWithAdjustment( untypedExpr->get_function() );
+		std::list< AlternativeFinder > argAlternatives;
+		findSubExprs( untypedExpr->begin_args(), untypedExpr->end_args(), back_inserter( argAlternatives ) );
+
+		std::list< AltList > possibilities;
+		combos( argAlternatives.begin(), argAlternatives.end(), back_inserter( possibilities ) );
+
+		Tuples::TupleAssignSpotter tassign( this );
+		if ( tassign.isTupleAssignment( untypedExpr, possibilities ) ) {
+			// take care of possible tuple assignments, or discard expression
+			return;
+		} // else ...
+
+		AltList candidates;
+
+		for ( AltList::const_iterator func = funcFinder.alternatives.begin(); func != funcFinder.alternatives.end(); ++func ) {
+			PRINT(
+				std::cout << "working on alternative: " << std::endl;
+				func->print( std::cout, 8 );
+				)
+				// check if the type is pointer to function
+				PointerType *pointer;
+			if ( func->expr->get_results().size() == 1 && ( pointer = dynamic_cast< PointerType* >( func->expr->get_results().front() ) ) ) {
+				if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
+					for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
+						// XXX
+						//Designators::check_alternative( function, *actualAlt );
+						makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
+					}
+				} else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( pointer->get_base() ) ) {
+					EqvClass eqvClass;
+					if ( func->env.lookup( typeInst->get_name(), eqvClass ) && eqvClass.type ) {
+						if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.type ) ) {
+							for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
+								makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
+							} // for
+						} // if
+					} // if
+				} // if
+			} else {
+				// seek a function operator that's compatible
+				if ( ! doneInit ) {
+					doneInit = true;
+					NameExpr *opExpr = new NameExpr( "?()" );
+					try {
+						funcOpFinder.findWithAdjustment( opExpr );
+					} catch( SemanticError &e ) {
+						// it's ok if there aren't any defined function ops
+					}
+					PRINT(
+						std::cout << "known function ops:" << std::endl;
+						printAlts( funcOpFinder.alternatives, std::cout, 8 );
+						)
+						}
+
+				for ( AltList::const_iterator funcOp = funcOpFinder.alternatives.begin(); funcOp != funcOpFinder.alternatives.end(); ++funcOp ) {
+					// check if the type is pointer to function
+					PointerType *pointer;
+					if ( funcOp->expr->get_results().size() == 1
+						 && ( pointer = dynamic_cast< PointerType* >( funcOp->expr->get_results().front() ) ) ) {
+						if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
+							for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
+								AltList currentAlt;
+								currentAlt.push_back( *func );
+								currentAlt.insert( currentAlt.end(), actualAlt->begin(), actualAlt->end() );
+								makeFunctionAlternatives( *funcOp, function, currentAlt, std::back_inserter( candidates ) );
+							} // for
+						} // if
+					} // if
+				} // for
+			} // if
+		} // for
+
+		for ( AltList::iterator withFunc = candidates.begin(); withFunc != candidates.end(); ++withFunc ) {
+			Cost cvtCost = computeConversionCost( *withFunc, indexer );
+
+			PRINT(
+				ApplicationExpr *appExpr = dynamic_cast< ApplicationExpr* >( withFunc->expr );
+				assert( appExpr );
+				PointerType *pointer = dynamic_cast< PointerType* >( appExpr->get_function()->get_results().front() );
+				assert( pointer );
+				FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() );
+				assert( function );
+				std::cout << "Case +++++++++++++" << std::endl;
+				std::cout << "formals are:" << std::endl;
+				printAll( function->get_parameters(), std::cout, 8 );
+				std::cout << "actuals are:" << std::endl;
+				printAll( appExpr->get_args(), std::cout, 8 );
+				std::cout << "bindings are:" << std::endl;
+				withFunc->env.print( std::cout, 8 );
+				std::cout << "cost of conversion is:" << cvtCost << std::endl;
+				)
+				if ( cvtCost != Cost::infinity ) {
+					withFunc->cvtCost = cvtCost;
+					alternatives.push_back( *withFunc );
+				} // if
+		} // for
+		candidates.clear();
+		candidates.splice( candidates.end(), alternatives );
+
+		findMinCost( candidates.begin(), candidates.end(), std::back_inserter( alternatives ) );
+	}
+
+	bool isLvalue( Expression *expr ) {
+		for ( std::list< Type* >::const_iterator i = expr->get_results().begin(); i != expr->get_results().end(); ++i ) {
+			if ( !(*i)->get_isLvalue() ) return false;
+		} // for
+		return true;
+	}
+
+	void AlternativeFinder::visit( AddressExpr *addressExpr ) {
+		AlternativeFinder finder( indexer, env );
+		finder.find( addressExpr->get_arg() );
+		for ( std::list< Alternative >::iterator i = finder.alternatives.begin(); i != finder.alternatives.end(); ++i ) {
+			if ( isLvalue( i->expr ) ) {
+				alternatives.push_back( Alternative( new AddressExpr( i->expr->clone() ), i->env, i->cost ) );
+			} // if
+		} // for
+	}
+
+	void AlternativeFinder::visit( CastExpr *castExpr ) {
+		for ( std::list< Type* >::iterator i = castExpr->get_results().begin(); i != castExpr->get_results().end(); ++i ) {
+			SymTab::validateType( *i, &indexer );
+			adjustExprType( *i, env, indexer );
+		} // for
+
+		AlternativeFinder finder( indexer, env );
+		finder.findWithAdjustment( castExpr->get_arg() );
+
+		AltList candidates;
+		for ( std::list< Alternative >::iterator i = finder.alternatives.begin(); i != finder.alternatives.end(); ++i ) {
+			AssertionSet needAssertions, haveAssertions;
+			OpenVarSet openVars;
+
+			// It's possible that a cast can throw away some values in a multiply-valued expression.  (An example is a
+			// cast-to-void, which casts from one value to zero.)  Figure out the prefix of the subexpression results
+			// that are cast directly.  The candidate is invalid if it has fewer results than there are types to cast
+			// to.
+			int discardedValues = (*i).expr->get_results().size() - castExpr->get_results().size();
+			if ( discardedValues < 0 ) continue;
+			std::list< Type* >::iterator candidate_end = (*i).expr->get_results().begin();
+			std::advance( candidate_end, castExpr->get_results().size() );
+			if ( ! unifyList( (*i).expr->get_results().begin(), candidate_end,
+							 castExpr->get_results().begin(), castExpr->get_results().end(), i->env, needAssertions, haveAssertions, openVars, indexer ) ) continue;
+			Cost thisCost = castCostList( (*i).expr->get_results().begin(), candidate_end,
+										  castExpr->get_results().begin(), castExpr->get_results().end(), indexer, i->env );
+			if ( thisCost != Cost::infinity ) {
+				// count one safe conversion for each value that is thrown away
+				thisCost += Cost( 0, 0, discardedValues );
+				CastExpr *newExpr = castExpr->clone();
+				newExpr->set_arg( i->expr->clone() );
+				candidates.push_back( Alternative( newExpr, i->env, i->cost, thisCost ) );
+			} // if
+		} // for
+
+		// findMinCost selects the alternatives with the lowest "cost" members, but has the side effect of copying the
+		// cvtCost member to the cost member (since the old cost is now irrelevant).  Thus, calling findMinCost twice
+		// selects first based on argument cost, then on conversion cost.
+		AltList minArgCost;
+		findMinCost( candidates.begin(), candidates.end(), std::back_inserter( minArgCost ) );
+		findMinCost( minArgCost.begin(), minArgCost.end(), std::back_inserter( alternatives ) );
+	}
+
+	void AlternativeFinder::visit( UntypedMemberExpr *memberExpr ) {
+		AlternativeFinder funcFinder( indexer, env );
+		funcFinder.findWithAdjustment( memberExpr->get_aggregate() );
+
+		for ( AltList::const_iterator agg = funcFinder.alternatives.begin(); agg != funcFinder.alternatives.end(); ++agg ) {
+			if ( agg->expr->get_results().size() == 1 ) {
+				if ( StructInstType *structInst = dynamic_cast< StructInstType* >( agg->expr->get_results().front() ) ) {
+					addAggMembers( structInst, agg->expr, agg->cost, memberExpr->get_member() );
+				} else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( agg->expr->get_results().front() ) ) {
+					addAggMembers( unionInst, agg->expr, agg->cost, memberExpr->get_member() );
+				} // if
+			} // if
+		} // for
+	}
+
+	void AlternativeFinder::visit( MemberExpr *memberExpr ) {
+		alternatives.push_back( Alternative( memberExpr->clone(), env, Cost::zero ) );
+	}
+
+	void AlternativeFinder::visit( NameExpr *nameExpr ) {
+		std::list< DeclarationWithType* > declList;
+		indexer.lookupId( nameExpr->get_name(), declList );
+		PRINT( std::cerr << "nameExpr is " << nameExpr->get_name() << std::endl; )
+			for ( std::list< DeclarationWithType* >::iterator i = declList.begin(); i != declList.end(); ++i ) {
+				VariableExpr newExpr( *i, nameExpr->get_argName() );
+				alternatives.push_back( Alternative( newExpr.clone(), env, Cost() ) );
+				PRINT(
+					std::cerr << "decl is ";
+					(*i)->print( std::cerr );
+					std::cerr << std::endl;
+					std::cerr << "newExpr is ";
+					newExpr.print( std::cerr );
+					std::cerr << std::endl;
+					)
+					renameTypes( alternatives.back().expr );
+				if ( StructInstType *structInst = dynamic_cast< StructInstType* >( (*i)->get_type() ) ) {
+					addAggMembers( structInst, &newExpr, Cost( 0, 0, 1 ), "" );
+				} else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( (*i)->get_type() ) ) {
+					addAggMembers( unionInst, &newExpr, Cost( 0, 0, 1 ), "" );
+				} // if
+			} // for
+	}
+
+	void AlternativeFinder::visit( VariableExpr *variableExpr ) {
+		alternatives.push_back( Alternative( variableExpr->clone(), env, Cost::zero ) );
+	}
+
+	void AlternativeFinder::visit( ConstantExpr *constantExpr ) {
+		alternatives.push_back( Alternative( constantExpr->clone(), env, Cost::zero ) );
+	}
+
+	void AlternativeFinder::visit( SizeofExpr *sizeofExpr ) {
+		if ( sizeofExpr->get_isType() ) {
+			alternatives.push_back( Alternative( sizeofExpr->clone(), env, Cost::zero ) );
+		} else {
+			// find all alternatives for the argument to sizeof
+			AlternativeFinder finder( indexer, env );
+			finder.find( sizeofExpr->get_expr() );
+			// find the lowest cost alternative among the alternatives, otherwise ambiguous
+			AltList winners;
+			findMinCost( finder.alternatives.begin(), finder.alternatives.end(), back_inserter( winners ) );
+			if ( winners.size() != 1 ) {
+				throw SemanticError( "Ambiguous expression in sizeof operand: ", sizeofExpr->get_expr() );
+			} // if
+			// return the lowest cost alternative for the argument
+			Alternative &choice = winners.front();
+			alternatives.push_back( Alternative( new SizeofExpr( choice.expr->clone() ), choice.env, Cost::zero ) );
+		} // if
+	}
+
+	void AlternativeFinder::resolveAttr( DeclarationWithType *funcDecl, FunctionType *function, Type *argType, const TypeEnvironment &env ) {
+		// assume no polymorphism
+		// assume no implicit conversions
+		assert( function->get_parameters().size() == 1 );
+		PRINT(
+			std::cout << "resolvAttr: funcDecl is ";
+			funcDecl->print( std::cout );
+			std::cout << " argType is ";
+			argType->print( std::cout );
+			std::cout << std::endl;
 			)
-		}
-
-		for ( AltList::const_iterator funcOp = funcOpFinder.alternatives.begin(); funcOp != funcOpFinder.alternatives.end(); ++funcOp ) {
-		    // check if the type is pointer to function
-		    PointerType *pointer;
-		    if ( funcOp->expr->get_results().size() == 1
-			&& ( pointer = dynamic_cast< PointerType* >( funcOp->expr->get_results().front() ) ) ) {
-			if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
-			    for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
-				AltList currentAlt;
-				currentAlt.push_back( *func );
-				currentAlt.insert( currentAlt.end(), actualAlt->begin(), actualAlt->end() );
-				makeFunctionAlternatives( *funcOp, function, currentAlt, std::back_inserter( candidates ) );
-			    }
-			}
-		    }
-		}
-	    }
-	}
-
-	for ( AltList::iterator withFunc = candidates.begin(); withFunc != candidates.end(); ++withFunc ) {
-	    Cost cvtCost = computeConversionCost( *withFunc, indexer );
-
-	    PRINT(
-		ApplicationExpr *appExpr = dynamic_cast< ApplicationExpr* >( withFunc->expr );
-		assert( appExpr );
-		PointerType *pointer = dynamic_cast< PointerType* >( appExpr->get_function()->get_results().front() );
-		assert( pointer );
-		FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() );
-		assert( function );
-		std::cout << "Case +++++++++++++" << std::endl;
-		std::cout << "formals are:" << std::endl;
-		printAll( function->get_parameters(), std::cout, 8 );
-		std::cout << "actuals are:" << std::endl;
-		printAll( appExpr->get_args(), std::cout, 8 );
-		std::cout << "bindings are:" << std::endl;
-		withFunc->env.print( std::cout, 8 );
-		std::cout << "cost of conversion is:" << cvtCost << std::endl;
-		)
-	    if ( cvtCost != Cost::infinity ) {
-		withFunc->cvtCost = cvtCost;
-		alternatives.push_back( *withFunc );
-	    }
-	}
-	candidates.clear();
-	candidates.splice( candidates.end(), alternatives );
-
-	findMinCost( candidates.begin(), candidates.end(), std::back_inserter( alternatives ) );
-    }
-
-    bool isLvalue( Expression *expr ) {
-	for ( std::list< Type* >::const_iterator i = expr->get_results().begin(); i != expr->get_results().end(); ++i ) {
-	    if ( !(*i)->get_isLvalue() ) return false;
-	}
-	return true;
-    }
-
-    void AlternativeFinder::visit( AddressExpr *addressExpr ) {
-	AlternativeFinder finder( indexer, env );
-	finder.find( addressExpr->get_arg() );
-	for ( std::list< Alternative >::iterator i = finder.alternatives.begin(); i != finder.alternatives.end(); ++i ) {
-	    if ( isLvalue( i->expr ) ) {
-		alternatives.push_back( Alternative( new AddressExpr( i->expr->clone() ), i->env, i->cost ) );
-	    }
-	}
-    }
-
-    void AlternativeFinder::visit( CastExpr *castExpr ) {
-	for ( std::list< Type* >::iterator i = castExpr->get_results().begin(); i != castExpr->get_results().end(); ++i ) {
-	    SymTab::validateType( *i, &indexer );
-	    adjustExprType( *i, env, indexer );
-	}
-
-	AlternativeFinder finder( indexer, env );
-	finder.findWithAdjustment( castExpr->get_arg() );
-
-	AltList candidates;
-	for ( std::list< Alternative >::iterator i = finder.alternatives.begin(); i != finder.alternatives.end(); ++i ) {
-	    AssertionSet needAssertions, haveAssertions;
-	    OpenVarSet openVars;
-
-	    // It's possible that a cast can throw away some values in a multiply-valued expression.  (An example is a
-	    // cast-to-void, which casts from one value to zero.)  Figure out the prefix of the subexpression results
-	    // that are cast directly.  The candidate is invalid if it has fewer results than there are types to cast
-	    // to.
-	    int discardedValues = (*i).expr->get_results().size() - castExpr->get_results().size();
-	    if ( discardedValues < 0 ) continue;
-	    std::list< Type* >::iterator candidate_end = (*i).expr->get_results().begin();
-	    std::advance( candidate_end, castExpr->get_results().size() );
-	    if ( !unifyList( (*i).expr->get_results().begin(), candidate_end,
-			    castExpr->get_results().begin(), castExpr->get_results().end(), i->env, needAssertions, haveAssertions, openVars, indexer ) ) continue;
-	    Cost thisCost = castCostList( (*i).expr->get_results().begin(), candidate_end,
-					  castExpr->get_results().begin(), castExpr->get_results().end(), indexer, i->env );
-	    if ( thisCost != Cost::infinity ) {
-		// count one safe conversion for each value that is thrown away
-		thisCost += Cost( 0, 0, discardedValues );
-		CastExpr *newExpr = castExpr->clone();
-		newExpr->set_arg( i->expr->clone() );
-		candidates.push_back( Alternative( newExpr, i->env, i->cost, thisCost ) );
-	    }
-	}
-
-	// findMinCost selects the alternatives with the lowest "cost" members, but has the side effect of copying the
-	// cvtCost member to the cost member (since the old cost is now irrelevant).  Thus, calling findMinCost twice
-	// selects first based on argument cost, then on conversion cost.
-	AltList minArgCost;
-	findMinCost( candidates.begin(), candidates.end(), std::back_inserter( minArgCost ) );
-	findMinCost( minArgCost.begin(), minArgCost.end(), std::back_inserter( alternatives ) );
-    }
-
-    void AlternativeFinder::visit( UntypedMemberExpr *memberExpr ) {
-	AlternativeFinder funcFinder( indexer, env );
-	funcFinder.findWithAdjustment( memberExpr->get_aggregate() );
-
-	for ( AltList::const_iterator agg = funcFinder.alternatives.begin(); agg != funcFinder.alternatives.end(); ++agg ) {
-	    if ( agg->expr->get_results().size() == 1 ) {
-		if ( StructInstType *structInst = dynamic_cast< StructInstType* >( agg->expr->get_results().front() ) ) {
-		    addAggMembers( structInst, agg->expr, agg->cost, memberExpr->get_member() );
-		} else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( agg->expr->get_results().front() ) ) {
-		    addAggMembers( unionInst, agg->expr, agg->cost, memberExpr->get_member() );
-		}
-	    }
-	}
-    }
-
-    void AlternativeFinder::visit( MemberExpr *memberExpr ) {
-	alternatives.push_back( Alternative( memberExpr->clone(), env, Cost::zero ) );
-    }
-
-    void AlternativeFinder::visit( NameExpr *nameExpr ) {
-	std::list< DeclarationWithType* > declList;
-	indexer.lookupId( nameExpr->get_name(), declList );
-	PRINT(
-	    std::cerr << "nameExpr is " << nameExpr->get_name() << std::endl;
-	    )
-	for ( std::list< DeclarationWithType* >::iterator i = declList.begin(); i != declList.end(); ++i ) {
-	    VariableExpr newExpr( *i, nameExpr->get_argName() );
-	    alternatives.push_back( Alternative( newExpr.clone(), env, Cost() ) );
-	    PRINT(
-		std::cerr << "decl is ";
-		(*i)->print( std::cerr );
-		std::cerr << std::endl;
-		std::cerr << "newExpr is ";
-		newExpr.print( std::cerr );
-		std::cerr << std::endl;
-		)
-	    renameTypes( alternatives.back().expr );
-	    if ( StructInstType *structInst = dynamic_cast< StructInstType* >( (*i)->get_type() ) ) {
-		addAggMembers( structInst, &newExpr, Cost( 0, 0, 1 ), "" );
-	    } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( (*i)->get_type() ) ) {
-		addAggMembers( unionInst, &newExpr, Cost( 0, 0, 1 ), "" );
-	    }
-	}
-    }
-
-    void AlternativeFinder::visit( VariableExpr *variableExpr ) {
-	alternatives.push_back( Alternative( variableExpr->clone(), env, Cost::zero ) );
-    }
-
-    void AlternativeFinder::visit( ConstantExpr *constantExpr ) {
-	alternatives.push_back( Alternative( constantExpr->clone(), env, Cost::zero ) );
-    }
-
-    void AlternativeFinder::visit( SizeofExpr *sizeofExpr ) {
-	if ( sizeofExpr->get_isType() ) {
-	    alternatives.push_back( Alternative( sizeofExpr->clone(), env, Cost::zero ) );
-	} else {
-	    // find all alternatives for the argument to sizeof
-	    AlternativeFinder finder( indexer, env );
-	    finder.find( sizeofExpr->get_expr() );
-	    // find the lowest cost alternative among the alternatives, otherwise ambiguous
-	    AltList winners;
-	    findMinCost( finder.alternatives.begin(), finder.alternatives.end(), back_inserter( winners ) );
-	    if ( winners.size() != 1 ) {
-		throw SemanticError( "Ambiguous expression in sizeof operand: ", sizeofExpr->get_expr() );
-	    }
-	    // return the lowest cost alternative for the argument
-	    Alternative &choice = winners.front();
-	    alternatives.push_back( Alternative( new SizeofExpr( choice.expr->clone() ), choice.env, Cost::zero ) );
-	}
-    }
-
-    void AlternativeFinder::resolveAttr( DeclarationWithType *funcDecl, FunctionType *function, Type *argType, const TypeEnvironment &env ) {
-	// assume no polymorphism
-	// assume no implicit conversions
-	assert( function->get_parameters().size() == 1 );
-	PRINT(
-	    std::cout << "resolvAttr: funcDecl is ";
-	    funcDecl->print( std::cout );
-	    std::cout << " argType is ";
-	    argType->print( std::cout );
-	    std::cout << std::endl;
-	    )
-	if ( typesCompatibleIgnoreQualifiers( argType, function->get_parameters().front()->get_type(), indexer, env ) ) {
-	    alternatives.push_back( Alternative( new AttrExpr( new VariableExpr( funcDecl ), argType->clone() ), env, Cost::zero ) );
-	    for ( std::list< DeclarationWithType* >::iterator i = function->get_returnVals().begin(); i != function->get_returnVals().end(); ++i ) {
-		alternatives.back().expr->get_results().push_back( (*i)->get_type()->clone() );
-	    }
-	}
-    }
-
-    void AlternativeFinder::visit( AttrExpr *attrExpr ) {
-	// assume no 'pointer-to-attribute'
-	NameExpr *nameExpr = dynamic_cast< NameExpr* >( attrExpr->get_attr() );
-	assert( nameExpr );
-	std::list< DeclarationWithType* > attrList;
-	indexer.lookupId( nameExpr->get_name(), attrList );
-	if ( attrExpr->get_isType() || attrExpr->get_expr() ) {
-	    for ( std::list< DeclarationWithType* >::iterator i = attrList.begin(); i != attrList.end(); ++i ) {
-		// check if the type is function
-		if ( FunctionType *function = dynamic_cast< FunctionType* >( (*i)->get_type() ) ) {
-		    // assume exactly one parameter
-		    if ( function->get_parameters().size() == 1 ) {
-			if ( attrExpr->get_isType() ) {
-			    resolveAttr( *i, function, attrExpr->get_type(), env );
-			} else {
-			    AlternativeFinder finder( indexer, env );
-			    finder.find( attrExpr->get_expr() );
-			    for ( AltList::iterator choice = finder.alternatives.begin(); choice != finder.alternatives.end(); ++choice ) {
-				if ( choice->expr->get_results().size() == 1 ) {
-				    resolveAttr(*i, function, choice->expr->get_results().front(), choice->env );
-				}
-			    }
-			}
-		    }
-		}
-	    }
-	} else {
-	    for ( std::list< DeclarationWithType* >::iterator i = attrList.begin(); i != attrList.end(); ++i ) {
-		VariableExpr newExpr( *i );
-		alternatives.push_back( Alternative( newExpr.clone(), env, Cost() ) );
-		renameTypes( alternatives.back().expr );
-	    }
-	}
-    }
-
-    void AlternativeFinder::visit( LogicalExpr *logicalExpr ) {
-	AlternativeFinder firstFinder( indexer, env );
-	firstFinder.findWithAdjustment( logicalExpr->get_arg1() );
-	for ( AltList::const_iterator first = firstFinder.alternatives.begin(); first != firstFinder.alternatives.end(); ++first ) {
-	    AlternativeFinder secondFinder( indexer, first->env );
-	    secondFinder.findWithAdjustment( logicalExpr->get_arg2() );
-	    for ( AltList::const_iterator second = secondFinder.alternatives.begin(); second != secondFinder.alternatives.end(); ++second ) {
-		LogicalExpr *newExpr = new LogicalExpr( first->expr->clone(), second->expr->clone(), logicalExpr->get_isAnd() );
-		alternatives.push_back( Alternative( newExpr, second->env, first->cost + second->cost ) );
-	    }
-	}
-    }
-
-    void AlternativeFinder::visit( ConditionalExpr *conditionalExpr ) {
-	AlternativeFinder firstFinder( indexer, env );
-	firstFinder.findWithAdjustment( conditionalExpr->get_arg1() );
-	for ( AltList::const_iterator first = firstFinder.alternatives.begin(); first != firstFinder.alternatives.end(); ++first ) {
-	    AlternativeFinder secondFinder( indexer, first->env );
-	    secondFinder.findWithAdjustment( conditionalExpr->get_arg2() );
-	    for ( AltList::const_iterator second = secondFinder.alternatives.begin(); second != secondFinder.alternatives.end(); ++second ) {
-		AlternativeFinder thirdFinder( indexer, second->env );
-		thirdFinder.findWithAdjustment( conditionalExpr->get_arg3() );
-		for ( AltList::const_iterator third = thirdFinder.alternatives.begin(); third != thirdFinder.alternatives.end(); ++third ) {
-		    OpenVarSet openVars;
-		    AssertionSet needAssertions, haveAssertions;
-		    Alternative newAlt( 0, third->env, first->cost + second->cost + third->cost );
-		    std::list< Type* > commonTypes;
-		    if ( unifyList( second->expr->get_results().begin(), second->expr->get_results().end(), third->expr->get_results().begin(), third->expr->get_results().end(), newAlt.env, needAssertions, haveAssertions, openVars, indexer, commonTypes ) ) {
-			ConditionalExpr *newExpr = new ConditionalExpr( first->expr->clone(), second->expr->clone(), third->expr->clone() );
-			std::list< Type* >::const_iterator original = second->expr->get_results().begin();
-			std::list< Type* >::const_iterator commonType = commonTypes.begin();
-			for ( ; original != second->expr->get_results().end() && commonType != commonTypes.end(); ++original, ++commonType ) {
-			    if ( *commonType ) {
-				newExpr->get_results().push_back( *commonType );
-			    } else {
-				newExpr->get_results().push_back( (*original)->clone() );
-			    }
-			}
-			newAlt.expr = newExpr;
-			inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( alternatives ) );
-		    }
-		}
-	    }
-	}
-    }
-
-    void AlternativeFinder::visit( CommaExpr *commaExpr ) {
-	TypeEnvironment newEnv( env );
-	Expression *newFirstArg = resolveInVoidContext( commaExpr->get_arg1(), indexer, newEnv );
-	AlternativeFinder secondFinder( indexer, newEnv );
-	secondFinder.findWithAdjustment( commaExpr->get_arg2() );
-	for ( AltList::const_iterator alt = secondFinder.alternatives.begin(); alt != secondFinder.alternatives.end(); ++alt ) {
-	    alternatives.push_back( Alternative( new CommaExpr( newFirstArg->clone(), alt->expr->clone() ), alt->env, alt->cost ) );
-	}
-	delete newFirstArg;
-    }
-
-    void AlternativeFinder::visit( TupleExpr *tupleExpr ) {
-	std::list< AlternativeFinder > subExprAlternatives;
-	findSubExprs( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end(), back_inserter( subExprAlternatives ) );
-	std::list< AltList > possibilities;
-	combos( subExprAlternatives.begin(), subExprAlternatives.end(), back_inserter( possibilities ) );
-	for ( std::list< AltList >::const_iterator i = possibilities.begin(); i != possibilities.end(); ++i ) {
-	    TupleExpr *newExpr = new TupleExpr;
-	    makeExprList( *i, newExpr->get_exprs() );
-	    for ( std::list< Expression* >::const_iterator resultExpr = newExpr->get_exprs().begin(); resultExpr != newExpr->get_exprs().end(); ++resultExpr ) {
-		for ( std::list< Type* >::const_iterator resultType = (*resultExpr)->get_results().begin(); resultType != (*resultExpr)->get_results().end(); ++resultType ) {
-		    newExpr->get_results().push_back( (*resultType)->clone() );
-		}
-	    }
-
-	    TypeEnvironment compositeEnv;
-	    simpleCombineEnvironments( i->begin(), i->end(), compositeEnv );
-	    alternatives.push_back( Alternative( newExpr, compositeEnv, sumCost( *i ) ) );
-	}
-    }
+			if ( typesCompatibleIgnoreQualifiers( argType, function->get_parameters().front()->get_type(), indexer, env ) ) {
+				alternatives.push_back( Alternative( new AttrExpr( new VariableExpr( funcDecl ), argType->clone() ), env, Cost::zero ) );
+				for ( std::list< DeclarationWithType* >::iterator i = function->get_returnVals().begin(); i != function->get_returnVals().end(); ++i ) {
+					alternatives.back().expr->get_results().push_back( (*i)->get_type()->clone() );
+				} // for
+			} // if
+	}
+
+	void AlternativeFinder::visit( AttrExpr *attrExpr ) {
+		// assume no 'pointer-to-attribute'
+		NameExpr *nameExpr = dynamic_cast< NameExpr* >( attrExpr->get_attr() );
+		assert( nameExpr );
+		std::list< DeclarationWithType* > attrList;
+		indexer.lookupId( nameExpr->get_name(), attrList );
+		if ( attrExpr->get_isType() || attrExpr->get_expr() ) {
+			for ( std::list< DeclarationWithType* >::iterator i = attrList.begin(); i != attrList.end(); ++i ) {
+				// check if the type is function
+				if ( FunctionType *function = dynamic_cast< FunctionType* >( (*i)->get_type() ) ) {
+					// assume exactly one parameter
+					if ( function->get_parameters().size() == 1 ) {
+						if ( attrExpr->get_isType() ) {
+							resolveAttr( *i, function, attrExpr->get_type(), env );
+						} else {
+							AlternativeFinder finder( indexer, env );
+							finder.find( attrExpr->get_expr() );
+							for ( AltList::iterator choice = finder.alternatives.begin(); choice != finder.alternatives.end(); ++choice ) {
+								if ( choice->expr->get_results().size() == 1 ) {
+									resolveAttr(*i, function, choice->expr->get_results().front(), choice->env );
+								} // fi
+							} // for
+						} // if
+					} // if
+				} // if
+			} // for
+		} else {
+			for ( std::list< DeclarationWithType* >::iterator i = attrList.begin(); i != attrList.end(); ++i ) {
+				VariableExpr newExpr( *i );
+				alternatives.push_back( Alternative( newExpr.clone(), env, Cost() ) );
+				renameTypes( alternatives.back().expr );
+			} // for
+		} // if
+	}
+
+	void AlternativeFinder::visit( LogicalExpr *logicalExpr ) {
+		AlternativeFinder firstFinder( indexer, env );
+		firstFinder.findWithAdjustment( logicalExpr->get_arg1() );
+		for ( AltList::const_iterator first = firstFinder.alternatives.begin(); first != firstFinder.alternatives.end(); ++first ) {
+			AlternativeFinder secondFinder( indexer, first->env );
+			secondFinder.findWithAdjustment( logicalExpr->get_arg2() );
+			for ( AltList::const_iterator second = secondFinder.alternatives.begin(); second != secondFinder.alternatives.end(); ++second ) {
+				LogicalExpr *newExpr = new LogicalExpr( first->expr->clone(), second->expr->clone(), logicalExpr->get_isAnd() );
+				alternatives.push_back( Alternative( newExpr, second->env, first->cost + second->cost ) );
+			}
+		}
+	}
+
+	void AlternativeFinder::visit( ConditionalExpr *conditionalExpr ) {
+		AlternativeFinder firstFinder( indexer, env );
+		firstFinder.findWithAdjustment( conditionalExpr->get_arg1() );
+		for ( AltList::const_iterator first = firstFinder.alternatives.begin(); first != firstFinder.alternatives.end(); ++first ) {
+			AlternativeFinder secondFinder( indexer, first->env );
+			secondFinder.findWithAdjustment( conditionalExpr->get_arg2() );
+			for ( AltList::const_iterator second = secondFinder.alternatives.begin(); second != secondFinder.alternatives.end(); ++second ) {
+				AlternativeFinder thirdFinder( indexer, second->env );
+				thirdFinder.findWithAdjustment( conditionalExpr->get_arg3() );
+				for ( AltList::const_iterator third = thirdFinder.alternatives.begin(); third != thirdFinder.alternatives.end(); ++third ) {
+					OpenVarSet openVars;
+					AssertionSet needAssertions, haveAssertions;
+					Alternative newAlt( 0, third->env, first->cost + second->cost + third->cost );
+					std::list< Type* > commonTypes;
+					if ( unifyList( second->expr->get_results().begin(), second->expr->get_results().end(), third->expr->get_results().begin(), third->expr->get_results().end(), newAlt.env, needAssertions, haveAssertions, openVars, indexer, commonTypes ) ) {
+						ConditionalExpr *newExpr = new ConditionalExpr( first->expr->clone(), second->expr->clone(), third->expr->clone() );
+						std::list< Type* >::const_iterator original = second->expr->get_results().begin();
+						std::list< Type* >::const_iterator commonType = commonTypes.begin();
+						for ( ; original != second->expr->get_results().end() && commonType != commonTypes.end(); ++original, ++commonType ) {
+							if ( *commonType ) {
+								newExpr->get_results().push_back( *commonType );
+							} else {
+								newExpr->get_results().push_back( (*original)->clone() );
+							} // if
+						} // for
+						newAlt.expr = newExpr;
+						inferParameters( needAssertions, haveAssertions, newAlt, openVars, back_inserter( alternatives ) );
+					} // if
+				} // for
+			} // for
+		} // for
+	}
+
+	void AlternativeFinder::visit( CommaExpr *commaExpr ) {
+		TypeEnvironment newEnv( env );
+		Expression *newFirstArg = resolveInVoidContext( commaExpr->get_arg1(), indexer, newEnv );
+		AlternativeFinder secondFinder( indexer, newEnv );
+		secondFinder.findWithAdjustment( commaExpr->get_arg2() );
+		for ( AltList::const_iterator alt = secondFinder.alternatives.begin(); alt != secondFinder.alternatives.end(); ++alt ) {
+			alternatives.push_back( Alternative( new CommaExpr( newFirstArg->clone(), alt->expr->clone() ), alt->env, alt->cost ) );
+		} // for
+		delete newFirstArg;
+	}
+
+	void AlternativeFinder::visit( TupleExpr *tupleExpr ) {
+		std::list< AlternativeFinder > subExprAlternatives;
+		findSubExprs( tupleExpr->get_exprs().begin(), tupleExpr->get_exprs().end(), back_inserter( subExprAlternatives ) );
+		std::list< AltList > possibilities;
+		combos( subExprAlternatives.begin(), subExprAlternatives.end(), back_inserter( possibilities ) );
+		for ( std::list< AltList >::const_iterator i = possibilities.begin(); i != possibilities.end(); ++i ) {
+			TupleExpr *newExpr = new TupleExpr;
+			makeExprList( *i, newExpr->get_exprs() );
+			for ( std::list< Expression* >::const_iterator resultExpr = newExpr->get_exprs().begin(); resultExpr != newExpr->get_exprs().end(); ++resultExpr ) {
+				for ( std::list< Type* >::const_iterator resultType = (*resultExpr)->get_results().begin(); resultType != (*resultExpr)->get_results().end(); ++resultType ) {
+					newExpr->get_results().push_back( (*resultType)->clone() );
+				} // for
+			} // for
+
+			TypeEnvironment compositeEnv;
+			simpleCombineEnvironments( i->begin(), i->end(), compositeEnv );
+			alternatives.push_back( Alternative( newExpr, compositeEnv, sumCost( *i ) ) );
+		} // for
+	}
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/AlternativeFinder.h
===================================================================
--- translator/ResolvExpr/AlternativeFinder.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/AlternativeFinder.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// AlternativeFinder.h -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sat May 16 23:56:12 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sat May 16 23:58:43 2015
+// Update Count     : 2
+// 
+
 #ifndef ALTERNATIVEFINDER_H
 #define ALTERNATIVEFINDER_H
@@ -11,58 +26,64 @@
 
 namespace ResolvExpr {
-    class AlternativeFinder : public Visitor {
-      public:
-	AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env );
-	void find( Expression *expr, bool adjust = false );
-	void findWithAdjustment( Expression *expr );
-	AltList &get_alternatives() { return alternatives; }
-  
-	// make this look like an STL container so that we can apply generic algorithms
-	typedef Alternative value_type;
-	typedef AltList::iterator iterator;
-	typedef AltList::const_iterator const_iterator;
-	AltList::iterator begin() { return alternatives.begin(); }
-	AltList::iterator end() { return alternatives.end(); }
-	AltList::const_iterator begin() const { return alternatives.begin(); }
-	AltList::const_iterator end() const { return alternatives.end(); }
-  
-	const SymTab::Indexer &get_indexer() const { return indexer; }
-	const TypeEnvironment &get_environ() const { return env; }
-      private:
-	virtual void visit( ApplicationExpr *applicationExpr );
-	virtual void visit( UntypedExpr *untypedExpr );
-	virtual void visit( AddressExpr *addressExpr );
-	virtual void visit( CastExpr *castExpr );
-	virtual void visit( UntypedMemberExpr *memberExpr );
-	virtual void visit( MemberExpr *memberExpr );
-	virtual void visit( NameExpr *variableExpr );
-	virtual void visit( VariableExpr *variableExpr );
-	virtual void visit( ConstantExpr *constantExpr ); 
-	virtual void visit( SizeofExpr *sizeofExpr );
-	virtual void visit( AttrExpr *attrExpr );
-	virtual void visit( LogicalExpr *logicalExpr );
-	virtual void visit( ConditionalExpr *conditionalExpr );
-	virtual void visit( CommaExpr *commaExpr );
-	virtual void visit( TupleExpr *tupleExpr );
-      public:  // xxx - temporary hack - should make Tuples::TupleAssignment a friend
-	template< typename InputIterator, typename OutputIterator >
-	    void findSubExprs( InputIterator begin, InputIterator end, OutputIterator out );
+	class AlternativeFinder : public Visitor {
+	  public:
+		AlternativeFinder( const SymTab::Indexer &indexer, const TypeEnvironment &env );
+		void find( Expression *expr, bool adjust = false );
+		void findWithAdjustment( Expression *expr );
+		AltList &get_alternatives() { return alternatives; }
 
-      private:
-	template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const std::string &name );
-	bool instantiateFunction( std::list< DeclarationWithType* >& formals, /*const*/ AltList &actuals, bool isVarArgs, OpenVarSet& openVars, TypeEnvironment &resultEnv, AssertionSet &resultNeed, AssertionSet &resultHave );
-	template< typename OutputIterator >
-	    void makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, AltList &actualAlt, OutputIterator out );
-	template< typename OutputIterator >
-	    void inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out );
-	void resolveAttr( DeclarationWithType *funcDecl, FunctionType *function, Type *argType, const TypeEnvironment &env );
+		// make this look like an STL container so that we can apply generic algorithms
+		typedef Alternative value_type;
+		typedef AltList::iterator iterator;
+		typedef AltList::const_iterator const_iterator;
+		AltList::iterator begin() { return alternatives.begin(); }
+		AltList::iterator end() { return alternatives.end(); }
+		AltList::const_iterator begin() const { return alternatives.begin(); }
+		AltList::const_iterator end() const { return alternatives.end(); }
 
-	const SymTab::Indexer &indexer;
-	AltList alternatives;
-	const TypeEnvironment &env;
-    }; // AlternativeFinder
+		const SymTab::Indexer &get_indexer() const { return indexer; }
+		const TypeEnvironment &get_environ() const { return env; }
+	  private:
+		virtual void visit( ApplicationExpr *applicationExpr );
+		virtual void visit( UntypedExpr *untypedExpr );
+		virtual void visit( AddressExpr *addressExpr );
+		virtual void visit( CastExpr *castExpr );
+		virtual void visit( UntypedMemberExpr *memberExpr );
+		virtual void visit( MemberExpr *memberExpr );
+		virtual void visit( NameExpr *variableExpr );
+		virtual void visit( VariableExpr *variableExpr );
+		virtual void visit( ConstantExpr *constantExpr ); 
+		virtual void visit( SizeofExpr *sizeofExpr );
+		virtual void visit( AttrExpr *attrExpr );
+		virtual void visit( LogicalExpr *logicalExpr );
+		virtual void visit( ConditionalExpr *conditionalExpr );
+		virtual void visit( CommaExpr *commaExpr );
+		virtual void visit( TupleExpr *tupleExpr );
+	  public:  // xxx - temporary hack - should make Tuples::TupleAssignment a friend
+		template< typename InputIterator, typename OutputIterator >
+		void findSubExprs( InputIterator begin, InputIterator end, OutputIterator out );
 
-    Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env );
+	  private:
+		template< typename StructOrUnionType > void addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Cost &newCost, const std::string &name );
+		bool instantiateFunction( std::list< DeclarationWithType* >& formals, /*const*/ AltList &actuals, bool isVarArgs, OpenVarSet& openVars, TypeEnvironment &resultEnv, AssertionSet &resultNeed, AssertionSet &resultHave );
+		template< typename OutputIterator >
+		void makeFunctionAlternatives( const Alternative &func, FunctionType *funcType, AltList &actualAlt, OutputIterator out );
+		template< typename OutputIterator >
+		void inferParameters( const AssertionSet &need, AssertionSet &have, const Alternative &newAlt, OpenVarSet &openVars, OutputIterator out );
+		void resolveAttr( DeclarationWithType *funcDecl, FunctionType *function, Type *argType, const TypeEnvironment &env );
+
+		const SymTab::Indexer &indexer;
+		AltList alternatives;
+		const TypeEnvironment &env;
+	}; // AlternativeFinder
+
+	Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env );
 } // namespace ResolvExpr
 
 #endif // ALTERNATIVEFINDER_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/AlternativePrinter.cc
===================================================================
--- translator/ResolvExpr/AlternativePrinter.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/AlternativePrinter.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// AlternativePrinter.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 06:53:19 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 06:55:05 2015
+// Update Count     : 2
+//
+
 #include "AlternativePrinter.h"
 #include "AlternativeFinder.h"
@@ -8,18 +23,24 @@
 
 namespace ResolvExpr {
-    AlternativePrinter::AlternativePrinter( std::ostream &os ) : SymTab::Indexer( false ), os( os ) {}
+	AlternativePrinter::AlternativePrinter( std::ostream &os ) : SymTab::Indexer( false ), os( os ) {}
 
-    void AlternativePrinter::visit( ExprStmt *exprStmt ) {
-	TypeEnvironment env;
-	AlternativeFinder finder( *this, env );
-	finder.findWithAdjustment( exprStmt->get_expr() );
-	int count = 1;
-	os << "There are " << finder.get_alternatives().size() << " alternatives" << std::endl;
-	for ( AltList::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) {
-	    os << "Alternative " << count++ << " ==============" << std::endl;
-	    printAll( i->expr->get_results(), os );
-	    //    i->print( os );
-	    os << std::endl;
-	} // for
-    } // AlternativePrinter::visit
+	void AlternativePrinter::visit( ExprStmt *exprStmt ) {
+		TypeEnvironment env;
+		AlternativeFinder finder( *this, env );
+		finder.findWithAdjustment( exprStmt->get_expr() );
+		int count = 1;
+		os << "There are " << finder.get_alternatives().size() << " alternatives" << std::endl;
+		for ( AltList::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) {
+			os << "Alternative " << count++ << " ==============" << std::endl;
+			printAll( i->expr->get_results(), os );
+			//    i->print( os );
+			os << std::endl;
+		} // for
+	} // AlternativePrinter::visit
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/AlternativePrinter.h
===================================================================
--- translator/ResolvExpr/AlternativePrinter.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/AlternativePrinter.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// AlternativePrinter.h -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 06:55:43 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 06:57:12 2015
+// Update Count     : 3
+//
+
 #ifndef ALTERNATIVEPRINTER_H
 #define ALTERNATIVEPRINTER_H
@@ -8,12 +23,18 @@
 
 namespace ResolvExpr {
-    class AlternativePrinter : public SymTab::Indexer {
-      public:
-	AlternativePrinter( std::ostream &os );
-	virtual void visit(ExprStmt *exprStmt);
-      private:
-	std::ostream &os;
-    };
+	class AlternativePrinter : public SymTab::Indexer {
+	  public:
+		AlternativePrinter( std::ostream &os );
+		virtual void visit( ExprStmt *exprStmt );
+	  private:
+		std::ostream &os;
+	};
 } // namespace ResolvExpr
 
 #endif // ALTERNATIVEPRINTER_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/CastCost.cc
===================================================================
--- translator/ResolvExpr/CastCost.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/CastCost.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// CastCost.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 06:57:43 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 06:59:10 2015
+// Update Count     : 2
+//
+
 #include "typeops.h"
 #include "Cost.h"
@@ -8,74 +23,80 @@
 
 namespace ResolvExpr {
-    class CastCost : public ConversionCost {
-      public:
-	CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
+	class CastCost : public ConversionCost {
+	  public:
+		CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
   
-	virtual void visit( BasicType *basicType );
-	virtual void visit( PointerType *pointerType );
-    };
+		virtual void visit( BasicType *basicType );
+		virtual void visit( PointerType *pointerType );
+	};
 
-    Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
-	if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
-	    EqvClass eqvClass;
-	    NamedTypeDecl *namedType;
-	    if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
-		return castCost( src, eqvClass.type, indexer, env );
-	    } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) {
-		TypeDecl *type = dynamic_cast< TypeDecl* >( namedType );
-		// all typedefs should be gone by this point
-		assert( type );
-		if ( type->get_base() ) {
-		    return castCost( src, type->get_base(), indexer, env ) + Cost( 0, 0, 1 );
+	Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
+		if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
+			EqvClass eqvClass;
+			NamedTypeDecl *namedType;
+			if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
+				return castCost( src, eqvClass.type, indexer, env );
+			} else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) {
+				TypeDecl *type = dynamic_cast< TypeDecl* >( namedType );
+				// all typedefs should be gone by this point
+				assert( type );
+				if ( type->get_base() ) {
+					return castCost( src, type->get_base(), indexer, env ) + Cost( 0, 0, 1 );
+				} // if
+			} // if
 		} // if
-	    } // if
-	} // if
-	if ( typesCompatibleIgnoreQualifiers( src, dest, indexer, env ) ) {
-	    return Cost( 0, 0, 0 );
-	} else if ( dynamic_cast< VoidType* >( dest ) ) {
-	    return Cost( 0, 0, 1 );
-	} else {
-	    CastCost converter( dest, indexer, env );
-	    src->accept( converter );
-	    if ( converter.get_cost() == Cost::infinity ) {
-		return Cost::infinity;
-	    } else {
-		return converter.get_cost() + Cost( 0, 0, 0 );
-	    } // if
-	} // if
-    }
+		if ( typesCompatibleIgnoreQualifiers( src, dest, indexer, env ) ) {
+			return Cost( 0, 0, 0 );
+		} else if ( dynamic_cast< VoidType* >( dest ) ) {
+			return Cost( 0, 0, 1 );
+		} else {
+			CastCost converter( dest, indexer, env );
+			src->accept( converter );
+			if ( converter.get_cost() == Cost::infinity ) {
+				return Cost::infinity;
+			} else {
+				return converter.get_cost() + Cost( 0, 0, 0 );
+			} // if
+		} // if
+	}
 
-    CastCost::CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env )
-	: ConversionCost( dest, indexer, env ) {
-    }
+	CastCost::CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env )
+		: ConversionCost( dest, indexer, env ) {
+	}
 
-    void CastCost::visit( BasicType *basicType ) {
-	if ( dynamic_cast< PointerType* >( dest ) ) {
-	    cost = Cost( 1, 0, 0 );
-	} else {
-	    ConversionCost::visit( basicType );
-	} // if
-    }
+	void CastCost::visit( BasicType *basicType ) {
+		if ( dynamic_cast< PointerType* >( dest ) ) {
+			cost = Cost( 1, 0, 0 );
+		} else {
+			ConversionCost::visit( basicType );
+		} // if
+	}
 
-    void CastCost::visit( PointerType *pointerType ) {
-	if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) {
-	    if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) {
-		cost = Cost( 0, 0, 1 );
-	    } else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
-		if ( destAsBasic->isInteger() ) {
-		    cost = Cost( 1, 0, 0 );
-		}
-	    } else {
-		TypeEnvironment newEnv( env );
-		newEnv.add( pointerType->get_forall() );
-		newEnv.add( pointerType->get_base()->get_forall() );
-		int assignResult = ptrsCastable( pointerType->get_base(), destAsPtr->get_base(), newEnv, indexer );
-		if ( assignResult > 0 ) {
-		    cost = Cost( 0, 0, 1 );
-		} else if ( assignResult < 0 ) {
-		    cost = Cost( 1, 0, 0 );
+	void CastCost::visit( PointerType *pointerType ) {
+		if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) {
+			if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) {
+				cost = Cost( 0, 0, 1 );
+			} else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
+				if ( destAsBasic->isInteger() ) {
+					cost = Cost( 1, 0, 0 );
+				} // if
+			} else {
+				TypeEnvironment newEnv( env );
+				newEnv.add( pointerType->get_forall() );
+				newEnv.add( pointerType->get_base()->get_forall() );
+				int assignResult = ptrsCastable( pointerType->get_base(), destAsPtr->get_base(), newEnv, indexer );
+				if ( assignResult > 0 ) {
+					cost = Cost( 0, 0, 1 );
+				} else if ( assignResult < 0 ) {
+					cost = Cost( 1, 0, 0 );
+				} // if
+			} // if
 		} // if
-	    } // if
-	} // if
-    }
+	}
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/CommonType.cc
===================================================================
--- translator/ResolvExpr/CommonType.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/CommonType.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,8 +1,16 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: CommonType.cc,v 1.6 2005/08/29 20:14:15 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// CommonType.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 06:59:27 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 07:04:50 2015
+// Update Count     : 2
+//
 
 #include "typeops.h"
@@ -14,226 +22,200 @@
 
 namespace ResolvExpr {
-
-class CommonType : public Visitor
-{
-public:
-  CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars );
-  
-  Type *get_result() const { return result; }
-
-private:
-  virtual void visit( VoidType *voidType );
-  virtual void visit( BasicType *basicType );
-  virtual void visit( PointerType *pointerType );
-  virtual void visit( ArrayType *arrayType );
-  virtual void visit( FunctionType *functionType );
-  virtual void visit( StructInstType *aggregateUseType );
-  virtual void visit( UnionInstType *aggregateUseType );
-  virtual void visit( EnumInstType *aggregateUseType );
-  virtual void visit( ContextInstType *aggregateUseType );
-  virtual void visit( TypeInstType *aggregateUseType );
-  virtual void visit( TupleType *tupleType );
-
-  template< typename RefType > void handleRefType( RefType *inst, Type *other );
-
-  Type *result;
-  Type *type2;				// inherited
-  bool widenFirst, widenSecond;
-  const SymTab::Indexer &indexer;
-  TypeEnvironment &env;
-  const OpenVarSet &openVars;
-};
-
-Type *
-commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars )
-{
-  CommonType visitor( type2, widenFirst, widenSecond, indexer, env, openVars );
-  type1->accept( visitor );
-  Type *result = visitor.get_result();
-  if( !result ) {
-    if( widenSecond ) {
-      TypeInstType *inst = dynamic_cast< TypeInstType* >( type2 );
-      if( inst ) {
-        NamedTypeDecl *nt = indexer.lookupType( inst->get_name() );
-        if( nt ) {
-          TypeDecl *type = dynamic_cast< TypeDecl* >( nt );
-          assert( type );
-          if( type->get_base() ) {
-            Type::Qualifiers tq1 = type1->get_qualifiers(), tq2 = type2->get_qualifiers();
-            AssertionSet have, need;
-            OpenVarSet newOpen( openVars );
-            type1->get_qualifiers() = Type::Qualifiers();
-            type->get_base()->get_qualifiers() = tq1;
-            if( unifyExact( type1, type->get_base(), env, have, need, newOpen, indexer ) ) {
-              result = type1->clone();
-              result->get_qualifiers() = tq1 + tq2;
-            }
-            type1->get_qualifiers() = tq1;
-            type->get_base()->get_qualifiers() = Type::Qualifiers();
-          }
-        }
-      }
-    }
-  }
+	class CommonType : public Visitor {
+	  public:
+		CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars );
+		Type *get_result() const { return result; }
+	  private:
+		virtual void visit( VoidType *voidType );
+		virtual void visit( BasicType *basicType );
+		virtual void visit( PointerType *pointerType );
+		virtual void visit( ArrayType *arrayType );
+		virtual void visit( FunctionType *functionType );
+		virtual void visit( StructInstType *aggregateUseType );
+		virtual void visit( UnionInstType *aggregateUseType );
+		virtual void visit( EnumInstType *aggregateUseType );
+		virtual void visit( ContextInstType *aggregateUseType );
+		virtual void visit( TypeInstType *aggregateUseType );
+		virtual void visit( TupleType *tupleType );
+
+		template< typename RefType > void handleRefType( RefType *inst, Type *other );
+
+		Type *result;
+		Type *type2;				// inherited
+		bool widenFirst, widenSecond;
+		const SymTab::Indexer &indexer;
+		TypeEnvironment &env;
+		const OpenVarSet &openVars;
+	};
+
+	Type *commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) {
+		CommonType visitor( type2, widenFirst, widenSecond, indexer, env, openVars );
+		type1->accept( visitor );
+		Type *result = visitor.get_result();
+		if ( ! result ) {
+			if ( widenSecond ) {
+				TypeInstType *inst = dynamic_cast< TypeInstType* >( type2 );
+				if ( inst ) {
+					NamedTypeDecl *nt = indexer.lookupType( inst->get_name() );
+					if ( nt ) {
+						TypeDecl *type = dynamic_cast< TypeDecl* >( nt );
+						assert( type );
+						if ( type->get_base() ) {
+							Type::Qualifiers tq1 = type1->get_qualifiers(), tq2 = type2->get_qualifiers();
+							AssertionSet have, need;
+							OpenVarSet newOpen( openVars );
+							type1->get_qualifiers() = Type::Qualifiers();
+							type->get_base()->get_qualifiers() = tq1;
+							if ( unifyExact( type1, type->get_base(), env, have, need, newOpen, indexer ) ) {
+								result = type1->clone();
+								result->get_qualifiers() = tq1 + tq2;
+							} // if
+							type1->get_qualifiers() = tq1;
+							type->get_base()->get_qualifiers() = Type::Qualifiers();
+						} // if
+					} // if
+				} // if
+			} // if
+		} // if
 #ifdef DEBUG
-  std::cout << "============= commonType" << std::endl << "type1 is ";
-  type1->print( std::cout );
-  std::cout << " type2 is ";
-  type2->print( std::cout );
-  if( result ) {
-    std::cout << " common type is ";
-    result->print( std::cout );
-  } else {
-    std::cout << " no common type";
-  }
-  std::cout << std::endl;
+		std::cout << "============= commonType" << std::endl << "type1 is ";
+		type1->print( std::cout );
+		std::cout << " type2 is ";
+		type2->print( std::cout );
+		if ( result ) {
+			std::cout << " common type is ";
+			result->print( std::cout );
+		} else {
+			std::cout << " no common type";
+		} // if
+		std::cout << std::endl;
 #endif
-  return result;
-}
-
-static const BasicType::Kind combinedType[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] =
-{
+		return result;
+	}
+
+	static const BasicType::Kind combinedType[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] =
+	{
 /* 		Bool		Char	SignedChar	UnsignedChar	ShortSignedInt	ShortUnsignedInt	SignedInt	UnsignedInt	LongSignedInt	LongUnsignedInt	LongLongSignedInt	LongLongUnsignedInt	Float	Double	LongDouble	FloatComplex	DoubleComplex	LongDoubleComplex	FloatImaginary	DoubleImaginary	LongDoubleImaginary */
-/* Bool */ 	{ BasicType::Bool,		BasicType::Char,	BasicType::SignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* Char */ 	{ BasicType::Char,		BasicType::Char,	BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* SignedChar */ 	{ BasicType::SignedChar,	BasicType::UnsignedChar,	BasicType::SignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* UnsignedChar */ 	{ BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* ShortSignedInt */ 	{ BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* ShortUnsignedInt */ 	{ BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* SignedInt */ 	{ BasicType::SignedInt,		BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* UnsignedInt */ 	{ BasicType::UnsignedInt,		BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* LongSignedInt */ 	{ BasicType::LongSignedInt,		BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* LongUnsignedInt */ 	{ BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* LongLongSignedInt */ 	{ BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* LongLongUnsignedInt */ 	{ BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* Float */ 	{ BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* Double */ 	{ BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::LongDouble,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* LongDouble */ 	{ BasicType::LongDouble,		BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex },
-/* FloatComplex */ 	{ BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* DoubleComplex */ 	{ BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
-/* LongDoubleComplex */ 	{ BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex },
-/* FloatImaginary */ 	{ BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatImaginary,	BasicType::DoubleImaginary,	BasicType::LongDoubleImaginary },
-/* DoubleImaginary */ 	{ BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleImaginary,	BasicType::DoubleImaginary,	BasicType::LongDoubleImaginary },
-/* LongDoubleImaginary */ 	{ BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleImaginary,	BasicType::LongDoubleImaginary,	BasicType::LongDoubleImaginary }
-};
-
-CommonType::CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars )
-  : result( 0 ), type2( type2 ), widenFirst( widenFirst ), widenSecond( widenSecond ), indexer( indexer ), env( env ), openVars( openVars )
-{
-}
-
-void 
-CommonType::visit( VoidType *voidType )
-{
-}
-
-void 
-CommonType::visit( BasicType *basicType )
-{
-  if( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) {
-    BasicType::Kind newType = combinedType[ basicType->get_kind() ][ otherBasic->get_kind() ];
-    if( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= otherBasic->get_qualifiers() ) || widenFirst ) && ( ( newType == otherBasic->get_kind() && basicType->get_qualifiers() <= otherBasic->get_qualifiers() ) || widenSecond ) ) {
-      result = new BasicType( basicType->get_qualifiers() + otherBasic->get_qualifiers(), newType );
-    }
-  }
-}
-
-void 
-CommonType::visit( PointerType *pointerType )
-{
-  if( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) {
-    if( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) ) {
-      result = otherPointer->clone();
-      result->get_qualifiers() += pointerType->get_qualifiers();
-    } else if( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) ) {
-      result = pointerType->clone();
-      result->get_qualifiers() += otherPointer->get_qualifiers();
-    } else if( ( pointerType->get_base()->get_qualifiers() >= otherPointer->get_base()->get_qualifiers() || widenFirst )
-               && ( pointerType->get_base()->get_qualifiers() <= otherPointer->get_base()->get_qualifiers() || widenSecond ) ) {
-      Type::Qualifiers tq1 = pointerType->get_base()->get_qualifiers(), tq2 = otherPointer->get_base()->get_qualifiers();
-      pointerType->get_base()->get_qualifiers() = Type::Qualifiers();
-      otherPointer->get_base()->get_qualifiers() = Type::Qualifiers();
-      AssertionSet have, need;
-      OpenVarSet newOpen( openVars );
-      if( unifyExact( pointerType->get_base(), otherPointer->get_base(), env, have, need, newOpen, indexer ) ) {
-        if( tq1 < tq2 ) {
-          result = pointerType->clone();
-        } else {
-          result = otherPointer->clone();
-        }
-        result->get_qualifiers() = tq1 + tq2;
-      } else {
-        /// std::cout << "place for ptr-to-type" << std::endl;
-      }
-      pointerType->get_base()->get_qualifiers() = tq1;
-      otherPointer->get_base()->get_qualifiers() = tq2;
-    }
-  }
-}
-
-void 
-CommonType::visit( ArrayType *arrayType )
-{
-}
-
-void 
-CommonType::visit( FunctionType *functionType )
-{
-}
-
-template< typename RefType > void 
-CommonType::handleRefType( RefType *inst, Type *other )
-{
-}
-
-void 
-CommonType::visit( StructInstType *aggregateUseType )
-{
-}
-
-void 
-CommonType::visit( UnionInstType *aggregateUseType )
-{
-}
-
-void 
-CommonType::visit( EnumInstType *aggregateUseType )
-{
-}
-
-void 
-CommonType::visit( ContextInstType *aggregateUseType )
-{
-}
-
-void 
-CommonType::visit( TypeInstType *inst )
-{
-  if( widenFirst ) {
-    NamedTypeDecl *nt = indexer.lookupType( inst->get_name() );
-    if( nt ) {
-      TypeDecl *type = dynamic_cast< TypeDecl* >( nt );
-      assert( type );
-      if( type->get_base() ) {
-        Type::Qualifiers tq1 = inst->get_qualifiers(), tq2 = type2->get_qualifiers();
-        AssertionSet have, need;
-        OpenVarSet newOpen( openVars );
-        type2->get_qualifiers() = Type::Qualifiers();
-        type->get_base()->get_qualifiers() = tq1;
-        if( unifyExact( type->get_base(), type2, env, have, need, newOpen, indexer ) ) {
-          result = type2->clone();
-          result->get_qualifiers() = tq1 + tq2;
-        }
-        type2->get_qualifiers() = tq2;
-        type->get_base()->get_qualifiers() = Type::Qualifiers();
-      }
-    }
-  }
-}
-
-void 
-CommonType::visit( TupleType *tupleType )
-{
-}
-
+		/* Bool */ 	{ BasicType::Bool,		BasicType::Char,	BasicType::SignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* Char */ 	{ BasicType::Char,		BasicType::Char,	BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* SignedChar */ 	{ BasicType::SignedChar,	BasicType::UnsignedChar,	BasicType::SignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* UnsignedChar */ 	{ BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* ShortSignedInt */ 	{ BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* ShortUnsignedInt */ 	{ BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* SignedInt */ 	{ BasicType::SignedInt,		BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* UnsignedInt */ 	{ BasicType::UnsignedInt,		BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* LongSignedInt */ 	{ BasicType::LongSignedInt,		BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* LongUnsignedInt */ 	{ BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* LongLongSignedInt */ 	{ BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* LongLongUnsignedInt */ 	{ BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* Float */ 	{ BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* Double */ 	{ BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::LongDouble,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* LongDouble */ 	{ BasicType::LongDouble,		BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex },
+		/* FloatComplex */ 	{ BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* DoubleComplex */ 	{ BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex },
+		/* LongDoubleComplex */ 	{ BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex },
+		/* FloatImaginary */ 	{ BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatImaginary,	BasicType::DoubleImaginary,	BasicType::LongDoubleImaginary },
+		/* DoubleImaginary */ 	{ BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleImaginary,	BasicType::DoubleImaginary,	BasicType::LongDoubleImaginary },
+		/* LongDoubleImaginary */ 	{ BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleImaginary,	BasicType::LongDoubleImaginary,	BasicType::LongDoubleImaginary }
+	};
+
+	CommonType::CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars )
+		: result( 0 ), type2( type2 ), widenFirst( widenFirst ), widenSecond( widenSecond ), indexer( indexer ), env( env ), openVars( openVars ) {
+	}
+
+	void CommonType::visit( VoidType *voidType ) {
+	}
+
+	void CommonType::visit( BasicType *basicType ) {
+		if ( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) {
+			BasicType::Kind newType = combinedType[ basicType->get_kind() ][ otherBasic->get_kind() ];
+			if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= otherBasic->get_qualifiers() ) || widenFirst ) && ( ( newType == otherBasic->get_kind() && basicType->get_qualifiers() <= otherBasic->get_qualifiers() ) || widenSecond ) ) {
+				result = new BasicType( basicType->get_qualifiers() + otherBasic->get_qualifiers(), newType );
+			} // if
+		} // if
+	}
+
+	void CommonType::visit( PointerType *pointerType ) {
+		if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) {
+			if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) ) {
+				result = otherPointer->clone();
+				result->get_qualifiers() += pointerType->get_qualifiers();
+			} else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) ) {
+				result = pointerType->clone();
+				result->get_qualifiers() += otherPointer->get_qualifiers();
+			} else if ( ( pointerType->get_base()->get_qualifiers() >= otherPointer->get_base()->get_qualifiers() || widenFirst )
+					   && ( pointerType->get_base()->get_qualifiers() <= otherPointer->get_base()->get_qualifiers() || widenSecond ) ) {
+				Type::Qualifiers tq1 = pointerType->get_base()->get_qualifiers(), tq2 = otherPointer->get_base()->get_qualifiers();
+				pointerType->get_base()->get_qualifiers() = Type::Qualifiers();
+				otherPointer->get_base()->get_qualifiers() = Type::Qualifiers();
+				AssertionSet have, need;
+				OpenVarSet newOpen( openVars );
+				if ( unifyExact( pointerType->get_base(), otherPointer->get_base(), env, have, need, newOpen, indexer ) ) {
+					if ( tq1 < tq2 ) {
+						result = pointerType->clone();
+					} else {
+						result = otherPointer->clone();
+					} // if
+					result->get_qualifiers() = tq1 + tq2;
+				} else {
+					/// std::cout << "place for ptr-to-type" << std::endl;
+				} // if
+				pointerType->get_base()->get_qualifiers() = tq1;
+				otherPointer->get_base()->get_qualifiers() = tq2;
+			} // if
+		} // if
+	}
+
+	void CommonType::visit( ArrayType *arrayType ) {
+	}
+
+	void CommonType::visit( FunctionType *functionType ) {
+	}
+
+	template< typename RefType > void CommonType::handleRefType( RefType *inst, Type *other ) {
+	}
+
+	void CommonType::visit( StructInstType *aggregateUseType ) {
+	}
+
+	void CommonType::visit( UnionInstType *aggregateUseType ) {
+	}
+
+	void CommonType::visit( EnumInstType *aggregateUseType ) {
+	}
+
+	void CommonType::visit( ContextInstType *aggregateUseType ) {
+	}
+
+	void CommonType::visit( TypeInstType *inst ) {
+		if ( widenFirst ) {
+			NamedTypeDecl *nt = indexer.lookupType( inst->get_name() );
+			if ( nt ) {
+				TypeDecl *type = dynamic_cast< TypeDecl* >( nt );
+				assert( type );
+				if ( type->get_base() ) {
+					Type::Qualifiers tq1 = inst->get_qualifiers(), tq2 = type2->get_qualifiers();
+					AssertionSet have, need;
+					OpenVarSet newOpen( openVars );
+					type2->get_qualifiers() = Type::Qualifiers();
+					type->get_base()->get_qualifiers() = tq1;
+					if ( unifyExact( type->get_base(), type2, env, have, need, newOpen, indexer ) ) {
+						result = type2->clone();
+						result->get_qualifiers() = tq1 + tq2;
+					} // if
+					type2->get_qualifiers() = tq2;
+					type->get_base()->get_qualifiers() = Type::Qualifiers();
+				} // if
+			} // if
+		} // if
+	}
+
+	void CommonType::visit( TupleType *tupleType ) {
+	}
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/ConversionCost.cc
===================================================================
--- translator/ResolvExpr/ConversionCost.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/ConversionCost.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,8 +1,16 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: ConversionCost.cc,v 1.11 2005/08/29 20:14:15 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// ConversionCost.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 07:06:19 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 07:22:19 2015
+// Update Count     : 4
+//
 
 #include "ConversionCost.h"
@@ -12,30 +20,26 @@
 #include "SymTab/Indexer.h"
 
-
 namespace ResolvExpr {
-
-const Cost Cost::zero = Cost( 0, 0, 0 );
-const Cost Cost::infinity = Cost( -1, -1, -1 );
-
-Cost
-conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env )
-{
-  if( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
-    EqvClass eqvClass;
-    NamedTypeDecl *namedType;
+	const Cost Cost::zero = Cost( 0, 0, 0 );
+	const Cost Cost::infinity = Cost( -1, -1, -1 );
+
+	Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
+		if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
+			EqvClass eqvClass;
+			NamedTypeDecl *namedType;
 ///     std::cout << "type inst " << destAsTypeInst->get_name();
-    if( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
-      return conversionCost( src, eqvClass.type, indexer, env );
-    } else if( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) {
+			if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
+				return conversionCost( src, eqvClass.type, indexer, env );
+			} else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) {
 ///       std::cout << " found" << std::endl;
-      TypeDecl *type = dynamic_cast< TypeDecl* >( namedType );
-      // all typedefs should be gone by this point
-      assert( type );
-      if( type->get_base() ) {
-        return conversionCost( src, type->get_base(), indexer, env ) + Cost( 0, 0, 1 );
-      }
-    }
+				TypeDecl *type = dynamic_cast< TypeDecl* >( namedType );
+				// all typedefs should be gone by this point
+				assert( type );
+				if ( type->get_base() ) {
+					return conversionCost( src, type->get_base(), indexer, env ) + Cost( 0, 0, 1 );
+				} // if
+			} // if
 ///     std::cout << " not found" << std::endl;
-  }
+		} // if
 ///   std::cout << "src is ";
 ///   src->print( std::cout );
@@ -44,226 +48,208 @@
 ///   std::cout << std::endl << "env is" << std::endl;
 ///   env.print( std::cout, 8 );
-  if( typesCompatibleIgnoreQualifiers( src, dest, indexer, env ) ) {
+		if ( typesCompatibleIgnoreQualifiers( src, dest, indexer, env ) ) {
 ///     std::cout << "compatible!" << std::endl;
-    return Cost( 0, 0, 0 );
-  } else if( dynamic_cast< VoidType* >( dest ) ) {
-    return Cost( 0, 0, 1 );
-  } else {
-    ConversionCost converter( dest, indexer, env );
-    src->accept( converter );
-    if( converter.get_cost() == Cost::infinity ) {
-      return Cost::infinity;
-    } else {
-      return converter.get_cost() + Cost( 0, 0, 0 );
-    }
-  }
-}
-
-ConversionCost::ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env )
-  : dest( dest ), indexer( indexer ), cost( Cost::infinity ), env( env )
-{
-}
+			return Cost( 0, 0, 0 );
+		} else if ( dynamic_cast< VoidType* >( dest ) ) {
+			return Cost( 0, 0, 1 );
+		} else {
+			ConversionCost converter( dest, indexer, env );
+			src->accept( converter );
+			if ( converter.get_cost() == Cost::infinity ) {
+				return Cost::infinity;
+			} else {
+				return converter.get_cost() + Cost( 0, 0, 0 );
+			} // if
+		} // if
+	}
+
+	ConversionCost::ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env )
+		: dest( dest ), indexer( indexer ), cost( Cost::infinity ), env( env ) {
+	}
 
 /*
-Old
-===
-                     Double
-                       |
-                     Float
-                       |
-                     ULong
-                     /   \
-                  UInt    Long
-                     \   /
-                      Int
-                       |
-                     Ushort
-                       |
-                     Short
-                       |
-                     Uchar
-                     /   \
-                 Schar   Char
-
-New
-===
-                               +-----LongDoubleComplex--+
-                   LongDouble--+          |             +-LongDoubleImag
-                       |         +---DoubleComplex---+         |
-                     Double------+        |          +----DoubleImag
-                       |           +-FloatComplex-+            |
-                     Float---------+              +-------FloatImag
-                       |
-                   ULongLong
-                       |
-                   LongLong
-                       |
-                     ULong
-                     /   \
-                  UInt    Long
-                     \   /
-                      Int
-                       |
-                     Ushort
-                       |
-                     Short
-                       |
-                     Uchar
-                     /   \
-                 Schar   Char
-                     \   /
-                      Bool
+            Old
+            ===
+           Double
+             |
+           Float
+             |
+           ULong
+           /   \
+        UInt    Long
+           \   /
+            Int
+             |
+           Ushort
+             |
+           Short
+             |
+           Uchar
+           /   \
+        Schar   Char
+
+                                New
+                                ===
+                       +-----LongDoubleComplex--+
+           LongDouble--+          |             +-LongDoubleImag
+             |         +---DoubleComplex---+         |
+           Double------+        |          +----DoubleImag
+             |           +-FloatComplex-+            |
+           Float---------+              +-------FloatImag
+             |
+          ULongLong
+             |
+          LongLong
+             |
+           ULong
+           /   \
+        UInt    Long
+           \   /
+            Int
+             |
+           Ushort
+             |
+           Short
+             |
+           Uchar
+           /   \
+        Schar   Char
+           \   /
+            Bool
 */
 
-static const int costMatrix[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] =
-{
-/* Src \ Dest:	Bool	Char	SChar	UChar	Short	UShort	Int	UInt	Long	ULong	LLong	ULLong	Float	Double	LDbl	FCplex	DCplex	LDCplex	FImag	DImag	LDImag */
-/* Bool */ 	{ 0,	1,	1,	2,	3,	4,	5,	6,	6,	7,	8,	9,	10,	11,	12,	11,	12,	13,	-1,	-1,	-1 },
-/* Char */ 	{ -1,	0,	-1,	1,	2,	3,	4,	5,	5,	6,	7,	8,	9,	10,	11,	10,	11,	12,	-1,	-1,	-1 },
-/* SChar */ 	{ -1,	-1,	0,	1,	2,	3,	4,	5,	5,	6,	7,	8,	9,	10,	11,	10,	11,	12,	-1,	-1,	-1 },
-/* UChar */ 	{ -1,	-1,	-1,	0,	1,	2,	3,	4,	4,	5,	6,	7,	8,	9,	10,	9,	10,	11,	-1,	-1,	-1 },
-/* Short */ 	{ -1,	-1,	-1,	-1,	0,	1,	2,	3,	3,	4,	5,	6,	7,	8,	9,	8,	9,	10,	-1,	-1,	-1 },
-/* UShort */ 	{ -1,	-1,	-1,	-1,	-1,	0,	1,	2,	2,	3,	4,	5,	6,	7,	8,	7,	8,	9,	-1,	-1,	-1 },
-/* Int */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	0,	1,	1,	2,	3,	4,	5,	6,	7,	6,	7,	8,	-1,	-1,	-1 },
-/* UInt */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	0,	-1,	1,	2,	3,	4,	5,	6,	5,	6,	7,	-1,	-1,	-1 },
-/* Long */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	0,	1,	2,	3,	4,	5,	6,	5,	6,	7,	-1,	-1,	-1 },
-/* ULong */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	0,	1,	2,	3,	4,	5,	4,	5,	6,	-1,	-1,	-1 },
-/* LLong */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	0,	1,	2,	3,	4,	3,	4,	5,	-1,	-1,	-1 },
-/* ULLong */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	0,	1,	2,	3,	2,	3,	4,	-1,	-1,	-1 },
-/* Float */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	0,	1,	2,	1,	2,	3,	-1,	-1,	-1 },
-/* Double */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	0,	1,	-1,	1,	2,	-1,	-1,	-1 },
-/* LDbl */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	0,	-1,	-1,	1,	-1,	-1,	-1 },
-/* FCplex */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	0,	1,	2,	-1,	-1,	-1 },
-/* DCplex */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	0,	1,	-1,	-1,	-1 },
-/* LDCplex */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	0,	-1,	-1,	-1 },
-/* FImag */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	1,	2,	3,	0,	1,	2 },
-/* DImag */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	1,	2,	-1,	0,	1 },
-/* LDImag */ 	{ -1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	-1,	1,	-1,	-1,	0 }
-};
-
-void 
-ConversionCost::visit(VoidType *voidType)
-{
-  cost = Cost::infinity;
-}
-
-void 
-ConversionCost::visit(BasicType *basicType)
-{
-  if( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
-    int tableResult = costMatrix[ basicType->get_kind() ][ destAsBasic->get_kind() ];
-    if( tableResult == -1 ) {
-      cost = Cost( 1, 0, 0 );
-    } else {
-      cost = Cost( 0, 0, tableResult );
-    }
-  }
-}
-
-void 
-ConversionCost::visit(PointerType *pointerType)
-{
-  if( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) {
-    if( pointerType->get_base()->get_qualifiers() <= destAsPtr->get_base()->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) {
-      cost = Cost( 0, 0, 1 );
-    } else {
-      int assignResult = ptrsAssignable( pointerType->get_base(), destAsPtr->get_base(), env );
-      if( assignResult < 0 ) {
-        cost = Cost( 0, 0, 1 );
-      } else if( assignResult > 0 ) {
-        cost = Cost( 1, 0, 0 );
-      }
-    }
-  }
-}
-
-void 
-ConversionCost::visit(ArrayType *arrayType)
-{
-}
-
-void 
-ConversionCost::visit(FunctionType *functionType)
-{
-}
-
-void 
-ConversionCost::visit(StructInstType *inst)
-{
-  if( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) {
-    if( inst->get_name() == destAsInst->get_name() ) {
-      cost = Cost::zero;
-    }
-  }
-}
-
-void 
-ConversionCost::visit(UnionInstType *inst)
-{
-  if( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) {
-    if( inst->get_name() == destAsInst->get_name() ) {
-      cost = Cost::zero;
-    }
-  }
-}
-
-void 
-ConversionCost::visit(EnumInstType *inst)
-{
-  static Type::Qualifiers q;
-  static BasicType integer( q, BasicType::SignedInt );
-  integer.accept( *this );
-  if( cost < Cost( 1, 0, 0 ) ) {
-    cost.incSafe();
-  }
-}
-
-void 
-ConversionCost::visit(ContextInstType *inst)
-{
-}
-
-void 
-ConversionCost::visit(TypeInstType *inst)
-{
-  EqvClass eqvClass;
-  NamedTypeDecl *namedType;
-  if( env.lookup( inst->get_name(), eqvClass ) ) {
-    cost = conversionCost( eqvClass.type, dest, indexer, env );
-  } else if( TypeInstType *destAsInst = dynamic_cast< TypeInstType* >( dest ) ) {
-    if( inst->get_name() == destAsInst->get_name() ) {
-      cost = Cost::zero;
-    }
-  } else if( ( namedType = indexer.lookupType( inst->get_name() ) ) ) {
-    TypeDecl *type = dynamic_cast< TypeDecl* >( namedType );
-    // all typedefs should be gone by this point
-    assert( type );
-    if( type->get_base() ) {
-      cost = conversionCost( type->get_base(), dest, indexer, env ) + Cost( 0, 0, 1 );
-    }
-  }
-}
-
-void 
-ConversionCost::visit(TupleType *tupleType)
-{
-  Cost c;
-  if( TupleType *destAsTuple = dynamic_cast< TupleType* >( dest ) ) {
-    std::list< Type* >::const_iterator srcIt = tupleType->get_types().begin();
-    std::list< Type* >::const_iterator destIt = destAsTuple->get_types().begin();
-    while( srcIt != tupleType->get_types().end() ) {
-      Cost newCost = conversionCost( *srcIt++, *destIt++, indexer, env );
-      if( newCost == Cost::infinity ) {
-        return;
-      }
-      c += newCost;
-    }
-    if( destIt != destAsTuple->get_types().end() ) {
-      cost = Cost::infinity;
-    } else {
-      cost = c;
-    }
-  }
-}
-
+	static const int costMatrix[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] =
+	{
+	/* Src \ Dest:	Bool	Char	SChar	UChar	Short	UShort	Int 	UInt	Long	ULong	LLong	ULLong	Float	Double	LDbl	FCplex	DCplex	LDCplex	FImag	DImag	LDImag */
+		/* Bool */ 	{ 0,	1,		1,		2,		3,		4,		5,		6,		6,		7,		8,		9,		10,		11,		12,		11,		12,		13,		-1,		-1,		-1 },
+		/* Char */ 	{ -1,	0,		-1,		1,		2,		3,		4,		5,		5,		6,		7,		8,		9,		10,		11,		10,		11,		12,		-1,		-1,		-1 },
+		/* SChar */ { -1,	-1,		0,		1,		2,		3,		4,		5,		5,		6,		7,		8,		9,		10,		11,		10,		11,		12,		-1,		-1,		-1 },
+		/* UChar */ { -1,	-1,		-1,		0,		1,		2,		3,		4,		4,		5,		6,		7,		8,		9,		10,		9,		10,		11,		-1,		-1,		-1 },
+		/* Short */ { -1,	-1,		-1,		-1,		0,		1,		2,		3,		3,		4,		5,		6,		7,		8,		9,		8,		9,		10,		-1,		-1,		-1 },
+		/* UShort */{ -1,	-1,		-1,		-1,		-1,		0,		1,		2,		2,		3,		4,		5,		6,		7,		8,		7,		8,		9,		-1,		-1,		-1 },
+		/* Int */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		0,		1,		1,		2,		3,		4,		5,		6,		7,		6,		7,		8,		-1,		-1,		-1 },
+		/* UInt */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		0,		-1,		1,		2,		3,		4,		5,		6,		5,		6,		7,		-1,		-1,		-1 },
+		/* Long */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		3,		4,		5,		6,		5,		6,		7,		-1,		-1,		-1 },
+		/* ULong */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		3,		4,		5,		4,		5,		6,		-1,		-1,		-1 },
+		/* LLong */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		3,		4,		3,		4,		5,		-1,		-1,		-1 },
+		/* ULLong */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		3,		2,		3,		4,		-1,		-1,		-1 },
+		/* Float */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		1,		2,		3,		-1,		-1,		-1 },
+		/* Double */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		-1,		1,		2,		-1,		-1,		-1 },
+		/* LDbl */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		-1,		-1,		1,		-1,		-1,		-1 },
+		/* FCplex */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		-1,		-1,		-1 },
+		/* DCplex */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		-1,		-1,		-1 },
+		/* LDCplex */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		-1,		-1,		-1 },
+		/* FImag */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		2,		3,		0,		1,		2 },
+		/* DImag */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		2,		-1,		0,		1 },
+		/* LDImag */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		-1,		-1,		0 }
+	};
+
+	void ConversionCost::visit(VoidType *voidType) {
+		cost = Cost::infinity;
+	}
+
+	void ConversionCost::visit(BasicType *basicType) {
+		if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
+			int tableResult = costMatrix[ basicType->get_kind() ][ destAsBasic->get_kind() ];
+			if ( tableResult == -1 ) {
+				cost = Cost( 1, 0, 0 );
+			} else {
+				cost = Cost( 0, 0, tableResult );
+			} // if
+		} // if
+	}
+
+	void ConversionCost::visit(PointerType *pointerType) {
+		if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) {
+			if ( pointerType->get_base()->get_qualifiers() <= destAsPtr->get_base()->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) {
+				cost = Cost( 0, 0, 1 );
+			} else {
+				int assignResult = ptrsAssignable( pointerType->get_base(), destAsPtr->get_base(), env );
+				if ( assignResult < 0 ) {
+					cost = Cost( 0, 0, 1 );
+				} else if ( assignResult > 0 ) {
+					cost = Cost( 1, 0, 0 );
+				} // if
+			} // if
+		} // if
+	}
+
+	void ConversionCost::visit(ArrayType *arrayType) {
+	}
+
+	void ConversionCost::visit(FunctionType *functionType) {
+	}
+
+	void ConversionCost::visit(StructInstType *inst) {
+		if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) {
+			if ( inst->get_name() == destAsInst->get_name() ) {
+				cost = Cost::zero;
+			} // if
+		} // if
+	}
+
+	void ConversionCost::visit(UnionInstType *inst) {
+		if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) {
+			if ( inst->get_name() == destAsInst->get_name() ) {
+				cost = Cost::zero;
+			} // if
+		} // if
+	}
+
+	void ConversionCost::visit(EnumInstType *inst) {
+		static Type::Qualifiers q;
+		static BasicType integer( q, BasicType::SignedInt );
+		integer.accept( *this );
+		if ( cost < Cost( 1, 0, 0 ) ) {
+			cost.incSafe();
+		} // if
+	}
+
+	void ConversionCost::visit(ContextInstType *inst) {
+	}
+
+	void ConversionCost::visit(TypeInstType *inst) {
+		EqvClass eqvClass;
+		NamedTypeDecl *namedType;
+		if ( env.lookup( inst->get_name(), eqvClass ) ) {
+			cost = conversionCost( eqvClass.type, dest, indexer, env );
+		} else if ( TypeInstType *destAsInst = dynamic_cast< TypeInstType* >( dest ) ) {
+			if ( inst->get_name() == destAsInst->get_name() ) {
+				cost = Cost::zero;
+			}
+		} else if ( ( namedType = indexer.lookupType( inst->get_name() ) ) ) {
+			TypeDecl *type = dynamic_cast< TypeDecl* >( namedType );
+			// all typedefs should be gone by this point
+			assert( type );
+			if ( type->get_base() ) {
+				cost = conversionCost( type->get_base(), dest, indexer, env ) + Cost( 0, 0, 1 );
+			} // if
+		} // if
+	}
+
+	void ConversionCost::visit(TupleType *tupleType) {
+		Cost c;
+		if ( TupleType *destAsTuple = dynamic_cast< TupleType* >( dest ) ) {
+			std::list< Type* >::const_iterator srcIt = tupleType->get_types().begin();
+			std::list< Type* >::const_iterator destIt = destAsTuple->get_types().begin();
+			while ( srcIt != tupleType->get_types().end() ) {
+				Cost newCost = conversionCost( *srcIt++, *destIt++, indexer, env );
+				if ( newCost == Cost::infinity ) {
+					return;
+				} // if
+				c += newCost;
+			} // while
+			if ( destIt != destAsTuple->get_types().end() ) {
+				cost = Cost::infinity;
+			} else {
+				cost = c;
+			} // if
+		} // if
+	}
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/ConversionCost.h
===================================================================
--- translator/ResolvExpr/ConversionCost.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/ConversionCost.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,11 +1,19 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: ConversionCost.h,v 1.6 2005/08/29 20:14:16 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// ConversionCost.h -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 09:37:28 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 09:39:23 2015
+// Update Count     : 2
+//
 
-#ifndef RESOLVEXPR_CONVERSIONCOST_PROTECTED_H
-#define RESOLVEXPR_CONVERSIONCOST_PROTECTED_H
+#ifndef CONVERSIONCOST_H
+#define CONVERSIONCOST_H
 
 #include "SynTree/Visitor.h"
@@ -15,32 +23,34 @@
 
 namespace ResolvExpr {
+	class ConversionCost : public Visitor {
+	  public:
+		ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
+  
+		Cost get_cost() const { return cost; }
 
-class ConversionCost : public Visitor
-{
-public:
-  ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
-  
-  Cost get_cost() const { return cost; }
-
-  virtual void visit(VoidType *voidType);
-  virtual void visit(BasicType *basicType);
-  virtual void visit(PointerType *pointerType);
-  virtual void visit(ArrayType *arrayType);
-  virtual void visit(FunctionType *functionType);
-  virtual void visit(StructInstType *aggregateUseType);
-  virtual void visit(UnionInstType *aggregateUseType);
-  virtual void visit(EnumInstType *aggregateUseType);
-  virtual void visit(ContextInstType *aggregateUseType);
-  virtual void visit(TypeInstType *aggregateUseType);
-  virtual void visit(TupleType *tupleType);
-
-protected:
-  Type *dest;
-  const SymTab::Indexer &indexer;
-  Cost cost;
-  const TypeEnvironment &env;
-};
-
+		virtual void visit(VoidType *voidType);
+		virtual void visit(BasicType *basicType);
+		virtual void visit(PointerType *pointerType);
+		virtual void visit(ArrayType *arrayType);
+		virtual void visit(FunctionType *functionType);
+		virtual void visit(StructInstType *aggregateUseType);
+		virtual void visit(UnionInstType *aggregateUseType);
+		virtual void visit(EnumInstType *aggregateUseType);
+		virtual void visit(ContextInstType *aggregateUseType);
+		virtual void visit(TypeInstType *aggregateUseType);
+		virtual void visit(TupleType *tupleType);
+	  protected:
+		Type *dest;
+		const SymTab::Indexer &indexer;
+		Cost cost;
+		const TypeEnvironment &env;
+	};
 } // namespace ResolvExpr
 
-#endif /* #ifndef RESOLVEXPR_CONVERSIONCOST_PROTECTED_H */
+#endif // CONVERSIONCOST_H */
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/Cost.h
===================================================================
--- translator/ResolvExpr/Cost.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/Cost.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,104 +1,122 @@
-#ifndef RESOLVEXPR_COST_H
-#define RESOLVEXPR_COST_H
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Cost.h -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 09:39:50 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 09:42:04 2015
+// Update Count     : 3
+//
+
+#ifndef COST_H
+#define COST_H
 
 #include <iostream>
 
 namespace ResolvExpr {
-    class Cost {
-      public:
-	Cost();
-	Cost( int unsafe, int poly, int safe );
+	class Cost {
+	  public:
+		Cost();
+		Cost( int unsafe, int poly, int safe );
   
-	void incUnsafe( int inc = 1 );
-	void incPoly( int inc = 1 );
-	void incSafe( int inc = 1 );
+		void incUnsafe( int inc = 1 );
+		void incPoly( int inc = 1 );
+		void incSafe( int inc = 1 );
   
-	Cost operator+( const Cost &other ) const;
-	Cost operator-( const Cost &other ) const;
-	Cost &operator+=( const Cost &other );
-	bool operator<( const Cost &other ) const;
-	bool operator==( const Cost &other ) const;
-	bool operator!=( const Cost &other ) const;
-	friend std::ostream &operator<<( std::ostream &os, const Cost &cost );
+		Cost operator+( const Cost &other ) const;
+		Cost operator-( const Cost &other ) const;
+		Cost &operator+=( const Cost &other );
+		bool operator<( const Cost &other ) const;
+		bool operator==( const Cost &other ) const;
+		bool operator!=( const Cost &other ) const;
+		friend std::ostream &operator<<( std::ostream &os, const Cost &cost );
   
-	static const Cost zero;
-	static const Cost infinity;
-      private:
-	int compare( const Cost &other ) const;
+		static const Cost zero;
+		static const Cost infinity;
+	  private:
+		int compare( const Cost &other ) const;
 
-	int unsafe;
-	int poly;
-	int safe;
-    };
+		int unsafe;
+		int poly;
+		int safe;
+	};
 
-    inline Cost::Cost() : unsafe( 0 ), poly( 0 ), safe( 0 ) {}
+	inline Cost::Cost() : unsafe( 0 ), poly( 0 ), safe( 0 ) {}
 
-    inline Cost::Cost( int unsafe, int poly, int safe ) : unsafe( unsafe ), poly( poly ), safe( safe ) {}
+	inline Cost::Cost( int unsafe, int poly, int safe ) : unsafe( unsafe ), poly( poly ), safe( safe ) {}
 
-    inline void 
-	Cost::incUnsafe( int inc ) {
-	unsafe += inc;
-    }
+	inline void Cost::incUnsafe( int inc ) {
+		unsafe += inc;
+	}
 
-    inline void 
-	Cost::incPoly( int inc ) {
-	unsafe += inc;
-    }
+	inline void Cost::incPoly( int inc ) {
+		unsafe += inc;
+	}
 
-    inline void 
-	Cost::incSafe( int inc ) {
-	unsafe += inc;
-    }
+	inline void Cost::incSafe( int inc ) {
+		unsafe += inc;
+	}
 
-    inline Cost Cost::operator+( const Cost &other ) const {
-	return Cost( unsafe + other.unsafe, poly + other.poly, safe + other.safe );
-    }
+	inline Cost Cost::operator+( const Cost &other ) const {
+		return Cost( unsafe + other.unsafe, poly + other.poly, safe + other.safe );
+	}
 
-    inline Cost Cost::operator-( const Cost &other ) const {
-	return Cost( unsafe - other.unsafe, poly - other.poly, safe - other.safe );
-    }
+	inline Cost Cost::operator-( const Cost &other ) const {
+		return Cost( unsafe - other.unsafe, poly - other.poly, safe - other.safe );
+	}
 
-    inline Cost &Cost::operator+=( const Cost &other ) {
-	unsafe += other.unsafe;
-	poly += other.poly;
-	safe += other.safe;
-	return *this;
-    }
+	inline Cost &Cost::operator+=( const Cost &other ) {
+		unsafe += other.unsafe;
+		poly += other.poly;
+		safe += other.safe;
+		return *this;
+	}
 
-    inline bool Cost::operator<( const Cost &other ) const {
+	inline bool Cost::operator<( const Cost &other ) const {
 	    if ( *this == infinity ) return false;
 	    if ( other == infinity ) return true;
 	    if ( unsafe > other.unsafe ) {
-		return false;
+			return false;
 	    } else if ( unsafe < other.unsafe ) {
-		return true;
+			return true;
 	    } else if ( poly > other.poly ) {
-		return false;
+			return false;
 	    } else if ( poly < other.poly ) {
-		return true;
+			return true;
 	    } else if ( safe > other.safe ) {
-		return false;
+			return false;
 	    } else if ( safe < other.safe ) {
-		return true;
+			return true;
 	    } else {
-		return false;
-	    }
+			return false;
+	    } // if
 	}
 
-    inline bool Cost::operator==( const Cost &other ) const {
-	return unsafe == other.unsafe
-	&& poly == other.poly
-	&& safe == other.safe;
-    }
+	inline bool Cost::operator==( const Cost &other ) const {
+		return unsafe == other.unsafe
+			&& poly == other.poly
+			&& safe == other.safe;
+	}
 
-    inline bool Cost::operator!=( const Cost &other ) const {
-	return !( *this == other );
-    }
+	inline bool Cost::operator!=( const Cost &other ) const {
+		return !( *this == other );
+	}
 
-    inline std::ostream &operator<<( std::ostream &os, const Cost &cost ) {
-	os << "( " << cost.unsafe << ", " << cost.poly << ", " << cost.safe << " )";
-	return os;
-    }
+	inline std::ostream &operator<<( std::ostream &os, const Cost &cost ) {
+		os << "( " << cost.unsafe << ", " << cost.poly << ", " << cost.safe << " )";
+		return os;
+	}
 } // namespace ResolvExpr
 
-#endif // RESOLVEXPR_COST_H
+#endif // COST_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/FindOpenVars.cc
===================================================================
--- translator/ResolvExpr/FindOpenVars.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/FindOpenVars.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,8 +1,16 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: FindOpenVars.cc,v 1.4 2005/08/29 20:14:16 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// FindOpenVars.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 09:42:48 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 09:45:25 2015
+// Update Count     : 3
+//
 
 #include "FindOpenVars.h"
@@ -10,59 +18,51 @@
 #include "SynTree/Visitor.h"
 
+namespace ResolvExpr {
+	class FindOpenVars : public Visitor {
+	  public:
+		FindOpenVars( OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen );
 
-namespace ResolvExpr {
+	  private:
+		virtual void visit(PointerType *pointerType);
+		virtual void visit(ArrayType *arrayType);
+		virtual void visit(FunctionType *functionType);
+		virtual void visit(TupleType *tupleType);
 
-class FindOpenVars : public Visitor
-{
-public:
-  FindOpenVars( OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen );
-  
-private:
-  virtual void visit(PointerType *pointerType);
-  virtual void visit(ArrayType *arrayType);
-  virtual void visit(FunctionType *functionType);
-  virtual void visit(TupleType *tupleType);
-  
-  void common_action( Type *type );
-  
-  OpenVarSet &openVars, &closedVars;
-  AssertionSet &needAssertions, &haveAssertions;
-  bool nextIsOpen;
-};
+		void common_action( Type *type );
 
-void
-findOpenVars( Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen )
-{
-  FindOpenVars finder( openVars, closedVars, needAssertions, haveAssertions, firstIsOpen );
-  type->accept( finder );
-}
+		OpenVarSet &openVars, &closedVars;
+		AssertionSet &needAssertions, &haveAssertions;
+		bool nextIsOpen;
+	};
 
-FindOpenVars::FindOpenVars( OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen )
-  : openVars( openVars ), closedVars( closedVars ), needAssertions( needAssertions ), haveAssertions( haveAssertions ), nextIsOpen( firstIsOpen )
-{
-}
+	void findOpenVars( Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen ) {
+		FindOpenVars finder( openVars, closedVars, needAssertions, haveAssertions, firstIsOpen );
+		type->accept( finder );
+	}
 
-void
-FindOpenVars::common_action( Type *type )
-{
-  if( nextIsOpen ) {
-    for( std::list< TypeDecl* >::const_iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
-      openVars[ (*i)->get_name() ] = (*i)->get_kind();
-      for( std::list< DeclarationWithType* >::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) {
-        needAssertions[ *assert ] = false;
-      }
+	FindOpenVars::FindOpenVars( OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen )
+		: openVars( openVars ), closedVars( closedVars ), needAssertions( needAssertions ), haveAssertions( haveAssertions ), nextIsOpen( firstIsOpen )	{
+	}
+
+	void FindOpenVars::common_action( Type *type ) {
+		if ( nextIsOpen ) {
+			for ( std::list< TypeDecl* >::const_iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
+				openVars[ (*i)->get_name() ] = (*i)->get_kind();
+				for ( std::list< DeclarationWithType* >::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) {
+					needAssertions[ *assert ] = false;
+				}
 ///       cloneAll( (*i)->get_assertions(), needAssertions );
 ///       needAssertions.insert( needAssertions.end(), (*i)->get_assertions().begin(), (*i)->get_assertions().end() );
-    }
-  } else {
-    for( std::list< TypeDecl* >::const_iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
-      closedVars[ (*i)->get_name() ] = (*i)->get_kind();
-      for( std::list< DeclarationWithType* >::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) {
-        haveAssertions[ *assert ] = false;
-      }
+			}
+		} else {
+			for ( std::list< TypeDecl* >::const_iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
+				closedVars[ (*i)->get_name() ] = (*i)->get_kind();
+				for ( std::list< DeclarationWithType* >::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) {
+					haveAssertions[ *assert ] = false;
+				}
 ///       cloneAll( (*i)->get_assertions(), haveAssertions );
 ///       haveAssertions.insert( haveAssertions.end(), (*i)->get_assertions().begin(), (*i)->get_assertions().end() );
-    }
-  }
+			} // for
+		} // if
 ///   std::cout << "type is ";
 ///   type->print( std::cout );
@@ -71,35 +71,32 @@
 ///   std::cout << std::endl << "have is" << std::endl;
 ///   printAssertionSet( haveAssertions, std::cout );
-}
+	}
 
-void 
-FindOpenVars::visit(PointerType *pointerType)
-{
-  common_action( pointerType );
-  Visitor::visit( pointerType );
-}
+	void FindOpenVars::visit(PointerType *pointerType) {
+		common_action( pointerType );
+		Visitor::visit( pointerType );
+	}
 
-void 
-FindOpenVars::visit(ArrayType *arrayType)
-{
-  common_action( arrayType );
-  Visitor::visit( arrayType );
-}
+	void FindOpenVars::visit(ArrayType *arrayType) {
+		common_action( arrayType );
+		Visitor::visit( arrayType );
+	}
 
-void 
-FindOpenVars::visit(FunctionType *functionType)
-{
-  common_action( functionType );
-  nextIsOpen = !nextIsOpen;
-  Visitor::visit( functionType );
-  nextIsOpen = !nextIsOpen;
-}
+	void FindOpenVars::visit(FunctionType *functionType) {
+		common_action( functionType );
+		nextIsOpen = ! nextIsOpen;
+		Visitor::visit( functionType );
+		nextIsOpen = ! nextIsOpen;
+	}
 
-void 
-FindOpenVars::visit(TupleType *tupleType)
-{
-  common_action( tupleType );
-  Visitor::visit( tupleType );
-}
+	void FindOpenVars::visit(TupleType *tupleType) {
+		common_action( tupleType );
+		Visitor::visit( tupleType );
+	}
+} // namespace ResolvExpr
 
-} // namespace ResolvExpr
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/FindOpenVars.h
===================================================================
--- translator/ResolvExpr/FindOpenVars.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/FindOpenVars.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,11 +1,19 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: FindOpenVars.h,v 1.3 2005/08/29 20:14:16 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// FindOpenVars.h -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 09:46:04 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 09:47:20 2015
+// Update Count     : 2
+//
 
-#ifndef RESOLVEXPR_FINDOPENVARS_H
-#define RESOLVEXPR_FINDOPENVARS_H
+#ifndef FINDOPENVARS_H
+#define FINDOPENVARS_H
 
 #include "Unify.h"
@@ -13,8 +21,12 @@
 
 namespace ResolvExpr {
-
-void findOpenVars( Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen );
-
+	void findOpenVars( Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen );
 } // namespace ResolvExpr
 
-#endif // #ifndef RESOLVEXPR_FINDOPENVARS_H
+#endif // FINDOPENVARS_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/Occurs.cc
===================================================================
--- translator/ResolvExpr/Occurs.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/Occurs.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,8 +1,16 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: Occurs.cc,v 1.2 2005/08/29 20:14:16 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Occurs.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 09:47:41 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 09:49:26 2015
+// Update Count     : 2
+//
 
 #include <set>
@@ -13,59 +21,52 @@
 #include "TypeEnvironment.h"
 
+namespace ResolvExpr {
+	class Occurs : public Visitor {
+	  public:
+		Occurs( std::string varName, const TypeEnvironment &env );
+		bool get_result() const { return result; }
+		virtual void visit( TypeInstType *typeInst );
+	  private:
+		bool result;
+		std::set< std::string > eqvVars;
+		const TypeEnvironment &env;
+	};
 
-namespace ResolvExpr {
+	bool occurs( Type *type, std::string varName, const TypeEnvironment &env ) {
+		Occurs occur( varName, env );
+		type->accept( occur );
+		return occur.get_result();
+	}
 
-class Occurs : public Visitor
-{
-public:
-  Occurs( std::string varName, const TypeEnvironment &env );
-  
-  bool get_result() const { return result; }
+	Occurs::Occurs( std::string varName, const TypeEnvironment &env ) : result( false ), env( env ) {
+		EqvClass eqvClass;
+		if ( env.lookup( varName, eqvClass ) ) {
+			eqvVars = eqvClass.vars;
+		} else {
+			eqvVars.insert( varName );
+		} // if
+	}
 
-  virtual void visit( TypeInstType *typeInst );
-
-private:
-  bool result;
-  std::set< std::string > eqvVars;
-  const TypeEnvironment &env;
-};
-
-bool
-occurs( Type *type, std::string varName, const TypeEnvironment &env )
-{
-  Occurs occur( varName, env );
-  type->accept( occur );
-  return occur.get_result();
-}
-
-Occurs::Occurs( std::string varName, const TypeEnvironment &env )
-  : result( false ), env( env )
-{
-  EqvClass eqvClass;
-  if( env.lookup( varName, eqvClass ) ) {
-    eqvVars = eqvClass.vars;
-  } else {
-    eqvVars.insert( varName );
-  }
-}
-
-void 
-Occurs::visit( TypeInstType *typeInst )
-{
-  EqvClass eqvClass;
+	void Occurs::visit( TypeInstType *typeInst ) {
+		EqvClass eqvClass;
 ///   std::cout << "searching for vars: ";
 ///   std::copy( eqvVars.begin(), eqvVars.end(), std::ostream_iterator< std::string >( std::cout, " " ) );
 ///   std::cout << std::endl;
-  if( eqvVars.find( typeInst->get_name() ) != eqvVars.end() ) {
-    result = true;
-  } else if( env.lookup( typeInst->get_name(), eqvClass ) ) {
-    if( eqvClass.type ) {
+		if ( eqvVars.find( typeInst->get_name() ) != eqvVars.end() ) {
+			result = true;
+		} else if ( env.lookup( typeInst->get_name(), eqvClass ) ) {
+			if ( eqvClass.type ) {
 ///       std::cout << typeInst->get_name() << " is bound to";
 ///       eqvClass.type->print( std::cout );
 ///       std::cout << std::endl;
-      eqvClass.type->accept( *this );
-    }
-  }
-}
+				eqvClass.type->accept( *this );
+			} // if
+		} // if
+	}
+} // namespace ResolvExpr
 
-} // namespace ResolvExpr
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/PolyCost.cc
===================================================================
--- translator/ResolvExpr/PolyCost.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/PolyCost.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,8 +1,16 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: PolyCost.cc,v 1.2 2005/08/29 20:14:16 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// PolyCost.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 09:50:12 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 09:52:02 2015
+// Update Count     : 3
+//
 
 #include "typeops.h"
@@ -12,51 +20,45 @@
 #include "TypeEnvironment.h"
 
+namespace ResolvExpr {
+	class PolyCost : public Visitor {
+	  public:
+		PolyCost( const TypeEnvironment &env, const SymTab::Indexer &indexer );
+		int get_result() const { return result; }
+	  private:
+		virtual void visit(TypeInstType *aggregateUseType);
+		int result;
+		const TypeEnvironment &env;
+		const SymTab::Indexer &indexer;
+	};
 
-namespace ResolvExpr {
+	int polyCost( Type *type, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
+		PolyCost coster( env, indexer );
+		type->accept( coster );
+		return coster.get_result();
+	}
 
-class PolyCost : public Visitor
-{
-public:
-  PolyCost( const TypeEnvironment &env, const SymTab::Indexer &indexer );
+	PolyCost::PolyCost( const TypeEnvironment &env, const SymTab::Indexer &indexer ) : result( 0 ), env( env ), indexer( indexer ) {
+	}
 
-  int get_result() const { return result; }
-
-private:
-  virtual void visit(TypeInstType *aggregateUseType);
-  
-  int result;
-  const TypeEnvironment &env;
-  const SymTab::Indexer &indexer;
-};
-
-int
-polyCost( Type *type, const TypeEnvironment &env, const SymTab::Indexer &indexer )
-{
-  PolyCost coster( env, indexer );
-  type->accept( coster );
-  return coster.get_result();
-}
-
-PolyCost::PolyCost( const TypeEnvironment &env, const SymTab::Indexer &indexer )
-  : result( 0 ), env( env ), indexer( indexer )
-{
-}
-
-void 
-PolyCost::visit(TypeInstType *typeInst)
-{
-  EqvClass eqvClass;
-  if( env.lookup( typeInst->get_name(), eqvClass ) ) {
-    if( eqvClass.type ) {
-      if( TypeInstType *otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) {
-        if( indexer.lookupType( otherTypeInst->get_name() ) ) {
-          result += 1;
-        }
-      } else {
-        result += 1;
-      }
-    }
-  }
-}
+	void PolyCost::visit(TypeInstType *typeInst) {
+		EqvClass eqvClass;
+		if ( env.lookup( typeInst->get_name(), eqvClass ) ) {
+			if ( eqvClass.type ) {
+				if ( TypeInstType *otherTypeInst = dynamic_cast< TypeInstType* >( eqvClass.type ) ) {
+					if ( indexer.lookupType( otherTypeInst->get_name() ) ) {
+						result += 1;
+					} // if
+				} else {
+					result += 1;
+				} // if
+			} // if
+		} // if
+	}
 
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/PtrsAssignable.cc
===================================================================
--- translator/ResolvExpr/PtrsAssignable.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/PtrsAssignable.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// PtrsAssignable.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 11:44:11 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 11:47:36 2015
+// Update Count     : 2
+//
+
 #include "typeops.h"
 #include "SynTree/Type.h"
@@ -6,97 +21,97 @@
 
 namespace ResolvExpr {
-    class PtrsAssignable : public Visitor {
-      public:
-	PtrsAssignable( Type *dest, const TypeEnvironment &env );
-  
-	int get_result() const { return result; }
+	class PtrsAssignable : public Visitor {
+	  public:
+		PtrsAssignable( Type *dest, const TypeEnvironment &env );
 
-	virtual void visit(VoidType *voidType);
-	virtual void visit(BasicType *basicType);
-	virtual void visit(PointerType *pointerType);
-	virtual void visit(ArrayType *arrayType);
-	virtual void visit(FunctionType *functionType);
-	virtual void visit(StructInstType *inst);
-	virtual void visit(UnionInstType *inst);
-	virtual void visit(EnumInstType *inst);
-	virtual void visit(ContextInstType *inst);
-	virtual void visit(TypeInstType *inst);
-	virtual void visit(TupleType *tupleType);
-      private:
-	Type *dest;
-	int result;
-	const TypeEnvironment &env;
-    };
+		int get_result() const { return result; }
 
-    int ptrsAssignable( Type *src, Type *dest, const TypeEnvironment &env ) {
-	if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
-	    EqvClass eqvClass;
-	    if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
-		return ptrsAssignable( src, eqvClass.type, env );
-	    }
+		virtual void visit( VoidType *voidType );
+		virtual void visit( BasicType *basicType );
+		virtual void visit( PointerType *pointerType );
+		virtual void visit( ArrayType *arrayType );
+		virtual void visit( FunctionType *functionType );
+		virtual void visit( StructInstType *inst );
+		virtual void visit( UnionInstType *inst );
+		virtual void visit( EnumInstType *inst );
+		virtual void visit( ContextInstType *inst );
+		virtual void visit( TypeInstType *inst );
+		virtual void visit( TupleType *tupleType );
+	  private:
+		Type *dest;
+		int result;
+		const TypeEnvironment &env;
+	};
+
+	int ptrsAssignable( Type *src, Type *dest, const TypeEnvironment &env ) {
+		if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
+			EqvClass eqvClass;
+			if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
+				return ptrsAssignable( src, eqvClass.type, env );
+			} // if
+		} // if
+		if ( dynamic_cast< VoidType* >( dest ) ) {
+			return 1;
+		} else {
+			PtrsAssignable ptrs( dest, env );
+			src->accept( ptrs );
+			return ptrs.get_result();
+		} // if
 	}
-	if ( dynamic_cast< VoidType* >( dest ) ) {
-	    return 1;
-	} else {
-	    PtrsAssignable ptrs( dest, env );
-	    src->accept( ptrs );
-	    return ptrs.get_result();
+
+	PtrsAssignable::PtrsAssignable( Type *dest, const TypeEnvironment &env ) : dest( dest ), result( 0 ), env( env ) {
 	}
-    }
 
-    PtrsAssignable::PtrsAssignable( Type *dest, const TypeEnvironment &env ) : dest( dest ), result( 0 ), env( env ) {
-    }
+	void PtrsAssignable::visit( VoidType *voidType ) {
+		if ( dynamic_cast< FunctionType* >( dest ) ) {
+			result = 0;
+		} else {
+			result = -1;
+		} // if
+	}
 
-    void PtrsAssignable::visit(VoidType *voidType) {
-	if ( dynamic_cast< FunctionType* >( dest ) ) {
-	    result = 0;
-	} else {
-	    result = -1;
+	void PtrsAssignable::visit( BasicType *basicType ) {
 	}
-    }
 
-    void PtrsAssignable::visit( BasicType *basicType ) {
-    }
+	void PtrsAssignable::visit( PointerType *pointerType ) {
+	}
 
-    void PtrsAssignable::visit( PointerType *pointerType ) {
-    }
+	void PtrsAssignable::visit( ArrayType *arrayType ) {
+	}
 
-    void PtrsAssignable::visit( ArrayType *arrayType ) {
-    }
+	void PtrsAssignable::visit( FunctionType *functionType ) {
+		result = -1;
+	}
 
-    void PtrsAssignable::visit( FunctionType *functionType ) {
-	result = -1;
-    }
+	void PtrsAssignable::visit( StructInstType *inst ) {
+		// I don't think we should be doing anything here, but I'm willing to admit that I might be wrong
+	}
 
-    void PtrsAssignable::visit( StructInstType *inst ) {
-	// I don't think we should be doing anything here, but I'm willing to admit that I might be wrong
-    }
+	void PtrsAssignable::visit( UnionInstType *inst ) {
+		// I don't think we should be doing anything here, but I'm willing to admit that I might be wrong
+	}
 
-    void PtrsAssignable::visit( UnionInstType *inst ) {
-	// I don't think we should be doing anything here, but I'm willing to admit that I might be wrong
-    }
+	void PtrsAssignable::visit( EnumInstType *inst ) {
+		if ( dynamic_cast< EnumInstType* >( inst ) ) {
+			result = 1;
+		} else if ( BasicType *bt = dynamic_cast< BasicType* >( inst ) ) {
+			result = bt->get_kind() == BasicType::SignedInt;
+		}
+	}
 
-    void PtrsAssignable::visit( EnumInstType *inst ) {
-	if ( dynamic_cast< EnumInstType* >( inst ) ) {
-	    result = 1;
-	} else if ( BasicType *bt = dynamic_cast< BasicType* >( inst ) ) {
-	    result = bt->get_kind() == BasicType::SignedInt;
+	void PtrsAssignable::visit( ContextInstType *inst ) {
+		// I definitely don't think we should be doing anything here
 	}
-    }
 
-    void PtrsAssignable::visit( ContextInstType *inst ) {
-	// I definitely don't think we should be doing anything here
-    }
+	void PtrsAssignable::visit( TypeInstType *inst ) {
+		EqvClass eqvClass;
+		if ( env.lookup( inst->get_name(), eqvClass ) ) {
+			result = ptrsAssignable( eqvClass.type, dest, env );
+		} else {
+			result = 0;
+		} // if
+	}
 
-    void PtrsAssignable::visit( TypeInstType *inst ) {
-	EqvClass eqvClass;
-	if ( env.lookup( inst->get_name(), eqvClass ) ) {
-	    result = ptrsAssignable( eqvClass.type, dest, env );
-	} else {
-	    result = 0;
-	}
-    }
-
-    void PtrsAssignable::visit( TupleType *tupleType ) {
+	void PtrsAssignable::visit( TupleType *tupleType ) {
 ///  // This code doesn't belong here, but it might be useful somewhere else
 ///   if ( TupleType *destAsTuple = dynamic_cast< TupleType* >( dest ) ) {
@@ -104,5 +119,5 @@
 ///     std::list< Type* >::const_iterator srcIt = tupleType->get_types().begin();
 ///     std::list< Type* >::const_iterator destIt = destAsTuple->get_types().begin();
-///     while( srcIt != tupleType->get_types().end() && destIt != destAsTuple->get_types().end() ) {
+///     while ( srcIt != tupleType->get_types().end() && destIt != destAsTuple->get_types().end() ) {
 ///       int assignResult = ptrsAssignable( *srcIt++, *destIt++ );
 ///       if ( assignResult == 0 ) {
@@ -121,4 +136,10 @@
 ///     }
 ///   }
-    }
+	}
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/PtrsCastable.cc
===================================================================
--- translator/ResolvExpr/PtrsCastable.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/PtrsCastable.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,8 +1,16 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: PtrsCastable.cc,v 1.5 2005/08/29 20:14:16 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// PtrsCastable.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 11:48:00 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 11:51:17 2015
+// Update Count     : 2
+//
 
 #include "typeops.h"
@@ -14,151 +22,126 @@
 
 namespace ResolvExpr {
+	class PtrsCastable : public Visitor {
+	  public:
+		PtrsCastable( Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer );
+  
+		int get_result() const { return result; }
 
-class PtrsCastable : public Visitor
-{
-public:
-  PtrsCastable( Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer );
-  
-  int get_result() const { return result; }
+		virtual void visit(VoidType *voidType);
+		virtual void visit(BasicType *basicType);
+		virtual void visit(PointerType *pointerType);
+		virtual void visit(ArrayType *arrayType);
+		virtual void visit(FunctionType *functionType);
+		virtual void visit(StructInstType *inst);
+		virtual void visit(UnionInstType *inst);
+		virtual void visit(EnumInstType *inst);
+		virtual void visit(ContextInstType *inst);
+		virtual void visit(TypeInstType *inst);
+		virtual void visit(TupleType *tupleType);
+	  private:
+		Type *dest;
+		int result;
+		const TypeEnvironment &env;
+		const SymTab::Indexer &indexer;
+	};
 
-  virtual void visit(VoidType *voidType);
-  virtual void visit(BasicType *basicType);
-  virtual void visit(PointerType *pointerType);
-  virtual void visit(ArrayType *arrayType);
-  virtual void visit(FunctionType *functionType);
-  virtual void visit(StructInstType *inst);
-  virtual void visit(UnionInstType *inst);
-  virtual void visit(EnumInstType *inst);
-  virtual void visit(ContextInstType *inst);
-  virtual void visit(TypeInstType *inst);
-  virtual void visit(TupleType *tupleType);
+	int objectCast( Type *src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
+		if ( dynamic_cast< FunctionType* >( src ) ) {
+			return -1;
+		} else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( src ) ) {
+			EqvClass eqvClass;
+			if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) {
+				if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) {
+					if ( tyDecl->get_kind() == TypeDecl::Ftype ) {
+						return -1;
+					} // if
+				} //if
+			} else if ( env.lookup( typeInst->get_name(), eqvClass ) ) {
+				if ( eqvClass.kind == TypeDecl::Ftype ) {
+					return -1;
+				} // if
+			} // if
+		} //if
+		return 1;
+	}
 
-private:
-  Type *dest;
-  int result;
-  const TypeEnvironment &env;
-  const SymTab::Indexer &indexer;
-};
+	int ptrsCastable( Type *src, Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
+		if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
+			EqvClass eqvClass;
+			if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
+				return ptrsAssignable( src, eqvClass.type, env );
+			} // if
+		} // if
+		if ( dynamic_cast< VoidType* >( dest ) ) {
+			return objectCast( src, env, indexer );
+		} else {
+			PtrsCastable ptrs( dest, env, indexer );
+			src->accept( ptrs );
+			return ptrs.get_result();
+		} // if
+	}
 
-int
-objectCast( Type *src, const TypeEnvironment &env, const SymTab::Indexer &indexer )
-{
-  if( dynamic_cast< FunctionType* >( src ) ) {
-    return -1;
-  } else if( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( src ) ) {
-    EqvClass eqvClass;
-    if( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) {
-      if( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) {
-        if( tyDecl->get_kind() == TypeDecl::Ftype ) {
-          return -1;
-        }
-      }
-    } else if( env.lookup( typeInst->get_name(), eqvClass ) ) {
-      if( eqvClass.kind == TypeDecl::Ftype ) {
-        return -1;
-      }
-    }
-  }
-  return 1;
-}
+	PtrsCastable::PtrsCastable( Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer )
+		: dest( dest ), result( 0 ), env( env ), indexer( indexer )	{
+	}
 
-int
-ptrsCastable( Type *src, Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer )
-{
-  if( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
-    EqvClass eqvClass;
-    if( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
-      return ptrsAssignable( src, eqvClass.type, env );
-    }
-  }
-  if( dynamic_cast< VoidType* >( dest ) ) {
-    return objectCast( src, env, indexer );
-  } else {
-    PtrsCastable ptrs( dest, env, indexer );
-    src->accept( ptrs );
-    return ptrs.get_result();
-  }
-}
+	void PtrsCastable::visit(VoidType *voidType) {
+		result = objectCast( dest, env, indexer );
+	}
 
-PtrsCastable::PtrsCastable( Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer )
-  : dest( dest ), result( 0 ), env( env ), indexer( indexer )
-{
-}
+	void PtrsCastable::visit(BasicType *basicType) {
+		result = objectCast( dest, env, indexer );
+	}
 
-void 
-PtrsCastable::visit(VoidType *voidType)
-{
-  result = objectCast( dest, env, indexer );
-}
+	void PtrsCastable::visit(PointerType *pointerType) {
+		result = objectCast( dest, env, indexer );
+	}
 
-void 
-PtrsCastable::visit(BasicType *basicType)
-{
-  result = objectCast( dest, env, indexer );
-}
+	void PtrsCastable::visit(ArrayType *arrayType) {
+		result = objectCast( dest, env, indexer );
+	}
 
-void 
-PtrsCastable::visit(PointerType *pointerType)
-{
-  result = objectCast( dest, env, indexer );
-}
+	void PtrsCastable::visit(FunctionType *functionType) {
+		result = -1;
+	}
 
-void 
-PtrsCastable::visit(ArrayType *arrayType)
-{
-  result = objectCast( dest, env, indexer );
-}
+	void PtrsCastable::visit(StructInstType *inst) {
+		result = objectCast( dest, env, indexer );
+	}
 
-void 
-PtrsCastable::visit(FunctionType *functionType)
-{
-  result = -1;
-}
+	void PtrsCastable::visit(UnionInstType *inst) {
+		result = objectCast( dest, env, indexer );
+	}
 
-void 
-PtrsCastable::visit(StructInstType *inst)
-{
-  result = objectCast( dest, env, indexer );
-}
+	void PtrsCastable::visit(EnumInstType *inst) {
+		if ( dynamic_cast< EnumInstType* >( inst ) ) {
+			result = 1;
+		} else if ( BasicType *bt = dynamic_cast< BasicType* >( inst ) ) {
+			if ( bt->get_kind() == BasicType::SignedInt ) {
+				result = 0;
+			} else {
+				result = 1;
+			}
+		} else {
+			result = objectCast( dest, env, indexer );
+		}
+	}
 
-void 
-PtrsCastable::visit(UnionInstType *inst)
-{
-  result = objectCast( dest, env, indexer );
-}
+	void PtrsCastable::visit(ContextInstType *inst) {
+		// I definitely don't think we should be doing anything here
+	}
 
-void 
-PtrsCastable::visit(EnumInstType *inst)
-{
-  if( dynamic_cast< EnumInstType* >( inst ) ) {
-    result = 1;
-  } else if( BasicType *bt = dynamic_cast< BasicType* >( inst ) ) {
-    if( bt->get_kind() == BasicType::SignedInt ) {
-      result = 0;
-    } else {
-      result = 1;
-    }
-  } else {
-    result = objectCast( dest, env, indexer );
-  }
-}
+	void PtrsCastable::visit(TypeInstType *inst) {
+		result = objectCast( inst, env, indexer ) && objectCast( dest, env, indexer ) ? 1 : -1;
+	}
 
-void 
-PtrsCastable::visit(ContextInstType *inst)
-{
-  // I definitely don't think we should be doing anything here
-}
+	void PtrsCastable::visit(TupleType *tupleType) {
+		result = objectCast( dest, env, indexer );
+	}
+} // namespace ResolvExpr
 
-void 
-PtrsCastable::visit(TypeInstType *inst)
-{
-  result = objectCast( inst, env, indexer ) && objectCast( dest, env, indexer ) ? 1 : -1;
-}
-
-void 
-PtrsCastable::visit(TupleType *tupleType)
-{
-  result = objectCast( dest, env, indexer );
-}
-
-} // namespace ResolvExpr
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/RenameVars.cc
===================================================================
--- translator/ResolvExpr/RenameVars.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/RenameVars.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,8 +1,16 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: RenameVars.cc,v 1.4 2005/08/29 20:14:16 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// RenameVars.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 12:05:18 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 12:07:59 2015
+// Update Count     : 2
+//
 
 #include <strstream>
@@ -15,148 +23,123 @@
 
 namespace ResolvExpr {
+	RenameVars global_renamer;
 
-RenameVars global_renamer;
+	RenameVars::RenameVars() : level( 0 ) {
+		mapStack.push_front( std::map< std::string, std::string >() );
+	}
 
-RenameVars::RenameVars()
-  : level( 0 )
-{
-  mapStack.push_front( std::map< std::string, std::string >() );
-}
+	void RenameVars::reset() {
+		level = 0;
+	}
 
-void 
-RenameVars::reset()
-{
-  level = 0;
-}
+	void RenameVars::visit( VoidType *voidType ) {
+		typeBefore( voidType );
+		typeAfter( voidType );
+	}
 
-void 
-RenameVars::visit( VoidType *voidType )
-{
-  typeBefore( voidType );
-  typeAfter( voidType );
-}
+	void RenameVars::visit( BasicType *basicType ) {
+		typeBefore( basicType );
+		typeAfter( basicType );
+	}
 
-void 
-RenameVars::visit( BasicType *basicType )
-{
-  typeBefore( basicType );
-  typeAfter( basicType );
-}
+	void RenameVars::visit( PointerType *pointerType ) {
+		typeBefore( pointerType );
+///   std::cout << "do pointer" << std::endl;
+		maybeAccept( pointerType->get_base(), *this );
+///   std::cout << "done pointer" << std::endl;
+		typeAfter( pointerType );
+	}
 
-void 
-RenameVars::visit( PointerType *pointerType )
-{
-  typeBefore( pointerType );
-///   std::cout << "do pointer" << std::endl;
-  maybeAccept( pointerType->get_base(), *this );
-///   std::cout << "done pointer" << std::endl;
-  typeAfter( pointerType );
-}
+	void RenameVars::visit( ArrayType *arrayType ) {
+		typeBefore( arrayType );
+		maybeAccept( arrayType->get_dimension(), *this );
+		maybeAccept( arrayType->get_base(), *this );
+		typeAfter( arrayType );
+	}
 
-void 
-RenameVars::visit( ArrayType *arrayType )
-{
-  typeBefore( arrayType );
-  maybeAccept( arrayType->get_dimension(), *this );
-  maybeAccept( arrayType->get_base(), *this );
-  typeAfter( arrayType );
-}
+	void RenameVars::visit( FunctionType *functionType ) {
+		typeBefore( functionType );
+///   std::cout << "return vals" << std::endl;
+		acceptAll( functionType->get_returnVals(), *this );
+///   std::cout << functionType->get_parameters().size() << " parameters" << std::endl;
+		acceptAll( functionType->get_parameters(), *this );
+///   std::cout << "done function" << std::endl;
+		typeAfter( functionType );
+	}
 
-void 
-RenameVars::visit( FunctionType *functionType )
-{
-  typeBefore( functionType );
-///   std::cout << "return vals" << std::endl;
-  acceptAll( functionType->get_returnVals(), *this );
-///   std::cout << functionType->get_parameters().size() << " parameters" << std::endl;
-  acceptAll( functionType->get_parameters(), *this );
-///   std::cout << "done function" << std::endl;
-  typeAfter( functionType );
-}
+	void RenameVars::visit( StructInstType *aggregateUseType ) {
+		typeBefore( aggregateUseType );
+		acceptAll( aggregateUseType->get_parameters(), *this );
+		typeAfter( aggregateUseType );
+	}
 
-void 
-RenameVars::visit( StructInstType *aggregateUseType )
-{
-  typeBefore( aggregateUseType );
-  acceptAll( aggregateUseType->get_parameters(), *this );
-  typeAfter( aggregateUseType );
-}
+	void RenameVars::visit( UnionInstType *aggregateUseType ) {
+		typeBefore( aggregateUseType );
+		acceptAll( aggregateUseType->get_parameters(), *this );
+		typeAfter( aggregateUseType );
+	}
 
-void 
-RenameVars::visit( UnionInstType *aggregateUseType )
-{
-  typeBefore( aggregateUseType );
-  acceptAll( aggregateUseType->get_parameters(), *this );
-  typeAfter( aggregateUseType );
-}
+	void RenameVars::visit( EnumInstType *aggregateUseType ) {
+		typeBefore( aggregateUseType );
+		acceptAll( aggregateUseType->get_parameters(), *this );
+		typeAfter( aggregateUseType );
+	}
 
-void 
-RenameVars::visit( EnumInstType *aggregateUseType )
-{
-  typeBefore( aggregateUseType );
-  acceptAll( aggregateUseType->get_parameters(), *this );
-  typeAfter( aggregateUseType );
-}
+	void RenameVars::visit( ContextInstType *aggregateUseType ) {
+		typeBefore( aggregateUseType );
+		acceptAll( aggregateUseType->get_parameters(), *this );
+		acceptAll( aggregateUseType->get_members(), *this );
+		typeAfter( aggregateUseType );
+	}
 
-void 
-RenameVars::visit( ContextInstType *aggregateUseType )
-{
-  typeBefore( aggregateUseType );
-  acceptAll( aggregateUseType->get_parameters(), *this );
-  acceptAll( aggregateUseType->get_members(), *this );
-  typeAfter( aggregateUseType );
-}
+	void RenameVars::visit( TypeInstType *instType ) {
+		typeBefore( instType );
+///   std::cout << "instance of type " << instType->get_name() << std::endl;
+		std::map< std::string, std::string >::const_iterator i = mapStack.front().find( instType->get_name() );
+		if ( i != mapStack.front().end() ) {
+///     std::cout << "found name " << i->second << std::endl;
+			instType->set_name( i->second );
+		} else {
+///     std::cout << "no name found" << std::endl;
+		} // if
+		acceptAll( instType->get_parameters(), *this );
+		typeAfter( instType );
+	}
 
-void 
-RenameVars::visit( TypeInstType *instType )
-{
-  typeBefore( instType );
-///   std::cout << "instance of type " << instType->get_name() << std::endl;
-  std::map< std::string, std::string >::const_iterator i = mapStack.front().find( instType->get_name() );
-  if( i != mapStack.front().end() ) {
-///     std::cout << "found name " << i->second << std::endl;
-    instType->set_name( i->second );
-  } else {
-///     std::cout << "no name found" << std::endl;
-  }
-  acceptAll( instType->get_parameters(), *this );
-  typeAfter( instType );
-}
+	void RenameVars::visit( TupleType *tupleType ) {
+		typeBefore( tupleType );
+		acceptAll( tupleType->get_types(), *this );
+		typeAfter( tupleType );
+	}
 
-void 
-RenameVars::visit( TupleType *tupleType )
-{
-  typeBefore( tupleType );
-  acceptAll( tupleType->get_types(), *this );
-  typeAfter( tupleType );
-}
-
-void 
-RenameVars::typeBefore( Type *type )
-{
-  if( !type->get_forall().empty() ) {
+	void RenameVars::typeBefore( Type *type ) {
+		if ( ! type->get_forall().empty() ) {
 ///     std::cout << "type with forall: ";
 ///     type->print( std::cout );
 ///     std::cout << std::endl;
-    mapStack.push_front( mapStack.front() );
-    for( std::list< TypeDecl* >::iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
-      std::ostrstream output;
-      output << "_" << level << "_" << (*i)->get_name();
-      std::string newname( output.str(), output.pcount() );
-      mapStack.front()[ (*i)->get_name() ] = newname;
-      (*i)->set_name( newname );
-      level++;
-      acceptAll( (*i)->get_assertions(), *this );
-    }
-  }
-}
+			mapStack.push_front( mapStack.front() );
+			for ( std::list< TypeDecl* >::iterator i = type->get_forall().begin(); i != type->get_forall().end(); ++i ) {
+				std::ostrstream output;
+				output << "_" << level << "_" << (*i)->get_name();
+				std::string newname( output.str(), output.pcount() );
+				mapStack.front()[ (*i)->get_name() ] = newname;
+				(*i)->set_name( newname );
+				level++;
+				acceptAll( (*i)->get_assertions(), *this );
+			} // for
+		} // if
+	}
 
-void 
-RenameVars::typeAfter( Type *type )
-{
-  if( !type->get_forall().empty() ) {
-    mapStack.pop_front();
-  }
-}
+	void RenameVars::typeAfter( Type *type ) {
+		if ( ! type->get_forall().empty() ) {
+			mapStack.pop_front();
+		} // if
+	}
 
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/RenameVars.h
===================================================================
--- translator/ResolvExpr/RenameVars.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/RenameVars.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,8 +1,16 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: RenameVars.h,v 1.2 2005/08/29 20:14:16 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// RenameVars.h -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 12:10:28 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 12:11:53 2015
+// Update Count     : 2
+//
 
 #ifndef RESOLVEXPR_RENAMEVARS_H
@@ -17,33 +25,35 @@
 
 namespace ResolvExpr {
+	class RenameVars : public Visitor {
+	  public:
+		RenameVars();
+		void reset();
+	  private:
+		virtual void visit( VoidType *basicType );
+		virtual void visit( BasicType *basicType );
+		virtual void visit( PointerType *pointerType );
+		virtual void visit( ArrayType *arrayType );
+		virtual void visit( FunctionType *functionType );
+		virtual void visit( StructInstType *aggregateUseType );
+		virtual void visit( UnionInstType *aggregateUseType );
+		virtual void visit( EnumInstType *aggregateUseType );
+		virtual void visit( ContextInstType *aggregateUseType );
+		virtual void visit( TypeInstType *aggregateUseType );
+		virtual void visit( TupleType *tupleType );
 
-class RenameVars : public Visitor
-{
-public:
-  RenameVars();
-  void reset();
-  
-private:
-  virtual void visit( VoidType *basicType );
-  virtual void visit( BasicType *basicType );
-  virtual void visit( PointerType *pointerType );
-  virtual void visit( ArrayType *arrayType );
-  virtual void visit( FunctionType *functionType );
-  virtual void visit( StructInstType *aggregateUseType );
-  virtual void visit( UnionInstType *aggregateUseType );
-  virtual void visit( EnumInstType *aggregateUseType );
-  virtual void visit( ContextInstType *aggregateUseType );
-  virtual void visit( TypeInstType *aggregateUseType );
-  virtual void visit( TupleType *tupleType );
-  
-  void typeBefore( Type *type );
-  void typeAfter( Type *type );
-  int level;
-  std::list< std::map< std::string, std::string > > mapStack;
-};
+		void typeBefore( Type *type );
+		void typeAfter( Type *type );
+		int level;
+		std::list< std::map< std::string, std::string > > mapStack;
+	};
 
-extern RenameVars global_renamer;
-
+	extern RenameVars global_renamer;
 } // namespace ResolvExpr
 
-#endif /* #ifndef RESOLVEXPR_RENAMEVARS_H */
+#endif // RENAMEVARS_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/ResolveTypeof.cc
===================================================================
--- translator/ResolvExpr/ResolveTypeof.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/ResolveTypeof.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// ResolveTypeof.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 12:12:20 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 12:13:38 2015
+// Update Count     : 2
+//
+
 #include "ResolveTypeof.h"
 #include "Alternative.h"
@@ -10,12 +25,12 @@
     namespace {
 #if 0
-	void
-	printAlts( const AltList &list, std::ostream &os, int indent = 0 )
-	{
-	    for( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) {
-		i->print( os, indent );
-		os << std::endl;
-	    }
-	}
+		void
+		printAlts( const AltList &list, std::ostream &os, int indent = 0 )
+		{
+			for ( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) {
+				i->print( os, indent );
+				os << std::endl;
+			}
+		}
 #endif
     }
@@ -23,38 +38,43 @@
     class ResolveTypeof : public Mutator {
       public:
-	ResolveTypeof( const SymTab::Indexer &indexer ) : indexer( indexer ) {}
-	Type *mutate( TypeofType *typeofType );
+		ResolveTypeof( const SymTab::Indexer &indexer ) : indexer( indexer ) {}
+		Type *mutate( TypeofType *typeofType );
 
       private:
-	const SymTab::Indexer &indexer;
+		const SymTab::Indexer &indexer;
     };
 
     Type *resolveTypeof( Type *type, const SymTab::Indexer &indexer ) {
-	ResolveTypeof mutator( indexer );
-	return type->acceptMutator( mutator );
+		ResolveTypeof mutator( indexer );
+		return type->acceptMutator( mutator );
     }
 
     Type *ResolveTypeof::mutate( TypeofType *typeofType ) {
 #if 0
-	std::cout << "resolving typeof: ";
-	typeofType->print( std::cout );
-	std::cout << std::endl;
+		std::cout << "resolving typeof: ";
+		typeofType->print( std::cout );
+		std::cout << std::endl;
 #endif
-	if ( typeofType->get_expr() ) {
-	    Expression *newExpr = resolveInVoidContext( typeofType->get_expr(), indexer );
-	    assert( newExpr->get_results().size() > 0 );
-	    Type *newType;
-	    if ( newExpr->get_results().size() > 1 ) {
-		TupleType *tupleType = new TupleType( Type::Qualifiers() );
-		cloneAll( newExpr->get_results(), tupleType->get_types() );
-		newType = tupleType;
-	    } else {
-		newType = newExpr->get_results().front()->clone();
-	    }
-	    delete typeofType;
-	    return newType;
-	}
-	return typeofType;
+		if ( typeofType->get_expr() ) {
+			Expression *newExpr = resolveInVoidContext( typeofType->get_expr(), indexer );
+			assert( newExpr->get_results().size() > 0 );
+			Type *newType;
+			if ( newExpr->get_results().size() > 1 ) {
+				TupleType *tupleType = new TupleType( Type::Qualifiers() );
+				cloneAll( newExpr->get_results(), tupleType->get_types() );
+				newType = tupleType;
+			} else {
+				newType = newExpr->get_results().front()->clone();
+			} // if
+			delete typeofType;
+			return newType;
+		} // if
+		return typeofType;
     }
+} // namespace ResolvExpr
 
-} // namespace ResolvExpr
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/ResolveTypeof.h
===================================================================
--- translator/ResolvExpr/ResolveTypeof.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/ResolveTypeof.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// ResolveTypeof.h -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 12:14:53 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 12:16:29 2015
+// Update Count     : 2
+//
+
 #ifndef RESOLVETYPEOF_H
 #define RESOLVETYPEOF_H
@@ -6,6 +21,12 @@
 
 namespace ResolvExpr {
-    Type *resolveTypeof( Type*, const SymTab::Indexer &indexer );
+	Type *resolveTypeof( Type*, const SymTab::Indexer &indexer );
 } // namespace ResolvExpr
 
 #endif // RESOLVETYPEOF_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/Resolver.cc
===================================================================
--- translator/ResolvExpr/Resolver.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/Resolver.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Resolver.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 12:17:01 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 12:18:17 2015
+// Update Count     : 2
+//
+
 #include "Resolver.h"
 #include "AlternativeFinder.h"
@@ -15,316 +30,322 @@
 
 namespace ResolvExpr {
-    class Resolver : public SymTab::Indexer {
-      public:
-	Resolver() : SymTab::Indexer( false ), switchType( 0 ) {}
-  
-	virtual void visit( FunctionDecl *functionDecl );
-	virtual void visit( ObjectDecl *functionDecl );
-	virtual void visit( TypeDecl *typeDecl );
-
-	virtual void visit( ExprStmt *exprStmt );
-	virtual void visit( IfStmt *ifStmt );
-	virtual void visit( WhileStmt *whileStmt );
-	virtual void visit( ForStmt *forStmt );
-	virtual void visit( SwitchStmt *switchStmt );
-	virtual void visit( ChooseStmt *switchStmt );
-	virtual void visit( CaseStmt *caseStmt );
-	virtual void visit( ReturnStmt *returnStmt );
-
-	virtual void visit( SingleInit *singleInit );
-	virtual void visit( ListInit *listInit );
-      private:
-	std::list< Type * > functionReturn;
-	Type *initContext;
-	Type *switchType;
-    };
-
-    void resolve( std::list< Declaration * > translationUnit ) {
-	Resolver resolver;
-	acceptAll( translationUnit, resolver );
-#if 0
-	resolver.print( cerr );
-	for ( std::list< Declaration * >::iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) {
-	    (*i)->print( std::cerr );
-	    (*i)->accept( resolver );
-	} // for
-#endif
-    }
-
-    Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ) {
-	TypeEnvironment env;
-	return resolveInVoidContext( expr, indexer, env );
-    }
-
-    namespace {
-	void finishExpr( Expression *expr, const TypeEnvironment &env ) {
-	    expr->set_env( new TypeSubstitution );
-	    env.makeSubstitution( *expr->get_env() );
-	}
-
-	Expression *findVoidExpression( Expression *untyped, const SymTab::Indexer &indexer ) {
-	    global_renamer.reset();
-	    TypeEnvironment env;
-	    Expression *newExpr = resolveInVoidContext( untyped, indexer, env );
-	    finishExpr( newExpr, env );
-	    return newExpr;
-	}
-  
-	Expression *findSingleExpression( Expression *untyped, const SymTab::Indexer &indexer ) {
-	    TypeEnvironment env;
-	    AlternativeFinder finder( indexer, env );
-	    finder.find( untyped );
-#if 0
-	    if ( finder.get_alternatives().size() != 1 ) {
-		std::cout << "untyped expr is ";
-		untyped->print( std::cout );
-		std::cout << std::endl << "alternatives are:";
-		for ( std::list< Alternative >::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) {
-		    i->print( std::cout );
+	class Resolver : public SymTab::Indexer {
+	  public:
+		Resolver() : SymTab::Indexer( false ), switchType( 0 ) {}
+  
+		virtual void visit( FunctionDecl *functionDecl );
+		virtual void visit( ObjectDecl *functionDecl );
+		virtual void visit( TypeDecl *typeDecl );
+
+		virtual void visit( ExprStmt *exprStmt );
+		virtual void visit( IfStmt *ifStmt );
+		virtual void visit( WhileStmt *whileStmt );
+		virtual void visit( ForStmt *forStmt );
+		virtual void visit( SwitchStmt *switchStmt );
+		virtual void visit( ChooseStmt *switchStmt );
+		virtual void visit( CaseStmt *caseStmt );
+		virtual void visit( ReturnStmt *returnStmt );
+
+		virtual void visit( SingleInit *singleInit );
+		virtual void visit( ListInit *listInit );
+	  private:
+		std::list< Type * > functionReturn;
+		Type *initContext;
+		Type *switchType;
+	};
+
+	void resolve( std::list< Declaration * > translationUnit ) {
+		Resolver resolver;
+		acceptAll( translationUnit, resolver );
+#if 0
+		resolver.print( cerr );
+		for ( std::list< Declaration * >::iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) {
+			(*i)->print( std::cerr );
+			(*i)->accept( resolver );
 		} // for
-	    } // if
-#endif
-	    assert( finder.get_alternatives().size() == 1 );
-	    Alternative &choice = finder.get_alternatives().front();
-	    Expression *newExpr = choice.expr->clone();
-	    finishExpr( newExpr, choice.env );
-	    return newExpr;
-	}
-
-	bool isIntegralType( Type *type ) {
-	    if ( dynamic_cast< EnumInstType * >( type ) ) {
-		return true;
-	    } else if ( BasicType *bt = dynamic_cast< BasicType * >( type ) ) {
-		return bt->isInteger();
-	    } else {
-		return false;
-	    } // if
-	}
-  
-	Expression *findIntegralExpression( Expression *untyped, const SymTab::Indexer &indexer ) {
-	    TypeEnvironment env;
-	    AlternativeFinder finder( indexer, env );
-	    finder.find( untyped );
-#if 0
-	    if ( finder.get_alternatives().size() != 1 ) {
-		std::cout << "untyped expr is ";
-		untyped->print( std::cout );
-		std::cout << std::endl << "alternatives are:";
-		for ( std::list< Alternative >::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) {
-		    i->print( std::cout );
+#endif
+	}
+
+	Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ) {
+		TypeEnvironment env;
+		return resolveInVoidContext( expr, indexer, env );
+	}
+
+	namespace {
+		void finishExpr( Expression *expr, const TypeEnvironment &env ) {
+			expr->set_env( new TypeSubstitution );
+			env.makeSubstitution( *expr->get_env() );
+		}
+
+		Expression *findVoidExpression( Expression *untyped, const SymTab::Indexer &indexer ) {
+			global_renamer.reset();
+			TypeEnvironment env;
+			Expression *newExpr = resolveInVoidContext( untyped, indexer, env );
+			finishExpr( newExpr, env );
+			return newExpr;
+		}
+  
+		Expression *findSingleExpression( Expression *untyped, const SymTab::Indexer &indexer ) {
+			TypeEnvironment env;
+			AlternativeFinder finder( indexer, env );
+			finder.find( untyped );
+#if 0
+			if ( finder.get_alternatives().size() != 1 ) {
+				std::cout << "untyped expr is ";
+				untyped->print( std::cout );
+				std::cout << std::endl << "alternatives are:";
+				for ( std::list< Alternative >::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) {
+					i->print( std::cout );
+				} // for
+			} // if
+#endif
+			assert( finder.get_alternatives().size() == 1 );
+			Alternative &choice = finder.get_alternatives().front();
+			Expression *newExpr = choice.expr->clone();
+			finishExpr( newExpr, choice.env );
+			return newExpr;
+		}
+
+		bool isIntegralType( Type *type ) {
+			if ( dynamic_cast< EnumInstType * >( type ) ) {
+				return true;
+			} else if ( BasicType *bt = dynamic_cast< BasicType * >( type ) ) {
+				return bt->isInteger();
+			} else {
+				return false;
+			} // if
+		}
+  
+		Expression *findIntegralExpression( Expression *untyped, const SymTab::Indexer &indexer ) {
+			TypeEnvironment env;
+			AlternativeFinder finder( indexer, env );
+			finder.find( untyped );
+#if 0
+			if ( finder.get_alternatives().size() != 1 ) {
+				std::cout << "untyped expr is ";
+				untyped->print( std::cout );
+				std::cout << std::endl << "alternatives are:";
+				for ( std::list< Alternative >::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) {
+					i->print( std::cout );
+				} // for
+			} // if
+#endif
+			Expression *newExpr = 0;
+			const TypeEnvironment *newEnv = 0;
+			for ( AltList::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) {
+				if ( i->expr->get_results().size() == 1 && isIntegralType( i->expr->get_results().front() ) ) {
+					if ( newExpr ) {
+						throw SemanticError( "Too many interpretations for case control expression", untyped );
+					} else {
+						newExpr = i->expr->clone();
+						newEnv = &i->env;
+					} // if
+				} // if
+			} // for
+			if ( ! newExpr ) {
+				throw SemanticError( "No interpretations for case control expression", untyped );
+			} // if
+			finishExpr( newExpr, *newEnv );
+			return newExpr;
+		}
+  
+	}
+  
+	void Resolver::visit( ObjectDecl *objectDecl ) {
+		Type *new_type = resolveTypeof( objectDecl->get_type(), *this );
+		objectDecl->set_type( new_type );
+		initContext = new_type;
+		SymTab::Indexer::visit( objectDecl );
+	}
+  
+	void Resolver::visit( TypeDecl *typeDecl ) {
+		if ( typeDecl->get_base() ) {
+			Type *new_type = resolveTypeof( typeDecl->get_base(), *this );
+			typeDecl->set_base( new_type );
+		} // if
+		SymTab::Indexer::visit( typeDecl );
+	}
+  
+	void Resolver::visit( FunctionDecl *functionDecl ) {
+#if 0
+		std::cout << "resolver visiting functiondecl ";
+		functionDecl->print( std::cout );
+		std::cout << std::endl;
+#endif
+		Type *new_type = resolveTypeof( functionDecl->get_type(), *this );
+		functionDecl->set_type( new_type );
+		std::list< Type * > oldFunctionReturn = functionReturn;
+		functionReturn.clear();
+		for ( std::list< DeclarationWithType * >::const_iterator i = functionDecl->get_functionType()->get_returnVals().begin(); i != functionDecl->get_functionType()->get_returnVals().end(); ++i ) {
+			functionReturn.push_back( (*i)->get_type() );
 		} // for
-	    } // if
-#endif
-	    Expression *newExpr = 0;
-	    const TypeEnvironment *newEnv = 0;
-	    for ( AltList::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) {
-		if ( i->expr->get_results().size() == 1 && isIntegralType( i->expr->get_results().front() ) ) {
-		    if ( newExpr ) {
-			throw SemanticError( "Too many interpretations for case control expression", untyped );
-		    } else {
-			newExpr = i->expr->clone();
-			newEnv = &i->env;
-		    } // if
-		} // if
-	    } // for
-	    if ( ! newExpr ) {
-		throw SemanticError( "No interpretations for case control expression", untyped );
-	    } // if
-	    finishExpr( newExpr, *newEnv );
-	    return newExpr;
-	}
-  
-    }
-  
-    void Resolver::visit( ObjectDecl *objectDecl ) {
-	Type *new_type = resolveTypeof( objectDecl->get_type(), *this );
-	objectDecl->set_type( new_type );
-	initContext = new_type;
-	SymTab::Indexer::visit( objectDecl );
-    }
-  
-    void Resolver::visit( TypeDecl *typeDecl ) {
-	if ( typeDecl->get_base() ) {
-	    Type *new_type = resolveTypeof( typeDecl->get_base(), *this );
-	    typeDecl->set_base( new_type );
-	} // if
-	SymTab::Indexer::visit( typeDecl );
-    }
-  
-    void Resolver::visit( FunctionDecl *functionDecl ) {
-#if 0
-	std::cout << "resolver visiting functiondecl ";
-	functionDecl->print( std::cout );
-	std::cout << std::endl;
-#endif
-	Type *new_type = resolveTypeof( functionDecl->get_type(), *this );
-	functionDecl->set_type( new_type );
-	std::list< Type * > oldFunctionReturn = functionReturn;
-	functionReturn.clear();
-	for ( std::list< DeclarationWithType * >::const_iterator i = functionDecl->get_functionType()->get_returnVals().begin(); i != functionDecl->get_functionType()->get_returnVals().end(); ++i ) {
-	    functionReturn.push_back( (*i)->get_type() );
-	} // for
-	SymTab::Indexer::visit( functionDecl );
-	functionReturn = oldFunctionReturn;
-    }
-
-    void Resolver::visit( ExprStmt *exprStmt ) {
-	if ( exprStmt->get_expr() ) {
-	    Expression *newExpr = findVoidExpression( exprStmt->get_expr(), *this );
-	    delete exprStmt->get_expr();
-	    exprStmt->set_expr( newExpr );
-	} // if
-    }
-
-    void Resolver::visit( IfStmt *ifStmt ) {
-	Expression *newExpr = findSingleExpression( ifStmt->get_condition(), *this );
-	delete ifStmt->get_condition();
-	ifStmt->set_condition( newExpr );
-	Visitor::visit( ifStmt );
-    }
-
-    void Resolver::visit( WhileStmt *whileStmt ) {
-	Expression *newExpr = findSingleExpression( whileStmt->get_condition(), *this );
-	delete whileStmt->get_condition();
-	whileStmt->set_condition( newExpr );
-	Visitor::visit( whileStmt );
-    }
-
-    void Resolver::visit( ForStmt *forStmt ) {
-        // SymTab::Indexer::visit( forStmt );
-	Expression *newExpr;
-        // for statements introduce a level of scope
-        enterScope();
-        maybeAccept( forStmt->get_initialization(), *this );
-	if ( forStmt->get_condition() ) {
-	    newExpr = findSingleExpression( forStmt->get_condition(), *this );
-	    delete forStmt->get_condition();
-	    forStmt->set_condition( newExpr );
-	} // if
-  
-	if ( forStmt->get_increment() ) {
-	    newExpr = findVoidExpression( forStmt->get_increment(), *this );
-	    delete forStmt->get_increment();
-	    forStmt->set_increment( newExpr );
-	} // if
-
-        maybeAccept( forStmt->get_condition(), *this );
-        maybeAccept( forStmt->get_increment(), *this );
-        maybeAccept( forStmt->get_body(), *this );
-        leaveScope();
-    }
-
-    template< typename SwitchClass >
-    void handleSwitchStmt( SwitchClass *switchStmt, SymTab::Indexer &visitor ) {
-	Expression *newExpr;
-	newExpr = findIntegralExpression( switchStmt->get_condition(), visitor );
-	delete switchStmt->get_condition();
-	switchStmt->set_condition( newExpr );
-  
-	visitor.Visitor::visit( switchStmt );
-    }
-
-    void Resolver::visit( SwitchStmt *switchStmt ) {
-	handleSwitchStmt( switchStmt, *this );
-    }
-
-    void Resolver::visit( ChooseStmt *switchStmt ) {
-	handleSwitchStmt( switchStmt, *this );
-    }
-
-    void Resolver::visit( CaseStmt *caseStmt ) {
-	Visitor::visit( caseStmt );
-    }
-
-    void Resolver::visit( ReturnStmt *returnStmt ) {
-	if ( returnStmt->get_expr() ) {
-	    CastExpr *castExpr = new CastExpr( returnStmt->get_expr() );
-	    cloneAll( functionReturn, castExpr->get_results() );
-	    Expression *newExpr = findSingleExpression( castExpr, *this );
-	    delete castExpr;
-	    returnStmt->set_expr( newExpr );
-	} // if
-    }
-
-    void Resolver::visit( SingleInit *singleInit ) {
-	if ( singleInit->get_value() ) {
-#if 0
-	    if (NameExpr * ne = dynamic_cast<NameExpr*>(singleInit->get_value())) {
-		string n = ne->get_name();
-		if (n == "0") {
-		    initContext = new BasicType(Type::Qualifiers(), 
-						BasicType::SignedInt);
-		} else {
-		    DeclarationWithType * decl = lookupId(n);
-		    initContext = decl->get_type();
-		}
-	    } else if (ConstantExpr * e = 
-		       dynamic_cast<ConstantExpr*>(singleInit->get_value())) {
-		Constant *c = e->get_constant();
-		initContext = c->get_type();
-	    } else {
-		assert(0);
-	    }
-#endif
-	    CastExpr *castExpr = new CastExpr( singleInit->get_value(), initContext->clone() );
-	    Expression *newExpr = findSingleExpression( castExpr, *this );
-	    delete castExpr;
-	    singleInit->set_value( newExpr );
-	} // if
+		SymTab::Indexer::visit( functionDecl );
+		functionReturn = oldFunctionReturn;
+	}
+
+	void Resolver::visit( ExprStmt *exprStmt ) {
+		if ( exprStmt->get_expr() ) {
+			Expression *newExpr = findVoidExpression( exprStmt->get_expr(), *this );
+			delete exprStmt->get_expr();
+			exprStmt->set_expr( newExpr );
+		} // if
+	}
+
+	void Resolver::visit( IfStmt *ifStmt ) {
+		Expression *newExpr = findSingleExpression( ifStmt->get_condition(), *this );
+		delete ifStmt->get_condition();
+		ifStmt->set_condition( newExpr );
+		Visitor::visit( ifStmt );
+	}
+
+	void Resolver::visit( WhileStmt *whileStmt ) {
+		Expression *newExpr = findSingleExpression( whileStmt->get_condition(), *this );
+		delete whileStmt->get_condition();
+		whileStmt->set_condition( newExpr );
+		Visitor::visit( whileStmt );
+	}
+
+	void Resolver::visit( ForStmt *forStmt ) {
+	    // SymTab::Indexer::visit( forStmt );
+		Expression *newExpr;
+	    // for statements introduce a level of scope
+	    enterScope();
+	    maybeAccept( forStmt->get_initialization(), *this );
+		if ( forStmt->get_condition() ) {
+			newExpr = findSingleExpression( forStmt->get_condition(), *this );
+			delete forStmt->get_condition();
+			forStmt->set_condition( newExpr );
+		} // if
+  
+		if ( forStmt->get_increment() ) {
+			newExpr = findVoidExpression( forStmt->get_increment(), *this );
+			delete forStmt->get_increment();
+			forStmt->set_increment( newExpr );
+		} // if
+
+	    maybeAccept( forStmt->get_condition(), *this );
+	    maybeAccept( forStmt->get_increment(), *this );
+	    maybeAccept( forStmt->get_body(), *this );
+	    leaveScope();
+	}
+
+	template< typename SwitchClass >
+	void handleSwitchStmt( SwitchClass *switchStmt, SymTab::Indexer &visitor ) {
+		Expression *newExpr;
+		newExpr = findIntegralExpression( switchStmt->get_condition(), visitor );
+		delete switchStmt->get_condition();
+		switchStmt->set_condition( newExpr );
+  
+		visitor.Visitor::visit( switchStmt );
+	}
+
+	void Resolver::visit( SwitchStmt *switchStmt ) {
+		handleSwitchStmt( switchStmt, *this );
+	}
+
+	void Resolver::visit( ChooseStmt *switchStmt ) {
+		handleSwitchStmt( switchStmt, *this );
+	}
+
+	void Resolver::visit( CaseStmt *caseStmt ) {
+		Visitor::visit( caseStmt );
+	}
+
+	void Resolver::visit( ReturnStmt *returnStmt ) {
+		if ( returnStmt->get_expr() ) {
+			CastExpr *castExpr = new CastExpr( returnStmt->get_expr() );
+			cloneAll( functionReturn, castExpr->get_results() );
+			Expression *newExpr = findSingleExpression( castExpr, *this );
+			delete castExpr;
+			returnStmt->set_expr( newExpr );
+		} // if
+	}
+
+	void Resolver::visit( SingleInit *singleInit ) {
+		if ( singleInit->get_value() ) {
+#if 0
+			if (NameExpr * ne = dynamic_cast<NameExpr*>(singleInit->get_value())) {
+				string n = ne->get_name();
+				if (n == "0") {
+					initContext = new BasicType(Type::Qualifiers(), 
+												BasicType::SignedInt);
+				} else {
+					DeclarationWithType * decl = lookupId(n);
+					initContext = decl->get_type();
+				}
+			} else if (ConstantExpr * e = 
+					   dynamic_cast<ConstantExpr*>(singleInit->get_value())) {
+				Constant *c = e->get_constant();
+				initContext = c->get_type();
+			} else {
+				assert(0);
+			}
+#endif
+			CastExpr *castExpr = new CastExpr( singleInit->get_value(), initContext->clone() );
+			Expression *newExpr = findSingleExpression( castExpr, *this );
+			delete castExpr;
+			singleInit->set_value( newExpr );
+		} // if
 //	singleInit->get_value()->accept( *this );
-    }
-
-    void Resolver::visit( ListInit *listInit ) {
-	Visitor::visit(listInit);
-#if 0
-	if ( ArrayType *at = dynamic_cast<ArrayType*>(initContext) ) {
-	    std::list<Initializer *>::iterator iter( listInit->begin_initializers() );
-	    for ( ; iter != listInit->end_initializers(); ++iter ) {
-		initContext = at->get_base();
-		(*iter)->accept( *this );
-	    } // for
-	} else if ( StructInstType *st = dynamic_cast<StructInstType*>(initContext) ) {
-	    StructDecl *baseStruct = st->get_baseStruct();
-	    std::list<Declaration *>::iterator iter1( baseStruct->get_members().begin() );
-	    std::list<Initializer *>::iterator iter2( listInit->begin_initializers() );
-	    for ( ; iter1 != baseStruct->get_members().end() && iter2 != listInit->end_initializers(); ++iter2 ) {
-		if ( (*iter2)->get_designators().empty() ) {
-		    DeclarationWithType *dt = dynamic_cast<DeclarationWithType *>( *iter1 );
-		    initContext = dt->get_type();
-		    (*iter2)->accept( *this );
-		    ++iter1;
-		} else {
-		    StructDecl *st = baseStruct;
-		    iter1 = st->get_members().begin();
-		    std::list<Expression *>::iterator iter3( (*iter2)->get_designators().begin() );
-		    for ( ; iter3 != (*iter2)->get_designators().end(); ++iter3 ) {
-			NameExpr *key = dynamic_cast<NameExpr *>( *iter3 );
-			assert( key );
-			for ( ; iter1 != st->get_members().end(); ++iter1 ) {
-			    if ( key->get_name() == (*iter1)->get_name() ) {
-				(*iter1)->print( cout );
-				cout << key->get_name() << endl;
-				ObjectDecl *fred = dynamic_cast<ObjectDecl *>( *iter1 );
-				assert( fred );
-				StructInstType *mary = dynamic_cast<StructInstType*>( fred->get_type() );
-				assert( mary );
-				st = mary->get_baseStruct();
-				iter1 = st->get_members().begin();
-				break;
-			    } // if
-			}  // for
-		    } // for
-		    ObjectDecl *fred = dynamic_cast<ObjectDecl *>( *iter1 );
-		    assert( fred );
-		    initContext = fred->get_type();
-		    (*listInit->begin_initializers())->accept( *this );
-		} // if
-	    } // for
-	} else if ( UnionInstType *st = dynamic_cast<UnionInstType*>(initContext) ) {
-	    DeclarationWithType *dt = dynamic_cast<DeclarationWithType *>( *st->get_baseUnion()->get_members().begin() );
-	    initContext = dt->get_type();
-	    (*listInit->begin_initializers())->accept( *this );
-	} // if
-#endif
-    }
+	}
+
+	void Resolver::visit( ListInit *listInit ) {
+		Visitor::visit(listInit);
+#if 0
+		if ( ArrayType *at = dynamic_cast<ArrayType*>(initContext) ) {
+			std::list<Initializer *>::iterator iter( listInit->begin_initializers() );
+			for ( ; iter != listInit->end_initializers(); ++iter ) {
+				initContext = at->get_base();
+				(*iter)->accept( *this );
+			} // for
+		} else if ( StructInstType *st = dynamic_cast<StructInstType*>(initContext) ) {
+			StructDecl *baseStruct = st->get_baseStruct();
+			std::list<Declaration *>::iterator iter1( baseStruct->get_members().begin() );
+			std::list<Initializer *>::iterator iter2( listInit->begin_initializers() );
+			for ( ; iter1 != baseStruct->get_members().end() && iter2 != listInit->end_initializers(); ++iter2 ) {
+				if ( (*iter2)->get_designators().empty() ) {
+					DeclarationWithType *dt = dynamic_cast<DeclarationWithType *>( *iter1 );
+					initContext = dt->get_type();
+					(*iter2)->accept( *this );
+					++iter1;
+				} else {
+					StructDecl *st = baseStruct;
+					iter1 = st->get_members().begin();
+					std::list<Expression *>::iterator iter3( (*iter2)->get_designators().begin() );
+					for ( ; iter3 != (*iter2)->get_designators().end(); ++iter3 ) {
+						NameExpr *key = dynamic_cast<NameExpr *>( *iter3 );
+						assert( key );
+						for ( ; iter1 != st->get_members().end(); ++iter1 ) {
+							if ( key->get_name() == (*iter1)->get_name() ) {
+								(*iter1)->print( cout );
+								cout << key->get_name() << endl;
+								ObjectDecl *fred = dynamic_cast<ObjectDecl *>( *iter1 );
+								assert( fred );
+								StructInstType *mary = dynamic_cast<StructInstType*>( fred->get_type() );
+								assert( mary );
+								st = mary->get_baseStruct();
+								iter1 = st->get_members().begin();
+								break;
+							} // if
+						}  // for
+					} // for
+					ObjectDecl *fred = dynamic_cast<ObjectDecl *>( *iter1 );
+					assert( fred );
+					initContext = fred->get_type();
+					(*listInit->begin_initializers())->accept( *this );
+				} // if
+			} // for
+		} else if ( UnionInstType *st = dynamic_cast<UnionInstType*>(initContext) ) {
+			DeclarationWithType *dt = dynamic_cast<DeclarationWithType *>( *st->get_baseUnion()->get_members().begin() );
+			initContext = dt->get_type();
+			(*listInit->begin_initializers())->accept( *this );
+		} // if
+#endif
+	}
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/Resolver.h
===================================================================
--- translator/ResolvExpr/Resolver.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/Resolver.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,17 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Resolver.h -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 12:18:34 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 12:19:32 2015
+// Update Count     : 2
+//
+
 #ifndef RESOLVER_H
 #define RESOLVER_H
@@ -6,7 +21,13 @@
 
 namespace ResolvExpr {
-    void resolve( std::list< Declaration * > translationUnit );
-    Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer );
+	void resolve( std::list< Declaration * > translationUnit );
+	Expression *resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer );
 } // namespace ResolvExpr
 
 #endif // RESOLVER_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/TypeEnvironment.cc
===================================================================
--- translator/ResolvExpr/TypeEnvironment.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/TypeEnvironment.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,8 +1,16 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: TypeEnvironment.cc,v 1.7 2005/08/29 20:14:16 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// TypeEnvironment.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 12:19:47 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 12:23:36 2015
+// Update Count     : 3
+//
 
 #include <algorithm>
@@ -15,209 +23,185 @@
 
 namespace ResolvExpr {
-
-void printAssertionSet( const AssertionSet &assertions, std::ostream &os, int indent )
-{
-  for( AssertionSet::const_iterator i = assertions.begin(); i != assertions.end(); ++i ) {
-    i->first->print( os, indent );
-    if( i->second ) {
-      os << "(used)";
-    } else {
-      os << "(not used)";
-    }
-  }
-}
-
-void printOpenVarSet( const OpenVarSet &openVars, std::ostream &os, int indent )
-{
-  os << std::string( indent, ' ' );
-  for( OpenVarSet::const_iterator i = openVars.begin(); i != openVars.end(); ++i ) {
-    os << i->first << "(" << i->second << ") ";
-  }
-}
-
-void
-EqvClass::initialize( const EqvClass &src, EqvClass &dest )
-{
-  dest.vars = src.vars;
-  dest.type = maybeClone( src.type );
-  dest.allowWidening = src.allowWidening;
-  dest.kind = src.kind;
-}
-
-EqvClass::EqvClass() : type( 0 ), allowWidening( true )
-{
-}
-
-EqvClass::EqvClass( const EqvClass &other )
-{
-  initialize( other, *this );
-}
-
-EqvClass &
-EqvClass::operator=( const EqvClass &other )
-{
-  if( this == &other ) return *this;
-  delete type;
-  initialize( other, *this );
-  return *this;
-}
-
-EqvClass::~EqvClass()
-{
-  delete type;
-}
-
-void 
-EqvClass::print( std::ostream &os, int indent ) const
-{
-  os << std::string( indent, ' ' ) << "( ";
-  std::copy( vars.begin(), vars.end(), std::ostream_iterator< std::string >( os, " " ) );
-  os << ")";
-  if( type ) {
-    os << " -> ";
-    type->print( os, indent );
-  }
-  if( !allowWidening ) {
-    os << " (no widening)";
-  }
-  os << std::endl;
-}
-
-bool 
-TypeEnvironment::lookup( const std::string &var, EqvClass &eqvClass ) const
-{
-  for( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i ) {
-    if( i->vars.find( var ) != i->vars.end() ) {
+	void printAssertionSet( const AssertionSet &assertions, std::ostream &os, int indent ) {
+		for ( AssertionSet::const_iterator i = assertions.begin(); i != assertions.end(); ++i ) {
+			i->first->print( os, indent );
+			if ( i->second ) {
+				os << "(used)";
+			} else {
+				os << "(not used)";
+			} // if
+		} // for
+	}
+
+	void printOpenVarSet( const OpenVarSet &openVars, std::ostream &os, int indent ) {
+		os << std::string( indent, ' ' );
+		for ( OpenVarSet::const_iterator i = openVars.begin(); i != openVars.end(); ++i ) {
+			os << i->first << "(" << i->second << ") ";
+		} // for
+	}
+
+	void EqvClass::initialize( const EqvClass &src, EqvClass &dest ) {
+		dest.vars = src.vars;
+		dest.type = maybeClone( src.type );
+		dest.allowWidening = src.allowWidening;
+		dest.kind = src.kind;
+	}
+
+	EqvClass::EqvClass() : type( 0 ), allowWidening( true ) {
+	}
+
+	EqvClass::EqvClass( const EqvClass &other ) {
+		initialize( other, *this );
+	}
+
+	EqvClass &EqvClass::operator=( const EqvClass &other ) {
+		if ( this == &other ) return *this;
+		delete type;
+		initialize( other, *this );
+		return *this;
+	}
+
+	EqvClass::~EqvClass() {
+		delete type;
+	}
+
+	void EqvClass::print( std::ostream &os, int indent ) const {
+		os << std::string( indent, ' ' ) << "( ";
+		std::copy( vars.begin(), vars.end(), std::ostream_iterator< std::string >( os, " " ) );
+		os << ")";
+		if ( type ) {
+			os << " -> ";
+			type->print( os, indent );
+		} // if
+		if ( ! allowWidening ) {
+			os << " (no widening)";
+		} // if
+		os << std::endl;
+	}
+
+	bool TypeEnvironment::lookup( const std::string &var, EqvClass &eqvClass ) const {
+		for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i ) {
+			if ( i->vars.find( var ) != i->vars.end() ) {
 ///       std::cout << var << " is in class ";
 ///       i->print( std::cout );
-      eqvClass = *i;
-      return true;
-    }
+				eqvClass = *i;
+				return true;
+			}
 ///     std::cout << var << " is not in class ";
 ///     i->print( std::cout );
-  }
-  return false;
-}
-
-void 
-TypeEnvironment::add( const EqvClass &eqvClass )
-{
-  std::list< EqvClass >::iterator i = env.begin();
-  while( i != env.end() ) {
-    std::list< EqvClass >::iterator next = i;
-    next++;
-    std::set< std::string > intersection;
-    std::set_intersection( i->vars.begin(), i->vars.end(), eqvClass.vars.begin(), eqvClass.vars.end(), std::inserter( intersection, intersection.begin() ) );
-    if( !intersection.empty() ) {
-      env.erase( i );
-    }
-    i = next;
-  }
-  env.insert( env.end(), eqvClass );
-}
-
-void 
-TypeEnvironment::add( const std::list< TypeDecl* > &tyDecls )
-{
-  for( std::list< TypeDecl* >::const_iterator i = tyDecls.begin(); i != tyDecls.end(); ++i ) {
-    EqvClass newClass;
-    newClass.vars.insert( (*i)->get_name() );
-    newClass.kind = (*i)->get_kind();
-    env.push_back( newClass );
-  }
-}
-
-void 
-TypeEnvironment::makeSubstitution( TypeSubstitution &sub ) const
-{
-  for( std::list< EqvClass >::const_iterator theClass = env.begin(); theClass != env.end(); ++theClass ) {
-    for( std::set< std::string >::const_iterator theVar = theClass->vars.begin(); theVar != theClass->vars.end(); ++theVar ) {
+		} // for
+		return false;
+	}
+
+	void TypeEnvironment::add( const EqvClass &eqvClass ) {
+		std::list< EqvClass >::iterator i = env.begin();
+		while ( i != env.end() ) {
+			std::list< EqvClass >::iterator next = i;
+			next++;
+			std::set< std::string > intersection;
+			std::set_intersection( i->vars.begin(), i->vars.end(), eqvClass.vars.begin(), eqvClass.vars.end(), std::inserter( intersection, intersection.begin() ) );
+			if ( ! intersection.empty() ) {
+				env.erase( i );
+			} // if
+			i = next;
+		} // while
+		env.insert( env.end(), eqvClass );
+	}
+
+	void TypeEnvironment::add( const std::list< TypeDecl* > &tyDecls ) {
+		for ( std::list< TypeDecl* >::const_iterator i = tyDecls.begin(); i != tyDecls.end(); ++i ) {
+			EqvClass newClass;
+			newClass.vars.insert( (*i)->get_name() );
+			newClass.kind = (*i)->get_kind();
+			env.push_back( newClass );
+		} // for
+	}
+
+	void TypeEnvironment::makeSubstitution( TypeSubstitution &sub ) const {
+		for ( std::list< EqvClass >::const_iterator theClass = env.begin(); theClass != env.end(); ++theClass ) {
+			for ( std::set< std::string >::const_iterator theVar = theClass->vars.begin(); theVar != theClass->vars.end(); ++theVar ) {
 ///       std::cout << "adding " << *theVar;
-      if( theClass->type ) {
+				if ( theClass->type ) {
 ///         std::cout << " bound to ";
 ///         theClass->type->print( std::cout );
 ///         std::cout << std::endl;
-        sub.add( *theVar, theClass->type );
-      } else if( theVar != theClass->vars.begin() ) {
-        TypeInstType *newTypeInst = new TypeInstType( Type::Qualifiers(), *theClass->vars.begin(), theClass->kind == TypeDecl::Ftype );
+					sub.add( *theVar, theClass->type );
+				} else if ( theVar != theClass->vars.begin() ) {
+					TypeInstType *newTypeInst = new TypeInstType( Type::Qualifiers(), *theClass->vars.begin(), theClass->kind == TypeDecl::Ftype );
 ///         std::cout << " bound to variable " << *theClass->vars.begin() << std::endl;
-        sub.add( *theVar, newTypeInst );
-        delete newTypeInst;
-      }
-    }
-  }
+					sub.add( *theVar, newTypeInst );
+					delete newTypeInst;
+				} // if
+			} // for
+		} // for
 ///   std::cerr << "input env is:" << std::endl;
 ///   print( std::cerr, 8 );
 ///   std::cerr << "sub is:" << std::endl;
 ///   sub.print( std::cerr, 8 );
-  sub.normalize();
-}
-
-void 
-TypeEnvironment::print( std::ostream &os, int indent ) const
-{
-  for( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i ) {
-    i->print( os, indent );
-  }
-}
-
-std::list< EqvClass >::iterator 
-TypeEnvironment::internal_lookup( const std::string &var )
-{
-  for( std::list< EqvClass >::iterator i = env.begin(); i != env.end(); ++i ) {
-    if( i->vars.find( var ) == i->vars.end() ) {
-      return i;
-    }
-  }
-  return env.end();
-}
-
-void 
-TypeEnvironment::simpleCombine( const TypeEnvironment &second )
-{
-  env.insert( env.end(), second.env.begin(), second.env.end() );
-}
-
-void 
-TypeEnvironment::combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) )
-{
-  TypeEnvironment secondCopy( second );
-  for( std::list< EqvClass >::iterator firstClass = env.begin(); firstClass != env.end(); ++firstClass ) {
-    EqvClass &newClass = *firstClass;
-    std::set< std::string > newVars;
-    for( std::set< std::string >::const_iterator var = firstClass->vars.begin(); var != firstClass->vars.end(); ++var ) {
-      std::list< EqvClass >::iterator secondClass = secondCopy.internal_lookup( *var );
-      if( secondClass != secondCopy.env.end() ) {
-        newVars.insert( secondClass->vars.begin(), secondClass->vars.end() );
-        if( secondClass->type ) {
-          if( newClass.type ) {
-            Type *newType = combineFunc( newClass.type, secondClass->type );
-            delete newClass.type;
-            newClass.type = newType;
-            newClass.allowWidening = newClass.allowWidening && secondClass->allowWidening;
-          } else {
-            newClass.type = secondClass->type->clone();
-            newClass.allowWidening = secondClass->allowWidening;
-          }
-        }
-        secondCopy.env.erase( secondClass );
-      }
-    }
-    newClass.vars.insert( newVars.begin(), newVars.end() );
-  }
-  for( std::list< EqvClass >::iterator secondClass = secondCopy.env.begin(); secondClass != secondCopy.env.end(); ++secondClass ) {
-    env.push_back( *secondClass );
-  }
-}
-
-void 
-TypeEnvironment::extractOpenVars( OpenVarSet &openVars ) const
-{
-  for( std::list< EqvClass >::const_iterator eqvClass = env.begin(); eqvClass != env.end(); ++eqvClass ) {
-    for( std::set< std::string >::const_iterator var = eqvClass->vars.begin(); var != eqvClass->vars.end(); ++var ) {
-      openVars[ *var ] = eqvClass->kind;
-    }
-  }
-}
+		sub.normalize();
+	}
+
+	void TypeEnvironment::print( std::ostream &os, int indent ) const {
+		for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i ) {
+			i->print( os, indent );
+		} // for
+	}
+
+	std::list< EqvClass >::iterator TypeEnvironment::internal_lookup( const std::string &var ) {
+		for ( std::list< EqvClass >::iterator i = env.begin(); i != env.end(); ++i ) {
+			if ( i->vars.find( var ) == i->vars.end() ) {
+				return i;
+			} // if
+		} // for
+		return env.end();
+	}
+
+	void TypeEnvironment::simpleCombine( const TypeEnvironment &second ) {
+		env.insert( env.end(), second.env.begin(), second.env.end() );
+	}
+
+	void TypeEnvironment::combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) ) {
+		TypeEnvironment secondCopy( second );
+		for ( std::list< EqvClass >::iterator firstClass = env.begin(); firstClass != env.end(); ++firstClass ) {
+			EqvClass &newClass = *firstClass;
+			std::set< std::string > newVars;
+			for ( std::set< std::string >::const_iterator var = firstClass->vars.begin(); var != firstClass->vars.end(); ++var ) {
+				std::list< EqvClass >::iterator secondClass = secondCopy.internal_lookup( *var );
+				if ( secondClass != secondCopy.env.end() ) {
+					newVars.insert( secondClass->vars.begin(), secondClass->vars.end() );
+					if ( secondClass->type ) {
+						if ( newClass.type ) {
+							Type *newType = combineFunc( newClass.type, secondClass->type );
+							delete newClass.type;
+							newClass.type = newType;
+							newClass.allowWidening = newClass.allowWidening && secondClass->allowWidening;
+						} else {
+							newClass.type = secondClass->type->clone();
+							newClass.allowWidening = secondClass->allowWidening;
+						} // if
+					} // if
+					secondCopy.env.erase( secondClass );
+				} // if
+			} // for
+			newClass.vars.insert( newVars.begin(), newVars.end() );
+		} // for
+		for ( std::list< EqvClass >::iterator secondClass = secondCopy.env.begin(); secondClass != secondCopy.env.end(); ++secondClass ) {
+			env.push_back( *secondClass );
+		} // for
+	}
+
+	void TypeEnvironment::extractOpenVars( OpenVarSet &openVars ) const {
+		for ( std::list< EqvClass >::const_iterator eqvClass = env.begin(); eqvClass != env.end(); ++eqvClass ) {
+			for ( std::set< std::string >::const_iterator var = eqvClass->vars.begin(); var != eqvClass->vars.end(); ++var ) {
+				openVars[ *var ] = eqvClass->kind;
+			} // for
+		} // for
+	}
 
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/TypeEnvironment.h
===================================================================
--- translator/ResolvExpr/TypeEnvironment.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/TypeEnvironment.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,11 +1,19 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: TypeEnvironment.h,v 1.8 2005/08/29 20:14:16 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// TypeEnvironment.h -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 12:24:58 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 12:26:52 2015
+// Update Count     : 2
+//
 
-#ifndef RESOLVEXPR_TYPEENVIRONMENT_H
-#define RESOLVEXPR_TYPEENVIRONMENT_H
+#ifndef TYPEENVIRONMENT_H
+#define TYPEENVIRONMENT_H
 
 #include <string>
@@ -20,73 +28,70 @@
 
 namespace ResolvExpr {
+	typedef std::map< DeclarationWithType*, bool > AssertionSet;
+	typedef std::map< std::string, TypeDecl::Kind > OpenVarSet;
 
-typedef std::map< DeclarationWithType*, bool > AssertionSet;
-typedef std::map< std::string, TypeDecl::Kind > OpenVarSet;
+	void printAssertionSet( const AssertionSet &, std::ostream &, int indent = 0 );
+	void printOpenVarSet( const OpenVarSet &, std::ostream &, int indent = 0 );
 
-void printAssertionSet( const AssertionSet &, std::ostream &, int indent = 0 );
-void printOpenVarSet( const OpenVarSet &, std::ostream &, int indent = 0 );
+	struct EqvClass {
+		std::set< std::string > vars;
+		Type *type;
+		bool allowWidening;
+		TypeDecl::Kind kind;
+  
+		void initialize( const EqvClass &src, EqvClass &dest );
+		EqvClass();
+		EqvClass( const EqvClass &other );
+		EqvClass &operator=( const EqvClass &other );
+		~EqvClass();
+		void print( std::ostream &os, int indent = 0 ) const;
+	};
 
-struct EqvClass
-{
-  std::set< std::string > vars;
-  Type *type;
-  bool allowWidening;
-  TypeDecl::Kind kind;
+	class TypeEnvironment {
+	  public:
+		bool lookup( const std::string &var, EqvClass &eqvClass ) const;
+		void add( const EqvClass &eqvClass );
+		void add( const std::list< TypeDecl* > &tyDecls );
+		template< typename SynTreeClass > int apply( SynTreeClass *&type ) const;
+		template< typename SynTreeClass > int applyFree( SynTreeClass *&type ) const;
+		void makeSubstitution( TypeSubstitution &result ) const;
+		bool isEmpty() const { return env.empty(); }
+		void print( std::ostream &os, int indent = 0 ) const;
+		void combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) );
+		void simpleCombine( const TypeEnvironment &second );
+		void extractOpenVars( OpenVarSet &openVars ) const;
+		TypeEnvironment *clone() const { return new TypeEnvironment( *this ); }
   
-  void initialize( const EqvClass &src, EqvClass &dest );
-  EqvClass();
-  EqvClass( const EqvClass &other );
-  EqvClass &operator=( const EqvClass &other );
-  ~EqvClass();
-  void print( std::ostream &os, int indent = 0 ) const;
-};
+		typedef std::list< EqvClass >::iterator iterator;
+		iterator begin() { return env.begin(); }
+		iterator end() { return env.end(); }
+		typedef std::list< EqvClass >::const_iterator const_iterator;
+		const_iterator begin() const { return env.begin(); }
+		const_iterator end() const { return env.end(); }
+	  private:
+		std::list< EqvClass > env;
+		std::list< EqvClass >::iterator internal_lookup( const std::string &var );
+	};
 
-class TypeEnvironment
-{
-public:
-  bool lookup( const std::string &var, EqvClass &eqvClass ) const;
-  void add( const EqvClass &eqvClass );
-  void add( const std::list< TypeDecl* > &tyDecls );
-  template< typename SynTreeClass > int apply( SynTreeClass *&type ) const;
-  template< typename SynTreeClass > int applyFree( SynTreeClass *&type ) const;
-  void makeSubstitution( TypeSubstitution &result ) const;
-  bool isEmpty() const { return env.empty(); }
-  void print( std::ostream &os, int indent = 0 ) const;
-  void combine( const TypeEnvironment &second, Type *(*combineFunc)( Type*, Type* ) );
-  void simpleCombine( const TypeEnvironment &second );
-  void extractOpenVars( OpenVarSet &openVars ) const;
-  TypeEnvironment *clone() const { return new TypeEnvironment( *this ); }
-  
-  typedef std::list< EqvClass >::iterator iterator;
-  iterator begin() { return env.begin(); }
-  iterator end() { return env.end(); }
-  typedef std::list< EqvClass >::const_iterator const_iterator;
-  const_iterator begin() const { return env.begin(); }
-  const_iterator end() const { return env.end(); }
-private:
-  std::list< EqvClass > env;
-  
-  std::list< EqvClass >::iterator internal_lookup( const std::string &var );
-};
+	template< typename SynTreeClass >
+	int TypeEnvironment::apply( SynTreeClass *&type ) const {
+		TypeSubstitution sub;
+		makeSubstitution( sub );
+		return sub.apply( type );
+	}
 
-template< typename SynTreeClass >
-int 
-TypeEnvironment::apply( SynTreeClass *&type ) const
-{
-  TypeSubstitution sub;
-  makeSubstitution( sub );
-  return sub.apply( type );
-}
-
-template< typename SynTreeClass >
-int 
-TypeEnvironment::applyFree( SynTreeClass *&type ) const
-{
-  TypeSubstitution sub;
-  makeSubstitution( sub );
-  return sub.applyFree( type );
-}
-
+	template< typename SynTreeClass >
+	int TypeEnvironment::applyFree( SynTreeClass *&type ) const {
+		TypeSubstitution sub;
+		makeSubstitution( sub );
+		return sub.applyFree( type );
+	}
 } // namespace ResolvExpr
 
-#endif /* #ifndef RESOLVEXPR_TYPEENVIRONMENT_H */
+#endif // TYPEENVIRONMENT_H */
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/Unify.cc
===================================================================
--- translator/ResolvExpr/Unify.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/Unify.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,8 +1,16 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: Unify.cc,v 1.14 2005/08/29 20:14:16 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Unify.cc -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 12:27:10 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 13:08:48 2015
+// Update Count     : 6
+//
 
 #include <set>
@@ -23,79 +31,71 @@
 
 namespace ResolvExpr {
-
-struct WidenMode
-{
-  WidenMode( bool widenFirst, bool widenSecond ): widenFirst( widenFirst ), widenSecond( widenSecond ) {}
-  WidenMode &operator|=( const WidenMode &other ) { widenFirst |= other.widenFirst; widenSecond |= other.widenSecond; return *this; }
-  WidenMode &operator&=( const WidenMode &other ) { widenFirst &= other.widenFirst; widenSecond &= other.widenSecond; return *this; }
-  WidenMode operator|( const WidenMode &other ) { WidenMode newWM( *this ); newWM |= other; return newWM; }
-  WidenMode operator&( const WidenMode &other ) { WidenMode newWM( *this ); newWM &= other; return newWM; }
-  operator bool() { return widenFirst && widenSecond; }
-  
-  bool widenFirst : 1, widenSecond : 1;
-};
-
-class Unify : public Visitor
-{
-public:
-  Unify( Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer );
-  
-  bool get_result() const { return result; }
-
-private:
-  virtual void visit(VoidType *voidType);
-  virtual void visit(BasicType *basicType);
-  virtual void visit(PointerType *pointerType);
-  virtual void visit(ArrayType *arrayType);
-  virtual void visit(FunctionType *functionType);
-  virtual void visit(StructInstType *aggregateUseType);
-  virtual void visit(UnionInstType *aggregateUseType);
-  virtual void visit(EnumInstType *aggregateUseType);
-  virtual void visit(ContextInstType *aggregateUseType);
-  virtual void visit(TypeInstType *aggregateUseType);
-  virtual void visit(TupleType *tupleType);
-
-  template< typename RefType > void handleRefType( RefType *inst, Type *other );
-
-  bool result;
-  Type *type2;				// inherited
-  TypeEnvironment &env;
-  AssertionSet &needAssertions;
-  AssertionSet &haveAssertions;
-  const OpenVarSet &openVars;
-  WidenMode widenMode;
-  Type *commonType;
-  const SymTab::Indexer &indexer;
-};
-
-bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer, Type *&common );
-bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer );
-  
-bool
-typesCompatible( Type *first, Type *second, const SymTab::Indexer &indexer, const TypeEnvironment &env )
-{
-  TypeEnvironment newEnv;
-  OpenVarSet openVars;
-  AssertionSet needAssertions, haveAssertions;
-  Type *newFirst = first->clone(), *newSecond = second->clone();
-  env.apply( newFirst );
-  env.apply( newSecond );
-  bool result = unifyExact( newFirst, newSecond, newEnv, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
-  delete newFirst;
-  delete newSecond;
-  return result;
-}
-
-bool
-typesCompatibleIgnoreQualifiers( Type *first, Type *second, const SymTab::Indexer &indexer, const TypeEnvironment &env )
-{
-  TypeEnvironment newEnv;
-  OpenVarSet openVars;
-  AssertionSet needAssertions, haveAssertions;
-  Type *newFirst = first->clone(), *newSecond = second->clone();
-  env.apply( newFirst );
-  env.apply( newSecond );
-  newFirst->get_qualifiers() = Type::Qualifiers();
-  newSecond->get_qualifiers() = Type::Qualifiers();
+	struct WidenMode {
+		WidenMode( bool widenFirst, bool widenSecond ): widenFirst( widenFirst ), widenSecond( widenSecond ) {}
+		WidenMode &operator|=( const WidenMode &other ) { widenFirst |= other.widenFirst; widenSecond |= other.widenSecond; return *this; }
+		WidenMode &operator&=( const WidenMode &other ) { widenFirst &= other.widenFirst; widenSecond &= other.widenSecond; return *this; }
+		WidenMode operator|( const WidenMode &other ) { WidenMode newWM( *this ); newWM |= other; return newWM; }
+		WidenMode operator&( const WidenMode &other ) { WidenMode newWM( *this ); newWM &= other; return newWM; }
+		operator bool() { return widenFirst && widenSecond; }
+  
+		bool widenFirst : 1, widenSecond : 1;
+	};
+
+	class Unify : public Visitor {
+	  public:
+		Unify( Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer );
+  
+		bool get_result() const { return result; }
+	  private:
+		virtual void visit(VoidType *voidType);
+		virtual void visit(BasicType *basicType);
+		virtual void visit(PointerType *pointerType);
+		virtual void visit(ArrayType *arrayType);
+		virtual void visit(FunctionType *functionType);
+		virtual void visit(StructInstType *aggregateUseType);
+		virtual void visit(UnionInstType *aggregateUseType);
+		virtual void visit(EnumInstType *aggregateUseType);
+		virtual void visit(ContextInstType *aggregateUseType);
+		virtual void visit(TypeInstType *aggregateUseType);
+		virtual void visit(TupleType *tupleType);
+
+		template< typename RefType > void handleRefType( RefType *inst, Type *other );
+
+		bool result;
+		Type *type2;				// inherited
+		TypeEnvironment &env;
+		AssertionSet &needAssertions;
+		AssertionSet &haveAssertions;
+		const OpenVarSet &openVars;
+		WidenMode widenMode;
+		Type *commonType;
+		const SymTab::Indexer &indexer;
+	};
+
+	bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer, Type *&common );
+	bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer );
+  
+	bool typesCompatible( Type *first, Type *second, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
+		TypeEnvironment newEnv;
+		OpenVarSet openVars;
+		AssertionSet needAssertions, haveAssertions;
+		Type *newFirst = first->clone(), *newSecond = second->clone();
+		env.apply( newFirst );
+		env.apply( newSecond );
+		bool result = unifyExact( newFirst, newSecond, newEnv, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+		delete newFirst;
+		delete newSecond;
+		return result;
+	}
+
+	bool typesCompatibleIgnoreQualifiers( Type *first, Type *second, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
+		TypeEnvironment newEnv;
+		OpenVarSet openVars;
+		AssertionSet needAssertions, haveAssertions;
+		Type *newFirst = first->clone(), *newSecond = second->clone();
+		env.apply( newFirst );
+		env.apply( newSecond );
+		newFirst->get_qualifiers() = Type::Qualifiers();
+		newSecond->get_qualifiers() = Type::Qualifiers();
 ///   std::cout << "first is ";
 ///   first->print( std::cout );
@@ -107,310 +107,285 @@
 ///   newSecond->print( std::cout );
 ///   std::cout << std::endl;
-  bool result = unifyExact( newFirst, newSecond, newEnv, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
-  delete newFirst;
-  delete newSecond;
-  return result;
-}
-
-bool
-isFtype( Type *type, const SymTab::Indexer &indexer )
-{
-  if( dynamic_cast< FunctionType* >( type ) ) {
-    return true;
-  } else if( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) {
-    return typeInst->get_isFtype();
-  }
-  return false;
-}
-
-bool
-tyVarCompatible( TypeDecl::Kind kind, Type *type, const SymTab::Indexer &indexer )
-{
-  switch( kind ) {
-  case TypeDecl::Any:
-  case TypeDecl::Dtype:
-    return !isFtype( type, indexer );
-  
-  case TypeDecl::Ftype:
-    return isFtype( type, indexer );
-  }
-  assert( false );
-  return false;
-}
-
-bool
-bindVar( TypeInstType *typeInst, Type *other, TypeDecl::Kind kind, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer )
-{
-  OpenVarSet::const_iterator tyvar = openVars.find( typeInst->get_name() );
-  assert( tyvar != openVars.end() );
-  if( !tyVarCompatible( tyvar->second, other, indexer ) ) {
-    return false;
-  }
-  if( occurs( other, typeInst->get_name(), env ) ) {
-    return false;
-  }
-  EqvClass curClass;
-  if( env.lookup( typeInst->get_name(), curClass ) ) {
-    if( curClass.type ) {
-      Type *common = 0;
-      std::auto_ptr< Type > newType( curClass.type->clone() );
-      if( unifyInexact( newType.get(), other, env, needAssertions, haveAssertions, openVars, widenMode & WidenMode( curClass.allowWidening, true ), indexer, common ) ) {
-        if( common ) {
-          common->get_qualifiers() = Type::Qualifiers();
-          delete curClass.type;
-          curClass.type = common;
-          env.add( curClass );
-        }
-        return true;
-      } else {
-        return false;
-      }
-    } else {
-      curClass.type = other->clone();
-      curClass.type->get_qualifiers() = Type::Qualifiers();
-      curClass.allowWidening = widenMode.widenFirst && widenMode.widenSecond;
-      env.add( curClass );
-    }
-  } else {
-    EqvClass newClass;
-    newClass.vars.insert( typeInst->get_name() );
-    newClass.type = other->clone();
-    newClass.type->get_qualifiers() = Type::Qualifiers();
-    newClass.allowWidening = widenMode.widenFirst && widenMode.widenSecond;
-    newClass.kind = kind;
-    env.add( newClass );
-  }
-  return true;
-}
-
-bool
-bindVarToVar( TypeInstType *var1, TypeInstType *var2, TypeDecl::Kind kind, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer )
-{
-  bool result = true;
-  EqvClass class1, class2;
-  bool hasClass1 = false, hasClass2 = false;
-  bool widen1 = false, widen2 = false;
-  Type *type1 = 0, *type2 = 0;
-  
-  if( env.lookup( var1->get_name(), class1 ) ) {
-    hasClass1 = true;
-    if( class1.type ) {
-      if( occurs( class1.type, var2->get_name(), env ) ) {
-        return false;
-      }
-      type1 = class1.type->clone();
-    }
-    widen1 = widenMode.widenFirst && class1.allowWidening;
-  }
-  if( env.lookup( var2->get_name(), class2 ) ) {
-    hasClass2 = true;
-    if( class2.type ) {
-      if( occurs( class2.type, var1->get_name(), env ) ) {
-        return false;
-      }
-      type2 = class2.type->clone();
-    }
-    widen2 = widenMode.widenSecond && class2.allowWidening;
-  }
-  
-  if( type1 && type2 ) {
+		bool result = unifyExact( newFirst, newSecond, newEnv, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+		delete newFirst;
+		delete newSecond;
+		return result;
+	}
+
+	bool isFtype( Type *type, const SymTab::Indexer &indexer ) {
+		if ( dynamic_cast< FunctionType* >( type ) ) {
+			return true;
+		} else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) {
+			return typeInst->get_isFtype();
+		} // if
+		return false;
+	}
+
+	bool tyVarCompatible( TypeDecl::Kind kind, Type *type, const SymTab::Indexer &indexer ) {
+		switch ( kind ) {
+		  case TypeDecl::Any:
+		  case TypeDecl::Dtype:
+			return ! isFtype( type, indexer );
+  
+		  case TypeDecl::Ftype:
+			return isFtype( type, indexer );
+		} // switch
+		assert( false );
+		return false;
+	}
+
+	bool bindVar( TypeInstType *typeInst, Type *other, TypeDecl::Kind kind, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) {
+		OpenVarSet::const_iterator tyvar = openVars.find( typeInst->get_name() );
+		assert( tyvar != openVars.end() );
+		if ( ! tyVarCompatible( tyvar->second, other, indexer ) ) {
+			return false;
+		} // if
+		if ( occurs( other, typeInst->get_name(), env ) ) {
+			return false;
+		} // if
+		EqvClass curClass;
+		if ( env.lookup( typeInst->get_name(), curClass ) ) {
+			if ( curClass.type ) {
+				Type *common = 0;
+				std::auto_ptr< Type > newType( curClass.type->clone() );
+				if ( unifyInexact( newType.get(), other, env, needAssertions, haveAssertions, openVars, widenMode & WidenMode( curClass.allowWidening, true ), indexer, common ) ) {
+					if ( common ) {
+						common->get_qualifiers() = Type::Qualifiers();
+						delete curClass.type;
+						curClass.type = common;
+						env.add( curClass );
+					} // if
+					return true;
+				} else {
+					return false;
+				} // if
+			} else {
+				curClass.type = other->clone();
+				curClass.type->get_qualifiers() = Type::Qualifiers();
+				curClass.allowWidening = widenMode.widenFirst && widenMode.widenSecond;
+				env.add( curClass );
+			} // if
+		} else {
+			EqvClass newClass;
+			newClass.vars.insert( typeInst->get_name() );
+			newClass.type = other->clone();
+			newClass.type->get_qualifiers() = Type::Qualifiers();
+			newClass.allowWidening = widenMode.widenFirst && widenMode.widenSecond;
+			newClass.kind = kind;
+			env.add( newClass );
+		} // if
+		return true;
+	}
+
+	bool bindVarToVar( TypeInstType *var1, TypeInstType *var2, TypeDecl::Kind kind, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) {
+		bool result = true;
+		EqvClass class1, class2;
+		bool hasClass1 = false, hasClass2 = false;
+		bool widen1 = false, widen2 = false;
+		Type *type1 = 0, *type2 = 0;
+  
+		if ( env.lookup( var1->get_name(), class1 ) ) {
+			hasClass1 = true;
+			if ( class1.type ) {
+				if ( occurs( class1.type, var2->get_name(), env ) ) {
+					return false;
+				} // if
+				type1 = class1.type->clone();
+			} // if
+			widen1 = widenMode.widenFirst && class1.allowWidening;
+		} // if
+		if ( env.lookup( var2->get_name(), class2 ) ) {
+			hasClass2 = true;
+			if ( class2.type ) {
+				if ( occurs( class2.type, var1->get_name(), env ) ) {
+					return false;
+				} // if
+				type2 = class2.type->clone();
+			} // if
+			widen2 = widenMode.widenSecond && class2.allowWidening;
+		} // if
+  
+		if ( type1 && type2 ) {
 //    std::cout << "has type1 && type2" << std::endl;
-    WidenMode newWidenMode ( widen1, widen2 );
-    Type *common = 0;
-    if( unifyInexact( type1, type2, env, needAssertions, haveAssertions, openVars, newWidenMode, indexer, common ) ) {
-      class1.vars.insert( class2.vars.begin(), class2.vars.end() );
-      class1.allowWidening = widen1 && widen2;
-      if( common ) {
-        common->get_qualifiers() = Type::Qualifiers();
-        delete class1.type;
-        class1.type = common;
-      }
-      env.add( class1 );
-    } else {
-      result = false;
-    }
-  } else if( hasClass1 && hasClass2 ) {
-    if( type1 ) {
-      class1.vars.insert( class2.vars.begin(), class2.vars.end() );
-      class1.allowWidening = widen1;
-      env.add( class1 );
-    } else {
-      class2.vars.insert( class1.vars.begin(), class1.vars.end() );
-      class2.allowWidening = widen2;
-      env.add( class2 );
-    }
-  } else if( hasClass1 ) {
-    class1.vars.insert( var2->get_name() );
-    class1.allowWidening = widen1;
-    env.add( class1 );
-  } else if( hasClass2 ) {
-    class2.vars.insert( var1->get_name() );
-    class2.allowWidening = widen2;
-    env.add( class2 );
-  } else {
-    EqvClass newClass;
-    newClass.vars.insert( var1->get_name() );
-    newClass.vars.insert( var2->get_name() );
-    newClass.allowWidening = widen1 && widen2;
-    newClass.kind = kind;
-    env.add( newClass );
-  }
-  delete type1;
-  delete type2;
-  return result;
-}
-
-bool
-unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer )
-{
-  OpenVarSet closedVars;
-  findOpenVars( type1, openVars, closedVars, needAssertions, haveAssertions, false );
-  findOpenVars( type2, openVars, closedVars, needAssertions, haveAssertions, true );
-  Type *commonType = 0;
-  if( unifyInexact( type1, type2, env, needAssertions, haveAssertions, openVars, WidenMode( true, true ), indexer, commonType ) ) {
-    if( commonType ) {
-      delete commonType;
-    }
-    return true;
-  } else {
-    return false;
-  }
-}
-
-bool
-unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, Type *&commonType )
-{
-  OpenVarSet closedVars;
-  findOpenVars( type1, openVars, closedVars, needAssertions, haveAssertions, false );
-  findOpenVars( type2, openVars, closedVars, needAssertions, haveAssertions, true );
-  return unifyInexact( type1, type2, env, needAssertions, haveAssertions, openVars, WidenMode( true, true ), indexer, commonType );
-}
-
-bool
-unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer )
-{
+			WidenMode newWidenMode ( widen1, widen2 );
+			Type *common = 0;
+			if ( unifyInexact( type1, type2, env, needAssertions, haveAssertions, openVars, newWidenMode, indexer, common ) ) {
+				class1.vars.insert( class2.vars.begin(), class2.vars.end() );
+				class1.allowWidening = widen1 && widen2;
+				if ( common ) {
+					common->get_qualifiers() = Type::Qualifiers();
+					delete class1.type;
+					class1.type = common;
+				} // if
+				env.add( class1 );
+			} else {
+				result = false;
+			} // if
+		} else if ( hasClass1 && hasClass2 ) {
+			if ( type1 ) {
+				class1.vars.insert( class2.vars.begin(), class2.vars.end() );
+				class1.allowWidening = widen1;
+				env.add( class1 );
+			} else {
+				class2.vars.insert( class1.vars.begin(), class1.vars.end() );
+				class2.allowWidening = widen2;
+				env.add( class2 );
+			} // if
+		} else if ( hasClass1 ) {
+			class1.vars.insert( var2->get_name() );
+			class1.allowWidening = widen1;
+			env.add( class1 );
+		} else if ( hasClass2 ) {
+			class2.vars.insert( var1->get_name() );
+			class2.allowWidening = widen2;
+			env.add( class2 );
+		} else {
+			EqvClass newClass;
+			newClass.vars.insert( var1->get_name() );
+			newClass.vars.insert( var2->get_name() );
+			newClass.allowWidening = widen1 && widen2;
+			newClass.kind = kind;
+			env.add( newClass );
+		} // if
+		delete type1;
+		delete type2;
+		return result;
+	}
+
+	bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ) {
+		OpenVarSet closedVars;
+		findOpenVars( type1, openVars, closedVars, needAssertions, haveAssertions, false );
+		findOpenVars( type2, openVars, closedVars, needAssertions, haveAssertions, true );
+		Type *commonType = 0;
+		if ( unifyInexact( type1, type2, env, needAssertions, haveAssertions, openVars, WidenMode( true, true ), indexer, commonType ) ) {
+			if ( commonType ) {
+				delete commonType;
+			} // if
+			return true;
+		} else {
+			return false;
+		} // if
+	}
+
+	bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, Type *&commonType ) {
+		OpenVarSet closedVars;
+		findOpenVars( type1, openVars, closedVars, needAssertions, haveAssertions, false );
+		findOpenVars( type2, openVars, closedVars, needAssertions, haveAssertions, true );
+		return unifyInexact( type1, type2, env, needAssertions, haveAssertions, openVars, WidenMode( true, true ), indexer, commonType );
+	}
+
+	bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) {
 #ifdef DEBUG
-  TypeEnvironment debugEnv( env );
+		TypeEnvironment debugEnv( env );
 #endif
-  bool result;
-  TypeInstType *var1 = dynamic_cast< TypeInstType* >( type1 );
-  TypeInstType *var2 = dynamic_cast< TypeInstType* >( type2 );
-  OpenVarSet::const_iterator entry1, entry2;
-  if( var1 ) {
-    entry1 = openVars.find( var1->get_name() );
-  }
-  if( var2 ) {
-    entry2 = openVars.find( var2->get_name() );
-  }
-  bool isopen1 = var1 && ( entry1 != openVars.end() );
-  bool isopen2 = var2 && ( entry2 != openVars.end() );
-  if( type1->get_qualifiers() != type2->get_qualifiers() ) {
-    return false;
-  } else if( isopen1 && isopen2 && entry1->second == entry2->second ) {
-    result = bindVarToVar( var1, var2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
-  } else if( isopen1 ) {
-    result = bindVar( var1, type2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
-  } else if( isopen2 ) {
-    result = bindVar( var2, type1, entry2->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
-  } else {
-    Unify comparator( type2, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
-    type1->accept( comparator );
-    result = comparator.get_result();
-  }
+		bool result;
+		TypeInstType *var1 = dynamic_cast< TypeInstType* >( type1 );
+		TypeInstType *var2 = dynamic_cast< TypeInstType* >( type2 );
+		OpenVarSet::const_iterator entry1, entry2;
+		if ( var1 ) {
+			entry1 = openVars.find( var1->get_name() );
+		} // if
+		if ( var2 ) {
+			entry2 = openVars.find( var2->get_name() );
+		} // if
+		bool isopen1 = var1 && ( entry1 != openVars.end() );
+		bool isopen2 = var2 && ( entry2 != openVars.end() );
+		if ( type1->get_qualifiers() != type2->get_qualifiers() ) {
+			return false;
+		} else if ( isopen1 && isopen2 && entry1->second == entry2->second ) {
+			result = bindVarToVar( var1, var2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
+		} else if ( isopen1 ) {
+			result = bindVar( var1, type2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
+		} else if ( isopen2 ) {
+			result = bindVar( var2, type1, entry2->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
+		} else {
+			Unify comparator( type2, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
+			type1->accept( comparator );
+			result = comparator.get_result();
+		} // if
 #ifdef DEBUG
-  std::cout << "============ unifyExact" << std::endl;
-  std::cout << "type1 is ";
-  type1->print( std::cout );
-  std::cout << std::endl << "type2 is ";
-  type2->print( std::cout );
-  std::cout << std::endl << "openVars are ";
-  printOpenVarSet( openVars, std::cout, 8 );
-  std::cout << std::endl << "input env is " << std::endl;
-  debugEnv.print( std::cout, 8 );
-  std::cout << std::endl << "result env is " << std::endl;
-  env.print( std::cout, 8 );
-  std::cout << "result is " << result << std::endl;
+		std::cout << "============ unifyExact" << std::endl;
+		std::cout << "type1 is ";
+		type1->print( std::cout );
+		std::cout << std::endl << "type2 is ";
+		type2->print( std::cout );
+		std::cout << std::endl << "openVars are ";
+		printOpenVarSet( openVars, std::cout, 8 );
+		std::cout << std::endl << "input env is " << std::endl;
+		debugEnv.print( std::cout, 8 );
+		std::cout << std::endl << "result env is " << std::endl;
+		env.print( std::cout, 8 );
+		std::cout << "result is " << result << std::endl;
 #endif
-  return result;
-}
-
-bool
-unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer )
-{
-  return unifyExact( type1, type2, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
-}
-
-bool
-unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer, Type *&common )
-{
-  Type::Qualifiers tq1 = type1->get_qualifiers(), tq2 = type2->get_qualifiers();
-  type1->get_qualifiers() = Type::Qualifiers();
-  type2->get_qualifiers() = Type::Qualifiers();
-  bool result;
+		return result;
+	}
+
+	bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ) {
+		return unifyExact( type1, type2, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+	}
+
+	bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer, Type *&common ) {
+		Type::Qualifiers tq1 = type1->get_qualifiers(), tq2 = type2->get_qualifiers();
+		type1->get_qualifiers() = Type::Qualifiers();
+		type2->get_qualifiers() = Type::Qualifiers();
+		bool result;
 #ifdef DEBUG
-  std::cout << "unifyInexact type 1 is ";
-  type1->print( std::cout );
-  std::cout << "type 2 is ";
-  type2->print( std::cout );
-  std::cout << std::endl;
+		std::cout << "unifyInexact type 1 is ";
+		type1->print( std::cout );
+		std::cout << "type 2 is ";
+		type2->print( std::cout );
+		std::cout << std::endl;
 #endif
-  if( !unifyExact( type1, type2, env, needAssertions, haveAssertions, openVars, widenMode, indexer ) ) {
+		if ( ! unifyExact( type1, type2, env, needAssertions, haveAssertions, openVars, widenMode, indexer ) ) {
 #ifdef DEBUG
-    std::cout << "unifyInexact: no exact unification found" << std::endl;
+			std::cout << "unifyInexact: no exact unification found" << std::endl;
 #endif
-    if( ( common = commonType( type1, type2, widenMode.widenFirst, widenMode.widenSecond, indexer, env, openVars ) ) ) {
-      common->get_qualifiers() = tq1 + tq2;
+			if ( ( common = commonType( type1, type2, widenMode.widenFirst, widenMode.widenSecond, indexer, env, openVars ) ) ) {
+				common->get_qualifiers() = tq1 + tq2;
 #ifdef DEBUG
-      std::cout << "unifyInexact: common type is ";
-      common->print( std::cout );
-      std::cout << std::endl;
+				std::cout << "unifyInexact: common type is ";
+				common->print( std::cout );
+				std::cout << std::endl;
 #endif
-      result = true;
-    } else {
+				result = true;
+			} else {
 #ifdef DEBUG
-      std::cout << "unifyInexact: no common type found" << std::endl;
+				std::cout << "unifyInexact: no common type found" << std::endl;
 #endif
-      result = false;
-    }
-  } else {
-    if( tq1 != tq2 ) {
-      if( ( tq1 > tq2 || widenMode.widenFirst ) && ( tq2 > tq1 || widenMode.widenSecond ) ) {
-        common = type1->clone();
-        common->get_qualifiers() = tq1 + tq2;
-        result = true;
-      } else {
-        result = false;
-      }
-    } else {
-      result = true;
-    }
-  }
-  type1->get_qualifiers() = tq1;
-  type2->get_qualifiers() = tq2;
-  return result;
-}
-
-Unify::Unify( Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer )
-  : result( false ), type2( type2 ), env( env ), needAssertions( needAssertions ), haveAssertions( haveAssertions ), openVars( openVars ), widenMode( widenMode ), indexer( indexer )
-{
-}
-
-void 
-Unify::visit(VoidType *voidType)
-{
-  result = dynamic_cast< VoidType* >( type2 );
-}
-
-void 
-Unify::visit(BasicType *basicType)
-{
-  if( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) {
-    result = basicType->get_kind() == otherBasic->get_kind();
-  }
-}
-
-void
-markAssertionSet( AssertionSet &assertions, DeclarationWithType *assert )
-{
+				result = false;
+			} // if
+		} else {
+			if ( tq1 != tq2 ) {
+				if ( ( tq1 > tq2 || widenMode.widenFirst ) && ( tq2 > tq1 || widenMode.widenSecond ) ) {
+					common = type1->clone();
+					common->get_qualifiers() = tq1 + tq2;
+					result = true;
+				} else {
+					result = false;
+				} // if
+			} else {
+				result = true;
+			} // if
+		} // if
+		type1->get_qualifiers() = tq1;
+		type2->get_qualifiers() = tq2;
+		return result;
+	}
+
+	Unify::Unify( Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer )
+		: result( false ), type2( type2 ), env( env ), needAssertions( needAssertions ), haveAssertions( haveAssertions ), openVars( openVars ), widenMode( widenMode ), indexer( indexer ) {
+	}
+
+	void Unify::visit(VoidType *voidType) {
+		result = dynamic_cast< VoidType* >( type2 );
+	}
+
+	void Unify::visit(BasicType *basicType) {
+		if ( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) {
+			result = basicType->get_kind() == otherBasic->get_kind();
+		} // if
+	}
+
+	void markAssertionSet( AssertionSet &assertions, DeclarationWithType *assert ) {
 ///   std::cout << "assertion set is" << std::endl;
 ///   printAssertionSet( assertions, std::cout, 8 );
@@ -418,151 +393,133 @@
 ///   assert->print( std::cout );
 ///   std::cout << std::endl;
-  AssertionSet::iterator i = assertions.find( assert );
-  if( i != assertions.end() ) {
+		AssertionSet::iterator i = assertions.find( assert );
+		if ( i != assertions.end() ) {
 ///     std::cout << "found it!" << std::endl;
-    i->second = true;
-  }
-}
-
-void
-markAssertions( AssertionSet &assertion1, AssertionSet &assertion2, Type *type )
-{
-  for( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
-    for( std::list< DeclarationWithType* >::const_iterator assert = (*tyvar)->get_assertions().begin(); assert != (*tyvar)->get_assertions().end(); ++assert ) {
-      markAssertionSet( assertion1, *assert );
-      markAssertionSet( assertion2, *assert );
-    }
-  }
-}
-
-void 
-Unify::visit(PointerType *pointerType)
-{
-  if( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) {
-    result = unifyExact( pointerType->get_base(), otherPointer->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
-    markAssertions( haveAssertions, needAssertions, pointerType );
-    markAssertions( haveAssertions, needAssertions, otherPointer );
-  }
-}
-
-void 
-Unify::visit(ArrayType *arrayType)
-{
-  // XXX -- compare array dimension
-  ArrayType *otherArray = dynamic_cast< ArrayType* >( type2 );
-  if( otherArray && arrayType->get_isVarLen() == otherArray->get_isVarLen() ) {
-    result = unifyExact( arrayType->get_base(), otherArray->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
-  }
-}
-
-template< typename Iterator1, typename Iterator2 >
-bool
-unifyDeclList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, const SymTab::Indexer &indexer ) {
-  for( ; list1Begin != list1End && list2Begin != list2End; ++list1Begin, ++list2Begin ) {
-    if( !unifyExact( (*list1Begin)->get_type(), (*list2Begin)->get_type(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer ) ) {
-      return false;
-    }
-  }
-  if( list1Begin != list1End || list2Begin != list2End ) {
-    return false;
-  } else {
-    return true;
-  }
-}
-
-void 
-Unify::visit(FunctionType *functionType)
-{
-  FunctionType *otherFunction = dynamic_cast< FunctionType* >( type2 );
-  if( otherFunction && functionType->get_isVarArgs() == otherFunction->get_isVarArgs() ) {
-  
-    if( unifyDeclList( functionType->get_parameters().begin(), functionType->get_parameters().end(), otherFunction->get_parameters().begin(), otherFunction->get_parameters().end(), env, needAssertions, haveAssertions, openVars, indexer ) ) {
-    
-      if( unifyDeclList( functionType->get_returnVals().begin(), functionType->get_returnVals().end(), otherFunction->get_returnVals().begin(), otherFunction->get_returnVals().end(), env, needAssertions, haveAssertions, openVars, indexer ) ) {
-
-        markAssertions( haveAssertions, needAssertions, functionType );
-        markAssertions( haveAssertions, needAssertions, otherFunction );
-
-        result = true;
-      }
-    }
-  }
-}
-
-template< typename RefType >
-void
-Unify::handleRefType( RefType *inst, Type *other )
-{  
-  RefType *otherStruct = dynamic_cast< RefType* >( other );
-  result = otherStruct && inst->get_name() == otherStruct->get_name();
-}  
-
-void 
-Unify::visit(StructInstType *structInst)
-{
-  handleRefType( structInst, type2 );
-}
-
-void 
-Unify::visit(UnionInstType *unionInst)
-{
-  handleRefType( unionInst, type2 );
-}
-
-void 
-Unify::visit(EnumInstType *enumInst)
-{
-  handleRefType( enumInst, type2 );
-}
-
-void 
-Unify::visit(ContextInstType *contextInst)
-{
-  handleRefType( contextInst, type2 );
-}
-
-void 
-Unify::visit(TypeInstType *typeInst)
-{
-  assert( openVars.find( typeInst->get_name() ) == openVars.end() );
-  TypeInstType *otherInst = dynamic_cast< TypeInstType* >( type2 );
-  if( otherInst && typeInst->get_name() == otherInst->get_name() ) {
-    result = true;
+			i->second = true;
+		} // if
+	}
+
+	void markAssertions( AssertionSet &assertion1, AssertionSet &assertion2, Type *type ) {
+		for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
+			for ( std::list< DeclarationWithType* >::const_iterator assert = (*tyvar)->get_assertions().begin(); assert != (*tyvar)->get_assertions().end(); ++assert ) {
+				markAssertionSet( assertion1, *assert );
+				markAssertionSet( assertion2, *assert );
+			} // for
+		} // for
+	}
+
+	void Unify::visit(PointerType *pointerType) {
+		if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) {
+			result = unifyExact( pointerType->get_base(), otherPointer->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+			markAssertions( haveAssertions, needAssertions, pointerType );
+			markAssertions( haveAssertions, needAssertions, otherPointer );
+		} // if
+	}
+
+	void Unify::visit(ArrayType *arrayType) {
+		// XXX -- compare array dimension
+		ArrayType *otherArray = dynamic_cast< ArrayType* >( type2 );
+		if ( otherArray && arrayType->get_isVarLen() == otherArray->get_isVarLen() ) {
+			result = unifyExact( arrayType->get_base(), otherArray->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+		} // if
+	}
+
+	template< typename Iterator1, typename Iterator2 >
+	bool unifyDeclList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, const SymTab::Indexer &indexer ) {
+		for ( ; list1Begin != list1End && list2Begin != list2End; ++list1Begin, ++list2Begin ) {
+			if ( ! unifyExact( (*list1Begin)->get_type(), (*list2Begin)->get_type(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer ) ) {
+				return false;
+			} // if
+		} // for
+		if ( list1Begin != list1End || list2Begin != list2End ) {
+			return false;
+		} else {
+			return true;
+		} // if
+	}
+
+	void Unify::visit(FunctionType *functionType) {
+		FunctionType *otherFunction = dynamic_cast< FunctionType* >( type2 );
+		if ( otherFunction && functionType->get_isVarArgs() == otherFunction->get_isVarArgs() ) {
+  
+			if ( unifyDeclList( functionType->get_parameters().begin(), functionType->get_parameters().end(), otherFunction->get_parameters().begin(), otherFunction->get_parameters().end(), env, needAssertions, haveAssertions, openVars, indexer ) ) {
+	
+				if ( unifyDeclList( functionType->get_returnVals().begin(), functionType->get_returnVals().end(), otherFunction->get_returnVals().begin(), otherFunction->get_returnVals().end(), env, needAssertions, haveAssertions, openVars, indexer ) ) {
+
+					markAssertions( haveAssertions, needAssertions, functionType );
+					markAssertions( haveAssertions, needAssertions, otherFunction );
+
+					result = true;
+				} // if
+			} // if
+		} // if
+	}
+
+	template< typename RefType >
+	void Unify::handleRefType( RefType *inst, Type *other ) {  
+		RefType *otherStruct = dynamic_cast< RefType* >( other );
+		result = otherStruct && inst->get_name() == otherStruct->get_name();
+	}  
+
+	void Unify::visit(StructInstType *structInst) {
+		handleRefType( structInst, type2 );
+	}
+
+	void Unify::visit(UnionInstType *unionInst) {
+		handleRefType( unionInst, type2 );
+	}
+
+	void Unify::visit(EnumInstType *enumInst) {
+		handleRefType( enumInst, type2 );
+	}
+
+	void Unify::visit(ContextInstType *contextInst) {
+		handleRefType( contextInst, type2 );
+	}
+
+	void Unify::visit(TypeInstType *typeInst) {
+		assert( openVars.find( typeInst->get_name() ) == openVars.end() );
+		TypeInstType *otherInst = dynamic_cast< TypeInstType* >( type2 );
+		if ( otherInst && typeInst->get_name() == otherInst->get_name() ) {
+			result = true;
 ///   } else {
 ///     NamedTypeDecl *nt = indexer.lookupType( typeInst->get_name() );
-///     if( nt ) {
+///     if ( nt ) {
 ///       TypeDecl *type = dynamic_cast< TypeDecl* >( nt );
 ///       assert( type );
-///       if( type->get_base() ) {
+///       if ( type->get_base() ) {
 ///         result = unifyExact( type->get_base(), typeInst, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
 ///       }
 ///     }
-  }
-}
-
-template< typename Iterator1, typename Iterator2 >
-bool
-unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) {
-  for( ; list1Begin != list1End && list2Begin != list2End; ++list1Begin, ++list2Begin ) {
-    Type *commonType = 0;
-    if( !unifyInexact( *list1Begin, *list2Begin, env, needAssertions, haveAssertions, openVars, widenMode, indexer, commonType ) ) {
-      return false;
-    }
-    delete commonType;
-  }
-  if( list1Begin != list1End || list2Begin != list2End ) {
-    return false;
-  } else {
-    return true;
-  }
-}
-
-void 
-Unify::visit(TupleType *tupleType)
-{
-  if( TupleType *otherTuple = dynamic_cast< TupleType* >( type2 ) ) {
-    result = unifyList( tupleType->get_types().begin(), tupleType->get_types().end(), otherTuple->get_types().begin(), otherTuple->get_types().end(), env, needAssertions, haveAssertions, openVars, widenMode, indexer );
-  }
-}
+		} // if
+	}
+
+	template< typename Iterator1, typename Iterator2 >
+	bool unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) {
+		for ( ; list1Begin != list1End && list2Begin != list2End; ++list1Begin, ++list2Begin ) {
+			Type *commonType = 0;
+			if ( ! unifyInexact( *list1Begin, *list2Begin, env, needAssertions, haveAssertions, openVars, widenMode, indexer, commonType ) ) {
+				return false;
+			}
+			delete commonType;
+		} // for
+		if ( list1Begin != list1End || list2Begin != list2End ) {
+			return false;
+		} else {
+			return true;
+		} //if
+	}
+
+	void Unify::visit(TupleType *tupleType) {
+		if ( TupleType *otherTuple = dynamic_cast< TupleType* >( type2 ) ) {
+			result = unifyList( tupleType->get_types().begin(), tupleType->get_types().end(), otherTuple->get_types().begin(), otherTuple->get_types().end(), env, needAssertions, haveAssertions, openVars, widenMode, indexer );
+		} // if
+	}
 
 } // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/Unify.h
===================================================================
--- translator/ResolvExpr/Unify.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/Unify.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,8 +1,16 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: Unify.h,v 1.4 2005/08/29 20:14:16 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Unify.h -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 13:09:04 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 13:10:34 2015
+// Update Count     : 2
+//
 
 #ifndef UNIFY_H
@@ -19,39 +27,42 @@
 
 namespace ResolvExpr {
+	bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer );
+	bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, Type *&commonType );
+	bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer );
 
-bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer );
-bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, Type *&commonType );
-bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer );
+	template< typename Iterator1, typename Iterator2 >
+	bool unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, std::list< Type* > &commonTypes ) {
+		for ( ; list1Begin != list1End && list2Begin != list2End; ++list1Begin, ++list2Begin ) {
+			Type *commonType = 0;
+			if ( ! unify( *list1Begin, *list2Begin, env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) {
+				return false;
+			} // if
+			commonTypes.push_back( commonType );
+		} // for
+		if ( list1Begin != list1End || list2Begin != list2End ) {
+			return false;
+		} else {
+			return true;
+		} // if
+	}
 
-template< typename Iterator1, typename Iterator2 >
-bool
-unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, std::list< Type* > &commonTypes ) {
-  for( ; list1Begin != list1End && list2Begin != list2End; ++list1Begin, ++list2Begin ) {
-    Type *commonType = 0;
-    if( !unify( *list1Begin, *list2Begin, env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) {
-      return false;
-    }
-    commonTypes.push_back( commonType );
-  }
-  if( list1Begin != list1End || list2Begin != list2End ) {
-    return false;
-  } else {
-    return true;
-  }
-}
-
-template< typename Iterator1, typename Iterator2 >
-bool
-unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ) {
-  std::list< Type* > commonTypes;
-  if( unifyList( list1Begin, list1End, list2Begin, list2End, env, needAssertions, haveAssertions, openVars, indexer, commonTypes ) ) {
-    deleteAll( commonTypes );
-    return true;
-  } else {
-    return false;
-  }
-}
+	template< typename Iterator1, typename Iterator2 >
+	bool unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ) {
+		std::list< Type* > commonTypes;
+		if ( unifyList( list1Begin, list1End, list2Begin, list2End, env, needAssertions, haveAssertions, openVars, indexer, commonTypes ) ) {
+			deleteAll( commonTypes );
+			return true;
+		} else {
+			return false;
+		} // if
+	}
 
 } // namespace ResolvExpr
 
-#endif /* #ifndef UNIFY_H */
+#endif // UNIFY_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/ResolvExpr/typeops.h
===================================================================
--- translator/ResolvExpr/typeops.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/ResolvExpr/typeops.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,8 +1,16 @@
-/*
- * This file is part of the Cforall project
- *
- * $Id: typeops.h,v 1.14 2005/08/29 20:14:17 rcbilson Exp $
- *
- */
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// typeops.h -- 
+//
+// Author           : Richard C. Bilson
+// Created On       : Sun May 17 07:28:22 2015
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Sun May 17 07:33:11 2015
+// Update Count     : 2
+//
 
 #ifndef TYPEOPS_H
@@ -16,146 +24,137 @@
 
 namespace ResolvExpr {
+	// combos: takes a list of sets and returns a set of lists representing every possible way of forming a list by
+	// picking one element out of each set
+	template< typename InputIterator, typename OutputIterator >
+	void combos( InputIterator begin, InputIterator end, OutputIterator out ) {
+		typedef typename InputIterator::value_type SetType;
+		typedef typename std::list< typename SetType::value_type > ListType;
+  
+		if ( begin == end )	{
+			*out++ = ListType();
+			return;
+		} // if
+  
+		InputIterator current = begin;
+		begin++;
 
-// combos: takes a list of sets and returns a set of lists representing
-// every possible way of forming a list by picking one element out of each set
-template< typename InputIterator, typename OutputIterator >
-void
-combos( InputIterator begin, InputIterator end, OutputIterator out )
-{
-  typedef typename InputIterator::value_type SetType;
-  typedef typename std::list< typename SetType::value_type > ListType;
+		std::list< ListType > recursiveResult;
+		combos( begin, end, back_inserter( recursiveResult ) );
   
-  if( begin == end )
-  {
-    *out++ = ListType();
-    return;
-  }
+		for ( typename std::list< ListType >::const_iterator i = recursiveResult.begin(); i != recursiveResult.end(); ++i ) {
+			for ( typename ListType::const_iterator j = current->begin(); j != current->end(); ++j ) {
+				ListType result;
+				std::back_insert_iterator< ListType > inserter = back_inserter( result );
+				*inserter++ = *j;
+				std::copy( i->begin(), i->end(), inserter );
+				*out++ = result;
+			} // for
+		} // for
+	}
   
-  InputIterator current = begin;
-  begin++;
+	// in AdjustExprType.cc
+	void adjustExprType( Type *&type, const TypeEnvironment &env, const SymTab::Indexer &indexer );
 
-  std::list< ListType > recursiveResult;
-  combos( begin, end, back_inserter( recursiveResult ) );
-  
-  for( typename std::list< ListType >::const_iterator i = recursiveResult.begin(); i != recursiveResult.end(); ++i ) {
-    for( typename ListType::const_iterator j = current->begin(); j != current->end(); ++j ) {
-      ListType result;
-      std::back_insert_iterator< ListType > inserter = back_inserter( result );
-      *inserter++ = *j;
-      std::copy( i->begin(), i->end(), inserter );
-      *out++ = result;
-    }
-  }
-}
-  
-// in AdjustExprType.cc
-void adjustExprType( Type *&type, const TypeEnvironment &env, const SymTab::Indexer &indexer );
+	template< typename ForwardIterator >
+	void adjustExprTypeList( ForwardIterator begin, ForwardIterator end, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
+		while ( begin != end ) {
+			adjustExprType( *begin++, env, indexer );
+		} // while
+	}
 
-template< typename ForwardIterator >
-void
-adjustExprTypeList( ForwardIterator begin, ForwardIterator end, const TypeEnvironment &env, const SymTab::Indexer &indexer )
-{
-  while( begin != end ) {
-    adjustExprType( *begin++, env, indexer );
-  }
-}
+	// in CastCost.cc
+	Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
 
-// in CastCost.cc
-Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
+	template< typename SrcIterator, typename DestIterator >
+	Cost castCostList( SrcIterator srcBegin, SrcIterator srcEnd, DestIterator destBegin, DestIterator destEnd, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
+		Cost ret;
+		if ( destBegin == destEnd ) {
+			if ( srcBegin == srcEnd ) {
+				return Cost::zero;
+			} else {
+				return Cost( 0, 0, 1 );
+			} // if
+		} // if
+		while ( srcBegin != srcEnd && destBegin != destEnd ) {
+			Cost thisCost = castCost( *srcBegin++, *destBegin++, indexer, env );
+			if ( thisCost == Cost::infinity ) {
+				return Cost::infinity;
+			} // if
+			ret += thisCost;
+		} // while
+		if ( srcBegin == srcEnd && destBegin == destEnd ) {
+			return ret;
+		} else {
+			return Cost::infinity;
+		} // if
+	}
 
-template< typename SrcIterator, typename DestIterator >
-Cost
-castCostList( SrcIterator srcBegin, SrcIterator srcEnd, DestIterator destBegin, DestIterator destEnd, const SymTab::Indexer &indexer, const TypeEnvironment &env )
-{
-  Cost ret;
-  if( destBegin == destEnd ) {
-    if( srcBegin == srcEnd ) {
-      return Cost::zero;
-    } else {
-      return Cost( 0, 0, 1 );
-    }
-  }
-  while( srcBegin != srcEnd && destBegin != destEnd ) {
-    Cost thisCost = castCost( *srcBegin++, *destBegin++, indexer, env );
-    if( thisCost == Cost::infinity ) {
-      return Cost::infinity;
-    }
-    ret += thisCost;
-  }
-  if( srcBegin == srcEnd && destBegin == destEnd ) {
-    return ret;
-  } else {
-    return Cost::infinity;
-  }
-}
+	// in ConversionCost.cc
+	Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
 
-// in ConversionCost.cc
-Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
+	template< typename SrcIterator, typename DestIterator >
+	Cost conversionCostList( SrcIterator srcBegin, SrcIterator srcEnd, DestIterator destBegin, DestIterator destEnd, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
+		Cost ret;
+		while ( srcBegin != srcEnd && destBegin != destEnd ) {
+			Cost thisCost = conversionCost( *srcBegin++, *destBegin++, indexer, env );
+			if ( thisCost == Cost::infinity ) {
+				return Cost::infinity;
+			} // if
+			ret += thisCost;
+		} // while
+		if ( srcBegin == srcEnd && destBegin == destEnd ) {
+			return ret;
+		} else {
+			return Cost::infinity;
+		} // if
+	}
 
-template< typename SrcIterator, typename DestIterator >
-Cost
-conversionCostList( SrcIterator srcBegin, SrcIterator srcEnd, DestIterator destBegin, DestIterator destEnd, const SymTab::Indexer &indexer, const TypeEnvironment &env )
-{
-  Cost ret;
-  while( srcBegin != srcEnd && destBegin != destEnd ) {
-    Cost thisCost = conversionCost( *srcBegin++, *destBegin++, indexer, env );
-    if( thisCost == Cost::infinity ) {
-      return Cost::infinity;
-    }
-    ret += thisCost;
-  }
-  if( srcBegin == srcEnd && destBegin == destEnd ) {
-    return ret;
-  } else {
-    return Cost::infinity;
-  }
-}
+	// in PtrsAssignable.cc
+	int ptrsAssignable( Type *src, Type *dest, const TypeEnvironment &env );
 
-// in PtrsAssignable.cc
-int ptrsAssignable( Type *src, Type *dest, const TypeEnvironment &env );
+	// in PtrsCastable.cc
+	int ptrsCastable( Type *src, Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer );
 
-// in PtrsCastable.cc
-int ptrsCastable( Type *src, Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer );
+	// in Unify.cc
+	bool typesCompatible( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );
+	bool typesCompatibleIgnoreQualifiers( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );
 
-// in Unify.cc
-bool typesCompatible( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );
-bool typesCompatibleIgnoreQualifiers( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );
+	inline bool typesCompatible( Type *t1, Type *t2, const SymTab::Indexer &indexer ) {
+		TypeEnvironment env;
+		return typesCompatible( t1, t2, indexer, env );
+	}
 
-inline bool typesCompatible( Type *t1, Type *t2, const SymTab::Indexer &indexer )
-{
-  TypeEnvironment env;
-  return typesCompatible( t1, t2, indexer, env );
-}
+	inline bool typesCompatibleIgnoreQualifiers( Type *t1, Type *t2, const SymTab::Indexer &indexer ) {
+		TypeEnvironment env;
+		return typesCompatibleIgnoreQualifiers( t1, t2, indexer, env );
+	}
 
-inline bool typesCompatibleIgnoreQualifiers( Type *t1, Type *t2, const SymTab::Indexer &indexer )
-{
-  TypeEnvironment env;
-  return typesCompatibleIgnoreQualifiers( t1, t2, indexer, env );
-}
+	template< typename Container1, typename Container2 >
+	bool typesCompatibleList( Container1 &c1, Container2 &c2, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
+		typename Container1::iterator i1 = c1.begin();
+		typename Container2::iterator i2 = c2.begin();
+		for ( ; i1 != c1.end() && i2 != c2.end(); ++i1, ++i2 ) {
+			if ( ! typesCompatible( *i1, *i2, indexer ) ) {
+				return false;
+			} // if
+		}
+		return ( i1 == c1.end() ) && ( i2 == c2.end() );
+	}
 
-template< typename Container1, typename Container2 >
-bool
-typesCompatibleList( Container1 &c1, Container2 &c2, const SymTab::Indexer &indexer, const TypeEnvironment &env )
-{
-  typename Container1::iterator i1 = c1.begin();
-  typename Container2::iterator i2 = c2.begin();
-  for( ; i1 != c1.end() && i2 != c2.end(); ++i1, ++i2 ) {
-    if( !typesCompatible( *i1, *i2, indexer ) ) {
-      return false;
-    }
-  }
-  return ( i1 == c1.end() ) && ( i2 == c2.end() );
-}
+	// in CommonType.cc
+	Type *commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars );
 
-// in CommonType.cc
-Type *commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars );
+	// in PolyCost.cc
+	int polyCost( Type *type, const TypeEnvironment &env, const SymTab::Indexer &indexer );
 
-// in PolyCost.cc
-int polyCost( Type *type, const TypeEnvironment &env, const SymTab::Indexer &indexer );
-
-// in Occurs.cc
-bool occurs( Type *type, std::string varName, const TypeEnvironment &env );
-
+	// in Occurs.cc
+	bool occurs( Type *type, std::string varName, const TypeEnvironment &env );
 } // namespace ResolvExpr
 
-#endif /* #ifndef TYPEOPS_H */
+#endif // TYPEOPS_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: translator/SymTab/AddVisit.h
===================================================================
--- translator/SymTab/AddVisit.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SymTab/AddVisit.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -15,5 +15,5 @@
 addVisitStatementList( std::list< Statement* > &statements, Visitor &visitor )
 {
-  for( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) {
+  for ( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) {
     addDecls( visitor.get_declsToAdd(), statements, i );
     (*i)->accept( visitor );
@@ -27,5 +27,5 @@
 {
   maybeAccept( stmt, visitor );
-///   if( !declsToAdd.empty() ) {
+///   if ( ! declsToAdd.empty() ) {
 ///     CompoundStmt *compound = new CompoundStmt( noLabels );
 ///     compound->get_kids().push_back( stmt );
Index: translator/SymTab/AggregateTable.h
===================================================================
--- translator/SymTab/AggregateTable.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SymTab/AggregateTable.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -25,7 +25,7 @@
   AggregateDeclClass *operator()( AggregateDeclClass *existing, AggregateDeclClass *added )
   {
-    if( existing->get_members().empty() ) {
+    if ( existing->get_members().empty() ) {
       return added;
-    } else if( !added->get_members().empty() ) {
+    } else if ( ! added->get_members().empty() ) {
       throw SemanticError( "redeclaration of ", added );
     }
Index: translator/SymTab/IdTable.cc
===================================================================
--- translator/SymTab/IdTable.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SymTab/IdTable.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -33,8 +33,8 @@
 IdTable::leaveScope()
 {
-  for( OuterTableType::iterator outer = table.begin(); outer != table.end(); ++outer ) {
-    for( InnerTableType::iterator inner = outer->second.begin(); inner != outer->second.end(); ++inner ) {
+  for ( OuterTableType::iterator outer = table.begin(); outer != table.end(); ++outer ) {
+    for ( InnerTableType::iterator inner = outer->second.begin(); inner != outer->second.end(); ++inner ) {
       std::stack< DeclEntry >& entry = inner->second;
-      if( !entry.empty() && entry.top().second == scopeLevel ) {
+      if ( ! entry.empty() && entry.top().second == scopeLevel ) {
         entry.pop();
       }
@@ -51,5 +51,5 @@
   const string &name = decl->get_name();
   string manglename;
-  if( decl->get_linkage() == LinkageSpec::C ) {
+  if ( decl->get_linkage() == LinkageSpec::C ) {
     manglename = name;
   } else {
@@ -58,18 +58,18 @@
   InnerTableType &declTable = table[ name ];
   InnerTableType::iterator it = declTable.find( manglename );
-  if( it == declTable.end() ) {
+  if ( it == declTable.end() ) {
     declTable[ manglename ].push( DeclEntry( decl, scopeLevel ) );
   } else {
     std::stack< DeclEntry >& entry = it->second;
-    if( !entry.empty() && entry.top().second == scopeLevel ) {
-      if( decl->get_linkage() != LinkageSpec::C || ResolvExpr::typesCompatible( decl->get_type(), entry.top().first->get_type(), Indexer() ) ) {
+    if ( ! entry.empty() && entry.top().second == scopeLevel ) {
+      if ( decl->get_linkage() != LinkageSpec::C || ResolvExpr::typesCompatible( decl->get_type(), entry.top().first->get_type(), Indexer() ) ) {
         FunctionDecl *newentry = dynamic_cast< FunctionDecl* >( decl );
         FunctionDecl *old = dynamic_cast< FunctionDecl* >( entry.top().first );
-        if( newentry && old && newentry->get_statements() && old->get_statements() ) {
+        if ( newentry && old && newentry->get_statements() && old->get_statements() ) {
           throw SemanticError( "duplicate function definition for ", decl );
         } else {
           ObjectDecl *newobj = dynamic_cast< ObjectDecl* >( decl );
           ObjectDecl *oldobj = dynamic_cast< ObjectDecl* >( entry.top().first );
-          if( newobj && oldobj && newobj->get_init() && oldobj->get_init() ) {
+          if ( newobj && oldobj && newobj->get_init() && oldobj->get_init() ) {
             throw SemanticError( "duplicate definition for ", decl );
           }
@@ -83,9 +83,9 @@
   }
   // ensure the set of routines with C linkage cannot be overloaded
-  for( InnerTableType::iterator i = declTable.begin(); i != declTable.end(); ++i ) {
-    if( !i->second.empty() && i->second.top().first->get_linkage() == LinkageSpec::C && declTable.size() > 1 ) {
+  for ( InnerTableType::iterator i = declTable.begin(); i != declTable.end(); ++i ) {
+    if ( ! i->second.empty() && i->second.top().first->get_linkage() == LinkageSpec::C && declTable.size() > 1 ) {
 	InnerTableType::iterator j = i;
-	for( j++; j != declTable.end(); ++j ) {
-	  if( !j->second.empty() && j->second.top().first->get_linkage() == LinkageSpec::C ) {
+	for ( j++; j != declTable.end(); ++j ) {
+	  if ( ! j->second.empty() && j->second.top().first->get_linkage() == LinkageSpec::C ) {
 	    throw SemanticError( "invalid overload of C function " );
 	  }
@@ -99,9 +99,9 @@
 {
   OuterTableType::const_iterator outer = table.find( id );
-  if( outer == table.end() ) return;
+  if ( outer == table.end() ) return;
   const InnerTableType &declTable = outer->second;
-  for( InnerTableType::const_iterator it = declTable.begin(); it != declTable.end(); ++it ) {
+  for ( InnerTableType::const_iterator it = declTable.begin(); it != declTable.end(); ++it ) {
     const std::stack< DeclEntry >& entry = it->second;
-    if( !entry.empty() ) {
+    if ( ! entry.empty() ) {
       decls.push_back( entry.top().first );
     }
@@ -114,9 +114,9 @@
 
    OuterTableType::const_iterator outer = table.find( id );
-   if( outer == table.end() ) return 0;
+   if ( outer == table.end() ) return 0;
    const InnerTableType &declTable = outer->second;
-   for( InnerTableType::const_iterator it = declTable.begin(); it != declTable.end(); ++it ) {
+   for ( InnerTableType::const_iterator it = declTable.begin(); it != declTable.end(); ++it ) {
      const std::stack< DeclEntry >& entry = it->second;
-     if( !entry.empty() && entry.top().second > depth ) {
+     if ( ! entry.empty() && entry.top().second > depth ) {
        result = entry.top().first;
        depth = entry.top().second;
@@ -129,9 +129,9 @@
 IdTable::dump( std::ostream &os ) const
 {
-  for( OuterTableType::const_iterator outer = table.begin(); outer != table.end(); ++outer ) {
-    for( InnerTableType::const_iterator inner = outer->second.begin(); inner != outer->second.end(); ++inner ) {
+  for ( OuterTableType::const_iterator outer = table.begin(); outer != table.end(); ++outer ) {
+    for ( InnerTableType::const_iterator inner = outer->second.begin(); inner != outer->second.end(); ++inner ) {
 #if 0
       const std::stack< DeclEntry >& entry = inner->second;
-      if( !entry.empty() ) { // && entry.top().second == scopeLevel ) {
+      if ( ! entry.empty() ) { // && entry.top().second == scopeLevel ) {
         os << outer->first << " (" << inner->first << ") (" << entry.top().second << ")" << std::endl;
       } else {
@@ -142,5 +142,5 @@
       std::stack<DeclEntry> stack = inner->second;
       os << "dumping a stack" << std::endl;
-      while (!stack.empty()) {
+      while (! stack.empty()) {
         DeclEntry d = stack.top();
         os << outer->first << " (" << inner->first << ") (" << d.second << ") " << std::endl;
@@ -151,8 +151,8 @@
   }
 #if 0
-  for( OuterTableType::const_iterator outer = table.begin(); outer != table.end(); ++outer ) {
-    for( InnerTableType::const_iterator inner = outer->second.begin(); inner != outer->second.end(); ++inner ) {
+  for ( OuterTableType::const_iterator outer = table.begin(); outer != table.end(); ++outer ) {
+    for ( InnerTableType::const_iterator inner = outer->second.begin(); inner != outer->second.end(); ++inner ) {
       const std::stack< DeclEntry >& entry = inner->second;
-      if( !entry.empty() && entry.top().second == scopeLevel ) {
+      if ( ! entry.empty() && entry.top().second == scopeLevel ) {
         os << outer->first << " (" << inner->first << ") (" << scopeLevel << ")" << std::endl;
       }
Index: translator/SymTab/ImplementationType.cc
===================================================================
--- translator/SymTab/ImplementationType.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SymTab/ImplementationType.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -45,5 +45,5 @@
   ImplementationType implementor( indexer );
   type->accept( implementor );
-  if( implementor.get_result() == 0 ) {
+  if ( implementor.get_result() == 0 ) {
     return type->clone();
   } else {
@@ -87,8 +87,8 @@
 {
 ///   FunctionType *newType = functionType->clone();
-///   for( std::list< DeclarationWithType* >::iterator i = newType->get_parameters().begin(); i != newType->get_parameters().end(); ++i ) {
+///   for ( std::list< DeclarationWithType* >::iterator i = newType->get_parameters().begin(); i != newType->get_parameters().end(); ++i ) {
 ///     i->set_type( implementationType( i->get_type(), indexer ) );
 ///   }
-///   for( std::list< DeclarationWithType* >::iterator i = newType->get_parameters().begin(); i != newType->get_parameters().end(); ++i ) {
+///   for ( std::list< DeclarationWithType* >::iterator i = newType->get_parameters().begin(); i != newType->get_parameters().end(); ++i ) {
 ///     i->set_type( implementationType( i->get_type(), indexer ) );
 ///   }
@@ -119,5 +119,5 @@
 {
   NamedTypeDecl *typeDecl = indexer.lookupType( inst->get_name() );
-  if( typeDecl && typeDecl->get_base() ) {
+  if ( typeDecl && typeDecl->get_base() ) {
     Type *base = implementationType( typeDecl->get_base(), indexer );
     base->get_qualifiers() += inst->get_qualifiers();
@@ -130,5 +130,5 @@
 {
   TupleType *newType = new TupleType( Type::Qualifiers() );
-  for( std::list< Type* >::iterator i = tupleType->get_types().begin(); i != tupleType->get_types().end(); ++i ) {
+  for ( std::list< Type* >::iterator i = tupleType->get_types().begin(); i != tupleType->get_types().end(); ++i ) {
     Type *implType = implementationType( *i, indexer );
     implType->get_qualifiers() += tupleType->get_qualifiers();
Index: translator/SymTab/ImplementationType.h
===================================================================
--- translator/SymTab/ImplementationType.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SymTab/ImplementationType.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -20,5 +20,5 @@
 implementationTypeList( InputIterator begin, InputIterator end, OutputIterator out, const SymTab::Indexer &indexer )
 {
-  while( begin != end ) {
+  while ( begin != end ) {
     *out++ = implementationType( *begin++, indexer );
   }
Index: translator/SymTab/Mangler.cc
===================================================================
--- translator/SymTab/Mangler.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SymTab/Mangler.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -184,5 +184,5 @@
 
     void Mangler::printQualifiers( Type *type ) {
-	if ( !type->get_forall().empty() ) {
+	if ( ! type->get_forall().empty() ) {
 	    std::list< std::string > assertionNames;
 	    int tcount = 0, dcount = 0, fcount = 0;
Index: translator/SymTab/StackTable.cc
===================================================================
--- translator/SymTab/StackTable.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SymTab/StackTable.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -17,5 +17,5 @@
 	for ( typename TableType::iterator it = table.begin(); it != table.end(); ++it ) {
 	    std::stack< Entry >& entry = it->second;
-	    if ( !entry.empty() && entry.top().second == scopeLevel ) {
+	    if ( ! entry.empty() && entry.top().second == scopeLevel ) {
 		entry.pop();
 	    }
@@ -28,5 +28,5 @@
     void StackTable< Element, ConflictFunction >::add( Element *type ) {
 	std::stack< Entry >& entry = table[ type->get_name() ];
-	if ( !entry.empty() && entry.top().second == scopeLevel ) {
+	if ( ! entry.empty() && entry.top().second == scopeLevel ) {
 	    entry.top().first = conflictFunction( entry.top().first, type );
 	} else {
@@ -45,5 +45,5 @@
 	if ( it == table.end() ) {
 	    return 0;
-	} else if ( !it->second.empty() ) {
+	} else if ( ! it->second.empty() ) {
 	    return it->second.top().first;
 	} else {
@@ -56,5 +56,5 @@
 	for ( typename TableType::const_iterator it = table.begin(); it != table.end(); ++it ) {
 	    const std::stack< Entry >& entry = it->second;
-	    if ( !entry.empty() && entry.top().second == scopeLevel ) {
+	    if ( ! entry.empty() && entry.top().second == scopeLevel ) {
 		os << it->first << std::endl;
 	    }
Index: translator/SymTab/TypeTable.h
===================================================================
--- translator/SymTab/TypeTable.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SymTab/TypeTable.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -17,5 +17,5 @@
 	    if ( existing->get_base() == 0 ) {
 		return added;
-	    } else if( added->get_base() == 0 ) {
+	    } else if ( added->get_base() == 0 ) {
 		return existing;
 	    } else {
Index: translator/SynTree/AddressExpr.cc
===================================================================
--- translator/SynTree/AddressExpr.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/AddressExpr.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -14,5 +14,5 @@
     : Expression( _aname ), arg( arg )
 {
-    for( std::list< Type* >::const_iterator i = arg->get_results().begin(); i != arg->get_results().end(); ++i ) {
+    for ( std::list< Type* >::const_iterator i = arg->get_results().begin(); i != arg->get_results().end(); ++i ) {
 	get_results().push_back( new PointerType( Type::Qualifiers(), (*i)->clone() ) );
     }
@@ -33,5 +33,5 @@
 {
     os << std::string( indent, ' ' ) << "Address of:" << std::endl;
-    if( arg ) {
+    if ( arg ) {
 	arg->print( os, indent+2 );
     }
Index: translator/SynTree/AggregateDecl.cc
===================================================================
--- translator/SynTree/AggregateDecl.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/AggregateDecl.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -36,9 +36,9 @@
 
     os << typeString() << " " << get_name();
-    if( !parameters.empty() ) {
+    if ( ! parameters.empty() ) {
 	os << endl << string( indent+2, ' ' ) << "with parameters" << endl;
 	printAll( parameters, os, indent+4 );
     }
-    if( !members.empty() ) {
+    if ( ! members.empty() ) {
 	os << endl << string( indent+2, ' ' ) << "with members" << endl;
 	printAll( members, os, indent+4 );
@@ -53,5 +53,5 @@
 
     os << typeString() << " " << get_name();
-    if( !parameters.empty() ) {
+    if ( ! parameters.empty() ) {
 	os << endl << string( indent+2, ' ' ) << "with parameters" << endl;
 	printAll( parameters, os, indent+4 );
Index: translator/SynTree/ApplicationExpr.cc
===================================================================
--- translator/SynTree/ApplicationExpr.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/ApplicationExpr.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -16,5 +16,5 @@
 ParamEntry::operator=( const ParamEntry &other )
 {
-    if( &other == this ) return *this;
+    if ( &other == this ) return *this;
     decl = other.decl;
     actualType = maybeClone( other.actualType );
@@ -39,5 +39,5 @@
     assert( function );
     
-    for( std::list< DeclarationWithType* >::const_iterator i = function->get_returnVals().begin(); i != function->get_returnVals().end(); ++i ) {
+    for ( std::list< DeclarationWithType* >::const_iterator i = function->get_returnVals().begin(); i != function->get_returnVals().end(); ++i ) {
 	get_results().push_back( (*i)->get_type()->clone() );
     }
@@ -61,11 +61,11 @@
     os << std::string( indent, ' ' ) << "Application of" << std::endl;
     function->print( os, indent+2 );
-    if( !args.empty() ) {
+    if ( ! args.empty() ) {
 	os << std::string( indent, ' ' ) << "to arguments" << std::endl;
 	printAll( args, os, indent+2 );
     }
-    if( !inferParams.empty() ) {
+    if ( ! inferParams.empty() ) {
 	os << std::string(indent, ' ') << "with inferred parameters:" << std::endl;
-	for( InferredParams::const_iterator i = inferParams.begin(); i != inferParams.end(); ++i ) {
+	for ( InferredParams::const_iterator i = inferParams.begin(); i != inferParams.end(); ++i ) {
 	    os << std::string(indent+2, ' ');
 	    Declaration::declFromId( i->second.decl )->printShort( os, indent+2 );
Index: translator/SynTree/ArrayType.cc
===================================================================
--- translator/SynTree/ArrayType.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/ArrayType.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -33,10 +33,10 @@
 {
     Type::print( os, indent );
-    if( isStatic ) {
+    if ( isStatic ) {
 	os << "static ";
     }
-    if( isVarLen ) {
+    if ( isVarLen ) {
 	os << "variable length array of ";
-    } else if( dimension ) {
+    } else if ( dimension ) {
 	os << "array of ";
 	dimension->print( os, indent );
@@ -44,5 +44,5 @@
 	os << "open array of ";
     }
-    if( base ) {
+    if ( base ) {
 	base->print( os, indent );
     }
Index: translator/SynTree/AttrType.cc
===================================================================
--- translator/SynTree/AttrType.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/AttrType.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -37,9 +37,9 @@
     Type::print( os, indent );
     os << "attribute " << name << " applied to ";
-    if( expr ) {
+    if ( expr ) {
 	os << "expression ";
 	expr->print( os, indent );
     }
-    if( type ) {
+    if ( type ) {
 	os << "type ";
 	type->print( os, indent );
Index: translator/SynTree/BasicType.cc
===================================================================
--- translator/SynTree/BasicType.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/BasicType.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -19,5 +19,5 @@
 
 bool BasicType::isInteger() const {
-    switch( kind ) {
+    switch ( kind ) {
       case Bool:
       case Char:
Index: translator/SynTree/CodeGenVisitor.cc
===================================================================
--- translator/SynTree/CodeGenVisitor.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/CodeGenVisitor.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -20,5 +20,5 @@
 
 void CodeGenVisitor::visit(ConstantExpr *cnst){
-    if(cnst != 0)
+    if (cnst != 0)
 	visit(cnst->get_constant());
 }
@@ -28,10 +28,10 @@
 
 void CodeGenVisitor::visit(ExprStmt *exprStmt){
-    if(exprStmt != 0)
+    if (exprStmt != 0)
 	exprStmt->get_expr()->accept(*this);	// visit(exprStmt->get_expr()) doesn't work
 }
 
 void CodeGenVisitor::visit(SwitchStmt *switchStmt){
-    cout << "switch(" << endl;	    
+    cout << "switch (" << endl;	    
     // visit(switchStmt->get_condition());   // why doesn't this work?
     switchStmt->get_condition()->accept(*this);
Index: translator/SynTree/Constant.cc
===================================================================
--- translator/SynTree/Constant.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/Constant.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -15,5 +15,5 @@
 void Constant::print( std::ostream &os ) const {
     os << value;
-    if( type ) {
+    if ( type ) {
 	os << " (type: ";
 	type->print( os );
Index: translator/SynTree/DeclStmt.cc
===================================================================
--- translator/SynTree/DeclStmt.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/DeclStmt.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -30,5 +30,5 @@
 {
     os << "Declaration of ";
-    if( decl ) {
+    if ( decl ) {
 	decl->print( os, indent );
     }
Index: translator/SynTree/Declaration.cc
===================================================================
--- translator/SynTree/Declaration.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/Declaration.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -47,5 +47,5 @@
 {
     IdMapType::const_iterator i = idMap.find( id );
-    if( i != idMap.end() ) {
+    if ( i != idMap.end() ) {
 	return i->second;
     } else {
@@ -58,5 +58,5 @@
 Declaration::dumpIds( std::ostream &os )
 {
-    for( IdMapType::const_iterator i = idMap.begin(); i != idMap.end(); ++i ) {
+    for ( IdMapType::const_iterator i = idMap.begin(); i != idMap.end(); ++i ) {
 	os << i->first << " -> ";
 	i->second->printShort( os );
Index: translator/SynTree/Expression.cc
===================================================================
--- translator/SynTree/Expression.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/Expression.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -32,5 +32,5 @@
 Expression::add_result( Type *t )
 {
-    if( TupleType *tuple = dynamic_cast< TupleType* >( t ) ) {
+    if ( TupleType *tuple = dynamic_cast< TupleType* >( t ) ) {
 	std::copy( tuple->get_types().begin(), tuple->get_types().end(), back_inserter( results ) );
     } else {
@@ -40,10 +40,10 @@
 
 void Expression::print(std::ostream &os, int indent) const {
-    if( env ) {
+    if ( env ) {
 	os << std::string(indent, ' ') << "with environment:" << std::endl;
 	env->print( os, indent+2 );
     }
 
-    if( argName ) {
+    if ( argName ) {
 	os << std::string(indent, ' ') << "with designator:";
 	argName->print( os, indent+2 );
@@ -75,5 +75,5 @@
 {
     add_result( var->get_type()->clone() );
-    for( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) {
+    for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) {
 	(*i)->set_isLvalue( true );
     }
@@ -94,6 +94,6 @@
 
     Declaration *decl = get_var();
-    // if( decl != 0) decl->print(os, indent + 2);
-    if( decl != 0) decl->printShort(os, indent + 2);
+    // if ( decl != 0) decl->print(os, indent + 2);
+    if ( decl != 0) decl->printShort(os, indent + 2);
     os << std::endl;
     Expression::print( os, indent );
@@ -126,5 +126,5 @@
     os << std::string(indent, ' ') << "Sizeof Expression on: ";
 
-    if(isType)
+    if (isType)
 	type->print(os, indent + 2);
     else
@@ -160,8 +160,8 @@
     os << std::string(indent, ' ') << "Attr ";
     attr->print( os, indent + 2 );
-    if( isType || expr ) {
+    if ( isType || expr ) {
 	os << "applied to: ";
 
-	if(isType)
+	if (isType)
 	    type->print(os, indent + 2);
 	else
@@ -197,5 +197,5 @@
     arg->print(os, indent+2);
     os << std::endl << std::string(indent, ' ') << "to:" << std::endl;
-    if( results.empty() ) {
+    if ( results.empty() ) {
 	os << std::string(indent+2, ' ') << "nothing" << std::endl;
     } else {
@@ -233,5 +233,5 @@
 {
     add_result( member->get_type()->clone() );
-    for( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) {
+    for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) {
 	(*i)->set_isLvalue( true );
     }
@@ -287,5 +287,5 @@
 void UntypedExpr::printArgs(std::ostream &os, int indent ) const {
     std::list<Expression *>::const_iterator i;
-    for(i = args.begin(); i != args.end(); i++)
+    for (i = args.begin(); i != args.end(); i++)
 	(*i)->print(os, indent);
 }
@@ -362,5 +362,5 @@
 {
     os << std::string(indent, ' ') << "Valof Expression: " << std::endl;
-    if( get_body() != 0 )
+    if ( get_body() != 0 )
 	get_body()->print( os, indent + 2 );
 }
Index: translator/SynTree/FunctionDecl.cc
===================================================================
--- translator/SynTree/FunctionDecl.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/FunctionDecl.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -56,5 +56,5 @@
     if ( ! oldIdents.empty() ) {
 	os << string( indent+2, ' ' ) << "with parameter names" << endl;
-	for( std::list< std::string >::const_iterator i = oldIdents.begin(); i != oldIdents.end(); ++i ) {
+	for ( std::list< std::string >::const_iterator i = oldIdents.begin(); i != oldIdents.end(); ++i ) {
 	    os << string( indent+4, ' ' ) << *i << endl;
 	}
Index: translator/SynTree/Initializer.cc
===================================================================
--- translator/SynTree/Initializer.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/Initializer.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -61,5 +61,5 @@
     }
 
-    for( std::list<Initializer *>::iterator i = initializers.begin(); i != initializers.end(); i++ ) 
+    for ( std::list<Initializer *>::iterator i = initializers.begin(); i != initializers.end(); i++ ) 
 	(*i)->print( os, indent + 2 );
 }
Index: translator/SynTree/Mutator.h
===================================================================
--- translator/SynTree/Mutator.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/Mutator.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -110,5 +110,5 @@
 	}
     }
-    if ( !errors.isEmpty() ) {
+    if ( ! errors.isEmpty() ) {
 	throw errors;
     }
Index: translator/SynTree/NamedTypeDecl.cc
===================================================================
--- translator/SynTree/NamedTypeDecl.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/NamedTypeDecl.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -35,9 +35,9 @@
 	base->print( os, indent );
     } // if
-    if ( !parameters.empty() ) {
+    if ( ! parameters.empty() ) {
 	os << endl << string( indent, ' ' ) << "with parameters" << endl;
 	printAll( parameters, os, indent+2 );
     } // if
-    if ( !assertions.empty() ) {
+    if ( ! assertions.empty() ) {
 	os << endl << string( indent, ' ' ) << "with assertions" << endl;
 	printAll( assertions, os, indent+2 );
@@ -59,5 +59,5 @@
 	base->print( os, indent );
     } // if
-    if ( !parameters.empty() ) {
+    if ( ! parameters.empty() ) {
 	os << endl << string( indent, ' ' ) << "with parameters" << endl;
 	printAll( parameters, os, indent+2 );
Index: translator/SynTree/PointerType.cc
===================================================================
--- translator/SynTree/PointerType.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/PointerType.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -40,14 +40,14 @@
     Type::print( os, indent );
     os << "pointer to ";
-    if( isStatic ) {
+    if ( isStatic ) {
 	os << "static ";
     }
-    if( isVarLen ) {
+    if ( isVarLen ) {
 	os << "variable length array of ";
-    } else if( dimension ) {
+    } else if ( dimension ) {
 	os << "array of ";
 	dimension->print( os, indent );
     }
-    if( base ) {
+    if ( base ) {
 	base->print( os, indent );
     }
Index: translator/SynTree/ReferenceToType.cc
===================================================================
--- translator/SynTree/ReferenceToType.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/ReferenceToType.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -39,5 +39,5 @@
     Type::print( os, indent );
     os << "instance of " << typeString() << " " << name << " ";
-    if( !parameters.empty() ) {
+    if ( ! parameters.empty() ) {
 	os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
 	printAll( parameters, os, indent+2 );
@@ -51,6 +51,6 @@
 {
     std::list< Declaration* > found;
-    for( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i ) {
-	if( (*i)->get_name() == name ) {
+    for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i ) {
+	if ( (*i)->get_name() == name ) {
 	    found.push_back( *i );
 	}
@@ -118,5 +118,5 @@
     Type::print( os, indent );
     os << "instance of " << typeString() << " " << get_name() << " (" << ( isFtype ? "" : "not" ) << " a function type) ";
-    if( !parameters.empty() ) {
+    if ( ! parameters.empty() ) {
 	os << endl << std::string( indent, ' ' ) << "with parameters" << endl;
 	printAll( parameters, os, indent+2 );
Index: translator/SynTree/Statement.cc
===================================================================
--- translator/SynTree/Statement.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/Statement.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -38,5 +38,5 @@
 {
     //actually this is a syntactic error signaled by the parser
-    if(type == BranchStmt::Goto && target.size() == 0)
+    if (type == BranchStmt::Goto && target.size() == 0)
 	throw SemanticError("goto without target");
 }
@@ -46,5 +46,5 @@
     Statement(labels), computedTarget(_computedTarget), type(_type)
 {
-    if(type != BranchStmt::Goto || computedTarget == 0)
+    if (type != BranchStmt::Goto || computedTarget == 0)
 	throw SemanticError("Computed target not valid in branch statement");
 }
@@ -63,5 +63,5 @@
 void ReturnStmt::print( std::ostream &os, int indent ){
     os << "\r" << std::string(indent, ' ') << string ( isThrow? "Throw":"Return" ) << " Statement, returning: ";
-    if(expr != 0) expr->print(os);
+    if (expr != 0) expr->print(os);
     os << endl;
 }
@@ -81,5 +81,5 @@
     thenPart->print(os, indent + 4);
 
-    if(elsePart != 0){
+    if (elsePart != 0){
 	elsePart->print(os, indent + 4);
     }
@@ -104,5 +104,5 @@
     // branches
     std::list<Statement *>::iterator i;
-    for(i = branches.begin(); i != branches.end(); i++)
+    for (i = branches.begin(); i != branches.end(); i++)
 	(*i)->print(os, indent + 4);
 
@@ -115,5 +115,5 @@
     Statement(_labels), condition(_condition), stmts(_statements), _isDefault(deflt)
 {
-    if(isDefault() && condition != 0)
+    if (isDefault() && condition != 0)
 	throw SemanticError("default with conditions");
 }
@@ -126,5 +126,5 @@
     os << "\r" << string(indent, ' ');
 
-    if(isDefault())
+    if (isDefault())
 	os << "Default ";
     else {
@@ -136,5 +136,5 @@
 
     std::list<Statement *>::iterator i;
-    for(i = stmts.begin(); i != stmts.end(); i++)
+    for (i = stmts.begin(); i != stmts.end(); i++)
 	(*i)->print(os, indent + 4);
 }
@@ -158,5 +158,5 @@
     // branches
     std::list<Statement *>::iterator i;
-    for(i = branches.begin(); i != branches.end(); i++)
+    for (i = branches.begin(); i != branches.end(); i++)
 	(*i)->print(os, indent + 4);
 
@@ -183,5 +183,5 @@
     os << string(indent, ' ') << ".... with body: " << endl;
 
-    if(body != 0) body->print(os, indent + 4);
+    if (body != 0) body->print(os, indent + 4);
 }
 
@@ -216,5 +216,5 @@
 
     os << "\n\r" << string(indent + 2, ' ') << "statement block: \n"; 
-    if(body != 0)
+    if (body != 0)
 	body->print(os, indent + 4);
 
@@ -244,5 +244,5 @@
     os << string(indent + 2, ' ') << "and handlers: " << endl;
     std::list<Statement *>::iterator i;
-    for(i = handlers.begin(); i != handlers.end(); i++)
+    for (i = handlers.begin(); i != handlers.end(); i++)
 	(*i)->print(os, indent + 4);
 
@@ -267,5 +267,5 @@
 
     os << "\r" << string(indent, ' ') << "... catching" << endl;
-    if( decl ) {
+    if ( decl ) {
 	decl->printShort( os, indent + 4 );
 	os << endl;
Index: translator/SynTree/Type.cc
===================================================================
--- translator/SynTree/Type.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/Type.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -40,5 +40,5 @@
 
 void Type::print( std::ostream &os, int indent ) const {
-    if ( !forall.empty() ) {
+    if ( ! forall.empty() ) {
 	os << "forall" << std::endl;
 	printAll( forall, os, indent + 4 );
Index: translator/SynTree/TypeExpr.cc
===================================================================
--- translator/SynTree/TypeExpr.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/TypeExpr.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -29,5 +29,5 @@
 TypeExpr::print( std::ostream &os, int indent ) const
 {
-    if( type ) type->print( os, indent );
+    if ( type ) type->print( os, indent );
     Expression::print( os, indent );
 }
Index: translator/SynTree/TypeSubstitution.cc
===================================================================
--- translator/SynTree/TypeSubstitution.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/TypeSubstitution.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -21,8 +21,8 @@
 TypeSubstitution::~TypeSubstitution()
 {
-    for( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
+    for ( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
 	delete( i->second );
     }
-    for( VarEnvType::iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {
+    for ( VarEnvType::iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {
 	delete( i->second );
     }
@@ -32,5 +32,5 @@
 TypeSubstitution::operator=( const TypeSubstitution &other )
 {
-    if( this == &other ) return *this;
+    if ( this == &other ) return *this;
     initialize( other, *this );
     return *this;
@@ -48,8 +48,8 @@
 TypeSubstitution::add( const TypeSubstitution &other )
 {
-    for( TypeEnvType::const_iterator i = other.typeEnv.begin(); i != other.typeEnv.end(); ++i ) {
+    for ( TypeEnvType::const_iterator i = other.typeEnv.begin(); i != other.typeEnv.end(); ++i ) {
 	typeEnv[ i->first ] = i->second->clone();
     }
-    for( VarEnvType::const_iterator i = other.varEnv.begin(); i != other.varEnv.end(); ++i ) {
+    for ( VarEnvType::const_iterator i = other.varEnv.begin(); i != other.varEnv.end(); ++i ) {
 	varEnv[ i->first ] = i->second->clone();
     }
@@ -60,5 +60,5 @@
 {
     TypeEnvType::iterator i = typeEnv.find( formalType );
-    if( i != typeEnv.end() ) {
+    if ( i != typeEnv.end() ) {
 	delete i->second;
     }
@@ -70,5 +70,5 @@
 {
     TypeEnvType::iterator i = typeEnv.find( formalType );
-    if( i != typeEnv.end() ) {
+    if ( i != typeEnv.end() ) {
 	delete i->second;
 	typeEnv.erase( formalType );
@@ -80,5 +80,5 @@
 {
     TypeEnvType::const_iterator i = typeEnv.find( formalType );
-    if( i == typeEnv.end() ) {
+    if ( i == typeEnv.end() ) {
 	return 0;
     } else {
@@ -99,8 +99,8 @@
 	subCount = 0;
 	freeOnly = true;
-	for( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
+	for ( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
 	    i->second = i->second->acceptMutator( *this );
 	}
-    } while( subCount );
+    } while ( subCount );
 }
 
@@ -109,8 +109,8 @@
 {
     BoundVarsType::const_iterator bound = boundVars.find( inst->get_name() );
-    if( bound != boundVars.end() ) return inst;
+    if ( bound != boundVars.end() ) return inst;
     
     TypeEnvType::const_iterator i = typeEnv.find( inst->get_name() );
-    if( i == typeEnv.end() ) {
+    if ( i == typeEnv.end() ) {
 	return inst;
     } else {
@@ -130,5 +130,5 @@
 {
     VarEnvType::const_iterator i = varEnv.find( nameExpr->get_name() );
-    if( i == varEnv.end() ) {
+    if ( i == varEnv.end() ) {
 	return nameExpr;
     } else {
@@ -144,6 +144,6 @@
 {
     BoundVarsType oldBoundVars( boundVars );
-    if( freeOnly ) {
-	for( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
+    if ( freeOnly ) {
+	for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
 	    boundVars.insert( (*tyvar)->get_name() );
 	}
@@ -218,5 +218,5 @@
 {
     os << std::string( indent, ' ' ) << "Types:" << std::endl;
-    for( TypeEnvType::const_iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
+    for ( TypeEnvType::const_iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
 	os << std::string( indent+2, ' ' ) << i->first << " -> ";
 	i->second->print( os, indent+4 );
@@ -224,5 +224,5 @@
     }
     os << std::string( indent, ' ' ) << "Non-types:" << std::endl;
-    for( VarEnvType::const_iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {
+    for ( VarEnvType::const_iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {
 	os << std::string( indent+2, ' ' ) << i->first << " -> ";
 	i->second->print( os, indent+4 );
Index: translator/SynTree/TypeSubstitution.h
===================================================================
--- translator/SynTree/TypeSubstitution.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/TypeSubstitution.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -90,10 +90,10 @@
     FormalIterator formalIt = formalBegin;
     ActualIterator actualIt = actualBegin;
-    for( ; formalIt != formalEnd; ++formalIt, ++actualIt ) {
-	if( TypeDecl *formal = dynamic_cast< TypeDecl* >( *formalIt ) ) {
-	    if( TypeExpr *actual = dynamic_cast< TypeExpr* >( *actualIt ) ) {
-		if( formal->get_name() != "" ) {
+    for ( ; formalIt != formalEnd; ++formalIt, ++actualIt ) {
+	if ( TypeDecl *formal = dynamic_cast< TypeDecl* >( *formalIt ) ) {
+	    if ( TypeExpr *actual = dynamic_cast< TypeExpr* >( *actualIt ) ) {
+		if ( formal->get_name() != "" ) {
 		    TypeEnvType::iterator i = typeEnv.find( formal->get_name() );
-		    if( i != typeEnv.end() ) {
+		    if ( i != typeEnv.end() ) {
 			delete i->second;
 		    }
@@ -105,5 +105,5 @@
 	} else {
 	    // TODO: type check the formal and actual parameters
-	    if( (*formalIt)->get_name() != "" ) {
+	    if ( (*formalIt)->get_name() != "" ) {
 		varEnv[ (*formalIt)->get_name() ] = (*actualIt)->clone();
 	    }
@@ -152,7 +152,7 @@
 TypeSubstitution::extract( TypeInstListIterator begin, TypeInstListIterator end, TypeSubstitution &result )
 {
-    while( begin != end ) {
+    while ( begin != end ) {
 	TypeEnvType::iterator cur = typeEnv.find( (*begin++)->get_name() );
-	if( cur != typeEnv.end() ) {
+	if ( cur != typeEnv.end() ) {
 	    result.typeEnv[ cur->first ] = cur->second;
 	    typeEnv.erase( cur );
@@ -170,5 +170,5 @@
 
     TypeSubstitution sub = TypeSubstitution( formalBegin, formalEnd, actual );
-    for( std::list< Declaration* >::iterator i = memberBegin; i != memberEnd; ++i ) {
+    for ( std::list< Declaration* >::iterator i = memberBegin; i != memberEnd; ++i ) {
 	Declaration *newdecl = (*i)->clone();
 	sub.apply( newdecl );
Index: translator/SynTree/TypeofType.cc
===================================================================
--- translator/SynTree/TypeofType.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/TypeofType.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -31,5 +31,5 @@
     Type::print( os, indent );
     os << "type-of expression ";
-    if( expr ) {
+    if ( expr ) {
 	expr->print( os, indent );
     }
Index: translator/SynTree/Visitor.h
===================================================================
--- translator/SynTree/Visitor.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/SynTree/Visitor.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -103,5 +103,5 @@
 	}
     }
-    if ( !errors.isEmpty() ) {
+    if ( ! errors.isEmpty() ) {
 	throw errors;
     }
@@ -129,5 +129,5 @@
 	}
     }
-    if ( !errors.isEmpty() ) {
+    if ( ! errors.isEmpty() ) {
 	throw errors;
     }
Index: translator/Tests/ResolvExpr/Statement.c
===================================================================
--- translator/Tests/ResolvExpr/Statement.c	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Tests/ResolvExpr/Statement.c	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -7,8 +7,8 @@
     int a;
     struct { int b; } a;
-    if( a ) {
-      while( a ) {
+    if ( a ) {
+      while ( a ) {
         int *b;
-        for( b; a; b ) {
+        for ( b; a; b ) {
         }
       }
Index: translator/Tests/Syntax/Expression.c
===================================================================
--- translator/Tests/Syntax/Expression.c	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Tests/Syntax/Expression.c	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -10,5 +10,5 @@
     // operators
 
-    !i;
+    ! i;
     ~i;
     +i;
Index: translator/Tests/gcc/920409-2.c
===================================================================
--- translator/Tests/gcc/920409-2.c	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Tests/gcc/920409-2.c	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -1,2 +1,2 @@
 double x(){int x1,x2;double v;
-if(((long)(x1-x2))<1)return -1.0;v=t(v);v=y(1,v>0.0?(int)v:((int)v-1));}
+if (((long)(x1-x2))<1)return -1.0;v=t(v);v=y(1,v>0.0?(int)v:((int)v-1));}
Index: translator/Tests/gcc/920410-2.c
===================================================================
--- translator/Tests/gcc/920410-2.c	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Tests/gcc/920410-2.c	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -3,9 +3,9 @@
     int j;
 
-    while( 1 )
+    while ( 1 )
       {
-	for( j = 0; j < 4; j++ )
+	for ( j = 0; j < 4; j++ )
 	  ;
-	for( j = 0; j < 4; j++ )
+	for ( j = 0; j < 4; j++ )
 	  ;
       }
Index: translator/Tuples/AssignExpand.cc
===================================================================
--- translator/Tuples/AssignExpand.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Tuples/AssignExpand.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -24,5 +24,5 @@
     CompoundStmt *newSt = 0;
     if (! extra.empty() ) {
-      if ( !newSt )
+      if ( ! newSt )
 	newSt= new CompoundStmt(std::list<Label>());
 
@@ -31,5 +31,5 @@
 
     if (! extra2.empty() ) {
-      if ( !newSt )
+      if ( ! newSt )
 	newSt= new CompoundStmt(std::list<Label>());
 
@@ -38,5 +38,5 @@
 
     if (! replace.empty() ) {
-      if ( !newSt )
+      if ( ! newSt )
 	newSt= new CompoundStmt(std::list<Label>());
 
@@ -45,5 +45,5 @@
     }
 
-    if( newSt ) return newSt; else return exprStmt;
+    if ( newSt ) return newSt; else return exprStmt;
   }
 
@@ -72,9 +72,9 @@
 		   tupleExpr->get_type() == SolvedTupleExpr::MASS ) */ {
       std::list<Expression *> &comps = tupleExpr->get_exprs();
-      for( std::list<Expression *>::iterator i = comps.begin(); i != comps.end(); ++i ) {
+      for ( std::list<Expression *>::iterator i = comps.begin(); i != comps.end(); ++i ) {
 	std::list<Statement *> decls;
 	std::list<Statement *> temps;
 	std::list<Statement *> assigns;
-	if( ApplicationExpr *app = dynamic_cast< ApplicationExpr * >(*i) ) {
+	if ( ApplicationExpr *app = dynamic_cast< ApplicationExpr * >(*i) ) {
 	  assert( app->get_args().size() == 2 );
 
Index: translator/Tuples/FunctionChecker.cc
===================================================================
--- translator/Tuples/FunctionChecker.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Tuples/FunctionChecker.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -23,6 +23,6 @@
 
   FunctionChecker::FunctionChecker( bool _topLevel, UniqueName *_nameGen ) : topLevel( _topLevel ), nameGen( _nameGen ) {
-    if( topLevel) {
-      assert( !nameGen );
+    if ( topLevel) {
+      assert( ! nameGen );
       nameGen = new UniqueName("_MVR_");
     } else
@@ -31,5 +31,5 @@
 
   FunctionChecker::~FunctionChecker() {
-    if( topLevel) {
+    if ( topLevel) {
       delete nameGen;
       nameGen = 0;
@@ -39,12 +39,12 @@
   Statement* FunctionChecker::mutate(ExprStmt *exprStmt) {
     exprStmt->set_expr( maybeMutate( exprStmt->get_expr(), *this ) );
-    if ( !tempExpr.empty() ) {
-      assert ( !temporaries.empty() );
+    if ( ! tempExpr.empty() ) {
+      assert ( ! temporaries.empty() );
       CompoundStmt *newBlock = new CompoundStmt( std::list< Label >() );
       // declarations
-      for( std::list< ObjectDecl *>::iterator d = temporaries.begin(); d != temporaries.end(); ++d )
+      for ( std::list< ObjectDecl *>::iterator d = temporaries.begin(); d != temporaries.end(); ++d )
 	newBlock->get_kids().push_back( new DeclStmt( std::list<Label>(), *d ) );
       // new expression statements
-      for( std::list< Expression *>::iterator e = tempExpr.begin(); e != tempExpr.end(); ++e )
+      for ( std::list< Expression *>::iterator e = tempExpr.begin(); e != tempExpr.end(); ++e )
 	newBlock->get_kids().push_back( new ExprStmt( std::list<Label>(), *e ) );
 
@@ -69,12 +69,12 @@
 
     std::list< Expression * > newArgs;
-    for( std::list< Expression *>::iterator e = applicationExpr->get_args().begin(); e != applicationExpr->get_args().end(); ++e ) {
+    for ( std::list< Expression *>::iterator e = applicationExpr->get_args().begin(); e != applicationExpr->get_args().end(); ++e ) {
       FunctionChecker rec( false, nameGen );
       (*e)->acceptMutator( rec );
 
-      if ( !rec.temporaries.empty() ) {
+      if ( ! rec.temporaries.empty() ) {
 	TupleExpr *lhs = new TupleExpr;
 	std::list< Expression * > &tmem = lhs->get_exprs();
-	for( std::list<ObjectDecl *>::iterator d = rec.temporaries.begin();  d != rec.temporaries.end(); ++d ) {
+	for ( std::list<ObjectDecl *>::iterator d = rec.temporaries.begin();  d != rec.temporaries.end(); ++d ) {
 	  tmem.push_back( new VariableExpr( *d ) );
 	  newArgs.push_back( new VariableExpr( *d ) );
@@ -100,12 +100,12 @@
 
   Expression* TupleDistrib::mutate(UntypedExpr *expr) {
-    if(  NameExpr *assgnop = dynamic_cast< NameExpr * >(expr->get_function()) ) {
-      if( assgnop->get_name() == std::string("?=?") ) {
+    if (  NameExpr *assgnop = dynamic_cast< NameExpr * >(expr->get_function()) ) {
+      if ( assgnop->get_name() == std::string("?=?") ) {
 	std::list<Expression *> &args = expr->get_args();
 	assert(args.size() == 2);
 	//if args.front() points to a tuple and if args.back() is already resolved
-	if( AddressExpr *addr = dynamic_cast<AddressExpr *>(args.front()) )
-	  if( TupleExpr *lhs = dynamic_cast<TupleExpr *>(addr->get_arg()) )
-	    if( ApplicationExpr *rhs = dynamic_cast<ApplicationExpr *>( args.back() ) ) {
+	if ( AddressExpr *addr = dynamic_cast<AddressExpr *>(args.front()) )
+	  if ( TupleExpr *lhs = dynamic_cast<TupleExpr *>(addr->get_arg()) )
+	    if ( ApplicationExpr *rhs = dynamic_cast<ApplicationExpr *>( args.back() ) ) {
 	      for ( std::list<Expression *>::iterator tc = lhs->get_exprs().begin(); tc != lhs->get_exprs().end(); ++tc )
 		rhs->get_args().push_back( new AddressExpr( *tc ) );
Index: translator/Tuples/FunctionFixer.cc
===================================================================
--- translator/Tuples/FunctionFixer.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Tuples/FunctionFixer.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -40,11 +40,11 @@
     Expression *rhs = 0;
     // also check if returning multiple values
-    if( CastExpr *cst = dynamic_cast<CastExpr *>( retStmt->get_expr() ) ) {
-      if( ApplicationExpr *app = dynamic_cast<ApplicationExpr *>( cst->get_arg() ) ) {
-	if( app->get_results().size() > 1 ) { // doesn't need to be ApplicationExpr
+    if ( CastExpr *cst = dynamic_cast<CastExpr *>( retStmt->get_expr() ) ) {
+      if ( ApplicationExpr *app = dynamic_cast<ApplicationExpr *>( cst->get_arg() ) ) {
+	if ( app->get_results().size() > 1 ) { // doesn't need to be ApplicationExpr
 	  tupleReturn = true;
 	  rhs = app;
 	}
-      } else if( TupleExpr *t = dynamic_cast<TupleExpr *>( cst->get_arg() ) ) {
+      } else if ( TupleExpr *t = dynamic_cast<TupleExpr *>( cst->get_arg() ) ) {
 	tupleReturn = true;
 	assert( rets.size() == t->get_exprs().size() ); // stupid check, resolve expression
@@ -52,8 +52,8 @@
       }
 
-      if( tupleReturn ) {
+      if ( tupleReturn ) {
 	assert ( rhs != 0 );
 	std::list< Expression * > lhs;
-	for( std::list< DeclarationWithType * >::iterator d = rets.begin(); d != rets.end(); ++d ) {
+	for ( std::list< DeclarationWithType * >::iterator d = rets.begin(); d != rets.end(); ++d ) {
 	  std::list<Expression *> largs;
 	  largs.push_back(new VariableExpr( *d ));
@@ -81,5 +81,5 @@
     if ( rets.empty() ) return variableExpr;
     mutateAll( variableExpr->get_results(), *this );
-    if( std::find( rets.begin(), rets.end(), variableExpr->get_var() ) != rets.end() )
+    if ( std::find( rets.begin(), rets.end(), variableExpr->get_var() ) != rets.end() )
 //      if ( PointerType *ptr = dynamic_cast<PointerType *>(variableExpr->get_var()->get_type()) ) {
       if ( dynamic_cast<PointerType *>(variableExpr->get_var()->get_type()) != 0 ) {
@@ -88,5 +88,5 @@
 	  Expression *expr = ResolvExpr::resolveInVoidContext( /*new CastExpr(*/new UntypedExpr( new NameExpr( "*?" ), largs )/*,
 																 ptr->get_base()),*/, index);
-	  if( ApplicationExpr *app = dynamic_cast< ApplicationExpr * >( expr ) ) {
+	  if ( ApplicationExpr *app = dynamic_cast< ApplicationExpr * >( expr ) ) {
 	    assert( app->get_args().size() == 1 );
 	    app->get_args().pop_front();
Index: translator/Tuples/MultRet.cc
===================================================================
--- translator/Tuples/MultRet.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Tuples/MultRet.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -35,10 +35,10 @@
       // copy variables
       Statements &vars = toplevel.getVars()->get_kids();
-      for( Statements::iterator i = vars.begin(); i != vars.end(); i++ )
+      for ( Statements::iterator i = vars.begin(); i != vars.end(); i++ )
 	code->get_kids().push_back( *i );
 
       // copy statements
       Statements &block = toplevel.getCode()->get_kids();
-      for( Statements::iterator i = block.begin(); i != block.end(); i++ )
+      for ( Statements::iterator i = block.begin(); i != block.end(); i++ )
 	code->get_kids().push_back( *i );
 
@@ -66,5 +66,5 @@
       mulretp = true;
 
-      if( newVars == 0 )
+      if ( newVars == 0 )
 	newVars = new CompoundStmt( std::list<Label>(0) );
 
@@ -81,5 +81,5 @@
     Exprs &args = appExpr->get_args();
     std::list< Expression * > newArgs;
-    for( Exprs::iterator i = args.begin(); i != args.end(); i++ ) {
+    for ( Exprs::iterator i = args.begin(); i != args.end(); i++ ) {
       MVRMutator next;
       Expression *mutated = (*i)->acceptMutator( next );
@@ -93,10 +93,10 @@
 	if (newVars == 0)
 	  newVars = new CompoundStmt( std::list< Label >() );
-	for( Stmts::iterator i = vars.begin(); i != vars.end(); i++ )  // std::splice? -- need to append lists
+	for ( Stmts::iterator i = vars.begin(); i != vars.end(); i++ )  // std::splice? -- need to append lists
 	  newVars->get_kids().push_back( *i );
 
 	if (newCode == 0)
 	  newCode = new CompoundStmt( std::list< Label >() );
-	for( Stmts::iterator i = block.begin(); i != block.end(); i++ )
+	for ( Stmts::iterator i = block.begin(); i != block.end(); i++ )
 	  newCode->get_kids().push_back( *i );
 
@@ -105,5 +105,5 @@
       if ( next.hasResults() ) {
 	Exprs &res = next.get_results();
-	for( Exprs::iterator i = res.begin(); i != res.end(); i++ )
+	for ( Exprs::iterator i = res.begin(); i != res.end(); i++ )
 	  newArgs.push_back( *i );
       } else
@@ -117,5 +117,5 @@
       // add 'out' parameters
       if ( ! argsToAdd.empty() )
-	for(std::list< Expression *>::iterator i = argsToAdd.begin(); i != argsToAdd.end(); i++)
+	for (std::list< Expression *>::iterator i = argsToAdd.begin(); i != argsToAdd.end(); i++)
 	  (appExpr->get_args()).push_back( *i );
       // clear 'out' parameters ( so that the list can be reused -- substitute by auto_ptr later? )
Index: translator/Tuples/NameMatcher.cc
===================================================================
--- translator/Tuples/NameMatcher.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Tuples/NameMatcher.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -6,5 +6,5 @@
     : current( 0 ) {
     int cnt = 0;
-    for( std::list< DeclarationWithType *>::const_iterator f = formals.begin(); f != formals.end(); ++f ) {
+    for ( std::list< DeclarationWithType *>::const_iterator f = formals.begin(); f != formals.end(); ++f ) {
       table.insert( std::pair< std::string, int >( (*f)->get_name(), cnt++ ) );
       index.push_back(*f);
@@ -16,9 +16,9 @@
 
   void NameMatcher::match( ResolvExpr::AltList &alternatives ) throw (NoMatch) {
-    if( alternatives.size() != index.size() )
+    if ( alternatives.size() != index.size() )
       throw NoMatch("Length of actuals and formals differ");
 
-    for( ResolvExpr::AltList::const_iterator a = alternatives.begin(); a != alternatives.end(); ++a ) {
-      if( a->expr->get_argName() != 0 )
+    for ( ResolvExpr::AltList::const_iterator a = alternatives.begin(); a != alternatives.end(); ++a ) {
+      if ( a->expr->get_argName() != 0 )
 	if ( NameExpr *name = dynamic_cast<NameExpr *>( a->expr->get_argName() ) ) {
 	  if ( table.find( name->get_name() ) != table.end() ) {
@@ -27,5 +27,5 @@
 	  } else
 	    throw NoMatch( name->get_name() + "no such  designation" );
-	} /*else if( TupleExpr *tup = dynamic_cast<TupleExpr *>( a->expr->get_argName() ) )
+	} /*else if ( TupleExpr *tup = dynamic_cast<TupleExpr *>( a->expr->get_argName() ) )
 	    std::cerr << "Designated expression" << std::endl; */
       exprs.push_back( &(*a) );
@@ -41,5 +41,5 @@
 
   ResolvExpr::Alternative &NameMatcher::get_next() throw (NoMoreElements) {
-    if( current++ >= (int)(index.size()) )
+    if ( current++ >= (int)(index.size()) )
       throw NoMoreElements();
     return *(new ResolvExpr::Alternative());
Index: translator/Tuples/TupleAssignment.cc
===================================================================
--- translator/Tuples/TupleAssignment.cc	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Tuples/TupleAssignment.cc	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -19,6 +19,6 @@
   bool TupleAssignSpotter::pointsToTuple( Expression *expr ) {
     // also check for function returning tuple of reference types
-    if(AddressExpr *addr = dynamic_cast<AddressExpr *>(expr) )
-      if( isTuple(addr->get_arg() ) )
+    if (AddressExpr *addr = dynamic_cast<AddressExpr *>(expr) )
+      if ( isTuple(addr->get_arg() ) )
 	return true;
     return false;
@@ -26,5 +26,5 @@
 
   bool TupleAssignSpotter::isTupleVar( DeclarationWithType *decl ) {
-    if( dynamic_cast<TupleType *>(decl->get_type()) )
+    if ( dynamic_cast<TupleType *>(decl->get_type()) )
       return true;
     return false;
@@ -33,10 +33,10 @@
   bool TupleAssignSpotter::isTuple( Expression *expr, bool isRight ) {
     // true if `expr' is an expression returning a tuple: tuple, tuple variable or MRV function
-    if ( !expr ) return false;
-
-    if( dynamic_cast<TupleExpr *>(expr) )
-      return true;
-    else if( VariableExpr *var = dynamic_cast<VariableExpr *>(expr) ) {
-      if( isTupleVar(var->get_var()) )
+    if ( ! expr ) return false;
+
+    if ( dynamic_cast<TupleExpr *>(expr) )
+      return true;
+    else if ( VariableExpr *var = dynamic_cast<VariableExpr *>(expr) ) {
+      if ( isTupleVar(var->get_var()) )
 	return true;
     }
@@ -52,7 +52,7 @@
       return false;
 
-    if( new_assigns.empty() ) return false;
+    if ( new_assigns.empty() ) return false;
     /*return */matcher->solve( new_assigns );
-    if( dynamic_cast<TupleAssignSpotter::MultipleAssignMatcher *>( matcher ) ) {
+    if ( dynamic_cast<TupleAssignSpotter::MultipleAssignMatcher *>( matcher ) ) {
       // now resolve new assignments
       std::list< Expression * > solved_assigns;
@@ -61,5 +61,5 @@
 
       ResolvExpr::AltList current;
-      for( std::list< Expression * >::iterator i = new_assigns.begin(); i != new_assigns.end(); ++i ) {
+      for ( std::list< Expression * >::iterator i = new_assigns.begin(); i != new_assigns.end(); ++i ) {
 	//try {
 	ResolvExpr::AlternativeFinder finder( currentFinder->get_indexer(), currentFinder->get_environ() );
@@ -80,5 +80,5 @@
       return true;
     } else { // mass assignment
-      //if( new_assigns.empty() ) return false;
+      //if ( new_assigns.empty() ) return false;
       std::list< Expression * > solved_assigns;
       ResolvExpr::AltList solved_alts;
@@ -87,9 +87,9 @@
       ResolvExpr::AltList current;
       if ( optMass.empty() ) {
-	for( std::list< Expression * >::size_type i = 0; i != new_assigns.size(); ++i )
+	for ( std::list< Expression * >::size_type i = 0; i != new_assigns.size(); ++i )
 	  optMass.push_back( ResolvExpr::AltList() );
       }
       int cnt = 0;
-      for( std::list< Expression * >::iterator i = new_assigns.begin(); i != new_assigns.end(); ++i, cnt++ ) {
+      for ( std::list< Expression * >::iterator i = new_assigns.begin(); i != new_assigns.end(); ++i, cnt++ ) {
 
 	ResolvExpr::AlternativeFinder finder( currentFinder->get_indexer(), currentFinder->get_environ() );
@@ -110,5 +110,5 @@
 
   bool TupleAssignSpotter::isMVR( Expression *expr ) {
-    if( expr->get_results().size() > 1 ) {
+    if ( expr->get_results().size() > 1 ) {
       // MVR processing
       return true;
@@ -118,17 +118,17 @@
 
   bool TupleAssignSpotter::isTupleAssignment( UntypedExpr * expr, std::list<ResolvExpr::AltList> &possibilities ) {
-    if(  NameExpr *assgnop = dynamic_cast< NameExpr * >(expr->get_function()) ) {
-
-      if( assgnop->get_name() == std::string("?=?") ) {
-
-	for( std::list<ResolvExpr::AltList>::iterator ali = possibilities.begin(); ali != possibilities.end(); ++ali ) {
+    if (  NameExpr *assgnop = dynamic_cast< NameExpr * >(expr->get_function()) ) {
+
+      if ( assgnop->get_name() == std::string("?=?") ) {
+
+	for ( std::list<ResolvExpr::AltList>::iterator ali = possibilities.begin(); ali != possibilities.end(); ++ali ) {
 	  assert( ali->size() == 2 );
 	  ResolvExpr::AltList::iterator opit = ali->begin();
 	  ResolvExpr::Alternative op1 = *opit, op2 = *(++opit);
 
-	  if( pointsToTuple(op1.expr) ) { // also handles tuple vars
+	  if ( pointsToTuple(op1.expr) ) { // also handles tuple vars
 	    if ( isTuple( op2.expr, true ) )
 	      matcher = new MultipleAssignMatcher(op1.expr, op2.expr);
-	    else if( isMVR( op2.expr ) ) {
+	    else if ( isMVR( op2.expr ) ) {
 	      // handle MVR differently
 	    } else
@@ -137,7 +137,7 @@
 
 	    std::list< ResolvExpr::AltList > options;
-	    if( match() )
+	    if ( match() )
 	      /*
-	      if( hasMatched ) {
+	      if ( hasMatched ) {
 		// throw SemanticError("Ambiguous tuple assignment");
 	      } else {*/
@@ -150,11 +150,11 @@
 	}
 
-	if( hasMatched ) {
-	  if( dynamic_cast<TupleAssignSpotter::MultipleAssignMatcher *>( matcher ) ) {
+	if ( hasMatched ) {
+	  if ( dynamic_cast<TupleAssignSpotter::MultipleAssignMatcher *>( matcher ) ) {
 	    //options.print( std::cerr );
 	    std::list< ResolvExpr::AltList >best = options.get_best();
-	    if( best.size() == 1 ) {
+	    if ( best.size() == 1 ) {
 	      std::list<Expression *> solved_assigns;
-	      for( ResolvExpr::AltList::iterator i = best.front().begin(); i != best.front().end(); ++i ){
+	      for ( ResolvExpr::AltList::iterator i = best.front().begin(); i != best.front().end(); ++i ){
 		solved_assigns.push_back( i->expr );
 	      }
@@ -165,9 +165,9 @@
 	    assert(! optMass.empty() );
 	    ResolvExpr::AltList winners;
-	    for( std::vector< ResolvExpr::AltList >::iterator i = optMass.begin(); i != optMass.end(); ++i )
+	    for ( std::vector< ResolvExpr::AltList >::iterator i = optMass.begin(); i != optMass.end(); ++i )
 	      findMinCostAlt( i->begin(), i->end(), back_inserter(winners) );
 
 	    std::list< Expression *> solved_assigns;
-	    for( ResolvExpr::AltList::iterator i = winners.begin(); i != winners.end(); ++i )
+	    for ( ResolvExpr::AltList::iterator i = winners.begin(); i != winners.end(); ++i )
 	      solved_assigns.push_back( i->expr );
 	    currentFinder->get_alternatives().push_front( ResolvExpr::Alternative(new SolvedTupleExpr(solved_assigns/*, SolvedTupleExpr::MASS*/), currentFinder->get_environ(), ResolvExpr::Cost() ) );
@@ -181,6 +181,6 @@
   void TupleAssignSpotter::Matcher::init( Expression *_lhs, Expression *_rhs ) {
     lhs.clear();
-    if(AddressExpr *addr = dynamic_cast<AddressExpr *>(_lhs) )
-      if( TupleExpr *tuple = dynamic_cast<TupleExpr *>(addr->get_arg()) )
+    if (AddressExpr *addr = dynamic_cast<AddressExpr *>(_lhs) )
+      if ( TupleExpr *tuple = dynamic_cast<TupleExpr *>(addr->get_arg()) )
 	std::copy( tuple->get_exprs().begin(), tuple->get_exprs().end(), back_inserter(lhs) );
 
@@ -195,5 +195,5 @@
     init(_lhs,_rhs);
 
-    if( TupleExpr *tuple = dynamic_cast<TupleExpr *>(_rhs) )
+    if ( TupleExpr *tuple = dynamic_cast<TupleExpr *>(_rhs) )
       std::copy( tuple->get_exprs().begin(), tuple->get_exprs().end(), back_inserter(rhs) );
   }
@@ -211,5 +211,5 @@
     if ( lhs.empty() || (rhs.size() != 1) ) return false;
 
-    for( std::list< Expression * >::iterator l = lhs.begin(); l != lhs.end(); l++ ) {
+    for ( std::list< Expression * >::iterator l = lhs.begin(); l != lhs.end(); l++ ) {
       std::list< Expression * > args;
       args.push_back( new AddressExpr(*l) );
@@ -229,9 +229,9 @@
     ResolvExpr::AltList current;
     if ( optMass.empty() ) {
-      for( std::list< Expression * >::size_type i = 0; i != new_assigns.size(); ++i )
+      for ( std::list< Expression * >::size_type i = 0; i != new_assigns.size(); ++i )
 	optMass.push_back( ResolvExpr::AltList() );
     }
     int cnt = 0;
-    for( std::list< Expression * >::iterator i = new_assigns.begin(); i != new_assigns.end(); ++i, cnt++ ) {
+    for ( std::list< Expression * >::iterator i = new_assigns.begin(); i != new_assigns.end(); ++i, cnt++ ) {
 
       ResolvExpr::AlternativeFinder finder( currentFinder->get_indexer(), currentFinder->get_environ() );
@@ -250,5 +250,5 @@
   bool TupleAssignSpotter::MultipleAssignMatcher::match( std::list< Expression * > &out ) {
     // need more complicated matching
-    if( lhs.size() == rhs.size() ) {
+    if ( lhs.size() == rhs.size() ) {
       zipWith( lhs.begin(), lhs.end(), rhs.begin(), rhs.end(), back_inserter(out), TupleAssignSpotter::Matcher::createAssgn );
       return true;
@@ -265,5 +265,5 @@
 
     ResolvExpr::AltList current;
-    for( std::list< Expression * >::iterator i = new_assigns.begin(); i != new_assigns.end(); ++i ) {
+    for ( std::list< Expression * >::iterator i = new_assigns.begin(); i != new_assigns.end(); ++i ) {
       //try {
       ResolvExpr::AlternativeFinder finder( currentFinder->get_indexer(), currentFinder->get_environ() );
@@ -297,9 +297,9 @@
     // transpose matrix
     if ( costMatrix.empty() )
-      for( unsigned int i = 0; i< opt.size(); ++i)
+      for ( unsigned int i = 0; i< opt.size(); ++i)
 	costMatrix.push_back( vector<ResolvExpr::Cost>() );
 
     int cnt = 0;
-    for( ResolvExpr::AltList::iterator i = opt.begin(); i != opt.end(); ++i, cnt++ )
+    for ( ResolvExpr::AltList::iterator i = opt.begin(); i != opt.end(); ++i, cnt++ )
       costMatrix[cnt].push_back( i->cost );
 
@@ -312,5 +312,5 @@
     list< ResolvExpr::AltList > ret;
     list< multiset<int> > solns;
-    for( vector< vector<Cost> >::iterator i = costMatrix.begin(); i != costMatrix.end(); ++i ) {
+    for ( vector< vector<Cost> >::iterator i = costMatrix.begin(); i != costMatrix.end(); ++i ) {
       list<int> current;
       findMinCost( i->begin(), i->end(), back_inserter(current) );
@@ -320,5 +320,5 @@
     multiset<int> result;
     lift_intersection( solns.begin(), solns.end(), inserter( result, result.begin() ) );
-    if( result.size() != 1 )
+    if ( result.size() != 1 )
       throw SemanticError("Ambiguous tuple expression");
     ret.push_back(get_option( *(result.begin() )));
@@ -329,6 +329,6 @@
     using namespace std;
 
-    for( vector< vector < ResolvExpr::Cost > >::iterator i = costMatrix.begin(); i != costMatrix.end(); ++i ) {
-      for( vector < ResolvExpr::Cost >::iterator j = i->begin(); j != i->end(); ++j )
+    for ( vector< vector < ResolvExpr::Cost > >::iterator i = costMatrix.begin(); i != costMatrix.end(); ++i ) {
+      for ( vector < ResolvExpr::Cost >::iterator j = i->begin(); j != i->end(); ++j )
 	ostr << *j << " " ;
       ostr << std::endl;
@@ -352,10 +352,10 @@
     Cost minCost = Cost::infinity;
     unsigned int index = 0;
-    for( InputIterator i = begin; i != end; ++i, index++ ) {
-      if( *i < minCost ) {
+    for ( InputIterator i = begin; i != end; ++i, index++ ) {
+      if ( *i < minCost ) {
         minCost = *i;
         alternatives.clear();
         alternatives.push_back( index );
-      } else if( *i == minCost ) {
+      } else if ( *i == minCost ) {
         alternatives.push_back( index );
       }
@@ -366,8 +366,8 @@
   template< class InputIterator, class OutputIterator >
   void TupleAssignSpotter::Options::lift_intersection( InputIterator begin, InputIterator end, OutputIterator out ){
-    if( begin == end ) return;
+    if ( begin == end ) return;
     InputIterator test = begin;
 
-    if(++test == end)
+    if (++test == end)
       { copy(begin->begin(), begin->end(), out); return; }
 
@@ -376,5 +376,5 @@
     copy( begin->begin(), begin->end(), inserter( cur, cur.begin() ) );
 
-    while( test != end ) {
+    while ( test != end ) {
       std::multiset<int> temp;
       set_intersection( cur.begin(), cur.end(), test->begin(), test->end(), inserter(temp,temp.begin()) );
@@ -390,8 +390,8 @@
 
   ResolvExpr::AltList TupleAssignSpotter::Options::get_option( std::list< ResolvExpr::AltList >::size_type index ) {
-    if( index >= options.size() )
+    if ( index >= options.size() )
       throw 0; // XXX
     std::list< ResolvExpr::AltList >::iterator it = options.begin();
-    for( std::list< ResolvExpr::AltList >::size_type i = 0; i < index; ++i, ++it );
+    for ( std::list< ResolvExpr::AltList >::size_type i = 0; i < index; ++i, ++it );
     return *it;
   }
Index: translator/Tuples/TupleAssignment.h
===================================================================
--- translator/Tuples/TupleAssignment.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/Tuples/TupleAssignment.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -102,11 +102,11 @@
     // select the alternatives that have the minimum parameter cost
     Cost minCost = Cost::infinity;
-    for( AltList::iterator i = begin; i != end; ++i ) {
-      if( i->cost < minCost ) {
+    for ( AltList::iterator i = begin; i != end; ++i ) {
+      if ( i->cost < minCost ) {
         minCost = i->cost;
         i->cost = i->cvtCost;
         alternatives.clear();
         alternatives.push_back( *i );
-      } else if( i->cost == minCost ) {
+      } else if ( i->cost == minCost ) {
         i->cost = i->cvtCost;
         alternatives.push_back( *i );
Index: translator/examples/iostream.c
===================================================================
--- translator/examples/iostream.c	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/examples/iostream.c	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -50,13 +50,13 @@
     do {
 	is >> &cur;
-	if( fail( is ) || eof( is ) ) return is;
-    } while( !( cur >= '0' && cur <= '9' ) );
+	if ( fail( is ) || eof( is ) ) return is;
+    } while ( !( cur >= '0' && cur <= '9' ) );
   
     // accumulate digits
     *ip = 0;
-    while( cur >= '0' && cur <= '9' ) {
+    while ( cur >= '0' && cur <= '9' ) {
 	*ip = *ip * 10 + ( cur - '0' );
 	is >> &cur;
-	if( fail( is ) || eof( is ) ) return is;
+	if ( fail( is ) || eof( is ) ) return is;
     }
   
Index: translator/examples/iterator.c
===================================================================
--- translator/examples/iterator.c	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/examples/iterator.c	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -10,5 +10,5 @@
 /// {
 ///   iterator_type i;
-///   for( i = begin; i != end; ++i ) {
+///   for ( i = begin; i != end; ++i ) {
 ///     func( *i );
 ///   }
Index: translator/examples/iterator.h
===================================================================
--- translator/examples/iterator.h	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/examples/iterator.h	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -19,5 +19,5 @@
 };
 
-context iterator_for( type iterator_type, type collection_type, type elt_type | iterator( iterator_type, elt_type ) ) {
+context iterator_for ( type iterator_type, type collection_type, type elt_type | iterator( iterator_type, elt_type ) ) {
 //    [ iterator_type begin, iterator_type end ] get_iterators( collection_type );
     iterator_type begin( collection_type );
Index: translator/examples/simplePoly.c
===================================================================
--- translator/examples/simplePoly.c	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ translator/examples/simplePoly.c	(revision a32b204359041ff1f6ef505a929495bcfe7a54f3)
@@ -13,5 +13,5 @@
     int y;
     double x;
-//  if( y )
+//  if ( y )
     q( 3, &x );
 }
Index: translator/examples/test.c
===================================================================
--- translator/examples/test.c	(revision b87a5edee8b2aa6c36e184150ebd60baf4c64251)
+++ 	(revision )
@@ -1,13 +1,0 @@
-#include "fstream.h"
-#include "vector_int.h"
-
-int main() {
-    ofstream *sout = ofstream_stdout();
-    vector_int vec = vector_int_allocate();
-    int index;
-    switch(1) {
-      case 1:
-	sout << vec[ index ];
-    }
-    sout << "\n";
-}
