users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic operators


From: ED-DBALI AbdelAli
Subject: Re: Dynamic operators
Date: Thu, 10 May 2001 11:32:21 +0200

"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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]