chunk_id
large_stringlengths
9
11
question_id
large_stringlengths
6
8
language
large_stringclasses
1 value
chunk_index
int64
0
4
chunk_text
large_stringlengths
115
2.62k
sparse_text
large_stringlengths
111
4.37k
dense_vector
listlengths
3.58k
3.58k
sparse_indices
listlengths
9
217
sparse_values
listlengths
9
217
export_source
large_stringclasses
1 value
73804503_c0
73804503
prolog
0
Title: Ask the user to input two strings and check whether one string is a substring of another in prolog Problem title: Ask the user to input two strings and check whether one string is a substring of another in prolog Tags: prolog, string, substring, swi-prolog Problem: Ask the user to input two strings and check whe...
Ask the user to input two strings and check whether one string is a substring of another in prolog Ask the user to input two strings and check whether one string is a substring of another in prolog prolog string substring swi-prolog Ask Enter Ask the user to input two strings and check whether one string is a substring...
[ 0.00714111328125, -0.004241943359375, -0.0142822265625, 0.044921875, -0.02392578125, 0.01904296875, 0.0189208984375, 0.015380859375, -0.013427734375, -0.005859375, 0.00946044921875, 0.0031585693359375, -0.01953125, 0.01263427734375, 0.0078125, -0.007232666015625, 0.046875, 0.013122...
[ 105219, 38937, 107730, 6626, 79315, 136, 12765, 36766, 1632, 83, 10, 1614, 91693, 111, 15700, 502, 4867, 47, 23, 2452, 3454, 60816, 3525, 18151, 22936, 4358, 28864, 172337, 3688 ]
[ 0.1221923828125, 0.1461181640625, 0.211181640625, 0.161865234375, 0.23828125, 0.0242462158203125, 0.1822509765625, 0.07275390625, 0.050994873046875, 0.0804443359375, 0.0631103515625, 0.1898193359375, 0.2249755859375, 0.0528564453125, 0.1038818359375, 0.1502685546875, 0.223876953125, ...
embed
43033786_c0
43033786
prolog
0
Title: Prolog Conversion to uppercase letters Problem title: Prolog Conversion to uppercase letters Tags: prolog, uppercase, functor, lowercase Problem: Prolog Conversion to uppercase letters Okay I wanted to ask if there is any way that i could change the lowercase letter to uppercase without adding the "". Sorry if t...
Prolog Conversion to uppercase letters Prolog Conversion to uppercase letters prolog uppercase functor lowercase Prolog Conversion upcase_atom Prolog Conversion to uppercase letters Okay I wanted to ask if there is any way that i could change the lowercase letter to uppercase without adding the "". Sorry if this sound ...
[ 0.0152587890625, -0.003173828125, 0.019287109375, 0.0166015625, 0.00153350830078125, 0.017578125, 0.0098876953125, 0.011474609375, 0.0023651123046875, 0.01312255859375, -0.0028228759765625, 0.00897216796875, 0.0115966796875, 0.03271484375, 0.007171630859375, -0.00384521484375, -0.005...
[ 1250, 4867, 1657, 46354, 47, 1407, 56, 58437, 120820, 502, 7477, 18770, 92319, 1257, 5928, 36663, 26458, 2499, 3917, 17, 5809, 15549, 70, 31330, 15490, 154107, 44, 90502, 2174, 45730, 78, 12097, 3871, 903, 11675, 1528, 54397, 110023, 1884, ...
[ 0.1622314453125, 0.2734375, 0.040435791015625, 0.1480712890625, 0.12255859375, 0.122314453125, 0.1094970703125, 0.2049560546875, 0.2176513671875, 0.1082763671875, 0.1051025390625, 0.081298828125, 0.2147216796875, 0.0833740234375, 0.1517333984375, 0.0438232421875, 0.058319091796875, ...
embed
43313755_c0
43313755
prolog
0
Title: How to create a list of index values based on 2 lists in prolog Problem title: How to create a list of index values based on 2 lists in prolog Tags: prolog Problem: How to create a list of index values based on 2 lists in prolog I'm trying to work on an assignment, however am really stuck on this section. What I...
How to create a list of index values based on 2 lists in prolog How to create a list of index values based on 2 lists in prolog prolog How How to create a list of index values based on 2 lists in prolog I'm trying to work on an assignment, however am really stuck on this section. What I need to do is write a predicate ...
[ 0.01416015625, 0.016357421875, 0.00189971923828125, -0.0118408203125, -0.0277099609375, 0.00970458984375, -0.00225830078125, 0.021728515625, 0.01251220703125, -0.0281982421875, 0.004241943359375, 0.006256103515625, -0.01019287109375, -0.0177001953125, -0.00457763671875, -0.012512207031...
[ 11249, 28282, 5303, 111, 63262, 142424, 35509, 98, 116, 7, 502, 4867, 23, 95486, 179933, 33022, 1653, 2063, 14858, 214, 17262, 171859, 756, 50960, 70541, 19069, 6626, 5701, 34292, 4358 ]
[ 0.05908203125, 0.1597900390625, 0.2158203125, 0.049285888671875, 0.203857421875, 0.1815185546875, 0.115234375, 0.01190185546875, 0.150634765625, 0.044647216796875, 0.1251220703125, 0.215576171875, 0.00537109375, 0.07769775390625, 0.04058837890625, 0.055938720703125, 0.05963134765625,...
embed
22811055_c1
22811055
prolog
1
_mpz(take, rop) && PL_get_mpz(size, n) ) { k = mpz_get_ui(rop); mpz_bin_ui(rop, n, k); rc = PL_unify_mpz(result, rop); } else { rc = FALSE; } mpz_clear(rop); mpz_clear(n); return rc; } install_t install_choose() { PL_register_foreign("choose", 3, pl_choose, 0); } I build and link it by calling swipl-ld -lgmp -shared -o...
_mpz(take, rop) && PL_get_mpz(size, n) ) { k = mpz_get_ui(rop); mpz_bin_ui(rop, n, k); rc = PL_unify_mpz(result, rop); } else { rc = FALSE; } mpz_clear(rop); mpz_clear(n); return rc; } install_t install_choose() { PL_register_foreign("choose", 3, pl_choose, 0); } I build and link it by calling swipl-ld -lgmp -shared -o...
[ 0.0069580078125, 0.01031494140625, 0.01263427734375, 0.002899169921875, -0.03466796875, -0.00408935546875, 0.00408935546875, 0.0155029296875, 0.0267333984375, -0.0233154296875, 0.0263671875, 0.00970458984375, -0.0019683837890625, 0.01025390625, -0.0035552978515625, 0.003936767578125, ...
[ 101, 2676, 169, 78219, 4, 87850, 16, 1230, 33106, 3794, 62539, 653, 472, 9607, 4515, 28437, 7568, 19437, 309, 40383, 7136, 7842, 9127, 119488, 19, 20600, 18, 3089, 8364, 105199, 2472, 38529, 138, 6456, 757, 87, 45367, 136, 3126, 442, 15...
[ 0.034637451171875, 0.1533203125, 0.2442626953125, 0.2459716796875, 0.014404296875, 0.234619140625, 0.004547119140625, 0.05718994140625, 0.1890869140625, 0.1014404296875, 0.114013671875, 0.075439453125, 0.1094970703125, 0.146240234375, 0.1573486328125, 0.1893310546875, 0.1536865234375...
embed
2381962_c0
2381962
prolog
0
Title: Prolog - Declaring arithmetic clauses Problem title: Prolog - Declaring arithmetic clauses Tags: clause, math, prolog Problem: Prolog - Declaring arithmetic clauses A simple question, how would I go about declaring a clause which would produce the number specified +1 +2 and +3? I have tried: addup(Thenumber,Then...
Prolog - Declaring arithmetic clauses Prolog - Declaring arithmetic clauses clause math prolog Prolog Declaring Thenumber Prolog - Declaring arithmetic clauses A simple question, how would I go about declaring a clause which would produce the number specified +1 +2 and +3? I have tried: but when I run it with say, Then...
[ 0.0035858154296875, 0.011962890625, 0.006072998046875, 0.00701904296875, -0.010498046875, 0.0184326171875, 0.00311279296875, -0.0023040771484375, 0.028076171875, -0.026611328125, -0.0181884765625, -0.000018715858459472656, -0.01531982421875, 0.006927490234375, 0.0233154296875, 0.001159...
[ 1250, 4867, 25755, 320, 214, 8962, 282, 70731, 90, 48909, 502, 581, 2606, 1297, 8781, 9655, 3642, 2806, 87, 738, 1672, 8, 18347, 2852, 10, 13, 27489, 14012, 58735, 57157, 94369, 136, 85398, 37842, 11675, 678, 114997, 1660, 30646, 190, 2...
[ 0.1414794921875, 0.2171630859375, 0.123779296875, 0.148681640625, 0.043914794921875, 0.110595703125, 0.0626220703125, 0.273193359375, 0.0611572265625, 0.0853271484375, 0.0792236328125, 0.1551513671875, 0.1961669921875, 0.1767578125, 0.0933837890625, 0.057830810546875, 0.0607604980468...
embed
30028830_c0
30028830
prolog
0
Title: Bounded tabling Problem title: Bounded tabling Tags: prolog-tabling, memoization, prolog Problem: Bounded tabling Quite recently, I started playing around with tabling in Prolog; some experiments that I did with b-prolog and xsb can be found in this question . With the tables getting bigger and bigger, I realize...
Bounded tabling Bounded tabling prolog-tabling memoization prolog Bounded Bounded tabling Quite recently, I started playing around with tabling in Prolog; some experiments that I did with b-prolog and xsb can be found in this question . With the tables getting bigger and bigger, I realized that I needed to find some ta...
[ 0.018310546875, 0.004974365234375, 0.00482177734375, -0.0096435546875, -0.00738525390625, 0.01953125, 0.031494140625, 0.0035400390625, 0.015869140625, 0.002349853515625, 0.01116943359375, 0.0021820068359375, -0.0128173828125, 0.0234375, 0.01025390625, 0.0255126953125, 0.0166015625, ...
[ 335, 167457, 308, 79298, 502, 4867, 102, 163, 432, 47691, 75169, 10932, 1250, 28007, 876, 3454, 1022, 7, 275, 23180, 167785, 50717, 171859, 17475, 41170, 98323, 171332, 23937, 202319, 23009, 15850, 38496, 80234, 4677 ]
[ 0.13623046875, 0.1895751953125, 0.2010498046875, 0.2086181640625, 0.1209716796875, 0.225830078125, 0.15625, 0.03973388671875, 0.0897216796875, 0.0192108154296875, 0.052520751953125, 0.0430908203125, 0.144775390625, 0.0985107421875, 0.068359375, 0.103515625, 0.050872802734375, 0.036...
embed
74031001_c0
74031001
prolog
0
Title: Is it possible to define an append function for a list of predicates? Problem title: Is it possible to define an append function for a list of predicates? Tags: append, prolog Problem: Is it possible to define an append function for a list of predicates? How do I define an append function for a list of predicate...
Is it possible to define an append function for a list of predicates? Is it possible to define an append function for a list of predicates? append prolog empty_member List Is it possible to define an append function for a list of predicates? How do I define an append function for a list of predicates? Ex. of a list: Ex...
[ -0.00051116943359375, 0.00775146484375, 0.0260009765625, 0.00286865234375, -0.0091552734375, 0.0224609375, 0.00066375732421875, 0.01953125, 0.0142822265625, -0.0191650390625, 0.02099609375, -0.01141357421875, -0.01373291015625, 0.004638671875, 0.0255126953125, 0.0062255859375, 0.0039...
[ 7722, 61924, 114689, 71, 32354, 5303, 1653, 2063, 1636, 100, 502, 4867, 201505, 27417, 32036, 5443, 11782, 27211, 27117, 34831, 96819, 1632, 13579 ]
[ 0.1474609375, 0.203857421875, 0.2001953125, 0.1689453125, 0.212158203125, 0.15380859375, 0.1485595703125, 0.1927490234375, 0.084228515625, 0.0181884765625, 0.06756591796875, 0.1239013671875, 0.1087646484375, 0.099365234375, 0.0992431640625, 0.0506591796875, 0.119140625, 0.091125488...
embed
70496382_c0
70496382
prolog
0
Title: Trouble with this Prolog Rule Problem title: Trouble with this Prolog Rule Tags: math, prolog, rules Problem: Trouble with this Prolog Rule If i have facts such as these: ss(30, 1). ss(29, 2). ss(27, 3). ss(23, 5). ss(18, 7). ss(13, 8). ss( 8, 9). ss( 4, 11). ss( 3, 12). How can i define a rule: calculate_ss(Yea...
Trouble with this Prolog Rule Trouble with this Prolog Rule math prolog rules Trouble Prolog Rule calculate_ss Year Score Trouble with this Prolog Rule If i have facts such as these: How can i define a rule: that gives: calculate_ss(10, S). gives S = 9 calculate_ss( 8, S). gives S = 9 calculate_ss(24, S). gives S = 5 T...
[ -0.00927734375, 0.005279541015625, -0.0196533203125, -0.00909423828125, -0.02001953125, -0.0054931640625, 0.0078125, 0.004547119140625, -0.00058746337890625, 0.00762939453125, -0.004241943359375, -0.0146484375, -0.004425048828125, -0.025634765625, 0.032470703125, -0.022705078125, 0.0...
[ 119671, 2661, 678, 903, 1250, 4867, 139118, 48909, 502, 91736, 74481, 67, 454, 7, 42552, 168071, 15824, 831, 17, 61924, 79986, 76199, 90980, 159, 483, 382, 2357, 2203, 190, 35166, 5608, 167375, 161063, 107730, 117396, 6602 ]
[ 0.1513671875, 0.1114501953125, 0.1429443359375, 0.10577392578125, 0.1334228515625, 0.2181396484375, 0.2137451171875, 0.0875244140625, 0.107177734375, 0.1302490234375, 0.177734375, 0.09161376953125, 0.009033203125, 0.131591796875, 0.1790771484375, 0.197021484375, 0.1102294921875, 0....
embed
72168202_c1
72168202
prolog
1
/prolog/test.pl:7: Warning: Singleton variables: [Y] Warning: c:/users/i3/documents/prolog/test.pl:8: Warning: Singleton variables: [X] Warning: c:/users/i3/documents/prolog/test.pl:9: Warning: Singleton variables: [X] Warning: c:/users/i3/documents/prolog/test.pl:10: Warning: Singleton variables: [Y] Warning: c:/users...
/prolog/test.pl:7: Warning: Singleton variables: [Y] Warning: c:/users/i3/documents/prolog/test.pl:8: Warning: Singleton variables: [X] Warning: c:/users/i3/documents/prolog/test.pl:9: Warning: Singleton variables: [X] Warning: c:/users/i3/documents/prolog/test.pl:10: Warning: Singleton variables: [Y] Warning: c:/users...
[ 0.01458740234375, -0.0017547607421875, 0.00390625, 0.016357421875, 0.0037384033203125, 0.013916015625, -0.00830078125, 0.0126953125, 0.01385498046875, -0.0057373046875, -0.0096435546875, 0.0096435546875, -0.0240478515625, -0.01263427734375, 0.01416015625, 0.0128173828125, 0.011840820...
[ 3454, 4867, 6954, 2424, 966, 5550, 592, 43609, 1507, 77336, 7, 1723, 223, 14, 40061, 117432, 1019, 1542, 1126, 15110, 19993, 29568, 53418, 28219, 7440, 18499, 903, 1528, 28864, 26073, 502, 26040, 214, 4263, 647, 28574, 7623, 3034, 363, 61...
[ 0.15087890625, 0.23974609375, 0.2374267578125, 0.1383056640625, 0.1048583984375, 0.16259765625, 0.1343994140625, 0.2279052734375, 0.2379150390625, 0.291259765625, 0.05718994140625, 0.1917724609375, 0.0928955078125, 0.006927490234375, 0.1510009765625, 0.092041015625, 0.08392333984375,...
embed
30649801_c0
30649801
prolog
0
Title: How to get Prolog to explain your result beyond the true statement Problem title: How to get Prolog to explain your result beyond the true statement Tags: prolog Problem: How to get Prolog to explain your result beyond the true statement I have the following facts and rules: flight(sea,msp). flight(msp,jfk). rou...
How to get Prolog to explain your result beyond the true statement How to get Prolog to explain your result beyond the true statement prolog How Prolog How to get Prolog to explain your result beyond the true statement I have the following facts and rules: when query for route(sea,jfk) I get a result true but what I wi...
[ 0.033203125, 0.018798828125, 0.017578125, 0.0303955078125, -0.01202392578125, 0.0018463134765625, 0.016357421875, -0.00122833251953125, 0.0026397705078125, -0.0203857421875, 0.0016937255859375, -0.01226806640625, -0.0299072265625, 0.015625, 0.00274658203125, 0.00138092041015625, 0.00...
[ 11249, 2046, 1250, 4867, 47, 73342, 16750, 107314, 29568, 63805, 935, 502, 15824, 91736, 41, 1294, 100, 36439, 184, 11, 39271, 92, 32599, 70, 14700, 2397, 2320, 15520, 152745, 39, 7008, 14192, 442, 3642 ]
[ 0.0928955078125, 0.10406494140625, 0.182861328125, 0.275146484375, 0.0732421875, 0.2509765625, 0.1864013671875, 0.183837890625, 0.1610107421875, 0.16943359375, 0.0406494140625, 0.135009765625, 0.0423583984375, 0.06512451171875, 0.09320068359375, 0.080810546875, 0.01763916015625, 0....
embed
22749480_c0
22749480
prolog
0
Title: Rename Variables in SWI Prolog Problem title: Rename Variables in SWI Prolog Tags: prolog Problem: Rename Variables in SWI Prolog How can I rename variables in SWI Prolog? I tried to use numbervars predicate like this. numbervars(Xs,1,_,[functor_name(name)]). So if Xs is a list of 4 variables, it will look like ...
Rename Variables in SWI Prolog Rename Variables in SWI Prolog prolog Rename Variables SWI Prolog functor_name name1 name2 name3 name4 Rename Variables in SWI Prolog How can I rename variables in SWI Prolog? I tried to use numbervars predicate like this. So if Xs is a list of 4 variables, it will look like this when I c...
[ 0.005828857421875, 0.01708984375, -0.0004558563232421875, 0.02978515625, -0.00469970703125, 0.010986328125, -0.005157470703125, 0.0133056640625, 0.001983642578125, -0.004119873046875, 0.0013580322265625, 0.00148773193359375, -0.003997802734375, -0.0108642578125, 0.0111083984375, 0.0053...
[ 853, 11627, 111477, 13566, 23, 159, 38969, 1250, 4867, 502, 7477, 18770, 9351, 418, 304, 363, 617, 11249, 831, 87, 456, 77336, 7, 37842, 4527, 14012, 1961, 1653, 2063, 1884, 903, 1193, 83, 5303, 201, 6713, 375, 4007, 5429, 44148, 19, ...
[ 0.151611328125, 0.235595703125, 0.2064208984375, 0.133544921875, 0.03851318359375, 0.09906005859375, 0.2298583984375, 0.15380859375, 0.20751953125, 0.11962890625, 0.1256103515625, 0.146240234375, 0.01708984375, 0.00836181640625, 0.03875732421875, 0.03363037109375, 0.1319580078125, ...
embed
74940051_c0
74940051
prolog
0
Title: Prolog query doesn't work for some reason Problem title: Prolog query doesn't work for some reason Tags: prolog Problem: Prolog query doesn't work for some reason I'm trying to write a simple game in Prolog. And here is my predicate for inventory: :- dynamic have/1. inv(0, []). inv(N, [X | Rest]):- hav...
Prolog query doesn't work for some reason Prolog query doesn't work for some reason prolog Prolog Rest classic_gun Prolog query doesn't work for some reason I'm trying to write a simple game in Prolog. And here is my predicate for inventory: So, I'm trying to choose every item which player has, and it works f...
[ -0.025390625, 0.00445556640625, 0.01483154296875, 0.013671875, -0.00543212890625, 0.012939453125, -0.021484375, 0.01312255859375, -0.007598876953125, -0.036865234375, 0.019287109375, 0.0111083984375, 0.00848388671875, 0.01318359375, -0.0216064453125, 0.0206298828125, 0.01806640625, ...
[ 1250, 4867, 41, 1294, 22027, 3768, 18, 4488, 31635, 502, 49756, 54704, 6967, 33022, 8781, 6712, 1653, 2063, 26868, 30675, 31577, 55076, 11907, 35735, 3129, 58585, 1556, 43240, 23, 334, 54753, 627, 98320, 44691 ]
[ 0.162841796875, 0.2489013671875, 0.16943359375, 0.151611328125, 0.009033203125, 0.024627685546875, 0.04296875, 0.1427001953125, 0.006011962890625, 0.1090087890625, 0.15478515625, 0.11572265625, 0.111572265625, 0.07794189453125, 0.045867919921875, 0.06951904296875, 0.033599853515625, ...
embed
43482641_c0
43482641
prolog
0
Title: Opposite of findall Problem title: Opposite of findall Tags: prolog Problem: Opposite of findall I would like to know how to do the opposite of findall (that are not used) in prolog.For example, If I have the following predicats : vegetable('salad','green'). vegetable('tomato','red'). vegetable('avocado','red')....
Opposite of findall Opposite of findall prolog Opposite Simple Opposite of findall I would like to know how to do the opposite of findall (that are not used) in prolog.For example, If I have the following predicats : I would need something opposite to the find all in the code overhead. I would like to like to find all ...
[ 0.0016937255859375, -0.0096435546875, 0.001678466796875, 0.00142669677734375, -0.0179443359375, 0.00016880035400390625, 0.01373291015625, 0.010498046875, 0.0040283203125, -0.005889892578125, -0.01397705078125, -0.00347900390625, 0.005645751953125, -0.0191650390625, 0.005462646484375, -...
[ 2331, 77087, 13, 111, 7413, 5584, 502, 4867, 60552, 1884, 3714, 3642, 54, 70, 198274, 86673, 621, 959, 11814, 23, 1653, 2063, 3871, 9844, 47, 756, 18151, 645, 31251, 231718, 70541, 109911, 218060 ]
[ 0.189453125, 0.1910400390625, 0.04736328125, 0.08447265625, 0.180908203125, 0.220703125, 0.15576171875, 0.2294921875, 0.0938720703125, 0.065673828125, 0.015838623046875, 0.0279998779296875, 0.0511474609375, 0.06884765625, 0.242919921875, 0.021331787109375, 0.04833984375, 0.12805175...
embed
54071696_c1
54071696
prolog
1
1, 4], [1, 5], [1, 6], [2, 6], [2, 7], [2|...], [...|...]|...] ; P = [[1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [2, 6], [2, 7], [2|...], [...|...]|...] ; P = [[1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [2, 6], [2, 7], [2|...], [...|...]|...] . When executing the program, it should display all the paths if a path exists betw...
1, 4], [1, 5], [1, 6], [2, 6], [2, 7], [2|...], [...|...]|...] ; P = [[1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [2, 6], [2, 7], [2|...], [...|...]|...] ; P = [[1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [2, 6], [2, 7], [2|...], [...|...]|...] . When executing the program, it should display all the paths if a path exists betw...
[ 0.0185546875, 0.013427734375, 0.01202392578125, 0.0252685546875, -0.009521484375, 0.0218505859375, 0.006378173828125, -0.015869140625, 0.0167236328125, -0.0218505859375, -0.004791259765625, 0.0152587890625, -0.004608154296875, 0.0123291015625, -0.005462646484375, -0.0213623046875, 0....
[ 106, 201, 68252, 190, 305, 361, 436, 2203, 418, 116, 138, 304, 14847, 71924, 1528, 5608, 44116, 756, 70, 60875, 2174, 32316, 17721, 19069, 30646, 98320, 120262, 759, 18151, 60899, 3934, 54241, 13, 40956, 13695, 12663, 1916, 4358, 122446, ...
[ 0.047760009765625, 0.14111328125, 0.000732421875, 0.0782470703125, 0.068115234375, 0.04449462890625, 0.11767578125, 0.030975341796875, 0.0254058837890625, 0.133544921875, 0.0076904296875, 0.002685546875, 0.0150146484375, 0.1937255859375, 0.183349609375, 0.037353515625, 0.205688476562...
embed
24467337_c0
24467337
prolog
0
Title: Collect all elements of binary tree that are power of 2 Problem title: Collect all elements of binary tree that are power of 2 Tags: failure-slice, prolog Problem: Collect all elements of binary tree that are power of 2 I can't get the following to work. This is what I got so far: stepen(2). stepen(X):- X mod 2=...
Collect all elements of binary tree that are power of 2 Collect all elements of binary tree that are power of 2 failure-slice prolog Collect Serbian Collect all elements of binary tree that are power of 2 I can't get the following to work. This is what I got so far:
[ 0.01806640625, 0.002777099609375, 0.0037689208984375, -0.00482177734375, 0.01611328125, 0.015869140625, -0.0279541015625, -0.00439453125, -0.006683349609375, -0.039794921875, 0.009521484375, -0.00799560546875, -0.0198974609375, -0.01080322265625, -0.006103515625, 0.025390625, 0.00885...
[ 138521, 756, 80854, 2394, 6635, 53201, 621, 14537, 111, 116, 137578, 13348, 502, 4867, 80380, 19, 450, 831, 25632, 4488, 2060 ]
[ 0.186767578125, 0.0882568359375, 0.154541015625, 0.126953125, 0.102783203125, 0.1856689453125, 0.037841796875, 0.1568603515625, 0.08447265625, 0.160888671875, 0.1829833984375, 0.10205078125, 0.0982666015625, 0.1351318359375, 0.19580078125, 0.0869140625, 0.00457763671875, 0.01263427...
embed
48995415_c0
48995415
prolog
0
Title: Prolog: Can prolog detect facts that does not exist yet? Problem title: Prolog: Can prolog detect facts that does not exist yet? Tags: prolog Problem: Prolog: Can prolog detect facts that does not exist yet? I am a beginner in Prolog, and here is my question: I want to build a KB that adds facts as it goes along...
Prolog: Can prolog detect facts that does not exist yet? Prolog: Can prolog detect facts that does not exist yet? prolog Prolog Can Prolog: Can prolog detect facts that does not exist yet? I am a beginner in Prolog, and here is my question: I want to build a KB that adds facts as it goes along. In my initial KB, I do n...
[ 0.01904296875, 0.013916015625, 0.03515625, 0.01318359375, -0.007110595703125, 0.002166748046875, 0.01129150390625, 0.00341796875, -0.000873565673828125, -0.00182342529296875, 0.0113525390625, 0.0023040771484375, -0.0177001953125, 0.0107421875, 0.00531005859375, -0.0015869140625, 0.02...
[ 1250, 4867, 4171, 502, 96391, 15824, 7, 450, 14602, 959, 32316, 14373, 12, 9842, 1679, 3444, 45367, 30742, 15190, 237, 60899, 33233, 61475, 765, 133291, 31998, 124308, 18151, 44622, 35509, 36766, 103707, 3387, 83, 7722, 23 ]
[ 0.1827392578125, 0.2548828125, 0.109130859375, 0.1549072265625, 0.2237548828125, 0.2025146484375, 0.1209716796875, 0.05487060546875, 0.0614013671875, 0.11865234375, 0.1964111328125, 0.1175537109375, 0.003753662109375, 0.0166473388671875, 0.045501708984375, 0.048004150390625, 0.115112...
embed
46446407_c2
46446407
prolog
2
pg_ats_i(C,AtList):- cpg_ats(C,Ats), maplist(value_intvalue,Ats,AtList). cpg_ats(c1,[attribute(at1,0.5),attribute(at2,0.03)]). cpg_ats(c2,[attribute(at1,0.02)]). cpg_ats(c3,[attribute(at2,0.1),attribute(at3,0.04),attribute(at4,0.08)]). When trying the test Code signals: Combining, cpgpartition_ts_fs_feature, at2, use_m...
pg_ats_i(C,AtList):- cpg_ats(C,Ats), maplist(value_intvalue,Ats,AtList). cpg_ats(c1,[attribute(at1,0.5),attribute(at2,0.03)]). cpg_ats(c2,[attribute(at1,0.02)]). cpg_ats(c3,[attribute(at2,0.1),attribute(at3,0.04),attribute(at4,0.08)]). When trying the test Code signals: Combining, cpgpartition_ts_fs_feature, at2, use_m...
[ -0.010986328125, -0.0196533203125, -0.01708984375, -0.0216064453125, -0.001190185546875, -0.01348876953125, 0.004913330078125, 0.00836181640625, -0.00775146484375, -0.003082275390625, 0.016845703125, 0.007720947265625, -0.0103759765625, 0.0283203125, -0.00225830078125, -0.0101928710937...
[ 915, 177, 454, 9821, 14, 441, 28848, 154663, 501, 254, 7, 22288, 6562, 27494, 4288, 194, 418, 191145, 257, 93645, 216969, 5, 108591, 304, 101432, 363, 128188, 112072, 617, 99929, 50490, 14847, 31577, 3034, 28864, 26073, 106935, 592, 15866, ...
[ 0.11474609375, 0.197021484375, 0.028564453125, 0.2095947265625, 0.113525390625, 0.0931396484375, 0.1566162109375, 0.167236328125, 0.0216217041015625, 0.1148681640625, 0.075439453125, 0.06561279296875, 0.134033203125, 0.1290283203125, 0.0723876953125, 0.053192138671875, 0.043151855468...
embed
22671536_c0
22671536
prolog
0
Title: How to check that certain strA is the substring of strB using Prolog? Problem title: How to check that certain strA is the substring of strB using Prolog? Tags: prolog Problem: How to check that certain strA is the substring of strB using Prolog? So basically I use this code to check the substring: substring(X,S...
How to check that certain strA is the substring of strB using Prolog? How to check that certain strA is the substring of strB using Prolog? prolog Prolog How Ins How to check that certain strA is the substring of strB using Prolog? So basically I use this code to check the substring: and my input is this: But when I us...
[ 0.00823974609375, -0.007720947265625, 0.018798828125, 0.041748046875, -0.0255126953125, 0.020751953125, 0.00482177734375, 0.0038604736328125, 0.00136566162109375, -0.003753662109375, -0.0008697509765625, 0.020751953125, -0.02099609375, -0.004974365234375, 0.00677490234375, -0.008178710...
[ 11249, 47, 12765, 450, 24233, 7704, 284, 83, 70, 1614, 91693, 571, 17368, 1250, 4867, 502, 360, 111, 18151, 107730, 903, 2452, 3454, 144851, 7413, 165523, 4358 ]
[ 0.03460693359375, 0.037322998046875, 0.1904296875, 0.03375244140625, 0.0958251953125, 0.18603515625, 0.1697998046875, 0.0941162109375, 0.0704345703125, 0.2025146484375, 0.2310791015625, 0.212158203125, 0.0714111328125, 0.138916015625, 0.24462890625, 0.09149169921875, 0.0560302734375,...
embed
23439360_c0
23439360
prolog
0
Title: Prolog program that deletes every n-th element from a list Problem title: Prolog program that deletes every n-th element from a list Tags: list, prolog Problem: Prolog program that deletes every n-th element from a list Could you help me solve the following? Write a ternary predicate delete_nth that deletes ever...
Prolog program that deletes every n-th element from a list Prolog program that deletes every n-th element from a list list prolog a Prolog delete_nth Num Prolog program that deletes every n-th element from a list Could you help me solve the following? Sample runs: I tried this:
[ -0.0010528564453125, 0.0078125, 0.01416015625, -0.0015106201171875, -0.0036468505859375, 0.019287109375, 0.024169921875, 0.002838134765625, 0.0012359619140625, -0.01458740234375, 0.0034027099609375, -0.01177978515625, -0.012939453125, -0.019287109375, 0.0026397705078125, 0.008056640625...
[ 1250, 4867, 1528, 450, 8, 74635, 11907, 653, 9, 927, 12830, 1295, 5303, 502, 10, 154109, 19, 52782, 191147, 4358, 86869, 25632, 947, 33209, 127877, 37842, 903 ]
[ 0.1884765625, 0.2408447265625, 0.2027587890625, 0.059539794921875, 0.1143798828125, 0.1982421875, 0.1373291015625, 0.1524658203125, 0.046051025390625, 0.1602783203125, 0.189208984375, 0.1097412109375, 0.176025390625, 0.162841796875, 0.040252685546875, 0.208740234375, 0.07568359375, ...
embed
33980737_c0
33980737
prolog
0
Title: I am try to write a small Prolog predicate Problem title: I am try to write a small Prolog predicate Tags: prolog Problem: I am try to write a small Prolog predicate I am trying to write a Prolog predicate. Assume we have data type A and type B. We want to get all the possible combination for both type such that...
I am try to write a small Prolog predicate I am try to write a small Prolog predicate prolog Prolog I am try to write a small Prolog predicate I am trying to write a Prolog predicate. Assume we have data type A and type B. We want to get all the possible combination for both type such that: That is the code we have: Do...
[ 0.003753662109375, 0.0198974609375, 0.003387451171875, 0.02685546875, -0.0106201171875, 0.0166015625, -0.0057373046875, -0.008056640625, 0.004730224609375, -0.000946044921875, 0.00160980224609375, -0.0079345703125, -0.005126953125, -0.0107421875, -0.00119781494140625, -0.00076293945312...
[ 444, 9790, 33022, 19336, 1250, 4867, 1653, 2063, 67, 502, 31577, 66596, 2053, 10644, 62, 136, 335, 3444, 2046, 756, 70, 7722, 162515, 100, 15044, 6044, 450, 18151, 765, 3871, 28282, 10, 313, 70541, 6626, 831, 54, 14858, 3630, 8337, 5962...
[ 0.019012451171875, 0.11279296875, 0.131103515625, 0.13427734375, 0.1485595703125, 0.2149658203125, 0.140869140625, 0.18505859375, 0.06964111328125, 0.1275634765625, 0.10205078125, 0.0469970703125, 0.16943359375, 0.208251953125, 0.0936279296875, 0.036407470703125, 0.11376953125, 0.0...
embed
40206023_c0
40206023
prolog
0
Title: Detect all k-length words of string in prolog Problem title: Detect all k-length words of string in prolog Tags: recursion, prolog, string Problem: Detect all k-length words of string in prolog Words are any symbol characters that are separated by white-spaces or by start/end points of string. For ex. [w,o,r,d,1...
Detect all k-length words of string in prolog Detect all k-length words of string in prolog recursion prolog string Detect Detect all k-length words of string in prolog Words are any symbol characters that are separated by white-spaces or by start/end points of string. For ex. [w,o,r,d,1,' ',w,o,r,d,2] . I need to find...
[ 0.005523681640625, -0.00482177734375, -0.006927490234375, 0.0027008056640625, -0.000530242919921875, -0.00506591796875, -0.007354736328125, 0.00146484375, 0.006011962890625, -0.0308837890625, 0.0191650390625, -0.01202392578125, -0.0198974609375, 0.0162353515625, 0.01092529296875, 0.012...
[ 579, 24762, 756, 472, 9, 23986, 927, 34153, 111, 79315, 502, 4867, 23, 195625, 1830, 22543, 621, 2499, 26582, 124850, 84797, 390, 35011, 65421, 4034, 3611, 26847, 1119, 434, 31, 42, 71, 418, 90173, 3871, 47, 7413, 34475, 114689, 16750, ...
[ 0.16748046875, 0.116455078125, 0.118408203125, 0.2098388671875, 0.05963134765625, 0.1571044921875, 0.11572265625, 0.2396240234375, 0.09808349609375, 0.2027587890625, 0.16845703125, 0.2437744140625, 0.06365966796875, 0.1832275390625, 0.0125732421875, 0.261962890625, 0.027496337890625,...
embed
12966911_c0
12966911
prolog
0
Title: Splitting a list at an specified element Problem title: Splitting a list at an specified element Tags: list, prolog, split Problem: Splitting a list at an specified element I've been trying to split a Prolog at a given element. I've come close but I can't get the left part of the list. split(X,[Y|L]) :- split(X,...
Splitting a list at an specified element Splitting a list at an specified element list prolog split Splitting Splitting a list at an specified element I've been trying to split a Prolog at a given element. I've come close but I can't get the left part of the list. Input: Returns: I want it to return
[ -0.0069580078125, 0.01123046875, 0.00421142578125, -0.0211181640625, -0.029296875, 0.00933837890625, -0.01361083984375, -0.000957489013671875, 0.006988525390625, 0.007598876953125, 0.00946044921875, -0.0014495849609375, -0.0274658203125, 0.0107421875, 0.006103515625, 0.009521484375, ...
[ 46474, 1916, 5303, 99, 58735, 12830, 297, 502, 4867, 65450, 31577, 1250, 34475, 1380, 20903, 831, 18, 2046, 25737, 2831, 360, 7077, 173340, 3444, 47, 30646 ]
[ 0.19921875, 0.08074951171875, 0.184326171875, 0.156005859375, 0.1939697265625, 0.191650390625, 0.016143798828125, 0.1644287109375, 0.2308349609375, 0.246337890625, 0.0716552734375, 0.14111328125, 0.025665283203125, 0.0034027099609375, 0.09332275390625, 0.0302886962890625, 0.006782531...
embed
67563431_c0
67563431
prolog
0
Title: Problem with Prolog list recursion keeps returning syntax error operator expected Problem title: Problem with Prolog list recursion keeps returning syntax error operator expected Tags: list, recursion, prolog Problem: Problem with Prolog list recursion keeps returning syntax error operator expected findSqr([],[]...
Problem with Prolog list recursion keeps returning syntax error operator expected Problem with Prolog list recursion keeps returning syntax error operator expected list recursion prolog Problem Prolog Problem with Prolog list recursion keeps returning syntax error operator expected Its suppose to return the elements of...
[ 0.00811767578125, 0.0274658203125, -0.004180908203125, -0.006988525390625, 0.006317138671875, 0.01483154296875, -0.01806640625, 0.00250244140625, -0.0181884765625, 0.000789642333984375, 0.00665283203125, -0.016845703125, -0.009521484375, -0.035400390625, 0.0263671875, 0.001724243164062...
[ 15649, 1250, 4867, 5303, 195625, 1830, 13695, 30646, 6002, 86531, 18499, 39933, 84751, 678, 502, 139124, 80854, 3129, 3229, 108047, 621, 40715, 3501, 805, 27781 ]
[ 0.1259765625, 0.132568359375, 0.207763671875, 0.15966796875, 0.180419921875, 0.06671142578125, 0.1490478515625, 0.165771484375, 0.0682373046875, 0.11590576171875, 0.13671875, 0.1656494140625, 0.2330322265625, 0.03656005859375, 0.08642578125, 0.1251220703125, 0.1370849609375, 0.0116...
embed
43741912_c0
43741912
prolog
0
Title: a prolom when run command from prolog use shell Problem title: a prolom when run command from prolog use shell Tags: prolog, swi-prolog Problem: a prolom when run command from prolog use shell i have a problem with executing commands in prolog, as http://www.swi-prolog.org/pldoc/man?predicate=shell/2 i am trying...
a prolom when run command from prolog use shell a prolom when run command from prolog use shell prolog swi-prolog prolog cmd.exe Users yousef_soliman a.py a prolom when run command from prolog use shell i have a problem with executing commands in prolog, as http://www.swi-prolog.org/pldoc/man?predicate=shell/2 i am try...
[ 0.0230712890625, 0.01531982421875, 0.01031494140625, 0.0208740234375, -0.0196533203125, 0.01556396484375, 0.0014190673828125, -0.0026702880859375, -0.01324462890625, -0.034423828125, 0.0133056640625, 0.033203125, -0.021484375, 0.00732421875, 0.00421142578125, -0.0135498046875, 0.0042...
[ 10, 502, 6511, 3229, 11675, 75101, 1295, 4867, 4527, 128019, 2452, 3454, 1827, 71, 46480, 53400, 4240, 669, 6493, 2967, 71924, 23, 29713, 19714, 2063, 12477, 31577, 17198, 50828, 11435, 17368, 30646, 20600, 831, 43240 ]
[ 0.1116943359375, 0.175048828125, 0.252197265625, 0.06646728515625, 0.1641845703125, 0.224853515625, 0.1383056640625, 0.252685546875, 0.128662109375, 0.25146484375, 0.1492919921875, 0.1317138671875, 0.15625, 0.092529296875, 0.121337890625, 0.003753662109375, 0.00360107421875, 0.0802...
embed
49088125_c0
49088125
prolog
0
Title: Run prolog program multiple times in sequence? Problem title: Run prolog program multiple times in sequence? Tags: prolog Problem: Run prolog program multiple times in sequence? I have a prolog program of which I'm trying to do some analysis and establish the runtime. As time/1 gives the values in seconds, I'm j...
Run prolog program multiple times in sequence? Run prolog program multiple times in sequence? prolog Run Run prolog program multiple times in sequence? I have a prolog program of which I'm trying to do some analysis and establish the runtime. As time/1 gives the values in seconds, I'm just getting 0 recorded as it is n...
[ 0.0245361328125, -0.01007080078125, -0.000797271728515625, 0.00726318359375, -0.007781982421875, -0.0017852783203125, 0.004241943359375, -0.00121307373046875, 0.012939453125, -0.06689453125, 0.005828857421875, 0.024658203125, -0.01519775390625, 0.00921630859375, 0.00799560546875, 0.005...
[ 28398, 502, 4867, 1528, 48716, 20028, 23, 40, 944, 3956, 114137, 137633, 11675, 6032, 1733, 11583, 76199, 142424, 94131, 20949, 757, 17164, 959, 5885, 162048, 20174, 1774, 2046, 10932, 1250, 4382, 7413, 101637, 8561, 21543 ]
[ 0.189697265625, 0.1905517578125, 0.27197265625, 0.192626953125, 0.216552734375, 0.2210693359375, 0.06231689453125, 0.07330322265625, 0.128173828125, 0.1046142578125, 0.06744384765625, 0.043792724609375, 0.200927734375, 0.151611328125, 0.12939453125, 0.1094970703125, 0.060028076171875...
embed
29130650_c0
29130650
prolog
0
Title: Prolog - arguments are not instantiated Problem title: Prolog - arguments are not instantiated Tags: prolog, clpfd Problem: Prolog - arguments are not instantiated I'm trying to understand how Prolog works. I'm using SWI-Prolog. Here's a bit of code: forall(C1,C2) :- \+ (C1, \+ C2). foo(N) :- N < 10. bar(N) :- N...
Prolog - arguments are not instantiated Prolog - arguments are not instantiated prolog clpfd Prolog ERROR Arguments Prolog - arguments are not instantiated I'm trying to understand how Prolog works. I'm using SWI-Prolog. Here's a bit of code: It produces desired output if I do something like: But when I try to see all ...
[ 0.034912109375, 0.01708984375, -0.0035247802734375, 0.01031494140625, 0.00994873046875, 0.011474609375, 0.0223388671875, 0.0031890869140625, 0.01434326171875, 0.0035858154296875, 0.00872802734375, -0.0172119140625, -0.00946044921875, 0.021484375, 0.00872802734375, -0.0103759765625, 0...
[ 1250, 4867, 10750, 7, 621, 959, 34648, 14, 27686, 502, 33139, 39557, 71, 151206, 24638, 112140, 28219, 43240, 159, 38969, 10752, 4785, 18151, 27489, 104851, 140992, 2174, 54, 1884, 9790, 1957, 756, 7722, 142424, 18499, 4865, 7730, 98, 3688 ...
[ 0.179931640625, 0.27294921875, 0.249267578125, 0.0877685546875, 0.1212158203125, 0.185791015625, 0.1162109375, 0.08966064453125, 0.06439208984375, 0.135009765625, 0.00750732421875, 0.0276336669921875, 0.0535888671875, 0.1014404296875, 0.051605224609375, 0.225830078125, 0.012817382812...
embed
53586368_c0
53586368
prolog
0
Title: prolog length of sublist not returning length but returning false? Problem title: prolog length of sublist not returning length but returning false? Tags: sublist, range, list, prolog Problem: prolog length of sublist not returning length but returning false? so not sure why my code does not work. But i am tryin...
prolog length of sublist not returning length but returning false? prolog length of sublist not returning length but returning false? sublist range list prolog prolog length of sublist not returning length but returning false? so not sure why my code does not work. But i am trying to find the length of a sublist given ...
[ 0.00311279296875, 0.0185546875, 0.0157470703125, -0.0111083984375, -0.00933837890625, 0.0216064453125, 0.003143310546875, 0.0223388671875, 0.0191650390625, 0.0142822265625, 0.006439208984375, 0.005615234375, 0.0242919921875, 0.0142822265625, 0.0269775390625, -0.001678466796875, 0.018...
[ 502, 4867, 140909, 111, 1614, 6562, 959, 30646, 214, 1284, 98320, 37457, 5303, 9077, 18151, 4488, 31577, 7413, 34475, 92319, 99091, 136, 1407, 56 ]
[ 0.1434326171875, 0.21533203125, 0.172119140625, 0.059783935546875, 0.217041015625, 0.2188720703125, 0.08294677734375, 0.1341552734375, 0.0181732177734375, 0.07989501953125, 0.1929931640625, 0.133056640625, 0.126953125, 0.008392333984375, 0.1156005859375, 0.055694580078125, 0.03515625...
embed
58028267_c0
58028267
prolog
0
Title: How to merge patches in Gerrit only when there are 2 +2 in Code Review Problem title: How to merge patches in Gerrit only when there are 2 +2 in Code Review Tags: gerrit, prolog Problem: How to merge patches in Gerrit only when there are 2 +2 in Code Review I need to add the patches to be merged only when there ...
How to merge patches in Gerrit only when there are 2 +2 in Code Review How to merge patches in Gerrit only when there are 2 +2 in Code Review gerrit prolog How Gerrit Review How to merge patches in Gerrit only when there are 2 +2 in Code Review I need to add the patches to be merged only when there they get two +2s in ...
[ 0.0034942626953125, 0.005645751953125, 0.006072998046875, 0.01129150390625, 0.0167236328125, 0.044921875, -0.00653076171875, -0.004180908203125, -0.0016021728515625, 0.01318359375, 0.03173828125, -0.0003223419189453125, -0.00830078125, -0.00140380859375, 0.01806640625, 0.00552368164062...
[ 11249, 47, 42564, 110912, 90, 23, 8022, 2783, 4734, 3229, 116, 94369, 28864, 35881, 4155, 502, 4867, 15190, 2046, 6626, 18151, 8347, 91736, 2424, 11435, 44841, 27781, 1250, 1505, 132340, 3454, 787, 2592 ]
[ 0.06951904296875, 0.001953125, 0.26708984375, 0.2388916015625, 0.1318359375, 0.059967041015625, 0.1552734375, 0.272216796875, 0.09588623046875, 0.06903076171875, 0.1300048828125, 0.2685546875, 0.1458740234375, 0.229248046875, 0.0718994140625, 0.08740234375, 0.143798828125, 0.072204...
embed
27221523_c0
27221523
prolog
0
Title: Prolog list combinations Problem title: Prolog list combinations Tags: prolog Problem: Prolog list combinations I'm trying to write a prolog code which will take a list and return all pairs of each element of that list. So for example: X = 1, Y = 2, Zs = [3] ; X = 1, Y = 3, Zs = [2] ; X = 2, Y = 1, Zs = [3] ; X ...
Prolog list combinations Prolog list combinations prolog Prolog select_pair Prolog list combinations I'm trying to write a prolog code which will take a list and return all pairs of each element of that list. So for example: So far I am able to get uptil the third line and not able to get the rest of the output. My cod...
[ -0.0189208984375, 0.0157470703125, -0.00139617919921875, 0.01336669921875, -0.009765625, 0.01300048828125, -0.0252685546875, 0.004730224609375, 0.01397705078125, -0.00830078125, 0.0126953125, -0.00482177734375, 0.019287109375, -0.00341796875, -0.005401611328125, 0.0162353515625, 0.01...
[ 1250, 4867, 5303, 162515, 502, 36849, 109637, 31577, 33022, 18151, 5646, 30646, 756, 80836, 12638, 12830, 27781, 2060, 19048, 2046, 3675, 50960, 13315, 959, 10588, 140992 ]
[ 0.1649169921875, 0.234130859375, 0.185302734375, 0.2161865234375, 0.1221923828125, 0.13134765625, 0.2406005859375, 0.05877685546875, 0.06317138671875, 0.145751953125, 0.06549072265625, 0.11279296875, 0.03515625, 0.193359375, 0.01861572265625, 0.1302490234375, 0.0012149810791015625, ...
embed
21258455_c0
21258455
prolog
0
Title: What is this SATCHMO code for? Problem title: What is this SATCHMO code for? Tags: prolog Problem: What is this SATCHMO code for? I have a code of SATCHMO and I have tried to understand it but I could not: Prove(true). Prove(A & B) :- Prove(A), Prove(B). Prove (A or B):- Prove(A); Prove(B). Prove(A):- P => A, Pr...
What is this SATCHMO code for? What is this SATCHMO code for? prolog What SATCHMO Prove What is this SATCHMO code for? I have a code of SATCHMO and I have tried to understand it but I could not: and how can I test it in prolog? I have somequestions about it and I am looking to hier a tutor who could explain such things...
[ 0.038818359375, 0.006317138671875, 0.00738525390625, 0.04833984375, -0.01495361328125, 0.024658203125, -0.00041961669921875, 0.01806640625, -0.01129150390625, -0.0184326171875, 0.00738525390625, 0.0002765655517578125, -0.0230712890625, -0.00616455078125, 0.0206298828125, 0.012817382812...
[ 4865, 83, 903, 5377, 142481, 12013, 18151, 100, 502, 4867, 1250, 272, 111, 28219, 5809, 959, 831, 3034, 442, 23, 16487, 1791, 121314, 73342 ]
[ 0.081787109375, 0.0634765625, 0.09881591796875, 0.1326904296875, 0.1527099609375, 0.269287109375, 0.219970703125, 0.14111328125, 0.1317138671875, 0.169921875, 0.10321044921875, 0.11865234375, 0.01812744140625, 0.0933837890625, 0.0207366943359375, 0.04119873046875, 0.0212249755859375,...
embed
9967885_c0
9967885
prolog
0
Title: DCG(again) creating abstrac tree in semantic actions Problem title: DCG(again) creating abstrac tree in semantic actions Tags: dcg, prolog Problem: DCG(again) creating abstrac tree in semantic actions Here is some gramma wich represents tree <tree> -> * <tree> -> (<tree><tree>) where * means leaf and couple of t...
DCG(again) creating abstrac tree in semantic actions DCG(again) creating abstrac tree in semantic actions dcg prolog DCG DCG(again) creating abstrac tree in semantic actions Here is some gramma wich represents tree where * means leaf and couple of trees in parentheses describes root that sons are trees in parentheses. ...
[ 0.031494140625, 0.004669189453125, -0.004791259765625, 0.0220947265625, 0.0172119140625, 0.033935546875, -0.033935546875, 0.00004482269287109375, 0.018798828125, -0.05224609375, -0.0126953125, -0.015380859375, -0.00897216796875, 0.00147247314453125, 0.0311279296875, -0.0007705688476562...
[ 391, 56367, 4729, 73, 105233, 43719, 39989, 53201, 484, 109109, 61972, 238, 177, 502, 4867, 122092, 11, 33636, 661, 26950, 2407, 24941, 1360, 49129, 35412, 98363, 74855, 775, 7, 434, 18781, 47, 104, 15190, 28282, 107838, 110, 12477, 27781, ...
[ 0.0550537109375, 0.1900634765625, 0.039154052734375, 0.0196075439453125, 0.059814453125, 0.1195068359375, 0.18408203125, 0.2352294921875, 0.1090087890625, 0.1075439453125, 0.1627197265625, 0.03485107421875, 0.1318359375, 0.10498046875, 0.1588134765625, 0.1224365234375, 0.059753417968...
embed
61608825_c1
61608825
prolog
1
with my recursion? (I don't think so since it was able to read blue , smooth and all the way down to combo5 ) Output that I'm getting ?- exists(combo1). false ?- exists(X). X = blue; X = smooth; X = combo5; false Appreciate any help on this. Many thanks! EDIT: Revised Attempt exists(X) :- store(_,_,S), isIn(X,S). isIn...
with my recursion? (I don't think so since it was able to read blue , smooth and all the way down to combo5 ) Output that I'm getting ?- exists(combo1). false ?- exists(X). X = blue; X = smooth; X = combo5; false Appreciate any help on this. Many thanks! EDIT: Revised Attempt exists(X) :- store(_,_,S), isIn(X,S). isIn...
[ -0.0054931640625, 0.026611328125, 0.0164794921875, 0.0230712890625, 0.0089111328125, 0.020751953125, -0.00628662109375, 0.00860595703125, 0.025634765625, 0.00009441375732421875, 0.0308837890625, 0.0150146484375, 0.0147705078125, -0.01202392578125, 0.0115966796875, -0.003082275390625, ...
[ 678, 759, 195625, 1830, 18, 5351, 19048, 12301, 57571, 156100, 7565, 375, 837, 758, 13538, 7077, 20949, 32316, 7, 277, 17727, 98320, 1542, 1193, 2203, 51606, 4358, 172864, 63441, 34224, 4343, 294, 83, 4153, 26634, 29827, 478, 839, 618, 96...
[ 0.1285400390625, 0.06768798828125, 0.290283203125, 0.1849365234375, 0.061187744140625, 0.0919189453125, 0.058685302734375, 0.1748046875, 0.2144775390625, 0.268310546875, 0.039306640625, 0.1246337890625, 0.1785888671875, 0.1494140625, 0.16357421875, 0.1732177734375, 0.10791015625, 0...
embed
4653784_c0
4653784
prolog
0
Title: Get all sets of list in prolog Problem title: Get all sets of list in prolog Tags: prolog Problem: Get all sets of list in prolog How can I generate all the possible sets of the elements of a list with current length? ?- get_set(X, [1,2,3]). X = [1,1,1] ; X = [1,1,2] ; X = [1,1,3] ; X = [1,2,1] ; X = [1,2,2] ; X...
Get all sets of list in prolog Get all sets of list in prolog prolog Get get_set Get all sets of list in prolog How can I generate all the possible sets of the elements of a list with current length? UPD: there is good answer given by Sharky. But maybe it's not the best. Here is another:
[ 0.003448486328125, 0.022216796875, 0.00775146484375, 0.00110626220703125, -0.0201416015625, 0.0035400390625, -0.0096435546875, -0.004852294921875, 0.0281982421875, -0.03662109375, 0.01055908203125, 0.037353515625, 0.002227783203125, 0.022705078125, -0.01019287109375, 0.01708984375, 0...
[ 20779, 756, 5423, 7, 111, 5303, 23, 502, 4867, 2046, 3509, 831, 87, 139392, 70, 7722, 80854, 678, 43581, 140909, 35166, 1002, 2965 ]
[ 0.1165771484375, 0.172119140625, 0.25537109375, 0.1009521484375, 0.1185302734375, 0.2188720703125, 0.07568359375, 0.1654052734375, 0.2386474609375, 0.1217041015625, 0.235595703125, 0.07208251953125, 0.0178985595703125, 0.1741943359375, 0.050201416015625, 0.168701171875, 0.15283203125...
embed
71155383_c1
71155383
prolog
1
snap/swi-prolog/48/usr/lib/swipl/boot/toplevel.pl:1162 ERROR: ERROR: Note: some frames are missing due to last-call optimization. ERROR: Re-run your program in debug mode (:- debug.) to get more detail. The git command is in my path, so Im stuck. Any help is greatly appreaciated. Audun Code signals: git, Package, SWI, ...
snap/swi-prolog/48/usr/lib/swipl/boot/toplevel.pl:1162 ERROR: ERROR: Note: some frames are missing due to last-call optimization. ERROR: Re-run your program in debug mode (:- debug.) to get more detail. The git command is in my path, so Im stuck. Any help is greatly appreaciated. Audun Code signals: git, Package, SWI, ...
[ 0.0185546875, 0.038330078125, -0.01019287109375, 0.0172119140625, -0.0283203125, 0.00238037109375, 0.00787353515625, 0.000244140625, 0.006256103515625, -0.025146484375, 0.0167236328125, -0.009033203125, -0.01806640625, 0.01190185546875, 0.0145263671875, -0.00101470947265625, 0.009948...
[ 76685, 7, 2452, 3454, 4867, 17357, 74758, 5612, 2424, 80765, 13784, 67919, 19993, 10837, 151206, 24638, 18622, 3060, 2674, 621, 132283, 4743, 4568, 85763, 87235, 1363, 853, 16428, 1528, 8, 85779, 13736, 9, 22443, 62270, 75101, 83, 23, 759, ...
[ 0.245849609375, 0.04412841796875, 0.2415771484375, 0.1292724609375, 0.2042236328125, 0.06036376953125, 0.036865234375, 0.06329345703125, 0.208740234375, 0.194091796875, 0.1331787109375, 0.248046875, 0.0194244384765625, 0.196044921875, 0.1728515625, 0.1619873046875, 0.1138916015625, ...
embed
63814832_c0
63814832
prolog
0
Title: Trying to learn prolog Problem title: Trying to learn prolog Tags: prolog Problem: Trying to learn prolog I was given the question: Define a 2-place predicate 'increment' that holds only when its second argument is an integer one larger than its first argument. For examples, increment(4,5) should hold, but incrm...
Trying to learn prolog Trying to learn prolog prolog Trying Trying to learn prolog I was given the question: Define a 2-place predicate 'increment' that holds only when its second argument is an integer one larger than its first argument. For examples, increment(4,5) should hold, but incrment(4,6) should not. So I wrot...
[ 0.01019287109375, 0.0157470703125, 0.004547119140625, 0.0211181640625, -0.0111083984375, 0.0172119140625, 0.00421142578125, -0.0106201171875, -0.00011777877807617188, -0.031005859375, -0.00238037109375, 0.007293701171875, -0.028564453125, 0.0283203125, 0.02685546875, -0.01202392578125,...
[ 40858, 30698, 502, 4867, 34475, 9655, 262, 64552, 4720, 23935, 1653, 2063, 67, 158661, 16401, 4734, 3229, 17932, 10750, 83, 892, 1505, 1632, 150679, 3501, 5117, 27781, 80389, 5608, 1284, 23, 23150, 674, 128191, 959, 54397, 903, 22027, 18, ...
[ 0.0684814453125, 0.076904296875, 0.108154296875, 0.1998291015625, 0.00579833984375, 0.007843017578125, 0.010467529296875, 0.1202392578125, 0.1522216796875, 0.174560546875, 0.126708984375, 0.1759033203125, 0.065185546875, 0.27001953125, 0.1676025390625, 0.08184814453125, 0.04782104492...
embed
4234001_c0
4234001
prolog
0
Title: Prolog definition of succ/2 Problem title: Prolog definition of succ/2 Tags: prolog Problem: Prolog definition of succ/2 I often used SWI-Prolog's feature of being able to do listing(predicate). to see how it implements some of its predicates. I want to see exactly what it does with succ/2 because I'm using it o...
Prolog definition of succ/2 Prolog definition of succ/2 prolog Prolog Prolog definition of succ/2 I often used SWI-Prolog's feature of being able to do listing(predicate). to see how it implements some of its predicates. I want to see exactly what it does with succ/2 because I'm using it on SWI-Prolog but I need it run...
[ 0.029052734375, 0.007720947265625, 0.0181884765625, 0.005615234375, -0.00628662109375, 0.0322265625, 0.002288818359375, 0.00445556640625, -0.00138092041015625, -0.01806640625, 0.01434326171875, -0.01446533203125, -0.0184326171875, -0.00396728515625, 0.0186767578125, -0.0030975341796875...
[ 1250, 4867, 80934, 166, 10060, 12477, 502, 111, 27983, 11814, 159, 38969, 10752, 60213, 5303, 214, 19714, 2063, 29479, 1653, 14602, 678, 17368, 51042, 63457, 18253, 23009, 2967, 76199, 1745, 184293 ]
[ 0.1722412109375, 0.2216796875, 0.186767578125, 0.161376953125, 0.203125, 0.254638671875, 0.1317138671875, 0.000274658203125, 0.010650634765625, 0.01220703125, 0.024078369140625, 0.173583984375, 0.1224365234375, 0.1474609375, 0.1376953125, 0.0789794921875, 0.09112548828125, 0.116821...
embed
51848890_c0
51848890
prolog
0
Title: Heuristic table converted to prolog facts highlight error Problem title: Heuristic table converted to prolog facts highlight error Tags: prolog Problem: Heuristic table converted to prolog facts highlight error I have a Heuristc table with point Node & H(n) node value. Am I correct below in converting to prolog ...
Heuristic table converted to prolog facts highlight error Heuristic table converted to prolog facts highlight error prolog Heuristic Node Table Heuristic table converted to prolog facts highlight error I have a Heuristc table with point Node & H(n) node value. Am I correct below in converting to prolog facts? It's givi...
[ 0.01513671875, -0.0281982421875, -0.00982666015625, 0.00107574462890625, 0.00130462646484375, 0.004058837890625, 0.0181884765625, -0.01214599609375, 0.0125732421875, 0.016845703125, -0.00531005859375, -0.0137939453125, -0.004638671875, 0.01446533203125, 0.004241943359375, -0.0048217773...
[ 1529, 474, 48242, 23180, 117176, 47, 502, 4867, 15824, 127308, 18499, 438, 112, 112997, 1162, 271, 238, 6275, 619, 572, 19, 110, 34292, 26785, 35064, 96760, 205811, 98, 756, 3540, 118, 289, 120820, 5, 284, 571, 441, 3871, 98816, 92319, ...
[ 0.074951171875, 0.168701171875, 0.148681640625, 0.194580078125, 0.091064453125, 0.059906005859375, 0.12451171875, 0.2060546875, 0.139404296875, 0.24951171875, 0.179931640625, 0.118408203125, 0.1226806640625, 0.15087890625, 0.169921875, 0.0858154296875, 0.042449951171875, 0.11267089...
embed
20562690_c1
20562690
prolog
1
), travelLoop(Thru,Y,[Thru|Passed]),X\=Y. travel(_,_):-write('Wrong travel input, please try again.'),nl. (2) travel(X,Y,go(X,Y)):-byCar(X,Y). travel(X,Y,go(X,Y)):-byTrain(X,Y). travel(X,Y,go(X,Y)):-byPlane(X,Y). travel(X,Y,go(X,Z,W)):-travel(X,Z,go(X,Z)),travel(Z,Y,W). (3) travel1(X,Y,go(X,Y,car)):-byCar(X,Y). travel1...
), travelLoop(Thru,Y,[Thru|Passed]),X\=Y. travel(_,_):-write('Wrong travel input, please try again.'),nl. (2) travel(X,Y,go(X,Y)):-byCar(X,Y). travel(X,Y,go(X,Y)):-byTrain(X,Y). travel(X,Y,go(X,Y)):-byPlane(X,Y). travel(X,Y,go(X,Z,W)):-travel(X,Z,go(X,Z)),travel(Z,Y,W). (3) travel1(X,Y,go(X,Y,car)):-byCar(X,Y). travel1...
[ 0.0279541015625, 0.01318359375, -0.01116943359375, 0.00106048583984375, 0.005828857421875, 0.002532958984375, -0.00106048583984375, -0.025146484375, 0.017822265625, -0.03125, 0.00162506103515625, 0.01324462890625, -0.0302734375, 0.005523681640625, -0.0019073486328125, -0.00747680664062...
[ 247, 26983, 15363, 2146, 20800, 882, 1723, 139117, 297, 1542, 1369, 18781, 1456, 35133, 107730, 22936, 9790, 13438, 13169, 1737, 519, 1272, 21851, 28542, 78680, 91844, 2788, 418, 3284, 1517, 5868, 856, 1511, 5351, 47, 136, 33462, 1653, 2063...
[ 0.048309326171875, 0.27978515625, 0.1229248046875, 0.1923828125, 0.044586181640625, 0.207763671875, 0.14208984375, 0.181640625, 0.1326904296875, 0.0836181640625, 0.0052490234375, 0.041839599609375, 0.08056640625, 0.214599609375, 0.1859130859375, 0.0880126953125, 0.1102294921875, 0....
embed
49224173_c0
49224173
prolog
0
Title: How to sort a list of strings by a part of the string in prolog Problem title: How to sort a list of strings by a part of the string in prolog Tags: sorting, prolog Problem: How to sort a list of strings by a part of the string in prolog If I have a list containing 123.1234,abc and 321.321,qwe , how can i sort t...
How to sort a list of strings by a part of the string in prolog How to sort a list of strings by a part of the string in prolog sorting prolog How How to sort a list of strings by a part of the string in prolog If I have a list containing 123.1234,abc and 321.321,qwe , how can i sort the list by only the float value? I...
[ 0.0159912109375, -0.0032958984375, 0.00011920928955078125, -0.0164794921875, -0.013427734375, -0.0152587890625, 0.00555419921875, -0.00164794921875, 0.01007080078125, -0.0125732421875, -0.01220703125, 0.01556396484375, -0.01434326171875, -0.00830078125, -0.006378173828125, -0.029052734...
[ 11249, 47, 12096, 5303, 79315, 7, 390, 2831, 111, 23, 502, 4867, 214, 70541, 37638, 190875, 2055, 238, 2789, 81046, 3117, 864, 1177, 4734, 21917, 257, 34292, 4527, 17357, 18, 4488, 7722, 22799, 62351, 44691, 35166 ]
[ 0.048126220703125, 0.04156494140625, 0.2406005859375, 0.167236328125, 0.242919921875, 0.017303466796875, 0.09674072265625, 0.1519775390625, 0.04949951171875, 0.009674072265625, 0.156982421875, 0.2310791015625, 0.0246429443359375, 0.03497314453125, 0.1719970703125, 0.131591796875, 0.0...
embed
5089928_c0
5089928
prolog
0
Title: Connecting Prolog File with PHP file Problem title: Connecting Prolog File with PHP file Tags: prolog, php Problem: Connecting Prolog File with PHP file I have a Prolog code data.pl , and I need to use it from a PHP file. From my search in internet, I found this: exec('start <path/to/prolog> -f data.pl -g elem(a...
Connecting Prolog File with PHP file Connecting Prolog File with PHP file prolog php Connecting Prolog File PHP data.pl Shell-exec Connecting Prolog File with PHP file I have a Prolog code data.pl , and I need to use it from a PHP file. From my search in internet, I found this: I've tried this with Shell-exec() and sys...
[ 0.03857421875, 0.0037689208984375, 0.0152587890625, 0.0213623046875, 0.00335693359375, 0.031494140625, 0.00787353515625, -0.000911712646484375, -0.00982666015625, -0.08154296875, 0.0167236328125, 0.0380859375, -0.0255126953125, 0.01141357421875, -0.004180908203125, -0.00088119506835937...
[ 62448, 214, 1250, 4867, 42724, 678, 47302, 11435, 502, 3958, 2053, 2424, 108362, 46480, 238, 765, 18151, 3871, 4527, 442, 1295, 903, 37842, 132, 5426, 75101, 959, 4488, 26785, 14364, 60875, 25813, 47, 188, 3454, 78303, 7464, 110, 16750, 4...
[ 0.1805419921875, 0.0244140625, 0.2041015625, 0.262939453125, 0.201416015625, 0.1351318359375, 0.244873046875, 0.1719970703125, 0.1568603515625, 0.1702880859375, 0.1429443359375, 0.18603515625, 0.1800537109375, 0.1524658203125, 0.092529296875, 0.00531005859375, 0.1697998046875, 0.03...
embed
77447439_c0
77447439
prolog
0
Title: Fibonacci using DCG Problem title: Fibonacci using DCG Tags: fibonacci, prolog, dcg Problem: Fibonacci using DCG I am in the process of trying to create the fibonacci series using DCG in prolog. I have this for starters, however I have no idea why the code is not being carried out. Here is the code below: fib --...
Fibonacci using DCG Fibonacci using DCG fibonacci prolog dcg DCG Fibonacci Fibonacci using DCG I am in the process of trying to create the fibonacci series using DCG in prolog. I have this for starters, however I have no idea why the code is not being carried out. Here is the code below: I get an error that the variabl...
[ 0.032958984375, 0.0021209716796875, -0.007080078125, 0.00750732421875, -0.000858306884765625, 0.00946044921875, -0.00592041015625, -0.0086669921875, 0.0159912109375, -0.03369140625, -0.0159912109375, -0.0252685546875, -0.0166015625, 0.02294921875, 0.0091552734375, 0.013671875, 0.0070...
[ 3698, 20990, 52544, 17368, 391, 56367, 809, 502, 4867, 177, 9433, 31577, 28282, 36549, 44177, 6528, 15400, 18151, 959, 8035, 175100, 1810, 35064, 18499, 77336, 129980, 34648, 14, 29806, 2060, 2704, 237875, 232460, 7722, 67660, 107730, 77947 ]
[ 0.113525390625, 0.148681640625, 0.181396484375, 0.100830078125, 0.1041259765625, 0.229248046875, 0.10986328125, 0.1219482421875, 0.2078857421875, 0.047454833984375, 0.012481689453125, 0.05224609375, 0.0994873046875, 0.1490478515625, 0.048095703125, 0.03125, 0.059906005859375, 0.169...
embed
27293390_c0
27293390
prolog
0
Title: Prolog - Listing Problem title: Prolog - Listing Tags: prolog Problem: Prolog - Listing I have some problem with trying to work out my code here. Let's say I have these codes: university('University of Cambridge', 1, 'United Kingdom', 90.3, 92.8, 89.4), university('University of Oxford', 2, 'United Kingdom', 88....
Prolog - Listing Prolog - Listing prolog Prolog Listing University Cambridge United Kingdom Oxford Prolog - Listing I have some problem with trying to work out my code here. Let's say I have these codes: How do I list out the names of the universities only? I tried doing listing. and listing(university). but that list ...
[ 0.017578125, 0.00138092041015625, 0.01318359375, 0.01373291015625, -0.006744384765625, -0.00038909912109375, 0.005950927734375, 0.0014190673828125, -0.0012054443359375, -0.0260009765625, -0.0146484375, -0.0172119140625, -0.0036163330078125, -0.0184326171875, -0.00982666015625, -0.00346...
[ 1250, 4867, 32036, 214, 502, 12535, 105109, 14098, 117604, 42673, 20, 2967, 31577, 4488, 1810, 759, 18151, 3688, 11249, 54, 87, 5303, 70, 123055, 111, 141626, 90, 4734, 37842, 136, 49545, 2481, 26818, 91736, 40858, 2046, 1884 ]
[ 0.1519775390625, 0.2291259765625, 0.1705322265625, 0.1558837890625, 0.09326171875, 0.186767578125, 0.26806640625, 0.09295654296875, 0.1483154296875, 0.272216796875, 0.006195068359375, 0.09539794921875, 0.0157470703125, 0.0390625, 0.1373291015625, 0.0207366943359375, 0.19384765625, ...
embed
19045248_c0
19045248
prolog
0
Title: Graph path define issue Problem title: Graph path define issue Tags: shortest-path, prolog Problem: Graph path define issue The solution ppath(X,Y,M,Path,[Y|Path]) :- edge(X,Y,M),\+ memberchk(Y,Path). path(X,Y,P,SoFar,Path) :- edge(X,W,M), \+ memberchk(W,SoFar), path(W,Y,N,[W|SoFar],Path), P is M+N. pravilo(X,Y,...
Graph path define issue Graph path define issue shortest-path prolog Graph Path SoFar Graph path define issue The solution Here is the code i have. The question is that starting point is a, and ending point is z. There is an error after execution, the result is displayed like [z, c, h, b]. But the correct answer should...
[ 0.0108642578125, 0.01507568359375, 0.00360107421875, 0.0218505859375, -0.0235595703125, -0.002197265625, -0.01068115234375, -0.0244140625, 0.007537841796875, -0.01165771484375, 0.01397705078125, 0.011962890625, -0.007110595703125, 0.005615234375, 0.0240478515625, 0.0189208984375, 0.0...
[ 6524, 11727, 60875, 61924, 31089, 16610, 525, 128405, 502, 4867, 108421, 1061, 80908, 29806, 18151, 765, 9655, 72134, 6275, 83, 10, 136, 86658, 97, 18499, 7103, 71924, 4, 16750, 44116, 1884, 169, 501, 1096, 876, 4966, 26785, 35166, 5608, ...
[ 0.15771484375, 0.1463623046875, 0.235107421875, 0.2210693359375, 0.154541015625, 0.1697998046875, 0.125244140625, 0.17919921875, 0.12255859375, 0.17333984375, 0.2100830078125, 0.00054931640625, 0.1363525390625, 0.08074951171875, 0.1319580078125, 0.020263671875, 0.09906005859375, 0....
embed
4753663_c0
4753663
prolog
0
Title: Bubble sort in Prolog language Problem title: Bubble sort in Prolog language Tags: prolog, bubble-sort Problem: Bubble sort in Prolog language I must implement the bubble sort function (the sorting algorithm). I have already implemented bubblesort and swap , a help function for bubblesort : swap([X,Y|T1],[Y,X|T1...
Bubble sort in Prolog language Bubble sort in Prolog language prolog bubble-sort Bubble Prolog Bubble sort in Prolog language I must implement the bubble sort function (the sorting algorithm). I have already implemented bubblesort and swap , a help function for bubblesort : I get an infinite loop. I must keep the signa...
[ 0.026611328125, 0.0250244140625, 0.016357421875, 0.00543212890625, -0.01416015625, 0.00811767578125, -0.0224609375, -0.019287109375, -0.0234375, 0.0012969970703125, 0.0126953125, 0.0108642578125, -0.0181884765625, -0.016357421875, 0.01165771484375, -0.000598907470703125, 0.0164794921...
[ 667, 73163, 12096, 1250, 4867, 46876, 23, 502, 373, 62351, 8110, 29479, 32354, 214, 234873, 21771, 136, 202317, 4358, 54241, 40956, 13695, 138256, 179933, 21974, 6528 ]
[ 0.08740234375, 0.20654296875, 0.2130126953125, 0.116943359375, 0.2125244140625, 0.110595703125, 0.0025634765625, 0.0867919921875, 0.07305908203125, 0.19775390625, 0.0784912109375, 0.12158203125, 0.1351318359375, 0.043701171875, 0.1436767578125, 0.033599853515625, 0.011016845703125, ...
embed
11915425_c1
11915425
prolog
1
|NewL], *) ), ! ; make_list([X1|L1], L2, [X3|NewL], *). My question is how to make it work as expected and why does B not work once A is done? After all it is also in the same parenthesis, e.g.: ?- make_list([6,6,10,20],[10,25,30],L, -). L = [6|_G849] % (should be [6,20]). EDIT1: make_list should find all members in L1...
|NewL], *) ), ! ; make_list([X1|L1], L2, [X3|NewL], *). My question is how to make it work as expected and why does B not work once A is done? After all it is also in the same parenthesis, e.g.: ?- make_list([6,6,10,20],[10,25,30],L, -). L = [6|_G849] % (should be [6,20]). EDIT1: make_list should find all members in L1...
[ -0.0240478515625, 0.0025482177734375, 0.0028228759765625, 0.01123046875, -0.007110595703125, 0.016357421875, -0.03125, 0.005645751953125, 0.0299072265625, 0.016845703125, 0.01708984375, 0.0025482177734375, 0.017822265625, 0.01495361328125, 0.01123046875, -0.004241943359375, 0.0257568...
[ 58745, 46568, 866, 661, 711, 3249, 6562, 1542, 418, 76172, 339, 304, 363, 4, 9655, 3642, 47, 442, 4488, 237, 84751, 15400, 14602, 335, 959, 24145, 62, 83, 16940, 23, 5701, 49129, 160291, 705, 140447, 963, 1549, 2588, 1197, 910, 178764, ...
[ 0.01055908203125, 0.172119140625, 0.183349609375, 0.0667724609375, 0.06890869140625, 0.1595458984375, 0.276123046875, 0.076171875, 0.0892333984375, 0.07171630859375, 0.136962890625, 0.08612060546875, 0.1168212890625, 0.008270263671875, 0.041259765625, 0.09564208984375, 0.035400390625...
embed
47654013_c0
47654013
prolog
0
Title: Process user input to &quot;phrase/3&quot; method in Prolog Problem title: Process user input to &quot;phrase/3&quot; method in Prolog Tags: dcg, prolog, swi-prolog Problem: Process user input to "phrase/3" method in Prolog I have build a DCG with Prolog. The code works, when I do the following call: phrase(prog...
Process user input to &quot;phrase/3&quot; method in Prolog Process user input to &quot;phrase/3&quot; method in Prolog dcg prolog swi-prolog Process Prolog Input atom_chars Process user input to "phrase/3" method in Prolog I have build a DCG with Prolog. The code works, when I do the following call: I want the user to...
[ -0.00640869140625, -0.00421142578125, 0.006866455078125, 0.048583984375, 0.00341796875, 0.018798828125, 0.0191650390625, -0.00933837890625, -0.00157928466796875, -0.06494140625, -0.0036468505859375, 0.000446319580078125, -0.0274658203125, 0.008544921875, -0.003143310546875, 0.010314941...
[ 123996, 38937, 107730, 47, 179665, 184, 18113, 55300, 1250, 4867, 104, 177, 502, 2452, 3454, 360, 34627, 9254, 45367, 391, 56367, 18151, 43240, 11782, 3444, 33022, 26265, 5201, 418, 54651, 18, 4488, 9433, 113860, 159029 ]
[ 0.138427734375, 0.15625, 0.2076416015625, 0.06744384765625, 0.18408203125, 0.084228515625, 0.228759765625, 0.1673583984375, 0.1434326171875, 0.21728515625, 0.001495361328125, 0.041168212890625, 0.07415771484375, 0.0927734375, 0.083251953125, 0.005584716796875, 0.181884765625, 0.133...
embed
53678572_c0
53678572
prolog
0
Title: How come this Prolog rule doesn&#x27;t go into a infinity loop? Problem title: How come this Prolog rule doesn&#x27;t go into a infinity loop? Tags: prolog Problem: How come this Prolog rule doesn't go into a infinity loop? I have following facts and rules: one(s). one(t). two(X,Y) :- one(X), one(Y), three(X), \...
How come this Prolog rule doesn&#x27;t go into a infinity loop? How come this Prolog rule doesn&#x27;t go into a infinity loop? prolog How Prolog How come this Prolog rule doesn't go into a infinity loop? I have following facts and rules: For the query two(Y,X). I get this result: I don't understand why the results are...
[ 0.019287109375, 0.0162353515625, 0.00836181640625, 0.0233154296875, 0.009765625, 0.004119873046875, 0.00156402587890625, 0.01385498046875, 0.0135498046875, -0.0157470703125, 0.0191650390625, -0.0003662109375, -0.003143310546875, 0.0037384033203125, 0.0106201171875, 0.038818359375, 0....
[ 11249, 1380, 903, 1250, 4867, 79986, 22027, 3768, 18, 738, 3934, 54241, 53, 40956, 502, 10, 15824, 91736, 41, 1294, 6626, 1723, 1542, 16750, 2301, 28219, 15400, 50339, 621, 990, 1369, 7, 136, 1193, 44084, 14602, 5941, 20028, 41872, 1328, ...
[ 0.0841064453125, 0.10498046875, 0.04010009765625, 0.1834716796875, 0.262939453125, 0.1781005859375, 0.08905029296875, 0.0360107421875, 0.1346435546875, 0.0743408203125, 0.1085205078125, 0.135498046875, 0.07086181640625, 0.185302734375, 0.11669921875, 0.012298583984375, 0.02783203125,...
embed
19800275_c0
19800275
prolog
0
Title: Prolog Write an entire search tree for a query Problem title: Prolog Write an entire search tree for a query Tags: search-tree, prolog Problem: Prolog Write an entire search tree for a query So for my class I'm asked to write an entire search tree for the query below. I have been given an example sheet however t...
Prolog Write an entire search tree for a query Prolog Write an entire search tree for a query search-tree prolog Prolog Write Prolog Write an entire search tree for a query So for my class I'm asked to write an entire search tree for the query below. I have been given an example sheet however to be honest my eyes glaze...
[ 0.0260009765625, 0.032958984375, -0.01611328125, 0.007110595703125, -0.0211181640625, 0.0262451171875, -0.00982666015625, -0.0205078125, -0.00787353515625, -0.0260009765625, 0.00897216796875, -0.013427734375, -0.00213623046875, 0.0133056640625, -0.002899169921875, 0.01263427734375, 0...
[ 1250, 4867, 601, 18781, 64194, 33938, 53201, 100, 41, 1294, 62600, 502, 18507, 37170, 33022, 70, 35064, 27781, 155434, 42551, 46223, 70019, 645, 16487, 35691, 9433, 29954, 73342, 34475 ]
[ 0.1273193359375, 0.200927734375, 0.060150146484375, 0.0863037109375, 0.1510009765625, 0.176025390625, 0.271728515625, 0.0736083984375, 0.1326904296875, 0.0810546875, 0.2203369140625, 0.0743408203125, 0.10205078125, 0.0748291015625, 0.119140625, 0.0062255859375, 0.0672607421875, 0.1...
embed
42211146_c0
42211146
prolog
0
Title: Understand a simple recursion in prolog Problem title: Understand a simple recursion in prolog Tags: prolog, recursion Problem: Understand a simple recursion in prolog I have the following Prolog from the book mastering Prolog, and I'm trying to learn some simple recursion. mins_to_hours(In, H, M):- In<60, H = 0...
Understand a simple recursion in prolog Understand a simple recursion in prolog prolog recursion Understand mins_to_hours In1 In-60 Understand a simple recursion in prolog I have the following Prolog from the book mastering Prolog, and I'm trying to learn some simple recursion. I'm not entirely sure why it doesn't work...
[ 0.003570556640625, 0.006195068359375, 0.01068115234375, 0.0027618408203125, -0.002410888671875, -0.00836181640625, -0.020751953125, -0.0026702880859375, 0.0150146484375, -0.01806640625, 0.00885009765625, -0.035888671875, 0.012451171875, 0.01611328125, 0.0439453125, -0.017333984375, 0...
[ 9626, 5165, 8781, 195625, 1830, 23, 502, 4867, 10, 881, 7, 188, 497, 12824, 360, 418, 60488, 25632, 1250, 12877, 31347, 31577, 30698, 9077, 15400, 22027, 18, 4488, 4028, 2069, 21974, 4358 ]
[ 0.10577392578125, 0.115966796875, 0.176025390625, 0.2080078125, 0.1346435546875, 0.065673828125, 0.1436767578125, 0.224365234375, 0.00909423828125, 0.1796875, 0.0193328857421875, 0.0867919921875, 0.1361083984375, 0.07525634765625, 0.091796875, 0.029205322265625, 0.1943359375, 0.036...
embed
9858574_c0
9858574
prolog
0
Title: Rewrite predicate Problem title: Rewrite predicate Tags: prolog Problem: Rewrite predicate scal(_, _, [], []). scal(Lista, [H|T], Wszystkie, [(X-Y)|Wynik]) :- wez_poz(H, Lista, (X-Y)), select(X, Wszystkie, W2), select(Y, W2, W3), scal(Lista, T, W3, Wynik). Does any one know how to rewrite that predicate to be co...
Rewrite predicate Rewrite predicate prolog Rewrite Lista Wszystkie X-Y Wynik wez_poz List Rewrite predicate Does any one know how to rewrite that predicate to be completely different but works same? wez_poz(H, List, (X-Y)) unifies X and Y with position of H in Lista , and Wszystkie is list of all positions in matrix, f...
[ -0.016357421875, 0.002716064453125, 0.0029144287109375, 0.001434326171875, -0.0269775390625, -0.00811767578125, -0.007659912109375, 0.016357421875, 0.0123291015625, 0.01416015625, 0.01239013671875, 0.006103515625, -0.013671875, -0.0157470703125, -0.0032958984375, 0.00262451171875, 0....
[ 853, 434, 18781, 1653, 2063, 67, 502, 4867, 50085, 85697, 1193, 9, 1723, 5492, 1881, 642, 169, 454, 55467, 32036, 3714, 3642, 47, 456, 450, 186, 64557, 12921, 1284, 43240, 5701, 841, 1542, 51, 27430, 90, 136, 990, 19069, 572, 23, 6, ...
[ 0.1436767578125, 0.18408203125, 0.2491455078125, 0.1851806640625, 0.2244873046875, 0.1124267578125, 0.09405517578125, 0.142578125, 0.20947265625, 0.2578125, 0.080322265625, 0.06951904296875, 0.1375732421875, 0.054412841796875, 0.0909423828125, 0.09954833984375, 0.1407470703125, 0.0...
embed
39964185_c0
39964185
prolog
0
Title: How I can store the indexes where a number appears on a list of Prolog? Problem title: How I can store the indexes where a number appears on a list of Prolog? Tags: indexing, prolog Problem: How I can store the indexes where a number appears on a list of Prolog? For example: positions (X, L, R):- . Where: X is t...
How I can store the indexes where a number appears on a list of Prolog? How I can store the indexes where a number appears on a list of Prolog? indexing prolog How Prolog Pos Pos1 How I can store the indexes where a number appears on a list of Prolog? For example: positions (X, L, R):- . Where: X is the number that I a...
[ -0.0086669921875, 0.0012969970703125, 0.01129150390625, 0.0021820068359375, -0.00518798828125, 0.018310546875, 0.00011873245239257812, 0.00836181640625, 0.0166015625, -0.035400390625, 0.000591278076171875, -0.00341796875, -0.00982666015625, 0.0201416015625, 0.007354736328125, -0.000614...
[ 11249, 831, 4343, 63262, 90, 7440, 14012, 135179, 5303, 1250, 4867, 214, 502, 13498, 418, 19069, 1542, 339, 627, 1193, 16487, 100, 5941, 101935, 65395, 11651, 50339 ]
[ 0.058563232421875, 0.051727294921875, 0.2137451171875, 0.2137451171875, 0.1390380859375, 0.0391845703125, 0.1602783203125, 0.13427734375, 0.1473388671875, 0.1507568359375, 0.2462158203125, 0.033294677734375, 0.095458984375, 0.09136962890625, 0.0172576904296875, 0.17578125, 0.06225585...
embed
23261379_c0
23261379
prolog
0
Title: Prolog Assigning integer to a variable Problem title: Prolog Assigning integer to a variable Tags: prolog Problem: Prolog Assigning integer to a variable I'm new to Prolog, and using GNU Prolog, so no clp(fd) allowed. What I'm trying to do is for a given integer N, generate a list with elements of 1 ~ N. So set(...
Prolog Assigning integer to a variable Prolog Assigning integer to a variable prolog Prolog Assigning N-1 Prolog Assigning integer to a variable I'm new to Prolog, and using GNU Prolog, so no clp(fd) allowed. What I'm trying to do is for a given integer N, generate a list with elements of 1 ~ N. So set(3,T). will outpu...
[ 0.00885009765625, 0.012939453125, 0.0172119140625, 0.0185546875, 0.00360107421875, -0.002532958984375, -0.016845703125, 0.021728515625, 0.004852294921875, -0.02587890625, 0.0130615234375, -0.00848388671875, -0.0145263671875, 0.008544921875, 0.0157470703125, -0.005706787109375, 0.0302...
[ 1250, 4867, 1301, 31304, 892, 1505, 47, 77336, 502, 541, 5759, 3525, 165132, 254, 71, 107003, 31577, 34475, 139392, 5303, 80854, 106, 6780, 5423, 86827, 618, 140992, 384, 2203, 155761, 268, 2060, 9790, 54753, 150631, 90, 8, 978, 678, 1448...
[ 0.18603515625, 0.24658203125, 0.04473876953125, 0.204345703125, 0.145263671875, 0.1204833984375, 0.07171630859375, 0.2462158203125, 0.1300048828125, 0.1160888671875, 0.1812744140625, 0.029632568359375, 0.1251220703125, 0.046630859375, 0.0040283203125, 0.057281494140625, 0.08642578125...
embed
24095226_c1
24095226
prolog
1
Goal. myFunction(V1, V2, Result) :- **cached_call(keepValue(V1,V2,V1cover,V2cover),** Result is V1/V1cover + V2/V2cover, write(Result). but it doesn't work, when I try to run the second time myFunction(2,3,A) and trace the program, it actually stores solution of the first call but I couldn't get the first values of V1...
Goal. myFunction(V1, V2, Result) :- **cached_call(keepValue(V1,V2,V1cover,V2cover),** Result is V1/V1cover + V2/V2cover, write(Result). but it doesn't work, when I try to run the second time myFunction(2,3,A) and trace the program, it actually stores solution of the first call but I couldn't get the first values of V1...
[ 0.0042724609375, 0.002227783203125, 0.00958251953125, 0.005645751953125, 0.0098876953125, 0.00653076171875, 0.00738525390625, -0.0283203125, 0.00982666015625, -0.05029296875, 0.008056640625, 0.048095703125, -0.02880859375, 0.0072021484375, 0.0157470703125, 0.0015106201171875, -0.0008...
[ 2016, 289, 5, 759, 97249, 10763, 856, 418, 310, 304, 126684, 59863, 297, 85763, 350, 4517, 50770, 63127, 247, 83, 50412, 997, 45792, 33022, 4332, 7, 7136, 1284, 22027, 18, 4488, 9790, 11675, 17932, 1733, 155761, 284, 144851, 1528, 4343, ...
[ 0.1617431640625, 0.1597900390625, 0.01953125, 0.13671875, 0.1658935546875, 0.1448974609375, 0.154052734375, 0.08154296875, 0.148193359375, 0.15576171875, 0.235107421875, 0.17333984375, 0.14697265625, 0.202392578125, 0.1136474609375, 0.104736328125, 0.139404296875, 0.218505859375, ...
embed
50105762_c0
50105762
prolog
0
Title: Mutually exclusive events in prolog Problem title: Mutually exclusive events in prolog Tags: prolog, probability Problem: Mutually exclusive events in prolog I want to define events in prolog where if one happens the other cannot. For example I have 5 boxes of different sizes, say 50,50,50,80,90 squared cm, and ...
Mutually exclusive events in prolog Mutually exclusive events in prolog prolog probability Mutually Mutually exclusive events in prolog I want to define events in prolog where if one happens the other cannot. For example I have 5 boxes of different sizes, say 50,50,50,80,90 squared cm, and 4 storage spaces and if I put...
[ 0.0198974609375, -0.006378173828125, 0.01129150390625, -0.00518798828125, -0.024658203125, -0.00154876708984375, 0.003326416015625, 0.0213623046875, 0.0078125, -0.0015869140625, -0.0206298828125, 0.03369140625, 0.0164794921875, -0.0031280517578125, 0.013427734375, 0.0091552734375, 0....
[ 174948, 25958, 97629, 47353, 23, 502, 4867, 37242, 2481, 3444, 61924, 7440, 2174, 1632, 96276, 3789, 53418, 190, 16530, 12921, 13267, 836, 2525, 4836, 5039, 1827, 201, 132096, 32628, 959, 19048, 4343, 186351, 128512, 30535, 74481, 756, 7722, ...
[ 0.1278076171875, 0.1024169921875, 0.2391357421875, 0.224609375, 0.06097412109375, 0.1583251953125, 0.2396240234375, 0.2117919921875, 0.06036376953125, 0.051239013671875, 0.1473388671875, 0.013397216796875, 0.114501953125, 0.052734375, 0.1343994140625, 0.1103515625, 0.1854248046875, ...
embed
36104941_c0
36104941
prolog
0
Title: Append an integer to list N times with prolog Problem title: Append an integer to list N times with prolog Tags: list, prolog Problem: Append an integer to list N times with prolog I am trying to append an integer N times to a list. So far, I know how to append two lists and I am trying to use that calling a rec...
Append an integer to list N times with prolog Append an integer to list N times with prolog list prolog Append N-1 Test Expected Result Append an integer to list N times with prolog I am trying to append an integer N times to a list. So far, I know how to append two lists and I am trying to use that calling a recursive...
[ -0.006683349609375, 0.005340576171875, 0.0128173828125, 0.0064697265625, 0.006439208984375, 0.0145263671875, -0.0067138671875, 0.0157470703125, 0.017822265625, -0.0194091796875, 0.005035400390625, -0.0291748046875, -0.025146484375, 0.02880859375, 0.019775390625, -0.0034027099609375, ...
[ 5659, 3611, 892, 1505, 47, 5303, 541, 20028, 678, 502, 4867, 5759, 8647, 60075, 13, 89829, 126684, 31577, 114689, 71, 2060, 3714, 3642, 6626, 4527, 159029, 195625, 5844, 11782, 6468, 142, 5, 21771, 37842 ]
[ 0.1282958984375, 0.1181640625, 0.1376953125, 0.1279296875, 0.0771484375, 0.1995849609375, 0.1953125, 0.2420654296875, 0.046539306640625, 0.1466064453125, 0.2158203125, 0.121337890625, 0.1461181640625, 0.0572509765625, 0.0797119140625, 0.0233154296875, 0.10223388671875, 0.087890625,...
embed
13035819_c0
13035819
prolog
0
Title: SWI-Prolog Rule Problem title: SWI-Prolog Rule Tags: list, prolog Problem: SWI-Prolog Rule My rule is supposed to unify the first parameter with the third element in the list. The list is the second parameter in the rule. If there is no third element, this should fail. After many examples and confusion i have cr...
SWI-Prolog Rule SWI-Prolog Rule list prolog SWI-Prolog Rule SWI-Prolog Rule My rule is supposed to unify the first parameter with the third element in the list. The list is the second parameter in the rule. If there is no third element, this should fail. After many examples and confusion i have created this rule. So my...
[ 0.01513671875, 0.0201416015625, 0.01495361328125, 0.0084228515625, -0.0026092529296875, 0.00665283203125, -0.0081787109375, 0.01171875, 0.01495361328125, -0.002166748046875, 0.008544921875, -0.0162353515625, -0.005126953125, -0.0142822265625, 0.00174713134765625, 0.01025390625, 0.025...
[ 159, 38969, 10752, 4867, 139118, 5303, 502, 79986, 134598, 51, 40383, 5117, 171859, 678, 50960, 12830, 83, 17932, 110, 35782, 27781, 169463, 75935, 100094, 18822, 214552, 1221, 5423, 990, 47, 384, 46741, 2831, 61475, 1193, 55681, 18151, 5980,...
[ 0.059906005859375, 0.218505859375, 0.1241455078125, 0.1807861328125, 0.1927490234375, 0.1815185546875, 0.1048583984375, 0.2078857421875, 0.0806884765625, 0.1375732421875, 0.1466064453125, 0.06298828125, 0.19970703125, 0.1043701171875, 0.239990234375, 0.14453125, 0.026824951171875, ...
embed
28450235_c1
28450235
prolog
1
'): if item in read_str: return for linking in post_script_link_list: sub_link = re.search('\((.*?)\)', linking).group(1) if sub_link in ['Wq','Ws','Wi','Wd']: process_result = process(read_str) if process_result is not None: return process_result elif sub_link in ['Qd']: return 'Yes/No' if verify_yesno(post_script_lin...
'): if item in read_str: return for linking in post_script_link_list: sub_link = re.search('\((.*?)\)', linking).group(1) if sub_link in ['Wq','Ws','Wi','Wd']: process_result = process(read_str) if process_result is not None: return process_result elif sub_link in ['Qd']: return 'Yes/No' if verify_yesno(post_script_lin...
[ 0.0086669921875, -0.00958251953125, 0.00201416015625, 0.0201416015625, -0.002349853515625, 0.006683349609375, 0.033203125, -0.006011962890625, 0.004425048828125, 0.006195068359375, -0.00732421875, -0.00994873046875, -0.00811767578125, -0.0111083984375, -0.00103759765625, -0.00064849853...
[ 242, 2077, 2174, 35735, 23, 12301, 454, 9297, 12, 30646, 100, 3126, 214, 1305, 32032, 10187, 6562, 1614, 456, 86250, 1639, 51588, 864, 1456, 36119, 9433, 2109, 7136, 39116, 959, 438, 2737, 71, 91480, 64, 5021, 493, 40383, 63736, 157, 45...
[ 0.05279541015625, 0.08880615234375, 0.08001708984375, 0.172119140625, 0.066162109375, 0.247314453125, 0.037841796875, 0.2548828125, 0.004058837890625, 0.1575927734375, 0.00946044921875, 0.1890869140625, 0.124755859375, 0.1190185546875, 0.20703125, 0.2471923828125, 0.21484375, 0.217...
embed
8404424_c0
8404424
prolog
0
Title: GNUProlog only returns one of the values for a query Problem title: GNUProlog only returns one of the values for a query Tags: prolog Problem: GNUProlog only returns one of the values for a query % facts mother(john, dana). father(john, david). mother(chelsea, dana). father(chelsea, david). mother(jared, dana). ...
GNUProlog only returns one of the values for a query GNUProlog only returns one of the values for a query prolog GNUProlog GNUProlog only returns one of the values for a query When I type in "parent(john, X).", I get X = dana, but not X== david. However, on my previous question , the person who responded to me seems to...
[ 0.0169677734375, 0.0120849609375, -0.00201416015625, -0.00555419921875, -0.0245361328125, 0.01300048828125, 0.003509521484375, -0.01495361328125, -0.0068359375, -0.032470703125, 0.00079345703125, -0.0277099609375, -0.013671875, 0.0087890625, 0.01068115234375, 0.0081787109375, -0.0046...
[ 165132, 10752, 4867, 4734, 30646, 1632, 111, 70, 142424, 100, 41, 1294, 502, 10, 10644, 23, 99547, 66159, 19, 1193, 2046, 2203, 9272, 1284, 959, 69112, 48, 5518, 45739, 47, 37202, 15044, 27863, 205969, 706, 3454, 44691 ]
[ 0.1790771484375, 0.1962890625, 0.2476806640625, 0.1475830078125, 0.1937255859375, 0.145751953125, 0.088134765625, 0.010284423828125, 0.1558837890625, 0.06109619140625, 0.1268310546875, 0.0911865234375, 0.1346435546875, 0.0078125, 0.1619873046875, 0.009429931640625, 0.2275390625, 0....
embed
16328734_c0
16328734
prolog
0
Title: Explicitly failing a context free grammar sentence parse Problem title: Explicitly failing a context free grammar sentence parse Tags: parse-tree, dcg, prolog, context-free-grammar Problem: Explicitly failing a context free grammar sentence parse I have a context free grammar sentence parser which functions corr...
Explicitly failing a context free grammar sentence parse Explicitly failing a context free grammar sentence parse parse-tree dcg prolog context-free-grammar Explicitly Explicitly failing a context free grammar sentence parse I have a context free grammar sentence parser which functions correctly except for the fact tha...
[ 0.028564453125, 0.013427734375, -0.00176239013671875, 0.0194091796875, -0.006072998046875, 0.01239013671875, -0.012939453125, -0.008056640625, -0.01202392578125, 0.01373291015625, -0.00994873046875, -0.0211181640625, -0.00848388671875, 0.011474609375, 0.0224609375, 0.0150146484375, -...
[ 60923, 35782, 43701, 4092, 122092, 147, 149357, 366, 184, 62600, 177, 502, 4867, 32087, 107415, 60075, 2189, 32354, 26785, 10644, 9844, 32316, 51359, 3647, 19911, 1221, 47143, 23, 54241, 40956, 59226, 63805, 30022, 3687, 195625, 15700 ]
[ 0.1435546875, 0.1407470703125, 0.1455078125, 0.1083984375, 0.0972900390625, 0.0772705078125, 0.1148681640625, 0.106201171875, 0.0439453125, 0.14599609375, 0.04205322265625, 0.0584716796875, 0.1337890625, 0.083740234375, 0.00946044921875, 0.005859375, 0.1063232421875, 0.060760498046...
embed
28920224_c0
28920224
prolog
0
Title: Prolog rotate list N times in either direction Problem title: Prolog rotate list N times in either direction Tags: prolog Problem: Prolog rotate list N times in either direction So my objective here is to write a predicate that rotates a list to the right N times if N>0 or the left N times if N<0. Here is my cod...
Prolog rotate list N times in either direction Prolog rotate list N times in either direction prolog Prolog N-1 Prolog rotate list N times in either direction So my objective here is to write a predicate that rotates a list to the right N times if N>0 or the left N times if N<0. Here is my code so far, the output is fa...
[ 0.002685546875, 0.000301361083984375, 0.0281982421875, -0.01361083984375, -0.01397705078125, 0.00408935546875, -0.00811767578125, 0.00848388671875, -0.000629425048828125, 0.00167083740234375, 0.0022430419921875, 0.0025177001953125, -0.00933837890625, 0.0032806396484375, 0.01019287109375,...
[ 1250, 4867, 47014, 67, 5303, 541, 20028, 40101, 48225, 23, 502, 5759, 151814, 3688, 33022, 1653, 2063, 1636, 47, 7108, 2174, 2740, 2389, 707, 25737, 16093, 18151, 2060, 140992, 98320, 117934, 6, 69112, 757, 9077, 31089, 5 ]
[ 0.194091796875, 0.273681640625, 0.2386474609375, 0.12744140625, 0.250732421875, 0.21484375, 0.228271484375, 0.1732177734375, 0.2286376953125, 0.045074462890625, 0.1522216796875, 0.1160888671875, 0.1419677734375, 0.0052490234375, 0.0758056640625, 0.1341552734375, 0.165283203125, 0.0...
embed
59241538_c0
59241538
prolog
0
Title: Check if the structure is Binary Tree with prolog Problem title: Check if the structure is Binary Tree with prolog Tags: prolog Problem: Check if the structure is Binary Tree with prolog Using the structure : tree(tip). tree(bin(L,_,R)) :- tree(L), tree(R). How to Determine whether a tree is a binary tree with e...
Check if the structure is Binary Tree with prolog Check if the structure is Binary Tree with prolog prolog Check Binary Tree Check if the structure is Binary Tree with prolog Using the structure : How to Determine whether a tree is a binary tree with every node on the left smaller then every node on the right? What I h...
[ 0.041259765625, 0.00634765625, -0.0026092529296875, -0.00933837890625, 0.02490234375, 0.016845703125, -0.00958251953125, -0.016357421875, -0.001617431640625, -0.0201416015625, -0.00958251953125, -0.01214599609375, -0.0111083984375, 0.006195068359375, 0.0198974609375, 0.0172119140625, ...
[ 38679, 2174, 45646, 83, 54092, 1294, 101344, 678, 502, 4867, 262, 30524, 36766, 53201, 2394, 6635, 11907, 110, 25737, 164917, 7068, 7108, 2060 ]
[ 0.138427734375, 0.0572509765625, 0.1932373046875, 0.047698974609375, 0.192138671875, 0.1539306640625, 0.24462890625, 0.0643310546875, 0.11309814453125, 0.20849609375, 0.027923583984375, 0.10125732421875, 0.026397705078125, 0.2188720703125, 0.15380859375, 0.1500244140625, 0.0603637695...
embed
9687121_c0
9687121
prolog
0
Title: Prolog lists difference Problem title: Prolog lists difference Tags: prolog, symmetric-difference, list Problem: Prolog lists difference I'm trying to make program in prolog that will do something like this: diffSet([a,b,c,d], [a,b,e,f], X). X = [c,d,e,f] I wrote this: diffSet([], _, []). diffSet([H|T1],Set,Z):-...
Prolog lists difference Prolog lists difference prolog symmetric-difference list Prolog Set Set2 Prolog lists difference I'm trying to make program in prolog that will do something like this: I wrote this: But in that way I can only get elements from the first list. How can I extract the elements from the second one? @...
[ 0.0260009765625, 0.00250244140625, 0.01495361328125, 0.0054931640625, -0.017822265625, 0.014892578125, -0.01312255859375, 0.03076171875, 0.012451171875, -0.0054931640625, 0.0031585693359375, 0.01300048828125, 0.009765625, 0.0018768310546875, 0.0032196044921875, 0.01495361328125, 0.01...
[ 1250, 4867, 5303, 7, 60212, 502, 230612, 238, 428, 18234, 6620, 19943, 304, 31577, 1528, 54397, 2046, 80854, 5117, 125663, 1295, 17932, 32786, 175199, 2174, 572, 23 ]
[ 0.152099609375, 0.264404296875, 0.20556640625, 0.031707763671875, 0.2237548828125, 0.1180419921875, 0.1673583984375, 0.0295257568359375, 0.05511474609375, 0.14990234375, 0.0196533203125, 0.176025390625, 0.07763671875, 0.0276641845703125, 0.101318359375, 0.0025634765625, 0.06365966796...
embed
33424730_c0
33424730
prolog
0
Title: How to merge given Facts in a List in Prolog Problem title: How to merge given Facts in a List in Prolog Tags: prolog Problem: How to merge given Facts in a List in Prolog I have 3 facts. myfact1(1,'Hamburg','Berlin', 315). myfact2(2,'Kiel','Bremen', 175). myfact3(3,'Essen', 'Oberhausen',50). I want to give the ...
How to merge given Facts in a List in Prolog How to merge given Facts in a List in Prolog prolog How Facts List Prolog myfact1 Hamburg Berlin myfact2 Kiel Bremen myfact3 Essen Oberhausen How to merge given Facts in a List in Prolog I have 3 facts. I want to give the imformation of myfacts as tuple of List. My query of ...
[ 0.03076171875, -0.0025482177734375, 0.006805419921875, 0.0126953125, -0.00921630859375, 0.009521484375, -0.0023651123046875, 0.00494384765625, 0.0081787109375, -0.005279541015625, -0.00014972686767578125, 0.007720947265625, -0.0130615234375, 0.01171875, -0.0179443359375, 0.01416015625,...
[ 11249, 47, 42564, 34475, 132640, 7, 23, 32036, 1250, 4867, 10, 502, 759, 114700, 418, 33112, 10271, 304, 38243, 147409, 363, 44581, 32629, 94465, 765, 138, 15824, 3444, 8337, 566, 5037, 237, 370, 8705, 41, 1294, 140992, 154663, 5303, 1884...
[ 0.10577392578125, 0.0491943359375, 0.268310546875, 0.203857421875, 0.255859375, 0.1591796875, 0.115234375, 0.2347412109375, 0.1903076171875, 0.2724609375, 0.0211639404296875, 0.1392822265625, 0.1324462890625, 0.2266845703125, 0.035064697265625, 0.1934814453125, 0.180908203125, 0.01...
embed
63463661_c0
63463661
prolog
0
Title: Prolog Issue Infinite Loop Beginner Problem title: Prolog Issue Infinite Loop Beginner Tags: infinite-loop, prolog Problem: Prolog Issue Infinite Loop Beginner I'm trying to write a prolog rule about someone's sister being searched. It's really quite simple, but I get caught in an infinite loop. Given -> male(jo...
Prolog Issue Infinite Loop Beginner Prolog Issue Infinite Loop Beginner infinite-loop prolog Prolog Issue Infinite Loop Beginner Prolog Issue Infinite Loop Beginner I'm trying to write a prolog rule about someone's sister being searched. It's really quite simple, but I get caught in an infinite loop. Given -> My Rule->...
[ 0.0289306640625, -0.0186767578125, 0.00946044921875, -0.0028533935546875, -0.015869140625, 0.0001964569091796875, 0.003814697265625, -0.00165557861328125, -0.0150146484375, -0.05126953125, 0.0242919921875, -0.0076904296875, -0.006072998046875, -0.000919342041015625, 0.037353515625, 0.0...
[ 1250, 4867, 223317, 134322, 13, 199694, 67053, 56, 54241, 28354, 502, 31577, 33022, 10, 79986, 1672, 22008, 7, 114015, 8035, 33938, 297, 6183, 32233, 8781, 1284, 2046, 156892, 23, 142, 40956, 77878, 19, 2646, 139118, 4358, 5 ]
[ 0.1461181640625, 0.22705078125, 0.1558837890625, 0.1595458984375, 0.08087158203125, 0.2208251953125, 0.1279296875, 0.093994140625, 0.14208984375, 0.2021484375, 0.1435546875, 0.06298828125, 0.12249755859375, 0.01435089111328125, 0.1893310546875, 0.03228759765625, 0.043792724609375, ...
embed
29044086_c0
29044086
prolog
0
Title: About a Prolog tokenizer Problem title: About a Prolog tokenizer Tags: prolog, lexer Problem: About a Prolog tokenizer One of my assignments ask us to build a prolog tokenizer. Right now I wrote a predicate that can change space and tab it new line. But I don't know how to implement that into the main program. T...
About a Prolog tokenizer About a Prolog tokenizer prolog lexer About Prolog Main list1 list2 About a Prolog tokenizer One of my assignments ask us to build a prolog tokenizer. Right now I wrote a predicate that can change space and tab it new line. But I don't know how to implement that into the main program. The repla...
[ 0.0238037109375, 0.0135498046875, 0.002532958984375, 0.0216064453125, -0.03173828125, -0.0003833770751953125, -0.00787353515625, 0.027587890625, 0.008544921875, -0.0103759765625, 0.0184326171875, 0.021484375, -0.0272216796875, -0.0177001953125, 0.0098876953125, 0.0076904296875, 0.029...
[ 56888, 1250, 4867, 47, 1098, 52825, 502, 95, 34058, 12321, 5303, 95486, 45367, 54397, 1653, 2063, 67, 831, 15549, 32628, 20928, 442, 3525, 13315, 3714, 29479, 3934, 5201, 1528, 91995, 2831, 33342, 1884, 903, 87388, 148477, 6562, 418, 10461,...
[ 0.04388427734375, 0.1553955078125, 0.2293701171875, 0.1319580078125, 0.16943359375, 0.1990966796875, 0.1319580078125, 0.09423828125, 0.2091064453125, 0.0704345703125, 0.1241455078125, 0.05511474609375, 0.047576904296875, 0.036224365234375, 0.1324462890625, 0.136962890625, 0.055969238...
embed
35444353_c0
35444353
prolog
0
Title: Prolog - 2 ways for progenitor predicate implementation Problem title: Prolog - 2 ways for progenitor predicate implementation Tags: transitive-closure, prolog, failure-slice, parent-child Problem: Prolog - 2 ways for progenitor predicate implementation Given a set of facts that represent parent-child relationsh...
Prolog - 2 ways for progenitor predicate implementation Prolog - 2 ways for progenitor predicate implementation transitive-closure prolog failure-slice parent-child Prolog pred1 pred2 Prolog - 2 ways for progenitor predicate implementation Given a set of facts that represent parent-child relationships via the predicate...
[ 0.01141357421875, -0.00164031982421875, 0.0089111328125, 0.01141357421875, -0.016845703125, 0.0125732421875, -0.00958251953125, 0.0030364990234375, 0.0164794921875, -0.0390625, 0.01397705078125, 0.015625, -0.0025787353515625, 0.000926971435546875, 0.0111083984375, 0.0064697265625, 0....
[ 1250, 4867, 116, 48322, 502, 1409, 26111, 1653, 2063, 67, 208124, 62621, 5844, 170224, 137578, 13348, 49129, 206, 38472, 418, 304, 15824, 33636, 151618, 1829, 12477, 2367, 60212, 13204, 449, 41911, 75620, 33, 60502, 1290, 678, 1636, 118551, ...
[ 0.1561279296875, 0.2235107421875, 0.11669921875, 0.100341796875, 0.154052734375, 0.191162109375, 0.233642578125, 0.2265625, 0.2227783203125, 0.038116455078125, 0.14208984375, 0.146484375, 0.0550537109375, 0.185546875, 0.2154541015625, 0.1185302734375, 0.1885986328125, 0.0888671875,...
embed
70215037_c0
70215037
prolog
0
Title: Check if list is made up by numbers only - Prolog Problem title: Check if list is made up by numbers only - Prolog Tags: swi-prolog, prolog, list Problem: Check if list is made up by numbers only - Prolog I need to write a predicate that returns true if a given list contains only numbers in Prolog. Example: ?- i...
Check if list is made up by numbers only - Prolog Check if list is made up by numbers only - Prolog swi-prolog prolog list Check Prolog Check if list is made up by numbers only - Prolog I need to write a predicate that returns true if a given list contains only numbers in Prolog. Example: This is the code I've made so ...
[ -0.00946044921875, 0.006805419921875, -0.00009822845458984375, -0.000583648681640625, -0.0194091796875, 0.033203125, 0.0017242431640625, 0.01275634765625, -0.0011749267578125, -0.00262451171875, -0.0089111328125, -0.0272216796875, -0.0216064453125, -0.01080322265625, -0.00121307373046875...
[ 38679, 2174, 5303, 7228, 1257, 390, 101935, 4734, 1250, 4867, 2452, 3454, 502, 83, 3871, 33022, 1653, 2063, 67, 30646, 29568, 34475, 70541, 23, 18151, 2060, 98320, 11907, 1733, 31635, 15400 ]
[ 0.1522216796875, 0.09002685546875, 0.2264404296875, 0.1116943359375, 0.1002197265625, 0.055084228515625, 0.2105712890625, 0.1163330078125, 0.161376953125, 0.2418212890625, 0.119873046875, 0.1014404296875, 0.1177978515625, 0.0096435546875, 0.03302001953125, 0.03662109375, 0.0843505859...
embed
37863853_c0
37863853
prolog
0
Title: Generating every outcome possible when parsing a list : element(N, L,X) Problem title: Generating every outcome possible when parsing a list : element(N, L,X) Tags: prolog Problem: Generating every outcome possible when parsing a list : element(N, L,X) I am trying to implement a simple element(N,L,X) predicate, ...
Generating every outcome possible when parsing a list : element(N, L,X) Generating every outcome possible when parsing a list : element(N, L,X) prolog Generating Generating every outcome possible when parsing a list : element(N, L,X) I am trying to implement a simple element(N,L,X) predicate, where L is a list, X an el...
[ -0.0030059814453125, 0.003692626953125, -0.0184326171875, 0.00170135498046875, -0.0103759765625, 0.0157470703125, 0.0047607421875, 0.00152587890625, 0.0111083984375, -0.03076171875, 0.004638671875, -0.018798828125, -0.010009765625, -0.0027008056640625, -0.01055908203125, 0.024047851562...
[ 155370, 1916, 11907, 184345, 7722, 3229, 366, 6953, 5303, 12830, 839, 339, 1542, 502, 4867, 31577, 29479, 8781, 4, 866, 1653, 2063, 67, 83, 1193, 541, 19069, 3444, 19048, 54, 51592, 903, 7413 ]
[ 0.2060546875, 0.108642578125, 0.1719970703125, 0.2607421875, 0.1646728515625, 0.034912109375, 0.1845703125, 0.122802734375, 0.1812744140625, 0.214111328125, 0.114990234375, 0.1065673828125, 0.160888671875, 0.1268310546875, 0.1915283203125, 0.07635498046875, 0.1573486328125, 0.12048...
embed
15705001_c1
15705001
prolog
1
the 1st column, in how many ways can you complete the diagram in a standard way? 2) If 7 is fixed on the 6th box of the 1st row and 11 is fixed in the last box of the 1st column, in how many ways can you complete the diagram in a standard way? 3) If 8 is fixed on the 6th box of the 1st row and 11 is fixed in the last ...
the 1st column, in how many ways can you complete the diagram in a standard way? 2) If 7 is fixed on the 6th box of the 1st row and 11 is fixed in the last box of the 1st column, in how many ways can you complete the diagram in a standard way? 3) If 8 is fixed on the 6th box of the 1st row and 11 is fixed in the last ...
[ 0.01287841796875, 0.021484375, -0.019775390625, 0.01446533203125, -0.01251220703125, -0.00872802734375, 0.01055908203125, 0.0069580078125, 0.0017547607421875, 0.00080108642578125, -0.0166015625, -0.006561279296875, -0.005950927734375, 0.0098876953125, -0.0260009765625, -0.0013427734375...
[ 106, 271, 3365, 316, 19, 3642, 5941, 48322, 831, 28484, 117233, 5570, 3917, 361, 188347, 305, 927, 16530, 15555, 534, 4568, 8439, 382, 18151, 29806, 50944, 425, 152382, 101935, 5759, 33, 6238, 62816, 179933, 116115, 442, 11907, 7722, 140026...
[ 0.0233917236328125, 0.042083740234375, 0.11669921875, 0.1058349609375, 0.0243682861328125, 0.00244140625, 0.0628662109375, 0.11279296875, 0.01495361328125, 0.154296875, 0.197021484375, 0.2398681640625, 0.1041259765625, 0.1181640625, 0.1563720703125, 0.10791015625, 0.01519775390625, ...
embed
1816057_c0
1816057
prolog
0
Title: Two clause definition to find the maximum number on a list Problem title: Two clause definition to find the maximum number on a list Tags: prolog Problem: Two clause definition to find the maximum number on a list How would I write a two clause recursive definition to find the maximum value in a list. So far I h...
Two clause definition to find the maximum number on a list Two clause definition to find the maximum number on a list prolog Two Two clause definition to find the maximum number on a list How would I write a two clause recursive definition to find the maximum value in a list. So far I have written this: This doesn't wo...
[ 0.0062255859375, 0.008056640625, 0.02001953125, 0.0172119140625, 0.00885009765625, 0.022216796875, -0.0125732421875, 0.010009765625, 0.02099609375, -0.0277099609375, -0.0011138916015625, -0.0230712890625, -0.00872802734375, -0.0027618408203125, 0.0247802734375, 0.0054931640625, 0.008...
[ 32964, 70731, 13, 80934, 7413, 38132, 14012, 98, 5303, 502, 4867, 47, 33022, 6626, 195625, 5844, 34292, 23, 59121, 22027, 18, 4488, 6002, 86531, 18499, 831, 32233, 1957, 112892, 18929 ]
[ 0.2254638671875, 0.2086181640625, 0.0787353515625, 0.17138671875, 0.119384765625, 0.2144775390625, 0.1697998046875, 0.06488037109375, 0.1845703125, 0.07684326171875, 0.1275634765625, 0.014312744140625, 0.04833984375, 0.1907958984375, 0.1236572265625, 0.08514404296875, 0.14892578125, ...
embed
39711616_c2
39711616
prolog
2
1), poly_red(Out1, Out2), lead(Out2, Out). poly_mod(INum, IDen, Out) :- lead(INum, [NumHead | NumTail]), lead(IDen, [DenHead | DenTail]), Q is NumHead / DenHead, append([DenHead], DenTail, DenNorm), append([NumHead], NumTail, Num), scal_prod(DenNorm, Q, DenXQ), poly_sub(Num, Code signals: Using, Prolog, GCD, Tail, Head...
1), poly_red(Out1, Out2), lead(Out2, Out). poly_mod(INum, IDen, Out) :- lead(INum, [NumHead | NumTail]), lead(IDen, [DenHead | DenTail]), Q is NumHead / DenHead, append([DenHead], DenTail, DenNorm), append([NumHead], NumTail, Num), scal_prod(DenNorm, Q, DenXQ), poly_sub(Num, Code signals: Using, Prolog, GCD, Tail, Head...
[ -0.006805419921875, 0.002532958984375, 0.0018768310546875, 0.0107421875, 0.0233154296875, 0.029052734375, -0.0030517578125, -0.007781982421875, 0.0213623046875, -0.02978515625, 0.0257568359375, -0.006561279296875, 0.01531982421875, -0.002044677734375, 0.00299072265625, -0.0068054199218...
[ 4879, 35874, 454, 2822, 79858, 418, 13538, 10461, 4, 37105, 304, 194, 13415, 8852, 316, 11338, 33, 15772, 13025, 712, 52782, 9874, 379, 247, 7146, 54494, 1575, 2396, 83, 248, 114689, 50645, 117906, 112348, 1542, 2737, 22144, 839, 28864, 2...
[ 0.1087646484375, 0.2353515625, 0.04302978515625, 0.2017822265625, 0.195556640625, 0.06915283203125, 0.2208251953125, 0.1217041015625, 0.034942626953125, 0.2362060546875, 0.118896484375, 0.0633544921875, 0.246337890625, 0.05499267578125, 0.20849609375, 0.1195068359375, 0.1917724609375...
embed
26502987_c0
26502987
prolog
0
Title: Filterlists prolog Problem title: Filterlists prolog Tags: prolog, list Problem: Filterlists prolog I am trying to filter a list of lists in prolog such that [[a,b,c],[],[d],[e,f]] gives [[a,b,c],[e,f]], my filter function should omit the elements of length less than two, The code I tried is as follows, omitunwa...
Filterlists prolog Filterlists prolog prolog list Filterlists List Filterlists prolog I am trying to filter a list of lists in prolog such that [[a,b,c],[],[d],[e,f]] gives [[a,b,c],[e,f]], my filter function should omit the elements of length less than two, The code I tried is as follows, It returns the output [[a,b,c...
[ 0.02197265625, 0.01507568359375, 0.01129150390625, -0.0130615234375, -0.0091552734375, -0.005523681640625, 0.0028839111328125, 0.01025390625, 0.0164794921875, 0.013916015625, 0.0037078857421875, -0.007476806640625, -0.0245361328125, 0.01495361328125, 0.00860595703125, 0.003158569335937...
[ 128896, 6562, 502, 4867, 7, 5303, 32036, 31577, 46312, 111, 23, 6044, 11, 275, 238, 71, 13, 420, 76199, 32354, 5608, 171, 217, 80854, 140909, 40715, 6626, 18151, 37842, 28960, 30646, 70, 140992, 4, 724, 2485, 4015, 100, 107730, 45767, 2...
[ 0.25537109375, 0.228759765625, 0.187255859375, 0.241943359375, 0.0552978515625, 0.2098388671875, 0.1605224609375, 0.0924072265625, 0.2744140625, 0.010467529296875, 0.004638671875, 0.002532958984375, 0.053466796875, 0.06793212890625, 0.09930419921875, 0.049407958984375, 0.08154296875,...
embed
10100310_c0
10100310
prolog
0
Title: Tree preorder traversal in Prolog Problem title: Tree preorder traversal in Prolog Tags: prolog Problem: Tree preorder traversal in Prolog Tree traversal refers to the process of visiting each node in a tree data structure in a systematic way. The preorder traversal in the following image Sorted_binary_tree retu...
Tree preorder traversal in Prolog Tree preorder traversal in Prolog prolog Tree Prolog Tree preorder traversal in Prolog Tree traversal refers to the process of visiting each node in a tree data structure in a systematic way. The preorder traversal in the following image Sorted_binary_tree returns F, B, A, D, C, E, G, ...
[ 0.0400390625, -0.004547119140625, -0.000568389892578125, -0.01080322265625, 0.004608154296875, 0.027587890625, -0.01025390625, -0.01409912109375, -0.001953125, -0.0693359375, 0.0022430419921875, -0.0003871917724609375, -0.020751953125, -0.000911712646484375, 0.020751953125, 0.003997802...
[ 101344, 479, 80596, 37317, 289, 1250, 4867, 502, 23, 15005, 9433, 150080, 12638, 110, 112, 53201, 2053, 45646, 242161, 3917, 25632, 29569, 53666, 297, 19155, 1294, 62600, 30646, 7, 563, 335, 391, 527, 87, 572, 148920, 25737, 7108, 18151, ...
[ 0.2451171875, 0.1790771484375, 0.2440185546875, 0.228515625, 0.159912109375, 0.1717529296875, 0.2313232421875, 0.1507568359375, 0.0032958984375, 0.036590576171875, 0.0955810546875, 0.187255859375, 0.0780029296875, 0.1334228515625, 0.09698486328125, 0.2105712890625, 0.1162109375, 0....
embed
41574775_c0
41574775
prolog
0
Title: How does this Prolog code work (Grandparent)? Problem title: How does this Prolog code work (Grandparent)? Tags: prolog Problem: How does this Prolog code work (Grandparent)? If you have these facts: parent(albert, bob). parent(albert, betsy). parent(albert, bill). parent(alice, bob). parent(alice, betsy). paren...
How does this Prolog code work (Grandparent)? How does this Prolog code work (Grandparent)? prolog How Prolog Grandparent grand_parent How does this Prolog code work (Grandparent)? If you have these facts: And then this code: And if you type: Then it returns: How does this work? It's a bit confusing. Especially the "Z"...
[ 0.0198974609375, 0.021484375, 0.0078125, 0.023193359375, -0.018310546875, 0.019775390625, 0.0089111328125, 0.01171875, 0.0181884765625, -0.0302734375, 0.00836181640625, -0.006805419921875, -0.003143310546875, 0.01361083984375, 0.010009765625, -0.00946044921875, 0.00823974609375, -0...
[ 11249, 14602, 903, 1250, 4867, 18151, 4488, 142216, 99547, 502, 12801, 9963, 454, 16, 4263, 765, 15824, 2174, 398, 10644, 12, 442, 30646, 4785, 55681, 6953, 1511, 2831 ]
[ 0.10003662109375, 0.09716796875, 0.1031494140625, 0.1790771484375, 0.2470703125, 0.1982421875, 0.1534423828125, 0.129638671875, 0.2021484375, 0.128662109375, 0.147705078125, 0.1214599609375, 0.00128173828125, 0.00445556640625, 0.001708984375, 0.02252197265625, 0.0477294921875, 0.04...
embed
56707039_c0
56707039
prolog
0
Title: When does Prolog break lines? Problem title: When does Prolog break lines? Tags: prolog, prolog-toplevel Problem: When does Prolog break lines? Consider the following example program in Prolog: p(0). p(1). b1(T) :- T = tri(X, Y, Z), p(X), p(Y), c(T), !, p(Z). c(tri(X, X, _Z)). SWI Prolog gives some interesting a...
When does Prolog break lines? When does Prolog break lines? prolog prolog-toplevel When Prolog When does Prolog break lines? Consider the following example program in Prolog: SWI Prolog gives some interesting answers for certain queries:\ Note that it did break the line in the second answer, but not in the first one. T...
[ 0.007110595703125, -0.0106201171875, 0.01220703125, 0.0198974609375, -0.008544921875, -0.005584716796875, 0.00799560546875, 0.007354736328125, -0.01507568359375, 0.007476806640625, -0.005035400390625, -0.00860595703125, -0.01708984375, -0.0026397705078125, 0.01953125, 0.01708984375, ...
[ 14847, 1250, 4867, 36356, 124519, 502, 13784, 67919, 14602, 27781, 1528, 159, 38969, 49041, 35166, 41, 10484, 70, 13315, 91736, 70751, 214, 3229, 959, 56566 ]
[ 0.11767578125, 0.173095703125, 0.2408447265625, 0.18798828125, 0.2210693359375, 0.0701904296875, 0.023223876953125, 0.1011962890625, 0.054901123046875, 0.047027587890625, 0.1165771484375, 0.021392822265625, 0.1605224609375, 0.013916015625, 0.03680419921875, 0.03546142578125, 0.004577...
embed
51137171_c0
51137171
prolog
0
Title: Prolog simple recursion Problem title: Prolog simple recursion Tags: prolog Problem: Prolog simple recursion This is a really simple quesiton but I don't get it. insert(X, L, [X|L]). insert(X, [H|T], [H|T2]) :- insert(X, T, T2). We run it with insert(1, [2,3], L). When it's called the 1st insert produces (1, [2,...
Prolog simple recursion Prolog simple recursion prolog Prolog Prolog simple recursion This is a really simple quesiton but I don't get it. We run it with insert(1, [2,3], L). When it's called the 1st insert produces (1, [2,3], [1|2,3]) > L = [1,2,3], then it looks at the second insert(1, [2|3], [2|T2]) // T2 is a varia...
[ -0.00150299072265625, 0.005279541015625, 0.009765625, 0.01123046875, 0.000232696533203125, 0.017578125, -0.032470703125, -0.0184326171875, 0.00836181640625, -0.035400390625, 0.02783203125, -0.024169921875, -0.0181884765625, 0.005584716796875, 0.0223388671875, 0.015380859375, 0.014160...
[ 1250, 4867, 8781, 195625, 1830, 502, 6183, 41, 1507, 2301, 18, 2046, 442, 11675, 678, 183540, 41600, 155761, 339, 35839, 106, 271, 27489, 977, 2203, 33342, 99, 17932, 96386, 618, 90173, 384, 304, 77336, 57767, 11782, 50740, 10461, 13438, ...
[ 0.1707763671875, 0.22802734375, 0.1998291015625, 0.2381591796875, 0.048553466796875, 0.1273193359375, 0.03521728515625, 0.0692138671875, 0.0794677734375, 0.0247802734375, 0.03216552734375, 0.0689697265625, 0.02655029296875, 0.1260986328125, 0.035247802734375, 0.265625, 0.009338378906...
embed
21926642_c1
21926642
prolog
1
):- X is 6. str2num(seven, X):- X is 7. str2num(eight, X):- X is 8. str2num(nine, X):- X is 9. str2num(ten, X):- X is 10. str2num(eleven, X):- X is 11. str2num(twelve, X):- X is 12. str2num(thirteen, X):- X is 13. str2num(fourteen, X):- X is 14. str2num(fifteen, X):- X is 15. str2num(sixteen, X):- X is 16. str2num(seve...
):- X is 6. str2num(seven, X):- X is 7. str2num(eight, X):- X is 8. str2num(nine, X):- X is 9. str2num(ten, X):- X is 10. str2num(eleven, X):- X is 11. str2num(twelve, X):- X is 12. str2num(thirteen, X):- X is 13. str2num(fourteen, X):- X is 14. str2num(fifteen, X):- X is 15. str2num(sixteen, X):- X is 16. str2num(seve...
[ 0.007049560546875, 0.01165771484375, 0.00921630859375, 0.02685546875, 0.00171661376953125, 0.0118408203125, -0.004974365234375, -0.000392913818359375, 0.020751953125, -0.0081787109375, -0.00750732421875, -0.01416015625, 0.000965118408203125, -0.0027313232421875, 0.003173828125, 0.00309...
[ 6, 2077, 9, 1193, 83, 2289, 7704, 304, 2606, 132, 26301, 4, 2861, 22553, 3217, 85963, 3569, 510, 4068, 57667, 4541, 76456, 5035, 95037, 8927, 5847, 160018, 6370, 18266, 6281, 6849, 62489, 7076, 6958, 7744, 6529, 74797, 53, 7085, 20028, ...
[ 0.041900634765625, 0.203125, 0.0745849609375, 0.240234375, 0.154296875, 0.231689453125, 0.1748046875, 0.154052734375, 0.24609375, 0.05499267578125, 0.1373291015625, 0.0216064453125, 0.1265869140625, 0.144287109375, 0.128662109375, 0.142578125, 0.1270751953125, 0.125244140625, 0.1...
embed
40500184_c0
40500184
prolog
0
Title: Prolog ERROR: is/2: Arguments are not sufficiently instantiated Problem title: Prolog ERROR: is/2: Arguments are not sufficiently instantiated Tags: clpfd, prolog, instantiation-error Problem: Prolog ERROR: is/2: Arguments are not sufficiently instantiated I'm new to Prolog. I wrote a very short program as follo...
Prolog ERROR: is/2: Arguments are not sufficiently instantiated Prolog ERROR: is/2: Arguments are not sufficiently instantiated clpfd prolog instantiation-error Prolog ERROR Arguments Prolog ERROR: is/2: Arguments are not sufficiently instantiated I'm new to Prolog. I wrote a very short program as follows: When I run i...
[ 0.0042724609375, 0.0164794921875, 0.00848388671875, 0.01416015625, 0.00726318359375, 0.0145263671875, 0.00665283203125, -0.01434326171875, 0.011474609375, -0.004791259765625, 0.01904296875, -0.0263671875, 0.0022735595703125, 0.0118408203125, 0.02001953125, 0.009765625, 0.018310546875...
[ 1250, 4867, 151206, 24638, 83, 12477, 12, 112140, 7, 621, 959, 129980, 538, 34648, 14, 27686, 33139, 39557, 71, 502, 188800, 3525, 54397, 4552, 16610, 1528, 28960, 11675, 25632, 2967, 44084, 14602, 18499, 96276, 2811, 40383, 18151, 69307, 5...
[ 0.18994140625, 0.264404296875, 0.1756591796875, 0.1214599609375, 0.16943359375, 0.262451171875, 0.039520263671875, 0.280517578125, 0.10443115234375, 0.06060791015625, 0.1510009765625, 0.1954345703125, 0.086669921875, 0.1429443359375, 0.1544189453125, 0.1168212890625, 0.018310546875, ...
embed
46583237_c0
46583237
prolog
0
Title: Prolog program to count down from a number using recursion Problem title: Prolog program to count down from a number using recursion Tags: prolog, recursion, prolog-cut Problem: Prolog program to count down from a number using recursion Lately I have been learning Prolog and tried to write a program to count dow...
Prolog program to count down from a number using recursion Prolog program to count down from a number using recursion prolog recursion prolog-cut a recursion Prolog count_down H-1 Prolog program to count down from a number using recursion Lately I have been learning Prolog and tried to write a program to count down fro...
[ 0.0036468505859375, 0.0078125, -0.007537841796875, 0.01104736328125, 0.0057373046875, 0.000713348388671875, -0.025634765625, 0.0015716552734375, 0.00927734375, -0.028076171875, -0.01007080078125, -0.033935546875, 0.0125732421875, 0.018310546875, 0.036865234375, -0.0230712890625, 0.01...
[ 1250, 4867, 1528, 47, 54529, 7565, 1295, 14012, 17368, 195625, 1830, 502, 19774, 34695, 572, 5759, 52080, 37842, 33022, 10, 15700, 34475, 442, 37202, 959, 20697, 18151, 28960, 7, 5117, 79986, 866, 4, 339, 16, 15772, 711, 83, 121011, 13, ...
[ 0.180419921875, 0.2425537109375, 0.1956787109375, 0.045379638671875, 0.2086181640625, 0.2227783203125, 0.16845703125, 0.1624755859375, 0.0770263671875, 0.248779296875, 0.1341552734375, 0.1500244140625, 0.1485595703125, 0.2388916015625, 0.08184814453125, 0.10791015625, 0.0728149414062...
embed
844043_c0
844043
prolog
0
Title: Declaring a predicate dynamic in gprolog Problem title: Declaring a predicate dynamic in gprolog Tags: prolog, prolog-directive-dynamic Problem: Declaring a predicate dynamic in gprolog I have this code in Prolog: dynamic(player_at/1). player_at(house). goto(X) :- retract(player_at(house)), assert(player_at(X))....
Declaring a predicate dynamic in gprolog Declaring a predicate dynamic in gprolog prolog prolog-directive-dynamic Declaring player_at permission_error static_procedure Declaring a predicate dynamic in gprolog I have this code in Prolog: But I still get this error: when I execute goto(foo). I've read the dynamic documen...
[ 0.01416015625, 0.02392578125, 0.029541015625, 0.004791259765625, 0.00677490234375, 0.01495361328125, -0.003936767578125, 0.019775390625, -0.011962890625, -0.0625, 0.0159912109375, 0.0155029296875, -0.025634765625, -0.01123046875, 0.014404296875, 0.00958251953125, 0.013671875, 0.011...
[ 25755, 320, 1653, 2063, 67, 84079, 706, 3454, 4867, 502, 936, 100034, 242554, 58585, 257, 168081, 188800, 201939, 232578, 18151, 1250, 7464, 903, 18499, 3229, 87, 71924, 4163, 31, 132, 3584, 209806, 4527, 442, 132283 ]
[ 0.114013671875, 0.1461181640625, 0.1593017578125, 0.2127685546875, 0.1123046875, 0.219970703125, 0.06390380859375, 0.1705322265625, 0.230712890625, 0.10357666015625, 0.08990478515625, 0.1187744140625, 0.1923828125, 0.208984375, 0.064697265625, 0.2244873046875, 0.172119140625, 0.150...
embed
40692000_c0
40692000
prolog
0
Title: how can i get the results of Prolog by searching a query through python Problem title: how can i get the results of Prolog by searching a query through python Tags: python, prolog Problem: how can i get the results of Prolog by searching a query through python This is the program which i have tried: from pyswip ...
how can i get the results of Prolog by searching a query through python how can i get the results of Prolog by searching a query through python python prolog pyswip Prolog prolog.assertz prolog.query how can i get the results of Prolog by searching a query through python This is the program which i have tried: Output w...
[ 0.0301513671875, 0.0213623046875, -0.006866455078125, 0.0281982421875, -0.035888671875, -0.0027618408203125, 0.007232666015625, 0.0007171630859375, -0.0108642578125, -0.06396484375, 0.0140380859375, -0.01239013671875, -0.02197265625, -0.0022125244140625, 0.00909423828125, 0.00399780273...
[ 3642, 831, 17, 2046, 70, 50339, 111, 1250, 4867, 390, 157318, 41, 1294, 8305, 17198, 50828, 502, 57756, 2452, 254, 33657, 169, 944, 10, 1528, 37842, 13538, 7077, 20949, 123996, 122799, 82230, 18151, 58166, 10433, 9167, 26073, 534, 159, 31...
[ 0.05084228515625, 0.0689697265625, 0.01666259765625, 0.1163330078125, 0.0316162109375, 0.2059326171875, 0.076416015625, 0.1944580078125, 0.262451171875, 0.056671142578125, 0.2103271484375, 0.137939453125, 0.1119384765625, 0.0975341796875, 0.1397705078125, 0.1702880859375, 0.144775390...
embed
1468150_c0
1468150
prolog
0
Title: How do I find all solutions to a goal in Prolog? Problem title: How do I find all solutions to a goal in Prolog? Tags: prolog-setof, prolog Problem: How do I find all solutions to a goal in Prolog? I have predicate P1 that returns values one after the other like this: -? P1(ARGUMENTS, RETURN). -? RETURN = 1; -? ...
How do I find all solutions to a goal in Prolog? How do I find all solutions to a goal in Prolog? prolog-setof prolog How Prolog ARGUMENTS LIST SOMEHOW HERE NEED INSERT ALL VALUES How do I find all solutions to a goal in Prolog? I have predicate P1 that returns values one after the other like this: I also have another ...
[ 0.011474609375, 0.0020294189453125, 0.0108642578125, 0.006591796875, -0.020751953125, 0.0228271484375, -0.01806640625, -0.0064697265625, 0.01129150390625, -0.038818359375, 0.01025390625, -0.00201416015625, -0.0028228759765625, -0.016845703125, 0.006195068359375, 0.0224609375, 0.01391...
[ 11249, 87, 7413, 756, 51347, 47, 69236, 23, 1250, 4867, 502, 3509, 4390, 13685, 43578, 33827, 195977, 65791, 138911, 64083, 56263, 58837, 310, 89994, 54, 10, 1653, 2063, 67, 436, 418, 30646, 142424, 7103, 3789, 304, 111, 9069, 56943, 839,...
[ 0.07940673828125, 0.041839599609375, 0.1646728515625, 0.19775390625, 0.2469482421875, 0.168701171875, 0.2154541015625, 0.0751953125, 0.1844482421875, 0.252197265625, 0.1199951171875, 0.04425048828125, 0.09588623046875, 0.04638671875, 0.162841796875, 0.10009765625, 0.1585693359375, ...
embed
54688982_c2
54688982
prolog
2
,3], [_,_,2, _,1,_, _,_,_], [_,_,_, _,4,_, _,_,9]]). the functions parseTextField and parseSolvedRowsTerm , actually the whole program, works fine with the commented-out Query q1 , but not with the not-commented-out Query q1 Code signals: How, Query, Rows, s00, t00, s01, t01, s87, t87, s88, t88, row0, s10, s20, s30, s4...
,3], [_,_,2, _,1,_, _,_,_], [_,_,_, _,4,_, _,_,9]]). the functions parseTextField and parseSolvedRowsTerm , actually the whole program, works fine with the commented-out Query q1 , but not with the not-commented-out Query q1 Code signals: How, Query, Rows, s00, t00, s01, t01, s87, t87, s88, t88, row0, s10, s20, s30, s4...
[ 0.00848388671875, 0.040771484375, 0.0045166015625, 0.03759765625, -0.022216796875, -0.018798828125, 0.0037689208984375, -0.0111083984375, 0.00116729736328125, -0.0032501220703125, 0.00787353515625, 0.01611328125, 0.00921630859375, 0.0026092529296875, -0.0155029296875, 0.0203857421875, ...
[ 96386, 304, 617, 1126, 194, 32354, 366, 184, 174379, 6159, 19388, 136, 102588, 4126, 12724, 19725, 35484, 39, 20653, 70, 28271, 1528, 43240, 5885, 678, 6868, 297, 6056, 58836, 53, 8096, 418, 1284, 959, 277, 1183, 28864, 26073, 11249, 9619...
[ 0.11279296875, 0.014739990234375, 0.0209503173828125, 0.0740966796875, 0.013885498046875, 0.170166015625, 0.1368408203125, 0.069580078125, 0.1390380859375, 0.07623291015625, 0.165771484375, 0.013214111328125, 0.1121826171875, 0.03936767578125, 0.0809326171875, 0.03753662109375, 0.129...
embed
20663117_c0
20663117
prolog
0
Title: Working with lists of lists in Prolog Problem title: Working with lists of lists in Prolog Tags: prolog Problem: Working with lists of lists in Prolog New to prolog , trying to get my head around dealing with lists of lists recursively. Say I have a list: prices([20, 20, 40]). And another list (of lists): items(...
Working with lists of lists in Prolog Working with lists of lists in Prolog prolog Working Prolog Working with lists of lists in Prolog New to prolog , trying to get my head around dealing with lists of lists recursively. Say I have a list: And another list (of lists): I want to append an element from prices to each li...
[ 0.009521484375, 0.01068115234375, 0.00799560546875, -0.00482177734375, 0.00872802734375, 0.020263671875, -0.0152587890625, 0.0025634765625, 0.020263671875, -0.0155029296875, 0.0157470703125, -0.00909423828125, 0.00119781494140625, 0.0191650390625, 0.001953125, -0.01165771484375, 0.02...
[ 27985, 214, 678, 5303, 7, 111, 23, 1250, 4867, 502, 2356, 47, 31577, 10336, 184017, 195625, 5844, 765, 15700, 4390, 3444, 114689, 12830, 1295, 112034, 12638, 55769, 19441, 63134, 20697, 8305, 15044, 11001, 5701, 6275, 1314, 77947 ]
[ 0.10369873046875, 0.0177154541015625, 0.1312255859375, 0.234619140625, 0.0654296875, 0.037353515625, 0.008575439453125, 0.1658935546875, 0.2366943359375, 0.111083984375, 0.0155792236328125, 0.0084228515625, 0.001953125, 0.021148681640625, 0.0670166015625, 0.1014404296875, 0.055389404...
embed
17472332_c0
17472332
prolog
0
Title: Prolog , Append with no repititions Problem title: Prolog , Append with no repititions Tags: prolog, append, member Problem: Prolog , Append with no repititions Hey I'm trying to append two list with no "double" members for example A = [a, b, c] B = [x, c, q] then -> append2(A,B,P) P= [a,b,c,x,q] I write this co...
Prolog , Append with no repititions Prolog , Append with no repititions prolog append member Prolog Append append2 not_member Prolog , Append with no repititions Hey I'm trying to append two list with no "double" members for example then -> I write this code, but it doesn't work... Thanks for helping :)
[ -0.0140380859375, 0.009765625, 0.0281982421875, 0.005523681640625, -0.00592041015625, 0.0211181640625, 0.001068115234375, 0.0225830078125, 0.0234375, -0.017333984375, 0.006072998046875, -0.0027923583984375, 0.01275634765625, 0.00677490234375, 0.01019287109375, 0.007110595703125, 0.00...
[ 1250, 4867, 5659, 3611, 678, 110, 10958, 1890, 5256, 502, 114689, 32786, 71, 304, 959, 27417, 28240, 31577, 6626, 5303, 21555, 2661, 43032, 27781, 18151, 4488, 120592 ]
[ 0.13671875, 0.205810546875, 0.1126708984375, 0.1484375, 0.049346923828125, 0.0740966796875, 0.1275634765625, 0.134765625, 0.003326416015625, 0.1103515625, 0.1392822265625, 0.171142578125, 0.082275390625, 0.10791015625, 0.030975341796875, 0.1246337890625, 0.00390625, 0.0172424316406...
embed
55816029_c0
55816029
prolog
0
Title: Retrieve data from database without printing Problem title: Retrieve data from database without printing Tags: prolog Problem: Retrieve data from database without printing How do I retrieve data from the database to use it in a condition, but I don't want to print it the console. Problem I am doing is to retriev...
Retrieve data from database without printing Retrieve data from database without printing prolog database Retrieve Year1 Year2 Name Surname Year1-Year2 Retrieve data from database without printing How do I retrieve data from the database to use it in a condition, but I don't want to print it the console. Problem I am d...
[ 0.01153564453125, -0.00933837890625, 0.0140380859375, 0.01220703125, -0.017822265625, 0.016845703125, -0.004913330078125, 0.01251220703125, 0.007354736328125, -0.02392578125, -0.00140380859375, -0.02783203125, -0.01513671875, -0.0184326171875, -0.006103515625, -0.0166015625, -0.00173...
[ 200451, 2053, 1295, 63399, 15490, 2448, 1916, 502, 4867, 42552, 418, 304, 15757, 8018, 11627, 20268, 69085, 147, 456, 3996, 3134, 4527, 35431, 2301, 18, 3444, 28412, 442, 130250, 15649, 29041, 27863, 32070, 129927, 423, 5369, 18151, 17368, ...
[ 0.2125244140625, 0.1749267578125, 0.131591796875, 0.2215576171875, 0.1416015625, 0.1341552734375, 0.06390380859375, 0.12158203125, 0.1898193359375, 0.17041015625, 0.045745849609375, 0.0927734375, 0.07513427734375, 0.0780029296875, 0.0826416015625, 0.0224761962890625, 0.0726318359375,...
embed
41055745_c0
41055745
prolog
0
Title: How do I unify the output of a call predicate to save to another file Problem title: How do I unify the output of a call predicate to save to another file Tags: prolog, stream Problem: How do I unify the output of a call predicate to save to another file I want to take the output of this code: callfunction(X):- ...
How do I unify the output of a call predicate to save to another file How do I unify the output of a call predicate to save to another file prolog stream How append1 How do I unify the output of a call predicate to save to another file I want to take the output of this code: and unify that with a another variable. For ...
[ 0.0147705078125, 0.00958251953125, 0.0196533203125, -0.01202392578125, -0.00165557861328125, 0.0030059814453125, 0.0126953125, 0.005828857421875, 0.02099609375, -0.040771484375, 0.01141357421875, -0.0015716552734375, -0.004974365234375, -0.0064697265625, 0.02392578125, -0.0151977539062...
[ 11249, 54, 87, 51, 40383, 140992, 11782, 1653, 2063, 67, 47, 30098, 15700, 11435, 111, 502, 4867, 75973, 114689, 71, 418, 3444, 5646, 18151, 678, 77336, 137175, 9007, 3611, 1542, 1193, 2203, 11, 58745, 238, 4527, 28412, 12921, 28987, 2281...
[ 0.04803466796875, 0.0174407958984375, 0.008331298828125, 0.1473388671875, 0.2076416015625, 0.2158203125, 0.167724609375, 0.1663818359375, 0.1702880859375, 0.058990478515625, 0.1285400390625, 0.1715087890625, 0.113525390625, 0.154296875, 0.004058837890625, 0.111572265625, 0.1802978515...
embed
10234700_c0
10234700
prolog
0
Title: Prolog query in code Problem title: Prolog query in code Tags: prolog Problem: Prolog query in code How do you execute a query in the code? For example: person(abe,instructor). person(bob,student). person(cindy,student). person(david,student). person(abe,student). % Like this, but this does not work % :- person(...
Prolog query in code Prolog query in code prolog Prolog Like Prolog query in code How do you execute a query in the code? For example: After loading the program, I can run the following query: person(X,Y). How can I run this query as part of the program itself so once the program loads, it will run the query and output...
[ 0.0250244140625, 0.0308837890625, 0.00127410888671875, 0.0247802734375, -0.0152587890625, 0.004791259765625, -0.01446533203125, 0.0035858154296875, -0.00421142578125, -0.0703125, -0.005828857421875, 0.00168609619140625, -0.0284423828125, -0.01055908203125, 0.00191497802734375, 0.005767...
[ 1250, 4867, 41, 1294, 23, 18151, 502, 18852, 11249, 54, 398, 71924, 13, 10, 24372, 72367, 214, 1528, 831, 11675, 25632, 3445, 1542, 1723, 903, 237, 2831, 68034, 24145, 7, 136, 140992 ]
[ 0.164306640625, 0.255615234375, 0.17724609375, 0.2022705078125, 0.0787353515625, 0.21240234375, 0.127197265625, 0.0933837890625, 0.0169677734375, 0.027099609375, 0.0178375244140625, 0.172607421875, 0.05059814453125, 0.0249481201171875, 0.0927734375, 0.1539306640625, 0.046051025390625...
embed
50019086_c0
50019086
prolog
0
Title: Define a predicate in prolog Problem title: Define a predicate in prolog Tags: prolog Problem: Define a predicate in prolog Define sublist(Xs, Ys) : this holds when Xs is a list containing some of the elements of Ys , in the same order they appear in the list Ys . For example, sublist(X,[a,b,c]) should have the ...
Define a predicate in prolog Define a predicate in prolog prolog Define Define a predicate in prolog Define sublist(Xs, Ys) : this holds when Xs is a list containing some of the elements of Ys , in the same order they appear in the list Ys . For example, sublist(X,[a,b,c]) should have the eight solutions X=[]; X=[c]; X...
[ 0.00872802734375, -0.00665283203125, 0.00836181640625, 0.00555419921875, -0.0230712890625, 0.01422119140625, 0.0048828125, 0.0108642578125, 0.018310546875, 0.003509521484375, 0.0147705078125, 0.01031494140625, -0.0032501220703125, -0.004608154296875, -0.00537109375, 0.02978515625, 0....
[ 262, 64552, 10, 1653, 2063, 67, 23, 502, 4867, 1614, 6562, 132, 1542, 7, 4, 990, 903, 16401, 3229, 1193, 83, 5303, 70541, 3060, 80854, 5701, 12989, 108975, 275, 238, 136659, 51347, 29806, 1884, 4734, 140992, 2367, 44691, 759 ]
[ 0.0643310546875, 0.1881103515625, 0.07989501953125, 0.21875, 0.259765625, 0.1590576171875, 0.057861328125, 0.1748046875, 0.2337646484375, 0.23876953125, 0.256103515625, 0.01171875, 0.1639404296875, 0.138916015625, 0.042205810546875, 0.1932373046875, 0.0145416259765625, 0.1204833984...
embed
40788856_c0
40788856
prolog
0
Title: Directed graphs in prolog Problem title: Directed graphs in prolog Tags: prolog Problem: Directed graphs in prolog I have a graph that I am creating rules on. owes money graph I have created rules that shows who owes money to who owes(alice,5,charlie). owes(alice,20,bob). owes(bob,10,charlie). I have created rul...
Directed graphs in prolog Directed graphs in prolog prolog Directed owesOver10 owesUnder10 Directed graphs in prolog I have a graph that I am creating rules on. owes money graph I have created rules that shows who owes money to who I have created rules that display who owes someone under a certain amount or over howeve...
[ 0.01300048828125, 0.007598876953125, -0.0220947265625, 0.0184326171875, -0.0135498046875, 0.0068359375, -0.019287109375, 0.0194091796875, 0.0123291015625, -0.01953125, 0.0012054443359375, -0.0233154296875, 0.0036163330078125, 0.01165771484375, 0.026123046875, 0.0206298828125, 0.02954...
[ 42666, 297, 41382, 7, 23, 502, 4867, 2600, 156673, 963, 7944, 765, 105233, 91736, 98, 17265, 75935, 45831, 2750, 47, 44116, 22008, 1379, 24233, 41170, 645, 3714, 3871, 33022, 79986, 5045, 3445, 3622, 5608, 714, 100, 10, 13348, 136, 209, ...
[ 0.1932373046875, 0.082275390625, 0.256591796875, 0.1226806640625, 0.042205810546875, 0.1435546875, 0.2177734375, 0.23779296875, 0.1650390625, 0.177734375, 0.1646728515625, 0.007232666015625, 0.088623046875, 0.1368408203125, 0.01153564453125, 0.1475830078125, 0.0911865234375, 0.0740...
embed
55657210_c0
55657210
prolog
0
Title: Encoding this logic sentence in Prolog: G ↔ ~Provable(x) Problem title: Encoding this logic sentence in Prolog: G ↔ ~Provable(x) Tags: prolog Problem: Encoding this logic sentence in Prolog: G ↔ ~Provable(x) http://www.swi-prolog.org/pldoc/man?predicate=%5C%2B/1 How would the above expression be encoded in Prolo...
Encoding this logic sentence in Prolog: G ↔ ~Provable(x) Encoding this logic sentence in Prolog: G ↔ ~Provable(x) prolog Encoding Prolog Provable Encoding this logic sentence in Prolog: G ↔ ~Provable(x) http://www.swi-prolog.org/pldoc/man?predicate=%5C%2B/1 How would the above expression be encoded in Prolog? Here it i...
[ 0.012451171875, 0.0068359375, 0.0096435546875, -0.0159912109375, 0.00014781951904296875, 0.0113525390625, 0.014892578125, -0.0002880096435546875, 0.007293701171875, -0.0269775390625, 0.000499725341796875, 0.007476806640625, 0.005157470703125, 0.007110595703125, 0.0194091796875, 0.01043...
[ 357, 587, 6238, 903, 62775, 149357, 23, 1250, 4867, 527, 243542, 6780, 177997, 2886, 132, 425, 502, 77345, 2452, 3454, 29713, 669, 19714, 2063, 36917, 125195, 22, 40899, 14941, 3714, 1653, 1556, 5701, 85027, 34292, 237, 6863, 10002, 51, 7...
[ 0.059234619140625, 0.1790771484375, 0.0228424072265625, 0.029693603515625, 0.1614990234375, 0.1444091796875, 0.0457763671875, 0.1607666015625, 0.205322265625, 0.159912109375, 0.1522216796875, 0.07269287109375, 0.255126953125, 0.2744140625, 0.01617431640625, 0.12255859375, 0.109619140...
embed
15187555_c0
15187555
prolog
0
Title: prolog finding max from a list of facts Problem title: prolog finding max from a list of facts Tags: prolog Problem: prolog finding max from a list of facts Hi sorry I'm really new to Prolog. Say I have a list of facts say 6 facts the first column of numbers represents the persons ID, and the second column repre...
prolog finding max from a list of facts prolog finding max from a list of facts prolog a prolog finding max from a list of facts Hi sorry I'm really new to Prolog. Say I have a list of facts say 6 facts the first column of numbers represents the persons ID, and the second column represents the number of wins a person h...
[ 0.033935546875, 0.0030364990234375, 0.008544921875, 0.0098876953125, -0.00848388671875, -0.00194549560546875, 0.0036773681640625, 0.0098876953125, 0.01031494140625, -0.033935546875, 0.01806640625, 0.005096435546875, -0.0111083984375, -0.0225830078125, -0.00872802734375, -0.020751953125...
[ 502, 4867, 90791, 18389, 1295, 5303, 111, 15824, 7, 10, 2673, 59090, 6183, 3525, 47, 1250, 25916, 765, 305, 5117, 3365, 316, 101935, 33636, 3445, 11338, 17932, 14012, 19916, 1556, 3444, 7413, 678, 2684, 3642, 1672, 20594, 903, 62077, 4255...
[ 0.153564453125, 0.2548828125, 0.1524658203125, 0.261962890625, 0.07537841796875, 0.1951904296875, 0.046356201171875, 0.203125, 0.15283203125, 0.030914306640625, 0.03094482421875, 0.0831298828125, 0.0408935546875, 0.0640869140625, 0.052764892578125, 0.1724853515625, 0.0150146484375, ...
embed
37519745_c0
37519745
prolog
0
Title: prolog - how to simulate a for-loop Problem title: prolog - how to simulate a for-loop Tags: prolog Problem: prolog - how to simulate a for-loop I am trying to generate a list such as [X1/1,X2/2,X3/3....Xn/N] with given N. I tried to make a function maketemplate(N,L) that takes N and returns the list of L with i...
prolog - how to simulate a for-loop prolog - how to simulate a for-loop prolog Rest prolog - how to simulate a for-loop I am trying to generate a list such as [X1/1,X2/2,X3/3....Xn/N] with given N. I tried to make a function maketemplate(N,L) that takes N and returns the list of L with items of Xn/N where Xn is a N-th ...
[ 0.015380859375, 0.00439453125, 0.0037689208984375, 0.00165557861328125, -0.0028839111328125, 0.010986328125, 0.004119873046875, 0.021484375, 0.01239013671875, -0.02490234375, 0.019287109375, -0.0230712890625, 0.00860595703125, -0.01263427734375, 0.0011749267578125, -0.001617431640625, ...
[ 502, 4867, 3642, 40226, 67, 100, 28354, 49756, 47, 10, 9, 31577, 139392, 5303, 1542, 418, 11583, 304, 12477, 363, 18113, 19, 64, 839, 678, 34475, 541, 37842, 32354, 3249, 2982, 92558, 866, 51776, 30646, 339, 55769, 1193, 927, 77336, 892...
[ 0.1578369140625, 0.2225341796875, 0.0657958984375, 0.271484375, 0.121826171875, 0.18994140625, 0.2374267578125, 0.17724609375, 0.00054931640625, 0.018646240234375, 0.0250244140625, 0.049072265625, 0.0965576171875, 0.1451416015625, 0.04803466796875, 0.032745361328125, 0.057373046875, ...
embed
26209193_c0
26209193
prolog
0
Title: Prolog allMember function Problem title: Prolog allMember function Tags: prolog Problem: Prolog allMember function I am trying to write a function that takes in two lists and returns true if every element in the first list appears at least once in the second list. Example: allMember(X, [a,b]). X = [] ; X = [a] ;...
Prolog allMember function Prolog allMember function prolog Prolog Len1 Len2 Prolog allMember function I am trying to write a function that takes in two lists and returns true if every element in the first list appears at least once in the second list. Example: The trouble is that after the final ; the program loops inf...
[ 0.0185546875, -0.0032958984375, 0.006439208984375, 0.01214599609375, -0.0106201171875, 0.01470947265625, 0.012451171875, 0.008544921875, 0.0228271484375, -0.01031494140625, 0.0306396484375, 0.0078125, 0.0152587890625, 0.01373291015625, -0.0035247802734375, -0.0067138671875, -0.004486...
[ 1250, 4867, 756, 594, 27417, 32354, 502, 18226, 418, 304, 31577, 33022, 51776, 23, 6626, 5303, 30646, 29568, 2174, 11907, 12830, 5117, 135179, 19713, 24145, 17932, 89536, 63134, 7103, 2704, 1528, 40956, 7, 54241, 175199, 7722, 30022 ]
[ 0.145751953125, 0.2020263671875, 0.141357421875, 0.108642578125, 0.2509765625, 0.19091796875, 0.10516357421875, 0.1632080078125, 0.0350341796875, 0.072021484375, 0.063232421875, 0.095458984375, 0.0062255859375, 0.05584716796875, 0.0902099609375, 0.170654296875, 0.097412109375, 0.17...
embed
75785959_c0
75785959
prolog
0
Title: Assertion failed when using pyswip Problem title: Assertion failed when using pyswip Tags: python, prolog Problem: Assertion failed when using pyswip I have just installed pyswip and I was testing if it is working correctly but I always get this error: Assertion failed: 0, file /home/swipl/src/swipl-devel/src/pl...
Assertion failed when using pyswip Assertion failed when using pyswip python prolog pyswip Prolog Assertion prolog.assertz Assertion failed when using pyswip I have just installed pyswip and I was testing if it is working correctly but I always get this error: Assertion failed: 0, file /home/swipl/src/swipl-devel/src/p...
[ 0.016357421875, 0.017822265625, -0.0179443359375, 0.0224609375, -0.048583984375, -0.020263671875, -0.00008058547973632812, 0.0022430419921875, -0.0235595703125, -0.023193359375, 0.02392578125, -0.004638671875, -0.01141357421875, -0.0042724609375, 0.01904296875, 0.01116943359375, 0.02...
[ 62, 16865, 1363, 165523, 17368, 57756, 2452, 254, 17198, 50828, 502, 4867, 1250, 162, 33657, 169, 20600, 134234, 20697, 11343, 18499, 757, 11435, 248, 29552, 2424, 19437, 112, 2601, 36361, 238, 13315, 1381, 10945, 27781, 18151, 54825, 209, ...
[ 0.08929443359375, 0.2279052734375, 0.1268310546875, 0.1846923828125, 0.0789794921875, 0.1500244140625, 0.2374267578125, 0.1461181640625, 0.0760498046875, 0.1253662109375, 0.1290283203125, 0.167724609375, 0.1097412109375, 0.07958984375, 0.129150390625, 0.0777587890625, 0.0318298339843...
embed
54558080_c0
54558080
prolog
0
Title: Prolog - How to separate atoms from expression involving predicates? Problem title: Prolog - How to separate atoms from expression involving predicates? Tags: prolog Problem: Prolog - How to separate atoms from expression involving predicates? If I’ve an expression: x + y * (-z) How to I separate them to form a ...
Prolog - How to separate atoms from expression involving predicates? Prolog - How to separate atoms from expression involving predicates? prolog expression Prolog How split2 Prolog - How to separate atoms from expression involving predicates? If I’ve an expression: How to I separate them to form a list of [x,y,z] ? My ...
[ -0.00092315673828125, -0.01177978515625, -0.003814697265625, 0.017333984375, -0.01373291015625, 0.048095703125, 0.0164794921875, 0.0115966796875, 0.007080078125, -0.0279541015625, 0.01806640625, 0.003570556640625, -0.004058837890625, -0.0140380859375, 0.0093994140625, 0.0152587890625, ...
[ 1250, 4867, 11249, 84797, 34627, 7, 1295, 125195, 3784, 1653, 2063, 1636, 47, 502, 65450, 304, 4263, 272, 87, 2856, 3173, 5303, 111, 425, 53, 169, 6528, 1081, 100, 661, 136, 20, 43240, 8781, 7225, 116, 69407, 1632, 14192, 44691 ]
[ 0.1376953125, 0.205078125, 0.08642578125, 0.208984375, 0.2000732421875, 0.056640625, 0.1341552734375, 0.228515625, 0.03704833984375, 0.14306640625, 0.18017578125, 0.0841064453125, 0.04486083984375, 0.10247802734375, 0.1572265625, 0.1392822265625, 0.0279998779296875, 0.025146484375,...
embed
23489044_c0
23489044
prolog
0
Title: Count number of occurrences in a list in Prolog Problem title: Count number of occurrences in a list in Prolog Tags: tail-recursion, prolog Problem: Count number of occurrences in a list in Prolog I write this little code in Prolog that counts the number of occurrences of some term in a list. It works, but it is...
Count number of occurrences in a list in Prolog Count number of occurrences in a list in Prolog tail-recursion prolog Count Prolog Count number of occurrences in a list in Prolog I write this little code in Prolog that counts the number of occurrences of some term in a list. It works, but it is not tail recursive (so n...
[ 0.006378173828125, 0.0220947265625, 0.01422119140625, 0.0162353515625, 0.0091552734375, 0.00750732421875, -0.0220947265625, 0.01055908203125, -0.0022735595703125, -0.04052734375, -0.0042724609375, -0.013671875, 0.024658203125, 0.028564453125, 0.02685546875, 0.0032806396484375, 0.0116...
[ 108210, 14012, 111, 74918, 42, 69098, 23, 5303, 1250, 4867, 46741, 107, 48650, 1830, 502, 33022, 10176, 18151, 54529, 13579, 43240, 959, 195625, 5844, 110, 87235, 5701, 1528, 1284, 678, 4527, 183278, 1290, 6528, 29479, 4358 ]
[ 0.1837158203125, 0.1343994140625, 0.052398681640625, 0.197021484375, 0.170166015625, 0.099609375, 0.06536865234375, 0.1865234375, 0.1746826171875, 0.2239990234375, 0.22021484375, 0.0232696533203125, 0.13720703125, 0.056396484375, 0.10546875, 0.0728759765625, 0.05950927734375, 0.103...
embed
13490900_c0
13490900
prolog
0
Title: Delete vowels in a list Problem title: Delete vowels in a list Tags: prolog Problem: Delete vowels in a list Write a program that deletes vowels ( String , NoVowelsString ) that deletes all vowels from a given string. So far I've got the condition vowel(X):- member(X,[a,e,i,o,u]) . Then I thought of the one that...
Delete vowels in a list Delete vowels in a list prolog Delete NoVowelsString delete2 Delete vowels in a list Write a program that deletes vowels ( String , NoVowelsString ) that deletes all vowels from a given string. So far I've got the condition vowel(X):- member(X,[a,e,i,o,u]) . Then I thought of the one that delete...
[ -0.01043701171875, 0.00927734375, 0.003875732421875, 0.01806640625, -0.01409912109375, 0.0179443359375, 0.011962890625, -0.0029296875, 0.015869140625, 0.0111083984375, 0.0096435546875, -0.0303955078125, 0.0155029296875, -0.007171630859375, -0.0130615234375, 0.0019378662109375, 0.0173...
[ 262, 46485, 2244, 8420, 7, 23, 5303, 10, 502, 4867, 438, 36635, 71713, 154109, 304, 18781, 1528, 8, 74635, 23351, 214, 756, 1295, 34475, 79315, 2060, 35431, 1542, 32786, 11, 13, 14, 31, 34, 17569, 1632, 450, 80854, 3789, 19441, 6097, ...
[ 0.125732421875, 0.1982421875, 0.1937255859375, 0.2230224609375, 0.040252685546875, 0.07208251953125, 0.214599609375, 0.012054443359375, 0.0958251953125, 0.1558837890625, 0.1204833984375, 0.1839599609375, 0.110107421875, 0.214599609375, 0.10650634765625, 0.007904052734375, 0.154296875...
embed
29175228_c0
29175228
prolog
0
Title: Using cuts in Prolog Problem title: Using cuts in Prolog Tags: prolog Problem: Using cuts in Prolog I am trying to find all of the distinct entries where a person's name is john, peter or fred. However, if there were, for example, two people called peter, I only want to display one occurrence of the name. My cod...
Using cuts in Prolog Using cuts in Prolog prolog Using Prolog Using cuts in Prolog I am trying to find all of the distinct entries where a person's name is john, peter or fred. However, if there were, for example, two people called peter, I only want to display one occurrence of the name. My code so far is as follows: ...
[ 0.03369140625, -0.000804901123046875, 0.0252685546875, 0.03369140625, -0.0037689208984375, 0.013427734375, -0.01043701171875, 0.00677490234375, 0.006103515625, -0.04296875, -0.00421142578125, -0.0198974609375, 0.0010223388671875, 0.000736236572265625, 0.01611328125, 0.01129150390625, ...
[ 345, 314, 933, 23, 1250, 4867, 6953, 502, 31577, 7413, 756, 117781, 112820, 3445, 9351, 83, 35254, 19, 154643, 707, 34836, 27781, 6626, 3395, 35839, 4734, 3444, 44116, 1632, 74918, 42, 18151, 2060, 28219, 29806, 31895, 53418, 11814, 3229, ...
[ 0.1141357421875, 0.2288818359375, 0.2010498046875, 0.04681396484375, 0.179443359375, 0.2607421875, 0.024932861328125, 0.1270751953125, 0.09051513671875, 0.110107421875, 0.032867431640625, 0.1219482421875, 0.1280517578125, 0.10107421875, 0.1439208984375, 0.029998779296875, 0.130126953...
embed
75220820_c0
75220820
prolog
0
Title: Prolog unification doesn&#x27;t evaluate arithmetic expression Problem title: Prolog unification doesn&#x27;t evaluate arithmetic expression Tags: prolog Problem: Prolog unification doesn't evaluate arithmetic expression Suppose, I wanted to write a program in prolog, which accepts a number input X, and outputs ...
Prolog unification doesn&#x27;t evaluate arithmetic expression Prolog unification doesn&#x27;t evaluate arithmetic expression prolog Prolog some_pred Xtemp Prolog unification doesn't evaluate arithmetic expression Suppose, I wanted to write a program in prolog, which accepts a number input X, and outputs all value pair...
[ 0.006439208984375, 0.00531005859375, 0.006591796875, 0.0032958984375, -0.0013275146484375, 0.011474609375, -0.000820159912109375, -0.002593994140625, 0.0228271484375, -0.020263671875, 0.0072021484375, 0.0255126953125, 0.007476806640625, -0.015869140625, 0.00030517578125, 0.006378173828...
[ 1250, 4867, 51, 41274, 3768, 18, 151575, 8962, 282, 125195, 502, 19714, 34224, 22027, 13, 187, 9523, 36663, 33022, 1528, 26946, 14012, 107730, 1193, 140992, 756, 34292, 80836, 10554, 959, 4488, 418, 997, 304, 1928, 35829, 34648, 14, 86869 ]
[ 0.1473388671875, 0.2314453125, 0.152099609375, 0.1436767578125, 0.02825927734375, 0.056182861328125, 0.1417236328125, 0.12744140625, 0.06268310546875, 0.1861572265625, 0.11962890625, 0.133544921875, 0.19921875, 0.001983642578125, 0.0267486572265625, 0.0035400390625, 0.015655517578125...
embed