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,13 +3,21 @@ 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 =
6+ op [opaque smt_opaque] allperms_r (n : unit list) (s : ' a list) : ' a list list =
77with n = [] => [[]]
88with n = x::n => (fun rec => flatten (
99 map (fun x => map ((::) x) (rec (rem x s))) (undup s))) (allperms_r n).
1010
11+ lemma allperms_r0 (s : ' a list) :
12+ allperms_r [] s = [[]] by done.
13+
14+ lemma allperms_rS (x : unit) (n : unit list) (s : ' a list) :
15+ allperms_r (x :: n) s = flatten (
16+ map (fun x => map ((::) x) (allperms_r n (rem x s))) (undup s)) by done.
17+
1118op allperms (s : ' a list) = allperms_r (nseq (size s) tt) s.
1219
20+ hint rewrite ap_r : allperms_r0 allperms_rS.
1321(* -------------------------------------------------------------------- *)
1422lemma allperms_rP n (s t : ' a list) : size s = size n =>
1523 (mem (allperms_r n s) t) <=> (perm_eq s t).
You can’t perform that action at this time.
0 commit comments