Mark Thom
238343f389
add max_steps to PStr offset ( #2381 )
2024-04-09 18:40:08 -06:00
Mark Thom
77e90ca725
correct offsets around max_steps in skip_max_list ( #2381 )
2024-04-09 15:58:23 -06:00
Mark Thom
aab6567750
treat Utf8Error::valid_up_to as an offset form self.pos, which it is ( #2374 )
2024-04-03 15:29:29 -06:00
Mark Thom
ea9e24f214
Merge pull request #2367 from triska/dcg_meta_predicates
...
ADDED: meta_predicate/1 declarations for (',')//2 and (;)//2
2024-03-26 15:21:37 -06:00
Mark
40fc4f9392
correct offset retrieval in add_pstr_chars_and_step ( #2370 )
2024-03-25 12:47:45 -06:00
Markus Triska
795a7c690d
ADDED: meta_predicate/1 declarations for (',')//2 and (;)//2
...
This addresses #2366 .
2024-03-21 22:14:40 +01:00
Markus Triska
767d90d5e7
ENHANCED: further partial evaluation for the common control sequence ~d
2024-03-20 21:10:14 +01:00
Markus Triska
bc04790fd5
extend partial evaluation to computing lengths when statically possible
2024-03-20 21:10:14 +01:00
Markus Triska
58f7c94e74
goal expansion for format/2 and format/3
...
In this way, we benefit from partial evaluation of format strings.
2024-03-20 21:10:14 +01:00
Markus Triska
8af29c200d
strengthen type check
2024-03-20 21:10:10 +01:00
Markus Triska
1db6bff890
ENHANCED: Partial evaluation of format_//2.
...
This moves analysis of the format string to compilation time when
possible, so that parsing it at run time is no longer necessary.
2024-03-20 20:59:43 +01:00
Mark
0292cb73d3
expand_call_goals/3 should expand meta-predicate subgoals ( #2361 )
2024-03-19 17:12:26 -06:00
Markus Triska
ee60c463c8
indicate deprecated functionality
2024-03-16 21:23:12 +01:00
Markus Triska
e1a6b5eb03
DOC: Un-document the ability to use bytes with encoding(octet).
...
This usage is now considered deprecated. Use strings instead for
greater efficiency and type consistency in your applications.
This functionality is a candidate for removal in a future commit.
2024-03-16 20:37:06 +01:00
Markus Triska
4ebdd97ad3
DOC: Improve descriptions to make clear what encoding(octet) means.
...
In particular, octet does *not* mean that the input is a list of
Prolog bytes in the sense of "integers between 0..255", but that the
character codes are used directly as byte values.
2024-03-16 20:36:22 +01:00
Mark
6f7f979c05
don't skip to end of pstr in CommaSeparatedCharList token variant ( #2356 )
2024-03-12 18:37:03 -06:00
Mark
df41eb1870
recompile original terms from compile_clause for term to term expansions ( #2236 )
2024-03-01 18:57:01 -07:00
Markus Triska
6b8a679a51
explain potential side-channel attacks due to compact string representation
...
This legitimate concern was already raised by @infogulch in:
https://github.com/mthom/scryer-prolog/issues/1309#issuecomment-1080028854
Thank you a lot!
2024-03-01 22:03:57 +01:00
Markus Triska
ec251b254c
ENHANCED: Safe HMAC verification, using constant time string comparison.
...
Without this provision, the expected HMAC can be gathered from timing
differences depending on the position where the strings first diverge,
and hence an attacker can forge an authenticated message by supplying
the gathered HMAC.
Test case, using exp(E) to succeed exactly 2^E times:
exp(E) :-
N is 2^E,
between(1, N, _).
yielding:
?- Options = [algorithm(sha512),hmac([1,2,3])],
Ds = "test",
crypto_data_hash(Ds, H, Options),
phrase((seq(As),seq(Bs)), H),
same_length(Bs, Cs),
maplist(=(a), Cs),
append(As, Cs, H1),
time((exp(10),crypto_data_hash(Ds, H1, Options),false)).
%@ % CPU time: 0.710s, 7_942_187 inferences
%@ % CPU time: 0.713s, 7_942_187 inferences
%@ % CPU time: 0.712s, 7_942_187 inferences
%@ % CPU time: 0.711s, 7_942_187 inferences
%@ % CPU time: 0.710s, 7_942_187 inferences
%@ % CPU time: 0.711s, 7_942_187 inferences
%@ % CPU time: 0.710s, 7_942_187 inferences
?- length(_, L), time((exp(10),crypto_data_hash("test", "3caebd1a0a2647930319a660b7d3642eb380fbd43202f9f6d08aabaa9ba50c39522a12ead10f0423f0af613cbc6fea74ad682ee11f563cc2e735722004fda2ba", [algorithm(sha512),hmac([0,L])]),false)).
%@ % CPU time: 0.733s, 7_878_699 inferences
%@ % CPU time: 0.734s, 7_878_699 inferences
%@ % CPU time: 0.732s, 7_878_699 inferences
%@ % CPU time: 0.733s, 7_878_699 inferences
%@ % CPU time: 0.733s, 7_878_699 inferences
%@ % CPU time: 0.733s, 7_878_699 inferences
%@ % CPU time: 0.733s, 7_878_699 inferences
%@ % CPU time: 0.733s, 7_878_699 inferences
%@ % CPU time: 0.733s, 7_878_699 inferences
%@ % CPU time: 0.733s, 7_878_699 inferences
%@ % CPU time: 0.733s, 7_878_699 inferences
%@ % CPU time: 0.515s, 5_525_404 inferences
%@ error('$interrupt_thrown',repl/0).
2024-03-01 18:59:48 +01:00
Mark
42f4827854
make indexer downcast Integers to Fixnums when possible, be slightly more judicious about allocating Integers instead of Fixnums ( #2340 )
2024-02-29 16:15:28 -07:00
Mark
f2d3779fa9
add #2341 test to lib_machine.rs
2024-02-29 15:12:58 -07:00
Mark
b70f121e46
use scryer-modular-bitfield on github, version bump
CI / build-test (ubuntu-22.04, true, stable, x86_64-unknown-linux-gnu) (push) Has been cancelled
CI / build-test (windows-latest, true, stable, x86_64-pc-windows-msvc) (push) Has been cancelled
CI / logtalk-test (push) Has been cancelled
CI / style (push) Has been cancelled
CI / build-test (--no-default-features, ubuntu-22.04, true, nightly, wasm32-unknown-unknown, --no-run --no-default-features) (push) Has been cancelled
CI / build-test (macos-11, true, stable, x86_64-apple-darwin) (push) Has been cancelled
CI / build-test (ubuntu-20.04, true, stable, x86_64-unknown-linux-gnu) (push) Has been cancelled
CI / build-test (ubuntu-22.04, 1.70, x86_64-unknown-linux-gnu) (push) Has been cancelled
CI / build-test (ubuntu-22.04, beta, x86_64-unknown-linux-gnu) (push) Has been cancelled
CI / build-test (ubuntu-22.04, nightly, x86_64-unknown-linux-gnu) (push) Has been cancelled
CI / build-test (ubuntu-22.04, true, stable, i686-unknown-linux-gnu) (push) Has been cancelled
CI / report (push) Has been cancelled
CI / release (push) Has been cancelled
Docker Publish / build (push) Has been cancelled
2024-02-29 10:08:14 -07:00
Mark
641765858f
fix misuse of TypeError trait while fixing #2345
2024-02-28 20:47:36 -07:00
Mark
ba362e2fe0
issue callable type error from dynamic_module_resolution if module is not an atom ( #2345 )
2024-02-28 20:35:38 -07:00
Mark Thom
84d5ce0d1e
Merge pull request #2309 from coasys/library-use-case
...
Iron-out edge cases for library use-case, adding extensive real-world test assertions
2024-02-28 14:34:54 -07:00
Markus Triska
1dd0c599c6
DOC: Add DocLog comments for reasoning about elliptic curves.
2024-02-24 20:43:57 +01:00
Markus Triska
27852eafd7
ADDED: Hash-based message authentication code (HMAC), using hmac(Key).
2024-02-22 20:53:27 +01:00
Bennet Bleßmann
e5ad70c093
fix compilation of wasm32 test and skip to run wasm32 tests
2024-02-16 23:18:21 +01:00
Markus Triska
8f2e9c6b94
FIXED: char_type/2 for unbound first argument.
...
Surrogate pairs form a gap in valid character codes, see:
https://github.com/mthom/scryer-prolog/issues/2326#issuecomment-1937864665
Many thanks to @Skgland for the pointer, and to @librarianmage for the
question that spawned this!
This addresses #2326 .
2024-02-11 22:19:19 +01:00
Nicolas Luck
1d2961e047
Merge branch 'master' into library-use-case
2024-02-09 12:41:01 +01:00
Mark Thom
b43f0979d9
Update src/machine/parsed_results.rs
...
Co-authored-by: Bennet Bleßmann <bennet.blessmann+github@googlemail.com >
2024-02-08 19:10:29 -07:00
Mark
539a1aee2c
fix tests broken by singleton
2024-02-07 21:46:32 -07:00
Markus Triska
53b7d9eec9
ENHANCED: Bidirectional char_type/2, addressing #2321 .
...
Suggested by @librarianmage, many thanks!
2024-02-07 20:57:28 +01:00
Markus Triska
aa98a7e7d6
ADDED: clpz_t/2, generalizing support for use with library(reif)
...
This was suggested and contributed by @librarianmage in:
https://github.com/mthom/scryer-prolog/issues/2225#issuecomment-1890801923
Many thanks!
If anyone can find a better predicate name, please let us know any time!
2024-02-06 19:05:29 +01:00
Mark
614850ab1d
fmt
2024-02-05 18:34:57 -07:00
Adrián Arroyo Calle
ec4a8745e7
Add all_mdoules test and fix library(csv)
2024-02-04 21:34:01 +01:00
Mark
673329ddb7
fix reverted tests, ensure files are loaded before goals ( #2315 )
2024-02-03 11:49:26 -07:00
Mark
de6c460a51
treat consultation of command line modules as regular goals ( #2314 )
2024-02-02 15:35:00 -07:00
Mark
75a94fd0b3
fmt
2024-02-02 11:49:02 -07:00
Mark
7573c64087
load .scryerrc before files and goals ( #1775 , #2313 )
2024-02-02 10:54:28 -07:00
Mark
cbb422f69d
record stub choice point as block
2024-02-01 09:26:58 -07:00
Nicolas Luck
06f198bc57
Test show problem with nonexistent predicate
2024-02-01 14:14:50 +01:00
Nicolas Luck
6586657658
fmt
2024-02-01 13:53:21 +01:00
Nicolas Luck
a0e598b97e
clippy
2024-02-01 13:51:37 +01:00
Nicolas Luck
8a6ea29c45
Fix all orderings in integration assertions
2024-02-01 13:43:51 +01:00
Nicolas Luck
e1b0ba466b
Remove test with long program literals, not needed
2024-02-01 13:00:49 +01:00
Nicolas Luck
f35d6287ab
More ordering adjustments
2024-02-01 12:59:10 +01:00
Mark
53028a9c2a
fix style errors
2024-01-31 17:32:32 -07:00
Mark
33fc2ed10c
index stub choice point correctly
2024-01-31 17:30:13 -07:00
Nicolas Luck
bc02fb3754
Extract failing assertion as single test case
2024-01-31 15:03:28 +01:00