示例#1
0
 private void D()
 {
     E();
     if (cTk.Type != Token.INTRS)
     {
         return;
     }
     GetToken();
     D();
     {
         FuzzySet s1 = stack.Pop();
         FuzzySet s2 = stack.Pop();
         if (s1.GetType().ToString() != s2.GetType().ToString())
         {
             throw new SemError("Об'єднання множин різних розмірностей невизначене!");
         }
         if (s1 is FuzzySet1D)
         {
             if (s1.Discrete == s2.Discrete)
             {
                 stack.Push((s1 as FuzzySet1D) & (s2 as FuzzySet1D));
             }
             else if (s1.Discrete)
             {
                 s1.Discrete = false;
                 stack.Push((s1 as FuzzySet1D) & (s2 as FuzzySet1D));
             }
             else
             {
                 s2.Discrete = false;
                 stack.Push((s1 as FuzzySet1D) & (s2 as FuzzySet1D));
             }
         }
         if (s1 is FuzzySet2D)
         {
             if (s1.Discrete == s2.Discrete)
             {
                 stack.Push((s1 as FuzzySet2D) & (s2 as FuzzySet2D));
             }
             else if (s1.Discrete)
             {
                 s1.Discrete = false;
                 stack.Push((s1 as FuzzySet2D) & (s2 as FuzzySet2D));
             }
             else
             {
                 s2.Discrete = false;
                 stack.Push((s1 as FuzzySet2D) & (s2 as FuzzySet2D));
             }
         }
     }
 }