We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
allperms
1 parent ecb3395 commit 330e4b0Copy full SHA for 330e4b0
1 file changed
theories/algebra/Perms.ec
@@ -5,8 +5,8 @@ require import AllCore List IntDiv Binomial Ring StdOrder.
5
(* -------------------------------------------------------------------- *)
6
op allperms_r (n : unit list) (s : 'a list) : 'a list list =
7
with n = [] => [[]]
8
-with n = x::n => flatten (
9
- map (fun x => map ((::) x) (allperms_r n (rem x s))) (undup s)).
+with n = x::n => (fun rec => flatten (
+ map (fun x => map ((::) x) (rec (rem x s))) (undup s))) (allperms_r n).
10
11
op allperms (s : 'a list) = allperms_r (nseq (size s) tt) s.
12
0 commit comments