Commit Graph

70 Commits

Author SHA1 Message Date
Markus Triska
79cb4cd6a5 ADDED: First version of call_nth/2.
A thread-safe implementation is possible for example with
'$nb_setarg'/3 (see #390).
2020-08-24 19:29:08 +02:00
Mark Thom
d3ab4b5def flatten passage of cut point B in (,)/2, (->)/2 and (;)/2 (#685, #683) 2020-08-23 22:49:10 -03:00
Markus Triska
cc77ef680d dif/2: Omit entailed residual goals, if the arguments are not unifiable.
This addresses #135.
2020-08-22 17:50:15 +02:00
Markus Triska
e75ebd9b6e dif/2: Succeed unconditionally if the arguments are not unifiable.
This addresses one part of #135.
2020-08-22 17:50:15 +02:00
notoria
0724c044d6 Use nonterminal fd_put//3 in mod from clpz 2020-08-15 17:56:07 +02:00
notoria
bed4afe74f Simplified the code 2020-08-15 17:39:34 +02:00
notoria
d4263cc8b9 Using queue_goal//1 to correctly bind variables 2020-08-15 17:06:12 +02:00
notoria
b4b11465a1 Fixed variable bindings in mod from clpz 2020-08-15 13:37:33 +02:00
notoria
daaebc59cb Made mod stronger and addressed #675 2020-08-15 12:53:28 +02:00
Mark Thom
79a74038ac Merge pull request #674 from notoria/clpz_mod
Improved mod in clpz
2020-08-14 00:21:19 -03:00
notoria
314baabf1d More improvement on mod from CLP(Z) 2020-08-13 21:36:36 +02:00
notoria
a24fbb8f61 Improved mod in CLP(Z)
This is still a work in progress.
2020-08-13 10:33:36 +02:00
Markus Triska
e185b626bd FIXED: CLP(B): Delay BDD restriction until after the instantiation.
This is necessary to actually take the new value into account.

Example:

    ?- sat(A*B>=C*D), A=1,B=0,C=1,D=1.
    false.

This addresses #670.
2020-08-12 19:51:25 +02:00
Markus Triska
ad8e2ad4f6 omit internal attributes in residual goals when using taut/2
Examples:

    ?- taut(X=:=X,1).
       clpb:sat(X=:=X)
    ;  false.

    ?- taut(X=\=X,0).
       clpb:sat(X=:=X)
    ;  false.
2020-08-11 20:49:10 +02:00
Mark Thom
4b610b6293 Merge pull request #656 from notoria/try_from_number
Fixed some conversion issues
2020-08-08 12:24:29 -03:00
Markus Triska
c55cc3c472 ensure proper lengths of key and initialization vector
This avoids crashes when using unsuitable lengths.
2020-08-06 23:27:49 +02:00
Markus Triska
674483a4c6 remove entailed constraint 2020-08-06 23:17:08 +02:00
notoria
3143468751 Fixed some conversion issues 2020-08-06 11:39:55 +02:00
Markus Triska
2d3f1e51ec shorten, and increase readability 2020-08-05 21:49:46 +02:00
Markus Triska
1c23336cff use "octet" as a string literal, reducing the number of arguments 2020-08-05 20:21:46 +02:00
Markus Triska
a622ffddfe ADDED: library(crypto): Support for additional authenticated data (AAD).
Additional authenticated data can now be specified with the new
aad(Chars) option for encryption and decryption. It is authenticated,
but not encrypted.
2020-08-05 20:09:07 +02:00
Mark Thom
4f15802fbc reconcile '[]' and [] (#644), solve remaining conformity issues (#648), move (-->) from dcgs.pl to builtins.pl (#649) 2020-08-02 23:35:53 -06:00
Markus Triska
32c612b747 ADDED: library(crypto): ECDH key exchange over Curve25519 (X25519) 2020-07-29 23:51:11 +02:00
Markus Triska
dcc4b91b35 ENHANCED: flush output for impure I/O (format/[2,3], portray_clause/1 etc.)
Without this, we do not get a (timely) prompt in cases like:

    ?- format("press a key: ", []), get_single_char(C).

whereas for example write/1 already works in such cases:

    ?- write('press a key: '), get_single_char(C).
    press a key:
2020-07-25 09:49:02 +02:00
Markus Triska
4a90f13dee better error handling for options 2020-07-23 00:27:31 +02:00
Markus Triska
61dddcee3f use newly available chars_base64/3 2020-07-22 20:35:48 +02:00
Markus Triska
4c510001ce ADDED: chars_base64/3 for efficient bidirectional Base64 conversion. 2020-07-22 20:35:48 +02:00
Markus Triska
2768beec4c ADDED: path_segments/2 for portable reasoning about path components.
The platform-specific directory separator is taken into account.
The clean representation of segments as a list simplifies reasoning.
2020-07-19 12:32:01 +02:00
Mark Thom
bd0aa16322 Merge pull request #633 from triska/file_time
ADDED: file_creation_time/2 and file_access_time/2.
2020-07-18 12:40:53 -03:00
Mark Thom
a1746a5bf1 Merge pull request #631 from cduret/lib_csv
add write_csv & change skip_header to with_header option
2020-07-18 12:40:28 -03:00
Markus Triska
17dd9239b6 ADDED: file_creation_time/2 and file_access_time/2.
The code can be simplified once if- and while-let-chains are available:

    https://github.com/rust-lang/rust/issues/53667
2020-07-17 18:48:39 +02:00
Cyrille Duret
920644afaf set domain_error exception & use format/3 with setup_call_cleanup/3 for stream writing 2020-07-17 01:21:40 +02:00
Markus Triska
8668aee7fd ENHANCED: Reorder fields in time stamps so that (@<)/2 is meaningful. 2020-07-16 23:40:03 +02:00
Markus Triska
4f386b3e5e ADDED: file_modification_time/2, obtaining a time stamp.
This addresses a remaining aspect of #511.
2020-07-16 23:40:03 +02:00
Markus Triska
0f4667d942 ADDED: path_canonical/2, obtaining the canonical absolute path.
This addresses a remaining aspect of #511.
2020-07-15 20:43:34 +02:00
Cyrille Duret
5705c42820 set throw() to follow ISO recommendations 2020-07-15 18:26:57 +02:00
794404
f5f0d00a75 add write_csv & change skip_header to with_header option 2020-07-15 13:02:30 +02:00
Markus Triska
94e9e17c79 ADDED: working_directory/2, addressing a remaining aspect of #511 2020-07-14 23:05:29 +02:00
Markus Triska
5134e64cae ADDED: delete_file/1, addressing a remaining aspect of #511 2020-07-14 22:21:46 +02:00
Markus Triska
88a2b82f7e ENHANCED: library(crypto): Retain the compact representation of strings.
This avoids the costly (in terms of space requirements!) conversion of
compact lists of characters to lists of integers, making hashing, HKDF,
encryption, decryption, signing and signature verification an order of
magnitude more efficient (primarily in terms of space, also in time).

This makes library(crypto) suitable to process also very large files.
2020-07-12 11:54:37 +02:00
Markus Triska
0fa8feb475 use newly available character type in must_be/2 2020-07-11 21:00:25 +02:00
Markus Triska
eb872f8fca ADDED: library(os), reasoning about environment variables.
Together with library(files), this addresses #511.
2020-07-11 21:00:25 +02:00
notoria
bf13700a95 Enhanced the implementation
The restriction has been removed by using read_library_path from
cfd15f4e02.
2020-07-01 13:14:12 +02:00
notoria
83268f5ff6 Allowing paths in use_module(library(..)) (#604)
In a module, the path is restricted in being an atom.
2020-07-01 10:22:17 +02:00
Mark Thom
8325bb11e2 Merge pull request #606 from triska/files
ADDED: library(files), for reasoning about files and directories.
2020-06-30 13:34:39 -03:00
Cyrille Duret
e2c61485a1 add csv library 2020-06-25 21:13:29 +02:00
Markus Triska
aa9432e24f comment on indexing, addressing a comment by @pmoura in #606
If indexing is needed for lists of characters, it should be added to
the engine.
2020-06-24 22:29:34 +02:00
Markus Triska
30d1585468 ADDED: library(files), for reasoning about files and directories. 2020-06-24 22:29:34 +02:00
Markus Triska
bcd6d4e8a7 library(format) is not used in this example 2020-06-21 09:46:05 +02:00
Markus Triska
32eb896c56 ADDED: load_xml/3 to load XML files from streams, files and strings. 2020-06-21 09:45:37 +02:00