Marc.Bezem | 10 Oct 19:55

tail recursion?

Dear All,

is the following program tail recursive:

% length of a list as a unary integer
len([],0).
len([H|T],s(N)):- len(T,N).

The reason that I hesitate is the term s(N) in the head.
Is the call stack replaced by a linked list of s-records?

The following program should be tail recursive:

% length of a list as an accumulated unary integer
len([],N,N).
len([H|T],A,N):- len(T,s(A),N).

When explaining the difference between the two programs,
is it correct to say the the second program is more efficient
since it "doesn't use a stack"? Isn't it more correct to say
that the second program builds the stack in its accumulator
argument, and that this is less costly than using the call stack
for this purpose? Of course, the benefits of tail recursion are
greater in the case of normal, decimal representation of integers,
where you really don't need a stack thanks to the efficiency
of decimal representation. But actually "stacks encoded in
accumulator arguments" are frequently encountered, for example,
when reversing a list.

Any remark or comment is highly appreciated,
(Continue reading)

Jacques Bergeron | 10 Oct 17:21

SPARQL licensing

Hi all,
Sorry for this stupid question but I'm confused and need help!

I want to use SWI-Prolog for a commercial client and that's what I undestand:
- no licensing problem because the interpreter is LPGL and the base libraries have an 'exception' to the GPL that allows for commercial use (if not modified)
- the semweb and rdf libraries carry the 'exception' (by the way it seems like pretty nice stuff)
- the SPARQL development was switched to the ClioPatria project that is GPL (problem ahead!) and not officially published.

If I get it right, do you know of a SPARQL library that would go on top of the rdf/semweb libraries and carry a licence compatible with the rest of SWI-Prolog.

Best regards
Jacques


Valerio Senni | 10 Oct 11:57

SW-Prolog Version 5.6.58 and Debian (lenny)

Hello to everyone,

I have made a fresh new (apt-get) install of SWI Prolog
under Debian (lenny). Version 5.6.58.
And I get the following error:

$ swipl
Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 5.6.58) Copyright (c) 1990-2008 University of Amsterdam. SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit http://www.swi-prolog.org for details. For help, use ?- help(Topic). or ?- apropos(Word). ?- use_module(library(clpq)). ERROR: source_sink `library(clpq)' does not exist ?- [test].
ERROR: /home/valerio/test.pl:1: source_sink `library(clpq)' does not exist Warning: /home/valerio/test.pl:1: Goal (directive) failed: user:use_module(library(clpq)) % test compiled 0.01 sec, 1,584 bytes true.
?-

The file test.pl contains the clause ":- use_module(library(clpq))."
Is this expected ? :)
Can anyone help me?

Thank you
Valerio

paschke | 9 Oct 14:03

Special Journal Issue IEEE TKDE: Call for Contributions

Dear Colleagues,

Please consider to participate in RuleML-2008
(http://2008.ruleml.org/) which will be in about 3 weeks in Orlando,
Florida, collocated with the world largest Business Rules Forum.

We have a very interesting program with renowned speakers, a
prestigious rules Challenge, a special session + panel about Rule
standards, etc.

We are also editing a special issue of IEEE TKDE. Please consider to
contribute to this issue and forward the open call for contributions
(below) to your interested colleagues.

Thanks,

Adrian

[ our apologies should you receive this message more than one time ]

===========================================================================
                                CALL FOR Contributions

        Rule Representation, Interchange and Reasoning in Distributed,
                          Heterogeneous Environments

      Special Issue of IEEE Transactions on Knowledge and Data Engineering

       Guest Editors: N. Bassiliades, G. Governatori, A. Paschke, J.
Dix
===========================================================================

In recent years rule based technologies have enjoyed remarkable
adoption in two areas: (1) Business Rule Processing and (2)
Web-Centered Reasoning. The first trend is caused by the software
development life cycle, which needs to be accelerated at reduced cost.
The second trend is related to the Semantic Web and Service-oriented
technologies, which aim to turn the Web into a huge repository of
cross-referenced, machine-understandable data and processes. For both
trends, rules can be used to extract, derive, transform, and integrate
information in a platform-independent manner.
While early rule engines and environments were complex, expensive to
maintain, and not very user friendly, the current generation of rule
technology provides enhanced usability, scalability and performance,
and is less costly. A general advantage of using rules is that they
are usually represented in a platform independent manner, often using
XML. This fits well into today's distributed, heterogeneous Web-based
system environments.
Rules represented in standardized Web formats can be discovered,
interchanged and invoked at runtime within and across Web systems, and
can be interpreted and executed on any platform.

This special issue solicits state-of-the-art approaches, solutions and
applications in the area of Rule Representation, Reasoning and
Interchange in the context of distributed, (partially) open,
heterogeneous environments, such as the Semantic Web, Intelligent
Multi-Agent Systems, Event-Driven Architectures and Service-Oriented
Computing. We strongly advise that solicited contributions should
clearly identify the target class of applications they enable.

=======
Topics
=======

Original contributions, not currently under review or accepted by
another journal, are solicited in relevant areas including (but not
limited to) the
following:

- Rule Representation and Languages
     * Rule languages for exchanging and processing information through the
       web
     * Representation and meta-annotation of rules and rule sets for
       publication and interchange
     * Event-driven/action rule languages and models
     * Rule-based event processing languages and rule-based complex event
       processing
     * Modeling of executable rule specifications and tool support
     * Natural-language processing of rules
     * Graphical processing, modeling and rendering of rules
     * Rules in web 2.0, web 3.0, semantic web technologies and web
       intelligence research

- Reasoning and Rule Engines
     * Execution models, rule engines, and environments
     * Rule-based (multi-valued) reasoning with and representing uncertain
       and fuzzy information
     * Rule-based reasoning with non-monotonic negation, modalities, deontic,
       temporal, priority, scoped or other rule qualifications
     * Rule-based default reasoning with default logic, defeasible logic, and
       answer set programming
     * Compilation vs. interpretation approaches of rules
     * Hybrid rule systems

- Rule Interchange and Integration
     * Interchange and refactoring of rule bases in heterogeneous execution
       environments
     * Rule-based agility and its role in middleware
     * Communication between rule based systems using interchange formats and
       processing / communication middleware
     * Information integration of external data and domain knowledge into rules
     * Homogeneous and heterogeneous integration of rules and ontologies
     * Extraction and reengineering of platform-independent, interchangeable
       rules and rule models from existing platform-specific resources
     * Rule interchange standards and related industry interchange formats
     * Incorporation of rule technology into distributed enterprise
       application architectures
     * Interoperation between different rule formats and ontological domain
       conceptualization
     * Translation of interchangeable and domain-independent rule formats and
       rule models into executable technical rule specifications

- Rule Engineering and Repositories
     * Verification and validation of interchanged rule bases in
       heterogeneous execution environments
     * Practical solutions tackling the real-world software engineering
       requirements of rule-based systems in open, distributed environments
     * Collaborative authoring, modeling and engineering of rule
       specifications and rule repositories
     * Management and maintenance of distributed rule bases and rule
     repositories during their lifecycle

- Web Rule Applications
     * Applications and integration of rules in web standards
     * Applications of rules in the semantic web and pragmatic web
     * Applications based on (semantic) web rule standardization or
       standards-proposing efforts
     * Applications of rules in e.g. legal reasoning, compliance rules,
       security, government, security, risk management, trust and proof
       reasoning, etc.
     * E-contracting and automated negotiations with rule-based declarative
       strategies
     * Specification, execution and management of rule-based policies and
       electronic contracts
     * Rule-based software agents and (web) services
     * Theoretical and/or empirical evaluation of rule-based system
       performance and scalability

=======================
Submission Guidelines
=======================

Prospective authors should prepare manuscripts according to the Information
for Authors as published in recent issues of the journal or at
http://www.computer.org/tkde/. Note that mandatory over-length page charges
and color charges will apply.
Manuscripts should be submitted through the online IEEE manuscript
submission system at https://mc.manuscriptcentral.com/cs-ieee.
Updated information of this call can be found at
http://lpis.csd.auth.gr/publications/tkde-si/.

=======================
Schedule
=======================

Deadline for paper submission:     March 1, 2009
Completion of first review:    June 19, 2009
Minor/Major revision due:    August 21, 2009
Final decision notification:     November 6, 2009
Publication materials due:     December 4, 2009
Publication date (tentative):     July 2010

=======================
Guest Editors
=======================

Nick Bassiliades, Aristotle University of Thessaloniki, Greece
nbassili AT csd.auth.gr

Guido Governatori, NICTA, Australia
guido.governatori AT nicta.com.au

Adrian Paschke, Free University Berlin, Corporate Semantic Web, Germany
paschke AT inf.fu-berlin.de

Jurgen Dix, Clausthal University of Technology, Germany
dix AT tu-clausthal.de

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________
SWI-Prolog mailing list
SWI-Prolog <at> iai.uni-bonn.de
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

JeffRose | 9 Oct 14:20

XPCE questions for the list

I have two questions for the list:

1) I have created a refinement of bitmap class that has a popup recogniser associated with it. A side effect of the popup behavior is that the image on the bitmap is changed to reflect the popup selection. This works fine as long as I use it by itself in a dialog. But if I use it as a member of a menu (choice), then the images do not render properly. Any ideas? A test jig is attached.

2) The second question has to do with XPCE and it associated tool set (PCEDraw, dialog editor, etc.) --What is to become of it? It does not appear to be maintained very well. Both the Linux and Windows variants are pretty buggy these days and have been for some time. XPCE seems to work well enough (except as noted) as long as you hand-write your dialogs. But that's not the way these sorts of things are done these days. I spoke briefly with Jan about it. He believes that it needs a major "facelift", but has no resources to do it, and that it will be maintained at a "basic level" for the foreseeable future.

Regards,
Jeff R.


**************
New MapQuest Local shows what's happening at your destination. Dining, Movies, Events, News & more. Try it out!
(http://local.mapquest.com/?ncid=emlcntnew00000001)
Attachment (fancyMenu.zip): application/zip, 2522 bytes
Roberto Bagnara | 9 Oct 08:30

Is there a way to make SWI-Prolog Valgrind-clean?


Here is what I observe (note that I simply typed Control-D at the prompt):

$ export VALGRIND=yes
$ valgrind --tool=memcheck -q --trace-children=yes --leak-check=yes --num-callers=100
--leak-resolution=high --suppressions=/home/roberto/ppl/ppl/tests/valgrind_suppressions /usr/local/bin/pl
Welcome to SWI-Prolog (Multi-threaded, 32 bits, Version 5.6.61)
Copyright (c) 1990-2008 University of Amsterdam.
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.

For help, use ?- help(Topic). or ?- apropos(Word).

?-
% halt
==6515==
==6515== 24 bytes in 1 blocks are definitely lost in loss record 16 of 61
==6515==    at 0x40054E5: malloc (vg_replace_malloc.c:149)
==6515==    by 0x806904F: SinitStreams (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80E6B69: PL_initialise (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x8050D91: main (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==
==6515==
==6515== 24 bytes in 1 blocks are definitely lost in loss record 17 of 61
==6515==    at 0x40054E5: malloc (vg_replace_malloc.c:149)
==6515==    by 0x806901D: SinitStreams (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80E6B69: PL_initialise (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x8050D91: main (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==
==6515==
==6515== 24 bytes in 1 blocks are definitely lost in loss record 18 of 61
==6515==    at 0x40054E5: malloc (vg_replace_malloc.c:149)
==6515==    by 0x8068FE3: SinitStreams (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80E6B69: PL_initialise (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x8050D91: main (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==
==6515==
==6515== 1,024 bytes in 1 blocks are definitely lost in loss record 49 of 61
==6515==    at 0x40054E5: malloc (vg_replace_malloc.c:149)
==6515==    by 0x805546F: PL_malloc (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x8057A4B: codeToAtom (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80B8DD2: simple_term (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80B71AA: complex_term (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80BB6A7: read_term (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80BC8AF: read_clause (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80BCAEA: pl_read_clause_va (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x8064063: PL_next_solution (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80AA604: callProlog (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80DA15B: pl_with_mutex (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x805A9F1: callForeign (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x8061D6C: PL_next_solution (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80AA233: prologToplevel (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80E705F: PL_initialise (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x8050D91: main (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==
==6515==
==6515== 2,596 (44 direct, 2,552 indirect) bytes in 1 blocks are definitely lost in loss record 54 of 61
==6515==    at 0x40054E5: malloc (vg_replace_malloc.c:149)
==6515==    by 0x805546F: PL_malloc (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80D8546: allocSimpleMutex (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x8098B66: _lookupModule (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80991A8: lookupModule (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x8055736: PL_predicate (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x80E5702: PL_cleanup (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x8054A41: PL_halt (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
==6515==    by 0x8050DB6: main (in /usr/local/lib/pl-5.6.61/bin/i686-linux/pl)
$

Is there a way to configure/compile/execute SWI-Prolog so that it deallocates all
memory before exiting?
All the best,

    Roberto

--

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara <at> cs.unipr.it
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog <at> iai.uni-bonn.de
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

BelenT | 8 Oct 18:42

SWI-Prolog web interface


I am developing a web interface using SWI-Prolog, I need a link to open in a
new window (in html it would be target="_blank"). I have read the
documentation several times, but I am unable to find out how to do this.
Any help will be appreciated.
Thanks in advance,

Belen T.
--

-- 
View this message in context: http://www.nabble.com/SWI-Prolog-web-interface-tp19882798p19882798.html
Sent from the SWI Prolog mailing list archive at Nabble.com.

_______________________________________________
SWI-Prolog mailing list
SWI-Prolog <at> iai.uni-bonn.de
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Michael Igler | 8 Oct 15:56

Compile JPL on Mac

I want to compile JPL on my Mac having the following problem:

plld -embed-shared -o libjpl.dylib src/c/jpl.o -Wl,-framework,JavaVM
ld: in /opt/local/lib/libxml2.2.dylib, file is not of required  
architecture

The libxml has no PPC code inside (checked it with nm -arch...) and  
plld wants to build for both, INTEL and PPC.

So I want alter the Makefile to force plld with  -ld-options* to use  
only something like -arch i386?
Has anyone a workaround?

Mit freundlichen Grüßen / Best Regards

Michael Igler
Dipl. Inform. (Univ.)

Universität Bayreuth
Fakultät für Mathematik, Physik und Informatik
Lehrstuhl für Angewandte Informatik IV

AI 0.25
D-95440 Bayreuth

Fon : +49 921 - 55 7625
Fax : +49 921 - 55 7622
Email : michael.igler <at> uni-bayreuth.de
Internet : http://www.ai4.uni-bayreuth.de

Attachment (smime.p7s): application/pkcs7-signature, 2441 bytes
Nicolas Pelletier | 7 Oct 15:24

Tail call optimisation

Hello,

I am using SWI 5.6.61 on Linux and am wondering, out of curiosity, how
I can verify that the compilation of a predicate leads to a tail call
optimized blurb of code. Is there already such a thing in SWI ?

Regards,

--

-- 
Nicolas
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog <at> iai.uni-bonn.de
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Günter Kniesel | 7 Oct 14:20

Inconsistent display of variable bindings in visual debugger


I just noted that the visual debugger displays different names for
the same internal variable in its "normal" binding view and in the "detail
binding view" that appears when double-klicking one of the bindings.
For instance, in the attached screenshot, _G4968, which appears in
both arguments, changes to two different names in the detail view
of each argument. The screenshot shows that in the detail view for
the first argument, _G4968 is displayed as _G1486.

This behaviour can be quite confusing. Worse, it might lead to errors.
When using the detail view to access large values and to assemble
a test call that exposes a problem, the consistency of variables
shared among the bindings will be lost. For instance, replacement
of _G4968 by two different variables, say A and C, leads to

  Arg1 = calls(a2,A), Arg2 = (f=B, C=D, ...), testcall(Arg1,Arg2).
                  ^                ^
instead of

  Arg1 = calls(a2,A), Arg2 = (f=B, A=D, ...), testcall(Arg1,Arg2).
                  ^                ^
Is this possibly a result of a recent change? I am pretty sure
that I used to cut and paste large values from detail views in
order to create test cases for identified bugs. Or did it only
work by accident because the different bindings didn't share any
variables?

Could this be changed (back) in a future release?

-- Günter

--------------------------------------------------------------------
Dr. Günter Kniesel                    http://www.cs.uni-bonn.de/~gk/
Institut für Informatik III                        gk <at> cs.uni-bonn.de
Universität Bonn
Römerstr. 164 (Raum A107)                      Tel (+49 228) 73-4511
D-53117 Bonn                                   Fax (+49 228) 73-4382

[JPL] Reset Prolog session

Hi all,

I read in the chanegelog that one can initialize JPL only once to avoid inconsistencies. My problem is that a
prolog program I'm trying to use from Java works only once per session. I'm trying to fix this bug at its
source of course but this is not my code and debugging foreign code is ... well lets just say I'm looking for a
workaround in case I cannot find a way to fix this bug. 

Is there any way to start a new prolog session with JPL?
Are there other possibilities to reset prolog? (I tried retractall(x(_)) for every dynamic x but it did not help)

thanks
Florian
--

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog <at> iai.uni-bonn.de
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog


Gmane