I have some problem whith this code. The func3 was never invoked :
technology(board, saw, table). technology(wood, sanded, board). technology(water, grow, tree). material(table, board, 20). material(table, tree, 5). material(wood, water, 100). equipment(table,saw, cut, 10). equipment(board, plane, polish, 7). equipment(tree, watering, growing, 100). specialization(saw, wood). specialization(plane, wood). specialization(watering, forestry). plan_vypusku(table,10). potreba_u_zahotovkah1(M, V):- write(M + V), nl, technology(F, _, M), material(M, F, C), Z is V * C, write(F - Z), nl. func3([A, B], C):- write("InF3"), nl, potreba_u_zahotovkah1(A, C), func3(B, C). func2([A, B], C):- write("InF2"), nl, findall(M, equipment(M, A, _, _), ML), write(ML), nl, func3(ML, C), func2(B, C). potreba_u_zahotovkah(C, G):- findall(X, specialization(X, C), XL), write(XL), nl, plan_vypusku(G, S), func2(XL, S).
Result:
?- potreba_u_zahotovkah(wood,table). [saw,plane] InF2 [table] false.
Help PLS!