1:- module(math, [boole/2, 2 pairs/2, 3 choices/2, product/3, 4 powerlist/3, powerset/2, 5 string_to_ground_term/2, 6 subst/3, 7 nCr/3, combi/3, combination/4, 8 fun_to_rel/2, rel_to_fun/2, principal_filter/3, 9 all_maps/3, 10 filter/3, inverse_image/3, image/3, 11 bigcap/2, 12 raise_list/3, distribute_cons/3, 13 fact/2, factorial/2, factorial/3, 14 permutations/2 15 ]). 16:- use_module(pac(basic)). 17:- use_module(util(meta2)). 18:- use_module(pac('expand-pac')). 19term_expansion --> pac:expand_pac. 20:- use_module(pac(op)). 21:- use_module(zdd('zdd-array')). 22 23 24% ?- factorial(54, X). 25% ?- X is (10000)^2. %å 26% ?- X is (10000)^3. %å 27% ?- X is (10000)^4. %京 28% ?- X is (10000)^5. % 29% ?- X is (10000)^6. 30% ?- X is (10)^68. % ç¡éå¤§æ° 31 32% ?- X is (10)^68. % ç¡éå¤§æ° 33% ?- factorial(54, F), X is 10^68, R is rdiv(F, X). 34%@ F = 230843697339241380472092742683027581083278564571807941132288000000000000, 35%@ X = 100000000000000000000000000000000000000000000000000000000000000000000, 36%@ R = 839804478670853788470022637495376624731865611727r363797880709171295166015625000000000000000000 . 37 38% ?- factorial(54, F), X is 10^68, Q is F//X. 39%@ F = 230843697339241380472092742683027581083278564571807941132288000000000000, 40%@ X = 100000000000000000000000000000000000000000000000000000000000000000000, 41%@ Q = 2308 . 42 43% ?- list_to_brace([[]], X). 44% ?- list_to_brace([[],[]], X). 45% ?- list_to_brace([[],[], []], X). 46 47:- bekind(list_to_brace, []). 48[] = `({}). 49[X] = `({})@X. 50[X|Y] = `({})@ (`(',')@X@Y). 51:- ekind. 52 53% ?- str("ab" + "cd" + "ef", X). 54%@ X = "abcdef". 55% ?- eval(str::("ab" + "cd" + "ef"), X). 56%@ X = "abcdef". 57 58:- bekind(str, []). 59X+Y = :string_concat@X@Y. 60% X+Y = :pred([X, Y, Z]:- string_concat(X, Y, Z))@X@Y. %% OK 61X