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
48428566_c0
48428566
prolog
0
Title: Prolog - Recursive function always returning false value Problem title: Prolog - Recursive function always returning false value Tags: recursion, prolog Problem: Prolog - Recursive function always returning false value I am used to implement a recursive function that checks if a given list L is written in a reve...
Prolog - Recursive function always returning false value Prolog - Recursive function always returning false value recursion prolog Prolog Recursive Prolog - Recursive function always returning false value I am used to implement a recursive function that checks if a given list L is written in a reverse-order: However af...
[ 0.005096435546875, 0.0255126953125, -0.00084686279296875, -0.01263427734375, 0.01019287109375, 0.00469970703125, 0.01397705078125, -0.00958251953125, 0.01055908203125, -0.0036468505859375, 0.005828857421875, 0.0076904296875, 0.0001392364501953125, -0.00909423828125, 0.0196533203125, 0....
[ 1250, 4867, 853, 48650, 5844, 32354, 11343, 30646, 214, 98320, 34292, 195625, 502, 29479, 12765, 2174, 34475, 5303, 339, 59121, 23, 39531, 184, 80596, 9969, 18151, 105876, 12989, 29598, 4332, 37676, 363, 304, 76172, 159, 38969, 176377, 44691 ...
[ 0.12451171875, 0.223876953125, 0.062347412109375, 0.1861572265625, 0.151611328125, 0.15478515625, 0.146240234375, 0.157470703125, 0.05010986328125, 0.2357177734375, 0.1708984375, 0.1865234375, 0.0701904296875, 0.0582275390625, 0.1373291015625, 0.04840087890625, 0.00177001953125, 0....
embed
53978037_c0
53978037
prolog
0
Title: How to append an element to each element of a list ? (Prolog) Problem title: How to append an element to each element of a list ? (Prolog) Tags: prolog Problem: How to append an element to each element of a list ? (Prolog) I'll like to append an element to each element of a list. the element must be a list too. ...
How to append an element to each element of a list ? (Prolog) How to append an element to each element of a list ? (Prolog) prolog How Prolog ele2 custom_append How to append an element to each element of a list ? (Prolog) I'll like to append an element to each element of a list. the element must be a list too. Exemple...
[ 0.0103759765625, 0.00982666015625, 0.0118408203125, 0.0162353515625, -0.0185546875, 0.03173828125, 0.00177001953125, 0.00836181640625, 0.0233154296875, -0.022216796875, 0.0157470703125, -0.0142822265625, -0.010009765625, 0.0177001953125, 0.00994873046875, -0.013427734375, 0.012634277...
[ 11249, 47, 114689, 71, 12830, 12638, 111, 5303, 10752, 4867, 502, 1250, 3163, 304, 114122, 9007, 3611, 1181, 1884, 10, 8110, 186, 5792, 16750, 37842, 4966, 30646, 98320, 678, 69307 ]
[ 0.08624267578125, 0.135009765625, 0.197265625, 0.1475830078125, 0.2071533203125, 0.130126953125, 0.0548095703125, 0.1767578125, 0.0689697265625, 0.1934814453125, 0.06787109375, 0.1070556640625, 0.08880615234375, 0.1102294921875, 0.1304931640625, 0.09332275390625, 0.1173095703125, 0...
embed
38198892_c0
38198892
prolog
0
Title: Why no division in CLP(FD) in Prolog? Problem title: Why no division in CLP(FD) in Prolog? Tags: clpfd, prolog, swi-prolog Problem: Why no division in CLP(FD) in Prolog? I could not find division (/) symbol on this page of CLP(FD): http://www.swi-prolog.org/man/clpfd.html Also this simple code give error: :-use_...
Why no division in CLP(FD) in Prolog? Why no division in CLP(FD) in Prolog? clpfd prolog swi-prolog Why CLP Prolog use_module ERROR Domain clpfd_expression Why no division in CLP(FD) in Prolog? I could not find division (/) symbol on this page of CLP(FD): http://www.swi-prolog.org/man/clpfd.html Also this simple code g...
[ -0.00506591796875, 0.0223388671875, 0.01068115234375, -0.006683349609375, 0.00701904296875, -0.00787353515625, 0.01611328125, -0.01397705078125, -0.005035400390625, -0.035400390625, -0.003204345703125, -0.0157470703125, -0.0037841796875, 0.00107574462890625, 0.01202392578125, -0.012329...
[ 44084, 110, 91853, 23, 313, 37352, 98553, 1250, 4867, 33139, 39557, 71, 502, 2452, 3454, 4527, 83279, 151206, 24638, 93702, 204629, 959, 7413, 64, 26582, 669, 34937, 8781, 18151, 18499, 2967, 86869 ]
[ 0.0811767578125, 0.0987548828125, 0.25634765625, 0.0269927978515625, 0.047119140625, 0.2408447265625, 0.2078857421875, 0.13818359375, 0.2393798828125, 0.050323486328125, 0.10052490234375, 0.1436767578125, 0.099853515625, 0.12841796875, 0.0986328125, 0.0792236328125, 0.1312255859375, ...
embed
2893766_c0
2893766
prolog
0
Title: Matching tuples in Prolog Problem title: Matching tuples in Prolog Tags: associativity, operators, pattern-matching, prolog, tuples Problem: Matching tuples in Prolog Why does Prolog match (X, Xs) with a tuple containing more elements? An example: test2((X, Xs)) :- write(X), nl, test2(Xs). test2((X)) :- write(X)...
Matching tuples in Prolog Matching tuples in Prolog associativity operators pattern-matching prolog tuples Matching Prolog test2 Matching tuples in Prolog Why does Prolog match (X, Xs) with a tuple containing more elements? An example: Actually this is what I want to achieve but it seems suspicious. Is there any other ...
[ 0.017578125, 0.009033203125, -0.01446533203125, 0.0089111328125, 0.00148773193359375, 0.0133056640625, 0.00032806396484375, 0.00579833984375, 0.029052734375, -0.0164794921875, 0.01287841796875, 0.0029296875, -0.00860595703125, -0.01068115234375, 0.006622314453125, 0.017822265625, 0.0...
[ 67407, 214, 370, 99726, 1250, 4867, 166027, 3760, 39933, 103510, 98753, 502, 3034, 44084, 14858, 1542, 1193, 678, 8705, 70541, 1286, 80854, 27781, 192728, 903, 3444, 69307, 1284, 37202, 166, 181960, 85689, 17043, 69407, 5303 ]
[ 0.1898193359375, 0.013397216796875, 0.1158447265625, 0.204833984375, 0.1239013671875, 0.2210693359375, 0.06903076171875, 0.01727294921875, 0.135009765625, 0.0865478515625, 0.1673583984375, 0.0650634765625, 0.0738525390625, 0.049530029296875, 0.1771240234375, 0.0673828125, 0.100463867...
embed
74433414_c0
74433414
prolog
0
Title: How to solve this using Prolog? Problem title: How to solve this using Prolog? Tags: prolog Problem: How to solve this using Prolog? Write Prolog program that reads the students grades in AI class and keep reading until “stop” is read. Find the number of students whose grades are: Between 93 - 100 Between 83 and...
How to solve this using Prolog? How to solve this using Prolog? prolog Prolog How MARKS Number How to solve this using Prolog? Write Prolog program that reads the students grades in AI class and keep reading until “stop” is read. Find the number of students whose grades are: Between 93 - 100 Between 83 and less than 92
[ 0.00909423828125, 0.0089111328125, -0.0098876953125, 0.0081787109375, -0.01190185546875, 0.015380859375, -0.0130615234375, 0.0029449462890625, -0.004425048828125, -0.022705078125, -0.0004119873046875, -0.0223388671875, 0.00102996826171875, 0.01214599609375, 0.01348876953125, -0.0060729...
[ 11249, 47, 86869, 903, 17368, 1250, 4867, 32, 502, 29227, 20113, 103332, 601, 18781, 1528, 12301, 70, 25921, 44000, 7, 23, 38730, 18507, 136, 13695, 16454, 24189, 19111, 26040, 14012, 124901, 621, 1177, 17461, 20, 805, 19251, 40715, 15671 ]
[ 0.1021728515625, 0.0826416015625, 0.211669921875, 0.126708984375, 0.14013671875, 0.2203369140625, 0.2861328125, 0.029693603515625, 0.1724853515625, 0.213623046875, 0.205078125, 0.234130859375, 0.041015625, 0.059722900390625, 0.1646728515625, 0.16552734375, 0.0109100341796875, 0.265...
embed
31613025_c0
31613025
prolog
0
Title: Prolog predicate argument descriptors Problem title: Prolog predicate argument descriptors Tags: prolog Problem: Prolog predicate argument descriptors I have been learning prolog and often come across prolog comments that contain descriptors of a predicates argument types, i.e. % (list,integer,list) (+,+,-) or: ...
Prolog predicate argument descriptors Prolog predicate argument descriptors prolog Prolog Prolog predicate argument descriptors I have been learning prolog and often come across prolog comments that contain descriptors of a predicates argument types, i.e. or: the 1st set of paranthesised descriptors is pretty self expl...
[ 0.036376953125, 0.0050048828125, -0.0186767578125, -0.0167236328125, 0.002593994140625, 0.038818359375, 0.002685546875, -0.0028228759765625, -0.01953125, -0.002471923828125, 0.01165771484375, -0.0380859375, -0.0137939453125, -0.00160980224609375, 0.0048828125, 0.0107421875, 0.0117187...
[ 1250, 4867, 1653, 2063, 10750, 104, 121707, 67, 502, 52080, 27983, 36880, 24626, 70541, 1636, 52895, 106, 271, 5423, 121, 660, 160291, 5281, 28875, 15970, 14700, 14845, 31667, 116, 2208, 9077, 177953, 28852, 9384, 59376 ]
[ 0.15869140625, 0.1990966796875, 0.145263671875, 0.19091796875, 0.239990234375, 0.0589599609375, 0.2366943359375, 0.0037841796875, 0.125244140625, 0.03076171875, 0.0312042236328125, 0.00238037109375, 0.1326904296875, 0.0240936279296875, 0.048095703125, 0.160400390625, 0.02955627441406...
embed
53714807_c1
53714807
prolog
1
,Target), transit(Rel,Source,Mid), not(member(Mid,Visited)), path_(Rel,Mid,Target,Path,Len,[Source|Visited]). The above is my second attempt, but I receive errors on everything. My first attempt only worked with non-cyclical paths, such as for the is_a relationships, which is noted below: path0(Rel,From,To,[From,To],2)...
,Target), transit(Rel,Source,Mid), not(member(Mid,Visited)), path_(Rel,Mid,Target,Path,Len,[Source|Visited]). The above is my second attempt, but I receive errors on everything. My first attempt only worked with non-cyclical paths, such as for the is_a relationships, which is noted below: path0(Rel,From,To,[From,To],2)...
[ 0.0223388671875, 0.0159912109375, 0.0201416015625, 0.017822265625, 0.00201416015625, -0.0172119140625, -0.0260009765625, -0.0213623046875, 0.021240234375, -0.0556640625, 0.00177001953125, 0.0164794921875, -0.0269775390625, 0.0179443359375, 0.0169677734375, -0.0157470703125, 0.0060729...
[ 63031, 3794, 62621, 1052, 583, 211235, 594, 532, 959, 27417, 65331, 14, 3674, 247, 60875, 683, 10519, 866, 33, 4, 36917, 17932, 81887, 53299, 18499, 7, 98, 26818, 5117, 4734, 79786, 678, 351, 187830, 6827, 83, 454, 11, 151618, 35064, 23...
[ 0.1676025390625, 0.2198486328125, 0.2281494140625, 0.1143798828125, 0.15771484375, 0.17333984375, 0.0557861328125, 0.114013671875, 0.1240234375, 0.149658203125, 0.1236572265625, 0.089111328125, 0.10791015625, 0.013671875, 0.2119140625, 0.053009033203125, 0.1441650390625, 0.05282592...
embed
7620084_c0
7620084
prolog
0
Title: Nested Prolog functions Problem title: Nested Prolog functions Tags: prolog Problem: Nested Prolog functions rotate(X):- write('convert -rotate 90 '),write(X),write(' o.jpg'), writeln(0). beside(X,Y):- write('convert -scale 50%%x50%% '),write(X),writeln(' 0111.jpg'), write('convert -scale 50%%x50%% '),write(Y),w...
Nested Prolog functions Nested Prolog functions prolog Nested Prolog o.jpg x50 Nested Prolog functions above are my prolog codes for rotate and beside functions. How can i modify the codes to suit case like rotate(beside(X,Y)). which are nested
[ 0.0026397705078125, 0.0263671875, 0.006927490234375, 0.0087890625, -0.0133056640625, 0.033203125, -0.01153564453125, -0.0038299560546875, 0.0306396484375, 0.004241943359375, -0.0098876953125, -0.002838134765625, -0.0011444091796875, -0.0101318359375, 0.013916015625, -0.008544921875, ...
[ 28701, 71, 1250, 4867, 32354, 502, 36, 25687, 2525, 36917, 759, 18151, 7, 47014, 67, 136, 186, 8752, 11249, 831, 17, 2811, 40383, 70, 47, 60813, 7225, 1884, 1542, 1723, 8512 ]
[ 0.258544921875, 0.1396484375, 0.1719970703125, 0.2432861328125, 0.2110595703125, 0.14599609375, 0.0178680419921875, 0.0655517578125, 0.07989501953125, 0.058502197265625, 0.0206451416015625, 0.212158203125, 0.0190582275390625, 0.1943359375, 0.1588134765625, 0.0093994140625, 0.08422851...
embed
43664695_c0
43664695
prolog
0
Title: Create successor numbers from natural numbers Problem title: Create successor numbers from natural numbers Tags: successor-arithmetics, prolog Problem: Create successor numbers from natural numbers I want to create successor Numbers from natural numbers in Prolog. nat2s(0, s(0)). nat2s(NaturalNumber, SNumber) :-...
Create successor numbers from natural numbers Create successor numbers from natural numbers successor-arithmetics prolog natural Create nat2s NaturalNumber SNumber Create successor numbers from natural numbers I want to create successor Numbers from natural numbers in Prolog. The output should be like this: Actually it...
[ 0.0091552734375, 0.01409912109375, -0.009765625, 0.0208740234375, 0.0164794921875, 0.0074462890625, 0.00921630859375, 0.01611328125, 0.01458740234375, -0.026611328125, 0.01953125, 0.0087890625, -0.01123046875, 0.007415771484375, 0.0247802734375, 0.01611328125, 0.0224609375, 0.00933...
[ 151313, 39457, 42, 101935, 1295, 6083, 8962, 41637, 502, 4867, 24, 18, 304, 24955, 18444, 26278, 316, 1297, 3444, 28282, 103332, 7, 1250, 140992, 5608, 1884, 903, 192728, 54241, 5844, 40956, 3642, 3564, 29568, 16750 ]
[ 0.1240234375, 0.209228515625, 0.1513671875, 0.1639404296875, 0.0943603515625, 0.197265625, 0.04144287109375, 0.0163116455078125, 0.10028076171875, 0.222900390625, 0.031341552734375, 0.01031494140625, 0.08123779296875, 0.158935546875, 0.08685302734375, 0.12890625, 0.10711669921875, ...
embed
34324838_c0
34324838
prolog
0
Title: Prolog PostFix Issue Problem title: Prolog PostFix Issue Tags: prolog, prefix, suffix, append Problem: Prolog PostFix Issue I'm having trouble solving this prolog problem. Define a postfix predicate so that postfix(X,Y) says that X is a list that is a postfix of Y. That is, each element of X is equal to (unifies...
Prolog PostFix Issue Prolog PostFix Issue prolog prefix suffix append Prolog PostFix Issue Prolog PostFix Issue I'm having trouble solving this prolog problem. Define a postfix predicate so that postfix(X,Y) says that X is a list that is a postfix of Y. That is, each element of X is equal to (unifies with) the correspo...
[ 0.03271484375, 0.0146484375, 0.03173828125, -0.004119873046875, 0.007293701171875, -0.004486083984375, 0.006011962890625, 0.00506591796875, 0.018310546875, -0.0012054443359375, 0.020751953125, -0.005462646484375, -0.017822265625, -0.0205078125, -0.0021820068359375, -0.002349853515625, ...
[ 1250, 4867, 2795, 6159, 223317, 502, 183114, 133784, 425, 114689, 71, 63134, 2967, 262, 64552, 1305, 55923, 1653, 2063, 67, 221, 1542, 4, 1723, 17378, 1193, 83, 5303, 10, 111, 990, 12638, 12830, 105950, 5980, 1029, 678, 42518, 1284, 1543,...
[ 0.161376953125, 0.221923828125, 0.125732421875, 0.2225341796875, 0.1578369140625, 0.16845703125, 0.2427978515625, 0.171142578125, 0.0142669677734375, 0.135986328125, 0.0057373046875, 0.07421875, 0.125244140625, 0.00048828125, 0.14013671875, 0.15576171875, 0.26904296875, 0.188476562...
embed
15650042_c0
15650042
prolog
0
Title: Prolog difference list - mergesort Problem title: Prolog difference list - mergesort Tags: prolog, difference-lists Problem: Prolog difference list - mergesort I must write predicate which will split one list into two lists (on halve): halve(X-Y, X-Z, Z-Y) :- halve_pom(X-Y, X-Y, Z), !. halve_pom(Z-Y, Y-Y, Z). ha...
Prolog difference list - mergesort Prolog difference list - mergesort prolog difference-lists Prolog X-Y X-Z Z-Y halve_pom Y-Y A-Y B-Y Prolog difference list - mergesort I must write predicate which will split one list into two lists (on halve): That was easy, but now I must write algorithm which will do mergesort - I ...
[ 0.01806640625, 0.0011138916015625, 0.0203857421875, -0.01055908203125, -0.01446533203125, 0.040771484375, -0.0240478515625, 0.0045166015625, 0.0115966796875, -0.0137939453125, 0.006591796875, 0.01239013671875, 0.006805419921875, -0.006317138671875, 0.00286865234375, -0.01519775390625, ...
[ 1250, 4867, 60212, 5303, 42564, 62351, 502, 6562, 1193, 1723, 1511, 567, 106706, 31572, 990, 62, 335, 8110, 33022, 1653, 2063, 67, 65450, 1632, 3934, 6626, 191, 23468, 5036, 234873, 54, 2301, 18, 2499, 6528, 4527, 4358 ]
[ 0.1722412109375, 0.254150390625, 0.241943359375, 0.2138671875, 0.2318115234375, 0.247314453125, 0.121826171875, 0.164794921875, 0.066162109375, 0.12548828125, 0.09893798828125, 0.07537841796875, 0.2105712890625, 0.1466064453125, 0.04913330078125, 0.034027099609375, 0.013885498046875,...
embed
16331218_c0
16331218
prolog
0
Title: SICStus Prolog making product/3 rule from sum/3 Problem title: SICStus Prolog making product/3 rule from sum/3 Tags: prolog Problem: SICStus Prolog making product/3 rule from sum/3 First of all, this is a homework question, so please just give me a hint! %Here is a rule that defines sum/3 that returns yes if Z i...
SICStus Prolog making product/3 rule from sum/3 SICStus Prolog making product/3 rule from sum/3 prolog sum/3 SICStus Prolog Here How SICStus Prolog making product/3 rule from sum/3 First of all, this is a homework question, so please just give me a hint! Also, how can write a query on product such that it returns the a...
[ -0.01251220703125, 0.041259765625, 0.0089111328125, 0.01531982421875, -0.02490234375, 0.00958251953125, -0.017333984375, 0.0137939453125, 0.0162353515625, -0.0206298828125, 0.0162353515625, -0.00787353515625, -0.008056640625, -0.02587890625, 0.007232666015625, 0.0164794921875, 0.0191...
[ 159, 102198, 2143, 1250, 4867, 20662, 12996, 18113, 79986, 1295, 10554, 502, 11853, 11249, 18244, 9655, 22936, 8337, 163, 10, 5122, 18, 3642, 831, 33022, 41, 1294, 98, 6044, 30646, 35166, 111, 1193, 661, 990, 136, 959, 450, 29568 ]
[ 0.10418701171875, 0.06573486328125, 0.1983642578125, 0.13427734375, 0.223388671875, 0.0587158203125, 0.2236328125, 0.238037109375, 0.1859130859375, 0.07666015625, 0.16943359375, 0.049835205078125, 0.03643798828125, 0.051422119140625, 0.0775146484375, 0.00201416015625, 0.0191192626953...
embed
42402726_c0
42402726
prolog
0
Title: use_module in XSB Prolog Problem title: use_module in XSB Prolog Tags: http, porting, prolog, swi-prolog, xsb Problem: use_module in XSB Prolog I am porting http libraries from SWI Prolog to XSB Prolog. I have to port the following statement: use_module(library(settings)). to XSB. Can someone please tell me how ...
use_module in XSB Prolog use_module in XSB Prolog http porting prolog swi-prolog xsb use_module XSB Prolog set_setting current_setting use_module in XSB Prolog I am porting http libraries from SWI Prolog to XSB Prolog. I have to port the following statement: to XSB. Can someone please tell me how to do this. I understa...
[ -0.0038299560546875, 0.005523681640625, 0.002716064453125, 0.007171630859375, -0.00138092041015625, 0.022705078125, 0.0167236328125, 0.0042724609375, 0.0027008056640625, -0.049072265625, 0.0196533203125, -0.00531005859375, 0.000640869140625, -0.0260009765625, 0.0069580078125, 0.0002040...
[ 4527, 83279, 1193, 36474, 1250, 4867, 23, 1621, 196, 1916, 502, 2452, 3454, 1022, 7, 275, 5423, 89840, 43581, 35773, 10484, 159, 38969, 47, 11469, 63805, 14192, 3642, 54, 903, 686, 3871, 454, 183234, 32354, 144573, 4358 ]
[ 0.171142578125, 0.21337890625, 0.1324462890625, 0.243408203125, 0.1204833984375, 0.1944580078125, 0.0146484375, 0.149658203125, 0.12109375, 0.09130859375, 0.077392578125, 0.136962890625, 0.0838623046875, 0.0596923828125, 0.0570068359375, 0.14892578125, 0.1337890625, 0.1829833984375...
embed
59802153_c0
59802153
prolog
0
Title: How can I catch the output to the console in Prolog to verify it? Problem title: How can I catch the output to the console in Prolog to verify it? Tags: output, plunit, prolog, console, unit-testing Problem: How can I catch the output to the console in Prolog to verify it? Suppose I have a hello_name.pl: greetin...
How can I catch the output to the console in Prolog to verify it? How can I catch the output to the console in Prolog to verify it? output plunit prolog console unit-testing How Prolog Name catch_output Moncho ConsoleOutput How can I catch the output to the console in Prolog to verify it? Suppose I have a hello_name.pl...
[ -0.00775146484375, 0.017333984375, 0.02099609375, 0.0223388671875, -0.002349853515625, -0.00921630859375, 0.0191650390625, 0.0025634765625, -0.00109100341796875, 0.006439208984375, -0.00469970703125, 0.017578125, -0.01324462890625, -0.0208740234375, 0.0277099609375, 0.01220703125, 0....
[ 11249, 831, 105556, 140992, 47, 130250, 23, 1250, 4867, 493, 40383, 87, 12266, 6773, 502, 25072, 6954, 15757, 6056, 7077, 7465, 3089, 40777, 79858, 70, 442, 33600, 11627, 2424, 3444, 3884, 9844, 1884 ]
[ 0.0270233154296875, 0.058441162109375, 0.2249755859375, 0.2340087890625, 0.098388671875, 0.2008056640625, 0.039154052734375, 0.1533203125, 0.2376708984375, 0.12109375, 0.146240234375, 0.0211639404296875, 0.12060546875, 0.17041015625, 0.0880126953125, 0.095703125, 0.115966796875, 0....
embed
78136605_c1
78136605
prolog
1
). % on calcule sigma(u,v) en faisant le produit scalaire entre u1,...,uN,uN+1,..U2N et vN+1,...,v2N,v1,...,vN % on coupe L en un morceau de taille N et un autre split(L,0,[],L). split([X|Xs],N,[X|Ys],Zs) :- N1 is N - 1, split(Xs,N1,Ys,Zs). % produit scalaire ps([X1],[Y1],Res):- Res is X1*Y1. ps([X1|L1],[X2|L2],Res):- ...
). % on calcule sigma(u,v) en faisant le produit scalaire entre u1,...,uN,uN+1,..U2N et vN+1,...,v2N,v1,...,vN % on coupe L en un morceau de taille N et un autre split(L,0,[],L). split([X|Xs],N,[X|Ys],Zs) :- N1 is N - 1, split(Xs,N1,Ys,Zs). % produit scalaire ps([X1],[Y1],Res):- Res is X1*Y1. ps([X1|L1],[X2|L2],Res):- ...
[ -0.00738525390625, 0.0223388671875, -0.014404296875, -0.0380859375, -0.0106201171875, -0.0086669921875, 0.01397705078125, 0.01202392578125, 0.023681640625, -0.037353515625, -0.01312255859375, -0.005279541015625, 0.019775390625, 0.00469970703125, -0.006256103515625, -0.007537841796875, ...
[ 194, 1745, 98, 44805, 13, 1144, 192, 132, 34, 4, 334, 16, 22, 122327, 42414, 146232, 2149, 1148, 75, 418, 839, 21748, 1062, 304, 81, 14974, 339, 179427, 72700, 541, 19501, 65450, 866, 2389, 1542, 1723, 1511, 83, 106, 24014, 76172, 433...
[ 0.106201171875, 0.1668701171875, 0.0682373046875, 0.266357421875, 0.091552734375, 0.2371826171875, 0.3017578125, 0.005218505859375, 0.1490478515625, 0.03973388671875, 0.25634765625, 0.0140228271484375, 0.013336181640625, 0.057159423828125, 0.26318359375, 0.1947021484375, 0.1840820312...
embed
8290932_c0
8290932
prolog
0
Title: prolog how to connecting data using loop/recursion Problem title: prolog how to connecting data using loop/recursion Tags: recursion, prolog, loops Problem: prolog how to connecting data using loop/recursion I got data which is from father(adam, matt). father(matt,frank). father(frank,jim). grandfather:-father(X...
prolog how to connecting data using loop/recursion prolog how to connecting data using loop/recursion recursion prolog loops loop/recursion grandfather:-father prolog how to connecting data using loop/recursion I got data which is from How do I actually using a recursion to search the grandfather or maybe great grandfa...
[ 0.0146484375, 0.0172119140625, 0.0009765625, 0.0262451171875, -0.004638671875, 0.007568359375, 0.00775146484375, 0.01043701171875, 0.0283203125, -0.076171875, 0.006805419921875, -0.03369140625, -0.01385498046875, -0.0033721923828125, 0.01348876953125, -0.028564453125, 0.0057678222656...
[ 502, 4867, 3642, 47, 37067, 214, 2053, 17368, 40956, 107, 48650, 1830, 195625, 9963, 1021, 9319, 12, 64, 4163, 1295, 54, 20653, 33938, 707, 51139, 6782, 198343, 29459, 1193, 990, 756, 7722, 14858, 1286, 1632, 67373, 136, 775 ]
[ 0.16455078125, 0.2177734375, 0.07666015625, 0.1624755859375, 0.201416015625, 0.086181640625, 0.19287109375, 0.1224365234375, 0.25927734375, 0.083984375, 0.214599609375, 0.180908203125, 0.2265625, 0.153076171875, 0.1812744140625, 0.15380859375, 0.0308837890625, 0.0379638671875, 0....
embed
10434938_c0
10434938
prolog
0
Title: Prolog simple sort Problem title: Prolog simple sort Tags: sorting, prolog, structure Problem: Prolog simple sort In Prolog, what I have now is, :-dynamic listofPeople/2. listofPeople(Mark,Name). which basically contains the mark for each student. I want to print the best 3 marks. To do that I believe I have to ...
Prolog simple sort Prolog simple sort sorting prolog structure Prolog Mark Name Prolog simple sort In Prolog, what I have now is, which basically contains the mark for each student. I want to print the best 3 marks. To do that I believe I have to do sorting. If I do sorting, I will lose the order of the name of the stu...
[ 0.038818359375, -0.00469970703125, 0.0086669921875, 0.01263427734375, -0.0341796875, 0.00335693359375, -0.00750732421875, -0.005401611328125, 0.0137939453125, -0.01251220703125, -0.000640869140625, 0.002197265625, 0.006500244140625, -0.004638671875, 0.00665283203125, -0.0177001953125, ...
[ 1250, 4867, 8781, 12096, 214, 502, 45646, 7880, 15757, 2367, 765, 5036, 83, 198343, 70541, 16188, 100, 12638, 9836, 3444, 28412, 2965, 138, 7, 18822, 1221, 388, 12989, 9351, 28219, 114977, 4734, 123055, 59499, 4358, 28864 ]
[ 0.1712646484375, 0.2666015625, 0.1905517578125, 0.231201171875, 0.0831298828125, 0.1405029296875, 0.1978759765625, 0.1290283203125, 0.0980224609375, 0.01153564453125, 0.0172271728515625, 0.0299072265625, 0.022125244140625, 0.0146331787109375, 0.083740234375, 0.1666259765625, 0.003143...
embed
23899042_c0
23899042
prolog
0
Title: Writing a predicate for converting a float into a list of digits Problem title: Writing a predicate for converting a float into a list of digits Tags: prolog Problem: Writing a predicate for converting a float into a list of digits I need to write a predicate that takes a float number and returns a list its digi...
Writing a predicate for converting a float into a list of digits Writing a predicate for converting a float into a list of digits prolog Writing float_integer_part C-E Writing a predicate for converting a float into a list of digits I need to write a predicate that takes a float number and returns a list its digits. Fo...
[ -0.0036773681640625, -0.004669189453125, -0.006591796875, -0.000682830810546875, -0.01434326171875, 0.0206298828125, -0.002899169921875, 0.00439453125, 0.006378173828125, 0.005279541015625, -0.0019683837890625, 0.02392578125, -0.0184326171875, 0.01513671875, 0.004302978515625, -0.01257...
[ 213185, 1653, 2063, 67, 100, 96760, 21917, 257, 3934, 5303, 153939, 10, 214, 111, 502, 4867, 6191, 1505, 17365, 313, 9, 647, 3871, 33022, 51776, 14012, 136, 30646, 6863, 27781, 3293, 759, 18151 ]
[ 0.1373291015625, 0.1552734375, 0.210693359375, 0.1484375, 0.007598876953125, 0.1339111328125, 0.2015380859375, 0.142333984375, 0.0802001953125, 0.149169921875, 0.1827392578125, 0.0159149169921875, 0.030181884765625, 0.018463134765625, 0.06396484375, 0.13720703125, 0.0804443359375, ...
embed
26262227_c0
26262227
prolog
0
Title: Stuck with Prolog Problem title: Stuck with Prolog Tags: prolog, recursion Problem: Stuck with Prolog I just started learning Prolog. One of the exercise wants me to write backwards/2, a predicate that is true when the second list argument is the reverse of the first list argument. And I have to use a paste pred...
Stuck with Prolog Stuck with Prolog prolog recursion Stuck Prolog Lrev Stuck with Prolog I just started learning Prolog. One of the exercise wants me to write backwards/2, a predicate that is true when the second list argument is the reverse of the first list argument. And I have to use a paste predicate to write backw...
[ -0.00592041015625, 0.03857421875, 0.0185546875, 0.00823974609375, 0.0030975341796875, 0.0233154296875, -0.00567626953125, 0.00390625, 0.0140380859375, -0.015380859375, 0.0024566650390625, 0.0150146484375, -0.01171875, -0.00543212890625, 0.009033203125, 0.005218505859375, 0.0118408203...
[ 26085, 2594, 678, 1250, 4867, 502, 195625, 1830, 65381, 52080, 81979, 86171, 33022, 4420, 19364, 7, 12477, 1653, 2063, 67, 29568, 17932, 5303, 10750, 83, 39531, 184, 5117, 4527, 71099, 79786, 21974, 35166, 765 ]
[ 0.147216796875, 0.0947265625, 0.1080322265625, 0.16748046875, 0.2447509765625, 0.12841796875, 0.1942138671875, 0.0170745849609375, 0.1534423828125, 0.06085205078125, 0.10546875, 0.055267333984375, 0.140380859375, 0.16015625, 0.209228515625, 0.057342529296875, 0.2342529296875, 0.145...
embed
70422215_c0
70422215
prolog
0
Title: find all pair of grandfather relationships using prolog Problem title: find all pair of grandfather relationships using prolog Tags: prolog Problem: find all pair of grandfather relationships using prolog If you have these facts: parent(albert, bob). parent(albert, betsy). parent(albert, bill). parent(alice, bob...
find all pair of grandfather relationships using prolog find all pair of grandfather relationships using prolog prolog prolog grand_parent find all pair of grandfather relationships using prolog If you have these facts: And then this code: How to write a query to find all pairs that share grand-parenthood relationship?
[ 0.000492095947265625, 0.0225830078125, 0.0103759765625, 0.00732421875, -0.0048828125, 0.005157470703125, -0.014892578125, 0.005462646484375, 0.0076904296875, -0.04736328125, 0.0166015625, -0.017578125, 0.0113525390625, -0.01373291015625, -0.00164031982421875, 0.002166748046875, -0.00...
[ 7413, 756, 80836, 111, 9963, 1021, 9319, 151618, 17368, 502, 4867, 99547, 765, 15824, 18151, 11249, 33022, 41, 1294, 47, 7, 450, 12008, 9, 44462, 76755 ]
[ 0.1485595703125, 0.13232421875, 0.2098388671875, 0.044952392578125, 0.1622314453125, 0.1693115234375, 0.1375732421875, 0.1817626953125, 0.0616455078125, 0.1507568359375, 0.2054443359375, 0.1973876953125, 0.0003123283386230469, 0.05511474609375, 0.10003662109375, 0.01006317138671875, ...
embed
24323473_c0
24323473
prolog
0
Title: Prolog - getting only one answer Problem title: Prolog - getting only one answer Tags: prolog Problem: Prolog - getting only one answer I have this program in Prolog: foo([],L2,L2). foo(L1,[],L1):-L1=[_|_). foo([H1|T1],[H2|T2],[H1|T3]):-foo(T1,[H2|T2],T3). foo([H1|T1],[H2|T2],[H2|T3]):-foo([H1|T1],T2,T3). I run ...
Prolog - getting only one answer Prolog - getting only one answer prolog Prolog Prolog - getting only one answer I have this program in Prolog: I run the query I got : and when I typed a semicolon ( ; ) to get more answers, I got False ... but when I run it by hand using backtracking I also got the answer [1,a,2] . I d...
[ 0.0181884765625, 0.0179443359375, 0.00457763671875, -0.000484466552734375, -0.0181884765625, 0.0027313232421875, -0.009765625, 0.016357421875, 0.00714111328125, -0.035400390625, 0.0057373046875, -0.011962890625, -0.006591796875, 0.0198974609375, -0.0014190673828125, -0.007171630859375,...
[ 1250, 4867, 20949, 4734, 1632, 35166, 502, 1528, 11675, 41, 1294, 10644, 40, 46029, 4759, 2819, 1286, 22225, 184, 3535, 4420, 125728, 214, 11, 90173, 28219, 9969, 34759, 76199 ]
[ 0.1640625, 0.262939453125, 0.09716796875, 0.1297607421875, 0.1910400390625, 0.228271484375, 0.116455078125, 0.08868408203125, 0.0758056640625, 0.09002685546875, 0.073486328125, 0.129150390625, 0.049835205078125, 0.1209716796875, 0.1318359375, 0.058349609375, 0.064453125, 0.11828613...
embed
28392151_c0
28392151
prolog
0
Title: Split a list in separate lists Problem title: Split a list in separate lists Tags: prolog Problem: Split a list in separate lists I have to define some more constraints for my list. I want to split my list is separate lists. Example: List=[[1,1],[_,0],[_,0],[_,0],[3,1],[_,0],[9,1],[2,0],[4,0]] I need three Lists...
Split a list in separate lists Split a list in separate lists prolog Split List Split a list in separate lists I have to define some more constraints for my list. I want to split my list is separate lists. Example: I need three Lists which i get from the main list: SO I always need a group of lists between a term with ...
[ 0.00274658203125, 0.002227783203125, -0.00433349609375, 0.01458740234375, -0.03173828125, 0.0159912109375, -0.00013446807861328125, 0.0167236328125, 0.00121307373046875, 0.0303955078125, -0.0047607421875, -0.005218505859375, -0.00799560546875, 0.0166015625, -0.00927734375, 0.0250244140...
[ 46474, 10, 5303, 23, 84797, 502, 4867, 32036, 765, 61924, 1286, 158, 2816, 4288, 3444, 65450, 83, 7, 89536, 3871, 17262, 2046, 1295, 5201, 15969, 11343, 21115, 17721, 13579, 678, 1542, 76172, 6782, 6069, 29806, 86869, 233592 ]
[ 0.25537109375, 0.06854248046875, 0.251220703125, 0.1322021484375, 0.242431640625, 0.117431640625, 0.1566162109375, 0.2108154296875, 0.012359619140625, 0.1240234375, 0.06610107421875, 0.031707763671875, 0.141357421875, 0.1055908203125, 0.05975341796875, 0.2242431640625, 0.070983886718...
embed
47241875_c0
47241875
prolog
0
Title: Make function check objects in predicate Prolog Problem title: Make function check objects in predicate Prolog Tags: prolog Problem: Make function check objects in predicate Prolog I've recently started learning Prolog and I've a question about predicates and functions. How can I write a function which will chec...
Make function check objects in predicate Prolog Make function check objects in predicate Prolog prolog Make Prolog Make function check objects in predicate Prolog I've recently started learning Prolog and I've a question about predicates and functions. How can I write a function which will check if objects in a predica...
[ 0.0086669921875, 0.0096435546875, -0.0035400390625, 0.01495361328125, -0.006256103515625, 0.0189208984375, -0.0155029296875, 0.006622314453125, 0.00238037109375, -0.030517578125, 0.015380859375, -0.038330078125, 0.0164794921875, -0.0234375, 0.007171630859375, 0.0147705078125, 0.01770...
[ 26176, 32354, 12765, 36746, 7, 23, 1653, 2063, 67, 1250, 4867, 502, 52080, 9655, 1636, 33022, 2174, 83, 15700, 3249, 28412, 26008, 80854, 959, 95378, 5170 ]
[ 0.0927734375, 0.2427978515625, 0.2347412109375, 0.2015380859375, 0.046661376953125, 0.12548828125, 0.17236328125, 0.2222900390625, 0.0986328125, 0.169677734375, 0.23828125, 0.0946044921875, 0.0577392578125, 0.00634765625, 0.0633544921875, 0.1226806640625, 0.0823974609375, 0.0464172...
embed
20552651_c0
20552651
prolog
0
Title: Maximum in a List Problem title: Maximum in a List Tags: prolog Problem: Maximum in a List I have a list and each element of the list has five components, so the list would be something like [[1,3,4,5,6], [2,4,5,15,16],...]. I want to find the maximum of the third component of all elements in the list. I am usin...
Maximum in a List Maximum in a List prolog Maximum List Max Max1 Maximum in a List I have a list and each element of the list has five components, so the list would be something like [[1,3,4,5,6], [2,4,5,15,16],...]. I want to find the maximum of the third component of all elements in the list. I am using the following...
[ 0.00823974609375, -0.00174713134765625, 0.0250244140625, 0.024658203125, -0.0079345703125, 0.0150146484375, -0.016357421875, 0.01953125, 0.01385498046875, -0.01025390625, 0.006439208984375, -0.013427734375, -0.0036468505859375, -0.00537109375, 0.000640869140625, -0.0015411376953125, ...
[ 46540, 316, 23, 10, 32036, 502, 4867, 9920, 418, 87, 765, 5303, 12638, 12830, 1556, 43606, 82761, 2806, 186, 1884, 82449, 104629, 4, 80389, 1837, 2485, 3444, 47, 7413, 38132, 111, 50960, 756, 80854, 17368, 25632, 124374, 14602, 959, 4488,...
[ 0.2408447265625, 0.1934814453125, 0.105224609375, 0.054718017578125, 0.264404296875, 0.1318359375, 0.1805419921875, 0.214599609375, 0.07763671875, 0.001983642578125, 0.009521484375, 0.23583984375, 0.04339599609375, 0.1668701171875, 0.0158538818359375, 0.1700439453125, 0.2227783203125...
embed
16159010_c0
16159010
prolog
0
Title: List of lists in prolog? Problem title: List of lists in prolog? Tags: prolog Problem: List of lists in prolog? I know how to manipulate lists in prolog but I am having trouble with lists of lists, I am studying for an exam and this is one of the practise questions. Can someone help me out with it. All attempts ...
List of lists in prolog? List of lists in prolog? prolog List max2D List of lists in prolog? I know how to manipulate lists in prolog but I am having trouble with lists of lists, I am studying for an exam and this is one of the practise questions. Can someone help me out with it. All attempts I have made so far were ut...
[ 0.0240478515625, 0.0040283203125, -0.000957489013671875, 0.0123291015625, -0.01611328125, 0.04052734375, 0.00445556640625, 0.00701904296875, 0.0079345703125, -0.006591796875, 0.0223388671875, 0.0002651214599609375, 0.0177001953125, -0.01470947265625, 0.0037689208984375, -0.007873535156...
[ 32036, 111, 5303, 7, 23, 502, 4867, 18389, 304, 397, 3714, 45258, 63134, 42276, 17823, 4358, 81887, 137578, 1653, 2063, 67, 142424, 171859, 30646, 38132, 756, 89536, 140992, 10149 ]
[ 0.171142578125, 0.0826416015625, 0.2335205078125, 0.06866455078125, 0.055023193359375, 0.15625, 0.2261962890625, 0.1513671875, 0.1087646484375, 0.140625, 0.0141448974609375, 0.1248779296875, 0.06591796875, 0.03851318359375, 0.003875732421875, 0.007293701171875, 0.0244598388671875, ...
embed
30126737_c0
30126737
prolog
0
Title: Prefix in Prolog Problem title: Prefix in Prolog Tags: prolog, prefix, list Problem: Prefix in Prolog I'm new in Prolog. I have a problem about predicate prefix but a little bit different. I want to get a prefix of a list but until an element The list can have repeat elements. An example: prefix(Element, List, P...
Prefix in Prolog Prefix in Prolog prolog prefix list Prefix Prolog Element List Prefix in Prolog I'm new in Prolog. I have a problem about predicate prefix but a little bit different. I want to get a prefix of a list but until an element The list can have repeat elements. An example: The element is not included. What I...
[ 0.01007080078125, 0.004180908203125, 0.0198974609375, 0.002838134765625, -0.01324462890625, -0.0010833740234375, -0.000942230224609375, 0.01068115234375, -0.00152587890625, -0.01806640625, 0.0050048828125, -0.002777099609375, -0.0174560546875, -0.0069580078125, -0.00122833251953125, 0....
[ 1914, 55923, 23, 1250, 4867, 502, 183114, 5303, 48325, 32036, 3525, 2967, 1653, 2063, 67, 12921, 3444, 2046, 111, 1284, 24189, 12830, 831, 119140, 80854, 27781, 959, 99201, 2060, 14602, 4488 ]
[ 0.0550537109375, 0.1890869140625, 0.032989501953125, 0.1456298828125, 0.2320556640625, 0.0982666015625, 0.223876953125, 0.142578125, 0.163818359375, 0.0994873046875, 0.012847900390625, 0.052764892578125, 0.08831787109375, 0.1094970703125, 0.01190185546875, 0.0298309326171875, 0.03515...
embed
321974_c0
321974
prolog
0
Title: How to verify if a rule exists in a prolog file clause database Problem title: How to verify if a rule exists in a prolog file clause database Tags: prolog Problem: How to verify if a rule exists in a prolog file clause database I'm working on a college assignment where I must verify if a certain clause (as a fa...
How to verify if a rule exists in a prolog file clause database How to verify if a rule exists in a prolog file clause database prolog How How to verify if a rule exists in a prolog file clause database I'm working on a college assignment where I must verify if a certain clause (as a fact or as a rule) exists in the cu...
[ 0.03759765625, 0.00872802734375, 0.005462646484375, 0.038818359375, -0.01123046875, 0.01458740234375, -0.00872802734375, 0.008544921875, 0.01190185546875, -0.0478515625, 0.0037078857421875, -0.00007724761962890625, -0.005828857421875, -0.026123046875, 0.0014801025390625, -0.00018978118...
[ 11249, 47, 493, 40383, 2174, 10, 79986, 32316, 7, 23, 502, 4867, 11435, 70731, 13, 63399, 20697, 40466, 95486, 24233, 162, 15824, 43581, 6528, 4527, 10336, 11627, 155937, 29568, 15700, 9351, 4358, 77947 ]
[ 0.073974609375, 0.0355224609375, 0.169189453125, 0.199951171875, 0.1220703125, 0.055999755859375, 0.24365234375, 0.218994140625, 0.09649658203125, 0.077392578125, 0.1627197265625, 0.221435546875, 0.1727294921875, 0.189208984375, 0.0899658203125, 0.2010498046875, 0.0188140869140625, ...
embed
10823087_c0
10823087
prolog
0
Title: Prolog - generate correct bracketing Problem title: Prolog - generate correct bracketing Tags: list, prolog Problem: Prolog - generate correct bracketing I'd like to get some help in the following exam problem, I have no idea how to do this: Input: a list of numbers, eg.: [1,2,3,4] Output: every possible correct...
Prolog - generate correct bracketing Prolog - generate correct bracketing list prolog Prolog Prolog - generate correct bracketing I'd like to get some help in the following exam problem, I have no idea how to do this: Input: a list of numbers, eg.: [1,2,3,4] Output: every possible correct bracketing. Eg.: (in case of i...
[ -0.0047607421875, 0.00811767578125, -0.0037841796875, -0.0157470703125, 0.01177978515625, 0.017578125, -0.0291748046875, -0.01007080078125, 0.0022735595703125, -0.017333984375, -0.0185546875, -0.0184326171875, -0.0098876953125, 0.0027008056640625, -0.0084228515625, -0.0155029296875, ...
[ 1250, 4867, 139392, 26785, 1620, 27853, 214, 5303, 502, 1884, 4358, 25632, 42276, 2967, 110, 6528, 3642, 54, 903, 360, 7077, 101935, 30046, 133063, 82449, 13538, 11907, 7722, 107730, 6163, 3688, 55300, 6626, 10750, 127664, 1363, 140992, 12989...
[ 0.1517333984375, 0.2222900390625, 0.194091796875, 0.170654296875, 0.2152099609375, 0.229248046875, 0.1337890625, 0.13330078125, 0.103271484375, 0.06890869140625, 0.09490966796875, 0.06951904296875, 0.15966796875, 0.0946044921875, 0.018280029296875, 0.06396484375, 0.0355224609375, 0...
embed
26803995_c0
26803995
prolog
0
Title: Cut(!) vs return Problem title: Cut(!) vs return Tags: prolog-cut, prolog Problem: Cut(!) vs return I am developing a predicate in Prolog and it is possible for it to terminate before the end of it. For that reason I was looking for a command similar to return; (C++). I used a cut ! but I'm doubtful as to what i...
Cut(!) vs return Cut(!) vs return prolog-cut prolog Cut Cut(!) vs return I am developing a predicate in Prolog and it is possible for it to terminate before the end of it. For that reason I was looking for a command similar to return; (C++). I used a cut ! but I'm doubtful as to what it literally stands for and if it d...
[ 0.024658203125, 0.00836181640625, 0.0291748046875, -0.00009298324584960938, 0.00148773193359375, 0.00830078125, 0.01116943359375, -0.0027618408203125, 0.00946044921875, -0.01177978515625, 0.00567626953125, 0.015869140625, 0.000804901123046875, -0.0001697540283203125, 0.00927734375, 0.0...
[ 3003, 18, 151399, 20209, 30646, 502, 4867, 19774, 168698, 1653, 2063, 67, 1250, 7722, 47, 121011, 13, 8108, 3564, 111, 16487, 75101, 21373, 441, 37223, 11814, 59226, 711, 92814, 7844, 2367, 442, 218500, 9157, 100, 14602, 66161, 74, 32354, ...
[ 0.256103515625, 0.1832275390625, 0.165283203125, 0.191162109375, 0.302490234375, 0.15087890625, 0.234375, 0.2269287109375, 0.090087890625, 0.13134765625, 0.1683349609375, 0.07208251953125, 0.14208984375, 0.0849609375, 0.013153076171875, 0.1634521484375, 0.105712890625, 0.1212158203...
embed
54470594_c0
54470594
prolog
0
Title: Constructing XOR/3 in Prolog Problem title: Constructing XOR/3 in Prolog Tags: xor, prolog Problem: Constructing XOR/3 in Prolog I have the following clauses for /3 propositional logic. statement(false). statement(true). not(false, true). not(true, false). and(false, false, false). and(false, true, false). and(t...
Constructing XOR/3 in Prolog Constructing XOR/3 in Prolog xor prolog Constructing XOR Prolog Not_X Constructing XOR/3 in Prolog I have the following clauses for /3 propositional logic. How would I go about adding XOR clauses?
[ 0.0245361328125, 0.0203857421875, 0.006744384765625, -0.01019287109375, -0.01556396484375, 0.01483154296875, -0.0028839111328125, 0.01287841796875, -0.00128936767578125, 0.004852294921875, -0.0213623046875, -0.01171875, 0.0003681182861328125, -0.0079345703125, 0.0034942626953125, 0.013...
[ 1657, 36716, 1193, 24638, 18113, 1250, 4867, 214, 23, 74706, 502, 11205, 1542, 25632, 70731, 89261, 289, 62775, 154107, 90 ]
[ 0.00839996337890625, 0.14111328125, 0.0728759765625, 0.2369384765625, 0.25146484375, 0.1353759765625, 0.2135009765625, 0.01227569580078125, 0.0025177001953125, 0.1683349609375, 0.081298828125, 0.08111572265625, 0.076904296875, 0.037109375, 0.1849365234375, 0.139892578125, 0.037261962...
embed
70723520_c0
70723520
prolog
0
Title: Invert atoms from list to integers - Prolog Problem title: Invert atoms from list to integers - Prolog Tags: atomic, prolog, list, integer Problem: Invert atoms from list to integers - Prolog I have this: streams=[[1,2,2,4],[2,1,4,2],[3,4,1,3],[4,3,3,1]] And the numbers inside that lists are all atoms and I need...
Invert atoms from list to integers - Prolog Invert atoms from list to integers - Prolog atomic prolog list integer list Invert Prolog Invert atoms from list to integers - Prolog I have this: And the numbers inside that lists are all atoms and I need to invert then all to integers. The streams should look like this: But...
[ -0.007080078125, 0.010986328125, 0.013427734375, 0.0281982421875, 0.0034027099609375, 0.0108642578125, -0.004638671875, 0.0032958984375, -0.01123046875, 0.005859375, 0.0086669921875, -0.00579833984375, 0.01611328125, 0.0390625, 0.01055908203125, 0.005615234375, 0.023681640625, -0.0...
[ 148639, 18, 34627, 7, 1295, 5303, 47, 892, 26255, 1250, 4867, 1771, 502, 1505, 765, 903, 101935, 46132, 450, 756, 3871, 131983, 7068, 75973, 5608, 6713, 1884, 9384, 6191, 959, 5928, 22008, 73342, 3642, 30334, 5037, 22936 ]
[ 0.224853515625, 0.1148681640625, 0.224609375, 0.042572021484375, 0.1123046875, 0.2098388671875, 0.1268310546875, 0.1658935546875, 0.1895751953125, 0.12841796875, 0.1956787109375, 0.03143310546875, 0.09759521484375, 0.123046875, 0.0404052734375, 0.038055419921875, 0.15380859375, 0.1...
embed
22736380_c0
22736380
prolog
0
Title: How to print a list in Prolog Problem title: How to print a list in Prolog Tags: prolog Problem: How to print a list in Prolog I assert student details to DB like this. assert(details(Age,Name,Dob,Zodiac)). I want to get a details list sorted by Age(asending or desending) and display it somethin like this. Name ...
How to print a list in Prolog How to print a list in Prolog prolog How Prolog Age Name Dob Zodiac Date Birth Sign How to print a list in Prolog I assert student details to DB like this. I want to get a details list sorted by Age(asending or desending) and display it somethin like this. I tried with bagof,findall but co...
[ 0.029296875, 0.007293701171875, 0.00555419921875, 0.0216064453125, -0.0322265625, 0.009521484375, -0.0086669921875, -0.00018978118896484375, -0.0068359375, 0.01043701171875, 0.000476837158203125, -0.01165771484375, 0.00180816650390625, -0.01055908203125, -0.0027923583984375, -0.0048828...
[ 11249, 47, 28412, 10, 5303, 23, 1250, 4867, 502, 72944, 15757, 37968, 5880, 3390, 25512, 2992, 48838, 237, 33657, 9836, 41653, 57976, 1884, 903, 3444, 2046, 17497, 390, 6991, 33770, 47112, 6238, 44116, 110023, 37842, 678, 41780, 420, 111607...
[ 0.07269287109375, 0.0616455078125, 0.228759765625, 0.0538330078125, 0.2489013671875, 0.072998046875, 0.1817626953125, 0.250244140625, 0.1505126953125, 0.153564453125, 0.059539794921875, 0.0919189453125, 0.03662109375, 0.082275390625, 0.01806640625, 0.05242919921875, 0.10723876953125,...
embed
9864586_c0
9864586
prolog
0
Title: Prolog dcg generating all words from language Problem title: Prolog dcg generating all words from language Tags: prolog, left-recursion, dcg Problem: Prolog dcg generating all words from language I'm trying to write some dcg grammar in prolog which will describe language of a^nb^n n>=0 "",ab,aabb,aaabbb itd All ...
Prolog dcg generating all words from language Prolog dcg generating all words from language prolog left-recursion dcg language Prolog Prolog dcg generating all words from language I'm trying to write some dcg grammar in prolog which will describe language of a^nb^n n>=0 "",ab,aabb,aaabbb itd All what I wrote is And its...
[ 0.011962890625, -0.0024566650390625, -0.002838134765625, 0.01434326171875, -0.0045166015625, 0.01416015625, -0.0096435546875, -0.006439208984375, 0.00021457672119140625, -0.051513671875, -0.00750732421875, -0.01263427734375, -0.0050048828125, -0.00004744529724121094, 0.00927734375, 0.0...
[ 1250, 4867, 104, 238, 177, 12663, 1916, 756, 34153, 1295, 46876, 502, 25737, 107, 48650, 1830, 31577, 33022, 122092, 147, 98363, 111, 10, 8353, 653, 2740, 145407, 2055, 10545, 76596, 5125, 54397, 6863, 4127, 4989, 12765, 2174, 2565, 26785, ...
[ 0.1434326171875, 0.260009765625, 0.056060791015625, 0.08721923828125, 0.1602783203125, 0.1837158203125, 0.042694091796875, 0.126708984375, 0.179931640625, 0.1400146484375, 0.171630859375, 0.1209716796875, 0.142578125, 0.008514404296875, 0.1224365234375, 0.032928466796875, 0.032836914...
embed
45378732_c0
45378732
prolog
0
Title: First order logic Prolog anonymous variables Problem title: First order logic Prolog anonymous variables Tags: prolog-anonymous-variable, first-order-logic, prolog Problem: First order logic Prolog anonymous variables The Prolog rule below: grandparent(X,Z) :- parent(X,Y) , parent(Y,Z) In first order logic is go...
First order logic Prolog anonymous variables First order logic Prolog anonymous variables prolog-anonymous-variable first-order-logic prolog First Prolog First order logic Prolog anonymous variables The Prolog rule below: In first order logic is going to be: In theory if we have an anonymous variable in our Prolog rule...
[ 0.0238037109375, 0.00604248046875, 0.004974365234375, 0.00970458984375, 0.00007343292236328125, 0.0228271484375, 0.018310546875, 0.00970458984375, -0.0025787353515625, -0.0303955078125, 0.01092529296875, -0.00640869140625, -0.0169677734375, -0.006591796875, 0.0111083984375, 0.000598907...
[ 23972, 12989, 62775, 1250, 4867, 52184, 77336, 502, 66, 45757, 21690, 5117, 80596, 137043, 79986, 35064, 360, 7730, 186, 154453, 765, 142, 83, 10, 613, 11627, 3642, 831, 13379, 442 ]
[ 0.1151123046875, 0.181640625, 0.2236328125, 0.1661376953125, 0.26220703125, 0.2105712890625, 0.2427978515625, 0.1077880859375, 0.06744384765625, 0.16943359375, 0.1036376953125, 0.1416015625, 0.14794921875, 0.16552734375, 0.197265625, 0.1129150390625, 0.049041748046875, 0.0415039062...
embed
23314050_c0
23314050
prolog
0
Title: Prolog repeating solutions on symmetric relations Problem title: Prolog repeating solutions on symmetric relations Tags: prolog, relation, symmetric Problem: Prolog repeating solutions on symmetric relations Consider this small program: married(bill, hillary). spouse(X, Y) :- married(X, Y); married(Y, X). likes(...
Prolog repeating solutions on symmetric relations Prolog repeating solutions on symmetric relations prolog relation symmetric Prolog Prolog repeating solutions on symmetric relations Consider this small program: Now I want to evaluate a goal Is there a way to prevent repeating on this symmetric relation when backtrack ...
[ -0.0111083984375, 0.0302734375, 0.01953125, 0.005950927734375, -0.00726318359375, -0.00518798828125, -0.00592041015625, 0.00007963180541992188, -0.0052490234375, -0.043701171875, -0.0264892578125, 0.0103759765625, -0.0230712890625, -0.00921630859375, 0.01544189453125, 0.0230712890625, ...
[ 1250, 4867, 119140, 214, 51347, 98, 230612, 238, 91582, 502, 41911, 137399, 19336, 1528, 14240, 3444, 151575, 13, 69236, 2685, 10, 3917, 47, 56282, 903, 3229, 4420, 125728, 7464, 479, 86687, 954, 3019, 15123, 100, 109458, 1884, 78280, 6635,...
[ 0.1646728515625, 0.24951171875, 0.28564453125, 0.1390380859375, 0.1876220703125, 0.1236572265625, 0.231201171875, 0.0772705078125, 0.184326171875, 0.1041259765625, 0.1912841796875, 0.0196685791015625, 0.08514404296875, 0.145263671875, 0.002227783203125, 0.033935546875, 0.137939453125...
embed
67020010_c0
67020010
prolog
0
Title: Difference function in prolog for multisets Problem title: Difference function in prolog for multisets Tags: prolog Problem: Difference function in prolog for multisets I want to calculate the difference between two lists - Here is my attempt at it difference(X, [], X). difference(H,[S|T],H):- del(S, H, H2), dif...
Difference function in prolog for multisets Difference function in prolog for multisets prolog Difference Difference function in prolog for multisets I want to calculate the difference between two lists - Here is my attempt at it But when I call it difference([a,a,b,b,b,c,d,d],[b,b,c,c,c,d,d,e],X). false. It returns fa...
[ 0.016845703125, 0.02880859375, 0.01153564453125, -0.00714111328125, -0.002197265625, 0.01177978515625, -0.0002079010009765625, 0.00360107421875, 0.0159912109375, -0.01507568359375, 0.007171630859375, 0.01068115234375, -0.0040283203125, 0.00101470947265625, 0.01409912109375, 0.008911132...
[ 803, 18234, 6620, 32354, 23, 502, 4867, 100, 6024, 3509, 3444, 74481, 67, 70, 60212, 17721, 6626, 5303, 81887, 4966, 11782, 11, 275, 238, 71, 1542, 98320, 30646, 64457, 68772, 35166, 5608, 10, 876 ]
[ 0.1201171875, 0.2469482421875, 0.1580810546875, 0.1966552734375, 0.0479736328125, 0.16552734375, 0.2327880859375, 0.05804443359375, 0.172119140625, 0.2227783203125, 0.043975830078125, 0.1649169921875, 0.06097412109375, 0.027740478515625, 0.279052734375, 0.1358642578125, 0.09558105468...
embed
69596884_c1
69596884
prolog
1
natural number(N) and the counting set Sn = {1,2,...,N} But this solution is buggy as regions_ncolors(L,N). only returns the same(one) solution for all N, and when I try to add a constraint to N, it goes in an infinite loop. So what can I do to make the most general query work both ways(for not-instantiated variables)...
natural number(N) and the counting set Sn = {1,2,...,N} But this solution is buggy as regions_ncolors(L,N). only returns the same(one) solution for all N, and when I try to add a constraint to N, it goes in an infinite loop. So what can I do to make the most general query work both ways(for not-instantiated variables)...
[ -0.01611328125, 0.0062255859375, -0.002410888671875, 0.0126953125, 0.00994873046875, -0.001434326171875, -0.00592041015625, 0.020263671875, 0.031494140625, -0.0299072265625, 0.0038909912109375, 0.00067901611328125, 0.0250244140625, 0.0101318359375, 0.0106201171875, 0.018798828125, -0...
[ 6083, 14012, 839, 136, 54529, 214, 5423, 159, 19, 2203, 133063, 27, 29806, 373, 67192, 10776, 46133, 866, 30646, 5701, 3630, 756, 541, 9790, 15190, 158, 2816, 4288, 60899, 54241, 40956, 831, 3249, 2684, 4537, 41, 1294, 4488, 15044, 48322,...
[ 0.1947021484375, 0.1861572265625, 0.14013671875, 0.029754638671875, 0.17919921875, 0.067626953125, 0.1737060546875, 0.04595947265625, 0.1116943359375, 0.020233154296875, 0.1363525390625, 0.00042724609375, 0.14111328125, 0.0911865234375, 0.1851806640625, 0.1878662109375, 0.21081542968...
embed
26707776_c1
26707776
prolog
1
, _SourceHead, []) :- fail. passesDistanceConstraint(Constraint, SourceHead, [TargetHead|TargetTail]) :- Distance is TargetHead - SourceHead, ( abs(Distance) =\= Constraint %test failed -> passesDistanceConstraint(Constraint, SourceHead, TargetTail) ; write('Distance constraint passed for '), write(SourceHead), nl ). I...
, _SourceHead, []) :- fail. passesDistanceConstraint(Constraint, SourceHead, [TargetHead|TargetTail]) :- Distance is TargetHead - SourceHead, ( abs(Distance) =\= Constraint %test failed -> passesDistanceConstraint(Constraint, SourceHead, TargetTail) ; write('Distance constraint passed for '), write(SourceHead), nl ). I...
[ 0.0238037109375, 0.0032196044921875, 0.00616455078125, -0.0023040771484375, 0.0159912109375, 0.00165557861328125, -0.031494140625, -0.008544921875, 0.006195068359375, -0.01397705078125, 0.0091552734375, -0.00518798828125, -0.0004730224609375, -0.005706787109375, 0.0037384033203125, 0.0...
[ 211235, 13025, 712, 15772, 35782, 10922, 7, 14055, 116071, 11935, 2816, 4288, 77641, 63031, 3794, 9874, 379, 154349, 329, 83, 160017, 43719, 1657, 6954, 165523, 33022, 158, 115081, 100, 13169, 903, 686, 2967, 26366, 24887, 5773, 4358, 28864, ...
[ 0.2413330078125, 0.21142578125, 0.1845703125, 0.0052490234375, 0.2344970703125, 0.184326171875, 0.045684814453125, 0.140380859375, 0.2061767578125, 0.0638427734375, 0.2064208984375, 0.16748046875, 0.25146484375, 0.1304931640625, 0.182373046875, 0.1710205078125, 0.1280517578125, 0.2...
embed
36335633_c0
36335633
prolog
0
Title: Difference between logic programming and automated theorem proving Problem title: Difference between logic programming and automated theorem proving Tags: theorem-proving, prolog, logic-programming Problem: Difference between logic programming and automated theorem proving What is the difference between logic pr...
Difference between logic programming and automated theorem proving Difference between logic programming and automated theorem proving theorem-proving prolog logic-programming Difference Difference between logic programming and automated theorem proving What is the difference between logic programming and automated theo...
[ 0.0196533203125, 0.0166015625, 0.005218505859375, 0.0096435546875, 0.00592041015625, 0.0125732421875, 0.00125885009765625, -0.004241943359375, 0.0087890625, -0.015380859375, 0.01043701171875, 0.0037689208984375, -0.0166015625, 0.0181884765625, 0.003662109375, 0.0081787109375, 0.01391...
[ 803, 18234, 6620, 17721, 62775, 56037, 449, 136, 11408, 297, 70, 58391, 502, 6496, 70628, 214, 4867, 28966, 83, 60212, 284, 23658, 678, 241, 9, 10752, 814, 159, 13409, 707, 108405, 5915, 4677, 14037, 127216, 479, 86927, 42, 111, 959, 19...
[ 0.1070556640625, 0.2105712890625, 0.0501708984375, 0.118408203125, 0.2186279296875, 0.2354736328125, 0.137939453125, 0.10595703125, 0.2210693359375, 0.090087890625, 0.08404541015625, 0.210205078125, 0.13916015625, 0.1490478515625, 0.157470703125, 0.0170440673828125, 0.17138671875, ...
embed
55251829_c0
55251829
prolog
0
Title: Prolog determinant of matrix (recursion) Problem title: Prolog determinant of matrix (recursion) Tags: prolog Problem: Prolog determinant of matrix (recursion) For example, in math, if you want to calculate the area of a triangle characterized by three point A(1,2) B(3,4) C(5,6) , the formula is: |Ax Bx| |Bx Cx|...
Prolog determinant of matrix (recursion) Prolog determinant of matrix (recursion) prolog Prolog Prolog determinant of matrix (recursion) For example, in math, if you want to calculate the area of a triangle characterized by three point A(1,2) B(3,4) C(5,6) , the formula is: In this case: 1x4-2x3+3x6-4x5+5x2-1x6 = 4-6+1...
[ 0.02734375, 0.022705078125, 0.018798828125, -0.013671875, -0.00531005859375, -0.01220703125, 0.00506591796875, 0.0185546875, 0.0201416015625, -0.0181884765625, 0.002593994140625, -0.0225830078125, -0.0191650390625, -0.0179443359375, 0.017333984375, 0.00011920928955078125, 0.031494140...
[ 1250, 4867, 27354, 660, 111, 50944, 425, 107, 48650, 1830, 502, 27781, 23, 48909, 3444, 74481, 67, 16128, 1927, 109217, 62816, 29367, 17262, 6275, 62, 133063, 335, 82449, 313, 104629, 26168, 7225, 617, 5428, 363, 85398, 173674, 131815, 1469...
[ 0.16552734375, 0.2841796875, 0.24072265625, 0.1361083984375, 0.1116943359375, 0.192626953125, 0.0830078125, 0.10052490234375, 0.2381591796875, 0.18310546875, 0.17041015625, 0.0242462158203125, 0.0596923828125, 0.141845703125, 0.0677490234375, 0.1954345703125, 0.07763671875, 0.21313...
embed
37634782_c0
37634782
prolog
0
Title: Why is my predicate not backtracking? Problem title: Why is my predicate not backtracking? Tags: backtracking, prolog Problem: Why is my predicate not backtracking? I don't understand why my predicate doesnt backtrack and find all solutions. person(john). person(erik). allExceptSpider(person(Spider),T ):- setof(...
Why is my predicate not backtracking? Why is my predicate not backtracking? backtracking prolog Why Spider Why is my predicate not backtracking? I don't understand why my predicate doesnt backtrack and find all solutions. If I call this predicate with Two variables: Then it will only give me the answer Z = john, Q = [p...
[ 0.0002288818359375, 0.02880859375, -0.00836181640625, 0.0260009765625, -0.0086669921875, 0.00872802734375, 0.0037384033203125, 0.0135498046875, 0.005279541015625, -0.04296875, 0.01055908203125, 0.01251220703125, 0.002166748046875, 0.01129150390625, 0.0240478515625, -0.0031280517578125,...
[ 44084, 83, 759, 1653, 2063, 67, 959, 4420, 125728, 214, 502, 4867, 103336, 28219, 15400, 22027, 18, 7413, 756, 51347, 11782, 32964, 77336, 4734, 35166, 567, 2203, 35254, 19, 2396, 30816, 2154, 23742, 783, 2737, 66159 ]
[ 0.1541748046875, 0.045196533203125, 0.1070556640625, 0.191162109375, 0.2161865234375, 0.1568603515625, 0.164794921875, 0.18310546875, 0.23095703125, 0.10760498046875, 0.126953125, 0.1448974609375, 0.250732421875, 0.055145263671875, 0.1239013671875, 0.09368896484375, 0.114501953125, ...
embed
75237813_c0
75237813
prolog
0
Title: Prolog: Create a List from a selection of a given List Problem title: Prolog: Create a List from a selection of a given List Tags: prolog, list Problem: Prolog: Create a List from a selection of a given List I want to write a predicate in Prolog, which creates a all possible segments of a given Size of a given L...
Prolog: Create a List from a selection of a given List Prolog: Create a List from a selection of a given List prolog list a Prolog Create List select_seg Segment Rest Size Head_Segs Tail_Segs Head_Rest Tail_Rest Acc New_Acc Seg Prolog: Create a List from a selection of a given List I want to write a predicate in Prolog...
[ -0.005584716796875, 0.006439208984375, 0.01171875, 0.019775390625, -0.020751953125, -0.0076904296875, -0.0152587890625, 0.0152587890625, 0.027099609375, 0.0198974609375, 0.012451171875, -0.006103515625, -0.00069427490234375, 0.023193359375, 0.006591796875, -0.0084228515625, 0.0081176...
[ 1250, 4867, 151313, 32036, 1295, 132216, 34475, 502, 5303, 36849, 25398, 38462, 49756, 80378, 44816, 4233, 9405, 1218, 379, 525, 1052, 29899, 2356, 10060, 3444, 33022, 1653, 2063, 67, 28282, 756, 7722, 33180, 30646, 51, 23765, 80854, 237, 2...
[ 0.1695556640625, 0.2276611328125, 0.1636962890625, 0.2265625, 0.08984375, 0.1348876953125, 0.092529296875, 0.1273193359375, 0.17041015625, 0.134765625, 0.1171875, 0.14892578125, 0.1024169921875, 0.1015625, 0.0987548828125, 0.0240936279296875, 0.07928466796875, 0.0171051025390625, ...
embed
71342403_c0
71342403
prolog
0
Title: In SWI Prolog, how can I prevent the interpreter from entering interactive mode during an error? Problem title: In SWI Prolog, how can I prevent the interpreter from entering interactive mode during an error? Tags: prolog Problem: In SWI Prolog, how can I prevent the interpreter from entering interactive mode du...
In SWI Prolog, how can I prevent the interpreter from entering interactive mode during an error? In SWI Prolog, how can I prevent the interpreter from entering interactive mode during an error? prolog entering SWI Prolog set_prolog_flag not_valid test.pl Warning test.pl:4 Singleton ERROR test.pl:2 Initialization Undefi...
[ -0.0087890625, 0.000728607177734375, 0.034423828125, 0.001007080078125, -0.0177001953125, 0.0145263671875, 0.004791259765625, 0.01165771484375, -0.0159912109375, -0.01953125, 0.004180908203125, -0.006927490234375, -0.01446533203125, -0.003875732421875, 0.0301513671875, 0.00147247314453...
[ 159, 38969, 1250, 4867, 3642, 831, 87, 56282, 29481, 56, 1295, 22, 33558, 212398, 13736, 20271, 18499, 502, 5423, 3454, 190872, 959, 7013, 3034, 2424, 5550, 617, 43609, 1507, 151206, 24638, 1890, 289, 5983, 10752, 444, 13307, 142, 148431, ...
[ 0.0711669921875, 0.2210693359375, 0.14501953125, 0.18896484375, 0.0484619140625, 0.053131103515625, 0.001312255859375, 0.187744140625, 0.2115478515625, 0.130859375, 0.0584716796875, 0.07708740234375, 0.07061767578125, 0.1888427734375, 0.140625, 0.105224609375, 0.1832275390625, 0.09...
embed
22444868_c0
22444868
prolog
0
Title: Prolog Between two set times Problem title: Prolog Between two set times Tags: prolog Problem: Prolog Between two set times LONG STORY SHORT I have a file called timetable.pl that has a pradicate (r,s,t)- r is the name of the train, s is the list of stations it stops at and t is a list of given times for the the...
Prolog Between two set times Prolog Between two set times prolog Prolog Between timetable.pl Prolog Between two set times LONG STORY SHORT I have a file called timetable.pl that has a pradicate (r,s,t)- r is the name of the train, s is the list of stations it stops at and t is a list of given times for the them stops. ...
[ 0.01190185546875, -0.00177764892578125, 0.02587890625, 0.00775146484375, 0.015869140625, -0.0185546875, -0.00109100341796875, 0.018310546875, 0.00250244140625, -0.032470703125, 0.017333984375, 0.0284423828125, -0.019287109375, -0.002777099609375, 0.02099609375, 0.003936767578125, 0.0...
[ 1250, 4867, 6300, 1177, 33, 6626, 5423, 20028, 502, 1733, 22819, 2424, 176487, 208230, 18883, 11435, 1645, 18601, 67, 7, 18, 1690, 9351, 70, 25550, 91, 5303, 29398, 7279, 808, 34475, 61924, 1653, 2063, 11737, 70059, 418, 10461, 16401, 304...
[ 0.1492919921875, 0.22802734375, 0.039703369140625, 0.15625, 0.074951171875, 0.126708984375, 0.1783447265625, 0.1708984375, 0.13427734375, 0.183349609375, 0.1998291015625, 0.1636962890625, 0.009429931640625, 0.031158447265625, 0.035919189453125, 0.148681640625, 0.09295654296875, 0.1...
embed
28731623_c0
28731623
prolog
0
Title: Prolog: using tell to create another .pl Problem title: Prolog: using tell to create another .pl Tags: prolog Problem: Prolog: using tell to create another .pl So here is a method in my program where i want to write everything to the 'currentState.pl' however when i consult the file i get this error, line 27 is ...
Prolog: using tell to create another .pl Prolog: using tell to create another .pl prolog tell Prolog currentState.pl Current State Saved Prolog: using tell to create another .pl So here is a method in my program where i want to write everything to the 'currentState.pl' however when i consult the file i get this error, ...
[ 0.0086669921875, -0.0032196044921875, 0.002777099609375, 0.0208740234375, -0.003082275390625, 0.00787353515625, -0.015625, 0.00604248046875, -0.00142669677734375, -0.0634765625, -0.00286865234375, 0.013427734375, 0.013671875, 0.0025787353515625, 0.00860595703125, -0.0255126953125, -0...
[ 1250, 4867, 17368, 14192, 47, 28282, 15700, 5, 2424, 502, 43581, 135206, 13, 114063, 22836, 947, 4126, 3688, 55300, 1528, 3444, 33022, 26818, 163812, 49903, 75463, 11435, 2046, 903, 18499, 13315, 1438, 83, 132, 4358, 77947, 27592, 25732, 19...
[ 0.162353515625, 0.23046875, 0.1026611328125, 0.2998046875, 0.044647216796875, 0.13427734375, 0.1165771484375, 0.06744384765625, 0.23876953125, 0.125, 0.185791015625, 0.1654052734375, 0.0810546875, 0.193603515625, 0.2083740234375, 0.082275390625, 0.049072265625, 0.01605224609375, ...
embed
21649243_c0
21649243
prolog
0
Title: Prolog - generate and test, how to write a rule square(S) Problem title: Prolog - generate and test, how to write a rule square(S) Tags: integer, prolog, perfect-square, generator Problem: Prolog - generate and test, how to write a rule square(S) I have to write a rule square(S) in Prolog that tests if a number ...
Prolog - generate and test, how to write a rule square(S) Prolog - generate and test, how to write a rule square(S) integer prolog perfect-square generator Prolog Prolog - generate and test, how to write a rule square(S) I have to write a rule square(S) in Prolog that tests if a number S is the square of an integer ret...
[ -0.00274658203125, 0.016357421875, -0.000835418701171875, -0.00133514404296875, -0.00762939453125, 0.0145263671875, -0.0037078857421875, -0.011962890625, -0.01171875, -0.000606536865234375, 0.007232666015625, 0.0155029296875, -0.00848388671875, -0.00836181640625, 0.01055908203125, -0.0...
[ 1250, 4867, 139392, 136, 3034, 3642, 33022, 79986, 108047, 294, 47, 10, 132, 892, 1505, 502, 15787, 145823, 765, 109921, 2174, 14012, 159, 83, 30646, 214, 98320, 69829, 29568, 99217, 11814, 21771, 756, 26255, 17721, 757, 276 ]
[ 0.150634765625, 0.227294921875, 0.1959228515625, 0.048797607421875, 0.1424560546875, 0.0391845703125, 0.18994140625, 0.2105712890625, 0.2568359375, 0.171875, 0.040557861328125, 0.0236663818359375, 0.013885498046875, 0.1326904296875, 0.043060302734375, 0.090576171875, 0.09283447265625...
embed
23733473_c0
23733473
prolog
0
Title: Compare lists in Prolog Problem title: Compare lists in Prolog Tags: list, comparison, fact, prolog Problem: Compare lists in Prolog I need to compare a list to a fact which includes a list. For example I have two facts: level1(toothed_whale,[1,2]). level1(baleen_whale,[2,1]). I want to create a predicate which ...
Compare lists in Prolog Compare lists in Prolog list comparison fact prolog Compare Prolog level1 toothed_whale baleen_whale Compare lists in Prolog I need to compare a list to a fact which includes a list. For example I have two facts: I want to create a predicate which compares these facts with list of my creation. I...
[ 0.0037078857421875, -0.00016117095947265625, 0.003631591796875, 0.0208740234375, -0.00994873046875, -0.0031280517578125, 0.004669189453125, 0.01190185546875, 0.0089111328125, -0.01043701171875, 0.0157470703125, 0.01806640625, -0.0017852783203125, -0.003662109375, -0.002777099609375, -0...
[ 113307, 13, 5303, 1250, 4867, 225490, 15824, 502, 17366, 418, 47, 818, 5252, 434, 50742, 88076, 33, 7, 23, 3871, 69101, 96853, 6626, 3444, 28282, 1653, 2063, 678, 166635, 32354, 30646 ]
[ 0.1741943359375, 0.037200927734375, 0.2357177734375, 0.1541748046875, 0.249755859375, 0.16845703125, 0.1669921875, 0.1036376953125, 0.15185546875, 0.0406494140625, 0.105712890625, 0.10498046875, 0.113525390625, 0.061920166015625, 0.1917724609375, 0.1383056640625, 0.1234130859375, 0...
embed
32920565_c0
32920565
prolog
0
Title: Consulting a shared prolog file Problem title: Consulting a shared prolog file Tags: command-line, java, network-programming, prolog Problem: Consulting a shared prolog file I am trying to consult a Prolog file on my Ubuntu PC which is shared on LAN by remote Ubuntu PC. I want to do this using java code. So i tr...
Consulting a shared prolog file Consulting a shared prolog file command-line java network-programming prolog Consulting Runtime.getRunTime sharedFile.pl Consulting a shared prolog file I am trying to consult a Prolog file on my Ubuntu PC which is shared on LAN by remote Ubuntu PC. I want to do this using java code. So ...
[ 0.041748046875, 0.0224609375, 0.00494384765625, 0.01239013671875, -0.0128173828125, -0.00628662109375, -0.009765625, 0.004486083984375, 0.004669189453125, -0.07373046875, 0.035400390625, 0.00628662109375, -0.0208740234375, -0.0167236328125, -0.003082275390625, 0.01153564453125, 0.031...
[ 149512, 99764, 502, 4867, 11435, 10, 75101, 2256, 79, 330, 33120, 28966, 28398, 6032, 163321, 70059, 174350, 2424, 31577, 75463, 1250, 116890, 6107, 48450, 148814, 3444, 54, 17368, 18151, 37842, 25632, 18499, 10752, 61475, 15032, 165523, 147845...
[ 0.279541015625, 0.1822509765625, 0.184814453125, 0.245849609375, 0.19140625, 0.03936767578125, 0.100830078125, 0.04791259765625, 0.1383056640625, 0.2039794921875, 0.07025146484375, 0.05035400390625, 0.00225830078125, 0.06396484375, 0.050628662109375, 0.1141357421875, 0.1494140625, ...
embed
23190495_c0
23190495
prolog
0
Title: Determine if number is prime in Prolog Problem title: Determine if number is prime in Prolog Tags: primes, prolog, primality-test Problem: Determine if number is prime in Prolog So I'm trying to determine if a number is prime using only one predicate. I don't really understand why every number is being declared ...
Determine if number is prime in Prolog Determine if number is prime in Prolog primes prolog primality-test 1 Determine Prolog is_prime Determine if number is prime in Prolog So I'm trying to determine if a number is prime using only one predicate. I don't really understand why every number is being declared false here.
[ -0.0040283203125, 0.005157470703125, 0.024658203125, 0.00872802734375, 0.00909423828125, 0.0145263671875, 0.00921630859375, -0.0224609375, 0.0198974609375, -0.027099609375, 0.014404296875, -0.010009765625, -0.01129150390625, 0.00262451171875, -0.00640869140625, 0.0201416015625, 0.006...
[ 262, 30524, 13, 2174, 14012, 83, 20809, 23, 1250, 4867, 502, 29810, 134393, 6954, 106, 114654, 31577, 83324, 17368, 4734, 1632, 1653, 2063, 28219, 15400, 11907, 159978, 98320, 3688 ]
[ 0.049560546875, 0.1326904296875, 0.0234222412109375, 0.083251953125, 0.1785888671875, 0.085693359375, 0.2220458984375, 0.057464599609375, 0.1583251953125, 0.2220458984375, 0.1121826171875, 0.1300048828125, 0.07171630859375, 0.1331787109375, 0.045074462890625, 0.190185546875, 0.015472...
embed
49017085_c1
49017085
prolog
1
["S", "BB"], ["A", "CC"], ["A", "AB"], ["A", "a"], ["B", "BB"], ["B", "CA"], ["B"|...], [...|...]|...], Cell = [_G2912, _G2915, _G2918, _G2921, "A", _G2933, _G2936, _G2939, _G2942|...]. So, you see that "A" is in the resulting list, which is correct, but I can't figure out why it's giving me all the extra stuff. I ass...
["S", "BB"], ["A", "CC"], ["A", "AB"], ["A", "a"], ["B", "BB"], ["B", "CA"], ["B"|...], [...|...]|...], Cell = [_G2912, _G2915, _G2918, _G2921, "A", _G2933, _G2936, _G2939, _G2942|...]. So, you see that "A" is in the resulting list, which is correct, but I can't figure out why it's giving me all the extra stuff. I ass...
[ -0.00144195556640625, 0.0152587890625, 0.01513671875, 0.0341796875, -0.006256103515625, 0.00518798828125, -0.004364013671875, 0.015869140625, 0.00017261505126953125, 0.00897216796875, 0.021240234375, -0.00007677078247070312, -0.006072998046875, 0.015625, -0.0034027099609375, -0.0222167...
[ 294, 22312, 284, 13709, 11040, 571, 13133, 80743, 2203, 724, 4235, 1530, 1837, 1819, 3117, 9185, 8659, 9323, 13023, 1957, 83, 23, 16750, 5303, 26785, 831, 18, 26366, 15400, 68772, 163, 756, 70, 4173, 41884, 41591, 959, 51339, 195625, 1830...
[ 0.08111572265625, 0.1463623046875, 0.160400390625, 0.082275390625, 0.114990234375, 0.05816650390625, 0.059417724609375, 0.265625, 0.02099609375, 0.003326416015625, 0.16015625, 0.1309814453125, 0.1192626953125, 0.1090087890625, 0.0731201171875, 0.134521484375, 0.0821533203125, 0.114...
embed
34599838_c0
34599838
prolog
0
Title: Height of a tree - PROLOG Problem title: Height of a tree - PROLOG Tags: prolog, height, binary-tree, tree Problem: Height of a tree - PROLOG I try to write a predicate to find the height of a tree in Prolog. My tree is represented like this: A / \ B C / \ / \ D E F G [a,[b,[d,e],c[f,g]]] ([Root,[Children]]) My ...
Height of a tree - PROLOG Height of a tree - PROLOG prolog height binary-tree tree Height PROLOG Height of a tree - PROLOG I try to write a predicate to find the height of a tree in Prolog. My tree is represented like this: [a,[b,[d,e],c[f,g]]] ([Root,[Children]]) My predicate is: But my code doesn't work. When I write...
[ 0.02001953125, 0.00811767578125, -0.0020599365234375, -0.00110626220703125, 0.000652313232421875, 0.01348876953125, -0.0185546875, 0.003021240234375, -0.003814697265625, -0.059326171875, -0.004150390625, -0.018798828125, -0.02587890625, 0.000606536865234375, 0.0361328125, -0.0014801025...
[ 1529, 22553, 111, 53201, 10514, 47510, 502, 4867, 155955, 2394, 6635, 62600, 10, 9790, 33022, 1653, 2063, 67, 7413, 70, 23, 1250, 33636, 1884, 177, 12724, 818, 102656, 982, 759, 18151, 18, 4488, 541, 105950, 3217, 4358, 74855, 9842, 99, ...
[ 0.189697265625, 0.193603515625, 0.120849609375, 0.2320556640625, 0.1595458984375, 0.1962890625, 0.1192626953125, 0.225341796875, 0.255859375, 0.1253662109375, 0.0640869140625, 0.186279296875, 0.0162506103515625, 0.048370361328125, 0.10040283203125, 0.1409912109375, 0.1644287109375, ...
embed
37119193_c0
37119193
prolog
0
Title: Filtering elements of a list in Prolog Problem title: Filtering elements of a list in Prolog Tags: prolog Problem: Filtering elements of a list in Prolog In my project I need to build a list of possible moves. I've already done that, but I need to filter the possible moves from previous moves. How can I do that?...
Filtering elements of a list in Prolog Filtering elements of a list in Prolog prolog Filtering Prolog PossibleMoves PreviousMoves PossibleMovesLeft Filtering elements of a list in Prolog In my project I need to build a list of possible moves. I've already done that, but I need to filter the possible moves from previous...
[ 0.00015544891357421875, 0.0269775390625, 0.01348876953125, 0.0081787109375, -0.0244140625, 0.003265380859375, -0.0133056640625, 0.016357421875, 0.0234375, -0.0103759765625, -0.02294921875, -0.002899169921875, -0.000762939453125, -0.00177764892578125, -0.0157470703125, 0.00677490234375,...
[ 128896, 214, 80854, 111, 5303, 23, 1250, 4867, 502, 115861, 2661, 9083, 3132, 6422, 2480, 13452, 3871, 45367, 7722, 25813, 21771, 46312, 1295, 96362, 717, 37842, 154109, 1328, 32786, 206, 92, 36272, 83425, 44691 ]
[ 0.256591796875, 0.04095458984375, 0.1614990234375, 0.00384521484375, 0.1978759765625, 0.0118408203125, 0.16162109375, 0.2371826171875, 0.12255859375, 0.168212890625, 0.1024169921875, 0.1263427734375, 0.045684814453125, 0.1182861328125, 0.1104736328125, 0.055511474609375, 0.0252838134...
embed
74858083_c1
74858083
prolog
1
that fido is a dog as a condition for another rule, I'd have to wrap it in the proven_true() predicate, e.g.: barks(X) :- proven_true(dog(X)). What I would like is some way to have X always be true if proven_true(X) is also true. That way, I could write the above rule as barks(X) :- dog(X). For a specific term like do...
that fido is a dog as a condition for another rule, I'd have to wrap it in the proven_true() predicate, e.g.: barks(X) :- proven_true(dog(X)). What I would like is some way to have X always be true if proven_true(X) is also true. That way, I could write the above rule as barks(X) :- dog(X). For a specific term like do...
[ -0.00007772445678710938, 0.006195068359375, 0.0034027099609375, 0.0113525390625, -0.00970458984375, 0.005859375, 0.003326416015625, 0.00848388671875, 0.01025390625, -0.03955078125, -0.005767822265625, 0.01409912109375, -0.01470947265625, 0.01190185546875, 0.007537841796875, 0.018798828...
[ 450, 809, 246, 83, 10, 10269, 35431, 15700, 79986, 137565, 60449, 9774, 13, 132, 1653, 2063, 67, 1909, 1224, 1542, 15772, 38507, 2806, 1884, 3917, 765, 1193, 11343, 186, 29568, 2174, 2843, 33022, 36917, 237, 29458, 13579, 69307, 756, 6940...
[ 0.113525390625, 0.1707763671875, 0.2108154296875, 0.08514404296875, 0.05584716796875, 0.2132568359375, 0.2437744140625, 0.04266357421875, 0.180908203125, 0.1180419921875, 0.2142333984375, 0.17822265625, 0.06524658203125, 0.0057373046875, 0.1219482421875, 0.1505126953125, 0.0186157226...
embed
4345547_c0
4345547
prolog
0
Title: How to define the facts in prolog db for planing metro routes? Problem title: How to define the facts in prolog db for planing metro routes? Tags: shortest-path, prolog Problem: How to define the facts in prolog db for planing metro routes? Well i cant decide how should my facts look in the prolog database...and...
How to define the facts in prolog db for planing metro routes? How to define the facts in prolog db for planing metro routes? shortest-path prolog How How to define the facts in prolog db for planing metro routes? Well i cant decide how should my facts look in the prolog database...and my assignment is to write predica...
[ 0.0186767578125, -0.004791259765625, 0.0034637451171875, 0.0164794921875, -0.01214599609375, -0.004486083984375, 0.0033416748046875, -0.006103515625, 0.0146484375, -0.046142578125, 0.01123046875, 0.002838134765625, -0.036376953125, -0.0034027099609375, -0.01165771484375, 0.008422851562...
[ 11249, 61924, 70, 15824, 7, 23, 502, 4867, 40041, 100, 1774, 214, 23205, 36439, 16610, 525, 128405, 45767, 28288, 6713, 63399, 95486, 33022, 1653, 2063, 60875, 17721, 116, 1614, 7514, 29398, 6528, 3115, 2967, 63134, 93766, 33636, 124519, 12...
[ 0.049713134765625, 0.206787109375, 0.025299072265625, 0.199462890625, 0.1683349609375, 0.03314208984375, 0.1217041015625, 0.22607421875, 0.1861572265625, 0.001251220703125, 0.146240234375, 0.0221405029296875, 0.1287841796875, 0.0966796875, 0.16015625, 0.14404296875, 0.1575927734375, ...
embed
4642728_c0
4642728
prolog
0
Title: insert element in a list and return the same list updated Problem title: insert element in a list and return the same list updated Tags: prolog Problem: insert element in a list and return the same list updated Hi i'm trying to insert an element in a list but it is very important from my program that the result ...
insert element in a list and return the same list updated insert element in a list and return the same list updated prolog insert element in a list and return the same list updated Hi i'm trying to insert an element in a list but it is very important from my program that the result is stored in the original list and no...
[ -0.0113525390625, 0.00616455078125, 0.00775146484375, 0.00750732421875, -0.00811767578125, 0.0208740234375, -0.040771484375, -0.0281982421875, -0.0028533935546875, -0.053466796875, 0.03564453125, -0.021728515625, -0.0205078125, -0.021240234375, 0.00909423828125, 0.0361328125, 0.00686...
[ 183540, 12830, 23, 5303, 30646, 5701, 150011, 502, 4867, 31577, 5526, 1528, 16750, 4343, 7311, 959, 3525, 18151, 59121, 14037, 1820, 214493, 28282, 3564, 93544, 14192, 61924, 32354, 132, 1542, 4, 866, 7440, 1193, 83, 339 ]
[ 0.262451171875, 0.193359375, 0.06121826171875, 0.2093505859375, 0.143798828125, 0.0950927734375, 0.143798828125, 0.1007080078125, 0.152099609375, 0.064453125, 0.072998046875, 0.058807373046875, 0.12109375, 0.08099365234375, 0.041839599609375, 0.0152587890625, 0.0193023681640625, 0....
embed
13227080_c0
13227080
prolog
0
Title: Prolog allowing multiple query argument orders Problem title: Prolog allowing multiple query argument orders Tags: function, prolog Problem: Prolog allowing multiple query argument orders I'm working on some homework in Prolog and I have to use something similar enough to: rules: brothers(a,b) brothers(c,d) and ...
Prolog allowing multiple query argument orders Prolog allowing multiple query argument orders function prolog Prolog Prolog allowing multiple query argument orders I'm working on some homework in Prolog and I have to use something similar enough to: rules: and I have to implement the ability to query brothers(b,a) and ...
[ 0.0174560546875, 0.0159912109375, 0.0166015625, -0.0028533935546875, -0.021484375, -0.000621795654296875, -0.0125732421875, -0.002349853515625, 0.01165771484375, -0.03759765625, 0.01483154296875, -0.0257568359375, -0.0034027099609375, -0.00872802734375, -0.00445556640625, 0.00427246093...
[ 1250, 4867, 190358, 48716, 41, 1294, 10750, 12989, 32354, 502, 20697, 5368, 18244, 4527, 21373, 91736, 29479, 81273, 82953, 7, 275, 11, 2046, 29568, 15490, 19441, 171763, 63399, 17569, 17368, 1542, 1723, 54241, 195625, 5844, 831, 15044, 12305...
[ 0.168701171875, 0.2083740234375, 0.138671875, 0.2454833984375, 0.1864013671875, 0.1185302734375, 0.235595703125, 0.2305908203125, 0.1485595703125, 0.136474609375, 0.04052734375, 0.00762939453125, 0.0723876953125, 0.0567626953125, 0.0570068359375, 0.154296875, 0.11962890625, 0.10607...
embed
20360431_c0
20360431
prolog
0
Title: Need help to write f:N->N in prolog Problem title: Need help to write f:N->N in prolog Tags: recursion, prolog, iteration Problem: Need help to write f:N->N in prolog I'm suppose to write f:N->N f(0)=2,f(1)=0,f(2)=3 f(n)=3f(n-3)+2f(n-2)-(n-1) for n>=3. both iteratively and recursively, This is what I have ...
Need help to write f:N->N in prolog Need help to write f:N->N in prolog recursion prolog iteration Need f:N n-3 n-2 n-1 F5-F1 Need help to write f:N->N in prolog I'm suppose to write f:N->N both iteratively and recursively, This is what I have so far iteratively but i keep getting 3 for N>2 Any help you can give ...
[ 0.005035400390625, -0.01495361328125, -0.00299072265625, -0.01031494140625, -0.0013275146484375, 0.007293701171875, -0.005706787109375, 0.01141357421875, -0.0019989013671875, -0.0211181640625, 0.0140380859375, -0.0189208984375, -0.01373291015625, 0.01025390625, 0.02099609375, -0.001464...
[ 52889, 4358, 47, 33022, 1238, 12, 839, 9, 1230, 5386, 23, 502, 4867, 195625, 1830, 720, 653, 8316, 5428, 5759, 563, 55426, 919, 418, 103607, 139124, 15044, 45023, 5844, 2060, 1284, 13695, 20949, 138, 100, 541, 2740, 304, 28541, 831, 833...
[ 0.1162109375, 0.1405029296875, 0.015533447265625, 0.1717529296875, 0.1529541015625, 0.0858154296875, 0.242919921875, 0.1085205078125, 0.0740966796875, 0.1944580078125, 0.08660888671875, 0.17919921875, 0.2421875, 0.1873779296875, 0.031768798828125, 0.1962890625, 0.0535888671875, 0.1...
embed
8663849_c0
8663849
prolog
0
Title: Is it possible to produce .o files with a compiler and then link them using another compiler? Problem title: Is it possible to produce .o files with a compiler and then link them using another compiler? Tags: compilation, gnu, linker, iphone, prolog Problem: Is it possible to produce .o files with a compiler and...
Is it possible to produce .o files with a compiler and then link them using another compiler? Is it possible to produce .o files with a compiler and then link them using another compiler? compilation gnu linker iphone prolog another Is it possible to produce .o files with a compiler and then link them using another com...
[ 0.0142822265625, 0.01068115234375, -0.01422119140625, -0.0164794921875, -0.01708984375, -0.001983642578125, 0.01123046875, 0.0079345703125, 0.0057373046875, -0.03271484375, -0.048095703125, 0.00823974609375, -0.00799560546875, 0.00262451171875, 0.01422119140625, -0.01519775390625, -0...
[ 2071, 442, 7722, 27489, 5, 31, 102158, 678, 9969, 34759, 3126, 17368, 15700, 7068, 98352, 104155, 56, 71798, 502, 4867, 47, 149016, 1340, 238, 136, 2424, 4129, 99954, 47599, 13964, 13452, 4527, 4027 ]
[ 0.0263671875, 0.031463623046875, 0.1741943359375, 0.185546875, 0.090087890625, 0.2398681640625, 0.1962890625, 0.0892333984375, 0.1839599609375, 0.18408203125, 0.1968994140625, 0.049957275390625, 0.08514404296875, 0.0229644775390625, 0.145263671875, 0.1990966796875, 0.1053466796875, ...
embed
16977718_c0
16977718
prolog
0
Title: Building a list in prolog Problem title: Building a list in prolog Tags: list, prolog, recursion Problem: Building a list in prolog im a beginner on prolog, and I am trying to return a list of results. Say i have items belonging to a person ie. items(person1,apple). items(person1,orange). I want to be able to cr...
Building a list in prolog Building a list in prolog list prolog recursion Building Building a list in prolog im a beginner on prolog, and I am trying to return a list of results. Say i have items belonging to a person ie. items(person1,apple). items(person1,orange). I want to be able to create a function that can retur...
[ 0.01153564453125, 0.01031494140625, 0.000415802001953125, 0.00020503997802734375, -0.006561279296875, 0.0106201171875, -0.02099609375, 0.00836181640625, 0.01904296875, -0.04736328125, 0.0196533203125, -0.0224609375, -0.00946044921875, 0.01336669921875, 0.0002918243408203125, 0.01013183...
[ 104919, 5303, 23, 502, 4867, 195625, 1830, 9842, 1679, 31577, 30646, 50339, 765, 55769, 66165, 81551, 3445, 30816, 9007, 133, 10727, 3444, 28282, 32354, 3095, 2046, 1486, 160054, 7, 7136, 839, 4332, 541, 4734, 5117, 35735, 11249, 831, 111, ...
[ 0.1810302734375, 0.2406005859375, 0.0731201171875, 0.16259765625, 0.2454833984375, 0.1971435546875, 0.0289764404296875, 0.0207977294921875, 0.057098388671875, 0.049041748046875, 0.1923828125, 0.1558837890625, 0.00347900390625, 0.199951171875, 0.1124267578125, 0.1478271484375, 0.14355...
embed
33503336_c0
33503336
prolog
0
Title: Change value in Prolog Problem title: Change value in Prolog Tags: prolog Problem: Change value in Prolog I am new to Prolog, and I want to change the value of a variable, which is extracted from a list. Initially, the variable is n , then on some occasions I would like to change it to a . But using (is)/2 won't...
Change value in Prolog Change value in Prolog prolog Change Prolog Change value in Prolog I am new to Prolog, and I want to change the value of a variable, which is extracted from a list. Initially, the variable is n , then on some occasions I would like to change it to a . But using (is)/2 won't work because it only o...
[ -0.0024871826171875, -0.00098419189453125, 0.0238037109375, 0.01220703125, 0.00982666015625, -0.0162353515625, -0.01434326171875, 0.00156402587890625, 0.00341796875, 0.00927734375, 0.000583648681640625, 0.026123046875, 0.0000743865966796875, -0.005859375, 0.010009765625, -0.01208496093...
[ 87377, 34292, 23, 1250, 4867, 502, 3525, 3444, 15549, 70, 77336, 125663, 1295, 5303, 1890, 653, 3060, 46505, 1884, 47, 442, 10, 17368, 164, 16, 12477, 23742, 18, 4488, 4734, 160404, 98, 101935, 23468, 18151, 33342, 438, 24494, 572, 21771,...
[ 0.2484130859375, 0.263671875, 0.07440185546875, 0.184814453125, 0.2783203125, 0.1365966796875, 0.06719970703125, 0.073486328125, 0.2271728515625, 0.0182647705078125, 0.249267578125, 0.1702880859375, 0.0645751953125, 0.17333984375, 0.007354736328125, 0.067626953125, 0.00042724609375, ...
embed
49185774_c0
49185774
prolog
0
Title: prolog - replace only first founded element in a list Problem title: prolog - replace only first founded element in a list Tags: prolog Problem: prolog - replace only first founded element in a list how can in replace only the first element founded in a list? I have this example: replace(_,_,[],[]). replace('-',...
prolog - replace only first founded element in a list prolog - replace only first founded element in a list prolog NewChar prolog - replace only first founded element in a list how can in replace only the first element founded in a list? I have this example: And the result is: but should be: Thanks a lot.
[ -0.01416015625, -0.000823974609375, 0.008544921875, 0.0177001953125, -0.01068115234375, -0.00177001953125, -0.00775146484375, 0.018310546875, -0.00518798828125, 0.0133056640625, 0.01141357421875, -0.01220703125, -0.00299072265625, -0.0220947265625, -0.0079345703125, 0.00091552734375, ...
[ 502, 4867, 20, 91995, 4734, 5117, 14037, 297, 12830, 23, 5303, 2356, 84068, 3642, 831, 765, 27781, 16750, 1284, 5608, 186, 22362, 5915 ]
[ 0.1817626953125, 0.257080078125, 0.021759033203125, 0.2073974609375, 0.12078857421875, 0.1612548828125, 0.168701171875, 0.0975341796875, 0.1966552734375, 0.0745849609375, 0.2001953125, 0.11572265625, 0.2183837890625, 0.0599365234375, 0.0606689453125, 0.0208892822265625, 0.11181640625...
embed
61621649_c0
61621649
prolog
0
Title: Setof: Is there a way for early stopping? Problem title: Setof: Is there a way for early stopping? Tags: prolog-setof, prolog Problem: Setof: Is there a way for early stopping? I want to find the minimun number of errors for a lot of schedules. I produce a schedule, take it's errors, store all Errors in a list a...
Setof: Is there a way for early stopping? Setof: Is there a way for early stopping? prolog-setof prolog MinError Setof Errors schedule_errors Setof: Is there a way for early stopping? I want to find the minimun number of errors for a lot of schedules. I produce a schedule, take it's errors, store all Errors in a list a...
[ 0.0162353515625, -0.002349853515625, 0.0174560546875, 0.007781982421875, -0.017822265625, -0.00738525390625, -0.00139617919921875, -0.0255126953125, -0.00112152099609375, -0.05029296875, -0.0103759765625, -0.004486083984375, 0.0264892578125, 0.00286865234375, 0.035888671875, 0.01330566...
[ 19943, 4390, 12, 2071, 2685, 10, 3917, 100, 39395, 7279, 10366, 502, 4867, 3509, 4211, 18468, 31611, 212059, 80889, 188800, 3444, 7413, 14786, 309, 14012, 18499, 5915, 27489, 5646, 4343, 756, 5303, 5117, 12830, 59076, 977, 145407, 32195, 83...
[ 0.188232421875, 0.268798828125, 0.010650634765625, 0.0262451171875, 0.0758056640625, 0.07568359375, 0.1363525390625, 0.09747314453125, 0.2093505859375, 0.20263671875, 0.19580078125, 0.10211181640625, 0.1827392578125, 0.1292724609375, 0.144287109375, 0.1494140625, 0.175537109375, 0....
embed
74300461_c1
74300461
prolog
1
, 33, 34, 35, 36 ] ] ??? I can extract the first k elements of each list in the list. getFirstK(List, K, FirstK, Remainder) :- length(FirstK, K), append(FirstK, Remainder, List). And I thought I could get at least [1,2,3,4,13,14,15,16,25,26,27,28] with the following, GetLists([], K, []). GetLists([FirstList|RestOfLists...
, 33, 34, 35, 36 ] ] ??? I can extract the first k elements of each list in the list. getFirstK(List, K, FirstK, Remainder) :- length(FirstK, K), append(FirstK, Remainder, List). And I thought I could get at least [1,2,3,4,13,14,15,16,25,26,27,28] with the following, GetLists([], K, []). GetLists([FirstList|RestOfLists...
[ 0.0074462890625, 0.0084228515625, 0.01080322265625, -0.01007080078125, -0.021240234375, -0.006439208984375, 0.01611328125, -0.019287109375, 0.012451171875, -0.007171630859375, 0.023681640625, 0.005859375, -0.021240234375, 0.0179443359375, -0.0027923583984375, 0.0093994140625, 0.02124...
[ 4, 3912, 4442, 2273, 4039, 10114, 37336, 87, 831, 125663, 70, 5117, 472, 80854, 111, 12638, 5303, 23, 2046, 207263, 605, 154663, 341, 23972, 853, 24931, 820, 15772, 140909, 114689, 71, 32036, 17569, 5809, 99, 19713, 378, 133063, 82449, 26...
[ 0.048858642578125, 0.2281494140625, 0.2236328125, 0.2198486328125, 0.2247314453125, 0.0201263427734375, 0.1361083984375, 0.082763671875, 0.135986328125, 0.2418212890625, 0.08453369140625, 0.1455078125, 0.1904296875, 0.2083740234375, 0.1087646484375, 0.1256103515625, 0.2666015625, 0...
embed
3926729_c0
3926729
prolog
0
Title: How would you code a program in Prolog to print numbers from 1 to 10 using recursion? Problem title: How would you code a program in Prolog to print numbers from 1 to 10 using recursion? Tags: prolog, recursion Problem: How would you code a program in Prolog to print numbers from 1 to 10 using recursion? How wou...
How would you code a program in Prolog to print numbers from 1 to 10 using recursion? How would you code a program in Prolog to print numbers from 1 to 10 using recursion? prolog recursion 1 recursion How Prolog print_numbers How would you code a program in Prolog to print numbers from 1 to 10 using recursion? How woul...
[ 0.0009613037109375, 0.00174713134765625, -0.000667572021484375, 0.0024261474609375, 0.009033203125, 0.0245361328125, -0.01904296875, -0.01116943359375, -0.0003185272216796875, -0.03759765625, 0.00159454345703125, -0.0322265625, -0.01116943359375, 0.0040283203125, 0.020751953125, -0.014...
[ 11249, 18151, 1528, 1250, 4867, 28412, 101935, 1295, 106, 47, 209, 17368, 195625, 1830, 2806, 23, 502, 2606, 1297, 37842, 25632, 22027, 18, 4488, 15400 ]
[ 0.032684326171875, 0.202880859375, 0.166748046875, 0.18603515625, 0.24755859375, 0.18603515625, 0.1956787109375, 0.07147216796875, 0.1083984375, 0.09771728515625, 0.1922607421875, 0.04461669921875, 0.2232666015625, 0.1500244140625, 0.04656982421875, 0.03271484375, 0.1279296875, 0.1...
embed
76983344_c0
76983344
prolog
0
Title: What is the underlying mechanism of Prolog's operation? Problem title: What is the underlying mechanism of Prolog's operation? Tags: prolog Problem: What is the underlying mechanism of Prolog's operation? I have the above code, and I'm not sure which of the two has_divisor clauses will be called when h...
What is the underlying mechanism of Prolog's operation? What is the underlying mechanism of Prolog's operation? prolog What Prolog is_prime has_divisor What is the underlying mechanism of Prolog's operation? I have the above code, and I'm not sure which of the two has_divisor clauses will be called when has_d...
[ 0.004364013671875, 0.033203125, 0.020263671875, 0.0277099609375, 0.0064697265625, 0.00567626953125, 0.011474609375, -0.037109375, -0.0027313232421875, -0.038330078125, 0.00151824951171875, 0.0035400390625, -0.004852294921875, -0.000736236572265625, -0.0028228759765625, -0.0002632141113...
[ 4865, 1379, 538, 214, 191619, 1250, 4867, 3768, 41018, 502, 83, 114654, 1556, 428, 51858, 111, 25, 7, 36917, 18151, 9077, 6626, 70731, 90, 35839, 3229, 23, 23253, 73342 ]
[ 0.02276611328125, 0.171630859375, 0.167236328125, 0.0809326171875, 0.205322265625, 0.1728515625, 0.258056640625, 0.0625, 0.179931640625, 0.1285400390625, 0.058563232421875, 0.181640625, 0.15234375, 0.1373291015625, 0.286865234375, 0.0224151611328125, 0.0029296875, 0.01123046875, ...
embed
72836302_c0
72836302
prolog
0
Title: How to use assert and retract in SWI-Prolog Problem title: How to use assert and retract in SWI-Prolog Tags: prolog Problem: How to use assert and retract in SWI-Prolog In SWI-Prolog, if I use assert and retract at the prompt, I get ?- assert(at(1)). true. ?- retract(at(1)). true. However, if I put these stateme...
How to use assert and retract in SWI-Prolog How to use assert and retract in SWI-Prolog prolog How SWI-Prolog ERROR test:2 How to use assert and retract in SWI-Prolog In SWI-Prolog, if I use assert and retract at the prompt, I get However, if I put these statements into a program file called "test" as and run SWI-Prolo...
[ 0.011474609375, 0.01446533203125, 0.0218505859375, 0.0038604736328125, -0.01287841796875, -0.0009613037109375, 0.003387451171875, 0.028564453125, 0.000732421875, -0.0228271484375, -0.00130462646484375, 0.007080078125, -0.0262451171875, 0.0064697265625, 0.037109375, -0.0103759765625, ...
[ 11249, 4527, 237, 33657, 136, 41499, 15390, 159, 38969, 10752, 4867, 502, 9, 151206, 24638, 3034, 304, 23, 105876, 3884, 63805, 1528, 11435, 6954, 11675, 2046, 29459, 35142 ]
[ 0.0245819091796875, 0.1204833984375, 0.1319580078125, 0.27001953125, 0.14599609375, 0.21435546875, 0.192626953125, 0.0704345703125, 0.224853515625, 0.1329345703125, 0.174072265625, 0.123291015625, 0.03778076171875, 0.0816650390625, 0.036285400390625, 0.1427001953125, 0.07635498046875...
embed
76142072_c0
76142072
prolog
0
Title: Finding Cycles in an Undirected Graph Problem title: Finding Cycles in an Undirected Graph Tags: search, cycle, depth-first-search, undirected-graph, prolog Problem: Finding Cycles in an Undirected Graph It is necessary to implement a swi-prolog program that implements the search for all cycles in an undirected ...
Finding Cycles in an Undirected Graph Finding Cycles in an Undirected Graph search cycle depth-first-search undirected-graph prolog Finding Cycles Undirected Graph find_cycles Cycle Finding Cycles in an Undirected Graph It is necessary to implement a swi-prolog program that implements the search for all cycles in an un...
[ 0.01483154296875, 0.024169921875, 0.01104736328125, 0.0174560546875, 0.002227783203125, -0.01123046875, -0.0123291015625, -0.0107421875, 0.00058746337890625, -0.0299072265625, -0.0107421875, -0.019775390625, -0.005279541015625, 0.0181884765625, 0.0263671875, 0.020751953125, -0.008728...
[ 26040, 214, 151612, 90, 23, 992, 80581, 297, 6524, 11727, 33938, 105823, 168867, 13448, 271, 86250, 51, 41382, 502, 4867, 7413, 75457, 63559, 29479, 91, 2452, 9, 3454, 1528, 70, 100, 756, 140992, 16750, 15490, 57346, 89536, 126684, 37842, ...
[ 0.137451171875, 0.008697509765625, 0.2529296875, 0.1007080078125, 0.038482666015625, 0.114013671875, 0.2127685546875, 0.060150146484375, 0.1387939453125, 0.126220703125, 0.1837158203125, 0.2379150390625, 0.1470947265625, 0.073486328125, 0.036224365234375, 0.1640625, 0.115234375, 0....
embed
41683508_c1
41683508
prolog
1
1+0+0+0+(1+0)+(1+0+0+(1+0))+(1+0+0+1+(1+0+1)+(1+0+0+(1+0)+(1+0+1+(1+0+(1+1)))))))) ? One thing that's comforting is that there are indeed 42 ones in the above expression(?). I was hoping for X=42. Note the question mark. Yes, there are more matches (apparently infinitely more). The second one is: X = 1+0+0+0+0+1+(1+0+0...
1+0+0+0+(1+0)+(1+0+0+(1+0))+(1+0+0+1+(1+0+1)+(1+0+0+(1+0)+(1+0+1+(1+0+(1+1)))))))) ? One thing that's comforting is that there are indeed 42 ones in the above expression(?). I was hoping for X=42. Note the question mark. Yes, there are more matches (apparently infinitely more). The second one is: X = 1+0+0+0+0+1+(1+0+0...
[ -0.01116943359375, -0.005523681640625, 0.0106201171875, 0.01385498046875, 0.0096435546875, 0.00131988525390625, -0.00112152099609375, 0.0140380859375, 0.0284423828125, -0.0213623046875, -0.00506591796875, 0.000934600830078125, 0.01312255859375, 0.01434326171875, -0.004425048828125, 0.0...
[ 106, 138790, 1328, 41600, 21748, 167089, 705, 47506, 214, 2685, 621, 160463, 4828, 64333, 23, 36917, 125195, 82600, 156377, 100, 1193, 107947, 5442, 32635, 1286, 14858, 77978, 54241, 17932, 1632, 2203, 32149, 2389, 28864, 26073, 7, 853, 48650...
[ 0.1451416015625, 0.294189453125, 0.20361328125, 0.137939453125, 0.244384765625, 0.2327880859375, 0.094482421875, 0.1175537109375, 0.036346435546875, 0.113037109375, 0.1181640625, 0.08160400390625, 0.24951171875, 0.244873046875, 0.05560302734375, 0.11865234375, 0.25732421875, 0.0701...
embed
29995806_c0
29995806
prolog
0
Title: Dividing two integers with an alternative way Problem title: Dividing two integers with an alternative way Tags: successor-arithmetics, prolog Problem: Dividing two integers with an alternative way Let's consider that n=s(s(...s(0)...)) (simply n= s^n(0)). How could write a program calculating the division of tw...
Dividing two integers with an alternative way Dividing two integers with an alternative way successor-arithmetics prolog Dividing Dividing two integers with an alternative way Let's consider that n=s(s(...s(0)...)) (simply n= s^n(0)). How could write a program calculating the division of two integers? I mean s^(n//m) (...
[ -0.004791259765625, 0.03125, -0.0155029296875, 0.00506591796875, 0.00408935546875, -0.0189208984375, 0.0010986328125, 0.00946044921875, 0.0159912109375, -0.03857421875, 0.0166015625, 0.01312255859375, -0.00958251953125, 0.01806640625, 0.01611328125, -0.003509521484375, 0.025756835937...
[ 76278, 6238, 6626, 892, 26255, 678, 142, 30700, 3917, 39457, 42, 8962, 41637, 502, 4867, 16916, 653, 1369, 7, 27, 177609, 12399, 5072, 62479, 91, 8353, 19, 11249, 5809, 33022, 1528, 74481, 1916, 70, 91853, 111, 29459, 20767, 39, 80934, ...
[ 0.1873779296875, 0.0892333984375, 0.179443359375, 0.1522216796875, 0.1505126953125, 0.0987548828125, 0.0333251953125, 0.212646484375, 0.12548828125, 0.170654296875, 0.057159423828125, 0.07080078125, 0.017669677734375, 0.08563232421875, 0.1253662109375, 0.0714111328125, 0.1318359375, ...
embed
31870437_c0
31870437
prolog
0
Title: How can I define a new operator in Prolog? Problem title: How can I define a new operator in Prolog? Tags: prolog, operators Problem: How can I define a new operator in Prolog? I'm trying to define an operator =>> that checks if one of its operands is double of the other operand. I tried so far: :- op(200, xfy, ...
How can I define a new operator in Prolog? How can I define a new operator in Prolog? prolog operators How Prolog How can I define a new operator in Prolog? I'm trying to define an operator =>> that checks if one of its operands is double of the other operand. I tried so far: But when used in RPEL, I got : What is the ...
[ 0.000762939453125, -0.0205078125, 0.0205078125, 0.00262451171875, 0.022216796875, 0.02294921875, -0.0184326171875, 0.0032958984375, -0.0057373046875, -0.00213623046875, -0.01123046875, -0.0064697265625, -0.00390625, -0.02685546875, 0.0242919921875, 0.003143310546875, -0.0234375, 0....
[ 11249, 831, 61924, 3525, 39933, 23, 1250, 4867, 87, 10, 502, 31577, 2203, 30813, 12765, 2174, 1632, 111, 6863, 6264, 2208, 83, 41929, 3789, 37842, 11814, 627, 111213, 2967, 30022 ]
[ 0.0596923828125, 0.05670166015625, 0.2171630859375, 0.17236328125, 0.295166015625, 0.0743408203125, 0.1507568359375, 0.2427978515625, 0.0318603515625, 0.0413818359375, 0.1033935546875, 0.013214111328125, 0.0928955078125, 0.1669921875, 0.1676025390625, 0.052520751953125, 0.03820800781...
embed
67286303_c1
67286303
prolog
1
write('You just mentioned your '), write(Animal), write('. Tell me more about your '), write(Animal), nl, eliza_loop. respond(Input) :- member(Term, Input), member(Term, [ hate, dislike ]), member(Term2, Input), member(Term2, [ you ]), write(':('), nl, eliza_loop. respond([ _ ]) :- retract(list_of_excuses([ Next | Res...
write('You just mentioned your '), write(Animal), write('. Tell me more about your '), write(Animal), nl, eliza_loop. respond(Input) :- member(Term, Input), member(Term, [ hate, dislike ]), member(Term2, Input), member(Term2, [ you ]), write(':('), nl, eliza_loop. respond([ _ ]) :- retract(list_of_excuses([ Next | Res...
[ -0.002410888671875, 0.01214599609375, -0.00927734375, 0.0306396484375, 0.0250244140625, 0.0196533203125, 0.00872802734375, 0.0133056640625, 0.0206298828125, -0.0255126953125, 0.01068115234375, 0.018310546875, -0.005157470703125, 0.0157470703125, 0.035400390625, 0.006866455078125, 0.0...
[ 33022, 132, 23562, 1660, 119056, 935, 242, 247, 93, 2749, 59488, 163, 1286, 1672, 6, 13169, 88, 7337, 28354, 35644, 4153, 7077, 15772, 32786, 35484, 39, 360, 35463, 2837, 5062, 304, 398, 12, 41499, 15390, 6562, 4390, 3355, 11680, 4997, ...
[ 0.1968994140625, 0.03363037109375, 0.1170654296875, 0.179931640625, 0.259765625, 0.2008056640625, 0.0792236328125, 0.0179595947265625, 0.131591796875, 0.125244140625, 0.1978759765625, 0.07794189453125, 0.127197265625, 0.1448974609375, 0.03515625, 0.137939453125, 0.1016845703125, 0....
embed
67641285_c0
67641285
prolog
0
Title: Prolog procedure does not exist (cant run rules in prolog) Problem title: Prolog procedure does not exist (cant run rules in prolog) Tags: prolog Problem: Prolog procedure does not exist (cant run rules in prolog) I am new to Prolog and using the SWISH SWI online PROLOG website. https://swish.swi-prolog.org/ I a...
Prolog procedure does not exist (cant run rules in prolog) Prolog procedure does not exist (cant run rules in prolog) prolog Prolog Reachable Prolog procedure does not exist (cant run rules in prolog) I am new to Prolog and using the SWISH SWI online PROLOG website. https://swish.swi-prolog.org/ I am trying a really ba...
[ 0.0179443359375, 0.0191650390625, 0.00531005859375, 0.0289306640625, -0.026611328125, 0.0208740234375, -0.018798828125, 0.0196533203125, -0.0023345947265625, -0.048095703125, -0.01226806640625, -0.0242919921875, -0.0172119140625, -0.01300048828125, 0.0272216796875, -0.009765625, 0.01...
[ 1250, 4867, 50491, 959, 32316, 36520, 11675, 91736, 23, 502, 14602, 934, 2886, 61595, 79909, 38969, 1118, 10514, 47510, 4165, 114686, 2452, 3454, 31577, 62822, 1528, 17723, 145, 13, 76199, 25632, 18499, 4358, 86869 ]
[ 0.19384765625, 0.270263671875, 0.2332763671875, 0.0762939453125, 0.1749267578125, 0.12841796875, 0.170654296875, 0.173095703125, 0.049896240234375, 0.15576171875, 0.0264739990234375, 0.134521484375, 0.080810546875, 0.077880859375, 0.1270751953125, 0.17041015625, 0.0310211181640625, ...
embed
70164809_c0
70164809
prolog
0
Title: How does declaring variables in swi prolog work? Problem title: How does declaring variables in swi prolog work? Tags: variables, swi-prolog, prolog Problem: How does declaring variables in swi prolog work? Sorry for the inconvenience, I'm still new to Prolog's syntax, Im just asking how would one declare/instan...
How does declaring variables in swi prolog work? How does declaring variables in swi prolog work? variables swi-prolog prolog How How does declaring variables in swi prolog work? Sorry for the inconvenience, I'm still new to Prolog's syntax, Im just asking how would one declare/instantiate and manipulate a variable X (...
[ 0.0240478515625, 0.017578125, -0.0067138671875, -0.0032806396484375, -0.0145263671875, 0.0033721923828125, -0.0033416748046875, 0.00152587890625, 0.004364013671875, 0.0069580078125, 0.01458740234375, -0.00830078125, -0.005828857421875, 0.0004596710205078125, 0.01031494140625, 0.0134887...
[ 11249, 14602, 8, 18347, 2852, 77336, 7, 23, 91, 2452, 502, 4867, 4488, 3454, 1250, 6002, 86531, 113292, 3642, 159978, 143034, 101426, 136, 45258, 1193, 7722, 33022, 35662, 1810, 21373, 46876, 68062, 26783, 29479 ]
[ 0.07586669921875, 0.05963134765625, 0.1279296875, 0.177490234375, 0.08587646484375, 0.2391357421875, 0.066162109375, 0.04364013671875, 0.057159423828125, 0.2076416015625, 0.1336669921875, 0.2144775390625, 0.1334228515625, 0.10723876953125, 0.1024169921875, 0.023284912109375, 0.096557...
embed
72331639_c0
72331639
prolog
0
Title: How to create grade system in prolog Problem title: How to create grade system in prolog Tags: prolog Problem: How to create grade system in prolog Menu Score Kelulusan Score get from UTS = 70% and UAS = 30% if score >=90 Lulus dengan Grade A if score >=80 Lulus dengan Grade B if score >=70 Lulus dengan Grade C ...
How to create grade system in prolog How to create grade system in prolog prolog How How to create grade system in prolog Menu Score Kelulusan Score get from UTS = 70% and UAS = 30% if score >=90 Lulus dengan Grade A if score >=80 Lulus dengan Grade B if score >=70 Lulus dengan Grade C if score >=60 Tidak Lulus dengan ...
[ 0.01092529296875, 0.01495361328125, -0.008056640625, 0.004669189453125, -0.014404296875, -0.017578125, -0.021240234375, 0.00001990795135498047, -0.00701904296875, 0.0033721923828125, 0.00994873046875, -0.0048828125, -0.013916015625, -0.00787353515625, -0.0113525390625, 0.00061798095703...
[ 11249, 47, 28282, 44000, 5426, 23, 502, 4867, 49434, 168071, 23203, 67478, 66, 2046, 1295, 345, 12763, 2203, 26134, 136, 9713, 16279, 2174, 47763, 5039, 173228, 22453, 62, 4836, 335, 5757, 313, 4598, 10742, 391, 12975, 462, 241, 76465, 66...
[ 0.0714111328125, 0.0499267578125, 0.209716796875, 0.26904296875, 0.2313232421875, 0.06109619140625, 0.1513671875, 0.251708984375, 0.2017822265625, 0.1871337890625, 0.08941650390625, 0.172119140625, 0.105224609375, 0.06170654296875, 0.0614013671875, 0.079345703125, 0.1522216796875, ...
embed
39614097_c0
39614097
prolog
0
Title: Prolog Wrong Compilation? Problem title: Prolog Wrong Compilation? Tags: prolog, macos, error-handling, compiler-errors Problem: Prolog Wrong Compilation? I am very new to prolog. Trying to learn it as much as possible in as little time as possible. Any help is greatly appreciated. I am using MacOS Sierra by the...
Prolog Wrong Compilation? Prolog Wrong Compilation? prolog macos error-handling compiler-errors Prolog Wrong Compilation Prolog Wrong Compilation? I am very new to prolog. Trying to learn it as much as possible in as little time as possible. Any help is greatly appreciated. I am using MacOS Sierra by the way. I am tryi...
[ 0.017578125, 0.02392578125, 0.011962890625, 0.0201416015625, -0.0159912109375, 0.0274658203125, -0.00775146484375, 0.0021209716796875, 0.00396728515625, -0.01171875, -0.0224609375, -0.01446533203125, 0.003326416015625, 0.0093994140625, 0.01019287109375, -0.004638671875, -0.0068054199...
[ 1250, 4867, 601, 35133, 15612, 14, 57860, 502, 7840, 18499, 54885, 9969, 34759, 188800, 3525, 30698, 4358, 4727, 7285, 130454, 31577, 107730, 124519, 3034, 17368, 75101, 76896, 71924, 903, 134598, 30646, 98320, 98352, 1363, 50339, 23, 29568, ...
[ 0.186279296875, 0.273681640625, 0.05572509765625, 0.2012939453125, 0.1654052734375, 0.1531982421875, 0.07861328125, 0.180908203125, 0.0882568359375, 0.1334228515625, 0.1136474609375, 0.128662109375, 0.05291748046875, 0.10491943359375, 0.00390625, 0.0184783935546875, 0.0615234375, 0...
embed
20454270_c0
20454270
prolog
0
Title: Boolean AND in prolog returns X=true but the function becomes false Problem title: Boolean AND in prolog returns X=true but the function becomes false Tags: prolog, boolean Problem: Boolean AND in prolog returns X=true but the function becomes false and_true(true, true). and_false(false,true). and_false(true,fal...
Boolean AND in prolog returns X=true but the function becomes false Boolean AND in prolog returns X=true but the function becomes false prolog boolean Boolean and_true and_false g_AND Boolean AND in prolog returns X=true but the function becomes false The only problem with this is that when I enter g_AND(true,true,X) i...
[ 0.021240234375, 0.01104736328125, 0.0093994140625, -0.004547119140625, -0.005645751953125, 0.0267333984375, -0.012451171875, -0.001495361328125, 0.018798828125, 0.0025787353515625, 0.00011110305786132812, -0.0240478515625, -0.01458740234375, 0.01904296875, 0.007537841796875, 0.01623535...
[ 73783, 34677, 48762, 23, 502, 4867, 30646, 1193, 9774, 1284, 32354, 24209, 98320, 337, 31, 136, 8710, 706, 45029, 7, 4734, 2967, 30957, 1542, 76199, 163, 1369, 2301, 18, 3444, 4171, 4358 ]
[ 0.1004638671875, 0.1956787109375, 0.275146484375, 0.042266845703125, 0.158203125, 0.223388671875, 0.151611328125, 0.162109375, 0.1600341796875, 0.0667724609375, 0.160400390625, 0.1116943359375, 0.2139892578125, 0.005859375, 0.07373046875, 0.217529296875, 0.1260986328125, 0.09423828...
embed
27202175_c1
27202175
prolog
1
cases that are not covered by this condition, like ?- nat_nat_sum(f(X),Y,Z). Now my question: Is there an alternate definition of nat_nat_sum/3 which possesses the termination condition: nat_nat_sum2(A,B,C) terminates_if b(A);b(B);b(C). (If yes, show it. If no, justify why) In other words, the new definition nat_nat_s...
cases that are not covered by this condition, like ?- nat_nat_sum(f(X),Y,Z). Now my question: Is there an alternate definition of nat_nat_sum/3 which possesses the termination condition: nat_nat_sum2(A,B,C) terminates_if b(A);b(B);b(C). (If yes, show it. If no, justify why) In other words, the new definition nat_nat_s...
[ -0.0115966796875, 0.01409912109375, 0.0234375, -0.000461578369140625, -0.005859375, 0.01348876953125, 0.0019378662109375, 0.006072998046875, 0.023193359375, -0.01177978515625, 0.01385498046875, -0.0031280517578125, 0.002899169921875, 0.010498046875, 0.0269775390625, 0.018310546875, 0...
[ 50218, 959, 127918, 903, 35431, 24, 18, 7695, 11832, 420, 1542, 75939, 80934, 18113, 158566, 29527, 1363, 304, 441, 121011, 90, 3190, 876, 72272, 7639, 1660, 40383, 15400, 5608, 13, 2174, 21771, 10750, 94418, 136, 61585, 67455, 28412, 34166...
[ 0.121337890625, 0.0252838134765625, 0.112060546875, 0.0151214599609375, 0.2100830078125, 0.1444091796875, 0.127197265625, 0.25, 0.24853515625, 0.0145721435546875, 0.002838134765625, 0.0887451171875, 0.169189453125, 0.2239990234375, 0.053619384765625, 0.2286376953125, 0.0469970703125,...
embed
33962666_c0
33962666
prolog
0
Title: Make a list of numbers found in list in Prolog Problem title: Make a list of numbers found in list in Prolog Tags: prolog, list Problem: Make a list of numbers found in list in Prolog I am trying to construct a list in Prolog for every number it has found. For example, findNumber([g,o,o,d,j,0,6],[0,6]) , but I c...
Make a list of numbers found in list in Prolog Make a list of numbers found in list in Prolog prolog list Make Prolog TAfter Make a list of numbers found in list in Prolog I am trying to construct a list in Prolog for every number it has found. For example, findNumber([g,o,o,d,j,0,6],[0,6]) , but I can't construct the ...
[ -0.000408172607421875, -0.00180816650390625, 0.018310546875, 0.01422119140625, -0.00555419921875, 0.0169677734375, -0.02197265625, 0.02734375, 0.0185546875, -0.01312255859375, -0.007354736328125, -0.040771484375, -0.0093994140625, 0.004791259765625, 0, 0.002838134765625, 0.0147094726...
[ 26176, 5303, 111, 101935, 14037, 23, 1250, 4867, 502, 12998, 46327, 31577, 64549, 100, 11907, 14012, 1556, 7413, 18444, 26278, 177, 31, 71, 170, 2389, 910, 831, 18, 678, 34475, 18151, 30607, 4358, 444, 32233, 39580, 133 ]
[ 0.0728759765625, 0.197998046875, 0.005279541015625, 0.1878662109375, 0.1353759765625, 0.07464599609375, 0.1787109375, 0.252685546875, 0.130126953125, 0.038299560546875, 0.2012939453125, 0.0386962890625, 0.1304931640625, 0.032135009765625, 0.0634765625, 0.1419677734375, 0.046264648437...
embed
21001152_c0
21001152
prolog
0
Title: Prolog 'is/2' predicate implementation Problem title: Prolog 'is/2' predicate implementation Tags: prolog, declarative-programming, imperative-programming Problem: Prolog 'is/2' predicate implementation How is the 'is/2' Prolog predicate implemented? I know that X is 3*4 is equivalent with is...
Prolog 'is/2' predicate implementation Prolog 'is/2' predicate implementation prolog declarative-programming imperative-programming Prolog Prolog 'is/2' predicate implementation How is the 'is/2' Prolog predicate implemented? I know that is equivalent with But is the predicate implemented using impe...
[ 0.01263427734375, 0.0115966796875, 0.0252685546875, -0.0157470703125, -0.00927734375, 0.031494140625, -0.000469207763671875, -0.012451171875, 0.00122833251953125, -0.0308837890625, 0.019287109375, 0.0244140625, -0.0208740234375, -0.019287109375, 0.00982666015625, 0.0250244140625, 0.0...
[ 1250, 4867, 3768, 164, 12477, 1653, 2063, 67, 208124, 502, 21635, 4935, 28966, 214, 222530, 13, 11249, 83, 29479, 297, 3714, 183234, 678, 4966, 70, 17368, 56037, 449, 25632, 313, 18151 ]
[ 0.2022705078125, 0.259521484375, 0.07958984375, 0.16162109375, 0.26806640625, 0.194580078125, 0.2218017578125, 0.1243896484375, 0.2109375, 0.1627197265625, 0.1441650390625, 0.1171875, 0.1334228515625, 0.01544189453125, 0.21435546875, 0.1109619140625, 0.046875, 0.043701171875, 0.2...
embed
19505382_c1
19505382
prolog
1
)]). green( Who ) :- lista(S), constraints(S), member(pareja(_, Who, _, _, green), S). nextto(X, Y, List) :- append(_, [X,Y|_], List). append([X|Y],Z,[X|W]) :- append(Y,Z,W). append([],X,X). member(X,[X|T]). member(X,[H|T]) :- member(X,T). perm2(X,Y, X,Y). perm2(X,Y, Y,X). I used some examples of the Zebra puzzle to do...
)]). green( Who ) :- lista(S), constraints(S), member(pareja(_, Who, _, _, green), S). nextto(X, Y, List) :- append(_, [X,Y|_], List). append([X|Y],Z,[X|W]) :- append(Y,Z,W). append([],X,X). member(X,[X|T]). member(X,[H|T]) :- member(X,T). perm2(X,Y, X,Y). perm2(X,Y, Y,X). I used some examples of the Zebra puzzle to do...
[ -0.0098876953125, 0.00799560546875, 0.019775390625, 0.0234375, 0.002532958984375, 0.006011962890625, -0.0223388671875, 0.00970458984375, 0.0142822265625, -0.0096435546875, -0.010498046875, 0.0242919921875, -0.00482177734375, 0.00921630859375, -0.01129150390625, 0.01409912109375, 0.00...
[ 1388, 268, 194, 50997, 132, 40469, 15772, 5875, 294, 158, 2816, 4288, 7, 247, 32786, 16082, 145, 159, 11737, 188, 1542, 990, 32036, 114689, 71, 1723, 4, 1511, 1456, 618, 841, 117, 39, 304, 87, 11814, 27781, 70, 3786, 2844, 104192, 47,...
[ 0.0980224609375, 0.08734130859375, 0.1163330078125, 0.264892578125, 0.05999755859375, 0.207763671875, 0.130126953125, 0.236572265625, 0.04620361328125, 0.07305908203125, 0.1790771484375, 0.10888671875, 0.036407470703125, 0.000091552734375, 0.207763671875, 0.11669921875, 0.18054199218...
embed
10547033_c0
10547033
prolog
0
Title: Pattern in prolog Problem title: Pattern in prolog Tags: cycle, prolog Problem: Pattern in prolog Take all the distinct bit patterns of length N and arrange them in a cycle such that each pattern overlaps with its two neighbours in N - 1 bits. Then flatten the cycle into a Prolog list. Write a predicate pattern(...
Pattern in prolog Pattern in prolog cycle prolog Pattern Pattern in prolog Take all the distinct bit patterns of length N and arrange them in a cycle such that each pattern overlaps with its two neighbours in N - 1 bits. Then flatten the cycle into a Prolog list. Write a predicate pattern(N,L) that returns a list of bi...
[ 0.008544921875, 0.011962890625, -0.0166015625, 0.0026702880859375, -0.0009002685546875, 0.005035400390625, -0.026123046875, 0.006134033203125, 0.0284423828125, -0.027587890625, -0.016845703125, 0.0040283203125, -0.0037994384765625, 0.01220703125, 0.007354736328125, 0.021728515625, -0...
[ 9876, 22766, 23, 502, 4867, 105823, 46673, 756, 117781, 4785, 103510, 140909, 541, 136, 137356, 10, 6044, 12638, 645, 96091, 678, 6626, 6958, 38648, 106, 47009, 49878, 510, 3934, 1250, 5303, 5, 601, 18781, 1653, 2063, 67, 839, 4, 866, 3...
[ 0.2451171875, 0.2001953125, 0.108642578125, 0.1829833984375, 0.257080078125, 0.2091064453125, 0.05810546875, 0.061248779296875, 0.1346435546875, 0.1624755859375, 0.260986328125, 0.1019287109375, 0.1082763671875, 0.0177764892578125, 0.1634521484375, 0.0162811279296875, 0.0149841308593...
embed
29628193_c0
29628193
prolog
0
Title: clpfd - constraint upper bond of domain the be the maximum of a list of elements Problem title: clpfd - constraint upper bond of domain the be the maximum of a list of elements Tags: clpfd, prolog Problem: clpfd - constraint upper bond of domain the be the maximum of a list of elements Given the following code: ...
clpfd - constraint upper bond of domain the be the maximum of a list of elements clpfd - constraint upper bond of domain the be the maximum of a list of elements clpfd prolog clpfd - constraint upper bond of domain the be the maximum of a list of elements Given the following code: I want to constraint L to not contain ...
[ -0.01446533203125, 0.017333984375, 0.0238037109375, -0.00634765625, -0.00518798828125, 0.01287841796875, -0.00994873046875, 0.0019378662109375, 0.01092529296875, -0.03369140625, -0.00946044921875, -0.019287109375, 0.00823974609375, -0.01483154296875, 0.024169921875, -0.01092529296875, ...
[ 33139, 39557, 71, 158, 2816, 4288, 1407, 56, 71052, 111, 77758, 70, 186, 38132, 5303, 80854, 502, 4867, 25632, 18151, 3444, 339, 47, 959, 70541, 142424, 77546, 3501, 34292, 527, 2046, 56206, 73, 18499, 17368, 903, 6002, 86531, 15700, 3917...
[ 0.090576171875, 0.141845703125, 0.1947021484375, 0.0931396484375, 0.1783447265625, 0.15673828125, 0.111083984375, 0.0704345703125, 0.2005615234375, 0.03070068359375, 0.2041015625, 0.033782958984375, 0.141357421875, 0.197998046875, 0.1204833984375, 0.181396484375, 0.11376953125, 0.1...
embed
65874066_c0
65874066
prolog
0
Title: Prolog Procedure si(A) Does not Exist Problem title: Prolog Procedure si(A) Does not Exist Tags: prolog Problem: Prolog Procedure si(A) Does not Exist This is the code verificar(S) :- (si(S) -> true ; (no(S) -> fail ; preguntar(S))). preguntar(Pregunta) :- write('Tiene los siguientes sintomas: '), write(Pregunta...
Prolog Procedure si(A) Does not Exist Prolog Procedure si(A) Does not Exist prolog Prolog Procedure Does Exist Pregunta Tiene Respuesta Reachable Prolog Procedure si(A) Does not Exist This is the code and the problem is
[ 0.007232666015625, 0.00762939453125, 0.01300048828125, 0.01446533203125, -0.0234375, 0.00982666015625, 0.0042724609375, 0.0244140625, 0.01129150390625, -0.0218505859375, 0.0189208984375, 0.01513671875, -0.025390625, -0.01092529296875, 0.02392578125, -0.00927734375, 0.029052734375, ...
[ 1250, 4867, 170470, 13, 78, 284, 101790, 959, 5443, 1419, 502, 1914, 66457, 103043, 9624, 1766, 7752, 853, 934, 2886, 18151, 2967 ]
[ 0.2098388671875, 0.29443359375, 0.2470703125, 0.12646484375, 0.1920166015625, 0.1475830078125, 0.05816650390625, 0.1422119140625, 0.138916015625, 0.1302490234375, 0.15673828125, 0.035125732421875, 0.13623046875, 0.16943359375, 0.08294677734375, 0.13232421875, 0.046875, 0.0405273437...
embed
4199365_c0
4199365
prolog
0
Title: How do you do a Nested if-else statement in Prolog? Problem title: How do you do a Nested if-else statement in Prolog? Tags: prolog Problem: How do you do a Nested if-else statement in Prolog? If I have this function: min(List1, List2, Output) :- length(List1, N), length(List2, M), ( N < M -> Output = 'true' ; O...
How do you do a Nested if-else statement in Prolog? How do you do a Nested if-else statement in Prolog? prolog How Nested Prolog List1 List2 Output How do you do a Nested if-else statement in Prolog? If I have this function: but what if I wanted to also check if N == M? Maybe like this: Doesn't seem to work.
[ 0.01397705078125, 0.009521484375, 0.0146484375, 0.0279541015625, 0.004058837890625, 0.0247802734375, 0.02197265625, -0.00408935546875, 0.0089111328125, 0.0157470703125, 0.005859375, -0.01446533203125, 0.01226806640625, 0.0126953125, 0.006622314453125, -0.0012969970703125, 0.011962890...
[ 11249, 54, 28701, 71, 2174, 9, 5557, 63805, 23, 1250, 4867, 10, 502, 32036, 418, 304, 13538, 32354, 36663, 12765, 541, 69112, 276, 1884, 903, 4488 ]
[ 0.072998046875, 0.08349609375, 0.25537109375, 0.168212890625, 0.1949462890625, 0.06793212890625, 0.2205810546875, 0.212158203125, 0.049224853515625, 0.15966796875, 0.2474365234375, 0.0494384765625, 0.091552734375, 0.114013671875, 0.015106201171875, 0.0628662109375, 0.048858642578125,...
embed
64854900_c0
64854900
prolog
0
Title: Prolog function to create multiplication tables Problem title: Prolog function to create multiplication tables Tags: prolog Problem: Prolog function to create multiplication tables I am trying to create a prolog function that gets a small multiplication table based on the first value pased to the function. My co...
Prolog function to create multiplication tables Prolog function to create multiplication tables prolog Prolog Prolog function to create multiplication tables I am trying to create a prolog function that gets a small multiplication table based on the first value pased to the function. My code is currently as follows: So...
[ 0.01385498046875, 0.0174560546875, 0.0198974609375, -0.0113525390625, 0.00146484375, 0.02392578125, 0.0048828125, -0.018310546875, -0.015869140625, -0.0272216796875, 0.00457763671875, -0.01214599609375, -0.01287841796875, -0.0076904296875, -0.0128173828125, 0.01470947265625, -0.00338...
[ 1250, 4867, 32354, 28282, 127664, 1363, 23180, 47, 502, 7, 31577, 19336, 35509, 5117, 34292, 452, 18151, 82424, 28960, 27781, 2806, 1884, 41, 1294, 44116, 903, 4734, 30646, 98320, 30022 ]
[ 0.15625, 0.2379150390625, 0.1480712890625, 0.170166015625, 0.1871337890625, 0.064697265625, 0.2296142578125, 0.0185089111328125, 0.1248779296875, 0.02215576171875, 0.03289794921875, 0.07183837890625, 0.04595947265625, 0.049346923828125, 0.058929443359375, 0.07666015625, 0.10852050781...
embed
66630422_c0
66630422
prolog
0
Title: Prolog, Drop Node from Graph Problem title: Prolog, Drop Node from Graph Tags: prolog Problem: Prolog, Drop Node from Graph i have a problem. I want to drop all link in a graph of a specific node. Here the code: dropAll(X,[],[]). dropAll(X,[X|T],L):- dropAll(X,T,L),!. dropAll(X,[X,H|Xs],[H|L]):- dropAll(X,Xs,L)....
Prolog, Drop Node from Graph Prolog, Drop Node from Graph prolog Graph Prolog Drop Node Prolog, Drop Node from Graph i have a problem. I want to drop all link in a graph of a specific node. Here the code: But it doesn't work. I want to obtain this: Input: Output: And Input: Output: Thanks a lot for the help
[ 0.0045166015625, 0.01318359375, -0.006866455078125, 0.01153564453125, -0.0147705078125, 0.01806640625, 0.00177001953125, -0.00823974609375, 0.00341796875, -0.020263671875, 0.003997802734375, -0.0213623046875, -0.017333984375, -0.0169677734375, 0.00494384765625, 0.009033203125, 0.0190...
[ 1250, 4867, 130403, 438, 112, 1295, 6524, 11727, 502, 2967, 3444, 36069, 756, 3126, 23, 41382, 29458, 110, 18151, 22027, 18, 4488, 113054, 903, 360, 7077, 13538, 4358 ]
[ 0.181640625, 0.2568359375, 0.2152099609375, 0.177734375, 0.1929931640625, 0.1539306640625, 0.1363525390625, 0.1790771484375, 0.1094970703125, 0.069580078125, 0.0567626953125, 0.19873046875, 0.07861328125, 0.186767578125, 0.04571533203125, 0.177734375, 0.064453125, 0.133056640625, ...
embed
19407783_c0
19407783
prolog
0
Title: Stream reasoning / Reactive programming in prolog? Problem title: Stream reasoning / Reactive programming in prolog? Tags: event-driven, swi-prolog, stream, prolog, reactive-programming Problem: Stream reasoning / Reactive programming in prolog? I was wondering if you know of any way to use prolog for stream pro...
Stream reasoning / Reactive programming in prolog? Stream reasoning / Reactive programming in prolog? event-driven swi-prolog stream prolog reactive-programming Stream Reactive Stream reasoning / Reactive programming in prolog? I was wondering if you know of any way to use prolog for stream processing, that is, some ki...
[ 0.01324462890625, 0.01092529296875, 0.010009765625, -0.000469207763671875, 0.00555419921875, 0.0023345947265625, 0.00811767578125, 0.0260009765625, -0.002593994140625, -0.036865234375, 0.00897216796875, -0.00341796875, -0.0211181640625, 0.0205078125, 0.0159912109375, 0.007598876953125,...
[ 115061, 31635, 214, 248, 853, 71232, 56037, 449, 23, 502, 4867, 32, 19732, 33926, 91, 2452, 3454, 75973, 456, 28966, 149016, 3714, 3917, 4527, 100, 9433, 41, 11675, 51359, 3647, 19686, 150011, 140992, 29479, 5700, 159, 38969 ]
[ 0.258056640625, 0.2086181640625, 0.1241455078125, 0.042816162109375, 0.11376953125, 0.2066650390625, 0.1610107421875, 0.1094970703125, 0.0877685546875, 0.1800537109375, 0.261962890625, 0.0222015380859375, 0.124755859375, 0.1046142578125, 0.0260162353515625, 0.165283203125, 0.15283203...
embed
67513621_c1
67513621
prolog
1
want to check for the spaces, and Spaces is my output. So should it be something like this: spaces_puzzle(Puzzle, Spaces):- maplist(spaces_in_file(h, File, Spaces), Puzzle, File) I want my file to be one of the lists of the Puzzle. I can't seem to get the syntax right. For now I just want the correct Result for the fi...
want to check for the spaces, and Spaces is my output. So should it be something like this: spaces_puzzle(Puzzle, Spaces):- maplist(spaces_in_file(h, File, Spaces), Puzzle, File) I want my file to be one of the lists of the Puzzle. I can't seem to get the syntax right. For now I just want the correct Result for the fi...
[ -0.0018768310546875, -0.007781982421875, -0.000579833984375, 0.025390625, -0.040283203125, 0.01544189453125, 0.003936767578125, -0.015869140625, 0.0009918212890625, 0.0032958984375, 0.01904296875, 0.005615234375, 0.00408935546875, 0.00189971923828125, -0.0235595703125, 0.0255126953125,...
[ 3444, 47, 12765, 100, 70, 32628, 7, 43045, 83, 759, 140992, 5608, 442, 186, 9844, 1884, 903, 1766, 13894, 133, 27559, 22288, 6562, 65421, 73, 29822, 127, 42724, 179277, 11435, 1632, 111, 5303, 6002, 86531, 7108, 5036, 26785, 126684, 10215...
[ 0.1107177734375, 0.0254364013671875, 0.22802734375, 0.123291015625, 0.0074462890625, 0.26416015625, 0.1044921875, 0.260009765625, 0.027862548828125, 0.07574462890625, 0.2122802734375, 0.06207275390625, 0.0240936279296875, 0.0364990234375, 0.030517578125, 0.0716552734375, 0.0426635742...
embed
25899684_c0
25899684
prolog
0
Title: Finding longest atom length from facts. (Prolog) Problem title: Finding longest atom length from facts. (Prolog) Tags: prolog Problem: Finding longest atom length from facts. (Prolog) I have facts which define four names. name('Fooo Baar'). name('Bar Fo'). name('Far Boooo'). name('Example Example'). How can I it...
Finding longest atom length from facts. (Prolog) Finding longest atom length from facts. (Prolog) prolog facts Finding Prolog Fooo Baar Bar Far Boooo Example longest_name Nimi atom_length Finding longest atom length from facts. (Prolog) I have facts which define four names. How can I iterate through these facts to find...
[ 0.013671875, 0.0054931640625, 0.0126953125, 0.041748046875, -0.00933837890625, 0.007568359375, 0.0130615234375, 0.0260009765625, -0.00151824951171875, -0.048828125, -0.0072021484375, 0.0027618408203125, 0.000518798828125, -0.004364013671875, 0.014892578125, -0.0037689208984375, -0.00...
[ 26040, 214, 4989, 525, 34627, 140909, 1295, 15824, 10752, 4867, 502, 1250, 563, 133520, 101813, 3253, 7325, 335, 61957, 89536, 8705, 11627, 128620, 23986, 927, 87, 765, 7, 61924, 22759, 123055, 11249, 831, 8560, 8305, 7413, 1810, 70, 9351, ...
[ 0.1190185546875, 0.041961669921875, 0.18359375, 0.175048828125, 0.250732421875, 0.1978759765625, 0.1182861328125, 0.2099609375, 0.0975341796875, 0.2130126953125, 0.099609375, 0.13134765625, 0.00537109375, 0.16015625, 0.162109375, 0.17041015625, 0.13232421875, 0.04095458984375, 0....
embed
64738557_c0
64738557
prolog
0
Title: Prolog: Assign value to Variable in Predicate Problem title: Prolog: Assign value to Variable in Predicate Tags: prolog Problem: Prolog: Assign value to Variable in Predicate With the following rules: test('John', ebola). test('John', covid). test('Maria', covid). How can I create a predicate that would tell me ...
Prolog: Assign value to Variable in Predicate Prolog: Assign value to Variable in Predicate prolog Prolog Assign Variable Predicate John Maria Persona Ebola Covid Prolog: Assign value to Variable in Predicate With the following rules: How can I create a predicate that would tell me if John or Maria took (both) the Ebol...
[ 0.0250244140625, -0.0177001953125, 0.01348876953125, 0.0341796875, -0.0115966796875, 0.00933837890625, -0.009765625, 0.0174560546875, 0.0093994140625, -0.00885009765625, 0.00396728515625, 0.00628662109375, 0.0029296875, 0.002777099609375, 0.0103759765625, 0.0042724609375, 0.006835937...
[ 1250, 4867, 1301, 31304, 34292, 47, 84572, 2886, 23, 7145, 2063, 67, 502, 4939, 5379, 118179, 241, 21098, 1311, 5518, 25632, 91736, 11249, 831, 28282, 1653, 2806, 14192, 163, 2174, 707, 34739, 837, 70, 136, 109921, 3444, 21373, 3714, 4469...
[ 0.1536865234375, 0.237060546875, 0.05145263671875, 0.2093505859375, 0.182373046875, 0.008453369140625, 0.1812744140625, 0.1422119140625, 0.025238037109375, 0.182373046875, 0.23583984375, 0.1534423828125, 0.10107421875, 0.224609375, 0.262939453125, 0.169921875, 0.071533203125, 0.264...
embed
13659212_c0
13659212
prolog
0
Title: Prolog debug mode - Last Call Optimisation Problem title: Prolog debug mode - Last Call Optimisation Tags: debugging, prolog Problem: Prolog debug mode - Last Call Optimisation So the Prolog interpreter implements Last Call Optimisation - so something like... length([], Acc, Acc). length([_|T], Acc, X) :- NewAcc...
Prolog debug mode - Last Call Optimisation Prolog debug mode - Last Call Optimisation debugging prolog Prolog Last Call Optimisation Acc NewAcc Prolog debug mode - Last Call Optimisation So the Prolog interpreter implements Last Call Optimisation - so something like... can be called in O(1) space. However, if I enter d...
[ 0.016845703125, 0.01416015625, 0.0035858154296875, 0.012939453125, -0.004913330078125, 0.0184326171875, 0.006805419921875, 0.0068359375, 0.02978515625, -0.031494140625, 0.0257568359375, -0.0130615234375, 0.00433349609375, 0.005279541015625, 0.0272216796875, -0.0074462890625, 0.007293...
[ 1250, 4867, 8, 85779, 13736, 21672, 26265, 43938, 15032, 978, 502, 29899, 2356, 10060, 29481, 56, 29479, 9844, 1884, 27, 831, 35839, 23, 180, 27750, 32628, 33306, 2174, 30957, 903, 238335, 9655, 3038, 172561, 36356, 28271, 6275, 36659, 5171...
[ 0.163330078125, 0.2471923828125, 0.1697998046875, 0.27001953125, 0.15576171875, 0.1705322265625, 0.193115234375, 0.16845703125, 0.115478515625, 0.190673828125, 0.1107177734375, 0.071533203125, 0.091552734375, 0.0933837890625, 0.1806640625, 0.0721435546875, 0.1263427734375, 0.014450...
embed
63860082_c0
63860082
prolog
0
Title: Translating Imogen (an intuitionistic theorem prover for FOL) into a Prolog prover? Problem title: Translating Imogen (an intuitionistic theorem prover for FOL) into a Prolog prover? Tags: prolog Problem: Translating Imogen (an intuitionistic theorem prover for FOL) into a Prolog prover? imogen is Sean McLaughli...
Translating Imogen (an intuitionistic theorem prover for FOL) into a Prolog prover? Translating Imogen (an intuitionistic theorem prover for FOL) into a Prolog prover? prolog Translating Imogen FOL Prolog Translating Imogen (an intuitionistic theorem prover for FOL) into a Prolog prover? imogen is Sean McLaughlin's int...
[ 0.0281982421875, -0.00250244140625, 0.0162353515625, -0.004364013671875, 0.0007476806640625, -0.00180816650390625, -0.00946044921875, -0.0159912109375, -0.0106201171875, -0.055419921875, 0.0191650390625, 0.01806640625, -0.033935546875, -0.01104736328125, 0.00174713134765625, 0.00179290...
[ 11062, 143, 1916, 3370, 62976, 58868, 1363, 48242, 58391, 502, 814, 172155, 3934, 1250, 4867, 566, 83, 82421, 19909, 2729, 58968, 2397, 20744, 39456, 51139, 49041, 50592, 69438, 77848, 3900, 19309, 23, 69101, 153648, 100094, 4552, 93766 ]
[ 0.1162109375, 0.152099609375, 0.036285400390625, 0.1717529296875, 0.30126953125, 0.2181396484375, 0.03607177734375, 0.0750732421875, 0.1488037109375, 0.130126953125, 0.1510009765625, 0.2200927734375, 0.0775146484375, 0.14794921875, 0.2183837890625, 0.1488037109375, 0.007598876953125,...
embed
71562981_c0
71562981
prolog
0
Title: prolog how does a built in predicate get an existence_error? Problem title: prolog how does a built in predicate get an existence_error? Tags: predicate, prolog Problem: prolog how does a built in predicate get an existence_error? so I have a prolog assignment that has to be tested with search algorithms provide...
prolog how does a built in predicate get an existence_error? prolog how does a built in predicate get an existence_error? predicate prolog existence_error prolog how does a built in predicate get an existence_error? so I have a prolog assignment that has to be tested with search algorithms provided by the teacher but I...
[ 0.006591796875, 0.0030059814453125, 0.0030364990234375, 0.01153564453125, 0.000942230224609375, 0.022705078125, 0.0076904296875, -0.00640869140625, 0.007232666015625, -0.059814453125, 0.019775390625, -0.01190185546875, 0.00830078125, -0.032470703125, 0.0189208984375, -0.015625, 0.017...
[ 502, 4867, 3642, 14602, 88303, 23, 1653, 2063, 67, 2046, 116311, 188800, 142, 95486, 3034, 33938, 234873, 117914, 13695, 903, 18499, 18, 28219, 233, 17357, 136, 7413, 5584, 18113, 1636, 5809, 1836, 959, 32316, 67660, 645 ]
[ 0.15771484375, 0.2060546875, 0.0723876953125, 0.0682373046875, 0.1771240234375, 0.165283203125, 0.16064453125, 0.2078857421875, 0.109375, 0.08123779296875, 0.2158203125, 0.248046875, 0.0282135009765625, 0.07415771484375, 0.0948486328125, 0.08209228515625, 0.10888671875, 0.064208984...
embed
61528902_c0
61528902
prolog
0
Title: How to delete a given element X from the list in prolog Problem title: How to delete a given element X from the list in prolog Tags: prolog Problem: How to delete a given element X from the list in prolog I want to delete a given element X from the list in Prolog. Such that delete(X,L) deletes the first instance...
How to delete a given element X from the list in prolog How to delete a given element X from the list in prolog prolog the it How Should List How to delete a given element X from the list in prolog I want to delete a given element X from the list in Prolog. Such that delete(X,L) deletes the first instance (from the hea...
[ -0.0140380859375, 0.0213623046875, 0.005615234375, 0.006317138671875, -0.02294921875, 0.032470703125, 0.00946044921875, 0.0021209716796875, 0.0225830078125, -0.00994873046875, 0.01092529296875, -0.0045166015625, -0.0205078125, 0.0059814453125, 0.01458740234375, 0.00946044921875, 0.02...
[ 11249, 47, 154109, 34475, 12830, 1193, 1295, 5303, 23, 502, 4867, 442, 151117, 32036, 3444, 1250, 1542, 866, 8, 74635, 5117, 110527, 161063, 10336, 892, 1505, 339, 1653, 2063, 67, 5608, 3173, 154663, 3642, 54, 4358 ]
[ 0.08160400390625, 0.0701904296875, 0.23974609375, 0.123779296875, 0.16650390625, 0.180908203125, 0.12890625, 0.19189453125, 0.05792236328125, 0.1561279296875, 0.2210693359375, 0.044586181640625, 0.055572509765625, 0.144287109375, 0.06451416015625, 0.1505126953125, 0.150634765625, 0...
embed
33263264_c0
33263264
prolog
0
Title: Determine if the number of elements in a list is even without counting Problem title: Determine if the number of elements in a list is even without counting Tags: list, recursion, prolog Problem: Determine if the number of elements in a list is even without counting I have to determine whether the number of elem...
Determine if the number of elements in a list is even without counting Determine if the number of elements in a list is even without counting list recursion prolog Determine Determine if the number of elements in a list is even without counting I have to determine whether the number of elements from a list is even or n...
[ -0.006134033203125, 0.0179443359375, -0.00408935546875, 0.00131988525390625, -0.0031280517578125, 0.01385498046875, -0.00201416015625, -0.01080322265625, 0.00836181640625, -0.0218505859375, 0.0135498046875, -0.03271484375, 0.007415771484375, 0.02685546875, 0.008544921875, 0.00500488281...
[ 262, 30524, 13, 2174, 14012, 80854, 23, 5303, 83, 3853, 15490, 54529, 214, 195625, 1830, 502, 4867, 83324, 36766, 1295, 959, 2967, 86869, 1250, 29806, 5844, 47644, 12478, 944, 756, 154107, 6528 ]
[ 0.06658935546875, 0.1591796875, 0.024993896484375, 0.08587646484375, 0.1241455078125, 0.1873779296875, 0.05743408203125, 0.183837890625, 0.0782470703125, 0.17626953125, 0.1474609375, 0.140625, 0.046142578125, 0.134765625, 0.034454345703125, 0.0648193359375, 0.1749267578125, 0.14282...
embed
37332091_c0
37332091
prolog
0
Title: insertBST in prolog - why it returns false Problem title: insertBST in prolog - why it returns false Tags: prolog Problem: insertBST in prolog - why it returns false Despite the fact that I traced my program, I can't understand why it returns false : insertBST(t(Root, L, R), Root, t(Root, L, R)). insertBST(nil, ...
insertBST in prolog - why it returns false insertBST in prolog - why it returns false prolog Root Elem insertBST in prolog - why it returns false Despite the fact that I traced my program, I can't understand why it returns false : Can you explain it me, please ?
[ 0.0205078125, 0.00180816650390625, 0.01214599609375, 0.006927490234375, 0.0123291015625, 0.0245361328125, -0.0042724609375, -0.033447265625, -0.0224609375, -0.0152587890625, 0.021728515625, 0.001007080078125, -0.007415771484375, -0.00860595703125, 0.000301361083984375, 0.00364685058593...
[ 183540, 571, 8545, 23, 502, 4867, 15400, 30646, 98320, 442, 150948, 540, 195, 7, 144851, 1528, 28219, 73342 ]
[ 0.2271728515625, 0.10955810546875, 0.221435546875, 0.04150390625, 0.1220703125, 0.1925048828125, 0.09625244140625, 0.1368408203125, 0.1900634765625, 0.0167236328125, 0.1673583984375, 0.0789794921875, 0.08203125, 0.0055084228515625, 0.1064453125, 0.0958251953125, 0.0249481201171875, ...
embed
59700543_c1
59700543
prolog
1
3+1. is_avl_tree(Tree,H) :- is_tree(Tree), is_avl_tree_help(Tree,H). % Define relation between a Tree and a List tree_elements_help(nil,[]). tree_elements_help(tree(X,Le,Ri),L) :- tree_elements_help(Le,L1), tree_elements_help(Ri,L2), append(L1,[X|L2],L). tree_elements(Tree,L) :- is_tree(Tree), tree_elements_help(Tree,L...
3+1. is_avl_tree(Tree,H) :- is_tree(Tree), is_avl_tree_help(Tree,H). % Define relation between a Tree and a List tree_elements_help(nil,[]). tree_elements_help(tree(X,Le,Ri),L) :- tree_elements_help(Le,L1), tree_elements_help(Ri,L2), append(L1,[X|L2],L). tree_elements(Tree,L) :- is_tree(Tree), tree_elements_help(Tree,L...
[ 0.0159912109375, 0.0054931640625, -0.005126953125, -0.01361083984375, -0.0023956298828125, 0.007568359375, -0.029052734375, -0.01239013671875, 0.00494384765625, -0.0247802734375, 0.006317138671875, -0.0186767578125, 0.011962890625, 0.006439208984375, -0.00848388671875, -0.0111083984375...
[ 138, 21748, 83, 11, 50132, 62600, 62731, 13, 841, 15772, 73866, 1745, 262, 64552, 41911, 17721, 101344, 136, 32036, 53201, 62766, 17324, 1542, 5267, 23267, 866, 114689, 185, 141, 48538, 56, 117, 561, 304, 28864, 26073, 1250, 4867, 4527, 8...
[ 0.12890625, 0.1942138671875, 0.162841796875, 0.050018310546875, 0.2100830078125, 0.290283203125, 0.2113037109375, 0.09661865234375, 0.1494140625, 0.0770263671875, 0.25048828125, 0.0634765625, 0.050018310546875, 0.1605224609375, 0.174072265625, 0.1427001953125, 0.268310546875, 0.091...
embed
4125133_c0
4125133
prolog
0
Title: How can I delete specific appearances of elements from an array in Prolog? Problem title: How can I delete specific appearances of elements from an array in Prolog? Tags: element, list, prolog Problem: How can I delete specific appearances of elements from an array in Prolog? I want to delete only second appeara...
How can I delete specific appearances of elements from an array in Prolog? How can I delete specific appearances of elements from an array in Prolog? element list prolog an How Prolog How can I delete specific appearances of elements from an array in Prolog? I want to delete only second appearance of each element in gi...
[ -0.006683349609375, 0.00970458984375, -0.018798828125, 0.00738525390625, 0.00457763671875, 0.0186767578125, 0.0037689208984375, 0.002777099609375, 0.00982666015625, -0.00506591796875, 0.0194091796875, 0.006805419921875, -0.0003757476806640625, -0.00201416015625, 0.01409912109375, 0.016...
[ 11249, 831, 87, 154109, 29458, 170894, 7, 80854, 1295, 10298, 53, 23, 1250, 4867, 12830, 5303, 502, 3444, 47, 4734, 17932, 12638, 30646, 16750, 3525, 34627, 1884, 28032, 1653, 2063, 67, 35839, 191633, 866, 418, 10461, 339, 617, 363, 304 ]
[ 0.10308837890625, 0.08087158203125, 0.0285797119140625, 0.271484375, 0.1959228515625, 0.196533203125, 0.0418701171875, 0.1966552734375, 0.09698486328125, 0.166748046875, 0.13232421875, 0.0244903564453125, 0.1839599609375, 0.2491455078125, 0.1817626953125, 0.088134765625, 0.1029052734...
embed
23181991_c0
23181991
prolog
0
Title: Combining two numbers in prolog Problem title: Combining two numbers in prolog Tags: prolog Problem: Combining two numbers in prolog Kindly, could you help me in the following: I am writing a Prolog program that takes two numbers digits then combine them as one number, for example: Num1: 5 Num2: 1 Then the new n...
Combining two numbers in prolog Combining two numbers in prolog prolog Combining Num1 Num2 Combining two numbers in prolog Kindly, could you help me in the following: I am writing a Prolog program that takes two numbers digits then combine them as one number, for example: Then the new number is 51. Assume V1 is the fir...
[ -0.0135498046875, 0.01312255859375, -0.01141357421875, 0.0257568359375, 0.01422119140625, 0.035888671875, -0.0281982421875, 0.022705078125, -0.0023193359375, -0.0213623046875, -0.01031494140625, 0.0010833740234375, -0.003692626953125, 0.0014190673828125, -0.01611328125, -0.006469726562...
[ 106935, 592, 6626, 101935, 23, 502, 4867, 52782, 418, 304, 4358, 32562, 1250, 1528, 51776, 153939, 70163, 2856, 237, 1632, 14012, 3525, 8651, 66596, 310, 5117, 17932, 3444, 136, 6024, 62479, 678, 363, 3642, 831, 54 ]
[ 0.2281494140625, 0.0537109375, 0.1485595703125, 0.18212890625, 0.061859130859375, 0.168212890625, 0.2371826171875, 0.166015625, 0.099853515625, 0.1612548828125, 0.06158447265625, 0.0711669921875, 0.1319580078125, 0.1094970703125, 0.048614501953125, 0.1270751953125, 0.243408203125, ...
embed
13585843_c1
13585843
prolog
1
Userinfo,Host,Port,Path,Query,Fragment)), append([H], This, Scheme). %fine computazione end([S]). Gives this result: ?- scheme("http:", uri(A,_,_,_,_,_,_)). A = [104, 116, 116, 112, _G1205]. I think that part is correct, but now I want to convert the char list into a string, so I changed the last line to this: end([S]...
Userinfo,Host,Port,Path,Query,Fragment)), append([H], This, Scheme). %fine computazione end([S]). Gives this result: ?- scheme("http:", uri(A,_,_,_,_,_,_)). A = [104, 116, 116, 112, _G1205]. I think that part is correct, but now I want to convert the char list into a string, so I changed the last line to this: end([S]...
[ -0.004425048828125, 0.01422119140625, 0.00159454345703125, 0.034912109375, -0.024169921875, 0.0037841796875, 0.00628662109375, -0.0072021484375, 0.00055694580078125, -0.0291748046875, 0.01300048828125, -0.0177001953125, -0.0106201171875, 0.005950927734375, -0.0203857421875, -0.01074218...
[ 53400, 7319, 11193, 271, 60006, 683, 10519, 41732, 1294, 108386, 177, 114689, 71, 841, 3293, 34702, 282, 1745, 64552, 181135, 1782, 3564, 294, 16750, 705, 150370, 5475, 12, 39074, 284, 62, 2203, 66947, 45773, 25837, 724, 1530, 8194, 87, 5...
[ 0.139404296875, 0.2176513671875, 0.0477294921875, 0.0279541015625, 0.1072998046875, 0.00482177734375, 0.10174560546875, 0.056365966796875, 0.0498046875, 0.037628173828125, 0.053619384765625, 0.09814453125, 0.0192413330078125, 0.06951904296875, 0.1224365234375, 0.124267578125, 0.13793...
embed