[m-users.] Mercury for Game AI

Tomas By tomas at basun.net
Sun Jan 23 23:27:40 AEDT 2022


On Sun, 23 Jan 2022 12:32:30 +0100, David Epstein wrote:
> For me, the attraction of Prolog (and perhaps of Mercury) for game
> AI is resolution via unification over a complex set of rules and
> facts. For example, say bob is a person who is hiding. If he stops
> hiding, he will become vulnerable:
> 
> person(bob)
> hiding(bob)
> vulnerable(Person) :- not(hiding(Person))


Assuming you mean that all this is dynamic data, then the main problem
is that you need to keep track of the variable bindings (ie Person is
the same in vulnerable/1 and in hiding/1).

Then you would need to also code the logic (:- and not) but that is
fairly trivial. Mercury does the same searching as Prolog.

/Tomas


More information about the users mailing list