1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| A.Asperti, C.Sacerdoti Coen, *)
8 (* ||A|| E.Tassi, S.Zacchiroli *)
10 (* \ / Matita is distributed under the terms of the *)
11 (* v GNU Lesser General Public License Version 2.1 *)
13 (**************************************************************************)
15 include "nat/factorization.ma".
17 let rec factorize_aux2 i n b on b ≝
21 let p ≝ nth_prime i in
31 | _ ⇒ nfa_proper (nf_last (pred q))]
33 let res ≝ factorize_aux2 (S i) r b' in
35 [ nfa_zero ⇒ nfa_zero (* impossible *)
36 | nfa_one ⇒ nfa_proper (nf_last q)
37 | nfa_proper l ⇒ nfa_proper (nf_cons q l)]]]]].
39 definition factorize2 ≝ λn.factorize_aux2 0 n n.