original_string: private static function alternative($feature) {
          if ($feature->getAlternative()) {
              $children = array();
              foreach ($feature->getChildren() as $child)
                  $children[] = Logic::is($child);
  
              $alternativeConstraints = array();
              for ($i = 0; $i < count($children); $i++)
                  for ($j = 0; $j < $i; $j++)
                      $alternativeConstraints[] = Logic::not(Logic::_and($children[$i], $children[$j]));
  
              return Logic::_and(Logic::equiv(Logic::is($feature),
                                              call_user_func_array("\FeaturePhp\Helper\Logic::_or", $children)),
                                 call_user_func_array("\FeaturePhp\Helper\Logic::_and", $alternativeConstraints));
          }
      }
code: private static function alternative($feature) {
          if ($feature->getAlternative()) {
              $children = array();
              foreach ($feature->getChildren() as $child)
                  $children[] = Logic::is($child);
  
              $alternativeConstraints = array();
              for ($i = 0; $i < count($children); $i++)
                  for ($j = 0; $j < $i; $j++)
                      $alternativeConstraints[] = Logic::not(Logic::_and($children[$i], $children[$j]));
  
              return Logic::_and(Logic::equiv(Logic::is($feature),
                                              call_user_func_array("\FeaturePhp\Helper\Logic::_or", $children)),
                                 call_user_func_array("\FeaturePhp\Helper\Logic::_and", $alternativeConstraints));
          }
      }
code_tokens: private static function alternative ( $ feature ) { if ( $ feature -> getAlternative ( ) ) { $ children = array ( ) ; foreach ( $ feature -> getChildren ( ) as $ child ) $ children [ ] = Logic :: is ( $ child ) ; $ alternativeConstraints = array ( ) ; for ( $ i = 0 ; $ i < count ( $ children ) ; $ i ++ ) for ( $ j = 0 ; $ j < $ i ; $ j ++ ) $ alternativeConstraints [ ] = Logic :: not ( Logic :: _and ( $ children [ $ i ] , $ children [ $ j ] ) ) ; return Logic :: _and ( Logic :: equiv ( Logic :: is ( $ feature ) , call_user_func_array ( "\FeaturePhp\Helper\Logic::_or" , $ children ) ) , call_user_func_array ( "\FeaturePhp\Helper\Logic::_and" , $ alternativeConstraints ) ) ; } }
docstring: Semantics for a feature that provides an alternative choice.
  Exactly one child of such a feature is selected.
  @param Feature $feature
  @return callable
docstring_tokens: Semantics for a feature that provides an alternative choice . Exactly one child of such a feature is selected .