Skip to content

Commit f4d702c

Browse files
committed
add back definitional lemmas and rewrite hints
1 parent 330e4b0 commit f4d702c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

theories/algebra/Perms.ec

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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 =
77
with n = [] => [[]]
88
with 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+
1118
op allperms (s : 'a list) = allperms_r (nseq (size s) tt) s.
1219
20+
hint rewrite ap_r : allperms_r0 allperms_rS.
1321
(* -------------------------------------------------------------------- *)
1422
lemma allperms_rP n (s t : 'a list) : size s = size n =>
1523
(mem (allperms_r n s) t) <=> (perm_eq s t).

0 commit comments

Comments
 (0)