File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,11 +3,22 @@ require import AllCore List IntDiv Binomial Ring StdOrder.
33(*---*) import IntID IntOrder.
44
55(* -------------------------------------------------------------------- *)
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)).
6+ op [smt_opaque] allperms_r (n : unit list) (s : ' a list) : ' a list list =
7+ with n = [] =>
8+ [[]]
9+ with n = _ :: n =>
10+ flatten (map (fun x => map ((::) x) (allperms_r n (rem x s))) (undup s)).
1011
12+ lemma allperms_r0 (s : ' a list) :
13+ allperms_r [] s = [[]]
14+ by done.
15+
16+ lemma allperms_rS (x : unit) (n : unit list) (s : ' a list) :
17+ allperms_r (x :: n) s = flatten (
18+ map (fun x => map ((::) x) (allperms_r n (rem x s))) (undup s))
19+ by done.
20+
21+ (* -------------------------------------------------------------------- *)
1122op allperms (s : ' a list) = allperms_r (nseq (size s) tt) s.
1223
1324(* -------------------------------------------------------------------- *)
You can’t perform that action at this time.
0 commit comments