From pmoura@di.ubi.pt Mon Feb 9 15:02:15 2004 From: pmoura@di.ubi.pt (Paulo Moura) Date: Mon, 9 Feb 2004 15:02:15 +0000 Subject: [bp-users]Logtalk 2.15.6 is now available for downloading Message-ID: Hi! Logtalk 2.15.6 is now available for downloading from the Logtalk web=20 site: http://www.logtalk.org/ This release provides significant improvements for the syntax coloring=20= configuration files for all supported text editors, including new=20 support for the KDE Kate and Kwrite editors. In addition, there is a=20 new compiler option related to the automatic generation of XML=20 documenting files, new support for the MacOS X Xcode IDE, and two small=20= bug fixes. =46rom the release notes: * Added "xmlspec" compiler option in order to specify the extension=20 (dtd or xsd) of the file describing the XML documenting files=20 specification. * Renamed compiler option "named_anonymous_vars" to the more=20 appropriated name "underscore_vars". Changed possible option values to=20= "dont_care" and "singletons" (default). * Added XSLT file for converting XML documenting files to XHTML 1.0=20 Strict files. Set the default encoding of all XSLT files to UTF-8. * Added syntax coloring support for the KDE Kate and Kwrite text=20 editors. * Improved syntax coloring configuration files for VIM, jEdit, NEdit,=20 SubEthaEdit, and Emacs text editors. * Removed outdated support for MacOS X Project Builder and added=20 support for the new MacOS X Xcode developer tool. * Corrected bug in the built-in predicate current_logtalk_flag/2 that=20 prevented some flag values from being returned after using the built-in=20= predicate set_logtalk_flag/2. * Corrected bug in the shapes example (wrong placement of the=20 declaration of the predicate side/1). The CVS tag for this release is "lgt2156". Happy logtalking! Paulo ----------------------------------------------------------- Paulo Jorge Lopes de Moura Dep. of Informatics Office 4.3 Ext. 3257 University of Beira Interior Phone: +351 275319700 6201-001 Covilh=E3 Fax: +351 275319891 Portugal ----------------------------------------------------------- From nzhou@acm.org Wed Feb 18 22:20:54 2004 From: nzhou@acm.org (Neng-Fa Zhou) Date: Wed, 18 Feb 2004 17:20:54 -0500 Subject: [bp-users]Re: once/1 for tabled predicates in B-Prolog Message-ID: <00be01c3f66d$7a636bb0$def9f592@ZHOU> Hi, some users of B-Prolog have asked about how to implement "once/1" for tabled predicates in B-Prolog. Here is my response. Hope it is of interest to you. Since version 6.4, B-Prolog has adopted a new strategy called lazy answer consumption for tabled subgoals. Under this strategy, answer consumption is postponed for tabled subgoals until all clauses are tried (for top-most looping subgoals answer consumption is postponed until the fixpoints are reached). This strategy is similar to the local scheduling strategy adopted in XSB. This strategy is more efficient in terms of both time and space than the eager consumption strategy for applications that require all-solution search such as deductive databases and machine learning systems . Nevertheless, for certain other applications such as planning and theorem proving, it is unrealistic to find all answers either because the search space is huge or because only one answer is needed. B-Prolog provides a predicate called "table_find_one(Call)" which succeeds if there is a variant of Call registered in the table that has at least one answer in the answer table. Call is unified with the first answer in the answer table after the call. This non-logical built-in can be used to implement once/1. In concrete, let p/1 be a tabled predicate in a program for which only one answer is needed. We replace each call p(X) in the program with once_p(X) and define once_p/1 as follows: once_p(X):-table_find_one(p(X)),!. once_p(X):-p(X). In this way, p(X) will stop producing any new answers once an answer has been produced. But notice that you cannot expect p(X) to return you all the answers in the search space after this transformation. If you want to find all answers some times and one answer some other times, you need to have two versions of the predicate. See the examples "farmer.pl" and "water.pl" in the directory "examples/tabling/" (you need to re-download the package from www.probp.com if you have an old version). I'll change the definition of "once/1" in the next version so that this kind of transformation will become unnecessary. For the time being, you can use this technique to solve possible problems. Regards, Neng-Fa Zhou