GithubHelp home page GithubHelp logo

vscosta / yap Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 11.0 122 MB

License: Other

Shell 0.17% C 60.77% SWIG 2.02% C++ 7.67% Python 1.74% CMake 1.06% Prolog 23.54% CSS 0.03% HTML 0.92% Makefile 0.34% QMake 0.01% Dockerfile 0.01% Roff 0.08% Meson 0.01% JavaScript 0.25% Emacs Lisp 0.90% Tcl 0.03% Jupyter Notebook 0.03% NSIS 0.02% TeX 0.41%

yap's People

Contributors

abramobagnara avatar davidmgvaz avatar denys-duchier avatar friguzzi avatar josephnunn avatar jpbsantos avatar miar avatar pedrocmoreno avatar pmoura avatar ricroc-dcc avatar rpereira avatar sei-eschwartz avatar teamspoon avatar uwn avatar vscosta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

yap's Issues

Manual: syntax outdated

The manual on syntax reads:

list_tail ---->      ',' list_expr
            |        ',..' subterm(999) % outdated by many decades
            |        '|' subterm(999)


YAP 7.4.0-ed2cc7fc (compiled  2023-07-05T16:19:51@g1)
database loaded from /opt/gupu/yap/lib/startup.yss

?- L = [A,..B].
user:0:0 error in top-level goal.
%%% bracket or operator expected. while parsing.

Also note that this grammar is the source for many misunderstandings. It is, e.g. ambiguous for prefix/postfix conflicts, whereas the standard states unambigously how to resolve such situations. See #147 ff.

Build does not work

g1:/opt/gupu/yap-src/Build> /opt/gupu/yap/bin/yap
C-predicate does not exist in new engine: >     prolog:$is_evaluable_property2/1
g1:/opt/gupu/yap-src/Build> git describe
fatal: No annotated tags can describe '61aff1456a9a5ae8c6f8a2a6b26ef0f896efc64a'.
However, there were unannotated tags: try --tags.

Attempting to build on macOS tries to use Apple's readline

Attempting to build on macOS tries to use Apple's BSD based version of the readline library. this happens in a system with both Homebrew and MacPorts installed:

The C compiler identification is AppleClang 13.0.0.13000029
The CXX compiler identification is AppleClang 13.0.0.13000029
Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
/lib
Found SWIG: /opt/local/bin/swig (found version "4.0.2") 
Could NOT find CUDD (missing: CUDD_LIBRARIES) 
Found Readline: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include (found version ".") 
Looking for include files stdio.h, readline/readline.h
Looking for include files stdio.h, readline/readline.h - found
Looking for include files stdio.h, readline/history.h
Looking for include files stdio.h, readline/history.h - found
Looking for add_history
Looking for add_history - not found
Looking for rl_begin_undo_group
Looking for rl_begin_undo_group - not found
Looking for rl_clear_pending_input
Looking for rl_clear_pending_input - not found
Looking for rl_discard_argument
Looking for rl_discard_argument - not found
Looking for rl_filename_completion_function
Looking for rl_filename_completion_function - not found
Looking for rl_free_line_state
Looking for rl_free_line_state - not found
Looking for rl_insert_close
Looking for rl_insert_close - not found
Looking for rl_reset_after_signal
Looking for rl_reset_after_signal - not found
Looking for rl_set_keyboard_input_timeout
Looking for rl_set_keyboard_input_timeout - not found
Looking for rl_set_prompt
Looking for rl_set_prompt - not found
Looking for rl_set_signals
Looking for rl_set_signals - not found
Looking for rl_catch_signals
Looking for rl_catch_signals - not found
...

If we turn off WITH_READLINE then we get the error:

Configuring done
CMake Error at CMakeLists.txt:268 (add_library):
  No SOURCES given to target: YAPReadline
Call Stack (most recent call first):
  os/readline/CMakeLists.txt:75 (add_component)

Arithmetic without overflow, no bignums

?- N is 2^58.
N=0, unexpected
?- N is 2^57.
N= -144115188075855872, unexpected

Apparently no gmp support was included in my installation. In that case, either the installation procedure should protest or clean arithmetical overflows should be produced.

Uses raptor_log_error_formatted which is internal

Building yap 6.3.4 fails*, and I believe the problem remains in this yap 7 repository. The error is:

packages/raptor/raptor_yap.c:60:7: error: implicit declaration of function 'raptor_log_error_formatted' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      raptor_log_error_formatted(term->world, RAPTOR_LOG_LEVEL_ERROR, NULL,
      ^

In raptor 2.0.15, raptor_log_error_formatted is declared using the keyword RAPTOR_INTERNAL_API in the file raptor_internal.h, which is not installed, so I don't think you are allowed to use it in your code.

*when -Werror=implicit-function-declaration is in CFLAGS. This is the default behavior of the version of clang included in Xcode 12 and later.

dif/2 incomplete

?- X = Y, dif(X-Y,1-2).
X=X % kind-of correct
?-        dif(X-Y,1-2), X = Y.
no % unexpected

#12.

In 6.3 this produces some memory error. Reported 2015-05-31 as Item#306

cmake error

Using recent version of cmake rises the following error:

$ cmake --version
cmake version 3.22.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ cmake ..
-- The C compiler identification is AppleClang 13.0.0.13000029
-- The CXX compiler identification is AppleClang 13.0.0.13000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:127 (list):
  Policy CMP0121 is not set: The list() command now validates parsing of
  index arguments.  Run "cmake --help-policy CMP0121" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.
  Invalid list index "pre".
This warning is for project developers.  Use -Wno-dev to suppress it.

/usr/local/lib
CMake Warning (dev) at CMakeLists.txt:142 (list):
  Policy CMP0121 is not set: The list() command now validates parsing of
  index arguments.  Run "cmake --help-policy CMP0121" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.
  Invalid list index "pos".
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:163 (GET_FILENAME_COMPONENT):
  GET_FILENAME_COMPONENT called with incorrect number of arguments


-- Configuring incomplete, errors occurred!
See also "/Users/pmoura/Documents/Prolog/yap/build/CMakeFiles/CMakeOutput.log".
See also "/Users/pmoura/Documents/Prolog/yap/build/CMakeFiles/CMakeError.log".

build issue

current HEAD has a corrupt file and so was unusable:
/home/fab/Build/yap/os/fmem.c:172:5: error: ‘memcpy9’ undeclared (first use in this function); did you mean ‘memcpy’?
172 | memcpy9=00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
This looks like file corruption.
Platform is Ubuntu 20.10 with gcc-10.2, source configured without python (would not build, independent issue).

Building error: can't find JNI and Python3

I'm trying to build YAP but I'm receiving some errors. I'm using macOS Monterey 12.2.1.

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/.local/bin ..
/usr/local/lib
-- Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR)
-- Could NOT find CUDD (missing: CUDD_LIBRARIES CUDD_INCLUDE_DIR)
   * Sqlite3 Data-Base (http://www.sqlite3.org), distributed with MYDDAS
ql
   * Sqlite3 Data-Base (http://www.sqlite3.org), distributed with MYDDAS
-- Building YAP packages version
-- Could NOT find Gecode, use Gecode_ROOT to hint its location (missing: GECODE_INCLUDE GECODE_LIBRARY)
-- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS)
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS)
-- Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS)
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS)
-- Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
-- Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found version "3.9.8")
During startup - Warning messages:
1: Setting LC_COLLATE failed, using "C"
2: Setting LC_TIME failed, using "C"
3: Setting LC_MESSAGES failed, using "C"
4: Setting LC_MONETARY failed, using "C"
-- Found R: /usr/local/Cellar/r/4.1.2/lib/R
-- Checking whether system has ANSI C header files
-- ANSI C header files - not found
-- Packages found:
-- The following features have been enabled:

 * YAPPython, Python3 3.9.8, at /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib, /usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib; and NumPy
 * real, The R Project for Statistical Compputing, at /usr/local/Cellar/r/4.1.2/lib/R. with libraries /usr/local/lib/libR.dylib

-- The following OPTIONAL packages have been found:

 * PkgConfig
 * Threads
 * Java
 * LibR

-- The following features have been disabled:

 * swig, SWIG interface generator version , at

-- The following OPTIONAL packages have not been found:

 * SWIG
 * CUDD
 * Gecode
 * JNI
 * MPI
 * Python3

-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
JAVA_INCLUDE_PATH (ADVANCED)
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
JAVA_INCLUDE_PATH2 (ADVANCED)
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
   used as include directory in directory /Users/gabriele/Programs/yap
_Python3_NumPy_INCLUDE_DIR
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python/yap4py
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python/yap4py
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python/yap4py
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python/yap4py
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python/yap4py
   used as include directory in directory /Users/gabriele/Programs/yap/packages/python/yap4py

CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "libYap":

    "JAVA_INCLUDE_PATH-NOTFOUND"



CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "libYap":

    "JAVA_INCLUDE_PATH-NOTFOUND"



CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "yap-bin":

    "JAVA_INCLUDE_PATH-NOTFOUND"



CMake Error in CMakeLists.txt:
  Found relative path while evaluating include directories of "yap-bin":

    "JAVA_INCLUDE_PATH-NOTFOUND"



CMake Error in packages/python/CMakeLists.txt:
  Found relative path while evaluating include directories of "Py4YAP":

    "_Python3_NumPy_INCLUDE_DIR-NOTFOUND"



CMake Error in packages/python/CMakeLists.txt:
  Found relative path while evaluating include directories of "Py4YAP":

    "_Python3_NumPy_INCLUDE_DIR-NOTFOUND"



CMake Error in packages/python/CMakeLists.txt:
  Found relative path while evaluating include directories of "YAPPython":

    "_Python3_NumPy_INCLUDE_DIR-NOTFOUND"



CMake Error in packages/python/CMakeLists.txt:
  Found relative path while evaluating include directories of "YAPPython":

    "_Python3_NumPy_INCLUDE_DIR-NOTFOUND"



-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

However, I have installed JDK and Python:

$ java -version
java version "18" 2022-03-22
Java(TM) SE Runtime Environment (build 18+36-2087)
Java HotSpot(TM) 64-Bit Server VM (build 18+36-2087, mixed mode, sharing)
$ python --version
Python 3.9.2

Also, in the cmake output you can see that it says "Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found version "3.9.8")", and if I'm not mistaken 3.9.8 is Python3, isn't it?

Finally, in any case, Java and Python should be optional, right? Is it correct that I'm receiving building errors for those?

DCGs: unexpected error

?- phrase(([a],[]),L).
user_input:51:0 error:
/opt/gupu/yap-src/pl/predtypes.yap:0:0 error executing prolog:,/4:
%%% [a] should be of type callable.

no

?- catch(phrase(([a],[]),L),error(Err,_),true).
Err=type_error(callable,[a]), unexpected.
   L = [a]. % expected

([a],[])) is a completely valid grammar rule body.

YAP Windows installer?

Is there a Windows installer for a recent YAP version available for downloading? Tried the installer for YAP 6.3.4 on Windows 10 but YAP crashes at startup.

gmp linking error

With the current git version (4f0444f), building fails with a gmp linking error:

[ 27%] Linking C shared library libYap.dylib
Undefined symbols for architecture x86_64:
  "___gmpq_abs", referenced from:
      _Yap_gmp_abs_big in gmp_support.c.o
  "___gmpq_add", referenced from:
      _Yap_gmp_add_int_big in gmp_support.c.o
      _Yap_gmp_add_big_big in gmp_support.c.o
      _Yap_gmp_round in gmp_support.c.o
  "___gmpq_canonicalize", referenced from:
      _Yap_gmq_rdiv_int_int in gmp_support.c.o
      _Yap_gmp_float_rationalize in gmp_support.c.o
  "___gmpq_clear", referenced from:
      _MkRatAndClose in gmp_support.c.o
      _Yap_gmp_mul_big_big in gmp_support.c.o
      _Yap_gmq_rdiv_int_big in gmp_support.c.o
      _Yap_gmq_rdiv_big_int in gmp_support.c.o
      _Yap_gmq_rdiv_big_big in gmp_support.c.o
      _Yap_gmp_fdiv_int_big in gmp_support.c.o
      _Yap_gmp_fdiv_big_int in gmp_support.c.o
      ...

Built-in predicate request: function_property/2

Latest versions of LVM and Trealla Prolog implement a function_property/2 built-in predicate, which provides similar functionality to the de facto standard predicate_property/2 built-in predicate, allowing checking or enumerating the properties of a given arithmetic function. The function_property/2 predicate allows clean checking if an arithmetic function is defined, simplifying e.g. portability linter checks for arithmetic expressions. The first argument is a function template (e.g. abs(_)) and the second argument is the property. Four properties are specified:

  • built_in (function is a defined built-in arithmetic function)
  • foreign (function is a defined arithmetic function implemented using the FLI)
  • static (function is a static arithmetic function)
  • dynamic (function is a dynamic arithmetic function)

The dynamic is meant for Prolog systems that allow runtime definition of new arithmetic functions (e.g. LVM). Built-in and foreign functions usually also have the static property.

The predicate spec is:

Template:
function_property(Function, Property)
Modes and number of proofs:
function_property(+callable, ?function_property) - zero_or_more

Exceptions:

  • Function is a variable:
    instantiation_error
  • Function is neither a variable nor a callable term:
    type_error(callable, Function)
  • Property is neither a variable nor an atom:
    type_error(atom, Property)
  • Property is an atom but not a valid function property:
    domain_error(function_property, Property)

Examples:

Check that popcount/1 is a built-in arithmetic function:

?- function_property(popcount(_), built_in).
true.

Would it be possible to add this predicate to YAP?

div/2 arithmetic function reports the wrong argument

$ yap
YAP 7.4.0-a2b970a3 (compiled  2023-06-09T21:23:[email protected])
database loaded from /usr/local/lib/startup.yss

?- X is div(7.5, 2).
user_input:1:0 error:
user_input:0:0 error executing prolog:is/2:
%%% 2 should be of type integer.
%
% info: div/2


no

?- catch(X is div(7.5, 2), Error, true).
Error=error(type_error(integer,2),[])

Checks for libxml2.h which does not exist

packages/raptor/CMakeLists.txt checks for libxml2.h and libxml2/libxml2.h. This fails:

-- Found LibXml2: /opt/local/lib/libxml2.dylib (found version "2.9.10") 
-- Looking for include file libxml2/libxml2.h
-- Looking for include file libxml2/libxml2.h - not found
-- Looking for include file libxml2.h
-- Looking for include file libxml2.h - not found

libxml2 2.9.10, at least, does not provide any header called libxml2.h. Here is the list of headers that it does provide:

/opt/local/include/libxml2/libxml/DOCBparser.h
/opt/local/include/libxml2/libxml/HTMLparser.h
/opt/local/include/libxml2/libxml/HTMLtree.h
/opt/local/include/libxml2/libxml/SAX.h
/opt/local/include/libxml2/libxml/SAX2.h
/opt/local/include/libxml2/libxml/c14n.h
/opt/local/include/libxml2/libxml/catalog.h
/opt/local/include/libxml2/libxml/chvalid.h
/opt/local/include/libxml2/libxml/debugXML.h
/opt/local/include/libxml2/libxml/dict.h
/opt/local/include/libxml2/libxml/encoding.h
/opt/local/include/libxml2/libxml/entities.h
/opt/local/include/libxml2/libxml/globals.h
/opt/local/include/libxml2/libxml/hash.h
/opt/local/include/libxml2/libxml/list.h
/opt/local/include/libxml2/libxml/nanoftp.h
/opt/local/include/libxml2/libxml/nanohttp.h
/opt/local/include/libxml2/libxml/parser.h
/opt/local/include/libxml2/libxml/parserInternals.h
/opt/local/include/libxml2/libxml/pattern.h
/opt/local/include/libxml2/libxml/relaxng.h
/opt/local/include/libxml2/libxml/schemasInternals.h
/opt/local/include/libxml2/libxml/schematron.h
/opt/local/include/libxml2/libxml/threads.h
/opt/local/include/libxml2/libxml/tree.h
/opt/local/include/libxml2/libxml/uri.h
/opt/local/include/libxml2/libxml/valid.h
/opt/local/include/libxml2/libxml/xinclude.h
/opt/local/include/libxml2/libxml/xlink.h
/opt/local/include/libxml2/libxml/xmlIO.h
/opt/local/include/libxml2/libxml/xmlautomata.h
/opt/local/include/libxml2/libxml/xmlerror.h
/opt/local/include/libxml2/libxml/xmlexports.h
/opt/local/include/libxml2/libxml/xmlmemory.h
/opt/local/include/libxml2/libxml/xmlmodule.h
/opt/local/include/libxml2/libxml/xmlreader.h
/opt/local/include/libxml2/libxml/xmlregexp.h
/opt/local/include/libxml2/libxml/xmlsave.h
/opt/local/include/libxml2/libxml/xmlschemas.h
/opt/local/include/libxml2/libxml/xmlschemastypes.h
/opt/local/include/libxml2/libxml/xmlstring.h
/opt/local/include/libxml2/libxml/xmlunicode.h
/opt/local/include/libxml2/libxml/xmlversion.h
/opt/local/include/libxml2/libxml/xmlwriter.h
/opt/local/include/libxml2/libxml/xpath.h
/opt/local/include/libxml2/libxml/xpathInternals.h
/opt/local/include/libxml2/libxml/xpointer.h

The only libxml2 headers you actually include, in packages/raptor/xml2_yap.c, are libxml/parser.h and libxml/tree.h.

call_nth/2 needed

For systematic testing, call_nth/2 of the Prolog prologue is needed. That's the only way to locate errors. Note that the Prolog prologue does not prescribe a specific library, but only requires that this feature is provided somehow.

cmake: only very new versions accepted

I get on my laptop where I just did sudo apt install cmake

ulrich@TU-Wien:/opt/gupu/yap/Build$ cmake ../
CMake Error at CMakeLists.txt:9 (cmake_minimum_required):
  CMake 3.18 or higher is required.  You are running version 3.10.2


-- Configuring incomplete, errors occurred!
ulrich@TU-Wien:/opt/gupu/yap/Build$ cat /etc/issue
Ubuntu 18.04.5 LTS \n \l

So far I succeed to install YAP only on g1, where I can connect to. But interactivity remotely is pretty bad.
And then I have my other laptop with 14.04.6, where I do all editorial stuff.

Bugs writing and recognizing floats

$ yap
YAP 7.4.0-a2b970a3 (compiled  2023-06-09T21:23:[email protected])
database loaded from /usr/local/lib/startup.yss

?- write(1.04858e+6), nl.
1.04858+6
yes
?- number(1.04858e+6).
no

These bugs explain at least 37 failures in the Logtalk distribution tests.

phrase/2: unexpected error

g1:/opt/gupu/yap-src> /opt/gupu/yap/bin/yap
YAP 7.4.0-894c8220 (compiled  2023-12-04T09:37:10@g1)
database loaded from /opt/gupu/yap/lib/startup.yss

?- phrase('|'([],[a]),[a]). 
user_input:1:0: error: user_input:0:0: error executing prolog:|/4:

%%% procedure prolog:t_body/6 does not exist.
%
% info: prolog:t_body(([]|[a]),_19,last,[a],[],_23)

Home page: old version

git clone https://github.com/vscosta/yap-6.3 yap

should read

git clone https://github.com/vscosta/yap yap

dif/2: odd extension mechanism

dif#e1:

YAP 7.4.0-a2b970a3 (compiled  2023-06-10T04:44:26@g1)
database loaded from /opt/gupu/yap/Build/startup.yss

?- asserta(dif(1,1)), dif(X,1).
X=1 ;
dif(X,1)

Either or, but it cannot be both. In previous versions, dif/2 was a built-in and there was no way to undefine it. The simplest way is to load it via a library. But then you have to declare that everywhere. An implicit mechanism as in SWI might make sense, provided, there is a way to switch off the default definition completely such that one gets an existence error for dif/2 in that case.

dif/2: no residual goals shown

g1:/opt/gupu/yap/Build> ./yap
YAP 7.4.0-20439788 (compiled  2023-06-09T15:01:40@g1)
database loaded from /opt/gupu/yap/Build/startup.yss

?- call_residue_vars(dif(X,1),Vs).
Vs=[X].
yes

?- dif(X,1), X = 1.
no

?- dif(X,1).
yes
.
yes

This answer seems to be broken.

Older versions, like 6.3 answered as expected

 ?- dif(X,1).
dif(X,1).

BTW, since when does YAP have dif/2? My guess would be around 2000. At least it is unmentioned in PPDP'99.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.