[m-users.] Mercury for Game AI
David Epstein
davideps at umich.edu
Fri Jan 21 04:50:24 AEDT 2022
Thank you Zoltan and Fabrice. I just need to maintain (add and remove)
facts before a query. This seems possible in Mercury through various data
structures in the standard library. I need to review Julien's fruitbowl
example again. He used lists to permit compiled Mercury to behave in a way
similar to redefining a predicate. However, I'm not sure how this is
different than just using those same data structures directly in C#.
On Thu, Jan 20, 2022 at 7:24 PM Fabrice Nicol <fabrnicol at gmail.com> wrote:
> David's question, to some extent, revolves around how much reflective
> programming can be done in Mercury and for what kind of uses.
>
> In Prolog, lists can be converted to predicates and vice-versa
> dynamically thanks to =.. ('univ'). Mercury's implementation of 'univ'
> can only be partial and limited to static introspection, which is
> supported to some extent by library predicates construct / deconstruct
> (see library/prolog.m and the comments there).
>
> The Mercury compiler code itself makes heavy use of these library
> predicates (have a look at mercury/library/rtti_implementation.m, for one).
>
> If you need to go beyond static introspection and make use of dynamic
> intercession, as I understand you will in an interactive app like an AI
> game, then you will be better off sticking with Prolog. SWI and Sicstus
> are the only two dialects I know of that have a C# interface.
>
> Fabrice
>
>
> _______________________________________________
> users mailing list
> users at lists.mercurylang.org
> https://lists.mercurylang.org/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20220120/f434aa22/attachment.html>
More information about the users
mailing list