function permute($target, $path)
{
    foreach (range(0, 4) as $x1) {
        foreach (range(0, 4) as $x2) {
            if ($x2 == $x1) {
                continue;
            }
            foreach (range(0, 4) as $x3) {
                if (count(array_filter([$x1, $x2], function ($_) use($x3) {
                    return $_ == $x3;
                }))) {
                    continue;
                }
                foreach (range(0, 4) as $x4) {
                    if (count(array_filter([$x1, $x2, $x3], function ($_) use($x4) {
                        return $_ == $x4;
                    }))) {
                        continue;
                    }
                    foreach (range(0, 4) as $x5) {
                        if (count(array_filter([$x1, $x2, $x3, $x4], function ($_) use($x5) {
                            return $_ == $x5;
                        }))) {
                            continue;
                        }
                        $ra = new Regexp_Assemble();
                        $ra->insert($path[$x1])->insert($path[$x2])->insert($path[$x3])->insert($path[$x4])->insert($path[$x5]);
                        is_deeply($ra->__path, $target, 'join: /' . join('/ /', array(join('', $path[$x1]), join('', $path[$x2]), join('', $path[$x3]), join('', $path[$x4]), join('', $path[$x5]))) . '/\\n' . $ra->dump() . ' versus ' . $ra->_dump($target) . "\n");
                    }
                }
            }
        }
    }
}
is_deeply($rt->_unrev_node(['ab' => ['ab', 'bc'], 'bc' => ['bc', 'cd', 'de', 'ef', 'fg', 'gh'], 'ef' => ['ef', 'gh', 'ij']], $context), ['bc' => ['bc', 'ab'], 'gh' => ['gh', 'fg', 'ef', 'de', 'cd', 'bc'], 'ij' => ['ij', 'gh', 'ef']], 'node(ab,bc,ef)');
is_deeply($rt->_unrev_node(['' => 0, 'b' => [[['b' => ['b'], 'b?' => [['' => 0, 'b' => ['b']], 'a']]], ['' => 0, 'c' => ['c']]]], $context), ['' => 0, 'c' => [['' => 0, 'c' => ['c']], [['a' => ['a', ['' => 0, 'b' => ['b']]], 'b' => ['b']]]]], 'node of (?:(?:ab?|b)c?)?');
is_deeply($rt->_unrev_path(['a', 'b', ['c' => ['c', 'd', 'e'], 'f' => ['f', 'g', 'h'], 'i' => ['i', 'j', ['k' => ['k', 'l', 'm'], 'n' => ['n', 'o', 'p']], 'x']]], $context), [['e' => ['e', 'd', 'c'], 'h' => ['h', 'g', 'f'], 'x' => ['x', ['m' => ['m', 'l', 'k'], 'p' => ['p', 'o', 'n']], 'j', 'i']], 'b', 'a'], 'path(node(path))');
//{
$r = new Regexp_Assemble();
$ra = $r->add('refused')->add('fused')->add('used');
$ra->_reduce();
ok(eq_set([array_keys($rt->_lookahead($ra->__path[0]))], ['f', 'r']), '_lookahead refused/fused/used');
$ra->reset()->add('refused')->add('reamused')->add('fused')->add('amused')->add('used')->_reduce();
ok(eq_set([array_keys($rt->_lookahead($ra->__path[0]))], ['a', 'f', 'r']), '_lookahead reamused/refused/amused/fused/used');
$ra->reset()->add('reran')->add('ran')->_reduce();
ok(eq_set([array_keys($rt->_lookahead($ra->__path[0]))], ['r']), '_lookahead reran/ran');
$ra->reset()->add('cruised')->add('bruised')->add('hosed')->add('gazed')->add('used')->_reduce();
ok(eq_set([array_keys($rt->_lookahead($ra->__path[0]))], ['b', 'c', 'g', 'h', 'u']), '_lookahead cruised/bruised/hosed/gazed/used');
//}
is($rt->_dump([1, 0, NULL]), '[1 0 *]', 'dump undef');
is($rt->_dump([1, 0, ' ']), "[1 0 ' ']", 'dump space');
is($rt->_dump(['a' => ['a', 'b'], 'b' => ['b']]), '{a=>[a b] b=>[b]}', 'dump node');
is($rt->_dump(['a', chr(7), 'b']), '[a \\x07 b]', 'dump pretty');
//保留
//is( $r->insert(' ')->insert(' ')->dump(),
//    '[\\x07 {\\x05=>[\\x05] \\x06=>[\\x06]}]', 'dump pretty node'
//);
is($rt->_dump(['a', chr(7), 'b']), '[a \\x07 b]', 'dump pretty');
is($rt->_combine('?=', ['c', 'a', 'b']), '(?=[abc])', '_combine c a b');
is($rt->_combine('?=', ['c', 'ab', 'de']), '(?=ab|de|c)', '_combine c ab de');
is($rt->_combine('?=', ['in', 'og']), '(?=in|og)', '_combine in og');
is($rt->_combine('?=', ['in', 'og', 'j', 'k', 'l']), '(?=[jkl]|in|og)', '_combine in og j k l');
is($rt->_combine('?=', ['in', 'og', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']), '(?=\\d|in|og)', '_combine in og 0 1 ... 9');
is_deeply($rt->_unrev_path([['x1' => ['x1', 'z\\d'], '' => 0]], $context), [['z\\d' => ['z\\d', 'x1'], '' => 0]], 'node(* metachar)');
is_deeply($rt->_unrev_path([['x' => ['x', '\\d'], '' => 0]], $context), [['\\d' => ['\\d', 'x'], '' => 0]], 'node(* metachar) 2');