code: private WyalFile.Stmt flattenUpto(AssumptionSet assumptions, AssumptionSet ancestor) {
  
  		if (assumptions == ancestor) {
  			// We have reached the ancestor
  			return null;
  		} else {
  			// Flattern parent assumptions
  			AssumptionSet[] parents = assumptions.parents;
  			WyalFile.Stmt e = null;
  			switch (parents.length) {
  			case 0:
  				// do nothing
  				break;
  			case 1:
  				// easy
  				e = flattenUpto(parents[0], ancestor);
  				break;
  			default:
  				// harder
  				AssumptionSet lca = assumptions.commonAncestor;
  				WyalFile.Stmt factor = flattenUpto(lca, ancestor);
  				for (int i = 0; i != parents.length; ++i) {
  					e = or(e, flattenUpto(parents[i], lca));
  				}
  				e = and(factor, e);
  			}
  
  			// Combine with local assumptions (if applicable)
  			WyalFile.Stmt[] local = assumptions.assumptions;
  			for (int i = 0; i != local.length; ++i) {
  				e = and(e, local[i]);
  			}
  			//
  			return e;
  		}
  	}
docs: Flatten an assumption set upto a given ancestor. That is, do not include the
  ancestor or any of its ancestors in the results. This is a little like taking
  the difference of the given assumptions and the given ancestor's assumptions.
  
  @param assumptions
  The assumption set to be flattened
  @param ancestor
  An ancestor of the given assumption set, or null to indicate all
  ancestors should be included
  @return