ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-ai
perl-ai
Yaswi with modules
by Steffen Schwigon other posts by this author
Jan 9 2006 7:30AM messages near this date
New AI::NeuralNet::Simple - feedback welcome | [Job Posting] Research Scientist, Eagan MN
Hi!

I'm using Language::Prolog::Yaswi.

Everything works ok with 'consult'ing prolog files.

When I write all my prolog in modules (without public/export
declaration) I have problems to use them in L::P::Yaswi.

My mini example (see attachments) has a predicate give_me_sth/2, that
can be used this way in pure swi prolog:

    $ pl
    ?- use_module('a.swipl').
    ?- use_module('b.swipl').
    ?- module(a).
    a:  ?- give_me_sth(2, Answer).
    Answer = 222 ;
    a:  ?- module(b).
    b:  ?- give_me_sth(2, Answer).
    Answer = 2 ;

However I'm not able to call it from Perl with L::P::Yaswi. I always
get:    error(existence_error(procedure, '/'(give_me_sth, 2)), _100).

I thought it should basically used this way:

  swi_use_modules ( "./a.swipl", "./b.swipl" );
  local $swi_module = 'a';                         ### or 'b'
  swi_set_query( give_me_sth(2, Answer) );
  swi_var(Answer);

Please see attachment for full mini example.

If someoene please could give me a hint what I'm doing wrong ...

I'm no prolog wizard anyway, so it's also possible I'm doing
something wrong there. 

(Greeti+Tha)nX
Steffen 
-- 
Steffen Schwigon <schwigon@[...].de> 
Dresden Perl Mongers <http://dresden-pm.org/> 
Attachments:
a.swipl
b.swipl
unknown1
use_swi.pl


Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved