Пример #1
0
 public void setName(VarI1 var, Name.Asserted name)
 {
     if (this.vars.Contain(var))
     {
         if (
             this.namings
             .Where(x => x.Key != var)
             .Select(x => x.Value)
             .Contain_eqDefault <Name.Asserted, nilnul.name.Eq>(name)
             )
         {
             throw new Exception("there are conflicting names.");
         }
         else
         {
             _namings[var] = name;
         }
     }
     else
     {
         if (
             this.namings
             .Select(x => x.Value)
             .Contain_eqDefault <Name.Asserted, nilnul.name.Eq>(name)
             )
         {
             throw new Exception("there are conflicting names.");
         }
         else
         {
             _namings[var] = name;                      // If the specified key is not found, a get operation throws a KeyNotFoundException, and a set operation creates a new element with the specified key.
         }
     }
 }
Пример #2
0
 public Name.Asserted getEnsuredName(VarI1 var)
 {
     if (!_namings.ContainsKey(var))
     {
         var _previousAutoName1 = getNextAutoName();
         setName(var, _previousAutoName1);
         return(_previousAutoName1);
     }
     else
     {
         return(_namings[var]);
     }
 }
Пример #3
0
        public Name.Asserted getEnsuredName(VarI1 var)
        {
            if (!_namings.ContainsKey(var))
            {
                setName(var, _previousAutoName1 = getNextAutoName());
                return(_previousAutoName1);
            }
            else
            {
                return(_namings[var]);
            }
            //return _names[var];

            //throw new NotImplementedException();
        }
Пример #4
0
 public void setName(VarI1 var, string name)
 {
     setName(var, new Name.Asserted(name));
 }
Пример #5
0
 static public bool NotContain(this IEnumerable <VarI1> str, VarI1 x)
 {
     return(!str.Contain(x));
 }
Пример #6
0
 static public bool Contain(this IEnumerable <VarI1> str, VarI1 x)
 {
     return(str.Contains(x, var.Eq_ofVarI.Instance));
 }