public Expression Extract(Expression extra) { Expression e; if (extra != null) { var conjunctsPlusExtra = new List <Expression>(conjuncts); conjunctsPlusExtra.Add(extra); e = AH.CombineExpressionsWithAnd(conjunctsPlusExtra); } else { if (conjuncts.Count == 0) { return(null); } e = AH.CombineExpressionsWithAnd(conjuncts); } for (int i = variableNames.Count - 1; i >= 0; --i) { e = AH.MakeLet1Expr(variableNames[i], variableValues[i], e); } return(e); }
public Expression Extract() { if (body == null) { Fail("Internal error: Attempt to extract before body is set"); } if (!valid) { return(null); } var e = body; for (int i = variableNames.Count - 1; i >= 0; --i) { e = AH.MakeLet1Expr(variableNames[i], variableValues[i], e); } return(e); }