current_prolog_flag(version_data,ciao(_,_,_,commit_info(_,_,D,V))),format('Ciao ~a ~a~n',[V,D]),false. current_prolog_flag(version_data,ciao(_,_,_,commit_info(_,_,D,V))).
?- functor(P,F,A). noExpected: instantiation error.
Same when put into a file:
:- initialization((functor(_,_,_);writeq(bad))).results in
bad
?- setof(P,R^predicate_property(P,R),Ps). Ps = ['basiccontrol:!'] ? ; %% unexpected, expected as below Ps = ['basiccontrol:fail'] ? ?- findall(P,predicate_property(P,_),PsU),sort(PsU,Ps). Ps = ['basiccontrol:!','basiccontrol:fail','basiccontrol:repeat' ...
numberchars/3,cyclic_term/1 ttydisplay/1,ttydisplay_string/1,ttydisplayq/1,ttyflush/0,ttyget/1,ttyget1/1,ttynl/0,ttyput/1,ttyskip/1,ttyskipeol/0,ttytab/1 close_file/1,see/1,seeing/1,seen/0,tell/1,telling/1,told/0Missing BIPs:
current_predicate/1,false/0,set_stream_position/2
use_package(iso_strict).
g1:/opt/gupu/ciao> cat /etc/issue Ubuntu 21.10 \n \l g1:/opt/gupu/ciao> ./ciao-boot.sh local-install Configuration mode... basic Verbose builder... no Generate documentation... yes Generate .asr files during compilation... yes Enable parallel builds (experimental)... no Installation type... local Registration type... user Prefix for installation directories... Base for system installation... Installation directory for executables... Installation directory for 'man' pages... Installation directory for 'info' files... Permissions for installed execs/dirs... 775 Permissions for installed data files... 664 Custom group for installed files... Path of GNU make command... /usr/bin/X11/gmake Path of GNU tar command... /usr/bin/X11/tar Update dot shell initialization files... yes Shell initialization file for bash... /nfs/ahome/ulrich/.bashrc Shell initialization file for zsh... /nfs/ahome/ulrich/.zshrc Shell initialization file for csh/tcsh... /nfs/ahome/ulrich/.cshrc core:itf_format... f Enable (optional) runtime checks... no core:rtchecks_level... inner core:rtchecks_trust... yes core:rtchecks_entry... yes core:rtchecks_exit... yes core:rtchecks_test... no core:rtchecks_asrloc... yes core:rtchecks_predloc... yes core:rtchecks_callloc... predicate core:rtchecks_namefmt... long Symbolic link from Ciao to 'prolog' executable... yes Custom C compiler... Custom C linker... Additional C compiler flags... Specify additional C linker flags... Target OS... LINUX Force 32-bit architecture... no Force 64-bit architecture... no Target architecture... x86_64 Enable threads in engine... yes Enable and-parallel execution... no Enable parallel backtracking... no Enable tabled execution... yes Optimization level... optimized Engine debug level... nodebug => core.engine: building [bin] compiling ciaoengine.LINUXx86_64 (engine) /opt/gupu/ciao/builder/sh_src/config-sysdep/config-sysdep.sh: 501: [: ': unexpected operator /opt/gupu/ciao/builder/sh_src/config-sysdep/config-sysdep.sh: 501: [: ': unexpected operator /opt/gupu/ciao/builder/sh_src/config-sysdep/config-sysdep.sh: 501: [: unexpected operator /opt/gupu/ciao/builder/sh_src/config-sysdep/config-sysdep.sh: 501: [: unexpected operator => core.exec_header: building [bin]
g1:/opt/gupu/ciao> git describe fatal: No annotated tags can describe 'dc5c4356c624d718ba767600723174c357dfa124'. However, there were unannotated tags: try --tags.
?- X #= abs(-2). no
Ciao 1.20-v1.21.0-alpha.3-7-gd9db7548 (2021-06-10 04:46:33 +0200) [LINUXx86_64] ?- use_package(clpfd). {Using package /opt/gupu/ciao/core/library/clpfd/clpfd.pl {Including /opt/gupu/ciao/core/library/clpfd/clpfd_ops.pl } } yes ?- catch(X in _, Error, true). in/2 expected range found _1108 no ?-Expected: Error = error(instantiation_error, _)
ulrich@gupu:~/inst/ciao$ build/bin/ciao Ciao 1.15-master-ga7cc57a (2016-11-15 07:37:51 +0100) [LINUXx86_64] ?- use_package(clpfd). {Using package /home/ulrich/inst/ciao/contrib/library/clpfd/clpfd.pl {Including /home/ulrich/inst/ciao/contrib/library/clpfd/clpfd_ops.pl } } yes ?- X in 1..2. *LOOPS*
?- read_term(T,[variable_names(VNs)]). B+A+Y+D+C. T = _B+_A+_E+_D+_C, VNs = ['A'=_A,'B'=_B,'C'=_C,'D'=_D,'Y'=_E] ? yesThe variable order should be left-to-right. Thus expected:
VNs = ['B'=_B, 'A'=_A, 'Y'=_E, 'D'=_D, 'C'=_C]Here is a way to fix this quickly!
ulrich@gupu:/opt/gupu/src/c2/ciao$ ./ciao-boot.sh configure => boot: building ciaoc.sta [native code for LINUXx86_64] /opt/gupu/src/c2/ciao/build-boot/eng/ciaoengine/src/wam_alloc.c: In function ‘statistics’: /opt/gupu/src/c2/ciao/build-boot/eng/ciaoengine/src/wam_alloc.c:413:3: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘inttime_t’ [-Wformat=] ENG_PRINTF(s, ^more precisely:
177 ./ciao-boot.sh clean 178 history ulrich@gupu:/opt/gupu/src/c2/ciao$ ./ciao-boot.sh configure => ciao: configuring Installation type: ............ local Installation directory for documentation: /opt/gupu/src/c2/ciao/build/doc Installation directory for HTML manuals: /opt/gupu/src/c2/ciao/build/doc URL for installed HTML documents: /opt/gupu/src/c2/ciao/build/doc Installation directory for 'man' pages: /opt/gupu/src/c2/ciao/build/doc Installation directory for 'info' files: /opt/gupu/src/c2/ciao/build/doc [ GSL detected: yes ] Enable GSL bindings: .......... yes Auto-install GSL (third party): no Enable PPL bindings: .......... no Auto-install PPL (third party): no [ Mathematica detected: no ] WARNING: Mathematica has not been detected. If you want to use the Mathematica out of the box interface it is recommended that you stop the Ciao configuration now and install Mathematica first and/or add the directory of the MathKernel command line to your PATH variable. Enable Mathematica bindings: .. no Custom C compiler: ............ Custom C linker: .............. Additional C compiler flags: .. Specify additional C linker flags: Target OS: .................... LINUX Force 32-bit architecture: .... no Force 64-bit architecture: .... no Target architecture: .......... x86_64 Enable threads in engine: ..... yes Enable and-parallel execution: no Enable parallel backtracking: . no Enable tabled execution: ...... yes Optimization level: ........... optimized Engine debug level: ........... nodebug Enable unused predicate warnings: no core:compress_exec: ........... no core:itf_format: .............. f Enable compressed bytecode: ... no Enable (optional) runtime checks: no core:rtchecks_level: .......... inner core:rtchecks_trust: .......... yes core:rtchecks_entry: .......... yes core:rtchecks_exit: ........... yes core:rtchecks_test: ........... no core:rtchecks_inline: ......... no core:rtchecks_asrloc: ......... yes core:rtchecks_predloc: ........ yes core:rtchecks_callloc: ........ predicate core:rtchecks_namefmt: ........ long core:rtchecks_abort_on_error: . no Registration type: ............ user Update bash init file: ........ yes Bash initialization file: ..... /home/ulrich/.bashrc Update csh init file: ......... yes Csh/Tcsh initialization file: . /home/ulrich/.cshrc [ Emacs detected: yes ] Enable Emacs-based IDE: ....... yes Emacs init file: .............. ciao-mode-init.el Modify emacs init file: ....... yes Emacs initialization file: .... /home/ulrich/.emacs Emacs site start: ............. /opt/gupu/src/c2/ciao/core Emacs version to be used: ..... /usr/bin/emacs Base for PiLLoW HTML assets: .. /opt/gupu/src/c2/ciao/build/doc Base URL for PiLLoW HTML assets: /opt/gupu/src/c2/ciao/build/doc [ MySQL detected: no ] WARNING: MySQL has not been detected. If you would like to use the Ciao-MySQL interface it is highly recommended that you stop the Ciao configuration now and install MySQL first. Enable MySQL support: ......... no [ javac and javadoc detected: yes ] Enable Java interface: ........ yes [ Ant detected: yes ] Enable Ant support: ........... yes Symbolic link from Ciao to 'prolog' executable: yes Configuration mode: ........... basic Verbose builder: .............. no Generate documentation: ....... yes Generate .asr files during compilation: yes Source directory for Ciao: .... /opt/gupu/src/c2/ciao Install prefix: ............... /opt/gupu/src/c2/ciao/build Installation directory for libraries: /opt/gupu/src/c2/ciao/build/lib Default directory for Ciao libraries: /opt/gupu/src/c2/ciao/core Installation directory for executables: /opt/gupu/src/c2/ciao/build/bin Permissions for installed execs/dirs: 775 Permissions for installed data files: 664 Custom group for installed files: Path of GNU make command: ..... /usr/bin/make Path of GNU tar command: ...... /bin/tar Path of Apache Ant command: ... /usr/bin/ant => ciao: configured Please check that all the configuration values above are correct. If not, you can change or customize the configuration using the command line or --interactive configure flag. To continue the installation, execute 'build' and 'install' commands. ulrich@gupu:/opt/gupu/src/c2/ciao$ ./ciao-boot.sh build => core: building [no docs] => core: (engine) building [no docs] => core: (exec_header) building [no docs] => core: building 'ciaoc' command (using bootstrap compiler) => core: building 'ciaosh' command => core: building 'ciao-shell' command => core: building 'ciao' command => core: building 'ciao_sysconf' command => core: building 'ciaodump' command => core: building 'pldiff' command => core: building 'lpmake' command => core: building 'plindent' command => core: building 'checkline' command => core: building 'ciaoc_sdyn' command => core: compiling 'lib' libraries {ERROR: source_tree:filter_def/2 - existence error: procedure:source_tree:filter_def/2 does not exist} {ERROR (ciao_builder): Unknown error 'error(existence_error(procedure,source_tree:filter_def/2),source_tree:filter_def/2)'. }
ulrich@gupu:~$ /usr/local/bin/ciao Ciao 1.15-master-g17eb2bd (2016-09-26 14:38:09 +0200) [LINUXx86_64] ?- use_package(clpfd). {Using package /usr/local/lib/ciao/contrib-1.15/library/clpfd/clpfd.pl {Including /usr/local/lib/ciao/contrib-1.15/library/clpfd/clpfd_ops.pl } {ERROR: streams_basic:$open/3, arg 1 - system error: Permission denied} no
% TODO: Can this reader be implemented deterministically? % The reader can do backtracking at some points: % - when an operator can be infix and postfix at the same time % (e.g. op(400, xfy, a). op(400, yf, a). X = a a. ) % This problem is inherited by many Prolog. % (jfran)See NOTE 4 in 6.3.4.3 of ISO/IEC 13211-1:1995.
?- subsumes_term(X, f(X)). {ERROR: user:subsumes_term/2 - existence error: procedure:user:subsumes_term/2 does not exist} no ?- use_module(library(terms_check),[subsumes_term/2]). Note: module terms_check already in executable, just made visible yes ?- subsumes_term(g(X), g(f(X))). yes ?- subsumes_term(X, f(X)). yesExpected: failure.
Note that subsumes_term/2 does not check for instances in general! It checks for certain instances!
Added 2024-12-02: Also note that the documentation claims
that subsumes_term/2
checks for being an instance. But
?- subsumes_term(f(X,X),f(Y,X)). yes, unexpected. % and it is not even an instance ?- subsumes_term(f(Y,X),f(X,X)). yes % ok
ulrich@p0:/opt/gupu/src/ciao$ cat /etc/issue Ubuntu 12.04.5 LTS \n \l ulrich@p0:/opt/gupu/src/ciao$ echo $LANG en_US.UTF-8 ulrich@p0:/opt/gupu/src/ciao$ ./ciao-boot.sh configure => boot: building ciaoc.sta [native code for LINUXx86_64] cc1: error: unrecognized command line option ‘-std=gnu11’ cp: cannot stat `configure_main.d': No such file or directory /bin/sh: 3: cannot open configure_main.d: No such file cc1: error: unrecognized command line option ‘-std=gnu11’ cc1: error: unrecognized command line option ‘-std=gnu11’ make: *** [configure_main.o] Error 1 make: *** Waiting for unfinished jobs.... cp: cannot stat `configure.d': No such file or directory /bin/sh: 3: cannot open configure.d: No such file cc1: error: unrecognized command line option ‘-std=gnu11’ make: *** [configure.o] Error 1 ERROR: Bootstrap could not be compiled! If needed, use 'emergency-clean' to recover from inconsistent build states and try 'boot-rebuild' to build the bootstrap manually. If bootstrap compilation failed for your system, please consult online documentation or report the bug to <ciao-bugs@clip.dia.fi.upm.es>.
git describe
to get the
current version number:
ulrich@p0:/opt/gupu/src/swipl-devel$ git describe V7.3.28-11-ga5c3d9eThis does not work in Ciao:
ulrich@p0:/opt/gupu/src/ciao$ git pull Already up-to-date. ulrich@p0:/opt/gupu/src/ciao$ git describe fatal: No names found, cannot describe anything.
ulrich@p0:/opt/gupu/src$ git clone https://github.com/ciao-lang/ciao.git Cloning into 'ciao'... remote: Counting objects: 4464, done. remote: Total 4464 (delta 0), reused 0 (delta 0), pack-reused 4464 Receiving objects: 100% (4464/4464), 5.53 MiB | 992 KiB/s, done. Resolving deltas: 100% (1753/1753), done. ulrich@p0:/opt/gupu/src$ cd ciao ulrich@p0:/opt/gupu/src/ciao$ git log|head commit 17eb2bd70e3898bc25eec54229f85f4a677f7d57 Author: Jose F. Morales <jfmcjf@gmail.com> Date: Mon Sep 26 14:37:09 2016 +0200 Public snapshot for a0566bced4b35998ef2485b76eaa92d57e0f57d2 Src-commit: a0566bced4b35998ef2485b76eaa92d57e0f57d2 commit fbcb82ff81cc370f45bb22d0788ce29282677729 Author: Jose F. Morales <jfmcjf@gmail.com>
Ciao 1.15-1781-g328b907: Fri Sep 28 16:50:14 CEST 2012 ?- current_prolog_flag(double_quotes,X). X = chars ? ; no ?- writeq("abc"). [97,98,99] yesExpected: if the value is
chars
, then "abc" should be [a,b,c].
?- set_prolog_flag(double_quotes,codes). no
?- ulrich@gupu2:~/iso-prolog$ ciao WARNING: cannot create /usr/lib/ciao/ciao-1.15/lib/dcg/dcg_phrase_rt.itf
uninstantiation_error
op/3
errors,
subsumes_term/2
,
callable/1
,
acyclic_term/1
,
term_variables/2
,
call/2..8
,
max/2
,
min/2
,
(^)/2
,
asin/1
,
acos/1
,
atan2/2
,
tan/1
,
pi/0
,
xor/2
.
ulrich@gupu2:~$ ciao WARNING: cannot create /usr/lib/ciao/ciao-1.15/lib/dcg/dcg_phrase_rt.itf Ciao 1.15.0-14763: Thu Jun 28 14:39:04 CEST 2012
?- X = f(_,_), Y = X, _A = _. X = f(_A,_B), Y = f(_A,_B) ?
?- predicate_property(P,built_in). noExpected: All ISO built-ins.
?- use_module(engine(hiord_rt)). Note: module hiord_rt already in executable, just made visible yes ?- call(=(X),Y). Y = X ? ; no ?- call(functor(f(X),F),A). no
?- catch(X is 1 // 0, error(E,_), true). E = evaluation_error(zero_divisor,0) ? ;Expected:
E = evaluation_error(zero_divisor).
Error: ForbiddenTIMELINE_VIEW privileges are required to perform this operation
?- arg(0,f(a1,a2),A). no ?- arg(-1,f(a1,a2),A). noExpected:
domain_error(not_less_than_zero,-1).
History:
?- arg(I,f(a1,a2),A). noExpected:
instantiation_error
.
ulrich@gupu2:~/iso-prolog$ ciao Ciao 1.13.0-12829: Fri Nov 19 18:55:53 CET 2010 ?- set_prolog_flag(double_quotes,chars). yes ?- L="a". L = [97] ?Expected:
L = [a].
Also:
?- set_prolog_flag(double_quotes, codes). noExpected: Success.
?- length(Xs,I),X is cos(0.9 ** I), number_chars(X,Chrs), number_chars(Y,Chrs), X \== Y. Chrs = ['0','.','9','2','5','8','8','6','6','8','1','8','5','4','7','6','6','1'], I = 9, X = 0.9258866818547661, Xs = [_,_,_,_,_,_,_,_,_], Y = 0.925886681854766 ?
?- catch(X is-1**1.5,error(E,_),true). X = 0.Nan ? ;Expected:
E = evaluation_error(undefined)
?- callable(X).Expected: Failure.X = a ? ;X = [_|_] ? ; no
?- number_chars(0,['0','0']). noExpected: Success.
?- Xs=[a|Xs],atom_chars(A,Xs). {ERROR: Memory allocation failed [in Realloc()]} { Execution aborted }Expected:
type_error(list,[a| ...])
.
?- atom_chars(X, [a|_]). X = a ? ; {ERROR: atomic_basic:atom_codes/2, arg 2 - instantiation_error} no
?- phrase(([1]|[2]),Xs). {ERROR: user:|/4 - existence error: procedure:user:|/4 does not exist} ?- phrase(([1];[2]),Xs). {ERROR: basiccontrol:;/4 - existence error: procedure:basiccontrol:;/4 does not exist}Expected: Two solutions.
ulrich@gupu2:~$ ciao-1.13 Ciao 1.13.0-11568: Thu Dec 31 18:51:42 CET 2009 ?- use_module(library(hiord_rt)). {ERROR: absolute_file_name/7, arg 1 - existence error: source_sink:library(hiord_rt) does not exist}
?- use_module(library(hiord)). {Reading /usr/lib/ciao/ciao-1.13/lib/hiord.pl WARNING: (lns 1-1) Source used as module without module declaration } WARNING: cannot create /usr/lib/ciao/ciao-1.13/lib/hiord.itf {ERROR: internals:$open/3, arg 1 - existence error: source_sink:/usr/lib/ciao/ciao-1.13/lib/hiord.po does not exist}The documentation (ciao-1.13.0.dvi) p.505 Ch 85.1 suggests use_module(library(hiord_rt)). include/1 works.
?- X = * . X = * ?Expected: Within an appropriate mode, a syntax error should be signaled. This is due to 13211-1 5.1 e. With the exception of Siemens IF/Prolog, all other systems do not offer such a mode which means that Prolog code is brittle, since systems differ slightly in the way they do extensions. The standard does not specify the exact way how this mode is enabled. It could be one flag for everything, but it could be also a separate flag for each feature. E.g.
iso_operators
would be a nice flag name.
?- functor(F,f,400). noExpected: representation error
?- catch((X=[a|X],Y=..X), Pat, true). noExpected type error list.
?- X=1+X,Y is X.Expected: type error.Segmentation fault/ loops
?- catch(length(Xs,100000000),Pat,true).Expected resource error. Pat = error(...).{ERROR: Memory allocation failed [in Realloc()]} { Execution aborted }Now: no
?- X is 1<<(1<<32). X = 1 ?
dynamic
is a prefix operator:
?- X = static-(dynamic). X = static-dynamic ?Expected: brackets as in the query above. Sometimes, the brackets are written already:
?- X = 1* (+). X = 1*(+) ?