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
14743005_c0
14743005
prolog
0
Title: How to check if each element in Prolog list is greater than 0? Problem title: How to check if each element in Prolog list is greater than 0? Tags: prolog, recursion, list Problem: How to check if each element in Prolog list is greater than 0? I have the following Prolog predicate prototype: solution(+InputVector...
How to check if each element in Prolog list is greater than 0? How to check if each element in Prolog list is greater than 0? prolog recursion list How Prolog How to check if each element in Prolog list is greater than 0? I have the following Prolog predicate prototype: solution(+InputVector), where InputVector is a li...
[ -0.02099609375, 0.014404296875, -0.0123291015625, 0.0120849609375, 0.0003528594970703125, 0.018310546875, 0.0164794921875, -0.00738525390625, -0.003875732421875, 0.021484375, 0.00732421875, -0.0235595703125, -0.019775390625, -0.0150146484375, 0.000274658203125, 0.00909423828125, 0.03...
[ 11249, 47, 12765, 2174, 12638, 12830, 23, 1250, 4867, 5303, 83, 117396, 3501, 757, 502, 195625, 1830, 1653, 2063, 67, 160469, 29806, 1328, 4153, 7077, 26455, 18770, 360, 142424, 69723, 140909, 4263, 756, 28412, 1810, 26008 ]
[ 0.07275390625, 0.051605224609375, 0.2274169921875, 0.1156005859375, 0.1170654296875, 0.211181640625, 0.1058349609375, 0.19189453125, 0.2587890625, 0.185791015625, 0.07952880859375, 0.1827392578125, 0.127197265625, 0.19482421875, 0.122314453125, 0.1478271484375, 0.012481689453125, 0...
embed
42367447_c0
42367447
prolog
0
Title: Prolog factorial predicate Problem title: Prolog factorial predicate Tags: prolog, failure-slice, factorial Problem: Prolog factorial predicate I have a factorial predicate fact(N,F) , where either N or F or both are bounded to a number. For example I can have fact(3,F) or fact(N,6) . Here is my predicate, which...
Prolog factorial predicate Prolog factorial predicate prolog failure-slice factorial Prolog Prolog factorial predicate I have a factorial predicate fact(N,F) , where either N or F or both are bounded to a number. For example I can have fact(3,F) or fact(N,6) . Here is my predicate, which works but I don't really unders...
[ 0.0172119140625, -0.0003910064697265625, 0.00994873046875, -0.01007080078125, -0.003875732421875, 0.008056640625, 0.006622314453125, -0.00146484375, -0.01300048828125, -0.0162353515625, 0.004669189453125, -0.0150146484375, -0.0284423828125, -0.0213623046875, -0.005401611328125, 0.00314...
[ 1250, 4867, 31461, 15403, 1653, 2063, 67, 502, 137578, 13348, 87, 765, 15824, 839, 919, 541, 707, 563, 15044, 876, 167457, 47, 14012, 27781, 831, 86827, 59690, 11853, 759, 43240, 2301, 18, 6183, 28219, 3642, 11814, 144851, 44402, 100094, ...
[ 0.158447265625, 0.2412109375, 0.19775390625, 0.1549072265625, 0.2049560546875, 0.2222900390625, 0.1273193359375, 0.1220703125, 0.226318359375, 0.1298828125, 0.012725830078125, 0.049560546875, 0.220703125, 0.049346923828125, 0.121826171875, 0.0887451171875, 0.029754638671875, 0.1184...
embed
34705190_c0
34705190
prolog
0
Title: Prolog ERROR: is/2 Problem title: Prolog ERROR: is/2 Tags: prolog Problem: Prolog ERROR: is/2 If I try logPower(X, N, REZ) :- N mod 2 =:= 0, !, N1 is N/2, logPower(X, N1, REZ1), REZ is REZ1*REZ. it doesn't work and I get ERROR: is/2: Arguments are not sufficiently instantiated but instead if I try logPower(X, N,...
Prolog ERROR: is/2 Prolog ERROR: is/2 prolog Prolog ERROR REZ REZ1 Arguments N-1 Prolog ERROR: is/2 If I try it doesn't work and I get ERROR: is/2: Arguments are not sufficiently instantiated but instead if I try it works. How may I edit the first one to work ?
[ -0.015625, 0.00970458984375, 0.01446533203125, -0.013671875, 0.02880859375, 0.017333984375, -0.001373291015625, -0.015625, 0.020751953125, -0.017578125, 0.0257568359375, 0.01287841796875, -0.00640869140625, -0.0137939453125, 0.029052734375, -0.004974365234375, 0.00396728515625, 0.0...
[ 1250, 4867, 151206, 24638, 83, 12477, 12, 502, 160314, 418, 112140, 7, 541, 5759, 9790, 22027, 18, 4488, 959, 129980, 34648, 14, 27686, 1284, 64457, 43240, 1543, 27211, 5117, 1632 ]
[ 0.186767578125, 0.27197265625, 0.189697265625, 0.1636962890625, 0.1800537109375, 0.284912109375, 0.00013434886932373047, 0.1241455078125, 0.1827392578125, 0.048858642578125, 0.27880859375, 0.0121307373046875, 0.048919677734375, 0.128662109375, 0.138427734375, 0.07196044921875, 0.0975...
embed
36430150_c2
36430150
prolog
2
composed of a list within a list. Would appreciate if someone could show me a configured predicate in order to achieve a list like stated. Thanks for any help!!! - really appreciate it! Edit - may be able to use this code found below and unable to see how I could implement this into a second findall/3 statement. Reall...
composed of a list within a list. Would appreciate if someone could show me a configured predicate in order to achieve a list like stated. Thanks for any help!!! - really appreciate it! Edit - may be able to use this code found below and unable to see how I could implement this into a second findall/3 statement. Reall...
[ -0.0013885498046875, -0.00555419921875, 0.01123046875, -0.003936767578125, 0.00274658203125, 0.00653076171875, 0.021240234375, 0.006927490234375, 0.01043701171875, -0.0234375, 0.0002460479736328125, -0.00250244140625, -0.006378173828125, -0.0093994140625, -0.0213623046875, 0.0057067871...
[ 150350, 71, 111, 10, 5303, 28032, 77947, 7639, 222495, 1653, 2063, 67, 69307, 1884, 4358, 1564, 19048, 4527, 18151, 29479, 17932, 7413, 5584, 18113, 63805, 5120, 179933, 99, 79520, 96190, 11554, 4769, 653, 927, 418, 12724, 434, 7656, 13685,...
[ 0.2264404296875, 0.122314453125, 0.05340576171875, 0.03546142578125, 0.250732421875, 0.1927490234375, 0.091796875, 0.06573486328125, 0.22119140625, 0.1561279296875, 0.207763671875, 0.096435546875, 0.16552734375, 0.06854248046875, 0.07464599609375, 0.000335693359375, 0.00054931640625,...
embed
66972239_c0
66972239
prolog
0
Title: finding players in the same the team in prolog Problem title: finding players in the same the team in prolog Tags: prolog Problem: finding players in the same the team in prolog I'm trying to solve a prolog question. I'm trying to print the players who is playing in Arsenal. I couldn't solve the problem. player(...
finding players in the same the team in prolog finding players in the same the team in prolog prolog finding players in the same the team in prolog I'm trying to solve a prolog question. I'm trying to print the players who is playing in Arsenal. I couldn't solve the problem. the output has to be:
[ 0.025390625, -0.004730224609375, 0.007415771484375, 0.007537841796875, -0.00482177734375, 0.004302978515625, -0.030029296875, 0.0186767578125, -0.004364013671875, -0.025146484375, 0.0218505859375, 0.025390625, -0.00885009765625, -0.0103759765625, -0.011474609375, 0.019287109375, 0.00...
[ 90791, 92865, 23, 5701, 70, 7175, 502, 4867, 86869, 28412, 75169, 49220, 2967, 140992 ]
[ 0.10394287109375, 0.171142578125, 0.1513671875, 0.161376953125, 0.04034423828125, 0.1536865234375, 0.1363525390625, 0.2154541015625, 0.055511474609375, 0.1773681640625, 0.1270751953125, 0.2335205078125, 0.026580810546875, 0.151611328125 ]
embed
71027626_c0
71027626
prolog
0
Title: Implement countall in prolog Problem title: Implement countall in prolog Tags: prolog Problem: Implement countall in prolog Need prolog code to implement countall(List1, List2, N), which counts the number of any element in List1 in List2 Test cases for checking code ?- countall([a], [b, a, c, a], Number). Number...
Implement countall in prolog Implement countall in prolog prolog Implement Number Implement countall in prolog Need prolog code to implement countall(List1, List2, N), which counts the number of any element in List1 in List2 Test cases for checking code
[ 0.01336669921875, -0.01904296875, -0.0068359375, 0.01239013671875, 0.01190185546875, 0.02490234375, -0.002593994140625, 0.0142822265625, 0.009765625, -0.0213623046875, 0.007659912109375, -0.02783203125, 0.0150146484375, 0.022216796875, 0.0126953125, -0.00823974609375, 0.016845703125,...
[ 153941, 54529, 5584, 502, 4867, 23, 103332, 52889, 18151, 29479, 154663, 418, 32036, 304, 541, 14012, 2499, 12830, 8647, 50218, 175199 ]
[ 0.27685546875, 0.2210693359375, 0.279541015625, 0.1556396484375, 0.229248046875, 0.029876708984375, 0.144775390625, 0.048187255859375, 0.1546630859375, 0.21240234375, 0.1141357421875, 0.025054931640625, 0.113037109375, 0.09722900390625, 0.09576416015625, 0.168701171875, 0.07916259765...
embed
7438960_c0
7438960
prolog
0
Title: Prolog Comparisation problem Problem title: Prolog Comparisation problem Tags: prolog Problem: Prolog Comparisation problem anyone have idea how to solve this problem counts the number of occurrences of an operator inside an expression. For instance, the query: ?- count(a+b*c-(2+3*4)/(5*(2+a)+(b+c)^f((d-e)*(x-y)...
Prolog Comparisation problem Prolog Comparisation problem prolog Prolog Comparisation Prolog Comparisation problem anyone have idea how to solve this problem counts the number of occurrences of an operator inside an expression. For instance, the query: would count the number of occurrences of operator * in the expressi...
[ 0.017578125, 0.002227783203125, 0.00341796875, 0.01123046875, 0.01495361328125, 0.002105712890625, -0.00811767578125, -0.0027618408203125, 0.005462646484375, -0.059814453125, -0.00823974609375, -0.023681640625, 0.020751953125, 0.009033203125, 0.01116943359375, -0.0240478515625, -0.01...
[ 1250, 4867, 113307, 15032, 2967, 502, 35672, 6528, 3642, 86869, 903, 54529, 7, 14012, 74918, 42, 69098, 39933, 46132, 125195, 41, 1294, 2806, 661, 5117, 10750, 140992, 98, 313, 38969, 3454 ]
[ 0.162353515625, 0.2291259765625, 0.196044921875, 0.10723876953125, 0.1568603515625, 0.0953369140625, 0.007801055908203125, 0.08636474609375, 0.02764892578125, 0.133544921875, 0.04913330078125, 0.1719970703125, 0.004970550537109375, 0.106201171875, 0.14111328125, 0.1177978515625, 0.10...
embed
62362422_c0
62362422
prolog
0
Title: 'swipl' is not recognized as an internal or external command, operable program or batch file Problem title: 'swipl' is not recognized as an internal or external command, operable program or batch file Tags: system-variable, prolog Problem: 'swipl' is not recognized as an internal or external ...
'swipl' is not recognized as an internal or external command, operable program or batch file 'swipl' is not recognized as an internal or external command, operable program or batch file system-variable prolog 'swipl' is not recognized as an internal or external command, operable program or batch fil...
[ 0.008056640625, 0.01312255859375, -0.0054931640625, 0.01806640625, -0.0267333984375, 0.024658203125, -0.010498046875, 0.000545501708984375, 0.0006103515625, 0.00830078125, -0.00555419921875, 0.02734375, -0.015625, -0.0021820068359375, 0.0030517578125, 0.0037384033203125, -0.001213073...
[ 3768, 7, 2452, 2424, 83, 959, 125296, 71, 237, 70796, 707, 173591, 75101, 6264, 2661, 1528, 1777, 11435, 5426, 21690, 2886, 502, 4867, 21771, 49814, 60875, 77336, 7464, 10644, 91, 105876, 442, 22027, 18, 9803, 12353, 111477, 13566 ]
[ 0.08978271484375, 0.0478515625, 0.2193603515625, 0.287841796875, 0.0204315185546875, 0.1201171875, 0.1396484375, 0.04168701171875, 0.0526123046875, 0.1488037109375, 0.040191650390625, 0.1444091796875, 0.207275390625, 0.1197509765625, 0.1170654296875, 0.1871337890625, 0.1170654296875,...
embed
63057490_c0
63057490
prolog
0
Title: Ancestors in Prolog Problem title: Ancestors in Prolog Tags: prolog Problem: Ancestors in Prolog I need to create a predicate that receives only one argument and returns all ancestors of the passed argument: % parents example: parent(jaime, rog) parent(sirris, anri) parent(gywn, gwyndolin) ancestor(Y, X) :- pare...
Ancestors in Prolog Ancestors in Prolog prolog Ancestors Prolog Ancestors in Prolog I need to create a predicate that receives only one argument and returns all ancestors of the passed argument: It returns only true, but I want it to return the names. (It requires to pass just one argument!)
[ 0.0255126953125, -0.0001373291015625, -0.0020294189453125, 0.0196533203125, -0.007568359375, 0.0223388671875, 0.0003681182861328125, 0.0174560546875, -0.016357421875, -0.060302734375, 0.0137939453125, -0.0125732421875, -0.021240234375, 0.021484375, 0.01025390625, 0.007354736328125, 0...
[ 893, 5170, 22230, 23, 1250, 4867, 502, 3871, 28282, 1653, 2063, 67, 53299, 4734, 1632, 10750, 30646, 756, 60502, 111, 115081, 29568, 3444, 123055, 144570, 27875, 1660, 8068 ]
[ 0.11090087890625, 0.17529296875, 0.173095703125, 0.040924072265625, 0.1710205078125, 0.259033203125, 0.1199951171875, 0.0753173828125, 0.12890625, 0.1693115234375, 0.21484375, 0.1431884765625, 0.09906005859375, 0.10235595703125, 0.162109375, 0.2298583984375, 0.1781005859375, 0.1116...
embed
34402191_c0
34402191
prolog
0
Title: Prolog countDown Problem title: Prolog countDown Tags: prolog, countdown, recursion Problem: Prolog countDown Hello i try to write recursion that count down like this in prolog language i tried to do some code like this: down(Y,X):- Y>0,K is Y-1,down(K,X). but its return "false." i dont know why its return boole...
Prolog countDown Prolog countDown prolog countdown recursion Prolog Y-1 Prolog countDown Hello i try to write recursion that count down like this in prolog language i tried to do some code like this: but its return "false." i dont know why its return boolean result... its need to insert into X the K value... and genera...
[ 0.0185546875, 0.001251220703125, 0.016357421875, 0.00225830078125, 0.0142822265625, -0.0025482177734375, -0.015380859375, 0.005767822265625, 0.005401611328125, -0.01904296875, 0.000820159912109375, -0.026123046875, -0.00775146484375, 0.0159912109375, 0.0203857421875, -0.00860595703125,...
[ 1250, 4867, 54529, 8331, 7710, 502, 34695, 195625, 1830, 990, 5759, 35378, 9790, 33022, 450, 7565, 1884, 903, 46876, 37842, 18151, 30646, 8710, 184, 13319, 3714, 15400, 6863, 337, 31, 34677, 16750, 3871, 183540, 3934, 1193, 341, 34292, 4537...
[ 0.1373291015625, 0.2286376953125, 0.2030029296875, 0.1572265625, 0.1842041015625, 0.1243896484375, 0.1973876953125, 0.2032470703125, 0.1424560546875, 0.05999755859375, 0.08502197265625, 0.010589599609375, 0.07159423828125, 0.08740234375, 0.000579833984375, 0.2315673828125, 0.09796142...
embed
4052794_c0
4052794
prolog
0
Title: Prolog query to find largest element in database? Problem title: Prolog query to find largest element in database? Tags: prolog Problem: Prolog query to find largest element in database? If I have defined all the digits in a Prolog database, such as dig(0), dig(1), ..., dig(9) . What query can I use for Prolog t...
Prolog query to find largest element in database? Prolog query to find largest element in database? prolog Prolog Prolog query to find largest element in database? If I have defined all the digits in a Prolog database, such as dig(0), dig(1), ..., dig(9) . What query can I use for Prolog to return the largest digit -- ...
[ 0.00836181640625, 0.0177001953125, 0.00098419189453125, -0.0032806396484375, -0.00982666015625, 0.021728515625, -0.005035400390625, -0.00201416015625, 0.0023345947265625, -0.033203125, -0.004425048828125, -0.013427734375, -0.0272216796875, -0.03076171875, 0.01434326171875, -0.012268066...
[ 1250, 4867, 41, 1294, 47, 7413, 142105, 12830, 23, 63399, 502, 61924, 756, 153939, 1466, 177609, 27750, 222104, 831, 4527, 30646, 70, 483, 37842, 1884, 5117, 207116, 14012 ]
[ 0.1695556640625, 0.246826171875, 0.157958984375, 0.1336669921875, 0.026947021484375, 0.1268310546875, 0.22802734375, 0.220947265625, 0.010284423828125, 0.2047119140625, 0.1060791015625, 0.1614990234375, 0.051605224609375, 0.2177734375, 0.130859375, 0.123779296875, 0.036956787109375, ...
embed
30016859_c0
30016859
prolog
0
Title: Division two naturals in prolog Problem title: Division two naturals in prolog Tags: prolog, successor-arithmetics Problem: Division two naturals in prolog I have written the following code: nat(0). nat(s(X)) :- nat(X). divide(0,_,0). divide(X,Y,D) :- X@<Y, D is 0. divide(X,s(0),X). divide(_,0,undefined) :- !. E...
Division two naturals in prolog Division two naturals in prolog prolog successor-arithmetics Division Division two naturals in prolog I have written the following code: Everything is right up to here. but what should i write, to calculate the division of two other naturals? for example
[ 0.0019989013671875, 0.0242919921875, -0.007476806640625, 0.0084228515625, 0.00726318359375, -0.01068115234375, 0.006317138671875, 0.01129150390625, 0.0174560546875, -0.0322265625, 0.020751953125, 0.0035400390625, -0.01806640625, 0.004058837890625, 0.01165771484375, 0.003509521484375, ...
[ 127152, 6626, 6083, 502, 4867, 7, 23, 39457, 42, 8962, 59121, 25632, 18151, 171581, 7108, 1257, 2367, 5608, 33022, 74481, 67, 91853, 111, 3789, 27781 ]
[ 0.187744140625, 0.1851806640625, 0.1680908203125, 0.130859375, 0.207763671875, 0.0377197265625, 0.0170440673828125, 0.1380615234375, 0.036041259765625, 0.050811767578125, 0.0382080078125, 0.019073486328125, 0.097900390625, 0.0231781005859375, 0.004184722900390625, 0.01532745361328125, ...
embed
50488656_c0
50488656
prolog
0
Title: Prolog Wumpus How to find a path in an unknown maze Problem title: Prolog Wumpus How to find a path in an unknown maze Tags: wumpus-world, prolog, maze Problem: Prolog Wumpus How to find a path in an unknown maze How to find a path in an unknown maze in prolog? I am having initial position and no. of rows and co...
Prolog Wumpus How to find a path in an unknown maze Prolog Wumpus How to find a path in an unknown maze wumpus-world prolog maze Prolog Wumpus How Prolog Wumpus How to find a path in an unknown maze How to find a path in an unknown maze in prolog? I am having initial position and no. of rows and columns, but no end pos...
[ 0.016845703125, 0.0106201171875, -0.006011962890625, 0.0284423828125, -0.00933837890625, 0.00019359588623046875, 0.006103515625, -0.006591796875, -0.00811767578125, -0.041748046875, 0.0079345703125, 0.0152587890625, -0.01373291015625, -0.00408935546875, 0.0020751953125, 0.0027313232421...
[ 1250, 4867, 601, 316, 7332, 11249, 7413, 10, 60875, 23, 51, 69723, 291, 731, 47, 148, 32554, 502, 19441, 61475, 19069, 15555, 136, 3365, 3564, 53418, 8337, 8447, 25813, 195625, 13380, 66769, 201505, 32628 ]
[ 0.1395263671875, 0.19384765625, 0.06829833984375, 0.1136474609375, 0.193115234375, 0.03741455078125, 0.1640625, 0.0276336669921875, 0.220947265625, 0.0780029296875, 0.044189453125, 0.1485595703125, 0.110595703125, 0.17431640625, 0.000762939453125, 0.0194549560546875, 0.04348754882812...
embed
14291895_c0
14291895
prolog
0
Title: Implement my own maplist in Prolog? Problem title: Implement my own maplist in Prolog? Tags: prolog, maplist Problem: Implement my own maplist in Prolog? I want to implement my own maplist in Prolog . Given the following : myMaplist(Goal, [Elem1|Tail1], [Elem2|Tail2]) :- apply(Goal, [Elem1, Elem2]), myMaplist(Go...
Implement my own maplist in Prolog? Implement my own maplist in Prolog? prolog maplist Implement Prolog Goal Elem1 Tail1 Elem2 Tail2 Implement my own maplist in Prolog? I want to implement my own maplist in Prolog . Given the following : What is the apply operator , and how can I replace it with something that is not a...
[ 0.0185546875, -0.0019073486328125, 0.021484375, 0.0021820068359375, -0.02197265625, 0.0264892578125, -0.007171630859375, 0.0035247802734375, 0.0157470703125, -0.04296875, 0.0303955078125, -0.0030517578125, -0.0147705078125, 0.00982666015625, 0.01214599609375, 0.006622314453125, 0.016...
[ 153941, 759, 10002, 22288, 6562, 23, 1250, 4867, 502, 2016, 289, 540, 195, 418, 1218, 379, 304, 3444, 29479, 59911, 39933, 91995, 35773, 1294, 5426, 11782 ]
[ 0.2264404296875, 0.0791015625, 0.177734375, 0.2015380859375, 0.260498046875, 0.078125, 0.19970703125, 0.256103515625, 0.1470947265625, 0.1431884765625, 0.0711669921875, 0.0692138671875, 0.1319580078125, 0.079345703125, 0.1226806640625, 0.09466552734375, 0.08782958984375, 0.05209350...
embed
39462366_c1
39462366
prolog
1
) :- Y1 is Y - 1, subset([[X,Y1]],S). % Iterate through all sublists and check for neighbours gridneighbour(S) :- forall(member(X,S), neighbourcheck(X,S)). The reason why this doesn't work is because subset doesn't care if we have a match up with another element that is disjointed. i.e. [3,1] matches up with [4,1]. Run...
) :- Y1 is Y - 1, subset([[X,Y1]],S). % Iterate through all sublists and check for neighbours gridneighbour(S) :- forall(member(X,S), neighbourcheck(X,S)). The reason why this doesn't work is because subset doesn't care if we have a match up with another element that is disjointed. i.e. [3,1] matches up with [4,1]. Run...
[ 0.00946044921875, 0.006744384765625, 0.0206298828125, 0.00762939453125, -0.01708984375, 0.00665283203125, 0.0113525390625, 0.01177978515625, 0.03076171875, 0.01007080078125, 0.005615234375, 0.0244140625, 0.002166748046875, -0.0016632080078125, -0.008544921875, 0.00848388671875, -0.00...
[ 1388, 15772, 990, 418, 83, 20, 106, 1614, 3509, 1542, 1723, 76172, 294, 1745, 87, 8560, 67, 8305, 756, 6562, 12765, 100, 108, 6958, 38648, 10314, 10952, 5584, 27417, 78292, 31635, 903, 22027, 18, 4488, 517, 14858, 1257, 12830, 2837, 513...
[ 0.003509521484375, 0.0728759765625, 0.1458740234375, 0.09002685546875, 0.0965576171875, 0.04632568359375, 0.0841064453125, 0.19140625, 0.186279296875, 0.0045166015625, 0.091064453125, 0.07196044921875, 0.0751953125, 0.05126953125, 0.028289794921875, 0.194580078125, 0.080810546875, ...
embed
16684495_c0
16684495
prolog
0
Title: How to search for words starting with given lettter Problem title: How to search for words starting with given lettter Tags: search, algorithm, prolog Problem: How to search for words starting with given lettter I want to implement a search function in Prolog where when I type a letter it shows suggested words, ...
How to search for words starting with given lettter How to search for words starting with given lettter search algorithm prolog How How to search for words starting with given lettter I want to implement a search function in Prolog where when I type a letter it shows suggested words, starting from that letter dynamical...
[ 0.007659912109375, -0.014892578125, -0.009033203125, 0.007354736328125, -0.0150146484375, -0.006988525390625, 0.01190185546875, 0.007720947265625, -0.00090789794921875, -0.06298828125, -0.0113525390625, 0.0098876953125, -0.0159912109375, 0.01055908203125, -0.007537841796875, -0.0071105...
[ 11249, 47, 33938, 100, 34153, 72134, 678, 34475, 9993, 720, 234873, 502, 4867, 3444, 29479, 32354, 23, 1250, 10644, 31330, 45831, 42459, 1295, 84079, 6275, 2046, 5303, 7413, 9790 ]
[ 0.06585693359375, 0.032989501953125, 0.2227783203125, 0.107177734375, 0.2152099609375, 0.1505126953125, 0.1331787109375, 0.1678466796875, 0.1915283203125, 0.23046875, 0.1822509765625, 0.1241455078125, 0.220458984375, 0.045074462890625, 0.08135986328125, 0.0999755859375, 0.05465698242...
embed
39547491_c1
39547491
prolog
1
Divisible(_, X) :- 1 is X. Currently, I try running something like this: [?- partition(5, X). and I get duplicate prompts of [5] and [3,2]. There is also another type of problem when I use bigger numbers like n = 20, as I get prompts with duplicate primes like [2,2,2,2,2,2,2,2,2,2]. I am very new to prolog, and I am su...
Divisible(_, X) :- 1 is X. Currently, I try running something like this: [?- partition(5, X). and I get duplicate prompts of [5] and [3,2]. There is also another type of problem when I use bigger numbers like n = 20, as I get prompts with duplicate primes like [2,2,2,2,2,2,2,2,2,2]. I am very new to prolog, and I am su...
[ -0.0284423828125, -0.0003032684326171875, 0.0120849609375, 0.00823974609375, -0.0040283203125, 0.0076904296875, 0.0034637451171875, -0.0145263671875, 0.01263427734375, -0.010986328125, 0.00193023681640625, 0.01068115234375, 0.015380859375, -0.009033203125, -0.0079345703125, 0.005950927...
[ 803, 99017, 454, 1193, 15772, 106, 83, 114063, 9790, 51042, 9844, 1884, 903, 32, 2878, 1363, 104116, 2046, 171763, 67, 105876, 7, 111, 83914, 136, 122101, 90173, 15700, 10644, 2967, 4527, 167785, 101935, 653, 2203, 387, 20809, 304, 4552, ...
[ 0.133544921875, 0.292724609375, 0.0958251953125, 0.1810302734375, 0.03704833984375, 0.12841796875, 0.1234130859375, 0.06146240234375, 0.11962890625, 0.1396484375, 0.0355224609375, 0.0662841796875, 0.051025390625, 0.035858154296875, 0.2235107421875, 0.140869140625, 0.125732421875, 0...
embed
1834867_c0
1834867
prolog
0
Title: Java and Prolog - Interprolog Problem title: Java and Prolog - Interprolog Tags: interprolog, java, prolog Problem: Java and Prolog - Interprolog I am currently trying to set up interprolog(see http://www.declarativa.com/interprolog/ ) and i've followed the steps on the site, but now I'm wondering how i can use ...
Java and Prolog - Interprolog Java and Prolog - Interprolog interprolog java prolog Java Prolog Interprolog Java and Prolog - Interprolog I am currently trying to set up interprolog(see http://www.declarativa.com/interprolog/ ) and i've followed the steps on the site, but now I'm wondering how i can use interprologs cl...
[ 0.007232666015625, 0.0034332275390625, -0.002655029296875, 0.0269775390625, -0.029296875, 0.01263427734375, -0.0211181640625, 0.0107421875, -0.009521484375, -0.03857421875, -0.00848388671875, -0.0018157958984375, -0.0341796875, 0.01092529296875, 0.00579833984375, -0.0004405975341796875...
[ 41925, 136, 1250, 4867, 20, 5337, 3454, 1940, 79, 330, 502, 82424, 31577, 5423, 1257, 50718, 3945, 4501, 10433, 134629, 98441, 1764, 5036, 149016, 3642, 831, 4527, 7, 61112, 1295, 759, 28, 106371, 184, 5415, 3871, 24927, 3934, 13452, 1672...
[ 0.2357177734375, 0.174560546875, 0.2000732421875, 0.2420654296875, 0.022674560546875, 0.2064208984375, 0.2005615234375, 0.2349853515625, 0.1031494140625, 0.158935546875, 0.141845703125, 0.03668212890625, 0.031982421875, 0.08782958984375, 0.051544189453125, 0.0301513671875, 0.11840820...
embed
37115142_c0
37115142
prolog
0
Title: Syntax error in prolog Problem title: Syntax error in prolog Tags: prolog, syntax-error, clpfd, swi-prolog Problem: Syntax error in prolog I am trying to write the following formula into swi prolog but get an error, Here is the code/query I am typing [X, Y, Z] ins 0 .. 4, X #= Y + 1. and here is the error I am g...
Syntax error in prolog Syntax error in prolog prolog syntax-error clpfd swi-prolog Syntax ERROR Operator Syntax error in prolog I am trying to write the following formula into swi prolog but get an error, Here is the code/query I am typing and here is the error I am getting Could someone let me know what I did wrong.
[ 0.003814697265625, 0.00860595703125, -0.00982666015625, 0.0185546875, -0.005767822265625, -0.002960205078125, -0.01220703125, 0.0081787109375, -0.00164794921875, -0.024658203125, -0.00885009765625, -0.01470947265625, 0.0126953125, -0.0140380859375, 0.00836181640625, -0.0013809204101562...
[ 19010, 86531, 18499, 23, 502, 4867, 6002, 188800, 33139, 39557, 71, 91, 2452, 3454, 151206, 24638, 150922, 31577, 33022, 25632, 26168, 3934, 11853, 18151, 944, 1294, 11417, 214, 3688, 20949, 44691 ]
[ 0.1573486328125, 0.2115478515625, 0.17138671875, 0.03521728515625, 0.1396484375, 0.2340087890625, 0.1353759765625, 0.1744384765625, 0.038330078125, 0.09686279296875, 0.0904541015625, 0.01461029052734375, 0.173828125, 0.112548828125, 0.11883544921875, 0.005931854248046875, 0.223144531...
embed
41566957_c0
41566957
prolog
0
Title: Prolog sum of multiples ( recursion) Problem title: Prolog sum of multiples ( recursion) Tags: prolog Problem: Prolog sum of multiples ( recursion) I am trying to solve some problem from my home work in Prolog: sum of multiples: for example : multi_sum([[2,3],[5,4],[3,1,2]],X). should return : X = 32 . but i am ...
Prolog sum of multiples ( recursion) Prolog sum of multiples ( recursion) prolog Prolog multi_sum Prolog sum of multiples ( recursion) I am trying to solve some problem from my home work in Prolog: sum of multiples: for example : should return : X = 32 . but i am getting as a result : false .
[ -0.0177001953125, 0.01373291015625, 0.032470703125, 0.00970458984375, -0.0299072265625, 0.00830078125, -0.0208740234375, 0.0123291015625, 0.02392578125, -0.025634765625, 0.00787353515625, -0.039794921875, 0.002593994140625, 0.001220703125, 0.01287841796875, -0.00077056884765625, 0.01...
[ 1250, 4867, 10554, 111, 48716, 7, 195625, 1830, 502, 6024, 11832, 31577, 86869, 2967, 4488, 27781, 5608, 30646, 1193, 2203, 2789, 20949, 16750, 98320 ]
[ 0.160888671875, 0.253173828125, 0.2183837890625, 0.12109375, 0.2349853515625, 0.043487548828125, 0.21484375, 0.1199951171875, 0.1109619140625, 0.171142578125, 0.223388671875, 0.036468505859375, 0.05322265625, 0.055328369140625, 0.06072998046875, 0.0081787109375, 0.066162109375, 0.1...
embed
21313349_c0
21313349
prolog
0
Title: Automatic results showing? Problem title: Automatic results showing? Tags: prolog, prolog-toplevel, backtracking Problem: Automatic results showing? How can I make SWI-Prolog interpreter to automatically do a semicolon? I have a lot of results (about 300) due to backtracking and I don't want to push semicolon fo...
Automatic results showing? Automatic results showing? prolog prolog-toplevel backtracking Automatic Automatic results showing? How can I make SWI-Prolog interpreter to automatically do a semicolon? I have a lot of results (about 300) due to backtracking and I don't want to push semicolon for all of them. I do NOT want ...
[ 0.00604248046875, 0.017822265625, 0.029296875, 0.024169921875, -0.0218505859375, 0.0035247802734375, 0.01116943359375, 0.0019989013671875, -0.006500244140625, 0.0031280517578125, 0.005126953125, 0.01373291015625, -0.0108642578125, 0.01190185546875, 0.004486083984375, -0.02197265625, ...
[ 51719, 1771, 50339, 141377, 502, 4867, 13784, 67919, 4420, 125728, 214, 11249, 831, 3249, 159, 38969, 10752, 29481, 56, 191082, 54, 10, 40, 46029, 4759, 765, 5915, 2668, 4743, 18, 3444, 25944, 756, 86725, 5303, 51347, 959, 32628, 31358, 1...
[ 0.2255859375, 0.097900390625, 0.21630859375, 0.1407470703125, 0.112060546875, 0.2178955078125, 0.0599365234375, 0.12060546875, 0.11328125, 0.190185546875, 0.047698974609375, 0.03033447265625, 0.0184478759765625, 0.055145263671875, 0.04852294921875, 0.2093505859375, 0.15087890625, 0...
embed
26439058_c0
26439058
prolog
0
Title: filter list into separate lists Problem title: filter list into separate lists Tags: prolog-dif, prolog, list Problem: filter list into separate lists I need to filter the list [#,d,e,#,f,g] such that I get the output as [[d,e],[f,g]] , I am stuck while creating a new list every time I encounter '#' is there a w...
filter list into separate lists filter list into separate lists prolog-dif prolog list List Head Tail filter list into separate lists I need to filter the list [#,d,e,#,f,g] such that I get the output as [[d,e],[f,g]] , I am stuck while creating a new list every time I encounter '#' is there a way to do this? I tried t...
[ 0.0123291015625, 0.0130615234375, 0.00021457672119140625, -0.0074462890625, -0.01104736328125, 0.005859375, -0.0147705078125, 0.014892578125, 0.021240234375, -0.004608154296875, 0.005462646484375, 0.0002460479736328125, 0.007110595703125, 0.00775146484375, -0.00250244140625, 0.02087402...
[ 46312, 5303, 3934, 84797, 502, 4867, 428, 420, 32036, 44816, 1218, 379, 7, 3871, 168051, 71, 13, 4904, 177, 6044, 2046, 140992, 237, 444, 179933, 105233, 3525, 11907, 1733, 190647, 3917, 54, 37842, 18151, 35064 ]
[ 0.26708984375, 0.232421875, 0.152587890625, 0.167724609375, 0.1156005859375, 0.18701171875, 0.048248291015625, 0.105224609375, 0.1634521484375, 0.09619140625, 0.062744140625, 0.06097412109375, 0.00213623046875, 0.1014404296875, 0.057830810546875, 0.0947265625, 0.1123046875, 0.12451...
embed
34213546_c0
34213546
prolog
0
Title: How to bind variable using DCG in prolog Problem title: How to bind variable using DCG in prolog Tags: dcg, prolog Problem: How to bind variable using DCG in prolog Based on the code in the pics, How can I bind those unbounded variables with processing the structure? For example, how can I let the X=1,Y=2 for th...
How to bind variable using DCG in prolog How to bind variable using DCG in prolog dcg prolog DCG How How to bind variable using DCG in prolog Based on the code in the pics, How can I bind those unbounded variables with processing the structure? For example, how can I let the X=1,Y=2 for the example in first pic. a more...
[ 0.007080078125, 0.009521484375, -0.003326416015625, 0.01373291015625, 0.00128173828125, 0.0194091796875, 0.00933837890625, 0.0047607421875, -0.003570556640625, -0.0233154296875, -0.0242919921875, -0.0252685546875, 0.004547119140625, 0.0086669921875, 0.00579833984375, 0.0137939453125, ...
[ 11249, 68557, 77336, 17368, 391, 56367, 23, 502, 4867, 104, 238, 177, 18151, 124683, 99091, 678, 9433, 45646, 3642, 2633, 1193, 33000, 1723, 55257, 27781, 8834, 119488, 8962, 282, 102203 ]
[ 0.0572509765625, 0.2406005859375, 0.288818359375, 0.05169677734375, 0.1131591796875, 0.251220703125, 0.00592041015625, 0.1365966796875, 0.2188720703125, 0.0158538818359375, 0.012908935546875, 0.06756591796875, 0.041778564453125, 0.09368896484375, 0.1373291015625, 0.0224761962890625, ...
embed
43723118_c0
43723118
prolog
0
Title: Call a rule in Prolog Problem title: Call a rule in Prolog Tags: prolog, knights-tour, combinatorics Problem: Call a rule in Prolog I'm trying to solve Knight Tour problem. I want to call a rule to evaluate possible movements, but I can't do that my rule returns the next position in the variable that I send. mov...
Call a rule in Prolog Call a rule in Prolog prolog knights-tour combinatorics Call Prolog Y-2 Y-1 Call a rule in Prolog I'm trying to solve Knight Tour problem. I want to call a rule to evaluate possible movements, but I can't do that my rule returns the next position in the variable that I send. In the console I send ...
[ 0.014892578125, 0.0179443359375, 0.01165771484375, 0.0419921875, 0.01507568359375, 0.0272216796875, 0.001953125, 0.0230712890625, 0.000644683837890625, -0.0257568359375, -0.004730224609375, 0.00921630859375, -0.00860595703125, -0.0179443359375, 0.01141357421875, -0.0145263671875, 0.0...
[ 26265, 10, 79986, 23, 1250, 4867, 502, 54350, 28889, 22321, 3826, 990, 5428, 5759, 31577, 86869, 114996, 11330, 2967, 3444, 11782, 151575, 7722, 112664, 831, 18, 30646, 11737, 19069, 77336, 25379, 130250, 25813, 10461, 27781, 15673, 128188, 4...
[ 0.1934814453125, 0.06878662109375, 0.241943359375, 0.04998779296875, 0.1658935546875, 0.2471923828125, 0.1304931640625, 0.154541015625, 0.244140625, 0.125732421875, 0.080078125, 0.075439453125, 0.1353759765625, 0.08966064453125, 0.004913330078125, 0.04974365234375, 0.198974609375, ...
embed
10538037_c0
10538037
prolog
0
Title: Prolog transform and separate term (atom) into a list Problem title: Prolog transform and separate term (atom) into a list Tags: prolog, list Problem: Prolog transform and separate term (atom) into a list I have a term (more accurately an atom) like this: name1(value1),name2(value2) and I would like to have inst...
Prolog transform and separate term (atom) into a list Prolog transform and separate term (atom) into a list prolog list Prolog name1 value1 name2 value2 Prolog transform and separate term (atom) into a list I have a term (more accurately an atom) like this: name1(value1),name2(value2) and I would like to have instead a...
[ 0.0322265625, -0.003387451171875, 0.00579833984375, 0.0162353515625, -0.01556396484375, 0.0067138671875, -0.0115966796875, 0.0169677734375, -0.0203857421875, -0.017578125, 0.01519775390625, 0.01373291015625, -0.00689697265625, 0.0067138671875, -0.0027618408203125, 0.0001382827758789062...
[ 1250, 4867, 27198, 136, 84797, 13579, 11, 5928, 3934, 10, 5303, 502, 9351, 418, 34292, 304, 765, 17678, 152018, 34627, 1884, 27494, 17727, 11627, 10461, 2806, 47, 64457, 30544, 903, 40, 16082, 69407, 6528, 3642, 54, 442 ]
[ 0.1661376953125, 0.2568359375, 0.226806640625, 0.0229339599609375, 0.1904296875, 0.2227783203125, 0.041534423828125, 0.189208984375, 0.0906982421875, 0.054351806640625, 0.24072265625, 0.139404296875, 0.084228515625, 0.0540771484375, 0.1817626953125, 0.129150390625, 0.078125, 0.0061...
embed
37243592_c0
37243592
prolog
0
Title: atom_concat works on swi-prolog but not gprolog Problem title: atom_concat works on swi-prolog but not gprolog Tags: prolog Problem: atom_concat works on swi-prolog but not gprolog I'm having this simple code : A is 1, atom_concat(A,'1', L). SWI-prolog gives me : A = 1, L = '11'. as intended but on gprolog I hav...
atom_concat works on swi-prolog but not gprolog atom_concat works on swi-prolog but not gprolog prolog atom_concat type_error atom_concat works on swi-prolog but not gprolog I'm having this simple code : SWI-prolog gives me : as intended but on gprolog I have : Why is there a difference of output between swi-prolog and...
[ 0.0152587890625, 0.0079345703125, 0.007354736328125, 0.0186767578125, -0.007080078125, -0.00151824951171875, -0.0013275146484375, 0.019775390625, -0.01385498046875, -0.048828125, 0.0201416015625, -0.0062255859375, 0.007293701171875, -0.006927490234375, 0.023681640625, -0.01708984375, ...
[ 34627, 2271, 4460, 43240, 98, 91, 2452, 3454, 4867, 1284, 959, 706, 454, 9, 502, 10644, 188800, 19441, 8781, 18151, 159, 38969, 76199, 163, 237, 179140, 765, 44084, 2685, 60212, 140992, 17721, 136, 7108, 22362 ]
[ 0.2320556640625, 0.14404296875, 0.268310546875, 0.1256103515625, 0.074951171875, 0.037109375, 0.1796875, 0.166015625, 0.2105712890625, 0.09149169921875, 0.07342529296875, 0.07379150390625, 0.04010009765625, 0.03179931640625, 0.138671875, 0.14697265625, 0.162841796875, 0.03451538085...
embed
44746906_c0
44746906
prolog
0
Title: Using embedded R tool in Prolog Problem title: Using embedded R tool in Prolog Tags: prolog, swi-prolog, r Problem: Using embedded R tool in Prolog I know with using pack 'real', we can use embedded R in Prolog. But I met problems to use this pack. And I didn't find simple examples of using this pack. Can somebo...
Using embedded R tool in Prolog Using embedded R tool in Prolog prolog swi-prolog r Using Prolog Using embedded R tool in Prolog I know with using pack 'real', we can use embedded R in Prolog. But I met problems to use this pack. And I didn't find simple examples of using this pack. Can somebody give a simple example o...
[ 0.0380859375, 0.00017642974853515625, -0.01263427734375, 0.0106201171875, 0.004150390625, 0.0120849609375, 0.003997802734375, 0.00506591796875, -0.00732421875, -0.05322265625, 0.0174560546875, 0.0045166015625, -0.0126953125, -0.0142822265625, 0.033447265625, 0.00189971923828125, 0.00...
[ 345, 55720, 69819, 627, 55516, 1250, 4867, 502, 2452, 3454, 1690, 3714, 17368, 43824, 30544, 831, 4527, 23, 44402, 8781, 27781, 228006, 142424, 77336, 11782, 32354, 48281, 23577 ]
[ 0.032928466796875, 0.181640625, 0.1485595703125, 0.210693359375, 0.22509765625, 0.1630859375, 0.232177734375, 0.10443115234375, 0.121337890625, 0.1181640625, 0.09173583984375, 0.00726318359375, 0.059539794921875, 0.162109375, 0.203369140625, 0.0200653076171875, 0.0946044921875, 0.0...
embed
48687416_c0
48687416
prolog
0
Title: Divide the length of a given List Problem title: Divide the length of a given List Tags: prolog, list Problem: Divide the length of a given List I want to divide the length of a given list. I know how to divide and I know how to obtain the length of a List, but using both predicates does not work for me. Here is...
Divide the length of a given List Divide the length of a given List prolog list Divide List Halflength Length Call _G15025 _G15108 ERROR Undefined However Exception Divide the length of a given List I want to divide the length of a given list. I know how to divide and I know how to obtain the length of a List, but usin...
[ 0.007232666015625, 0.015380859375, 0.01416015625, -0.01104736328125, -0.006072998046875, -0.005035400390625, 0.005828857421875, 0.006134033203125, 0.0220947265625, -0.0269775390625, 0.00634765625, -0.00011110305786132812, 0.00396728515625, 0.01904296875, -0.0018463134765625, -0.0055847...
[ 76278, 112, 70, 140909, 111, 34475, 32036, 502, 4867, 5303, 151500, 23986, 77554, 927, 26265, 19236, 2588, 1837, 69139, 151206, 24638, 79912, 5983, 33306, 5443, 63928, 3444, 47, 101637, 3714, 113054, 17368, 15044, 1653, 2063, 1636, 959, 4488 ...
[ 0.1927490234375, 0.116455078125, 0.05035400390625, 0.2119140625, 0.057220458984375, 0.1414794921875, 0.2132568359375, 0.13671875, 0.1968994140625, 0.1973876953125, 0.07623291015625, 0.1103515625, 0.10198974609375, 0.004638671875, 0.152099609375, 0.0712890625, 0.1546630859375, 0.025...
embed
20027182_c0
20027182
prolog
0
Title: GNU Prolog assert error Problem title: GNU Prolog assert error Tags: prolog-assert, iso-prolog, gnu-prolog, prolog Problem: GNU Prolog assert error I am new to Prolog, but I am stuck at this supposedly simple command. I have loaded a knowledge base with no errors, and whenever I try do assert (and even help ) I ...
GNU Prolog assert error GNU Prolog assert error prolog-assert iso-prolog gnu-prolog prolog GNU Prolog existence_error top_level GNU Prolog assert error I am new to Prolog, but I am stuck at this supposedly simple command. I have loaded a knowledge base with no errors, and whenever I try do assert (and even help ) I get...
[ 0.0257568359375, 0.01544189453125, -0.006317138671875, 0.01220703125, -0.0181884765625, 0.01202392578125, -0.01361083984375, 0.0047607421875, -0.00469970703125, -0.0198974609375, 0.0186767578125, 0.003875732421875, -0.00543212890625, 0.0037384033203125, 0.035888671875, 0.00151062011718...
[ 165132, 1250, 4867, 237, 33657, 18499, 502, 162, 13882, 3454, 104155, 116311, 188800, 2663, 67919, 3525, 179933, 134598, 8781, 75101, 72367, 297, 51359, 3647, 110, 217684, 9790, 4358, 25632, 26008, 4865, 444, 87, 66161, 132283, 51606 ]
[ 0.1942138671875, 0.181396484375, 0.2467041015625, 0.121337890625, 0.259521484375, 0.1998291015625, 0.123291015625, 0.0994873046875, 0.105224609375, 0.109619140625, 0.1373291015625, 0.1888427734375, 0.21728515625, 0.096923828125, 0.1553955078125, 0.0504150390625, 0.08172607421875, 0...
embed
66392574_c0
66392574
prolog
0
Title: Can anybody help me understanding this prolog program? Problem title: Can anybody help me understanding this prolog program? Tags: prolog Problem: Can anybody help me understanding this prolog program? maxi([X],X). maxi([K|R],X):- maxi(R,X), X > K. maxi([K|R],K):- maxi(R,X), X =< K. ?- maxi([4,5,3,8,2],X), write...
Can anybody help me understanding this prolog program? Can anybody help me understanding this prolog program? prolog Can Can anybody help me understanding this prolog program? So the output of the program is 8, which is correct, but I don't understand how it works. Can anybody just shortly explain each step of the prog...
[ 0.0201416015625, 0.00811767578125, 0.0162353515625, 0.006622314453125, -0.00154876708984375, 0.012451171875, 0.003570556640625, 0.01214599609375, 0.0159912109375, -0.0194091796875, 0.0130615234375, -0.01153564453125, -0.022216796875, -0.004180908203125, 0.0283203125, 0.0037841796875, ...
[ 4171, 2499, 37873, 4358, 163, 100094, 903, 502, 4867, 1528, 32, 70, 140992, 111, 83, 382, 3129, 26785, 2301, 18, 28219, 3642, 442, 43240, 16610, 73342, 12638, 29954, 5045, 77947 ]
[ 0.0570068359375, 0.052337646484375, 0.107421875, 0.111328125, 0.0625, 0.1861572265625, 0.09320068359375, 0.220703125, 0.283203125, 0.2099609375, 0.0022258758544921875, 0.0472412109375, 0.23486328125, 0.03900146484375, 0.0904541015625, 0.211669921875, 0.00829315185546875, 0.09918212...
embed
23711935_c0
23711935
prolog
0
Title: Find all list rotations in Prolog Problem title: Find all list rotations in Prolog Tags: list, prolog, rotation Problem: Find all list rotations in Prolog I'm trying to produe all possible list rotations in Prolog. Here is an example: rotate([1,2,3], X). X = [1,2,3]; X = [2,3,1]; X = [3,1,2]. I found a way to ma...
Find all list rotations in Prolog Find all list rotations in Prolog list prolog rotation Find Prolog Left Right Find all list rotations in Prolog I'm trying to produe all possible list rotations in Prolog. Here is an example: I found a way to make one rotation: But how to find all? Answer
[ -0.009033203125, 0.0103759765625, 0.033203125, -0.01495361328125, -0.015625, -0.010498046875, -0.01171875, -0.003631591796875, 0.00244140625, -0.012451171875, 0.0004520416259765625, -0.000125885009765625, 0.0135498046875, 0.002777099609375, -0.00159454345703125, 0.0216064453125, 0.01...
[ 26040, 756, 5303, 47014, 5256, 23, 1250, 4867, 502, 2062, 22062, 636, 2480, 90911, 31577, 23608, 7722, 27781, 14037, 3249, 1632, 47, 7413 ]
[ 0.10272216796875, 0.1396484375, 0.1865234375, 0.2098388671875, 0.135009765625, 0.052764892578125, 0.165283203125, 0.238037109375, 0.1083984375, 0.15869140625, 0.1810302734375, 0.02569580078125, 0.08526611328125, 0.0994873046875, 0.00738525390625, 0.0831298828125, 0.11572265625, 0.0...
embed
10645763_c0
10645763
prolog
0
Title: User Interface in Prolog Problem title: User Interface in Prolog Tags: user-interface, prolog Problem: User Interface in Prolog I have been begun programming in Prolog lately and find the language very dry. Is there a way by which, after having built the database of facts and rules, we can interface that with a ...
User Interface in Prolog User Interface in Prolog user-interface prolog User Interface Prolog User Interface in Prolog I have been begun programming in Prolog lately and find the language very dry. Is there a way by which, after having built the database of facts and rules, we can interface that with a webpage written ...
[ 0.0380859375, 0.006500244140625, 0.0101318359375, 0.0113525390625, 0.0024566650390625, 0.038330078125, -0.003326416015625, 0.00860595703125, -0.00081634521484375, -0.06494140625, 0.0032501220703125, 0.00689697265625, -0.0244140625, -0.00274658203125, 0.033447265625, 0.004852294921875, ...
[ 53400, 220237, 23, 1250, 4867, 38937, 10433, 40404, 502, 6967, 56037, 449, 37838, 7413, 46876, 4552, 36898, 2685, 3917, 7103, 19441, 88303, 63399, 15824, 136, 91736, 831, 101758, 450, 678, 1467, 22469, 59121, 47302, 2499, 3789, 41, 1294, 18...
[ 0.162841796875, 0.286865234375, 0.09161376953125, 0.18896484375, 0.279296875, 0.137939453125, 0.134033203125, 0.0809326171875, 0.141357421875, 0.020751953125, 0.111572265625, 0.0279541015625, 0.0231475830078125, 0.094482421875, 0.2056884765625, 0.07763671875, 0.2120361328125, 0.008...
embed
13458623_c0
13458623
prolog
0
Title: update nth element of a list Problem title: update nth element of a list Tags: prolog Problem: update nth element of a list I am new to prolog , I have a list in prolog like A=[1,2,3,4] , and than I accessed nth element using nth(N,[_|T],R) . Now I have Nth element in R , than I have done some calculation on R ....
update nth element of a list update nth element of a list prolog update nth element of a list I am new to prolog , I have a list in prolog like A=[1,2,3,4] , and than I accessed nth element using nth(N,[_|T],R) . Now I have Nth element in R , than I have done some calculation on R . Now what I want is to update that nt...
[ -0.012939453125, -0.0035247802734375, 0.02978515625, -0.004913330078125, 0.00188446044921875, 0.004547119140625, -0.00421142578125, 0.00799560546875, 0.0035400390625, -0.0284423828125, 0.01611328125, -0.013916015625, -0.005859375, -0.0191650390625, 0.0196533203125, -0.010986328125, 0...
[ 28350, 653, 927, 12830, 111, 5303, 10, 502, 4867, 3525, 1884, 62, 133063, 82449, 17203, 839, 618, 1052, 541, 627, 74481, 3444, 47, 23, 5915, 831, 12638, 1733, 55300 ]
[ 0.1790771484375, 0.209716796875, 0.2060546875, 0.225830078125, 0.091552734375, 0.19775390625, 0.01824951171875, 0.14306640625, 0.1798095703125, 0.04547119140625, 0.001556396484375, 0.06451416015625, 0.0501708984375, 0.1195068359375, 0.07464599609375, 0.060577392578125, 0.037841796875...
embed
14792680_c0
14792680
prolog
0
Title: Summation of a set of vectors in Prolog Problem title: Summation of a set of vectors in Prolog Tags: prolog Problem: Summation of a set of vectors in Prolog I am trying to sum up a set of vectors in Prolog. I have the code for summing up the elements in one vector but I am not sure how to extend it to multiple v...
Summation of a set of vectors in Prolog Summation of a set of vectors in Prolog prolog Summation Prolog set_addtion Head Tail TotalSum Sum1 Summation of a set of vectors in Prolog I am trying to sum up a set of vectors in Prolog. I have the code for summing up the elements in one vector but I am not sure how to extend ...
[ 0.0011138916015625, 0.021484375, 0.0206298828125, 0.0238037109375, -0.01226806640625, -0.0166015625, -0.01373291015625, 0.00084686279296875, 0.00982666015625, -0.0284423828125, 0.01025390625, 0.0031890869140625, -0.010986328125, -0.010009765625, -0.000621795654296875, -0.01031494140625...
[ 131150, 1363, 5423, 22834, 22230, 1250, 4867, 502, 4028, 44816, 1218, 379, 33867, 294, 316, 36335, 418, 23, 31577, 10554, 1257, 18151, 166, 58838, 80854, 1632, 173, 18770, 65042, 48716 ]
[ 0.2039794921875, 0.05133056640625, 0.1361083984375, 0.18701171875, 0.145263671875, 0.1287841796875, 0.1998291015625, 0.09381103515625, 0.0736083984375, 0.1031494140625, 0.08209228515625, 0.07244873046875, 0.11572265625, 0.10406494140625, 0.1881103515625, 0.1904296875, 0.0256805419921...
embed
4768366_c0
4768366
prolog
0
Title: How to write a complete binary tree predicate using Prolog Problem title: How to write a complete binary tree predicate using Prolog Tags: prolog Problem: How to write a complete binary tree predicate using Prolog What is the algorithm of checking if a Binary tree is a complete binary tree? (Using Prolog). For e...
How to write a complete binary tree predicate using Prolog How to write a complete binary tree predicate using Prolog prolog Prolog How How to write a complete binary tree predicate using Prolog What is the algorithm of checking if a Binary tree is a complete binary tree? (Using Prolog). For example:
[ 0.01434326171875, 0.000621795654296875, -0.01226806640625, 0.0036773681640625, -0.00787353515625, 0.0196533203125, -0.01202392578125, -0.011474609375, -0.0106201171875, -0.01806640625, -0.01129150390625, 0.00445556640625, -0.01141357421875, -0.007415771484375, 0.01348876953125, 0.01379...
[ 11249, 33022, 28484, 2394, 6635, 53201, 1653, 2063, 67, 17368, 1250, 4867, 47, 502, 234873, 175199, 2174, 54092, 1294, 83, 10 ]
[ 0.028167724609375, 0.146728515625, 0.1849365234375, 0.148681640625, 0.138427734375, 0.206787109375, 0.1280517578125, 0.1693115234375, 0.0865478515625, 0.043060302734375, 0.14501953125, 0.2364501953125, 0.010223388671875, 0.10174560546875, 0.188720703125, 0.1785888671875, 0.0536804199...
embed
52843527_c0
52843527
prolog
0
Title: Prolog - exaclty one element in list without using size or length functions Problem title: Prolog - exaclty one element in list without using size or length functions Tags: prolog Problem: Prolog - exaclty one element in list without using size or length functions The question states to return true if a list has...
Prolog - exaclty one element in list without using size or length functions Prolog - exaclty one element in list without using size or length functions prolog size Prolog Examples Prolog - exaclty one element in list without using size or length functions The question states to return true if a list has exactly one ele...
[ 0.0233154296875, 0.021240234375, 0.01483154296875, 0.00897216796875, -0.0152587890625, 0.01336669921875, 0.000820159912109375, -0.00994873046875, 0.010009765625, -0.0184326171875, 0.0216064453125, -0.0152587890625, -0.006683349609375, 0.0140380859375, 0.00738525390625, 0.00927734375, ...
[ 1250, 4867, 1119, 2263, 1277, 53, 1632, 12830, 5303, 15490, 17368, 13267, 140909, 32354, 23, 502, 89536, 9655, 117249, 30646, 29568, 2174, 1556, 66161, 6, 46741, 8110, 201505, 10932, 903 ]
[ 0.15478515625, 0.2705078125, 0.05560302734375, 0.143310546875, 0.084228515625, 0.0802001953125, 0.1331787109375, 0.19873046875, 0.2034912109375, 0.10614013671875, 0.054168701171875, 0.1180419921875, 0.1309814453125, 0.1400146484375, 0.016387939453125, 0.1199951171875, 0.0610046386718...
embed
26398781_c0
26398781
prolog
0
Title: Warning: Attempt to read past end of file in SGETTOK Prolog abort Problem title: Warning: Attempt to read past end of file in SGETTOK Prolog abort Tags: prolog Problem: Warning: Attempt to read past end of file in SGETTOK Prolog abort I was trying to do consult(file_name) when i get the following error - "Warnin...
Warning: Attempt to read past end of file in SGETTOK Prolog abort Warning: Attempt to read past end of file in SGETTOK Prolog abort prolog Warning Attempt SGETTOK Prolog file_name Warning: Attempt to read past end of file in SGETTOK Prolog abort I was trying to do consult(file_name) when i get the following error - Thi...
[ 0.03759765625, 0.00994873046875, 0.01068115234375, -0.0045166015625, -0.0306396484375, 0.00946044921875, -0.0089111328125, 0.030517578125, -0.007781982421875, -0.02099609375, 0.026123046875, 0.00732421875, -0.0242919921875, -0.031005859375, 0.034423828125, -0.0269775390625, 0.0224609...
[ 5550, 592, 34224, 12301, 11015, 3564, 111, 11435, 159, 79794, 72071, 1250, 4867, 64853, 18, 47, 23, 502, 11627, 31577, 75463, 29822, 25632, 18499, 3293, 96276, 100, 11907, 1528, 87, 11675 ]
[ 0.116943359375, 0.060699462890625, 0.154296875, 0.162353515625, 0.1551513671875, 0.1533203125, 0.111328125, 0.1304931640625, 0.0692138671875, 0.150634765625, 0.2353515625, 0.1517333984375, 0.2052001953125, 0.2413330078125, 0.023193359375, 0.00274658203125, 0.007293701171875, 0.1063...
embed
16405344_c1
16405344
prolog
1
= g(t1,…,tn)(f,g: function symbols,si and ti:terms) – If fisidentical identicalto g,replace replace the termconstraint constraint by constraints constraints s1=t1 and s2=t2,……,sn=tn; otherwise: no solution – Repeat this process until no more constraints left or a report of no‐solution solution exists. It is not quit c...
= g(t1,…,tn)(f,g: function symbols,si and ti:terms) – If fisidentical identicalto g,replace replace the termconstraint constraint by constraints constraints s1=t1 and s2=t2,……,sn=tn; otherwise: no solution – Repeat this process until no more constraints left or a report of no‐solution solution exists. It is not quit c...
[ -0.000637054443359375, 0.03662109375, -0.00897216796875, 0.0216064453125, -0.000637054443359375, -0.007354736328125, -0.0010223388671875, -0.007110595703125, 0.0008544921875, -0.0166015625, 0.00139617919921875, 0.0033721923828125, -0.01129150390625, -0.0031280517578125, -0.004638671875, ...
[ 2203, 706, 18, 418, 27, 19, 420, 177, 32354, 26582, 172, 1053, 32166, 46, 4263, 809, 20816, 70760, 31943, 6827, 188, 107, 23935, 91995, 13579, 2271, 2816, 4288, 158, 91, 136, 304, 2551, 120262, 110, 29806, 33742, 13, 9433, 1286, 25737, ...
[ 0.1317138671875, 0.1669921875, 0.0550537109375, 0.0858154296875, 0.02142333984375, 0.08642578125, 0.0723876953125, 0.0955810546875, 0.1171875, 0.18896484375, 0.1085205078125, 0.1102294921875, 0.143798828125, 0.008880615234375, 0.0721435546875, 0.13134765625, 0.189208984375, 0.16467...
embed
55137955_c0
55137955
prolog
0
Title: Prolog Dynamic Predicates Basic Usage Problem title: Prolog Dynamic Predicates Basic Usage Tags: prolog, prolog-assert Problem: Prolog Dynamic Predicates Basic Usage with this knowledge base using https://swish.swi-prolog.org :- dynamic happy/1. go:- assert(happy(mia)), write(happy(mia)). if I run go. I get happ...
Prolog Dynamic Predicates Basic Usage Prolog Dynamic Predicates Basic Usage prolog prolog-assert Prolog Dynamic Predicates Basic Usage Prolog Dynamic Predicates Basic Usage with this knowledge base using https://swish.swi-prolog.org if I run go. I get If I just have and run happy(mia) , I get false . What fundamental c...
[ 0.0286865234375, 0.0030059814453125, 0.0181884765625, 0.01544189453125, -0.016845703125, 0.023681640625, 0.00109100341796875, 0.0242919921875, 0.001068115234375, -0.023681640625, 0.006591796875, -0.00958251953125, -0.0242919921875, -0.00225830078125, 0.0361328125, 0.02587890625, 0.03...
[ 1250, 4867, 73327, 21068, 7145, 2063, 1636, 91692, 70166, 502, 162, 33657, 429, 903, 51359, 3647, 17368, 114686, 2452, 3454, 1478, 11675, 738, 2046, 4263, 1660, 765, 136, 17723, 132, 7605, 98320, 20531, 23755, 132283, 22936 ]
[ 0.1846923828125, 0.285400390625, 0.14501953125, 0.0948486328125, 0.19970703125, 0.205078125, 0.054962158203125, 0.14892578125, 0.1224365234375, 0.1466064453125, 0.095458984375, 0.217529296875, 0.003997802734375, 0.0307769775390625, 0.112060546875, 0.1541748046875, 0.008148193359375, ...
embed
35019820_c0
35019820
prolog
0
Title: Split words from string in Prolog Problem title: Split words from string in Prolog Tags: dcg, list, prolog, split Problem: Split words from string in Prolog I want to split words from string and put into a list in Prolog. num --> [one] | [two] | [three] | [four] | [five]. ?- split("onethreetwofive", Ls). Ls = [o...
Split words from string in Prolog Split words from string in Prolog dcg list prolog split string Split Prolog Split words from string in Prolog I want to split words from string and put into a list in Prolog. Here, I want to split the string with matching list from num and put the words in list. I am using SWI-Prolog. ...
[ -0.00640869140625, 0.000020503997802734375, -0.0084228515625, 0.0133056640625, -0.0242919921875, 0.035888671875, -0.00011157989501953125, 0.00188446044921875, -0.002716064453125, -0.02734375, -0.01531982421875, -0.00634765625, -0.0206298828125, 0.0038604736328125, 0.01068115234375, 0.0...
[ 46474, 34153, 1295, 79315, 23, 1250, 4867, 238, 177, 5303, 502, 65450, 3444, 3884, 3934, 47, 678, 14858, 13269, 17368, 159, 38969, 10752, 25647 ]
[ 0.1988525390625, 0.214111328125, 0.1763916015625, 0.23193359375, 0.0489501953125, 0.15869140625, 0.2467041015625, 0.0276031494140625, 0.111572265625, 0.1483154296875, 0.1251220703125, 0.202392578125, 0.05426025390625, 0.036468505859375, 0.044464111328125, 0.006053924560546875, 0.0267...
embed
31357006_c1
31357006
prolog
1
","ACGGGGTACG"); S = section("duck","ACGTTAG"); false. But if I did phrase(fasta_file(Sections),">frog\nACGGGGTACG\n>duck\nACGTTAG). Sections is unified with a list of sections/2s, which is what I want, but my current code seems quite hacky- how I have handled the newline character for example. Code signals: What, use_...
","ACGGGGTACG"); S = section("duck","ACGTTAG"); false. But if I did phrase(fasta_file(Sections),">frog\nACGGGGTACG\n>duck\nACGTTAG). Sections is unified with a list of sections/2s, which is what I want, but my current code seems quite hacky- how I have handled the newline character for example. Code signals: What, use_...
[ 0.012451171875, 0.024658203125, -0.01953125, 0.01220703125, -0.006866455078125, 0.015869140625, 0.0057373046875, 0.006072998046875, 0.01312255859375, 0.00958251953125, 0.00095367431640625, 0.0281982421875, -0.00616455078125, 0.01312255859375, 0.005279541015625, 0.0147705078125, 0.005...
[ 15012, 46754, 134873, 724, 159, 40059, 693, 2594, 37315, 188226, 98320, 4966, 2174, 6777, 113860, 39473, 11, 29822, 294, 58994, 211209, 140978, 7, 51, 47314, 5303, 12477, 3444, 43581, 18151, 37202, 32233, 85526, 53, 34831, 3525, 2256, 62816, ...
[ 0.07366943359375, 0.08184814453125, 0.08544921875, 0.0963134765625, 0.07928466796875, 0.186767578125, 0.1121826171875, 0.135986328125, 0.0919189453125, 0.207763671875, 0.154052734375, 0.0711669921875, 0.0419921875, 0.030120849609375, 0.202880859375, 0.1392822265625, 0.1326904296875, ...
embed
71976787_c0
71976787
prolog
0
Title: Accessing Parametric object from category Problem title: Accessing Parametric object from category Tags: prolog, logtalk, categories Problem: Accessing Parametric object from category how to Access Parametric object from a ategory :- category(attributes). :- public(info/1). info(Value) :- arg(1,_Array_,Value). :...
Accessing Parametric object from category Accessing Parametric object from category prolog logtalk categories category Accessing Parametric Value _Array_ end_category Singleton Accessing Parametric object from category how to Access Parametric object from a ategory this does not work ...
[ 0.00555419921875, 0.00057220458984375, -0.0023956298828125, -0.00634765625, 0.0042724609375, 0.0032958984375, -0.0034027099609375, 0.01397705078125, 0.002105712890625, -0.04736328125, 0.004058837890625, -0.032470703125, -0.0164794921875, -0.01263427734375, -0.0029296875, -0.02563476562...
[ 40266, 214, 1720, 186518, 36746, 1295, 95487, 502, 4867, 12684, 139109, 39283, 190060, 7092, 3564, 33478, 6504, 43609, 1507, 99, 3081, 903, 959, 4488 ]
[ 0.21484375, 0.04376220703125, 0.1534423828125, 0.2259521484375, 0.205078125, 0.1474609375, 0.260009765625, 0.078857421875, 0.15576171875, 0.08587646484375, 0.1754150390625, 0.2076416015625, 0.11639404296875, 0.09124755859375, 0.05731201171875, 0.1182861328125, 0.1715087890625, 0.12...
embed
32640402_c0
32640402
prolog
0
Title: Prolog: working with lists Problem title: Prolog: working with lists Tags: prolog, list Problem: Prolog: working with lists I got this assignment with Prolog lists and I need some help. Build a program in Prolog that Check if a list is empty Check if a list is not empty Check if a list only has one element Check...
Prolog: working with lists Prolog: working with lists prolog list Prolog Prolog: working with lists I got this assignment with Prolog lists and I need some help. Build a program in Prolog that Check if a list is empty Check if a list is not empty Check if a list only has one element Check if a list has 2 or more elemen...
[ 0.0166015625, 0.00897216796875, 0.00146484375, 0.01409912109375, -0.021728515625, 0.03564453125, -0.007598876953125, -0.004058837890625, 0.00799560546875, -0.000579833984375, 0.020263671875, -0.029541015625, -0.02294921875, 0.00347900390625, -0.0023193359375, 0.00537109375, 0.0285644...
[ 1250, 4867, 20697, 678, 5303, 12, 7, 502, 4163, 903, 95486, 674, 3871, 4358, 121137, 1528, 23, 38679, 2174, 83, 201505, 959, 4734, 1556, 1632, 12830, 116, 1286, 80854, 20779, 5117, 17932, 15490, 46741, 29117, 10336 ]
[ 0.1710205078125, 0.254638671875, 0.1131591796875, 0.1207275390625, 0.2374267578125, 0.011962890625, 0.05731201171875, 0.134033203125, 0.0029296875, 0.003814697265625, 0.1202392578125, 0.047210693359375, 0.04620361328125, 0.094970703125, 0.1136474609375, 0.1669921875, 0.01640319824218...
embed
47627159_c0
47627159
prolog
0
Title: Prolog: How to work with Global Array? Problem title: Prolog: How to work with Global Array? Tags: arrays, global-variables, swi-prolog, prolog Problem: Prolog: How to work with Global Array? In SWI Prolog, I need to keep marking in the same global array, how do I achieve it? My doubt is because, the global arra...
Prolog: How to work with Global Array? Prolog: How to work with Global Array? arrays global-variables swi-prolog prolog Prolog How Global Array Prolog: How to work with Global Array? In SWI Prolog, I need to keep marking in the same global array, how do I achieve it? My doubt is because, the global array will be overwr...
[ 0.029052734375, 0.0042724609375, 0.0020599365234375, 0.0137939453125, -0.01708984375, -0.0033721923828125, -0.023681640625, 0.030029296875, 0.004638671875, -0.01373291015625, 0.022216796875, 0.0120849609375, -0.01470947265625, -0.00885009765625, 0.0205078125, 0.0024871826171875, 0.01...
[ 1250, 4867, 11249, 4488, 678, 13453, 69253, 53, 10298, 4778, 7964, 21690, 19736, 2452, 3454, 502, 159, 38969, 3871, 13695, 16188, 214, 5701, 3642, 69307, 92814, 645, 5429, 75639, 11907, 6032, 28219, 84079, 33657, 140013, 19048, 26366 ]
[ 0.146728515625, 0.267578125, 0.0875244140625, 0.16015625, 0.118896484375, 0.216552734375, 0.2073974609375, 0.187255859375, 0.182373046875, 0.005279541015625, 0.2044677734375, 0.1309814453125, 0.062225341796875, 0.1148681640625, 0.0673828125, 0.07720947265625, 0.023193359375, 0.1822...
embed
46268357_c0
46268357
prolog
0
Title: How can I filter some numbers and make a new list in prolog Problem title: How can I filter some numbers and make a new list in prolog Tags: prolog Problem: How can I filter some numbers and make a new list in prolog I was trying to filter and make a new list. For example if I have list(3,[1,2,3,4,5],R) the resu...
How can I filter some numbers and make a new list in prolog How can I filter some numbers and make a new list in prolog prolog How Element Head Tail How can I filter some numbers and make a new list in prolog I was trying to filter and make a new list. For example if I have the result will be but I don't know why it do...
[ -0.0079345703125, 0.0189208984375, 0.00104522705078125, 0.0008697509765625, -0.0020294189453125, 0.017822265625, 0.0001544952392578125, 0.011474609375, 0.01708984375, 0.004150390625, 0.0179443359375, -0.01513671875, -0.01177978515625, 0.00982666015625, 0.005096435546875, -0.01141357421...
[ 11249, 831, 46312, 101935, 136, 3249, 3525, 5303, 502, 4867, 87, 23, 48325, 44816, 1218, 379, 31577, 16750, 3714, 15400, 22027, 18, 4488 ]
[ 0.0611572265625, 0.045684814453125, 0.246337890625, 0.1524658203125, 0.0303955078125, 0.08197021484375, 0.10491943359375, 0.1866455078125, 0.1275634765625, 0.206787109375, 0.0212554931640625, 0.032135009765625, 0.1678466796875, 0.143310546875, 0.1114501953125, 0.1199951171875, 0.0048...
embed
29039032_c2
29039032
prolog
2
1) ; (addX( X,SI*23,S),R = 23,SO= -1) ; (addX( X,SI*27,S),R = 27,SO= 1). c(X,S,R,SI,SO) :- (addX( X,SI*33,S),R=33,SO= 1) ; (addX( X,SI*47,S),R = 47,SO= 1) ; (addX( X,SI*45,S),R = 45,SO= 1). solve(Sum,Res3,Res4,Res5) :- e(Xe,Xd,Res5,1,SO5),d(Xd,Xc,Res4,SO5,SO4),c(Xc,Sum,Res3,SO4,SO3). Unfortunately this results in the f...
1) ; (addX( X,SI*23,S),R = 23,SO= -1) ; (addX( X,SI*27,S),R = 27,SO= 1). c(X,S,R,SI,SO) :- (addX( X,SI*33,S),R=33,SO= 1) ; (addX( X,SI*47,S),R = 47,SO= 1) ; (addX( X,SI*45,S),R = 45,SO= 1). solve(Sum,Res3,Res4,Res5) :- e(Xe,Xd,Res5,1,SO5),d(Xd,Xc,Res4,SO5,SO4),c(Xc,Sum,Res3,SO4,SO3). Unfortunately this results in the f...
[ -0.0023956298828125, 0.016845703125, 0.00421142578125, 0.0147705078125, -0.0152587890625, 0.014892578125, -0.00933837890625, 0.021240234375, 0.020263671875, 0.01202392578125, 0.005950927734375, -0.03076171875, 0.00994873046875, 0.005340576171875, 0.00311279296875, 0.0038299560546875, ...
[ 4879, 2819, 11, 4028, 1542, 1193, 9902, 1639, 3742, 294, 247, 1052, 2203, 24645, 13055, 110218, 3768, 30284, 1369, 501, 132, 15772, 4, 9185, 13330, 7657, 4633, 2678, 86869, 316, 4332, 7, 363, 617, 43317, 28, 71, 758, 29557, 21320, 18539...
[ 0.113525390625, 0.056396484375, 0.038116455078125, 0.162353515625, 0.2152099609375, 0.1405029296875, 0.1553955078125, 0.008758544921875, 0.162841796875, 0.0936279296875, 0.0186767578125, 0.1092529296875, 0.03546142578125, 0.146728515625, 0.162841796875, 0.0699462890625, 0.16015625, ...
embed
20775562_c0
20775562
prolog
0
Title: Unexpected behaviour of Prolog code Problem title: Unexpected behaviour of Prolog code Tags: prolog Problem: Unexpected behaviour of Prolog code I want to ask about this code , why List L2 keep it's values when functions start to return it's value from Recursion , it's like 'Holding' it self , i think that list ...
Unexpected behaviour of Prolog code Unexpected behaviour of Prolog code prolog Unexpected Prolog my_reverse my_rev Acc Unexpected behaviour of Prolog code I want to ask about this code , why List L2 keep it's values when functions start to return it's value from Recursion , it's like 'Holding' it self , i think that li...
[ -0.007293701171875, 0.026611328125, 0.0019989013671875, 0.01611328125, -0.0010986328125, 0.0027923583984375, 0.003021240234375, -0.000926971435546875, 0.015869140625, -0.0211181640625, 0.02978515625, 0.02587890625, 0.01416015625, 0.00653076171875, 0.03515625, 0.005645751953125, 0.012...
[ 992, 83613, 13, 89829, 224833, 1250, 4867, 18151, 502, 759, 107, 37676, 65381, 29899, 3444, 26458, 15400, 32036, 339, 304, 13695, 442, 142424, 3229, 32354, 4034, 30646, 34292, 1295, 165428, 42, 6889, 1884, 113251, 6238, 15970, 5351, 5303, 8...
[ 0.036407470703125, 0.0888671875, 0.090576171875, 0.05224609375, 0.1761474609375, 0.18017578125, 0.2396240234375, 0.1778564453125, 0.154296875, 0.1229248046875, 0.0958251953125, 0.2353515625, 0.21142578125, 0.135498046875, 0.009735107421875, 0.059356689453125, 0.10345458984375, 0.18...
embed
9288197_c0
9288197
prolog
0
Title: Predicate to check each element of the diagonal of matrix NxN Problem title: Predicate to check each element of the diagonal of matrix NxN Tags: prolog Problem: Predicate to check each element of the diagonal of matrix NxN I need to write a Prolog predicate to check if all element on the diagonal of matrix NxN i...
Predicate to check each element of the diagonal of matrix NxN Predicate to check each element of the diagonal of matrix NxN prolog Predicate NxN Predicate to check each element of the diagonal of matrix NxN I need to write a Prolog predicate to check if all element on the diagonal of matrix NxN is equal to the sum of a...
[ 0.004058837890625, 0.003631591796875, 0.004486083984375, 0.008056640625, -0.0101318359375, 0.01556396484375, 0.010986328125, 0.01806640625, 0.0308837890625, -0.0108642578125, 0.0198974609375, 0.018798828125, -0.0026092529296875, -0.0164794921875, -0.0157470703125, 0.0185546875, 0.018...
[ 7145, 2063, 67, 12765, 12638, 12830, 207997, 50944, 541, 425, 839, 111, 502, 4867, 47, 3871, 33022, 1250, 1653, 2174, 756, 98, 105950, 10554, 3789, 80854, 5701, 15555, 4358, 30019, 177953, 12301 ]
[ 0.14892578125, 0.1669921875, 0.084228515625, 0.2308349609375, 0.1317138671875, 0.2080078125, 0.2088623046875, 0.1414794921875, 0.0399169921875, 0.139404296875, 0.174072265625, 0.0160675048828125, 0.1239013671875, 0.18701171875, 0.0137939453125, 0.01861572265625, 0.035430908203125, ...
embed
58147564_c1
58147564
prolog
1
timetable([a,[C1,S1,T1],b,[C2,S2,T2],c,[C3,S3,T3],d,[C4,S4,T4]],List1):- teacher_pref(T1,C1), teacher_pref(T2,C2), teacher_pref(T3,C3), teacher_pref(T4,C4), prefers(S1,C1), prefers(S2,C2), S1\\=S2, prefers(S3,C3), S1\\=S3, S2\\=S3, prefers(S4,C4), S1\\=S4, S2\\=S4, S3\\=S4, addToList(List1,C):- teacher_pref(mike,C). s...
timetable([a,[C1,S1,T1],b,[C2,S2,T2],c,[C3,S3,T3],d,[C4,S4,T4]],List1):- teacher_pref(T1,C1), teacher_pref(T2,C2), teacher_pref(T3,C3), teacher_pref(T4,C4), prefers(S1,C1), prefers(S2,C2), S1\\=S2, prefers(S3,C3), S1\\=S3, S2\\=S3, prefers(S4,C4), S1\\=S4, S2\\=S4, S3\\=S4, addToList(List1,C):- teacher_pref(mike,C). s...
[ 0.0218505859375, 0.0052490234375, 0.00080108642578125, -0.001953125, -0.0167236328125, -0.0235595703125, -0.029296875, -0.0025634765625, -0.01324462890625, -0.041015625, 0.004364013671875, 0.00726318359375, -0.000812530517578125, 0.0020904541015625, -0.0233154296875, 0.013671875, -0....
[ 1733, 22819, 11, 441, 418, 294, 618, 76172, 275, 304, 238, 363, 71, 617, 154663, 17727, 12, 117914, 4692, 420, 10461, 21320, 29557, 12601, 159, 15190, 7763, 266, 350, 56002, 147834, 1528, 944, 1294, 6032, 28864, 26073, 1250, 4867, 32036, ...
[ 0.1937255859375, 0.26123046875, 0.026947021484375, 0.02703857421875, 0.05889892578125, 0.049530029296875, 0.04705810546875, 0.0321044921875, 0.038330078125, 0.06524658203125, 0.0157012939453125, 0.10302734375, 0.039215087890625, 0.12353515625, 0.1717529296875, 0.061981201171875, 0.00...
embed
8959280_c0
8959280
prolog
0
Title: How to check if there&#x27;s two facts that represent the same in prolog Problem title: How to check if there&#x27;s two facts that represent the same in prolog Tags: prolog Problem: How to check if there's two facts that represent the same in prolog I'm having trouble understanding this. Suppose I have: person(...
How to check if there&#x27;s two facts that represent the same in prolog How to check if there&#x27;s two facts that represent the same in prolog prolog How How to check if there's two facts that represent the same in prolog I'm having trouble understanding this. Suppose I have: Is there a way in which I can prove that...
[ 0.0155029296875, 0.007049560546875, 0.006683349609375, 0.0286865234375, -0.009521484375, -0.01019287109375, -0.00555419921875, 0.006805419921875, 0.0103759765625, -0.0390625, 0.0023956298828125, 0.0281982421875, -0.000713348388671875, 0.0030670166015625, -0.0137939453125, 0.00045394897...
[ 11249, 47, 12765, 2174, 2685, 3768, 7, 6626, 15824, 450, 33636, 5701, 23, 502, 4867, 63134, 100094, 121691, 3917, 23534, 110, 3445, 765, 9351, 37842, 76199, 20174 ]
[ 0.05621337890625, 0.050506591796875, 0.1964111328125, 0.0869140625, 0.06207275390625, 0.04608154296875, 0.08453369140625, 0.1650390625, 0.1845703125, 0.049468994140625, 0.2181396484375, 0.1868896484375, 0.0931396484375, 0.161865234375, 0.21484375, 0.002838134765625, 0.014678955078125...
embed
39862265_c0
39862265
prolog
0
Title: Remove leading s(s(0)) in list Problem title: Remove leading s(s(0)) in list Tags: prolog-coroutining, prolog Problem: Remove leading s(s(0)) in list (This is a followup to that question ). How to write lead1(Xs,Ys) which is true, iff Ys is a suffix of Xs with all leading s(s(0)) terms removed. Thus instead of r...
Remove leading s(s(0)) in list Remove leading s(s(0)) in list prolog-coroutining prolog Remove lead1 Remove leading s(s(0)) in list (This is a followup to that question ). How to write lead1(Xs,Ys) which is true, iff Ys is a suffix of Xs with all leading s(s(0)) terms removed. Thus instead of removing leading 0 s this ...
[ 0.0233154296875, 0.01104736328125, -0.0172119140625, 0.00396728515625, -0.006439208984375, -0.0301513671875, 0.0101318359375, 0.01251220703125, 0.0267333984375, -0.00726318359375, 0.00946044921875, 0.0135498046875, -0.01129150390625, -0.004180908203125, 0.035400390625, 0.00340270996093...
[ 181139, 105207, 91, 132, 7, 177609, 23, 5303, 502, 4867, 10517, 6056, 14653, 37105, 418, 2037, 11249, 47, 33022, 1542, 4, 1723, 3129, 29568, 32920, 990, 133784, 425, 111, 1193, 756, 69407, 184750, 64457, 49146, 6496, 757, 9655, 34844, 53,...
[ 0.1839599609375, 0.223388671875, 0.2205810546875, 0.0648193359375, 0.1400146484375, 0.2493896484375, 0.0804443359375, 0.2142333984375, 0.120361328125, 0.1644287109375, 0.021026611328125, 0.0823974609375, 0.0841064453125, 0.24853515625, 0.14501953125, 0.002288818359375, 0.047607421875...
embed
10066275_c0
10066275
prolog
0
Title: Incrementing elements in SWI-Prolog Problem title: Incrementing elements in SWI-Prolog Tags: prolog, increment Problem: Incrementing elements in SWI-Prolog Well, since I'm practising "the Prolog logic" today and I found this unanswered problem in another thread here, I was wondering how it works. increment every...
Incrementing elements in SWI-Prolog Incrementing elements in SWI-Prolog prolog increment Incrementing SWI-Prolog Incrementing elements in SWI-Prolog Well, since I'm practising "the Prolog logic" today and I found this unanswered problem in another thread here, I was wondering how it works. And I almost thought that I l...
[ 0.018310546875, 0.019287109375, 0.002960205078125, 0.02685546875, 0.0023956298828125, 0.00482177734375, -0.00518798828125, -0.007415771484375, -0.00982666015625, -0.026611328125, 0.01123046875, -0.00433349609375, -0.0242919921875, 0.0244140625, 0.01806640625, -0.01275634765625, 0.013...
[ 8942, 107, 674, 214, 80854, 159, 38969, 10752, 4867, 502, 158661, 23, 17823, 1250, 62775, 18925, 1779, 6488, 2967, 86997, 149016, 3642, 43240, 39555, 17569, 1884, 46876, 32559, 9844, 450, 7722, 22362 ]
[ 0.139892578125, 0.1710205078125, 0.1729736328125, 0.0232696533203125, 0.2188720703125, 0.0911865234375, 0.223876953125, 0.149658203125, 0.22509765625, 0.139404296875, 0.252685546875, 0.018707275390625, 0.00701904296875, 0.1182861328125, 0.1474609375, 0.0161285400390625, 0.00479125976...
embed
35524997_c0
35524997
prolog
0
Title: check the list of numbers different more than one in prolog Problem title: check the list of numbers different more than one in prolog Tags: clpfd, prolog, list Problem: check the list of numbers different more than one in prolog I have a list of numbers in prolog. the numbers are already sorted.I want to check ...
check the list of numbers different more than one in prolog check the list of numbers different more than one in prolog clpfd prolog list check the list of numbers different more than one in prolog I have a list of numbers in prolog. the numbers are already sorted.I want to check any of the numbers are not repeated and...
[ -0.002197265625, -0.00185394287109375, -0.004669189453125, 0.0220947265625, -0.00433349609375, 0.0079345703125, -0.005126953125, 0.0133056640625, 0.0225830078125, 0.018798828125, 0.0101318359375, 0.0042724609375, -0.0076904296875, 0.00958251953125, 0.01324462890625, 0.00762939453125, ...
[ 12765, 5303, 111, 101935, 12921, 1286, 3501, 1632, 23, 502, 4867, 33139, 39557, 71, 21771, 17497, 3444, 47, 2499, 959, 119140, 17721, 6626, 117396, 442, 82449, 3355, 47107, 98320, 135461, 963, 29568 ]
[ 0.1982421875, 0.155517578125, 0.053070068359375, 0.1663818359375, 0.2342529296875, 0.1328125, 0.1119384765625, 0.1158447265625, 0.09228515625, 0.166015625, 0.224853515625, 0.008026123046875, 0.0250244140625, 0.08642578125, 0.043701171875, 0.1424560546875, 0.011444091796875, 0.03414...
embed
68428264_c0
68428264
prolog
0
Title: Relationship between not found, dif, and \+ Problem title: Relationship between not found, dif, and \+ Tags: prolog Problem: Relationship between not found, dif, and \+ Conceptually what's the relationship between false , dif , and \+ . Given this program: likes(john, mary). What is being asked exactly when exec...
Relationship between not found, dif, and \+ Relationship between not found, dif, and \+ prolog Relationship Relationship between not found, dif, and \+ Conceptually what's the relationship between false , dif , and \+ . Given this program: What is being asked exactly when executing the query: And why is the answer not:...
[ 0.00848388671875, 0.0211181640625, 0.01092529296875, 0.020263671875, -0.031494140625, 0.0064697265625, 0.0093994140625, 0.0167236328125, 0.027587890625, 0.0086669921875, -0.018310546875, -0.00433349609375, 0.00083160400390625, 0.017578125, 0.0191650390625, 0.007781982421875, 0.014526...
[ 116822, 16070, 17721, 959, 14037, 45755, 41872, 1328, 502, 4867, 136, 128182, 76755, 98320, 1528, 4865, 8035, 37170, 66161, 3229, 71924, 41, 1294, 15400, 83, 35166, 1286, 5351, 122991, 18, 28219, 91084, 108, 125682, 1250 ]
[ 0.1658935546875, 0.0933837890625, 0.05999755859375, 0.2032470703125, 0.216552734375, 0.254638671875, 0.06109619140625, 0.1734619140625, 0.1302490234375, 0.234375, 0.00787353515625, 0.0616455078125, 0.18994140625, 0.255126953125, 0.1097412109375, 0.0214691162109375, 0.0240325927734375...
embed
73905939_c0
73905939
prolog
0
Title: Prolog Termination of Generated List Problem title: Prolog Termination of Generated List Tags: prolog, non-termination, clpfd, list Problem: Prolog Termination of Generated List N #>= 0, N #< 3, length(Ls, N), false. The expression above does not terminate when posted on the swi prolog terminal. I have tried exc...
Prolog Termination of Generated List Prolog Termination of Generated List prolog non-termination clpfd list Prolog Termination Generated List Prolog Termination of Generated List The expression above does not terminate when posted on the swi prolog terminal. I have tried exchanging the order of goals. and I am using SW...
[ 0.01519775390625, 0.0230712890625, -0.000957489013671875, -0.0034027099609375, -0.013427734375, -0.00732421875, 0.015625, 0.0042724609375, 0.003448486328125, -0.02099609375, -0.004791259765625, -0.01068115234375, 0.00445556640625, 0.0234375, 0.00933837890625, 0.00897216796875, 0.0300...
[ 1250, 4867, 27366, 2320, 155370, 3674, 32036, 111, 502, 351, 720, 91407, 39557, 71, 5303, 125195, 36917, 14602, 959, 121011, 3229, 44183, 91, 2452, 33949, 37842, 1119, 90965, 12989, 109458, 159, 38969, 10752, 11389, 3217, 158406, 15276, 13307...
[ 0.14892578125, 0.224365234375, 0.2164306640625, 0.01092529296875, 0.127685546875, 0.001434326171875, 0.19189453125, 0.0230712890625, 0.1195068359375, 0.07513427734375, 0.128662109375, 0.0721435546875, 0.0262908935546875, 0.05810546875, 0.15478515625, 0.19873046875, 0.078369140625, ...
embed
16424362_c0
16424362
prolog
0
Title: Find a missing number in a list Problem title: Find a missing number in a list Tags: prolog Problem: Find a missing number in a list Say I have a List [2,1,4,5] , I would like to have a predicate that returns 3 as the missing element. missing([], []). missing([H|T], R) :- missing([H|T], H, R). missing([], _I, []...
Find a missing number in a list Find a missing number in a list prolog Find NextI Find a missing number in a list Say I have a List [2,1,4,5] , I would like to have a predicate that returns 3 as the missing element. but it doesnt work with unsorted lists.
[ -0.0201416015625, 0.0135498046875, 0.016357421875, 0.005889892578125, -0.006622314453125, 0.0179443359375, 0.005340576171875, 0.0179443359375, 0.007171630859375, -0.0341796875, 0.010986328125, 0.00048065185546875, -0.0196533203125, 0.0147705078125, 0.006011962890625, 0.015869140625, ...
[ 26040, 10, 132283, 14012, 23, 5303, 502, 4867, 4997, 568, 25916, 765, 32036, 304, 418, 80389, 2806, 1884, 1653, 2063, 67, 30646, 138, 237, 12830, 22027, 18, 4488, 51, 62351 ]
[ 0.1280517578125, 0.05596923828125, 0.237060546875, 0.2264404296875, 0.08453369140625, 0.22021484375, 0.1278076171875, 0.1754150390625, 0.1903076171875, 0.12176513671875, 0.0286102294921875, 0.053497314453125, 0.1676025390625, 0.05462646484375, 0.01122283935546875, 0.1806640625, 0.028...
embed
1445338_c0
1445338
prolog
0
Title: How to define a relative rule in Prolog? Problem title: How to define a relative rule in Prolog? Tags: prolog Problem: How to define a relative rule in Prolog? How to define a relative rule in Prolog? This is what I got so far: spouce(X,Y) :- wife(X,Y). spouce(X,Y) :- husband(X,Y). relative-by-blood(X,Y) :- ance...
How to define a relative rule in Prolog? How to define a relative rule in Prolog? prolog How Prolog How to define a relative rule in Prolog? How to define a relative rule in Prolog? This is what I got so far: Thanks in advance!
[ 0.0147705078125, 0.0196533203125, 0.011962890625, 0.0361328125, -0.00921630859375, 0.003082275390625, -0.00823974609375, -0.00250244140625, -0.005523681640625, -0.038330078125, -0.0034637451171875, -0.033203125, -0.0019683837890625, 0.007781982421875, 0.00860595703125, 0.0147705078125,...
[ 11249, 61924, 35845, 79986, 23, 1250, 4867, 10, 502, 47, 2060, 129745 ]
[ 0.03668212890625, 0.1812744140625, 0.253662109375, 0.24267578125, 0.049072265625, 0.1409912109375, 0.2286376953125, 0.040496826171875, 0.0635986328125, 0.0064849853515625, 0.017822265625, 0.032257080078125 ]
embed
27292167_c1
27292167
prolog
1
([Meet1], [Combpersons], T), append(T, U, Z); ...no match code here..). However my code keeps ending prematurely with a false when I try to change or add appends like this in the first block of code I put here. Even a change such as turning append([First], U, Z) into append([Meet1], U, Z) makes my code end with a false...
([Meet1], [Combpersons], T), append(T, U, Z); ...no match code here..). However my code keeps ending prematurely with a false when I try to change or add appends like this in the first block of code I put here. Even a change such as turning append([First], U, Z) into append([Meet1], U, Z) makes my code end with a false...
[ -0.011962890625, 0.039306640625, 0.00153350830078125, 0.01287841796875, -0.013427734375, -0.004302978515625, 0.01025390625, 0.01165771484375, 0.0439453125, -0.015380859375, -0.00131988525390625, 0.00604248046875, 0.02685546875, 0.0194091796875, 0.00494384765625, -0.00086212158203125, ...
[ 6696, 126, 76172, 10770, 275, 30816, 7, 384, 114689, 71, 618, 345, 567, 157, 14858, 18151, 3688, 33306, 759, 13695, 86658, 170176, 21286, 678, 98320, 9790, 15549, 15190, 6468, 1884, 903, 5117, 46389, 3884, 174548, 207263, 268, 3934, 30482, ...
[ 0.14599609375, 0.1312255859375, 0.084228515625, 0.073974609375, 0.083251953125, 0.2027587890625, 0.03265380859375, 0.07769775390625, 0.1636962890625, 0.089599609375, 0.05914306640625, 0.0916748046875, 0.10662841796875, 0.0775146484375, 0.176025390625, 0.2127685546875, 0.07421875, 0...
embed
55925460_c0
55925460
prolog
0
Title: How to count only the number elements in a list (PROLOG), except _? Problem title: How to count only the number elements in a list (PROLOG), except _? Tags: list, prolog Problem: How to count only the number elements in a list (PROLOG), except _? This code give me the number of zeros that is in a list. But if my...
How to count only the number elements in a list (PROLOG), except _? How to count only the number elements in a list (PROLOG), except _? list prolog How PROLOG How to count only the number elements in a list (PROLOG), except _? This code give me the number of zeros that is in a list. But if my list is [0,_,0,0,_] the co...
[ -0.005889892578125, 0.01092529296875, 0.005126953125, 0.000244140625, 0.00469970703125, 0.0186767578125, -0.0045166015625, 0.01446533203125, 0.004730224609375, -0.01123046875, -0.00494384765625, -0.045654296875, 0.0029449462890625, 0.0142822265625, 0.01806640625, -0.018798828125, 0.0...
[ 11249, 47, 54529, 4734, 14012, 80854, 23, 5303, 47970, 47510, 40494, 101, 502, 4867, 10514, 70, 18151, 8337, 163, 45234, 7, 4966, 2174, 759, 83, 2389, 63527, 454, 17378, 2685, 190, 30022, 2967 ]
[ 0.043670654296875, 0.04864501953125, 0.213623046875, 0.1612548828125, 0.195068359375, 0.205322265625, 0.051239013671875, 0.211181640625, 0.1458740234375, 0.2408447265625, 0.1676025390625, 0.0330810546875, 0.1290283203125, 0.198486328125, 0.1590576171875, 0.043731689453125, 0.13696289...
embed
58897193_c0
58897193
prolog
0
Title: Prolog DCG select distinct items Problem title: Prolog DCG select distinct items Tags: prolog, dcg Problem: Prolog DCG select distinct items I am trying to write a prolog DCG to pick 2 distinct colours in a list, see code below. colour --> [red]. colour --> [blue]. colour --> [green]. ... pick2colours --> colour...
Prolog DCG select distinct items Prolog DCG select distinct items prolog dcg Prolog DCG pick2colours Prolog DCG select distinct items I am trying to write a prolog DCG to pick 2 distinct colours in a list, see code below. The actual version of the code does not garanty the two colours to be distinct. I don't know how t...
[ -0.0025177001953125, -0.0203857421875, -0.001739501953125, 0.0223388671875, 0.00799560546875, 0.019287109375, -0.008544921875, 0.00109100341796875, 0.01531982421875, -0.015869140625, 0.005157470703125, 0.0021514892578125, 0.038330078125, 0.0223388671875, -0.01336669921875, 0.0285644531...
[ 1250, 4867, 391, 56367, 36849, 117781, 55769, 502, 104, 238, 177, 39580, 304, 22796, 31577, 33022, 116, 134855, 23, 5303, 1957, 18151, 35064, 8561, 11389, 959, 22807, 53, 6626, 186, 3714, 86869, 2967 ]
[ 0.1158447265625, 0.2161865234375, 0.0654296875, 0.21728515625, 0.16455078125, 0.197265625, 0.164306640625, 0.099853515625, 0.0123291015625, 0.0242156982421875, 0.05731201171875, 0.1605224609375, 0.1029052734375, 0.1273193359375, 0.0662841796875, 0.0927734375, 0.1116943359375, 0.218...
embed
16026907_c0
16026907
prolog
0
Title: Adding two params of a predicate that aren&#x27;t static Problem title: Adding two params of a predicate that aren&#x27;t static Tags: arithmetic-expressions, prolog, math Problem: Adding two params of a predicate that aren't static I'm trying to add two numbers together add(num1, num2, output) :- output is num1...
Adding two params of a predicate that aren&#x27;t static Adding two params of a predicate that aren&#x27;t static arithmetic-expressions prolog math Adding num1 num2 instantiation_error Adding two params of a predicate that aren't static I'm trying to add two numbers together Let's say X is 1 and Y is 3, but they're no...
[ 0.00506591796875, -0.0031890869140625, 0.004150390625, -0.0057373046875, -0.00604248046875, 0.045654296875, 0.00103759765625, -0.007232666015625, 0.000614166259765625, -0.035888671875, 0.027099609375, -0.0164794921875, -0.01422119140625, -0.00119781494140625, 0.031494140625, -0.0173339...
[ 62, 59725, 6626, 121, 4432, 1653, 2063, 67, 450, 125381, 3768, 18, 201939, 111, 8962, 204629, 502, 4867, 48909, 13269, 418, 304, 34648, 14, 2320, 188800, 31577, 15190, 101935, 25842, 1193, 83, 106, 136, 990, 138, 959, 77336, 1542, 1810, ...
[ 0.13037109375, 0.1195068359375, 0.221923828125, 0.181640625, 0.1820068359375, 0.1798095703125, 0.2122802734375, 0.1053466796875, 0.03363037109375, 0.1131591796875, 0.06890869140625, 0.143798828125, 0.2216796875, 0.033935546875, 0.07257080078125, 0.1331787109375, 0.09954833984375, 0...
embed
47576976_c0
47576976
prolog
0
Title: Why does Prolog predicate member/2 print an extra whitespace in output? Problem title: Why does Prolog predicate member/2 print an extra whitespace in output? Tags: prolog, prolog-toplevel Problem: Why does Prolog predicate member/2 print an extra whitespace in output? I really don't understand why Prolog prints...
Why does Prolog predicate member/2 print an extra whitespace in output? Why does Prolog predicate member/2 print an extra whitespace in output? prolog prolog-toplevel Why Prolog Why does Prolog predicate member/2 print an extra whitespace in output? I really don't understand why Prolog prints a single whitespace after ...
[ 0.0125732421875, -0.000017642974853515625, 0.01239013671875, 0.0174560546875, -0.0255126953125, 0.0115966796875, 0.0162353515625, 0.01239013671875, -0.01171875, -0.006591796875, 0.0147705078125, -0.00372314453125, -0.005126953125, -0.01007080078125, 0.00189208984375, -0.00537109375, ...
[ 44084, 1250, 4867, 1653, 2063, 67, 32786, 12477, 28412, 4173, 35011, 65421, 140992, 502, 13784, 67919, 142, 28219, 15400, 11001, 7103, 4734, 130250, 132442, 116666 ]
[ 0.109375, 0.150634765625, 0.2381591796875, 0.13623046875, 0.163330078125, 0.0615234375, 0.1982421875, 0.1937255859375, 0.18212890625, 0.1435546875, 0.1597900390625, 0.249755859375, 0.181396484375, 0.075927734375, 0.035064697265625, 0.1109619140625, 0.002777099609375, 0.066467285156...
embed
52902472_c0
52902472
prolog
0
Title: confused how to go about using \= when updating a knowledge base Problem title: confused how to go about using \= when updating a knowledge base Tags: prolog Problem: confused how to go about using \= when updating a knowledge base Swi-prolog syntax questions; I'm pretty confused how to go about using \= when up...
confused how to go about using \= when updating a knowledge base confused how to go about using \= when updating a knowledge base prolog Song confused how to go about using \= when updating a knowledge base Swi-prolog syntax questions; I'm pretty confused how to go about using \= when updating a knowledge base. I'm wri...
[ -0.005340576171875, 0.00848388671875, 0.01019287109375, 0.007080078125, 0.008544921875, 0.00150299072265625, 0.000095367431640625, 0.007354736328125, 0.006439208984375, 0.011474609375, -0.0174560546875, 0.007354736328125, 0.0028839111328125, -0.004791259765625, 0, 0.01336669921875, -...
[ 55681, 5281, 3642, 738, 1672, 17368, 41872, 1369, 3229, 1257, 56464, 51359, 3647, 502, 4867, 5986, 47, 10, 105432, 3454, 6002, 86531, 17582, 28875, 32562, 1653, 2063, 3444, 28412, 1810, 756, 52336, 1185, 33, 831, 51339, 40494, 28192, 21718,...
[ 0.1766357421875, 0.1162109375, 0.09100341796875, 0.0401611328125, 0.1138916015625, 0.12158203125, 0.2265625, 0.2685546875, 0.08935546875, 0.1798095703125, 0.225341796875, 0.1744384765625, 0.220458984375, 0.186767578125, 0.2144775390625, 0.2041015625, 0.037841796875, 0.0016174316406...
embed
65722678_c1
65722678
prolog
1
-F-J-N, Z3 = [C,G,K,O], all_different(Z3), C =:= 15-G-K-O, Z4 = [E,F,G], all_different(Z4), E =:= 11-F-G, Z5 = [A,E], all_different(Z5), E =:= 17-A, Z6 = [J,K,L], all_different(Z6), J =:=22-K-L, A1 = [N,O,P], all_different(A1), N =:= 14-O-P, A2 = [L,P], all_different(A2), L =:=13-P, labeling([], L). Also how do I start...
-F-J-N, Z3 = [C,G,K,O], all_different(Z3), C =:= 15-G-K-O, Z4 = [E,F,G], all_different(Z4), E =:= 11-F-G, Z5 = [A,E], all_different(Z5), E =:= 17-A, Z6 = [J,K,L], all_different(Z6), J =:=22-K-L, A1 = [N,O,P], all_different(A1), N =:= 14-O-P, A2 = [L,P], all_different(A2), L =:=13-P, labeling([], L). Also how do I start...
[ 0.0029296875, -0.0024261474609375, -0.0064697265625, 0.04443359375, -0.0108642578125, 0.02099609375, -0.01708984375, 0.007080078125, 0.0181884765625, -0.0155029296875, 0.0098876953125, -0.00162506103515625, 0.01239013671875, 0.02001953125, -0.0211181640625, 0.006103515625, -0.0015411...
[ 919, 9, 1375, 839, 567, 363, 2203, 441, 724, 605, 670, 756, 238778, 1511, 21320, 313, 17659, 617, 29557, 241, 19586, 758, 43317, 26879, 284, 910, 821, 207234, 866, 62, 541, 25055, 339, 27495, 67967, 214, 3642, 54, 87, 4034, 70, 6496, ...
[ 0.10546875, 0.041473388671875, 0.181884765625, 0.1171875, 0.11474609375, 0.1461181640625, 0.088134765625, 0.0174560546875, 0.07470703125, 0.031982421875, 0.089599609375, 0.117919921875, 0.21240234375, 0.07586669921875, 0.10150146484375, 0.0400390625, 0.1322021484375, 0.123168945312...
embed
4416656_c1
4416656
prolog
1
),member(End,S),!. solve1([P|O],End,Visited,Path):-(not(member(P,Visited)),children(P,S),append(O,S,O1),solve1(O1,End,Visited,Path)); (solve1(O,End,Visited,Path)). ?-should be the list with path to destination Node The only problem is that i don't know how to return the path to the destination node. Thank's ahead. Code...
),member(End,S),!. solve1([P|O],End,Visited,Path):-(not(member(P,Visited)),children(P,S),append(O,S,O1),solve1(O1,End,Visited,Path)); (solve1(O,End,Visited,Path)). ?-should be the list with path to destination Node The only problem is that i don't know how to return the path to the destination node. Thank's ahead. Code...
[ 0.01104736328125, 0.01220703125, 0.02197265625, 0.0155029296875, -0.00396728515625, 0.0101318359375, -0.020751953125, -0.0206298828125, 0.0096435546875, -0.055419921875, 0.01153564453125, 0.009033203125, -0.00055694580078125, 0.00994873046875, 0.00634765625, -0.031005859375, 0.008422...
[ 247, 39, 27417, 152378, 294, 38, 86869, 418, 683, 58745, 670, 65331, 14, 3674, 10519, 10869, 237052, 3611, 17727, 86918, 705, 11412, 52366, 186, 70, 5303, 678, 60875, 47, 78869, 438, 112, 4734, 2967, 3714, 3642, 30646, 110, 25689, 28864, ...
[ 0.0206756591796875, 0.052398681640625, 0.201416015625, 0.185302734375, 0.0660400390625, 0.07904052734375, 0.2099609375, 0.050048828125, 0.04815673828125, 0.05633544921875, 0.12451171875, 0.1478271484375, 0.1156005859375, 0.1446533203125, 0.163818359375, 0.09600830078125, 0.1583251953...
embed
46851223_c0
46851223
prolog
0
Title: Given that the first of the month is a monday, define a predicate to print the day for any date in a month using list in prolog Problem title: Given that the first of the month is a monday, define a predicate to print the day for any date in a month using list in prolog Tags: list, prolog Problem: Given that the...
Given that the first of the month is a monday, define a predicate to print the day for any date in a month using list in prolog Given that the first of the month is a monday, define a predicate to print the day for any date in a month using list in prolog list prolog list Given Num Name Monday Tuesday Wednesday Thursda...
[ 0.01177978515625, -0.0220947265625, 0.0172119140625, 0.0341796875, -0.0140380859375, 0.0177001953125, 0.00182342529296875, 0.0194091796875, -0.0064697265625, 0.002593994140625, -0.0003833770751953125, 0.01251220703125, -0.0252685546875, -0.01348876953125, -0.00836181640625, 0.017211914...
[ 5117, 111, 31150, 149550, 53, 61924, 1653, 2063, 67, 47, 28412, 5155, 100, 2499, 5622, 17368, 5303, 23, 502, 4867, 83, 10, 77878, 52782, 15757, 68318, 97001, 64227, 103616, 41626, 72864, 52305, 3917, 20653, 79786, 112892, 1029, 35166 ]
[ 0.1470947265625, 0.09521484375, 0.1724853515625, 0.1619873046875, 0.09259033203125, 0.15478515625, 0.193115234375, 0.2200927734375, 0.139404296875, 0.03411865234375, 0.218994140625, 0.16357421875, 0.083740234375, 0.1026611328125, 0.1529541015625, 0.02423095703125, 0.1754150390625, ...
embed
3279441_c0
3279441
prolog
0
Title: Counting definite clause grammar recursions in Prolog Problem title: Counting definite clause grammar recursions in Prolog Tags: grammar, prolog, dcg Problem: Counting definite clause grammar recursions in Prolog I have the following Prolog definite clause grammar: s-->[a],s,[b]. s-->[]. This will result in word...
Counting definite clause grammar recursions in Prolog Counting definite clause grammar recursions in Prolog grammar prolog dcg Counting Prolog Counting definite clause grammar recursions in Prolog I have the following Prolog definite clause grammar: This will result in words like [a,a,b,b] being accepted in opposite to...
[ 0.0126953125, -0.00142669677734375, -0.006378173828125, 0.02099609375, 0.00830078125, 0.021484375, -0.00543212890625, -0.00457763671875, 0.00494384765625, -0.034912109375, -0.0201416015625, -0.0267333984375, -0.00830078125, 0.01513671875, 0.0419921875, 0.004730224609375, 0.0075073242...
[ 1311, 128396, 71496, 13, 70731, 122092, 147, 195625, 17514, 1250, 4867, 502, 238, 177, 25632, 1221, 16750, 34153, 1884, 275, 68186, 198274, 128019, 171259, 10, 8353, 19, 876, 3444, 30646, 653, 47, 38937, 74481, 67 ]
[ 0.109130859375, 0.13916015625, 0.19580078125, 0.091552734375, 0.1954345703125, 0.136474609375, 0.1036376953125, 0.2203369140625, 0.0943603515625, 0.15380859375, 0.2412109375, 0.0665283203125, 0.009246826171875, 0.000030517578125, 0.01385498046875, 0.003936767578125, 0.057220458984375...
embed
9436192_c0
9436192
prolog
0
Title: hex string from list of integers in swi-prolog Problem title: hex string from list of integers in swi-prolog Tags: sha, swi-prolog, prolog, hex Problem: hex string from list of integers in swi-prolog wondering if there's a library call somewhere to convert the crypto libs sha1 return format 15 ?- sha_hash('howdy...
hex string from list of integers in swi-prolog hex string from list of integers in swi-prolog sha swi-prolog prolog hex list sha_hash atom_codes hex string from list of integers in swi-prolog wondering if there's a library call somewhere to convert the crypto libs sha1 return format want to convert X to format like "A3...
[ -0.004669189453125, -0.00555419921875, 0.007537841796875, 0.020263671875, -0.0341796875, -0.0106201171875, -0.003021240234375, 0.0179443359375, -0.0017547607421875, 0.000690460205078125, 0.01953125, -0.00445556640625, 0.00830078125, 0.011962890625, -0.004180908203125, -0.011962890625, ...
[ 764, 425, 79315, 1295, 5303, 892, 26255, 91, 2452, 3454, 4867, 9638, 502, 126234, 34627, 40899, 149016, 35773, 1294, 11782, 96760, 215637, 25474, 418, 30646, 9384, 1193, 284, 10289, 136442, 919, 2485 ]
[ 0.1708984375, 0.1558837890625, 0.2318115234375, 0.05426025390625, 0.1318359375, 0.1226806640625, 0.05035400390625, 0.0296630859375, 0.1634521484375, 0.0997314453125, 0.1746826171875, 0.156982421875, 0.101806640625, 0.1248779296875, 0.135498046875, 0.13330078125, 0.0540771484375, 0....
embed
27543066_c0
27543066
prolog
0
Title: Check occurrence in Prolog Problem title: Check occurrence in Prolog Tags: prolog Problem: Check occurrence in Prolog I want to write a predicate occurs(Var, Term) that succeeds if the Prolog variable Var occurs in the Prolog term Term , and fails otherwise. % occurs(Var, Term) ?- occurs(X, f(X)). true. ?- occur...
Check occurrence in Prolog Check occurrence in Prolog prolog Check Prolog Term contains_term Check occurrence in Prolog I want to write a predicate occurs(Var, Term) that succeeds if the Prolog variable Var occurs in the Prolog term Term , and fails otherwise. I was thinking about such a thing but i want another soluti...
[ 0.0103759765625, 0.01141357421875, 0.009033203125, 0.01611328125, 0.004058837890625, 0.01129150390625, 0.001556396484375, 0.0126953125, -0.01092529296875, -0.058349609375, 0.01007080078125, 0.0079345703125, -0.0179443359375, 0.00106048583984375, 0.0181884765625, 0.00116729736328125, ...
[ 38679, 74918, 42, 23, 1250, 4867, 502, 2994, 39, 70541, 32166, 6620, 3444, 33022, 1653, 2063, 7, 81827, 214493, 77336, 3323, 13579, 35782 ]
[ 0.193603515625, 0.1904296875, 0.1390380859375, 0.05938720703125, 0.1669921875, 0.247314453125, 0.114990234375, 0.1533203125, 0.08740234375, 0.1629638671875, 0.1744384765625, 0.0255889892578125, 0.007537841796875, 0.0311279296875, 0.075439453125, 0.09814453125, 0.008331298828125, 0....
embed
36269528_c0
36269528
prolog
0
Title: Visualizing prolog rule dependencies Problem title: Visualizing prolog rule dependencies Tags: visualization, code-analysis, graphviz, prolog Problem: Visualizing prolog rule dependencies I have a prolog program that has some rather complicated recursive logic. I'd like to visualize the dependency of the rules t...
Visualizing prolog rule dependencies Visualizing prolog rule dependencies visualization code-analysis graphviz prolog Visualizing Visualizing prolog rule dependencies I have a prolog program that has some rather complicated recursive logic. I'd like to visualize the dependency of the rules to better understand the prog...
[ 0.0162353515625, 0.0159912109375, -0.0076904296875, 0.0118408203125, 0.01031494140625, 0.037841796875, -0.0245361328125, -0.000316619873046875, 0.00787353515625, -0.0244140625, 0.009765625, -0.00066375732421875, -0.0123291015625, 0.0206298828125, 0.01953125, 0.0062255859375, 0.003906...
[ 73372, 84382, 502, 4867, 79986, 42548, 117538, 21176, 47691, 18151, 174976, 41382, 22572, 1528, 43257, 96704, 195625, 5844, 62775, 1884, 20650, 27771, 91736, 11522, 28219, 19537, 939, 831, 96760, 6524, 11727, 6609, 169, 11435, 1653, 2063, 70541...
[ 0.1817626953125, 0.081787109375, 0.13037109375, 0.2188720703125, 0.168701171875, 0.1851806640625, 0.060272216796875, 0.1778564453125, 0.1082763671875, 0.05780029296875, 0.07061767578125, 0.10009765625, 0.181640625, 0.1241455078125, 0.0123291015625, 0.06268310546875, 0.07366943359375,...
embed
19093704_c0
19093704
prolog
0
Title: Are relations built in to Prolog? Problem title: Are relations built in to Prolog? Tags: prolog Problem: Are relations built in to Prolog? I know this is probably a stupid question, but I'm just reading the first chapter of Bratko Prolog Programming for artificial intelligence. One of the first programs has clau...
Are relations built in to Prolog? Are relations built in to Prolog? prolog Prolog Are relations built in to Prolog? I know this is probably a stupid question, but I'm just reading the first chapter of Bratko Prolog Programming for artificial intelligence. One of the first programs has clauses like My question: parent, ...
[ -0.0028076171875, 0.015380859375, 0.0174560546875, 0.00592041015625, -0.004241943359375, 0.01806640625, -0.005340576171875, -0.004150390625, 0.0024566650390625, -0.051513671875, -0.000385284423828125, -0.004302978515625, -0.037109375, 0.005584716796875, 0.017333984375, -0.0062255859375...
[ 15901, 91582, 88303, 23, 47, 1250, 4867, 502, 3714, 31895, 110833, 9655, 16454, 119794, 265, 27958, 66733, 130687, 5117, 103391, 70731, 49129, 7010, 84079, 4171, 26868 ]
[ 0.0255584716796875, 0.2420654296875, 0.1639404296875, 0.133056640625, 0.1341552734375, 0.20361328125, 0.281494140625, 0.14013671875, 0.012969970703125, 0.0308380126953125, 0.07354736328125, 0.051055908203125, 0.037109375, 0.10888671875, 0.1177978515625, 0.08990478515625, 0.0870361328...
embed
56208458_c0
56208458
prolog
0
Title: Permission denied when opening file in Prolog Problem title: Permission denied when opening file in Prolog Tags: prolog Problem: Permission denied when opening file in Prolog I have outputToFile(DATA) :- open('file.txt',write,Stream), write(Stream,DATA), close(Stream). solveGame(P):-solve(P, SOL), outputToFile(S...
Permission denied when opening file in Prolog Permission denied when opening file in Prolog prolog Permission Prolog DATA file.txt Stream SOL Permission denied when opening file in Prolog I have file.txt in the same directory of prolog file , When i run it i get
[ 0.03515625, 0.02197265625, 0.006500244140625, -0.001953125, 0.0030975341796875, -0.00083160400390625, -0.01171875, 0.01904296875, -0.00726318359375, -0.0303955078125, -0.00677490234375, 0.01708984375, 0.0000762939453125, 0.0103759765625, 0.01300048828125, -0.0140380859375, 0.01794433...
[ 908, 21150, 8, 93, 73432, 11435, 1250, 4867, 3229, 23, 502, 391, 17758, 124326, 115061, 78837, 297, 765, 5701, 14364, 11675 ]
[ 0.13720703125, 0.1397705078125, 0.1239013671875, 0.1424560546875, 0.12261962890625, 0.1300048828125, 0.17578125, 0.223876953125, 0.01544189453125, 0.0238189697265625, 0.103759765625, 0.01383209228515625, 0.1036376953125, 0.20068359375, 0.1466064453125, 0.1766357421875, 0.004432678222...
embed
43701548_c0
43701548
prolog
0
Title: Prolog Convert a list in a list of lists Problem title: Prolog Convert a list in a list of lists Tags: list, prolog Problem: Prolog Convert a list in a list of lists I need to convert a list of elements into a list of lists. For example, if i have the list [1,2,3,4] the output must be [[1],[2],[3],[4]], one elem...
Prolog Convert a list in a list of lists Prolog Convert a list in a list of lists list prolog Prolog Convert Aux Result Prolog Convert a list in a list of lists I need to convert a list of elements into a list of lists. For example, if i have the list [1,2,3,4] the output must be [[1],[2],[3],[4]], one element per list...
[ 0.01611328125, 0.00762939453125, 0.006805419921875, 0.0155029296875, -0.020751953125, 0.0189208984375, -0.00689697265625, -0.006195068359375, 0.0224609375, -0.0147705078125, 0.0169677734375, -0.0115966796875, -0.00125885009765625, 0.009033203125, -0.005462646484375, 0.0096435546875, ...
[ 1250, 4867, 1657, 11549, 5303, 23, 111, 10, 502, 6077, 126684, 7, 3871, 96760, 80854, 3934, 133063, 82449, 70, 140992, 8110, 186, 25256, 39556, 4, 54968, 68714, 1632, 12830, 117, 11343, 2046, 98320, 7722, 54 ]
[ 0.1541748046875, 0.22607421875, 0.0269775390625, 0.1561279296875, 0.259521484375, 0.10186767578125, 0.1256103515625, 0.054840087890625, 0.099609375, 0.095947265625, 0.10107421875, 0.0750732421875, 0.058441162109375, 0.1871337890625, 0.167724609375, 0.101318359375, 0.06109619140625, ...
embed
10260672_c0
10260672
prolog
0
Title: Prolog: First duplicate value Problem title: Prolog: First duplicate value Tags: prolog-dif, list, prolog Problem: Prolog: First duplicate value I need to find the first duplicate value in a list. prep(3,[1,3,5,3,5]). Should be true. prep(5,[1,3,5,3,5]). Should be false. I thought checking for equality with the ...
Prolog: First duplicate value Prolog: First duplicate value prolog-dif list prolog Prolog First Prolog: First duplicate value I need to find the first duplicate value in a list. prep(3,[1,3,5,3,5]). Should be true. prep(5,[1,3,5,3,5]). Should be false. I thought checking for equality with the current value and the prev...
[ 0.00909423828125, -0.0029296875, 0.01153564453125, 0.010009765625, -0.00921630859375, 0.0120849609375, 0.0247802734375, 0.00445556640625, 0.006622314453125, -0.026123046875, -0.014404296875, 0.048828125, 0.00122833251953125, -0.0000934600830078125, -0.0025634765625, 0.0289306640625, ...
[ 1250, 4867, 23972, 171763, 67, 34292, 502, 428, 420, 5303, 3871, 47, 7413, 70, 5117, 23, 64503, 86827, 92714, 151117, 29568, 104116, 186, 98320, 17569, 175199, 28, 161789, 678, 43581, 96362, 43032, 24189, 1632, 3034, 100, 1193, 6528, 3642, ...
[ 0.189697265625, 0.259033203125, 0.1942138671875, 0.27685546875, 0.21142578125, 0.23583984375, 0.1270751953125, 0.070068359375, 0.120849609375, 0.20361328125, 0.0797119140625, 0.019989013671875, 0.154541015625, 0.0545654296875, 0.200439453125, 0.042633056640625, 0.2017822265625, 0.0...
embed
33739801_c0
33739801
prolog
0
Title: Finding the longest list in Prolog? Problem title: Finding the longest list in Prolog? Tags: prolog Problem: Finding the longest list in Prolog? I need to write a predicate longestList/2 such that longestList(L1,L2) is satisfied if L2 is the longest nested list from the list of lists L1. ?- longestList([[1],[1,2...
Finding the longest list in Prolog? Finding the longest list in Prolog? prolog Finding Prolog Finding the longest list in Prolog? I need to write a predicate longestList/2 such that longestList(L1,L2) is satisfied if L2 is the longest nested list from the list of lists L1. Could someone please help me with intuition to...
[ 0.005889892578125, 0.0189208984375, -0.0003662109375, 0.011962890625, -0.01361083984375, 0.0255126953125, -0.000415802001953125, -0.00121307373046875, -0.00439453125, -0.0196533203125, 0.006561279296875, -0.0146484375, -0.01513671875, 0.007476806640625, 0.0179443359375, 0.0031433105468...
[ 26040, 70, 4989, 525, 5303, 23, 1250, 4867, 214, 502, 3871, 33022, 1653, 2063, 154663, 12477, 866, 418, 10461, 83, 214521, 339, 304, 8512, 4358, 58868, 3115, 6496 ]
[ 0.1031494140625, 0.065673828125, 0.16162109375, 0.1724853515625, 0.2269287109375, 0.06146240234375, 0.162353515625, 0.23779296875, 0.0178375244140625, 0.06793212890625, 0.050567626953125, 0.056182861328125, 0.08660888671875, 0.1121826171875, 0.1639404296875, 0.13134765625, 0.03979492...
embed
19230594_c0
19230594
prolog
0
Title: List Length in Prolog Problem title: List Length in Prolog Tags: clpfd, list, prolog Problem: List Length in Prolog I am beginner in Prolog programming. I wrote this program to calculate the length of a list. Why is below program wrong? length(0, []). length(L+l, H|T) :- length(L, T). I wrote below program and i...
List Length in Prolog List Length in Prolog clpfd list prolog List Length Prolog List Length in Prolog I am beginner in Prolog programming. I wrote this program to calculate the length of a list. Why is below program wrong? I wrote below program and it works correctly. when I changed the order, I got an error. Why?
[ 0.003631591796875, 0.034912109375, 0.0057373046875, 0.01434326171875, 0.0048828125, -0.01397705078125, -0.007232666015625, 0.01031494140625, 0.00341796875, -0.0341796875, 0.0031585693359375, -0.021240234375, 0.00390625, 0.01513671875, 0.023681640625, -0.0021514892578125, 0.0261230468...
[ 32036, 77554, 927, 23, 1250, 4867, 33139, 39557, 71, 5303, 502, 9842, 1679, 56037, 449, 54397, 1528, 74481, 67, 140909, 111, 44084, 83, 35064, 44691, 43240, 26785, 98816, 12989, 18499 ]
[ 0.2149658203125, 0.1673583984375, 0.0830078125, 0.0677490234375, 0.169189453125, 0.24560546875, 0.0074920654296875, 0.03289794921875, 0.08831787109375, 0.1839599609375, 0.11883544921875, 0.024658203125, 0.07177734375, 0.07562255859375, 0.00696563720703125, 0.0667724609375, 0.12780761...
embed
41299381_c0
41299381
prolog
0
Title: Leaves from binary tree Problem title: Leaves from binary tree Tags: prolog Problem: Leaves from binary tree I have a binary tree like this: tree(T) :- T = btree("classes", [ btree("class1", [ btree("thomas", []) ] ), btree("class2", [ btree("peter", []), btree("liz", []) ] ), btree("class3", [ btree("anna", [])...
Leaves from binary tree Leaves from binary tree prolog binary Leaves class1 class2 class3 Leaves from binary tree I have a binary tree like this: I want to make a predicate tree_leaf(T, Leaf), which gives me all leaves from a binary tree. The predicate should work for every binary tree.
[ 0.038818359375, 0.006622314453125, -0.007781982421875, -0.0013885498046875, 0.01458740234375, 0.0400390625, -0.0264892578125, -0.018798828125, -0.01416015625, -0.02978515625, -0.022705078125, 0.0013580322265625, 0.00311279296875, 0.01007080078125, 0, 0.0242919921875, 0.04296875, 0....
[ 64819, 7, 1295, 2394, 6635, 53201, 502, 4867, 18507, 363, 765, 1884, 903, 3444, 3249, 1653, 2063, 67, 133, 2407, 618, 636, 76199, 756, 31358, 5608, 4488, 100, 11907 ]
[ 0.23388671875, 0.08795166015625, 0.08447265625, 0.1917724609375, 0.1435546875, 0.2100830078125, 0.07391357421875, 0.128662109375, 0.116943359375, 0.06396484375, 0.01161956787109375, 0.03912353515625, 0.01441192626953125, 0.055450439453125, 0.032745361328125, 0.1436767578125, 0.184448...
embed
62308531_c0
62308531
prolog
0
Title: Multiple expression in the unification algorithm Problem title: Multiple expression in the unification algorithm Tags: prolog, logic, unification Problem: Multiple expression in the unification algorithm I have solved exercises where I had to unify only expressions of the following form f(..) = f(...). Now I hav...
Multiple expression in the unification algorithm Multiple expression in the unification algorithm prolog logic unification Multiple Multiple expression in the unification algorithm I have solved exercises where I had to unify only expressions of the following form f(..) = f(...). Now I have to solve a similar one but t...
[ -0.00341796875, -0.000728607177734375, 0.005096435546875, 0.0000743865966796875, 0.00811767578125, -0.01513671875, 0.00738525390625, -0.005889892578125, 0.0179443359375, -0.005340576171875, -0.0216064453125, 0.005889892578125, 0.0255126953125, 0.008056640625, -0.0169677734375, -0.00781...
[ 19335, 8705, 125195, 51, 41274, 234873, 23, 502, 4867, 62775, 86869, 81979, 40383, 4734, 7, 25632, 3173, 1238, 132, 5, 2203, 139666, 21373, 621, 138, 425, 706, 53, 4, 34, 97, 177, 113, 5608, 4034, 105950, 20650, 756, 70, 24145, 21342 ]
[ 0.192626953125, 0.1495361328125, 0.278076171875, 0.1768798828125, 0.161376953125, 0.2132568359375, 0.016021728515625, 0.107666015625, 0.178955078125, 0.13671875, 0.1470947265625, 0.12255859375, 0.156982421875, 0.0640869140625, 0.0496826171875, 0.0546875, 0.1165771484375, 0.10443115...
embed
8112470_c0
8112470
prolog
0
Title: Saving GProlog database Problem title: Saving GProlog database Tags: gnu-prolog, prolog Problem: Saving GProlog database In my program I have a dynamic clauses, they works fine, but when I closing my program, they are disappears. I've tryed that saveState :- write_pl_state_file('backup.dat'). loadState :- file_e...
Saving GProlog database Saving GProlog database gnu-prolog prolog Saving GProlog write_pl_state_file backup.dat file_exists read_pl_state_file Saving GProlog database In my program I have a dynamic clauses, they works fine, but when I closing my program, they are disappears. I've tryed that but this is not works. Is th...
[ 0.025634765625, 0.03173828125, 0.0108642578125, 0.00101470947265625, -0.0274658203125, 0.01483154296875, -0.0091552734375, 0.00372314453125, 0.0002803802490234375, -0.039794921875, 0.00543212890625, 0.0247802734375, -0.02197265625, 0.007171630859375, 0.022216796875, -0.0281982421875, ...
[ 947, 6496, 527, 10752, 4867, 63399, 104155, 3454, 502, 33022, 2424, 61340, 29822, 126502, 5164, 11435, 54376, 12301, 1528, 84079, 70731, 90, 43240, 5885, 1284, 3229, 20450, 6953, 621, 213566, 9790, 959, 3917, 30098, 903, 48, 9843, 184, 47 ]
[ 0.1163330078125, 0.043304443359375, 0.1173095703125, 0.1746826171875, 0.2330322265625, 0.2008056640625, 0.15234375, 0.10498046875, 0.1092529296875, 0.096435546875, 0.094482421875, 0.12255859375, 0.109375, 0.1531982421875, 0.082275390625, 0.1387939453125, 0.157470703125, 0.087646484...
embed
5652867_c0
5652867
prolog
0
Title: How to use nested if Problem title: How to use nested if Tags: prolog Problem: How to use nested if for example: testif(X,Y) :- X >= 6 -> writeln('X> 6'), Y>= 3 -> writeln('X >6 and Y> 3'); writeln('X >6 and Y<3'), writeln('X<6'); writeln('Test over'). test(X,Y):- testif(X,Y). ?- test(7, 3). Yes (0.00s cpu) X> 6...
How to use nested if How to use nested if prolog How Test Yes How to use nested if for example: why don't output 'Test over' ? why don't output 'Test over' too? Thanks very much :)
[ 0.015869140625, 0.01171875, 0.0164794921875, 0.024169921875, 0.01446533203125, 0.009521484375, 0.0146484375, 0.00189971923828125, -0.0019683837890625, 0.0167236328125, -0.00421142578125, -0.01165771484375, -0.0289306640625, 0.0126953125, 0.030029296875, 0.00933837890625, 0.0181884765...
[ 11249, 47, 4527, 8512, 71, 2174, 502, 4867, 8647, 32635, 15400, 2301, 18, 140992, 111337, 645 ]
[ 0.060821533203125, 0.05987548828125, 0.1575927734375, 0.2489013671875, 0.195556640625, 0.2044677734375, 0.1270751953125, 0.1912841796875, 0.1416015625, 0.1171875, 0.08001708984375, 0.0285797119140625, 0.064208984375, 0.1434326171875, 0.1650390625, 0.187744140625 ]
embed
67318329_c0
67318329
prolog
0
Title: List Manipulation prolog Problem title: List Manipulation prolog Tags: prolog, list Problem: List Manipulation prolog I have write these lines of code in prolog extend([],[]). extend([(N,L)|T], [NewList|NewListT]):- fill((N,L),NewList), extend(T,NewListT). fill((N,L),List) :- length(List, N), maplist(=(L), List)...
List Manipulation prolog List Manipulation prolog prolog list List Manipulation NewList NewListT List Manipulation prolog I have write these lines of code in prolog The thing i am trying to do is for a given list=[(0, a), (0, b), (1, c)] to create a list=[[c]] . My problem is when i run the code i have this result L = ...
[ 0.01129150390625, 0.0157470703125, 0.00531005859375, 0.0198974609375, -0.029541015625, 0.0032958984375, -0.01275634765625, 0.023681640625, 0.00506591796875, -0.00958251953125, 0.011962890625, -0.0159912109375, 0.003509521484375, 0.014404296875, -0.0162353515625, 0.005279541015625, 0....
[ 32036, 221169, 2320, 502, 4867, 5303, 2356, 154663, 618, 87, 765, 33022, 6097, 124519, 111, 18151, 23, 13580, 31577, 54, 100, 34475, 1369, 2389, 10, 22085, 4, 876, 2858, 501, 47, 28282, 1065, 238, 2646, 2967, 3229, 11675, 70, 17, 903, ...
[ 0.213623046875, 0.2440185546875, 0.05047607421875, 0.190185546875, 0.2548828125, 0.26220703125, 0.1107177734375, 0.2479248046875, 0.1064453125, 0.002166748046875, 0.031005859375, 0.08038330078125, 0.06915283203125, 0.0977783203125, 0.012359619140625, 0.16845703125, 0.03448486328125, ...
embed
66729035_c2
66729035
prolog
2
ums, DoubleBass, Saxophon, Trumpet, Instrument, InstrumentS, FirstName, Andi, Cornelius, Fritz, Markus, Pete, Walter, FirstNameS, LastName, Bramkamp, Franke, Karolewicz, Lueg, Schlueter, Weidemann, LastNameS, Song, Bermudadreieck, Jupps, Kroesken, Legende, Sally, Wanne, SongS, Jupps-Eck-Blues, Tanz, Bergmann, Dog, Wann...
ums, DoubleBass, Saxophon, Trumpet, Instrument, InstrumentS, FirstName, Andi, Cornelius, Fritz, Markus, Pete, Walter, FirstNameS, LastName, Bramkamp, Franke, Karolewicz, Lueg, Schlueter, Weidemann, LastNameS, Song, Bermudadreieck, Jupps, Kroesken, Legende, Sally, Wanne, SongS, Jupps-Eck-Blues, Tanz, Bergmann, Dog, Wann...
[ 0.0152587890625, 0.006561279296875, -0.0076904296875, 0.04248046875, -0.004791259765625, 0.03173828125, -0.00024127960205078125, 0.006103515625, 0.0257568359375, -0.0255126953125, 0.009765625, 0.0155029296875, 0.0208740234375, 0.0079345703125, -0.01080322265625, 0.0194091796875, -0.0...
[ 286, 7, 4, 107172, 63473, 105459, 31, 75189, 5879, 126, 73750, 294, 23972, 163612, 3493, 14, 74352, 3834, 177545, 111246, 1460, 67, 80490, 21672, 6163, 27633, 17819, 13, 119042, 187892, 3350, 2507, 124503, 34, 45673, 1401, 2506, 5761, 5986,...
[ 0.141845703125, 0.1044921875, 0.0406494140625, 0.1632080078125, 0.2568359375, 0.1275634765625, 0.078369140625, 0.20263671875, 0.1968994140625, 0.1754150390625, 0.25927734375, 0.1099853515625, 0.130615234375, 0.1915283203125, 0.0947265625, 0.0703125, 0.07354736328125, 0.141845703125...
embed
37231990_c1
37231990
prolog
1
, 7)], _G3140, _G3141) ? creep Call: (9) divide([ed(5, 6, 7)], _G3140, _G3141) ? creep Call: (10) divide([], _G3140, _G3141) ? creep Exit: (10) divide([], [], []) ? creep Call: (10) append([ed(5, 6, 7)], [], _G3144) ? creep Exit: (10) append([ed(5, 6, 7)], [], _G3144) ? creep I would hope that _G3144 (last sentence) is...
, 7)], _G3140, _G3141) ? creep Call: (9) divide([ed(5, 6, 7)], _G3140, _G3141) ? creep Call: (10) divide([], _G3140, _G3141) ? creep Exit: (10) divide([], [], []) ? creep Call: (10) append([ed(5, 6, 7)], [], _G3144) ? creep Exit: (10) append([ed(5, 6, 7)], [], _G3144) ? creep I would hope that _G3144 (last sentence) is...
[ 0.0146484375, 0.0284423828125, 0.013671875, 0.01031494140625, 0.0025482177734375, 0.01141357421875, 0.007659912109375, 0.00677490234375, 0.03125, 0.00885009765625, 0.0146484375, 0.005523681640625, -0.0274658203125, 0.0189208984375, 0.0198974609375, -0.009521484375, 0.026123046875, ...
[ 4, 49413, 268, 724, 363, 43900, 5016, 123001, 705, 49512, 254, 26265, 11438, 101637, 132, 297, 104116, 305, 101, 17857, 5443, 217, 12, 114689, 116553, 15673, 131663, 19777, 149357, 16, 34648, 14, 27686, 47, 4358, 28864, 26073, 7, 1250, 48...
[ 0.05230712890625, 0.1851806640625, 0.05377197265625, 0.1151123046875, 0.13720703125, 0.2452392578125, 0.1746826171875, 0.2025146484375, 0.059417724609375, 0.1719970703125, 0.169677734375, 0.1832275390625, 0.18505859375, 0.2310791015625, 0.00482177734375, 0.186767578125, 0.14978027343...
embed
38177232_c0
38177232
prolog
0
Title: Simple square program in Prolog Problem title: Simple square program in Prolog Tags: prolog, list Problem: Simple square program in Prolog Why is following simple program not working? main :- squares([1,2,3,4,5], L), writeln(L). squares([H|T], Outl) :- Sq is H*H, squares(T, [Sq|Outl]). squares([], []). The outpu...
Simple square program in Prolog Simple square program in Prolog prolog list Simple Prolog Outl Simple square program in Prolog Why is following simple program not working? The output is: Replacing Outl with [Outl] ( in squares([H|T], Outl) ) does not help. Using = and #= instead or is also did not help. Nor did squares...
[ 0.0224609375, 0.0155029296875, 0.006256103515625, -0.01251220703125, -0.02099609375, -0.0047607421875, -0.0225830078125, 0.0108642578125, 0.00946044921875, -0.0101318359375, 0.0184326171875, -0.017822265625, -0.001251220703125, -0.006866455078125, 0.012451171875, -0.010009765625, 0.0...
[ 60552, 108047, 1528, 1250, 4867, 502, 5303, 13538, 141, 23, 44084, 25632, 8781, 959, 20697, 140992, 853, 133266, 678, 79858, 841, 58745, 618, 14602, 4358, 2203, 136, 468, 1369, 64457, 707, 83, 436 ]
[ 0.165283203125, 0.21728515625, 0.217041015625, 0.1473388671875, 0.228271484375, 0.070068359375, 0.10498046875, 0.15234375, 0.1158447265625, 0.002288818359375, 0.0098876953125, 0.1251220703125, 0.1640625, 0.109619140625, 0.1553955078125, 0.12939453125, 0.035736083984375, 0.123901367...
embed
59418715_c1
59418715
prolog
1
bar(10). bar(10) does not exist foo(8). Is this an accident of the implementation? It does seem a bit dicey. Furthermore, the above code was written because I wanted to test whether the constraint to be removed from the store (here, bar(Y) ) would be available in the body of the rule. Apparently not, it is already gone...
bar(10). bar(10) does not exist foo(8). Is this an accident of the implementation? It does seem a bit dicey. Furthermore, the above code was written because I wanted to test whether the constraint to be removed from the store (here, bar(Y) ) would be available in the body of the rule. Apparently not, it is already gone...
[ 0.019775390625, 0.0257568359375, 0.004241943359375, 0.0157470703125, 0.019775390625, 0.015869140625, -0.017578125, -0.00130462646484375, -0.000743865966796875, -0.02880859375, 0.00433349609375, 0.01336669921875, -0.01556396484375, -0.00726318359375, 0.01507568359375, -0.032958984375, ...
[ 1909, 90980, 14602, 959, 32316, 5775, 31, 50490, 903, 27998, 208124, 48903, 4785, 13747, 53, 18151, 59121, 3034, 158, 2816, 4288, 186, 184750, 1295, 4343, 35593, 1723, 16, 19882, 14361, 79986, 442, 21771, 74955, 3229, 71924, 90, 108750, 635...
[ 0.2412109375, 0.2568359375, 0.0550537109375, 0.133544921875, 0.215087890625, 0.118896484375, 0.09814453125, 0.1544189453125, 0.025360107421875, 0.2264404296875, 0.1700439453125, 0.042449951171875, 0.024200439453125, 0.0301513671875, 0.0426025390625, 0.1116943359375, 0.001373291015625...
embed
64659969_c0
64659969
prolog
0
Title: How to create a swap function in Prolog with a temp variable? Problem title: How to create a swap function in Prolog with a temp variable? Tags: swap, prolog Problem: How to create a swap function in Prolog with a temp variable? I need to create a program to swap two values with a temporary variable in prolog as...
How to create a swap function in Prolog with a temp variable? How to create a swap function in Prolog with a temp variable? swap prolog How Prolog How to create a swap function in Prolog with a temp variable? I need to create a program to swap two values with a temporary variable in prolog as a part of my advanced prog...
[ 0.0216064453125, 0.0206298828125, -0.0042724609375, -0.0029296875, -0.006500244140625, 0.0027923583984375, -0.03515625, 0.0034332275390625, -0.009033203125, -0.004180908203125, 0.01025390625, 0.01507568359375, -0.0126953125, 0.005218505859375, 0.0260009765625, 0.00634765625, 0.010375...
[ 11249, 28282, 10, 202317, 32354, 23, 1250, 4867, 678, 20805, 77336, 502, 3871, 1528, 6626, 142424, 142458, 175961, 56037, 18507, 1733, 46876, 53, 63559, 4358 ]
[ 0.05633544921875, 0.1397705078125, 0.0294342041015625, 0.2490234375, 0.20751953125, 0.03778076171875, 0.1318359375, 0.222900390625, 0.0897216796875, 0.204833984375, 0.2369384765625, 0.10711669921875, 0.0191192626953125, 0.1282958984375, 0.103271484375, 0.14111328125, 0.151611328125, ...
embed
57560589_c0
57560589
prolog
0
Title: Creating a List in prolog recursively Problem title: Creating a List in prolog recursively Tags: prolog Problem: Creating a List in prolog recursively i would like to create a list in prolog where in each recursive step i add an element to the list.My code: solve(N,List):- N>5, solve(N-1,[a|List]), N<5, solve(N-...
Creating a List in prolog recursively Creating a List in prolog recursively prolog Creating List N-1 Creating a List in prolog recursively i would like to create a list in prolog where in each recursive step i add an element to the list.My code: This supposedly runs recursions adding a or b to the List depending on N.H...
[ 0.006072998046875, 0.0079345703125, 0.01043701171875, 0.0140380859375, -0.00701904296875, 0.0230712890625, -0.0223388671875, 0.018310546875, 0.00885009765625, -0.01336669921875, 0.0147705078125, -0.0206298828125, -0.01092529296875, 0.00579833984375, 0.013671875, 0.0014190673828125, 0...
[ 56781, 32036, 502, 4867, 195625, 5844, 538, 1916, 10, 23, 541, 5759, 2806, 1884, 28282, 5303, 12638, 29954, 15190, 12830, 47, 18151, 134598, 127877, 17514, 154107, 707, 876, 96819, 11, 58745, 154663, 959, 1830, 26785, 3917, 54 ]
[ 0.1390380859375, 0.21630859375, 0.14697265625, 0.2266845703125, 0.205078125, 0.147705078125, 0.0170745849609375, 0.01806640625, 0.006927490234375, 0.0225830078125, 0.109375, 0.078369140625, 0.011749267578125, 0.0821533203125, 0.14697265625, 0.18896484375, 0.055908203125, 0.12219238...
embed
8648120_c0
8648120
prolog
0
Title: Single cycle permutations Problem title: Single cycle permutations Tags: prolog, permutation Problem: Single cycle permutations Let's take a permutation of numbers {1,2,3,4} which has only one cycle in it. For example it can be: (2,3,4,1). I was wondering, how can I generate all such permutations using Prolog? I...
Single cycle permutations Single cycle permutations prolog permutation Single Single cycle permutations Let's take a permutation of numbers {1,2,3,4} which has only one cycle in it. For example it can be: (2,3,4,1). I was wondering, how can I generate all such permutations using Prolog? I know how to generate all permu...
[ 0.01348876953125, -0.00537109375, -0.006988525390625, 0.01165771484375, -0.0076904296875, 0.0031585693359375, -0.0419921875, -0.01318359375, 0.0203857421875, -0.042724609375, -0.032958984375, 0.0201416015625, -0.0244140625, 0.022705078125, -0.0036773681640625, 0.0185546875, -0.032226...
[ 43609, 105823, 117, 14311, 21094, 502, 4867, 561, 22062, 101935, 133063, 82449, 1556, 4734, 1632, 23, 27781, 831, 4700, 17727, 149016, 3642, 139392, 756, 6044, 17368, 1250, 36849, 6528, 47, 75457, 11001, 19336, 105876, 67660 ]
[ 0.211181640625, 0.2479248046875, 0.1502685546875, 0.2220458984375, 0.1209716796875, 0.130615234375, 0.2421875, 0.198486328125, 0.10662841796875, 0.17041015625, 0.1063232421875, 0.1973876953125, 0.0156402587890625, 0.11572265625, 0.1619873046875, 0.0260162353515625, 0.0052490234375, ...
embed
33852348_c0
33852348
prolog
0
Title: How do I surround an Atom value with double quotation marks in Prolog? Problem title: How do I surround an Atom value with double quotation marks in Prolog? Tags: prolog Problem: How do I surround an Atom value with double quotation marks in Prolog? Id = 1, Result= "1", How do I surround the value in Id with dou...
How do I surround an Atom value with double quotation marks in Prolog? How do I surround an Atom value with double quotation marks in Prolog? prolog How Atom Prolog Result How do I surround an Atom value with double quotation marks in Prolog? How do I surround the value in Id with double quotations? In the example abov...
[ 0.02978515625, -0.00151824951171875, 0.00640869140625, 0.0213623046875, 0.000946044921875, 0.0294189453125, 0.00506591796875, 0.00188446044921875, 0.01141357421875, -0.0189208984375, 0.004608154296875, 0.0072021484375, -0.032470703125, -0.0235595703125, 0.0101318359375, 0.0148315429687...
[ 11249, 54, 87, 613, 67688, 69728, 34292, 678, 41929, 81732, 1363, 16188, 23, 1250, 4867, 502, 126684, 24799, 27781, 106, 4343, 3444, 6, 5, 163846, 18151 ]
[ 0.0870361328125, 0.030029296875, 0.021148681640625, 0.1378173828125, 0.2177734375, 0.23681640625, 0.212646484375, 0.096923828125, 0.200439453125, 0.20361328125, 0.09552001953125, 0.1278076171875, 0.064453125, 0.1807861328125, 0.24658203125, 0.1141357421875, 0.2113037109375, 0.16845...
embed
33989010_c0
33989010
prolog
0
Title: Prolog foreach : display facts Problem title: Prolog foreach : display facts Tags: prolog Problem: Prolog foreach : display facts In prolog, I want to display simple facts like this : person(Mike, 18). person(Alice, 22). person(Louis, 34). in this : ------------------ | Name | Age | ------------------ | Mike | 1...
Prolog foreach : display facts Prolog foreach : display facts prolog Prolog Mike Alice Louis Name Age Prolog foreach : display facts In prolog, I want to display simple facts like this : in this : I test with my code, but seems dont work : Can you help me ?
[ 0.033935546875, -0.00018787384033203125, 0.00726318359375, 0.017333984375, -0.0028839111328125, -0.00007915496826171875, 0.006103515625, 0.0064697265625, -0.00537109375, -0.04248046875, 0.0137939453125, -0.00396728515625, -0.0220947265625, 0.0091552734375, 0.004852294921875, -0.0020141...
[ 1250, 4867, 100, 41581, 44116, 15824, 7, 502, 41576, 66083, 37405, 15757, 72944, 360, 3444, 47, 8781, 1884, 903, 23, 3034, 678, 759, 18151, 1284, 37202, 13319, 4488, 4171, 4358 ]
[ 0.17822265625, 0.262451171875, 0.10357666015625, 0.2464599609375, 0.2200927734375, 0.215576171875, 0.038238525390625, 0.15087890625, 0.1834716796875, 0.1832275390625, 0.2274169921875, 0.08380126953125, 0.165771484375, 0.0011453628540039062, 0.084228515625, 0.0170745849609375, 0.16613...
embed
50912859_c0
50912859
prolog
0
Title: List in prolog with statement if Problem title: List in prolog with statement if Tags: prolog Problem: List in prolog with statement if I want to do if statement,with a list.We have a list with numbers extreme([1,5,-10,-22,33,-41,16,58,10],LP) .How can i do it with if ?Lets say i want the numbers smaller than -1...
List in prolog with statement if List in prolog with statement if prolog List List in prolog with statement if I want to do if statement,with a list.We have a list with numbers extreme([1,5,-10,-22,33,-41,16,58,10],LP) .How can i do it with if ?Lets say i want the numbers smaller than -10 and bigger than 12.As a result...
[ 0.01708984375, -0.0089111328125, -0.00081634521484375, 0.000881195068359375, 0.0034027099609375, 0.00982666015625, 0.00970458984375, 0.0244140625, 0.01336669921875, 0.0042724609375, -0.01171875, -0.0194091796875, -0.0169677734375, 0.00872802734375, 0.01251220703125, 0.0137939453125, ...
[ 32036, 23, 502, 4867, 678, 63805, 2174, 3444, 54, 76228, 5303, 101935, 120069, 57626, 9193, 4, 31043, 9185, 8894, 2485, 10057, 963, 37352, 81826, 831, 442, 164917, 3501, 167785, 5035, 186, 82080, 4527, 27798, 3917, 29458, 4734, 100, 79315 ]
[ 0.2120361328125, 0.09765625, 0.18505859375, 0.2548828125, 0.130126953125, 0.25732421875, 0.277099609375, 0.119140625, 0.08428955078125, 0.115478515625, 0.2103271484375, 0.1588134765625, 0.211669921875, 0.1578369140625, 0.188232421875, 0.002593994140625, 0.1357421875, 0.175537109375...
embed
18690788_c0
18690788
prolog
0
Title: Arithmetic expression in swi-prolog Problem title: Arithmetic expression in swi-prolog Tags: arithmetic-expressions, prolog Problem: Arithmetic expression in swi-prolog I have the following prolog program: set_1(2). p(X) :- set_1(X+1). I'm using SWI-Prolog version 5.10.4 for i386 to run the query p(1) on this pr...
Arithmetic expression in swi-prolog Arithmetic expression in swi-prolog arithmetic-expressions prolog Arithmetic set_1 Arithmetic expression in swi-prolog I have the following prolog program: I'm using SWI-Prolog version 5.10.4 for i386 to run the query p(1) on this program. The answer is 'false'. I expect the answer t...
[ 0.01385498046875, 0.01470947265625, 0.01513671875, 0.01806640625, 0.0101318359375, 0.004150390625, 0.0031890869140625, 0.026123046875, 0.010009765625, -0.01177978515625, 0.0155029296875, 0.0233154296875, -0.019287109375, -0.008056640625, 0.01708984375, -0.00848388671875, 0.0107421875...
[ 1172, 8962, 282, 125195, 91, 2452, 3454, 4867, 9523, 23, 204629, 502, 5423, 115187, 1528, 17368, 159, 38969, 10752, 11389, 68433, 121254, 105742, 11675, 41, 1294, 915, 27750, 35166, 83, 8710, 184, 41206, 9774, 1542, 21748, 61585, 237, 40970...
[ 0.0237579345703125, 0.1417236328125, 0.05670166015625, 0.226806640625, 0.04583740234375, 0.194580078125, 0.142333984375, 0.1839599609375, 0.0028076171875, 0.003204345703125, 0.1680908203125, 0.1217041015625, 0.1646728515625, 0.1512451171875, 0.0980224609375, 0.01226806640625, 0.03887...
embed
37397381_c0
37397381
prolog
0
Title: breadth first on binary tree - using Semicontext notation Problem title: breadth first on binary tree - using Semicontext notation Tags: list, prolog, dcg-semicontext, dcg Problem: breadth first on binary tree - using Semicontext notation I would like to compute list being bfs order on binary tree. Moreover, it ...
breadth first on binary tree - using Semicontext notation breadth first on binary tree - using Semicontext notation list prolog dcg-semicontext dcg Semicontext breadth first on binary tree - using Semicontext notation I would like to compute list being bfs order on binary tree. Moreover, it should work in second side -...
[ 0.0264892578125, 0.022705078125, 0.01031494140625, 0.00994873046875, 0.005462646484375, 0.01104736328125, -0.0172119140625, 0.0037994384765625, -0.01141357421875, -0.0322265625, 0.011474609375, -0.01177978515625, -0.00136566162109375, 0.0225830078125, 0.01495361328125, -0.0086059570312...
[ 179967, 927, 5117, 98, 2394, 6635, 53201, 17368, 84420, 2271, 22829, 110, 22062, 5303, 502, 4867, 177, 84505, 238, 1884, 9969, 6743, 8035, 876, 17447, 12989, 4488, 17932, 5609, 442, 7413, 5122, 765, 11814, 22027, 18 ]
[ 0.205810546875, 0.158447265625, 0.119873046875, 0.043670654296875, 0.1302490234375, 0.10498046875, 0.2012939453125, 0.010162353515625, 0.113037109375, 0.05755615234375, 0.15966796875, 0.093017578125, 0.06634521484375, 0.1553955078125, 0.08026123046875, 0.1302490234375, 0.053283691406...
embed
17534890_c0
17534890
prolog
0
Title: How can I check if a Prolog rules was already fired? Problem title: How can I check if a Prolog rules was already fired? Tags: artificial-intelligence, prolog Problem: How can I check if a Prolog rules was already fired? I need to check if a rule was already "fired" before to fire it again. I mean before asserti...
How can I check if a Prolog rules was already fired? How can I check if a Prolog rules was already fired? artificial-intelligence prolog How Prolog How can I check if a Prolog rules was already fired? I need to check if a rule was already "fired" before to fire it again. I mean before asserting a new fact I need to kno...
[ 0.0186767578125, 0.002716064453125, 0.007232666015625, 0.04052734375, 0.00396728515625, 0.002685546875, 0.0086669921875, 0.0167236328125, 0.00421142578125, -0.03173828125, 0.00653076171875, -0.0142822265625, -0.006561279296875, 0.001983642578125, 0.0167236328125, 0.0146484375, 0.0180...
[ 11249, 831, 12765, 2174, 10, 1250, 4867, 91736, 509, 21771, 11476, 71, 66733, 130687, 502, 87, 3871, 47, 79986, 1029, 2822, 8108, 13438, 16865, 1916, 3525, 15824, 3714, 5701, 96362, 40956, 720, 5303, 193701, 2967, 4527, 903 ]
[ 0.07867431640625, 0.0926513671875, 0.2396240234375, 0.11328125, 0.077392578125, 0.1917724609375, 0.269775390625, 0.2178955078125, 0.1112060546875, 0.2119140625, 0.2037353515625, 0.16455078125, 0.0875244140625, 0.0830078125, 0.1246337890625, 0.006805419921875, 0.0299530029296875, 0....
embed
42906385_c1
42906385
prolog
1
,stuart). brother(jerry,kather). brother(peter, warren). sister(ann, maryalice). sister(kather,jerry). parent_of(warren,jerry). parent_of(maryalice,jerry). parent_of(X,Z):- brother(Y,Z),(father(X,Y);mother(X,Y)). father(X,Y) :- parent_of(X,Y), male(X). mother(X,Y) :- parent_of(X,Y), female(X). I thought the first Call ...
,stuart). brother(jerry,kather). brother(peter, warren). sister(ann, maryalice). sister(kather,jerry). parent_of(warren,jerry). parent_of(maryalice,jerry). parent_of(X,Z):- brother(Y,Z),(father(X,Y);mother(X,Y)). father(X,Y) :- parent_of(X,Y), male(X). mother(X,Y) :- parent_of(X,Y), female(X). I thought the first Call ...
[ 0.006195068359375, 0.00921630859375, 0.000919342041015625, 0.0177001953125, -0.03173828125, 0.01373291015625, -0.00445556640625, -0.0174560546875, 0.01409912109375, -0.0299072265625, 0.015869140625, -0.01422119140625, -0.000789642333984375, 0.0108642578125, 0.006866455078125, -0.002914...
[ 6, 4, 4313, 3960, 194, 82953, 4227, 1294, 161, 9319, 5408, 56, 1631, 982, 114015, 6763, 395, 13348, 49129, 4390, 4205, 1542, 1511, 1723, 1021, 432, 67373, 11280, 42732, 117776, 17569, 70, 5117, 26265, 390, 7108, 5608, 71924, 13, 136, 13...
[ 0.037384033203125, 0.016326904296875, 0.10272216796875, 0.2125244140625, 0.062042236328125, 0.186279296875, 0.146484375, 0.16455078125, 0.053131103515625, 0.1455078125, 0.04376220703125, 0.014862060546875, 0.082763671875, 0.140380859375, 0.131103515625, 0.0943603515625, 0.05499267578...
embed
10712367_c1
10712367
prolog
1
or right). legal(X, X). **legal(3,X). legal(0,X).** % newstate(State1, State2) newstate(state(M1, C1, left), state(M2, C2, right)) :- carry(M, C), M =< M1, C =< C1, M2 is M1 - M, C2 is C1 - C, legal(M2, C2). newstate(state(M1, C1, right), state(M2, C2, left)) :- carry(M, C), M2 is M1 + M, C2 is C1 + C, M2 =< 3, C2 =< ...
or right). legal(X, X). **legal(3,X). legal(0,X).** % newstate(State1, State2) newstate(state(M1, C1, left), state(M2, C2, right)) :- carry(M, C), M =< M1, C =< C1, M2 is M1 - M, C2 is C1 - C, legal(M2, C2). newstate(state(M1, C1, right), state(M2, C2, left)) :- carry(M, C), M2 is M1 + M, C2 is C1 + C, M2 =< 3, C2 =< ...
[ 0.00087738037109375, 0.005950927734375, 0.01123046875, 0.037353515625, -0.003753662109375, 0.049072265625, -0.0172119140625, -0.01300048828125, 0.01043701171875, -0.03271484375, 0.00157928466796875, -0.0172119140625, 0.00726318359375, 0.00299072265625, -0.00982666015625, -0.025390625, ...
[ 707, 7108, 8437, 1542, 1193, 86966, 86827, 2389, 1745, 7123, 19888, 135206, 418, 22836, 10461, 61340, 594, 313, 25737, 247, 11341, 304, 15772, 85358, 276, 16093, 4, 83, 997, 138, 831, 5154, 86869, 442, 1528, 111, 29752, 6635, 20, 4398, ...
[ 0.0706787109375, 0.157470703125, 0.1922607421875, 0.079833984375, 0.103759765625, 0.1932373046875, 0.06488037109375, 0.002044677734375, 0.102783203125, 0.157958984375, 0.264892578125, 0.1409912109375, 0.097900390625, 0.148681640625, 0.143310546875, 0.1678466796875, 0.088623046875, ...
embed
38647774_c0
38647774
prolog
0
Title: Reverse the last two elements of a list in Prolog Problem title: Reverse the last two elements of a list in Prolog Tags: prolog, list Problem: Reverse the last two elements of a list in Prolog I am trying to write the following predicate in Prolog while not making use of append/3 : lastTwoReversed(List, ListOf2)...
Reverse the last two elements of a list in Prolog Reverse the last two elements of a list in Prolog prolog list Reverse Prolog List ListOf2 Reverse the last two elements of a list in Prolog I am trying to write the following predicate in Prolog while not making use of append/3 : which succeeds exactly when ListOf2 cont...
[ 0.00007677078247070312, 0.025634765625, 0.009033203125, 0.017822265625, -0.006378173828125, 0.033447265625, -0.006317138671875, 0.00592041015625, 0.023681640625, 0.006317138671875, 0.0167236328125, 0.0159912109375, 0.0035552978515625, 0.01458740234375, 0.0023956298828125, 0.01385498046...
[ 853, 37676, 4568, 6626, 80854, 5303, 1250, 4867, 502, 32036, 132887, 304, 31577, 33022, 1653, 2063, 114689, 18113, 214493, 66161, 70541, 136, 17932, 188, 19777, 450, 12989, 39531, 5281, 4358 ]
[ 0.10516357421875, 0.263916015625, 0.1798095703125, 0.1671142578125, 0.1688232421875, 0.169189453125, 0.149658203125, 0.2130126953125, 0.10107421875, 0.156005859375, 0.2022705078125, 0.14794921875, 0.016754150390625, 0.0679931640625, 0.08642578125, 0.10711669921875, 0.0682373046875, ...
embed
65172748_c0
65172748
prolog
0
Title: Retract by partial match? Problem title: Retract by partial match? Tags: prolog Problem: Retract by partial match? Is there a way to retractall clauses by partial match .. let say i have the following grammar : s3-->[a, b, r, a]. s4-->[a, b]. s5-->s4, s4. how can I delete all clauses starting with 's' ? exists(P...
Retract by partial match? Retract by partial match? prolog Retract Prefix Max atom_concat current_predicate Retract by partial match? Is there a way to retractall clauses by partial match .. let say i have the following grammar : how can I delete all clauses starting with 's' ?
[ -0.0089111328125, 0.00897216796875, 0.014404296875, 0.0087890625, -0.01239013671875, -0.00007677078247070312, 0.0220947265625, 0.011474609375, 0.01251220703125, -0.02294921875, 0.0186767578125, 0.0238037109375, -0.01434326171875, -0.0206298828125, 0.02880859375, -0.01104736328125, 0....
[ 853, 39989, 18, 390, 2878, 289, 14858, 502, 4867, 55923, 9920, 34627, 2271, 4460, 43581, 19714, 2063, 10, 3917, 47, 41499, 238, 91569, 70731, 90, 25632, 122092, 147, 3642, 831, 154109, 756, 72134, 678, 7 ]
[ 0.08709716796875, 0.18310546875, 0.11871337890625, 0.0894775390625, 0.146728515625, 0.07000732421875, 0.1815185546875, 0.05377197265625, 0.0989990234375, 0.10369873046875, 0.10015869140625, 0.1318359375, 0.00952911376953125, 0.1212158203125, 0.129638671875, 0.044464111328125, 0.09045...
embed
27090619_c0
27090619
prolog
0
Title: Converting input to list in prolog Problem title: Converting input to list in prolog Tags: prolog Problem: Converting input to list in prolog I am doing something like this read_line_to_codes(user_input,Li1),nl, write(Li1),nl, atom_codes(A,Li1), write(A),nl So I am getting this output- |: 'hello',18,19,'Bye' [39...
Converting input to list in prolog Converting input to list in prolog prolog Converting read_line_to_codes user_input Li1 atom_codes Bye Converting input to list in prolog I am doing something like this So I am getting this output- But I want a list having this- L=['hello',18,19,'Bye'] How can I do this?
[ -0.017578125, -0.0247802734375, 0.00653076171875, 0.0130615234375, -0.0147705078125, 0.0133056640625, 0.006072998046875, 0.009765625, -0.00640869140625, -0.0458984375, 0.0002613067626953125, -0.0162353515625, -0.0028228759765625, 0.0033111572265625, -0.0059814453125, 0.0004253387451171...
[ 1657, 814, 1916, 107730, 47, 5303, 502, 4867, 23, 12301, 2256, 188, 40899, 38937, 73, 7077, 1261, 418, 34627, 3311, 140992, 4966, 3444, 19441, 903, 339, 1369, 13817, 1819, 2947, 571, 1033, 831, 54 ]
[ 0.0377197265625, 0.1273193359375, 0.05322265625, 0.2188720703125, 0.1199951171875, 0.21826171875, 0.142822265625, 0.2322998046875, 0.032684326171875, 0.141357421875, 0.1278076171875, 0.078857421875, 0.1920166015625, 0.0970458984375, 0.081298828125, 0.016815185546875, 0.06927490234375...
embed
55232252_c0
55232252
prolog
0
Title: What does it mean for a predicate in Prolog to be &quot;shallow&quot; or &quot;deep&quot;? Problem title: What does it mean for a predicate in Prolog to be &quot;shallow&quot; or &quot;deep&quot;? Tags: predicate, list, prolog Problem: What does it mean for a predicate in Prolog to be "shallow" or "deep"? For ex...
What does it mean for a predicate in Prolog to be &quot;shallow&quot; or &quot;deep&quot;? What does it mean for a predicate in Prolog to be &quot;shallow&quot; or &quot;deep&quot;? predicate list prolog What Prolog What does it mean for a predicate in Prolog to be "shallow" or "deep"? For example, I am tasked with cre...
[ 0.0238037109375, 0.02880859375, 0.01275634765625, 0.0126953125, 0.003631591796875, 0.03369140625, 0.00238037109375, -0.009521484375, 0.01092529296875, 0.01092529296875, 0.0257568359375, -0.01458740234375, -0.019287109375, 0.0067138671875, 0.0159912109375, 0.01300048828125, 0.02185058...
[ 29459, 1653, 2063, 67, 1250, 4867, 2420, 41566, 707, 123041, 23, 5303, 502, 186, 66211, 105233, 6626, 1636, 87388, 12830, 131148, 69407 ]
[ 0.129638671875, 0.1737060546875, 0.21923828125, 0.1539306640625, 0.1585693359375, 0.2376708984375, 0.1480712890625, 0.23681640625, 0.06622314453125, 0.23828125, 0.04656982421875, 0.1265869140625, 0.10009765625, 0.038818359375, 0.01068115234375, 0.005462646484375, 0.02313232421875, ...
embed