Did you know ... Search Documentation:
Title for pldoc(default)
Branch: development (switch to stable),
version to version

SWI-Prolog Changelog from version 7.5.9 to 7.5.10

[Jun 25 2017]

  • ENHANCED: Add callable/1 to the fast type tests.
  • ENHANCED: Specialized versions for delim/3,4
  • MODIFIED: More low-level implementation of reset/3. The new implementation ONLY binds the Continuation if there is no reset, avoiding ambiguity that may result from testing on Ball.
  • FIXED: CLP(FD): Overeager goal expansion. Julien Cumin. This mistake was introduced in 038d86b08bfecc0715b4548a6ec3f2d91c20b658.

    A new binding must not be dragged outside of disjunctions, since the code may look for example like this:

    i(X) :- ( X #= 3 ; X #= 4 ).

    In fact, this would previously not even compile, and instead raise:

    put_attr/3: Uninstantiated argument expected, found 3 (1-st
            argument)

    already during goal expansion.

    This commit fixes this issue, and still rewrites CLP(FD) expressions as far as possible already at compilation time.

    For example:

    n(X) :- X #= 1+3.

    This is now compiled to (note that 1+3 is evaluated to 4):

    ?- listing(n/1).
    %@ n(A) :-
    %@ ( integer(A)
    %@ -> A=:=4
    %@ ; var(A)
    %@ -> A=4
    %@ ; B=4,
    %@ clpfd:clpfd_equal(A, B)
    %@ ).

    Ideally, it should be compiled to:

    n(4).

[Jun 24 2017]

  • ENHANCED: Put a continuation in a single structure, reducing memory usage and dereferencing need.
  • ENHANCED: Represent a continuation as an array rather than a linked list.
  • ENHANCED: Use __builtin_popcountll() to compute popcount for `small' integers.
  • ENHANCED: when/2: ground trigger uses nonground/2
  • ADDED: nonground/2, compatible with hProlog and ECLiPSe

[Jun 23 2017]

  • FIXED: VM version of atom/1 accepted blobs. Paulo Moura.
  • ENHANCED: More low-level code to revive a continuation. Almost 10% improvement on tabling.
  • CLEANUP: simplify local stack overflow handling.
  • ENHANCED: reduce thread local data access.
  • ENHANCED: Reduce thread local data access
  • ENHANCED: Add common type tests to VM (number, float, atom, atomic,string,compound)
  • ENHANCED: Inline arithmetic stack operations.

[Jun 22 2017]

  • ENHANCED: Avoid creating a choice point for simple conditions in (if-then->else). Simple conditions are those that are executed by the VM itself and are known to be semidet and their execution does not change any terms, so no trailing is needed. Currently covers var/1, nonvar/1, integer/1, ==, \== and arithmetic comparison (>, <, =:=, etc.) IF optimized compilation (-O is used). Conjunctions of such simple instructions still use the optimized condition handling.

[Jun 20 2017]

  • FIXED: Ensure TTY state buffers are fully initialised
  • FIXED: Safe must_be/2. Jacco van Ossenbruggen.
  • ENHANCED: Reduce thread-local-data access.
  • ENHANCED: Reduce thread-local-data access.

[Jun 19 2017]

  • ADDED: term_singletons/2: find term singleton variables inside a term.
  • ADDED: library(prolog_xref): handle :- import(:PI).
  • HACK: if a first-var integer/1 tests is always false, emit a C_VAR to keep the variable registered as seen. In a next step we should avoid such dead code being generated in the first place.
  • CLEANUP: Generalise compiler warnings for tests that always yield true/false.
  • ADDED: I_INTEGER instruction to speedup integer/1

[Jun 18 2017]

[Jun 16 2017]

  • FIXED: cleanClauseIndexes() should be locked with addClauseToIndexes(). May cause incorrect results as well as crashes.
  • ENHANCED: Only print the thread id when printing the thread context in print_message/2.
  • FIXED: thread_get_message/3 (Windows only) using a deadline if the deadline has already passed waited approx 7 weeks because dwMilliseconds is a DWORD, which is unsigned. New code can also deal with a deadline that is more than 7 weeks ahead. Based on patch by Matt Lilley.
  • ENHANCED: Speedup finding the debug frame for a redo. Eyal Drechter.

[Jun 15 2017]

  • DOC: Mention crypto_n_random_bytes/2 in the documentation of random/1.
  • DOC: Issue#10: surprises caused by variable ordering.
  • DOC: Issue#5: format_time/3 %p may yield am/pm in some locales.
  • FIXED: Upgrade packs that are installed from github archive files.

Package archive

[Jun 15 2017]

Package chr

[Jun 24 2017]

Package clib

[Jun 18 2017]

  • FIXED: Issue#29: directory_file_path(-,+,+) returns directory with trailing '/'. Paul Singleton.

Package http

[May 21 2017]

  • FIXED: Encapsulate predicates inside debugging/1 to avoid singleton warnings when running in optimized mode.

Package pengines

[Jun 16 2017]

  • ENHANCED: SWISH Issue#62: allow redirecting I/O using e.g. with_output_to/2. Anne Ogborn.

Package pldoc

[Jun 24 2017]

  • FIXED: Issue#27: recent change disallowed font switches inside a [...] label. Markus Triska.

[Jun 22 2017]

  • FIXED: Really demand font-changing sequences to be preceded by white space or some reserved punctuation.
  • MODIFIED: Do not allow nesting of and .
  • MODIFIED: Depand a font-change sequence to end in whitespace or a sentence ending punctuation mark.

[Jun 18 2017]

  • FIXED: Avoid <img> alt to be prepended for the predicate name by inserting a space and compensate the layout. Not very nice ...

[Jun 15 2017]

  • FIXED: Formatting comments inside source code (broken after changes to the fragment classification).

Package semweb

[Jun 20 2017]

[Jun 18 2017]

[Apr 24 2017]

  • DOC: Missing instantiation indicator.

[Mar 29 2017]

  • ENHANCED: Use canonical XML writer for datatype rdf:XMLLiteral.
  • DOC: Clarify that the graph/1 term cannot be used with rdf_update/3.
  • FIXED: rdf_list(-) would not enumerate more than one RDF list.
  • ADDED: rdf_nth1/3, complementing rdf_nth0/3 This includes a test case.
  • ADDED: rdf_estimate_complexity/4 now works with rdf11 literal terms.
  • DOC: Fixed instantiation pattern in module header.

[Jan 24 2017]

  • FIXED: application/turtle -> text/turtle

[Jun 15 2017]

  • FIXED: iri_turtle_prefix/2 returned the suffix after recent patch rather than the prefix. Jacco van Ossenbruggen.

Package ssl

[Jun 25 2017]

[Jun 23 2017]

  • CLEANUP: ssl context blob handling. Code was dubious, but probably not wrong.

[Jun 20 2017]

[Jun 19 2017]

  • ADDED: library(crypto): New predicate crypto_generate_prime/3.
  • ADDED: library(crypto): Predicates for reasoning over elliptic curves. Currently, only named curves over prime fields are supported. Notable applications of these predicates include the ECDH key exchange used by typical HTTPS servers, and generation of Bitcoin keys and addresses.

    For reasoning about Bitcoin addresses with library(crypto), check out:

    https://www.metalevel.at/bitcoinolog/

    Sample use of scalar multiplication over elliptic curves:

    ?- crypto_name_curve(secp256k1, C), crypto_curve_generator(C,
       G), crypto_curve_scalar_mult(C, 5, G, P).

    Yielding:

    %@ C = <crypto_curve>(secp256k1, 0x21e8a90),
    %@ G =
       point(55066263022277343669578718895168534326250603453777594175500187360389116729240,
       32670510020758816978083085130507043184471273380659243275938904335757337482424),
    %@ P =
       point(21505829891763648114329055987619236494102133314575206970830385799158076338148,
       98003708678762621233683240503080860129026887322874138805529884920309963580118).

[Jun 18 2017]

  • ADDED: Sandbox declarations for safe library(crypto) predicates.
  • FIXED: Accessing memory after free, potentially leading to a crash. Reproducible on OSX with:
    ?- length(_, L), garbage_collect, crypto_context_new(Context,
       [algorithm(sha256)]), false.
  • ADDED: library(crypto): New predicate crypto_modular_inverse/3 [Jun

17 2017]

  • ADDED: library(crypto): New predicate crypto_modular_inverse/3. This predicate lets you compute modular multiplicative inverses, which is an operation that is often needed in cryptographic applications.

    This can be more than an order of magnitude faster than doing it in Prolog.

    For example, consider the following Prolog implementation, using the extended Euclidean algorithm:

    multiplicative_inverse_modulo_p(X, P, Y) :- eea(X, P, _, _, Y),
            R #= X*Y mod P, zcompare(C, 1, R), must_be_one(C, X, P, Y).
    
    must_be_one(=, _, _, _).
    must_be_one(>, X, P, Y) :-
            throw(multiplicative_inverse_modulo_p(X,P,Y)).
    must_be_one(<, X, P, Y) :-
            throw(multiplicative_inverse_modulo_p(X,P,Y)).
    
    eea(I, J, G, S, T) :- State0 = state(1,0,0,1), eea_loop(I, J,
            State0, G, S, T).
    
    eea_loop(I, J, State0, G, S, T) :- zcompare(C, 0, J), eea_(C, I,
            J, State0, G, S, T).
    
    eea_(=, I, _, state(_,_,U,V), I, U, V).
    eea_(<, I0, J0, state(S0,T0,U0,V0), I, U, V) :- Q #= I0 // J0,
            R #= I0 mod J0, S1 #= U0 - (Q*S0), T1 #= V0 - (Q*T0),
            eea_loop(J0, R, state(S1,T1,S0,T0), I, U, V).

    We now have, using the Prolog implementation:

    ?- time((between(1,1000,_),
       multiplicative_inverse_modulo_p(65341020041517633956166170261014086368942546761318486551877808671514674964848,
       115792089237316195423570985008687907853269984665640564039457584007908834671663,
       I),false)).
    %@ % 14,921,002 inferences, 1.133 CPU in 1.133 seconds (100% CPU,
       13173595 Lips)
    %@ false.

    And using the new crypto_modular_inverse/3:

    ?- time((between(1,1000,_),
       crypto_modular_inverse(65341020041517633956166170261014086368942546761318486551877808671514674964848,
       115792089237316195423570985008687907853269984665640564039457584007908834671663,
       I),false)).
    %@ % 326,205 inferences, 0.079 CPU in 0.079 seconds (100% CPU,
       4116844 Lips)
    %@ false.

[Jun 16 2017]

FIXED:ssl_peer_certificate/2,ssl_peer_certificate_chain/2:avoid
ambiguous stream pair warning. Sam Neeves.

[Jun 15 2017]

  • ADDED: library(crypto): New predicate crypto_n_random_bytes/2. This predicate lets you generate sequences of bytes that are deemed sufficiently unpredictable for cryptographic purposes including creation of keys. This functionality is needed in almost all cryptographic applications.

Package xpce

[Jun 25 2017]

  • FIXED: prolog_predicate<-convert (reported as always false).