Re: How can I make scope in prolog?

Paulo Moura <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 13/01/2014, at 12:22, He-chien Tsai <[email protected]> wrote:

> I want to scope the scope which prolog inference engine is restricted in
> that scope.
> 
> for example:
> 
> 
> pred1(A) :- pred2(A). % rule 1
> 
> scope(scope1).
> % In this scope, rule 1 is deprecated
> pred2(A) :- pred3(A). % rule 2
> pred3(b). % rule 3
> 
> pred2(A). % A = b.
> pred1(A). % no.
> 
> end_scope(scope1).

Not sure I fully understand your question but SWI-Prolog module system and Logtalk object system allows you to define define a scope for a set of predicates using modules or objects.

Cheers,

Paulo

-----------------------------------------------------------------
Paulo Moura
Logtalk developer

Email: <mailto:[email protected]>
Web:   <http://logtalk.org/>
-----------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.