Question 1
Comment puis-je combiner avec weatherInfo(X,Y)
airDensity(X,Y)
pour en faire une liste. Je veux que ce soit quelque chose comme ça si possible.Prolog: comment combiner 2 prédicat devenir 1 liste seulement
:- dynamic analize/3
outlook(Sunny).
outlook(Overcast).
outlook(Rain).
temperature(Hot).
temperature(Mild).
temperature(Cool).
humidity(Normal).
humidity(High).
windy(True).
windy(False).
weatherInfo(Sunny,Mild).
weatherInfo(Sunny,Cool).
weatherInfo(Overcast,Hot).
weatherInfo(Overcast,Mild).
weatherInfo(Overcast,Cool).
weatherInfo(Rain,Mild).
weatherInfo(Rain,Cool).
airDensity(Normal,False).
airDensity(Normal,True).
airDensity(High,False).
airDensity(High,True).
prediction(Result):-
analize([],[], _).
analize([H1|T1], [H2,T2], Result),
append(T1, [H2,T2], Result),
assertz([H1|T1], _, [H2,T2]),
Result =.. [[H1|T1], [H2,T2]),
write(L1, L2),
analize(NewT, NewL, Result).
Question 2
que je dois faire supprimer les anciennes données, mais je ne sais pas où je suis censé le faire. Est-ce après l'ajout ou avant l'ajout?
voir [findall] (http://www.swi-prolog.org/pldoc/doc_for?object=findall/3)/3 – CapelliC