[m-users.] Inferring over dynamic data

Stepp, Nigel D ndstepp at hrl.com
Wed Jan 19 03:47:35 AEDT 2022


2022-01-18 01:07 GMT-07:00 Zoltan Somogyi <zoltan.somogyi at runbox.com>:

> 2022-01-18 18:01 GMT+11:00 "Stepp, Nigel D" <ndstepp at hrl.com>:
> > If anyone has pointers to an example of this kind of method, I would be very appreciative.​
>
> I already gave an example piece of Mercury code for computing the intersection of factA and factB.

Got that message before yours.

> > Is it the case that every predicate that would otherwise rely on the database of facts, should instead have a preamble that extracts > and attempts unification with some part of the data structure?
>
> Calling a predicate in Prolog *is* code that "attempts unification with some parts of a data structure".

Absolutely, and I'm trying to recover that when dealing with terms that come from an external source.

> Consider an example that in Prolog would use two dynamic predicates:
>
[ snip very nice map update example ]
>
> If that is not enough, don't make us guess what *would* be enough; give us a small example
> in Prolog of the kind of thing you would like to do.

Definitely not trying to make you guess. If I'm being general, it's 1) because I feel like this is a general problem, and 2) I am not able to share details of the code.

Here's a better example though, and then I'll go off and try a few things that replicate it taking inspiration from your examples.

Dynamic predicates:
isA/1, at/2, in/2, rel/2, trans/3

Rules:
p(X,Y) :-
    isA(X), isA(Y),
    in(Y,area),
    at(X,area).

p(X,Y) :-
    isA(X), isA(Y),
    trans(X,A1,area),
    trans(Y,A2,area),
    rel(A1,A2).

Now, we want setof(Y, p(x,Y), Ys), where instances of the dynamic predicates are computed in an external system during runtime.

Thank you again for your detailed responses!

> Zoltan.

--
Nigel Stepp, Ph.D. Information and System Sciences Lab HRL Laboratories, LLC.
3011 Malibu Canyon Road, Malibu, CA 90265 Office: +1 310-317-5267
CONFIDENTIALITY NOTICE: The information transmitted in this email, including attachments, is intended only for the person(s) or entity to which it is addressed and may contain confidential, proprietary and/or privileged material exempt from disclosure under applicable law. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this message in error, please contact the sender immediately and destroy any copies of this information in their entirety.


More information about the users mailing list