Index: src/AST/Expr.cpp
===================================================================
--- src/AST/Expr.cpp	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/AST/Expr.cpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -30,5 +30,5 @@
 #include "Common/SemanticError.h"
 #include "GenPoly/Lvalue.h"        // for referencesPermissable
-#include "ResolvExpr/typeops.h"    // for extractResultType
+#include "ResolvExpr/Unify.h"      // for extractResultType
 #include "Tuples/Tuples.h"         // for makeTupleType
 
Index: src/AST/Node.hpp
===================================================================
--- src/AST/Node.hpp	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/AST/Node.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -19,5 +19,4 @@
 #include <cstddef>     // for nullptr_t
 #include <iosfwd>
-#include <type_traits> // for remove_reference
 
 #include "Common/ErrorObjects.h"  // for SemanticErrorException
@@ -36,6 +35,6 @@
 	Node(const Node&) : strong_count(0), weak_count(0) {}
 	Node(Node&&) : strong_count(0), weak_count(0) {}
-	Node& operator= (const Node&) = delete;
-	Node& operator= (Node&&) = delete;
+	Node& operator=(const Node&) = delete;
+	Node& operator=(Node&&) = delete;
 	virtual ~Node() {}
 
Index: src/AST/SymbolTable.cpp
===================================================================
--- src/AST/SymbolTable.cpp	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/AST/SymbolTable.cpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -22,5 +22,5 @@
 #include "Inspect.hpp"
 #include "Type.hpp"
-#include "CodeGen/OperatorTable.h"  // for isCtorDtorAssign
+#include "CodeGen/OperatorTable.h"         // for isCtorDtorAssign
 #include "Common/SemanticError.h"
 #include "Common/Stats/Counter.h"
@@ -28,5 +28,6 @@
 #include "InitTweak/InitTweak.h"
 #include "ResolvExpr/Cost.h"
-#include "ResolvExpr/typeops.h"
+#include "ResolvExpr/CandidateFinder.hpp"  // for referenceToRvalueConversion
+#include "ResolvExpr/Unify.h"
 #include "SymTab/Mangler.h"
 
Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/CodeGen/CodeGenerator.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -273,36 +273,37 @@
 	}
 
+	template<typename pass_type>
+	inline void genEnumInitializer( PassVisitor<pass_type> * visitor, Type * baseType, std::ostream & output,
+	Initializer * init, long long * cur_val, Options options) {
+		auto baseTypeAsBasic = baseType ? dynamic_cast<BasicType *>( baseType ) : nullptr;
+		if ( init ) { // If value has an explicit initiazatior 
+			output << " = "; 
+			output << "(" << genType(baseType, "", options) << ")";
+			init->accept( *visitor );
+			if ( baseTypeAsBasic && baseTypeAsBasic->isInteger() ) { // if it is an integral type and initilizer offered, 
+			// need to update the cur_val
+				Expression* expr = ((SingleInit *)(init))->value;
+				while ( auto temp = dynamic_cast<CastExpr *>(expr) ) { // unwrap introduced cast
+					expr = temp->arg;
+				}
+				*cur_val = ((ConstantExpr *)expr)->constant.get_ival()+1;
+			}
+		} else if ( baseTypeAsBasic && baseTypeAsBasic->isInteger() ) { // integral implicitly init to cur_val + 1
+			output << " = " << "(" << genType(baseType, "", options) << ")";
+			output << (*cur_val)++;
+		}
+	}
+
 	void CodeGenerator::postvisit( EnumDecl * enumDecl ) {
 		extension( enumDecl );
 		std::list< Declaration* > &memb = enumDecl->get_members();
 		if (enumDecl->base && ! memb.empty()) {
-			unsigned long long last_val = -1; // if the first enum value has no explicit initializer,
-			// as other
+			long long cur_val = 0;
 			for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
 				ObjectDecl * obj = dynamic_cast< ObjectDecl* >( *i );
 				assert( obj );
 				output << "static ";
-				output << genType(enumDecl->base, "", options) << " const ";
-				output << mangleName( obj ) << " ";
-				output << " = ";
-				output << "(" << genType(enumDecl->base, "", options) << ")";
-				if ( (BasicType *)(enumDecl->base) && ((BasicType *)(enumDecl->base))->isWholeNumber() ) {
-					if ( obj->get_init() ) {
-						obj->get_init()->accept( *visitor );
-						Expression* expr = ((SingleInit *)(obj->init))->value;
-						while ( auto temp = dynamic_cast<CastExpr *>(expr) ) {
-							expr = temp->arg;
-						}
-						last_val = ((ConstantExpr *)expr)->constant.get_ival();
-					} else {
-						output << ++last_val;
-					} // if
-				} else {
-					if ( obj->get_init() ) {
-						obj->get_init()->accept( *visitor );
-					} else {
-						// Should not reach here!
-					}
-				}
+				output << genType(enumDecl->base, mangleName( obj ), options);
+				genEnumInitializer( visitor, enumDecl->base, output, obj->get_init(), &cur_val, options);
 				output << ";" << endl;
 			} // for
Index: src/CodeGen/GenType.cc
===================================================================
--- src/CodeGen/GenType.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/CodeGen/GenType.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -255,5 +255,5 @@
 	void GenType::postvisit( EnumInstType * enumInst ) {
 		if ( enumInst->baseEnum && enumInst->baseEnum->base ) {
-			typeString = genType(enumInst->baseEnum->base, "", options) + typeString;
+			typeString = genType(enumInst->baseEnum->base, typeString, options);
 		} else {
 			typeString = enumInst->name + " " + typeString;
Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/GenPoly/Box.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -14,4 +14,6 @@
 //
 
+#include "Box.h"
+
 #include <algorithm>                     // for mismatch
 #include <cassert>                       // for assert, strict_dynamic_cast
@@ -23,6 +25,4 @@
 #include <string>                        // for string, allocator, basic_string
 #include <utility>                       // for pair
-
-#include "Box.h"
 
 #include "CodeGen/OperatorTable.h"
@@ -37,5 +37,5 @@
 #include "InitTweak/InitTweak.h"         // for getFunctionName, isAssignment
 #include "Lvalue.h"                      // for generalizedLvalue
-#include "ResolvExpr/typeops.h"          // for typesCompatible
+#include "ResolvExpr/Unify.h"            // for typesCompatible
 #include "ScopedSet.h"                   // for ScopedSet, ScopedSet<>::iter...
 #include "ScrubTyVars.h"                 // for ScrubTyVars
@@ -911,33 +911,31 @@
 
 			for ( FunctionType const * const funType : functions ) {
-				FunctionType *originalFunction = funType->clone();
-				FunctionType *realFunction = funType->clone();
-				std::string mangleName = SymTab::Mangler::mangle( realFunction );
+				std::string mangleName = SymTab::Mangler::mangle( funType );
 
 				// only attempt to create an adapter or pass one as a parameter if we haven't already done so for this
 				// pre-substitution parameter function type.
 				// The second part of the insert result is "is the value new".
-				if ( adaptersDone.insert( mangleName ).second ) {
-
-					// apply substitution to type variables to figure out what the adapter's type should look like
-					assert( env );
-					env->apply( realFunction );
-					mangleName = SymTab::Mangler::mangle( realFunction );
-					mangleName += makePolyMonoSuffix( originalFunction, exprTyVars );
-
-					typedef ScopedMap< std::string, DeclarationWithType* >::iterator AdapterIter;
-					AdapterIter adapter = adapters.find( mangleName );
-					if ( adapter == adapters.end() ) {
-						// adapter has not been created yet in the current scope, so define it
-						FunctionDecl *newAdapter = makeAdapter( funType, realFunction, mangleName, exprTyVars );
-						std::pair< AdapterIter, bool > answer = adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, newAdapter ) );
-						adapter = answer.first;
-						stmtsToAddBefore.push_back( new DeclStmt( newAdapter ) );
-					} // if
-					assert( adapter != adapters.end() );
-
-					// add the appropriate adapter as a parameter
-					appExpr->get_args().push_front( new VariableExpr( adapter->second ) );
+				if ( !adaptersDone.insert( mangleName ).second ) continue;
+
+				// Apply substitution to type variables to figure out what the adapter's type should look like.
+				assert( env );
+				FunctionType *realType = funType->clone();
+				env->apply( realType );
+				mangleName = SymTab::Mangler::mangle( realType );
+				mangleName += makePolyMonoSuffix( funType, exprTyVars );
+
+				typedef ScopedMap< std::string, DeclarationWithType* >::iterator AdapterIter;
+				AdapterIter adapter = adapters.find( mangleName );
+				if ( adapter == adapters.end() ) {
+					// Adapter has not been created yet in the current scope, so define it.
+					FunctionDecl *newAdapter = makeAdapter( funType, realType, mangleName, exprTyVars );
+					std::pair< AdapterIter, bool > answer = adapters.insert( mangleName, newAdapter );
+					adapter = answer.first;
+					stmtsToAddBefore.push_back( new DeclStmt( newAdapter ) );
 				} // if
+				assert( adapter != adapters.end() );
+
+				// Add the appropriate adapter as a parameter.
+				appExpr->args.push_front( new VariableExpr( adapter->second ) );
 			} // for
 		} // passAdapters
Index: src/GenPoly/GenPoly.cc
===================================================================
--- src/GenPoly/GenPoly.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/GenPoly/GenPoly.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -24,5 +24,7 @@
 #include <vector>                       // for vector
 
+#include "AST/Expr.hpp"
 #include "AST/Type.hpp"
+#include "AST/TypeSubstitution.hpp"
 #include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::const_it...
 #include "ResolvExpr/typeops.h"         // for flatten
@@ -490,4 +492,6 @@
 		}
 
+		/// Flattens a list of types.
+		// There is another flattenList in Unify.
 		void flattenList( vector<ast::ptr<ast::Type>> const & src,
 				vector<ast::ptr<ast::Type>> & out ) {
Index: src/GenPoly/InstantiateGeneric.cc
===================================================================
--- src/GenPoly/InstantiateGeneric.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/GenPoly/InstantiateGeneric.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -28,5 +28,6 @@
 #include "GenPoly.h"                   // for isPolyType, typesPolyCompatible
 #include "InitTweak/InitTweak.h"
-#include "ResolvExpr/typeops.h"
+#include "ResolvExpr/AdjustExprType.hpp"  // for adjustExprType
+#include "ResolvExpr/Unify.h"          // for typesCompatible
 #include "ScopedSet.h"                 // for ScopedSet, ScopedSet<>::iterator
 #include "ScrubTyVars.h"               // for ScrubTyVars
Index: src/GenPoly/InstantiateGenericNew.cpp
===================================================================
--- src/GenPoly/InstantiateGenericNew.cpp	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/GenPoly/InstantiateGenericNew.cpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -32,5 +32,6 @@
 #include "GenPoly/GenPoly.h"           // for isPolyType, typesPolyCompatible
 #include "GenPoly/ScrubTyVars.h"       // for scrubAll
-#include "ResolvExpr/typeops.h"        // for typesCompatible
+#include "ResolvExpr/AdjustExprType.hpp"  // for adjustExprType
+#include "ResolvExpr/Unify.h"          // for typesCompatible
 
 namespace GenPoly {
Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/InitTweak/FixInit.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -39,5 +39,5 @@
 #include "InitTweak.h"                 // for getFunctionName, getCallArg
 #include "ResolvExpr/Resolver.h"       // for findVoidExpression
-#include "ResolvExpr/typeops.h"        // for typesCompatible
+#include "ResolvExpr/Unify.h"          // for typesCompatible
 #include "SymTab/Autogen.h"            // for genImplicitCall
 #include "SymTab/Indexer.h"            // for Indexer
Index: src/InitTweak/FixInitNew.cpp
===================================================================
--- src/InitTweak/FixInitNew.cpp	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/InitTweak/FixInitNew.cpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -26,5 +26,5 @@
 #include "GenPoly/GenPoly.h"           // for getFunctionType
 #include "ResolvExpr/Resolver.h"       // for findVoidExpression
-#include "ResolvExpr/typeops.h"        // for typesCompatible
+#include "ResolvExpr/Unify.h"          // for typesCompatible
 #include "SymTab/Autogen.h"            // for genImplicitCall
 #include "SymTab/Indexer.h"            // for Indexer
Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/InitTweak/InitTweak.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -35,5 +35,5 @@
 #include "GenPoly/GenPoly.h"       // for getFunctionType
 #include "InitTweak.h"
-#include "ResolvExpr/typeops.h"    // for typesCompatibleIgnoreQualifiers
+#include "ResolvExpr/Unify.h"      // for typesCompatibleIgnoreQualifiers
 #include "SymTab/Autogen.h"
 #include "SymTab/Indexer.h"        // for Indexer
Index: src/Parser/TypeData.cc
===================================================================
--- src/Parser/TypeData.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/Parser/TypeData.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -933,5 +933,5 @@
 			member->set_init( new SingleInit( maybeMoveBuild< Expression >( cur->consume_enumeratorValue() ) ) );
 		} else if ( !cur->initializer ) {
-			if ( baseType && (!dynamic_cast<BasicType *>(baseType) || !dynamic_cast<BasicType *>(baseType)->isWholeNumber())) {
+			if ( baseType && (!dynamic_cast<BasicType *>(baseType) || !dynamic_cast<BasicType *>(baseType)->isInteger())) {
 				SemanticError( td->location, "Enumerators of an non-integer typed enum must be explicitly initialized." );
 			}
Index: src/ResolvExpr/AdjustExprType.hpp
===================================================================
--- src/ResolvExpr/AdjustExprType.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
+++ src/ResolvExpr/AdjustExprType.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -0,0 +1,56 @@
+//
+// 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.hpp --
+//
+// Author           : Andrew Beach
+// Created On       : Wed Jan 18  9:56:00 2023
+// Last Modified By : Andrew Beach
+// Last Modified On : Wed Jan 18  9:56:00 2023
+// Update Count     : 0
+//
+
+#pragma once
+
+class Type;
+namespace SymTab {
+	class Indexer;
+}
+namespace ast {
+	class SymbolTable;
+	class Type;
+	class TypeEnvironment;
+}
+
+namespace ResolvExpr {
+
+class TypeEnvironment;
+
+/// Replaces array types with the equivalent pointer, and function types with a pointer-to-function
+void adjustExprType( Type *& type, const TypeEnvironment & env, const SymTab::Indexer & indexer );
+
+/// Replaces array types with the equivalent pointer, and function types with a pointer-to-function using empty TypeEnvironment and Indexer.
+void adjustExprType( Type *& type );
+
+template< typename ForwardIterator >
+void adjustExprTypeList( ForwardIterator begin, ForwardIterator end, const TypeEnvironment & env, const SymTab::Indexer & indexer ) {
+	while ( begin != end ) {
+		adjustExprType( *begin++, env, indexer );
+	} // while
+}
+
+/// Replaces array types with equivalent pointer,
+/// and function types with a pointer-to-function.
+const ast::Type * adjustExprType( const ast::Type * type,
+	const ast::TypeEnvironment & env, const ast::SymbolTable & symtab );
+
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/ResolvExpr/AlternativeFinder.cc
===================================================================
--- src/ResolvExpr/AlternativeFinder.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/AlternativeFinder.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -14,4 +14,6 @@
 //
 
+#include "AlternativeFinder.h"
+
 #include <algorithm>               // for copy
 #include <cassert>                 // for strict_dynamic_cast, assert, assertf
@@ -26,18 +28,22 @@
 
 #include "CompilationState.h"      // for resolvep
+#include "AdjustExprType.hpp"      // for adjustExprType
 #include "Alternative.h"           // for AltList, Alternative
-#include "AlternativeFinder.h"
 #include "AST/Expr.hpp"
 #include "AST/SymbolTable.hpp"
 #include "AST/Type.hpp"
+#include "CastCost.hpp"            // for castCost
 #include "Common/SemanticError.h"  // for SemanticError
 #include "Common/utility.h"        // for deleteAll, printAll, CodeLocation
+#include "ConversionCost.h"        // for conversionCost
 #include "Cost.h"                  // for Cost, Cost::zero, operator<<, Cost...
 #include "ExplodedActual.h"        // for ExplodedActual
 #include "InitTweak/InitTweak.h"   // for getFunctionName
+#include "PolyCost.hpp"            // for polyCost
 #include "RenameVars.h"            // for RenameVars, global_renamer
 #include "ResolveAssertions.h"     // for resolveAssertions
 #include "ResolveTypeof.h"         // for resolveTypeof
 #include "Resolver.h"              // for resolveStmtExpr
+#include "SpecCost.hpp"            // for specCost
 #include "SymTab/Indexer.h"        // for Indexer
 #include "SymTab/Mangler.h"        // for Mangler
@@ -51,6 +57,6 @@
 #include "Tuples/Explode.h"        // for explode
 #include "Tuples/Tuples.h"         // for isTtype, handleTupleAssignment
+#include "typeops.h"               // for combos
 #include "Unify.h"                 // for unify
-#include "typeops.h"               // for adjustExprType, polyCost, castCost
 
 #define PRINT( text ) if ( resolvep ) { text }
Index: src/ResolvExpr/AlternativeFinder.h
===================================================================
--- src/ResolvExpr/AlternativeFinder.h	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/AlternativeFinder.h	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -34,4 +34,9 @@
 namespace ResolvExpr {
 	struct ArgPack;
+
+	Cost computeConversionCost( Type * actualType, Type * formalType, bool actualIsLvalue,
+		const SymTab::Indexer & indexer, const TypeEnvironment & env );
+
+	void referenceToRvalueConversion( Expression *& expr, Cost & cost );
 
 	/// First index is which argument, second index is which alternative for that argument,
Index: src/ResolvExpr/CandidateFinder.cpp
===================================================================
--- src/ResolvExpr/CandidateFinder.cpp	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/CandidateFinder.cpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -23,13 +23,18 @@
 #include <vector>
 
+#include "AdjustExprType.hpp"
 #include "Candidate.hpp"
+#include "CastCost.hpp"           // for castCost
 #include "CompilationState.h"
+#include "ConversionCost.h"       // for conversionCast
 #include "Cost.h"
 #include "ExplodedArg.hpp"
+#include "PolyCost.hpp"
 #include "RenameVars.h"           // for renameTyVars
 #include "Resolver.h"
 #include "ResolveTypeof.h"
 #include "SatisfyAssertions.hpp"
-#include "typeops.h"              // for adjustExprType, conversionCost, polyCost, specCost
+#include "SpecCost.hpp"
+#include "typeops.h"              // for combos
 #include "Unify.h"
 #include "AST/Expr.hpp"
Index: src/ResolvExpr/CandidateFinder.hpp
===================================================================
--- src/ResolvExpr/CandidateFinder.hpp	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/CandidateFinder.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -63,4 +63,9 @@
 	const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
 
+/// Create an expression that preforms reference to rvalue conversion on
+/// the given expression and update the cost of the expression.
+const ast::Expr * referenceToRvalueConversion(
+	const ast::Expr * expr, Cost & cost );
+
 } // namespace ResolvExpr
 
Index: src/ResolvExpr/CastCost.cc
===================================================================
--- src/ResolvExpr/CastCost.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/CastCost.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -13,4 +13,6 @@
 // Update Count     : 9
 //
+
+#include "CastCost.hpp"
 
 #include <cassert>                       // for assert
@@ -22,9 +24,12 @@
 #include "ConversionCost.h"              // for ConversionCost
 #include "Cost.h"                        // for Cost, Cost::infinity
+#include "ResolvExpr/ConversionCost.h"   // for conversionCost
+#include "ResolvExpr/PtrsCastable.hpp"   // for ptrsCastable
 #include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment, EqvClass
+#include "ResolvExpr/typeops.h"          // for ptrsCastable
+#include "ResolvExpr/Unify.h"            // for typesCompatibleIgnoreQualifiers
 #include "SymTab/Indexer.h"              // for Indexer
 #include "SynTree/Declaration.h"         // for TypeDecl, NamedTypeDecl
 #include "SynTree/Type.h"                // for PointerType, Type, TypeInstType
-#include "typeops.h"                     // for typesCompatibleIgnoreQualifiers
 
 #if 0
Index: src/ResolvExpr/CastCost.hpp
===================================================================
--- src/ResolvExpr/CastCost.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
+++ src/ResolvExpr/CastCost.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -0,0 +1,47 @@
+//
+// 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.hpp -- Cost of a cast.
+//
+// Author           : Andrew Beach
+// Created On       : Fri Dec  9 11:28:00 2022
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Dec  9 11:28:00 2022
+// Update Count     : 0
+//
+
+#pragma once
+
+#include "ResolvExpr/Cost.h"     // for Cost
+
+class Type;
+namespace SymTab {
+	class Indexer;
+}
+namespace ast {
+	class SymbolTable;
+	class Type;
+	class TypeEnvironment;
+}
+
+namespace ResolvExpr {
+
+class TypeEnvironment;
+
+Cost castCost(
+	const Type * src, const Type * dest, bool srcIsLvalue,
+	const SymTab::Indexer & indexer, const TypeEnvironment & env );
+Cost castCost(
+	const ast::Type * src, const ast::Type * dst, bool srcIsLvalue,
+	const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
+
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/ResolvExpr/CommonType.cc
===================================================================
--- src/ResolvExpr/CommonType.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/CommonType.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -13,4 +13,6 @@
 // Update Count     : 24
 //
+
+#include "CommonType.hpp"
 
 #include <cassert>                       // for strict_dynamic_cast
Index: src/ResolvExpr/CommonType.hpp
===================================================================
--- src/ResolvExpr/CommonType.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
+++ src/ResolvExpr/CommonType.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -0,0 +1,47 @@
+//
+// 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.hpp --
+//
+// Author           : Andrew Beach
+// Created On       : Tue Jan 17 16:52:00 2023
+// Last Modified By : Andrew Beach
+// Last Modified On : Tue Jan 17 16:52:00 2023
+// Update Count     : 0
+//
+
+#pragma once
+
+#include "AST/Fwd.hpp"
+#include "AST/TypeEnvironment.hpp"  // for AssertionSet, OpenVarSet
+#include "TypeEnvironment.h"        // for AssertionSet, OpenVarSet
+#include "WidenMode.h"              // for WidenMode
+
+class Type;
+namespace SymTab {
+	class Indexer;
+}
+
+namespace ResolvExpr {
+
+Type * commonType(
+	Type * type1, Type * type2, bool widenFirst, bool widenSecond,
+	const SymTab::Indexer & indexer, TypeEnvironment & env,
+	const OpenVarSet & openVars );
+ast::ptr< ast::Type > commonType(
+	const ast::ptr< ast::Type > & type1, const ast::ptr< ast::Type > & type2,
+	ast::TypeEnvironment & env,
+	ast::AssertionSet & need, ast::AssertionSet & have,
+	const ast::OpenVarSet & open, WidenMode widen,
+	const ast::SymbolTable & symtab );
+
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/ResolvExpr/ConversionCost.cc
===================================================================
--- src/ResolvExpr/ConversionCost.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/ConversionCost.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -22,9 +22,9 @@
 #include "ResolvExpr/Cost.h"             // for Cost
 #include "ResolvExpr/TypeEnvironment.h"  // for EqvClass, TypeEnvironment
-#include "ResolvExpr/Unify.h"
+#include "ResolvExpr/Unify.h"            // for typesCompatibleIgnoreQualifiers
+#include "ResolvExpr/PtrsAssignable.hpp" // for ptrsAssignable
 #include "SymTab/Indexer.h"              // for Indexer
 #include "SynTree/Declaration.h"         // for TypeDecl, NamedTypeDecl
 #include "SynTree/Type.h"                // for Type, BasicType, TypeInstType
-#include "typeops.h"                     // for typesCompatibleIgnoreQualifiers
 
 
Index: src/ResolvExpr/ConversionCost.h
===================================================================
--- src/ResolvExpr/ConversionCost.h	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/ConversionCost.h	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -32,4 +32,8 @@
 namespace ResolvExpr {
 	class TypeEnvironment;
+
+	Cost conversionCost(
+		const Type * src, const Type * dest, bool srcIsLvalue,
+		const SymTab::Indexer & indexer, const TypeEnvironment & env );
 
 	typedef std::function<Cost(const Type *, const Type *, bool,
@@ -80,4 +84,12 @@
 	const ast::SymbolTable &, const ast::TypeEnvironment &)>;
 
+Cost conversionCost(
+	const ast::Type * src, const ast::Type * dst, bool srcIsLvalue,
+	const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
+
+Cost convertToReferenceCost( const ast::Type * src, const ast::ReferenceType * dest,
+	bool srcIsLvalue, const ast::SymbolTable & indexer, const ast::TypeEnvironment & env,
+	PtrsCalculation func );
+
 #warning when the old ConversionCost is removed, get ride of the _new suffix.
 class ConversionCost_new : public ast::WithShortCircuiting {
@@ -119,8 +131,4 @@
 };
 
-Cost convertToReferenceCost( const ast::Type * src, const ast::ReferenceType * dest,
-	bool srcIsLvalue, const ast::SymbolTable & indexer, const ast::TypeEnvironment & env,
-	PtrsCalculation func );
-
 } // namespace ResolvExpr
 
Index: src/ResolvExpr/PolyCost.hpp
===================================================================
--- src/ResolvExpr/PolyCost.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
+++ src/ResolvExpr/PolyCost.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -0,0 +1,43 @@
+//
+// 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.hpp --
+//
+// Author           : Andrew Beach
+// Created On       : Tue Jan 17 16:45:00 2023
+// Last Modified By : Andrew Beach
+// Last Modified On : Tue Jan 17 16:45:00 2023
+// Update Count     : 0
+//
+
+#pragma once
+
+class Type;
+namespace SymTab {
+    class Indexer;
+}
+namespace ast {
+    class SymbolTable;
+    class Type;
+    class TypeEnvironment;
+}
+
+namespace ResolvExpr {
+
+class TypeEnvironment;
+
+int polyCost( Type * type,
+	const TypeEnvironment & env, const SymTab::Indexer & indexer );
+int polyCost( const ast::Type * type,
+	const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
+
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/ResolvExpr/PtrsAssignable.cc
===================================================================
--- src/ResolvExpr/PtrsAssignable.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/PtrsAssignable.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -14,5 +14,5 @@
 //
 
-#include "typeops.h"
+#include "PtrsAssignable.hpp"
 
 #include "AST/Pass.hpp"
Index: src/ResolvExpr/PtrsAssignable.hpp
===================================================================
--- src/ResolvExpr/PtrsAssignable.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
+++ src/ResolvExpr/PtrsAssignable.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -0,0 +1,39 @@
+//
+// 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.hpp --
+//
+// Author           : Andrew Beach
+// Created On       : Fri Dec  9 11:40:00 2022
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Dec  9 11:40:00 2022
+// Update Count     : 0
+//
+
+#pragma once
+
+class Type;
+namespace ast {
+	class Type;
+	class TypeEnvironment;
+}
+
+namespace ResolvExpr {
+
+class TypeEnvironment;
+
+int ptrsAssignable( const Type * src, const Type * dest,
+	const TypeEnvironment & env );
+int ptrsAssignable( const ast::Type * src, const ast::Type * dst,
+	const ast::TypeEnvironment & env );
+
+} // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/ResolvExpr/PtrsCastable.cc
===================================================================
--- src/ResolvExpr/PtrsCastable.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/PtrsCastable.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -14,4 +14,6 @@
 //
 
+#include "PtrsCastable.hpp"
+
 #include "AST/Decl.hpp"
 #include "AST/Pass.hpp"
@@ -19,4 +21,5 @@
 #include "AST/TypeEnvironment.hpp"
 #include "Common/PassVisitor.h"
+#include "ResolvExpr/PtrsAssignable.hpp" // for ptrsAssignable
 #include "ResolvExpr/TypeEnvironment.h"  // for EqvClass, TypeEnvironment
 #include "SymTab/Indexer.h"              // for Indexer
@@ -24,5 +27,4 @@
 #include "SynTree/Type.h"                // for TypeInstType, Type, BasicType
 #include "SynTree/Visitor.h"             // for Visitor
-#include "typeops.h"                     // for ptrsAssignable
 
 namespace ResolvExpr {
@@ -291,7 +293,5 @@
 		return objectCast( src, env, symtab );
 	} else {
-		ast::Pass< PtrsCastable_new > ptrs{ dst, env, symtab };
-		src->accept( ptrs );
-		return ptrs.core.result;
+		return ast::Pass<PtrsCastable_new>::read( src, dst, env, symtab );
 	}
 }
Index: src/ResolvExpr/PtrsCastable.hpp
===================================================================
--- src/ResolvExpr/PtrsCastable.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
+++ src/ResolvExpr/PtrsCastable.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -0,0 +1,45 @@
+//
+// 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.hpp --
+//
+// Author           : Andrew Beach
+// Created On       : Mon Jan 16 17:04:00 2023
+// Last Modified By : Andrew Beach
+// Last Modified On : Mon Jan 16 17:04:00 2023
+// Update Count     : 0
+//
+
+#pragma once
+
+class Type;
+namespace SymTab {
+    class Indexer;
+}
+namespace ast {
+    class SymbolTable;
+    class Type;
+    class TypeEnvironment;
+}
+
+namespace ResolvExpr {
+
+class TypeEnvironment;
+
+int ptrsCastable(
+	const Type * src, const Type * dst,
+	const TypeEnvironment & env, const SymTab::Indexer & indexer );
+int ptrsCastable(
+	const ast::Type * src, const ast::Type * dst,
+	const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
+
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/ResolvExpr/RenameVars.cc
===================================================================
--- src/ResolvExpr/RenameVars.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/RenameVars.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -83,17 +83,14 @@
 
 		const ast::TypeInstType * rename( const ast::TypeInstType * type ) {
-			// rename
 			auto it = idMap.find( type->name );
-			if ( it != idMap.end() ) {
-				// unconditionally mutate because map will *always* have different name
-				ast::TypeInstType * mut = ast::shallowCopy( type );
-				// reconcile base node since some copies might have been made
-				mut->base = it->second.base;
-				mut->formal_usage = it->second.formal_usage;
-				mut->expr_id = it->second.expr_id;
-	            type = mut;
-			}
-
-			return type;
+			if ( it == idMap.end() ) return type;
+
+			// Unconditionally mutate because map will *always* have different name.
+			ast::TypeInstType * mut = ast::shallowCopy( type );
+			// Reconcile base node since some copies might have been made.
+			mut->base = it->second.base;
+			mut->formal_usage = it->second.formal_usage;
+			mut->expr_id = it->second.expr_id;
+			return mut;
 		}
 
@@ -187,5 +184,4 @@
 
 const ast::Type * renameTyVars( const ast::Type * t, RenameMode mode, bool reset ) {
-	// ast::Type *tc = ast::deepCopy(t);
 	ast::Pass<RenameVars_new> renamer;
 	renamer.core.mode = mode;
Index: src/ResolvExpr/ResolveAssertions.cc
===================================================================
--- src/ResolvExpr/ResolveAssertions.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/ResolveAssertions.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -26,4 +26,5 @@
 #include <vector>                   // for vector
 
+#include "AdjustExprType.hpp"       // for adjustExprType
 #include "Alternative.h"            // for Alternative, AssertionItem, AssertionList
 #include "Common/FilterCombos.h"    // for filterCombos
@@ -31,10 +32,11 @@
 #include "Common/utility.h"         // for sort_mins
 #include "GenPoly/GenPoly.h"        // for getFunctionType
+#include "ResolvExpr/AlternativeFinder.h"  // for computeConversionCost
 #include "ResolvExpr/RenameVars.h"  // for renameTyVars
+#include "SpecCost.hpp"             // for specCost
 #include "SymTab/Indexer.h"         // for Indexer
 #include "SymTab/Mangler.h"         // for Mangler
 #include "SynTree/Expression.h"     // for InferredParams
 #include "TypeEnvironment.h"        // for TypeEnvironment, etc.
-#include "typeops.h"                // for adjustExprType, specCost
 #include "Unify.h"                  // for unify
 
Index: src/ResolvExpr/SatisfyAssertions.cpp
===================================================================
--- src/ResolvExpr/SatisfyAssertions.cpp	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/SatisfyAssertions.cpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -23,8 +23,11 @@
 #include <vector>
 
+#include "AdjustExprType.hpp"
 #include "Candidate.hpp"
 #include "CandidateFinder.hpp"
+#include "CommonType.hpp"
 #include "Cost.h"
 #include "RenameVars.h"
+#include "SpecCost.hpp"
 #include "typeops.h"
 #include "Unify.h"
Index: src/ResolvExpr/SpecCost.hpp
===================================================================
--- src/ResolvExpr/SpecCost.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
+++ src/ResolvExpr/SpecCost.hpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -0,0 +1,34 @@
+//
+// 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.
+//
+// SpecCost.hpp --
+//
+// Author           : Andrew Beach
+// Created On       : Tue Jan 17 16:49:00 2023
+// Last Modified By : Andrew Beach
+// Last Modified On : Tue Jan 17 16:49:00 2023
+// Update Count     : 0
+//
+
+#pragma once
+
+class Type;
+namespace ast {
+    class Type;
+}
+
+namespace ResolvExpr {
+
+int specCost( Type * type );
+int specCost( const ast::Type * type );
+
+}
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/ResolvExpr/Unify.cc
===================================================================
--- src/ResolvExpr/Unify.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/Unify.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -33,5 +33,7 @@
 #include "AST/TypeEnvironment.hpp"
 #include "Common/PassVisitor.h"     // for PassVisitor
+#include "CommonType.hpp"           // for commonType
 #include "FindOpenVars.h"           // for findOpenVars
+#include "SpecCost.hpp"             // for SpecCost
 #include "SynTree/LinkageSpec.h"    // for C
 #include "SynTree/Constant.h"       // for Constant
@@ -43,5 +45,5 @@
 #include "Tuples/Tuples.h"          // for isTtype
 #include "TypeEnvironment.h"        // for EqvClass, AssertionSet, OpenVarSet
-#include "typeops.h"                // for flatten, occurs, commonType
+#include "typeops.h"                // for flatten, occurs
 
 namespace ast {
@@ -50,5 +52,5 @@
 
 namespace SymTab {
-class Indexer;
+	class Indexer;
 }  // namespace SymTab
 
@@ -56,4 +58,28 @@
 
 namespace ResolvExpr {
+
+// Template Helpers:
+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
+	return ( list1Begin == list1End && list2Begin == list2End );
+}
+
+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
+}
 
 	struct Unify_old : public WithShortCircuiting {
Index: src/ResolvExpr/Unify.h
===================================================================
--- src/ResolvExpr/Unify.h	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/Unify.h	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Sun May 17 13:09:04 2015
-// Last Modified By : Aaron B. Moss
-// Last Modified On : Mon Jun 18 11:58:00 2018
-// Update Count     : 4
+// Last Modified By : Andrew Beach
+// Last Modified On : Tue Jan 17 11:12:00 2023
+// Update Count     : 5
 //
 
@@ -37,56 +37,61 @@
 
 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 unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer, Type *&common );
 
-	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
-	}
+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 unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer, Type *&common );
 
-	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
-	}
+bool typesCompatible( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment & env );
+bool typesCompatibleIgnoreQualifiers( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment & env );
 
-	bool unify( 
-		const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2, 
-		ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have, 
-		ast::OpenVarSet & open, const ast::SymbolTable & symtab );
+inline bool typesCompatible( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) {
+	TypeEnvironment env;
+	return typesCompatible( t1, t2, indexer, env );
+}
 
-	bool unify( 
-		const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2, 
-		ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have, 
-		ast::OpenVarSet & open, const ast::SymbolTable & symtab, ast::ptr<ast::Type> & common );
+inline bool typesCompatibleIgnoreQualifiers( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) {
+	TypeEnvironment env;
+	return typesCompatibleIgnoreQualifiers( t1, t2, indexer, env );
+}
 
-	bool unifyExact( 
-		const ast::Type * type1, const ast::Type * type2, ast::TypeEnvironment & env, 
-		ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open, 
-		WidenMode widen, const ast::SymbolTable & symtab );
+bool unify(
+	const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,
+	ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
+	ast::OpenVarSet & open, const ast::SymbolTable & symtab );
 
-	bool unifyInexact( 
-		const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2, 
-		ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have, 
-		const ast::OpenVarSet & open, WidenMode widen, const ast::SymbolTable & symtab, 
-		ast::ptr<ast::Type> & common );
+bool unify(
+	const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,
+	ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
+	ast::OpenVarSet & open, const ast::SymbolTable & symtab, ast::ptr<ast::Type> & common );
+
+bool unifyExact(
+	const ast::Type * type1, const ast::Type * type2, ast::TypeEnvironment & env,
+	ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open,
+	WidenMode widen, const ast::SymbolTable & symtab );
+
+bool unifyInexact(
+	const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,
+	ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
+	const ast::OpenVarSet & open, WidenMode widen, const ast::SymbolTable & symtab,
+	ast::ptr<ast::Type> & common );
+
+bool typesCompatible(
+	const ast::Type *, const ast::Type *, const ast::SymbolTable & symtab = {},
+	const ast::TypeEnvironment & env = {} );
+
+bool typesCompatibleIgnoreQualifiers(
+	const ast::Type *, const ast::Type *, const ast::SymbolTable & symtab = {},
+	const ast::TypeEnvironment & env = {} );
+
+/// Creates the type represented by the list of returnVals in a FunctionType.
+/// The caller owns the return value.
+Type * extractResultType( FunctionType * functionType );
+/// Creates or extracts the type represented by returns in a `FunctionType`.
+ast::ptr<ast::Type> extractResultType( const ast::FunctionType * func );
+
+std::vector<ast::ptr<ast::Type>> flattenList(
+	const std::vector<ast::ptr<ast::Type>> & src, ast::TypeEnvironment & env
+);
 
 } // namespace ResolvExpr
Index: src/ResolvExpr/WidenMode.h
===================================================================
--- src/ResolvExpr/WidenMode.h	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/WidenMode.h	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -19,5 +19,5 @@
 	struct WidenMode {
 		WidenMode( bool first, bool second ): first( first ), second( second ) {}
-		
+
 		WidenMode &operator|=( const WidenMode &other ) {
 			first |= other.first; second |= other.second; return *this;
@@ -35,5 +35,5 @@
 			WidenMode newWM( *this ); newWM &= other; return newWM;
 		}
-		
+
 		operator bool() { return first && second; }
 
Index: src/ResolvExpr/module.mk
===================================================================
--- src/ResolvExpr/module.mk	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/module.mk	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -17,4 +17,5 @@
 SRC_RESOLVEXPR = \
       ResolvExpr/AdjustExprType.cc \
+      ResolvExpr/AdjustExprType.hpp \
       ResolvExpr/Alternative.cc \
       ResolvExpr/AlternativeFinder.cc \
@@ -26,5 +27,7 @@
       ResolvExpr/Candidate.hpp \
       ResolvExpr/CastCost.cc \
+      ResolvExpr/CastCost.hpp \
       ResolvExpr/CommonType.cc \
+      ResolvExpr/CommonType.hpp \
       ResolvExpr/ConversionCost.cc \
       ResolvExpr/ConversionCost.h \
@@ -40,6 +43,9 @@
       ResolvExpr/Occurs.cc \
       ResolvExpr/PolyCost.cc \
+      ResolvExpr/PolyCost.hpp \
       ResolvExpr/PtrsAssignable.cc \
+      ResolvExpr/PtrsAssignable.hpp \
       ResolvExpr/PtrsCastable.cc \
+      ResolvExpr/PtrsCastable.hpp \
       ResolvExpr/RenameVars.cc \
       ResolvExpr/RenameVars.h \
@@ -54,4 +60,5 @@
       ResolvExpr/SatisfyAssertions.hpp \
       ResolvExpr/SpecCost.cc \
+      ResolvExpr/SpecCost.hpp \
       ResolvExpr/TypeEnvironment.cc \
       ResolvExpr/TypeEnvironment.h \
Index: src/ResolvExpr/typeops.h
===================================================================
--- src/ResolvExpr/typeops.h	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/ResolvExpr/typeops.h	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -10,6 +10,6 @@
 // Created On       : Sun May 17 07:28:22 2015
 // Last Modified By : Andrew Beach
-// Last Modified On : Tue Oct  1 09:45:00 2019
-// Update Count     : 6
+// Last Modified On : Wed Jan 18 11:54:00 2023
+// Update Count     : 7
 //
 
@@ -18,13 +18,5 @@
 #include <vector>
 
-#include "Cost.h"
-#include "TypeEnvironment.h"
-#include "WidenMode.h"
-#include "AST/Fwd.hpp"
-#include "AST/Node.hpp"
-#include "AST/SymbolTable.hpp"
 #include "AST/Type.hpp"
-#include "AST/TypeEnvironment.hpp"
-#include "SynTree/SynTree.h"
 #include "SynTree/Type.h"
 
@@ -34,4 +26,6 @@
 
 namespace ResolvExpr {
+	class TypeEnvironment;
+
 	// 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
@@ -61,99 +55,4 @@
 	}
 
-	// in AdjustExprType.cc
-	/// Replaces array types with the equivalent pointer, and function types with a pointer-to-function
-	void adjustExprType( Type *& type, const TypeEnvironment & env, const SymTab::Indexer & indexer );
-
-	/// Replaces array types with the equivalent pointer, and function types with a pointer-to-function using empty TypeEnvironment and Indexer
-	void adjustExprType( Type *& type );
-
-	template< typename ForwardIterator >
-	void adjustExprTypeList( ForwardIterator begin, ForwardIterator end, const TypeEnvironment & env, const SymTab::Indexer & indexer ) {
-		while ( begin != end ) {
-			adjustExprType( *begin++, env, indexer );
-		} // while
-	}
-
-	/// Replaces array types with equivalent pointer, and function types with a pointer-to-function
-	const ast::Type * adjustExprType(
-		const ast::Type * type, const ast::TypeEnvironment & env, const ast::SymbolTable & symtab );
-
-	// in CastCost.cc
-	Cost castCost( const Type * src, const Type * dest, bool srcIsLvalue,
-		const SymTab::Indexer & indexer, const TypeEnvironment & env );
-	Cost castCost(
-		const ast::Type * src, const ast::Type * dst, bool srcIsLvalue,
-		const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
-
-	// in ConversionCost.cc
-	Cost conversionCost( const Type * src, const Type * dest, bool srcIsLvalue,
-		const SymTab::Indexer & indexer, const TypeEnvironment & env );
-	Cost conversionCost(
-		const ast::Type * src, const ast::Type * dst, bool srcIsLvalue,
-		const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
-
-	// in AlternativeFinder.cc
-	Cost computeConversionCost( Type * actualType, Type * formalType, bool actualIsLvalue,
-		const SymTab::Indexer & indexer, const TypeEnvironment & env );
-
-	// in PtrsAssignable.cc
-	int ptrsAssignable( const Type * src, const Type * dest, const TypeEnvironment & env );
-	int ptrsAssignable( const ast::Type * src, const ast::Type * dst,
-		const ast::TypeEnvironment & env );
-
-	// in PtrsCastable.cc
-	int ptrsCastable( const Type * src, const Type * dest, const TypeEnvironment & env, const SymTab::Indexer & indexer );
-	int ptrsCastable(
-		const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab,
-		const ast::TypeEnvironment & env );
-
-	// in Unify.cc
-	bool typesCompatible( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment & env );
-	bool typesCompatibleIgnoreQualifiers( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment & env );
-
-	inline bool typesCompatible( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) {
-		TypeEnvironment env;
-		return typesCompatible( t1, t2, indexer, env );
-	}
-
-	inline bool typesCompatibleIgnoreQualifiers( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) {
-		TypeEnvironment env;
-		return typesCompatibleIgnoreQualifiers( t1, t2, indexer, env );
-	}
-
-	bool typesCompatible(
-		const ast::Type *, const ast::Type *, const ast::SymbolTable & symtab = {},
-		const ast::TypeEnvironment & env = {} );
-
-	bool typesCompatibleIgnoreQualifiers(
-		const ast::Type *, const ast::Type *, const ast::SymbolTable &,
-		const ast::TypeEnvironment & env = {} );
-
-	/// creates the type represented by the list of returnVals in a FunctionType. The caller owns the return value.
-	Type * extractResultType( FunctionType * functionType );
-	/// Creates or extracts the type represented by the list of returns in a `FunctionType`.
-	ast::ptr<ast::Type> extractResultType( const ast::FunctionType * func );
-
-	// in CommonType.cc
-	Type * commonType( Type * type1, Type * type2, bool widenFirst, bool widenSecond, const SymTab::Indexer & indexer, TypeEnvironment & env, const OpenVarSet & openVars );
-	ast::ptr< ast::Type > commonType(
-		const ast::ptr< ast::Type > & type1, const ast::ptr< ast::Type > & type2,
-			ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
-			const ast::OpenVarSet & open, WidenMode widen, const ast::SymbolTable & symtab
-	);
-	// in Unify.cc
-	std::vector< ast::ptr< ast::Type > > flattenList(
-		const std::vector< ast::ptr< ast::Type > > & src, ast::TypeEnvironment & env
-	);
-
-	// in PolyCost.cc
-	int polyCost( Type * type, const TypeEnvironment & env, const SymTab::Indexer & indexer );
-	int polyCost(
-		const ast::Type * type, const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
-
-	// in SpecCost.cc
-	int specCost( Type * type );
-	int specCost( const ast::Type * type );
-
 	// in Occurs.cc
 	bool occurs( const Type * type, const std::string & varName, const TypeEnvironment & env );
@@ -168,9 +67,4 @@
 		return false;
 	}
-
-	// in AlternativeFinder.cc
-	void referenceToRvalueConversion( Expression *& expr, Cost & cost );
-	// in CandidateFinder.cpp
-	const ast::Expr * referenceToRvalueConversion( const ast::Expr * expr, Cost & cost );
 
 	/// flatten tuple type into list of types
@@ -218,5 +112,4 @@
 		}
 
-
 		return new ast::TupleType{ std::move(types) };
 	}
@@ -227,6 +120,4 @@
 		return tupleFromTypes( tys.begin(), tys.end() );
 	}
-
-	
 
 	// in TypeEnvironment.cc
Index: src/SymTab/Indexer.cc
===================================================================
--- src/SymTab/Indexer.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/SymTab/Indexer.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -31,5 +31,6 @@
 #include "InitTweak/InitTweak.h"   // for isConstructor, isCopyFunction, isC...
 #include "Mangler.h"               // for Mangler
-#include "ResolvExpr/typeops.h"    // for typesCompatible
+#include "ResolvExpr/AlternativeFinder.h"  // for referenceToRvalueConversion
+#include "ResolvExpr/Unify.h"      // for typesCompatible
 #include "SynTree/LinkageSpec.h"   // for isMangled, isOverridable, Spec
 #include "SynTree/Constant.h"      // for Constant
Index: src/SymTab/Mangler.cc
===================================================================
--- src/SymTab/Mangler.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/SymTab/Mangler.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -439,5 +439,5 @@
 		  private:
 			void mangleDecl( const ast::DeclWithType *declaration );
-			void mangleRef( const ast::BaseInstType *refType, std::string prefix );
+			void mangleRef( const ast::BaseInstType *refType, const std::string & prefix );
 
 			void printQualifiers( const ast::Type *type );
@@ -535,12 +535,4 @@
 		}
 
-		__attribute__((unused))
-		inline std::vector< ast::ptr< ast::Type > > getTypes( const std::vector< ast::ptr< ast::DeclWithType > > & decls ) {
-			std::vector< ast::ptr< ast::Type > > ret;
-			std::transform( decls.begin(), decls.end(), std::back_inserter( ret ),
-							std::mem_fun( &ast::DeclWithType::get_type ) );
-			return ret;
-		}
-
 		void Mangler_new::postvisit( const ast::FunctionType * functionType ) {
 			printQualifiers( functionType );
@@ -558,19 +550,18 @@
 		}
 
-		void Mangler_new::mangleRef( const ast::BaseInstType * refType, std::string prefix ) {
+		void Mangler_new::mangleRef(
+				const ast::BaseInstType * refType, const std::string & prefix ) {
 			printQualifiers( refType );
 
 			mangleName += prefix + std::to_string( refType->name.length() ) + refType->name;
 
-			if ( mangleGenericParams ) {
-				if ( ! refType->params.empty() ) {
-					mangleName += "_";
-					for ( const ast::Expr * param : refType->params ) {
-						auto paramType = dynamic_cast< const ast::TypeExpr * >( param );
-						assertf(paramType, "Aggregate parameters should be type expressions: %s", toCString(param));
-						maybeAccept( paramType->type.get(), *visitor );
-					}
-					mangleName += "_";
+			if ( mangleGenericParams && ! refType->params.empty() ) {
+				mangleName += "_";
+				for ( const ast::Expr * param : refType->params ) {
+					auto paramType = dynamic_cast< const ast::TypeExpr * >( param );
+					assertf(paramType, "Aggregate parameters should be type expressions: %s", toCString(param));
+					maybeAccept( paramType->type.get(), *visitor );
 				}
+				mangleName += "_";
 			}
 		}
@@ -656,4 +647,5 @@
 		}
 
+		// For debugging:
 		__attribute__((unused)) void printVarMap( const std::map< std::string, std::pair< int, int > > &varMap, std::ostream &os ) {
 			for ( std::map< std::string, std::pair< int, int > >::const_iterator i = varMap.begin(); i != varMap.end(); ++i ) {
@@ -665,36 +657,34 @@
 			// skip if not including qualifiers
 			if ( typeMode ) return;
-			if ( auto ptype = dynamic_cast< const ast::FunctionType * >(type) ) {
-				if ( ! ptype->forall.empty() ) {
-					std::list< std::string > assertionNames;
-					int dcount = 0, fcount = 0, vcount = 0, acount = 0;
-					mangleName += Encoding::forall;
-					for ( auto & decl : ptype->forall ) {
-						switch ( decl->kind ) {
-						  case ast::TypeDecl::Kind::Dtype:
-							dcount++;
-							break;
-						  case ast::TypeDecl::Kind::Ftype:
-							fcount++;
-							break;
-						  case ast::TypeDecl::Kind::Ttype:
-							vcount++;
-							break;
-						  default:
-							assertf( false, "unimplemented kind for type variable %s", SymTab::Mangler::Encoding::typeVariables[decl->kind].c_str() );
-						} // switch
-						varNums[ decl->name ] = std::make_pair( nextVarNum, (int)decl->kind );
-					} // for
-					for ( auto & assert : ptype->assertions ) {
-						assertionNames.push_back( ast::Pass<Mangler_new>::read(
-							assert->var.get(),
-							mangleOverridable, typeMode, mangleGenericParams, nextVarNum, varNums ) );
-						acount++;
-					} // for
-					mangleName += std::to_string( dcount ) + "_" + std::to_string( fcount ) + "_" + std::to_string( vcount ) + "_" + std::to_string( acount ) + "_";
-					for(const auto & a : assertionNames) mangleName += a;
-//					std::copy( assertionNames.begin(), assertionNames.end(), std::ostream_iterator< std::string >( mangleName, "" ) );
-					mangleName += "_";
-				} // if
+			auto funcType = dynamic_cast<const ast::FunctionType *>( type );
+			if ( funcType && !funcType->forall.empty() ) {
+				std::list< std::string > assertionNames;
+				int dcount = 0, fcount = 0, vcount = 0, acount = 0;
+				mangleName += Encoding::forall;
+				for ( auto & decl : funcType->forall ) {
+					switch ( decl->kind ) {
+					case ast::TypeDecl::Dtype:
+						dcount++;
+						break;
+					case ast::TypeDecl::Ftype:
+						fcount++;
+						break;
+					case ast::TypeDecl::Ttype:
+						vcount++;
+						break;
+					default:
+						assertf( false, "unimplemented kind for type variable %s", SymTab::Mangler::Encoding::typeVariables[decl->kind].c_str() );
+					} // switch
+					varNums[ decl->name ] = std::make_pair( nextVarNum, (int)decl->kind );
+				} // for
+				for ( auto & assert : funcType->assertions ) {
+					assertionNames.push_back( ast::Pass<Mangler_new>::read(
+						assert->var.get(),
+						mangleOverridable, typeMode, mangleGenericParams, nextVarNum, varNums ) );
+					acount++;
+				} // for
+				mangleName += std::to_string( dcount ) + "_" + std::to_string( fcount ) + "_" + std::to_string( vcount ) + "_" + std::to_string( acount ) + "_";
+				for ( const auto & a : assertionNames ) mangleName += a;
+				mangleName += "_";
 			} // if
 			if ( ! inFunctionType ) {
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/SymTab/Validate.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -63,5 +63,6 @@
 #include "InitTweak/GenInit.h"         // for fixReturnStatements
 #include "InitTweak/InitTweak.h"       // for isCtorDtorAssign
-#include "ResolvExpr/typeops.h"        // for typesCompatible
+#include "ResolvExpr/typeops.h"        // for extractResultType
+#include "ResolvExpr/Unify.h"          // for typesCompatible
 #include "ResolvExpr/Resolver.h"       // for findSingleExpression
 #include "ResolvExpr/ResolveTypeof.h"  // for resolveTypeof
Index: src/SynTree/ApplicationExpr.cc
===================================================================
--- src/SynTree/ApplicationExpr.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/SynTree/ApplicationExpr.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// ApplicationExpr.cc.cc --
+// ApplicationExpr.cc --
 //
 // Author           : Richard C. Bilson
@@ -26,5 +26,5 @@
 #include "Expression.h"          // for ParamEntry, ApplicationExpr, Expression
 #include "InitTweak/InitTweak.h" // for getFunction
-#include "ResolvExpr/typeops.h"  // for extractResultType
+#include "ResolvExpr/Unify.h"    // for extractResultType
 #include "Type.h"                // for Type, PointerType, FunctionType
 
Index: src/SynTree/BasicType.cc
===================================================================
--- src/SynTree/BasicType.cc	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/SynTree/BasicType.cc	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -29,21 +29,4 @@
 }
 
-bool BasicType::isWholeNumber() const {
-	return kind == Bool || 
-		kind ==Char ||
-		kind == SignedChar ||
-		kind == UnsignedChar ||
-		kind == ShortSignedInt ||
-		kind == ShortUnsignedInt ||
-		kind == SignedInt ||
-		kind == UnsignedInt ||
-		kind == LongSignedInt ||
-		kind == LongUnsignedInt ||
-		kind == LongLongSignedInt ||
-		kind ==LongLongUnsignedInt ||
-		kind == SignedInt128 ||
-		kind == UnsignedInt128;
-}
-
 bool BasicType::isInteger() const {
 	return kind <= UnsignedInt128;
Index: src/SynTree/Type.h
===================================================================
--- src/SynTree/Type.h	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/SynTree/Type.h	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -271,5 +271,4 @@
 	virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
 	virtual void print( std::ostream & os, Indenter indent = {} ) const override;
-	bool isWholeNumber() const;
 	bool isInteger() const;
 };
Index: src/Validate/FixReturnTypes.cpp
===================================================================
--- src/Validate/FixReturnTypes.cpp	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/Validate/FixReturnTypes.cpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -20,5 +20,5 @@
 #include "AST/Type.hpp"
 #include "CodeGen/CodeGenerator.h"
-#include "ResolvExpr/typeops.h"
+#include "ResolvExpr/Unify.h"
 
 namespace ast {
Index: src/Validate/ReplaceTypedef.cpp
===================================================================
--- src/Validate/ReplaceTypedef.cpp	(revision 466787ab63d68db4ce9258a2f78369073fd88777)
+++ src/Validate/ReplaceTypedef.cpp	(revision ad861ef542966cb370b0bd630dcdc2e48cd4ecb8)
@@ -20,5 +20,5 @@
 #include "Common/UniqueName.h"
 #include "Common/utility.h"
-#include "ResolvExpr/typeops.h"
+#include "ResolvExpr/Unify.h"
 
 namespace Validate {
