Пример #1
0
 internal DafnyModelVariable(DafnyModelState state, Model.Element element,
                             string name, DafnyModelVariable parent)
 {
     this.state = state;
     Element    = element;
     Type       = state.Model.GetDafnyType(element);
     children   = new Dictionary <string, HashSet <DafnyModelVariable> >();
     state.AddVar(element, this);
     if (parent == null)
     {
         Name = name;
     }
     else
     {
         // TODO: a case can be made for refactoring this so that the indices
         // are model-wide rather than state-wide
         Name = "@" + state.VarIndex++;
         parent.AddChild(name, this);
     }
     state.AddVarName(ShortName);
 }