开发者

Is it possible make predicate from List?

开发者 https://www.devze.com 2023-03-06 06:20 出处:网络
I use SWI-Prolog I have lists like this [sunny,hot,high,weak,no] and [outlook,temperature,humidity,wind,play_tennis]

I use SWI-Prolog

I have lists like this

[sunny,hot,high,weak,no]

and

[outlook,temperature,humidity,wind,play_tennis]

I want to ma开发者_JAVA百科ke a predicate like

run(no,  [outlook=sunny,    temp=hot,  humidity=high,   wind=weak  ]).

Is it possible?


Yes, but you're going to have to implement the appropriate machine learning algorithm (your example looks identical to the ones found in Mitchell's machine learning book, is this a homework assignment?).

Note that you can use the =.. operator to turn a list into a predicate, which might help you if I've misunderstood your original question. In other words, A=..[a,b,c] binds a(b,c) to A

0

精彩评论

暂无评论...
验证码 换一张
取 消