protected static function toCanonicalForm($config, $key = 'operand')
    {
        if (!is_array($config)) {
            return array($key => $config);

        } elseif (array_key_exists('operator', $config)
                  || array_key_exists('operand', $config)
        ) {
            return $config;

        } elseif (1 == count($config)) {
            return array($key => end($config));

        } else {
            return array('operator' => reset($config), 'operand' => end($config));
        }
    }