public ModStrideConstraint GetStrideConstraint(string variable, object regionId) { if (!strideConstraintMap.ContainsKey(regionId)) { return(null); } else { int id; var strippedVariable = GVUtil.StripThreadIdentifier(variable, out id); ModStrideConstraint msc; if (strideConstraintMap[regionId].TryGetValue(strippedVariable, out msc)) { return(new ModStrideConstraint(verifier.MaybeDualise(msc.mod, id, impl.Name), verifier.MaybeDualise(msc.modEq, id, impl.Name))); } else { return(null); } } }
public override Expr VisitIdentifierExpr(IdentifierExpr expr) { int id; var varName = GVUtil.StripThreadIdentifier(expr.Name, out id); if (!defs.ContainsKey(varName)) { // The variable never assigned to in the procedure return(base.VisitIdentifierExpr(expr)); } else if (defs[varName] == null) { // The variable has been assigned to, but we do not know what was assigned. freeVars.Add(varName); return(base.VisitIdentifierExpr(expr)); } else { return(verifier.MaybeDualise(VisitExpr(defs[varName]), id, procName)); } }