Пример #1
0
 /// <summary>
 /// Converts a Bindings Clause to a Multiset
 /// </summary>
 /// <returns></returns>
 public BaseMultiset ToMultiset()
 {
     if (this._vars.Any())
     {
         Multiset m = new Multiset();
         foreach (String var in this._vars)
         {
             m.AddVariable(var);
         }
         foreach (BindingTuple tuple in this._tuples)
         {
             m.Add(new Set(tuple));
         }
         return(m);
     }
     else
     {
         return(new IdentityMultiset());
     }
 }
 /// <summary>
 /// Handles a Variable by adding it to the Multiset.
 /// </summary>
 /// <param name="var">Variable.</param>
 /// <returns></returns>
 protected override bool HandleVariableInternal(string var)
 {
     _mset.AddVariable(var);
     return(true);
 }