[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dynamic operators
From: |
Leonardo B. Lopes |
Subject: |
Re: Dynamic operators |
Date: |
Thu, 10 May 2001 11:49:15 -0500 (CDT) |
Thanks Ed. It turns out the error I was getting had to do with rereading a
file in which the operator was already defined. One more question: I
coulnd't find a way to reset gprolog to its initial state without exiting
and restarting it. Is there some way to do this?
Thanks,
Leo.
On Thu, 10 May 2001, ED-DBALI AbdelAli wrote:
> "Leonardo B. Lopes" wrote:
>
> > Is it possible to make an operator dynamic? such as:
> >
> > :- dynamic(is_parent/2).
> >
> > :- op(500,xfx,'is_parent').
> >
> > or something like that?
>
> Yes.
>
> To be sure, you can make this test after the 2 directives you gave:
>
> asserta(is_parent(a,b)). % prefix
> asserta(a is_parent c). % or infix notation
>
> The goal "X is_parent Y" gives the substitutions
>
> X = a, Y = c and X = a, Y =
> b
>
>
> Ali.
>
> _______________________________________________
> Users-prolog mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/users-prolog
>
========================================================================
Leonardo B. Lopes address@hidden
Ph.D. Student (847)491-8470
IEMS - Northwestern University http://www.iems.nwu.edu/~leo