Did you know ... Search Documentation:
Profile for user LogicalCaptain

Tags by LogicalCaptain

coroutinesSec. 4.10
deprecatedlibrary_directory/1, reconsult/1
doc-needs-helpis_of_type/2, assertion/1, , memberchk/2, cyclic_term/1, [wiki] Wiki page at "FAQ/reconsult.txt", ?=/2, dif/2, ==/2, Sec. A.48, [wiki] XPCE: the SWI-Prolog native GUI library, [wiki] Fix incomplete installation due to missing dependencies, [wiki] SWI-Prolog future directions, [wiki] Program Development Tools, call/1, format/2, Sec. 2.12, Sec. 2.16.1, maplist/2, writef/2, Sec. 2.16.1.3, Sec. 1.1, pengine_event_loop/2, Sec. 4.14, Sec. A.29, float/1, check/0, Sec. A.20, end_tests/1, Sec. 6.1, setup_call_cleanup/3, Sec. A.37, open/3, \=/2, \==/2, meta_predicate/1, Sec. 12.3, PL_register_foreign_in_module(), PL_get_atom_chars()
docs-needs-helpSec. 4.1

Comments by LogicalCaptain

PL_get_atom_chars()Soo... what do I do with the char**s after use? Just leave it be?
PL_register_foreign_in_module()"After this call returns successfully" means... it returns 0?
Sec. 12.3`As of SWI-Prolog 7.3.12, the arity of terms has changed from int to size_t.` In ...
sleep/1"On most non-realtime operating systems we can only ensure execution is suspende ...
meta_predicate/1Confused by "The argument is a term that is used to reference a predicate with N more arguments than the given argument term.
Sec. 6.5Confused by "The argument is a term that is used to reference a predicate with N more arguments than the given argument term.
Sec. 6.1As noted by Paulo Moura "Prolog Modules" (SWI-Prolog Modules?) can be seen as "o ...
current_prolog_flag/2This is not the user's home directory: == ?- current_prolog_flag(home, X). X = ' ...
nan/0== ?- NAN is nan, write_canonical(NAN). 1.5NaN NAN = 1.5NaN. == Weird! I suppose one can test against NaN using =:= ?
max/2This should really be extended to take vectors: == Big is max(ListOfExpressions) ...
=:=/2Some examples: Everything must be known at the time of evaluation: == ?- 2*2 =:= X. ERROR: Arguments are not sufficiently instantiated ?- X=4.0, 2*2 =:= X. X = 4.0. ?- cos(X) =\= sin(X). ERROR: Arguments are not sufficiently instantiated % Ok, then! ?- X=pi, cos(X) =\= sin(X). X = pi. == Sadly =:= is a bit fussy.
\==/2For clarity, this should be written with complimentary parentheses: == \+(Term1 ...
copy_term/2An example: == ?- X=f(A,b),Y=f(a,B),copy_term(X,Y). X = f(A, b), Y = f(a, b), B ...
\=/2We read: _"In other cases, such as `?- X \= Y.`, the predicate fails although th ...
\=/2It would be clearer to write == \+(Term1 = Term2) == rather than than == \+Term1 = Term2 == Although of course: == ?- write_canonical(\+Term1 = Term2). \+(=(_,_)) ==
->/2Consider the expression: == test1(A) -> exec1(A,B); test2(A) -> exec2(A,B); else ...
initialization/2Regarding "main", note that an exit status of 0 indicating "success" is a conven ...
Sec. 2.11.2.1Contra Carlo Capelli's note, the "shebang" is not at all overengineered. As a co ...
option/2I'm not sure why, but this predicate is indeed semi-deterministic. This means yo ...
Sec. 4.36Also consider library "filesex" ("extended operations on files", damned PhDs doi ...
Sec. A.21For the shebang trick where swipl is started indirectly through =env= == #!/usr/ ...
Sec. A.21For the "initialization" directive, see: https://www.swi-prolog.org/pldoc/doc_fo ...
open/3What does an empty option list assume about the encoding of the file? See: https ...
setup_call_cleanup/3The example given in the text is incomprehensible, here is another one: == alty ...
setup_call_cleanup/3Demo of determinism in the cleanup procedure: == ?- setup_call_cleanup(true,memb ...
setup_call_cleanup/3== intro :- format("intro\n").
deterministic/1Example: == ory :- format("1st clause:\n"), deterministic(D1), format(" Det at ( ...
setup_call_cleanup/3This is a bit like try-with-resources in Java: https://docs.oracle.com/javase/tu ...
atom/1See also: https://www.swi-prolog.org/pldoc/man?section=text-representation Atoms ...
Sec. 2.12This page could really become more legible if the flags were divided up by subje ...
Sec. 6.2There is also the predicate =module/1= which is used to set (but not query) the ...
option/3Example: Give me the option for =foramt=, but use =html= if it is missing == ?- ...
[wiki] SWI-Prolog -- Installation on Linux, *BSD (Unix)You may want to ensure that environment variable SWI_HOME_DIR is unset before co ...
Sec. 6.2You **cannot** load two files defining the same module: =file1.pl= with: == :-mo ...
Sec. 6.2_"Modules are organised in a single and flat namespace and therefore module name ...
Sec. 6.1The page of "library(prolog_xref)" seems to be here: https://www.swi-prolog.org/ ...
Sec. GThis is just the list of references that appear in the Documentation (I think, b ...
get_time/1I wonder why this isn't =T is get_time()=, possibly =T is get_time(now)= (etc), ...
begin_tests/1Note that if you add tests from the command line using [user]., you can do so on ...
end_tests/1What is the rationale behind having to repeat the test name in the block termina ...
consult/1You can actually also pass a series of files: consult([foo,roo])
consult/1Edge case: If there are files "roo", "foo", "foo.pl" and "foo.pl.pl" Then [foo] ...
Sec. A.20I would also point the user to https://www.swi-prolog.org/pldoc/man?section=ords ...
predicate_property/2This may not be directly clear from the description: Perhaps surprisingly, the t ...
Sec. 6.3Some example for loading a library: http://bit.ly/2wCxa2G_prolog
Sec. 2.12An example for "iso": f(A,B):-format("~w and then ~w\n",[A,B]). ?- f(,,a). , and then a true. ?- set_prolog_flag(iso,true). true. ?- f(,,a). ERROR: Syntax error: Operand expected, unquoted comma or bar found
check/0The checker/2 link is dead.
Sec. 6.2The notation for referencing a specific predicate of a specific module is: =modu ...
[wiki] Eat Your Own Dog FoodThis should really be linked from the "Documentation" intro page.
Sec. 3ISO Prolog only defines the "% ..." comments and the "/* ... */" comment block i ...
maplist/2I put up a page on github with some examples: http://bit.ly/2IrNfuG_prolog
Sec. 4.27.2.5A little program to exercise the "mod,div" and "rem,//" function pairs on github ...
string_concat/3Prolog just needs a syntax extension so that you can write: Name = "John", Cand ...
float/1"When used around the 2nd argument of is/2, the result will be returned as a flo ...
Sec. A.29This needs more explanation on the attached "database file". Is it a text file w ...
Sec. 4.14Please provide the link to library(persistency) in the second paragraph of "Usin ...
pengine_event_loop/2I think the use of "Closure" here is a bit misleading.
Sec. 1.1The link = http://www.swi-prolog.org/pldoc/doc/home/vnc/prolog/lib/swipl/library ...
catch/3Example, catching format/2 complaining about a lack of arguments: == catch( form ...
float/1What is a "float"?
Sec. 2.16.1.3This section applies to Strings, too ?- format(">\c | hello<"). >hello< true.
writef/2As noted on the page of format/2, the escape sequences one uses in practice are ...
format/2I'm trying to write an overview of printing in SWI Prolog here: http://bit.ly/2P ...
atom_string/2?- S="s\u2200", string(S), atom_string(A,S), atom(A). S = "s∀", A = 's∀'. ?- S=" ...
read/1This corresponds to "serialization/deserialization" in Java and other languages. You CAN but shouldn't use this for reading input typed in by the user. Example: ?- with_output_to(string(Buf),write_term(a(b,c,[1,2,3],var(ZZ)),[])), read_term_from_atom(Buf, T, []). Buf = "a(b,c,[1,2,3],var(_7256))", T = a(b, c, [1, 2, 3], var(_7848)). Use readutil for user querying: https://www.swi-prolog.org/pldoc/man?section=readutil Example: format("Answer me!\n"), read_line_to_string(user_input,S1), string_lower(S1,S2), (member(S2,["yes","1","ok","y","ja","oui"]) -> format("OK!") ; (format("NOK"), fail)). Answer me! |: YES OK!
Sec. A.1The "foreach" example is confusing because "dif/2" freezes until a decision can ...
maplist/3I put up a page on github with some examples: http://bit.ly/2In2NQj_prolog
Sec. 4.7Note that "==" and "\==" are really tests about the current state of the computa ...
Sec. 2.12I tried to write up some info on "double quotes".
Sec. 2.1"Getting started quickly" should point the user to a description/tutorial/howto ...
Sec. 2.16.1.9See also: https://eu.swi-prolog.org/pldoc/man?section=widechars
Sec. 2.12For "double_quotes": "This flag determines how double quoted strings are read by Prolog and is ---like character_escapes and back_quotes--- maintained for each module." Better: "...scoped to each module, which means that the interpretation of the source code of the module is read according to the value of that flag." (although, thinking a bit about this, when you call foo("xyz") of a predicate from a module that has the "double_quotes" flag set to "chars", will that predicate be called with a list of characters instead of a String?
Sec. 2.16.1The title of this section is "ISO Syntax Support" but should probably be "Extens ...
Sec. 2.16.1.5This is not ISO Prolog, but quite useful. Compare with Java where this trick is ...
findall/3findall/3 does not deal well with free variables.
Sec. 2.12"answer_write_options" is somehow lost in between toplevel_print_factorized and ...
Sec. 5.2.1Regarding the traditional "string": Wikipedia says at https://en.wikipedia.org/w ...
Sec. 4.1Searching for "mode flag" or "mode indicator" does not bring up this page in the search results, but should.
call/1The text should probably be changed from Note that clauses may have variables as subclauses, which is identical to call/1. to Note that clauses may have variables as goals.
[wiki] Program Development ToolsThere is nothing for IntelliJ JetBrains plugin repository: https://plugins.jetbr ...
[wiki] Program Development ToolsCurrently trying "ProDT"... Trying with Eclipse Oxygen (Eclipse 4.7, 2017-12) on Linux Fedora with JDK 1.8.0 The original site is http://prodevtools.sourceforge.net/ - the instructions on that site are a bit stale.
[wiki] Program Development ToolsThe link to "Prolog Development Tool - PDT" and the link to "Prolog Development ...
[wiki] SWI-Prolog future directionsIt might be helpful to indicate when this entry was written.
[wiki] Fix incomplete installation due to missing dependenciesDead link in the line "Redo the build.
[wiki] Wiki page at "build/issues/xpce.txt"Compiling on Fedora: At first sight, the error log seems to indicate that there ...
Sec. A.48Finally, there is the package http://eu.swi-prolog.org/pack/file_details/lambda/ ...
[wiki] XPCE: the SWI-Prolog native GUI librarySadly, the link The design of the XPCE/Prolog interface (Publication in Workshop on Logic Programming Environments, 2002) http://hcs.science.uva.nl/projects/SWI-Prolog/articles/wlpe-02.pdf is dead. However, there is https://arxiv.org/abs/cs/0207053 - "An Architecture for Making Object-Oriented Systems Available from Prolog"
Sec. A.48Please add the live link to "maplist:" http://eu.swi-prolog.org/pldoc/doc_for?ob ...
bagof/3At http://eu.swi-prolog.org/pldoc/man?section=yall the text says that the Var^Go ...
^/2Outside of arithmetic contexts, the ^/2 operator is used to mark variables as "n ...
==/2Confusingly, the explanations uses two adjectives: "equivalent" and "identical".
?=/2I think the text "Succeeds if the syntactic equality of Term1 and Term2..." shou ...
[wiki] Wiki page at "FAQ/reconsult.txt"The link to "Initialising and Managing.." has to be changed to http://www.swi-pr ...
cyclic_term/1What is the cost of detecting that a term is cyclic (a rational tree).
memberchk/2This predicate does not backtrack: ?- findall(X, memberchk(X, [one,two,three]), ...
Sec. 5See also http://eu.swi-prolog.org/pldoc/man?section=preddesc from the reference ...
Sec. 4.1See also the description in the package of the Prolog documentation generator: h ...
Sec. A.4.3Actually missing a way to get the number of elements in the association list...
Reference manual### Intro #### Gentle introduction http://www.learnprolognow.org/ by Patrick Bla ...
Genius! The index is messed up though
assertion/1===The links here don't work. They should go to http://eu.swi-prolog.org/pldoc/d ...
call/2In this context, the following, though rather old, is highly readable: "Higher-o ...
is_of_type/2This is _probably_ an alias for must_be/2 ? No, wait it does not throw as does m ...
file_search_path/2Thanks @Jan.
[wiki] Representation and printing of floating point numbersAnd here is the [reference for floating-point notation](http://www.dcc.fc.up.pt/ ...
[wiki] Representation and printing of floating point numbersHere is a another link of interest that predigests the "What Every Computer Scie ...
file_search_path/2The definition should be "file_search_path(?Alias, ?Path)" as the following work ...