[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Info-gnuprologjava] Writing dynamic and rules
From: |
Daniel Thomas |
Subject: |
Re: [Info-gnuprologjava] Writing dynamic and rules |
Date: |
Thu, 24 Mar 2011 11:40:32 +0000 |
Hello,
You can't do ":- dynamic(initPassed/3)." at dynamically, it needs to be
specified in a file. However having done that you can dynamically assert
the rules for initPassed/3.
So you can dynamically generate rules but you need to specify in advance
using ensureLoaded files the terms to be used for the generated rules.
I hope that that helps,
Daniel
On Thu, 2011-03-24 at 12:16 +0100, Daniel Warzecha wrote:
> Hello,
>
> I just wanted to check if I remembered right:
>
> Using the interpreter in Java, and having loaded a Prolog file with
> ensureLoaded and runInitialization, can I assert facts like ":-
> dynamic(initPassed/3)."?
>
> Also, can I incorporate rules into the environment?
>
> The reason I ask is I want to dynamically generate predicates and
> rules at runtime with Java. It would be either doing the above or
> generating the prolog file to parse with ensureLoaded. I would prefer
> the dynamic generation, of course.
>
> Bye,
> Daniel W.
>
signature.asc
Description: This is a digitally signed message part