コード例 #1
0
        public Expr SubstDefinitions(Expr expr, string procName, out HashSet <string> freeVars)
        {
            var v = new SubstitutionDuplicator(rootSubstitution, verifier, procName);
            var r = v.VisitExpr(expr);

            freeVars = v.freeVars;
            return(r);
        }
コード例 #2
0
 public void Initialize()
 {
     foreach (var v in modSet)
     {
         varDefs[v] = Expr.Ident(v);
     }
     foreach (var cmd in cmds)
     {
         if (cmd.Item2 == null)
         {
             varDefs[cmd.Item1] = null;
         }
         else
         {
             var s = new SubstitutionDuplicator(varDefs);
             var r = (Expr)s.Visit(cmd.Item2);
             varDefs[cmd.Item1] = s.isSubstitutable ? r : null;
         }
     }
 }
コード例 #3
0
            void UpdateAssignment(Variable variable, Expr rhs, Dictionary <Variable, Expr> newVarDefs)
            {
                if ((varDefs.ContainsKey(variable) && varDefs[variable] == null) ||
                    rhs == null)
                {
                    newVarDefs[variable] = null;
                    return;
                }

                var s = new SubstitutionDuplicator(newVarDefs);
                var r = (Expr)s.Visit(rhs);

                if (s.isSubstitutable)
                {
                    newVarDefs[variable] = r;
                }
                else
                {
                    newVarDefs[variable] = null;
                }
            }