Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

scistus prolog and clause
I have a problem with clause in sicstus prolog.

In theory something like clause(member(X,L),Body) should work, however
I got answer:
!Permission error: cannot access static user:member/2
! goal: clause(user:member(_79,_80)_86)

Any ideas?

Of course I consult my program where member is defined as
(clasically):
member(X, [X|_]).
member(X, [_|L]) :- member(X, L).

Lp,
Anton, ml.

Report this thread to moderator Post Follow-up to this message
Old Post
Anton
03-27-04 05:10 AM


Re: scistus prolog and clause
vahcica@email.si (Anton) wrote in message news:<8ebfff67.0403161215.6f4b2766@posting.google
.com>...
> I have a problem with clause in sicstus prolog.
>
> In theory something like clause(member(X,L),Body) should work, however
>  I got answer:
> !Permission error: cannot access static user:member/2
> ! goal: clause(user:member(_79,_80)_86)
>
> Any ideas?
>
> Of course I consult my program where member is defined as
> (clasically):
> member(X, [X|_]).
> member(X, [_|L]) :- member(X, L).
>
> Lp,
> Anton, ml.

hi Anton

Maybe member is a predefined predicate.

try :

clause(user:membr(_79,_80)_86) with

membr(X, [X|_]).
membr(X, [_|L]) :- membr(X, L).

succes!

Ton

Report this thread to moderator Post Follow-up to this message
Old Post
Ton
03-27-04 05:10 AM


Re: scistus prolog and clause
vahcica@email.si (Anton) wrote in message news:<8ebfff67.0403161215.6f4b2766@posting.google
.com>...
> I have a problem with clause in sicstus prolog.
>
> In theory something like clause(member(X,L),Body) should work, however
>  I got answer:
> !Permission error: cannot access static user:member/2
> ! goal: clause(user:member(_79,_80)_86)
>
> Any ideas?
>
> Of course I consult my program where member is defined as
> (clasically):
> member(X, [X|_]).
> member(X, [_|L]) :- member(X, L).
>
> Lp,
> Anton, ml.

hi Anton

No I was wrong this will work:

consult:

"
:-dynamic(memb/2).

memb(X, [X|_]).
memb(X, [_|L]) :- memb(X, L).   "

then in LPA I get:

: ?- clause(memb(X,L),Body).
X = _,
L = [X|_214259] ,
Body = true.......

hope this helps

Ton

Report this thread to moderator Post Follow-up to this message
Old Post
Ton
03-27-04 05:10 AM


Re: scistus prolog and clause
In SICStus, just put the line
:- use_module(library(lists)).
before you use member/2, because that is defined
in the lists library module.

Dave

"Anton" <vahcica@email.si> wrote in message
news:8ebfff67.0403161215.6f4b2766@posting.google.com...
> I have a problem with clause in sicstus prolog.
>
> In theory something like clause(member(X,L),Body) should work, however
>  I got answer:
> !Permission error: cannot access static user:member/2
> ! goal: clause(user:member(_79,_80)_86)
>
> Any ideas?
>
> Of course I consult my program where member is defined as
> (clasically):
> member(X, [X|_]).
> member(X, [_|L]) :- member(X, L).
>
> Lp,
> Anton, ml.



Report this thread to moderator Post Follow-up to this message
Old Post
Dave
03-27-04 05:10 AM


Re: scistus prolog and clause
Thanks people for all answers. Sicstus manual is not really generous with ex
amples.

Anton

"Dave" <vd419ll@freemail.hu> wrote in message news:<c39t7t$h6r$1@namru.matavnet.hu>...[colo
r=darkred]
> In SICStus, just put the line
> :- use_module(library(lists)).
> before you use member/2, because that is defined
> in the lists library module.
>
> Dave
>
> "Anton" <vahcica@email.si> wrote in message
> news:8ebfff67.0403161215.6f4b2766@posting.google.com... 

Report this thread to moderator Post Follow-up to this message
Old Post
Anton
03-27-04 05:10 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Prolog archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:07 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.