公理,251字节
C==>concat;A==>List Any;px(a:A):A==(k:=#a;r:=copy[a];k<=1=>r;i:=1;repeat(i>=k=>break;x:=a.(1..i);y:=a.((i+1)..k);z:=px(y);t:=[x,z.1];for j in 2..#z repeat(w:=(z.j)::A;m:=#w;v:=[x];for q in 1..m repeat v:=C(v,w.q);t:=C(t,[v]));r:=C(r,copy t);i:=i+1);r)
如果有人发现更好的东西...测试并测试:
pp(a:List Any):List Any==
k:=#a;r:=copy[a];k<=1=>r;i:=1
repeat
i>=k=>break
x:=a.(1..i);y:=a.((i+1)..k);z:=pp(y);
t:=[x,z.1]
for j in 2..#z repeat
w:=(z.j)::List Any
m:=#w; v:=[x]
for q in 1..m repeat
v:=concat(v,w.q);
t:=concat(t,[v])
r:=concat(r,copy t);
i:=i+1
r
(7) -> px []
(7) [[]]
Type: List Any
(8) -> px [1]
(8) [[1]]
Type: List Any
(9) -> px [1,2]
(9) [[1,2],[[1],[2]]]
Type: List Any
(10) -> px [1,2,3]
(10) [[1,2,3],[[1],[2,3]],[[1],[2],[3]],[[1,2],[3]]]
Type: List Any
(11) -> px [1,2,3,4,5,6]
(11)
[[1,2,3,4,5,6], [[1],[2,3,4,5,6]], [[1],[2],[3,4,5,6]],
[[1],[2],[3],[4,5,6]], [[1],[2],[3],[4],[5,6]], [[1],[2],[3],[4],[5],[6]],
[[1],[2],[3],[4,5],[6]], [[1],[2],[3,4],[5,6]], [[1],[2],[3,4],[5],[6]],
[[1],[2],[3,4,5],[6]], [[1],[2,3],[4,5,6]], [[1],[2,3],[4],[5,6]],
[[1],[2,3],[4],[5],[6]], [[1],[2,3],[4,5],[6]], [[1],[2,3,4],[5,6]],
[[1],[2,3,4],[5],[6]], [[1],[2,3,4,5],[6]], [[1,2],[3,4,5,6]],
[[1,2],[3],[4,5,6]], [[1,2],[3],[4],[5,6]], [[1,2],[3],[4],[5],[6]],
[[1,2],[3],[4,5],[6]], [[1,2],[3,4],[5,6]], [[1,2],[3,4],[5],[6]],
[[1,2],[3,4,5],[6]], [[1,2,3],[4,5,6]], [[1,2,3],[4],[5,6]],
[[1,2,3],[4],[5],[6]], [[1,2,3],[4,5],[6]], [[1,2,3,4],[5,6]],
[[1,2,3,4],[5],[6]], [[1,2,3,4,5],[6]]]
Type: List Any
(12) -> [[i,#px i] for i in [[],[1],[1,2],[1,2,3],[1,2,3,4],[1,2,3,4,5,6]] ]
(12)
[[[],1],[[1],1],[[1,2],2],[[1,2,3],4],[[1,2,3,4],8],[[1,2,3,4,5,6],32]]
Type: List List Any
(13) -> [#px(i) for i in [[],[1],[1,2],[1,2,3],[1,2,3,4],[1,2,3,4,5,6]] ]
(13) [1,1,2,4,8,32]
Type: List NonNegativeInteger
如果空间太大,请说出来,然后删除示例...
[...]
在输出格式中省略周围吗?(只要分隔区清楚地分开,例如通过换行符。)