Example #1
0
 /**
  * Set a specific realistic domain.
  *
  * @param   mixed         $offset     Offset.
  * @param   \Hoa\Realdom  $realdom    Realistic domain.
  * @return  \Hoa\Realdom\Disjunction
  * @throws  \Hoa\Realdom\Exception
  */
 public function offsetSet($offset, $realdom)
 {
     if ($realdom instanceof self) {
         foreach ($realdom as $_realdom) {
             $this->_offsetSet(null, $_realdom);
         }
         return $this;
     }
     if ($realdom instanceof Crate\Variable) {
         $this->__realdoms[] = $realdom;
         $unfolded = 1;
         foreach ($realdom->getDomains() as $_realdom) {
             $this->_offsetSet(null, $_realdom, false);
             ++$unfolded;
         }
         $this->__matches[] = $unfolded;
         return $this;
     }
     return $this->_offsetSet($offset, $realdom);
 }