]>
Repositorios git - scryer-prolog.git/log
Aman Verma [Fri, 28 Mar 2025 19:05:45 +0000 (14:05 -0500)]
Update lexical.
The previous versions of lexical and lexical-core we were using were
subject to the following security advisories:
- https://rustsec.org/advisories/RUSTSEC-2023-0086
- https://rustsec.org/advisories/RUSTSEC-2023-0055
Aman Verma [Fri, 28 Mar 2025 02:11:21 +0000 (21:11 -0500)]
Remove unused deps: regex, assert_cmd, predicates-core.
regex was introduced in commit
9e85be11fecd00b3d0be8b828eb0dd5cfb57e60a
but isn't used anymore.
assert_cmd and predicates-core were introduced in
e1c681fffead4d63caa0d0b902196224b651f465 for tests but aren't used
anymore.
Dependency count in Cargo.lock drops from 428 to 421.
Aman Verma [Fri, 28 Mar 2025 02:02:14 +0000 (21:02 -0500)]
Update ordered-float to 5.0.0.
Aman Verma [Fri, 28 Mar 2025 01:35:01 +0000 (20:35 -0500)]
Update scraper and ego-tree.
This gets rid of 4 dependencies, as verified by the output of
yj -tj < Cargo.lock | jq -c '.package | length'
Previously it was 432, now it is 428.
Aman Verma [Fri, 28 Mar 2025 01:20:46 +0000 (20:20 -0500)]
Bump dependencies except for arcu v0.1.1 and half 2.4.1.
arcu is not updated for reasons laid out in issue #2749.
half is not updated because going to 2.5.0 would require an MSRV bump 1.81.
Previous versions of idna, openssl, and ring were subject to the
following security advisories:
- https://rustsec.org/advisories/RUSTSEC-2025-0009
- https://rustsec.org/advisories/RUSTSEC-2025-0004
- https://rustsec.org/advisories/RUSTSEC-2024-0421
Mark Thom [Sun, 9 Mar 2025 20:21:25 +0000 (13:21 -0700)]
Merge pull request #2847 from triska/call_with_error_context
ADDED: type pair
Markus Triska [Sat, 8 Mar 2025 13:42:48 +0000 (14:42 +0100)]
ADDED: type pair
Mark Thom [Sat, 8 Mar 2025 08:39:03 +0000 (00:39 -0800)]
Merge pull request #2846 from triska/call_with_error_context
ADDED: call_with_error_context/2
Markus Triska [Sat, 8 Mar 2025 08:12:17 +0000 (09:12 +0100)]
ADDED: call_with_error_context/2
See https://github.com/mthom/scryer-prolog/discussions/2839 for more information.
Mark Thom [Sat, 1 Mar 2025 21:40:09 +0000 (13:40 -0800)]
Merge pull request #2837 from notoria/next
Fix conversion from float to rational
Mark Thom [Sat, 1 Mar 2025 09:45:55 +0000 (01:45 -0800)]
Merge pull request #2836 from triska/format_floats
Correct handling of floats in format/2 and portray_clause/1
Markus Triska [Fri, 28 Feb 2025 07:22:54 +0000 (08:22 +0100)]
FIXED: portray_clause/1 for numbers
Markus Triska [Fri, 28 Feb 2025 07:14:34 +0000 (08:14 +0100)]
correct handling of floats with N digits (~f and ~Nf)
This addresses #2771. Many thanks to @tmerr for reporting the issue!
The code was posted by @UWN in:
https://github.com/mthom/scryer-prolog/discussions/2805
Many thanks! With additional inputs by @adri326 and @notoria, who also
posted interesting approaches which could help to increase precision
in cases that are currently not ideally handled. Thank you all!
Please see the issue and discussion for more information.
notoria [Fri, 28 Feb 2025 07:00:00 +0000 (08:00 +0100)]
Fix conversion from float to rational
Mark Thom [Fri, 28 Feb 2025 05:38:58 +0000 (21:38 -0800)]
Merge pull request #2835 from thierrymarianne/fix-http_open-hanging-on-top-of-main-branch
Prevent http_open/3 from hanging
Mark Thom [Fri, 28 Feb 2025 05:26:40 +0000 (21:26 -0800)]
Merge pull request #2792 from triska/must_be_chars
FIXED: instantiation and type check for string arguments
Mark Thom [Fri, 28 Feb 2025 05:26:20 +0000 (21:26 -0800)]
Merge pull request #2825 from bakaq/wasm_rework
Wasm rework
revue_2_presse [Tue, 25 Feb 2025 19:19:14 +0000 (20:19 +0100)]
Replace futures::executor::block_on with tokio::block_in_place
bakaq [Thu, 20 Feb 2025 03:48:51 +0000 (00:48 -0300)]
Documentation
bakaq [Thu, 20 Feb 2025 03:33:11 +0000 (00:33 -0300)]
Consult modules
bakaq [Thu, 20 Feb 2025 03:12:30 +0000 (00:12 -0300)]
Send pure objects instead of classes
bakaq [Thu, 20 Feb 2025 01:50:41 +0000 (22:50 -0300)]
MachineBuilder constructor
bakaq [Fri, 31 Jan 2025 12:24:39 +0000 (09:24 -0300)]
Rework Wasm interface
bakaq [Fri, 31 Jan 2025 12:24:39 +0000 (09:24 -0300)]
Make Wasm compilable
Mark Thom [Mon, 17 Feb 2025 06:47:49 +0000 (22:47 -0800)]
Merge pull request #2817 from adri326/fix-2815-run_module_predicate-backtrack
Fix backtracking on the topmost predicate triggering UB in run_module_predicate
Mark Thom [Mon, 17 Feb 2025 06:47:34 +0000 (22:47 -0800)]
Merge pull request #2799 from bakaq/callback_streams
Callback streams for use as library
bakaq [Wed, 5 Feb 2025 15:07:28 +0000 (12:07 -0300)]
Add builder style configuration of user input, output and error
bakaq [Fri, 31 Jan 2025 16:14:45 +0000 (13:14 -0300)]
More stream tests
bakaq [Fri, 31 Jan 2025 10:45:13 +0000 (07:45 -0300)]
Disallow null streams in output
bakaq [Fri, 31 Jan 2025 10:23:39 +0000 (07:23 -0300)]
Make input and output stream configuration public
bakaq [Thu, 30 Jan 2025 12:20:28 +0000 (09:20 -0300)]
Configure streams separately
bakaq [Thu, 30 Jan 2025 09:14:38 +0000 (06:14 -0300)]
Refactor UserInput to use channels
bakaq [Wed, 29 Jan 2025 20:09:48 +0000 (17:09 -0300)]
Test for callback streams
bakaq [Wed, 29 Jan 2025 14:35:04 +0000 (11:35 -0300)]
Add input stream channel
bakaq [Tue, 28 Jan 2025 20:58:40 +0000 (17:58 -0300)]
Add callback streams
Mark Thom [Thu, 13 Feb 2025 07:25:21 +0000 (23:25 -0800)]
Merge pull request #2791 from Skgland/patch-1
Expand the build/install section of the readme
Mark Thom [Thu, 13 Feb 2025 07:23:44 +0000 (23:23 -0800)]
Merge pull request #2804 from dnmfarrell/line-count-off-by-one
Line numbers start at 1
Mark Thom [Thu, 13 Feb 2025 07:23:11 +0000 (23:23 -0800)]
Merge pull request #2818 from adri326/stream-cleanup
Fix various issues around close/1 and stream realiasing
Mark Thom [Thu, 13 Feb 2025 07:19:34 +0000 (23:19 -0800)]
Merge pull request #2812 from bakaq/attr_vars_arity_fix
Fix bug in finding arity for verify attributes
Emilie Burgun [Thu, 6 Feb 2025 22:47:22 +0000 (23:47 +0100)]
Test corner cases of stream aliasing
Emilie Burgun [Thu, 6 Feb 2025 21:55:40 +0000 (22:55 +0100)]
Fix set_output/1 and set_input/1 not updating the alias
Before this change, the following set of queries would behave incorrectly:
```
?- open("/tmp/out.log", write, S), set_output(S).
prints(""), write("/tmp/out.log", "S = stream(...)").
?- write(user_output, hello).
prints("hello"), unexpected.
prints(""), write("/tmp/out.log", "hello"). % Expected, but not found.
```
Now, `set_output/1` and `set_input/1` properly bind the `user_output` and
`user_input` aliases, making the queries above behave as expected.
Emilie Burgun [Mon, 3 Feb 2025 13:58:04 +0000 (14:58 +0100)]
Fix stream realiasing possibly shadowing other streams.
Emilie Burgun [Mon, 3 Feb 2025 13:26:33 +0000 (14:26 +0100)]
Fix realiased streams causing close/1 to leave a dangling stream
Emilie Burgun [Mon, 3 Feb 2025 13:00:37 +0000 (14:00 +0100)]
Encapsulate accesses to IndexStore::streams and ::stream_aliases
These two fields are able to hold `Stream` instances, which predicates like `close/1`
expect to be managed properly for their correctness. To ensure that this is the case,
I have removed direct accesses to those two fields, so that they can be properly managed
in one place.
Emilie Burgun [Thu, 6 Feb 2025 12:26:16 +0000 (13:26 +0100)]
Document run_module_predicate and handle critical failure in toplevel.pl
Emilie Burgun [Thu, 6 Feb 2025 09:37:54 +0000 (10:37 +0100)]
Disable test_run_module_predicate_throw under miri and support rustc < 1.83
Emilie Burgun [Wed, 5 Feb 2025 23:16:20 +0000 (00:16 +0100)]
Fix backtracking on the topmost predicate triggering UB in run_module_predicate
Fixes #2815, see that issue for my investigation.
This is a one-line fix that I'm quite proud of :)
If the topmost query for `run_module_predicate` needs to backtrack,
then before this commit, one of the following two things may happen:
- A dangling OrFrame is read at stack offset 0
- An AndFrame was at stack offset 0 would be read as an OrFrame
This can be seen by either calling `run_module_predicate` with a
throwing predicate (encountering the second scenario) or a failing
predicate (encountering the first scenario), or by running the following
in the REPL, which triggers a `throw/1` within the error handler, propagating
it all the way up (and encountering the second scenario):
```prolog
?- current_output(S), open(stream(S), write, S0, [type(binary)]).
```
Currently, `Stack` is not equipped with tools to detect this incorrect
behavior, so it would instead try to read an OrFrame at offset 0, which
triggers UB, since transmuting between AndFramePrelude and OrFramePrelude
isn't legal.
In practice, since `AndFramePrelude` is smaller, the later fields of
`OrFramePrelude` would read from the cells following the `AndFramePrelude`,
and would contain nonsensical data, triggering the panic that led to
my investigation in #2815 and that is fairly reliable to witness.
Surprisingly, this wouldn't happen with `run_query`, which led me to
look at how they operate differently. It turns out that `run_query`
inserts an OrFrame at offset 0, which covers both problematic scenarios.
The fix is thus to simply add a call to `Machine::allocate_stub_choice_point`
in `run_module_predicate` :)
bakaq [Wed, 5 Feb 2025 05:22:59 +0000 (02:22 -0300)]
Scan entire predicate in InstallVerifyAttr
bakaq [Sat, 1 Feb 2025 18:53:15 +0000 (15:53 -0300)]
Fix bug in finding arity for verify attributes
Emilie Burgun [Sun, 2 Feb 2025 23:07:39 +0000 (00:07 +0100)]
Fix close/1 messing up stream_aliases when user_input or user_output aren't set to Stdin and Stdout
David Farrell [Sat, 1 Feb 2025 19:02:34 +0000 (14:02 -0500)]
Line numbers start at 1
Bumps the line number for the singleton warning. When the singleton
occurs on the same line at the term starts, the line number is correct:
foo(X).
However it stills mis-reports this line number as 1 instead of 5:
foo(1) :-
true,
true,
true,
Y.
See issue #1356.
Mark Thom [Wed, 29 Jan 2025 06:24:17 +0000 (23:24 -0700)]
Merge pull request #2798 from bakaq/clippy_warnings
Fix clippy warnings
bakaq [Tue, 28 Jan 2025 19:22:50 +0000 (16:22 -0300)]
Fix clippy warnings
Bennet Bleßmann [Mon, 27 Jan 2025 19:40:12 +0000 (20:40 +0100)]
fix spelling and grammar errors found by mthom
https://github.com/mthom/scryer-prolog/pull/2791#discussion_r1930025598
Mark Thom [Mon, 27 Jan 2025 06:14:57 +0000 (23:14 -0700)]
Merge pull request #2777 from adri326/fix-2772-rnd_i-clipping
Fix invalid casts in is/2
Mark Thom [Mon, 27 Jan 2025 06:14:30 +0000 (23:14 -0700)]
Merge pull request #2738 from adri326/fix-2275-dcgs-call-module
Fix dcgs using call(M:Pred) when M was left unassigned
Mark Thom [Mon, 27 Jan 2025 06:02:23 +0000 (23:02 -0700)]
Merge pull request #2793 from Skgland/fix-ci
fix ci and update all used actions
Emilie Burgun [Wed, 15 Jan 2025 14:12:06 +0000 (15:12 +0100)]
Add integration tests for arithmetic operators
This extensively tests the behavior of is/2, both when compiled and in metacalls.
Emilie Burgun [Sun, 26 Jan 2025 22:56:52 +0000 (23:56 +0100)]
Fix integer overflow in >>/2 and <</2
Emilie Burgun [Sat, 18 Jan 2025 12:11:52 +0000 (13:11 +0100)]
Fix min/2 and max/2 returning the cast version of its arguments
It now behaves the same way as SWI-Prolog.
Emilie Burgun [Mon, 20 Jan 2025 10:10:16 +0000 (11:10 +0100)]
Fix `X is gcd(1, 2 ^ 64)` triggering a panic
The implementation for gcd/2 would cast the second argument to an isize.
Emilie Burgun [Fri, 17 Jan 2025 22:33:09 +0000 (23:33 +0100)]
Fix round() losing precision on bigints
The original issue can be reproduced with `X is round(2 ^ 54 + 1) - 2 ^ 54, X = 1.`
Emilie Burgun [Fri, 17 Jan 2025 19:11:05 +0000 (20:11 +0100)]
Fix rnd_i clipping floats that don't fit in Fixnum
Fixes #2772.
The current implementation of `rnd_i` incorrectly casts `f` (an `f64`)
into an `i64`, before casting it into an `Integer`.
This fixes that issue by using `Integer::try_from(f)` instead,
and failing if `f` is infinite or NaN.
A fixme is left for a future PR to properly handle the resulting errors
in floor/1 and friends (right now they can only be triggered through FFI).
Bennet Bleßmann [Fri, 24 Jan 2025 17:47:42 +0000 (18:47 +0100)]
fix typo
Markus Triska [Thu, 23 Jan 2025 19:18:55 +0000 (20:18 +0100)]
FIXED: instantiation and type check for string arguments
This addresses #2790.
The issue first appeared in an example reported by @ak-1 in #2788, and
was successfully analyzed by @flexoron. Many thanks!
Bennet Bleßmann [Thu, 23 Jan 2025 19:04:43 +0000 (20:04 +0100)]
Update README.md
fix ambiguity regarding the install location for the cargo install method, also include the binary name
Bennet Bleßmann [Thu, 23 Jan 2025 18:53:59 +0000 (19:53 +0100)]
fix ci and update all used actions
Bennet Bleßmann [Thu, 23 Jan 2025 18:20:19 +0000 (19:20 +0100)]
update install link
Bennet Bleßmann [Thu, 23 Jan 2025 18:18:15 +0000 (19:18 +0100)]
Update README.md
Bennet Bleßmann [Thu, 23 Jan 2025 18:11:08 +0000 (19:11 +0100)]
Update README.md
Mark Thom [Tue, 14 Jan 2025 05:15:11 +0000 (22:15 -0700)]
Merge pull request #2768 from robstolarz/RSTO-nix-macos-fix
fix: compile under Nix flake on macOS
Emilie Burgun [Wed, 1 Jan 2025 16:27:40 +0000 (17:27 +0100)]
Fix #2725 by calling load_context/1 in the unspecified branch of strip_module/3
This fixes #2725, by making it so that `strip_module(Pred, M, P), call(M:P)`
doesn't throw an `instanciation_error` when `Pred` isn't in the form `module:predicate`.
Now, `strip_module(hello, M, P)` will call `load_context(M)`, which unifies `M`
with the topmost module (or `user`).
Two new test cases are added: issue2725.pl, which tests the minimal case id(X) --> X.
and the strip_module(P, M, _), call(M:P) scenario, and module_resolution,
which tests the behavior of strip_module in a few scenarios.
Mark Thom [Sun, 12 Jan 2025 04:27:32 +0000 (21:27 -0700)]
Merge pull request #2756 from adri326/fix-load-context-unreachable
Fix load_context_module triggering unreachable!()
Rob Stolarz [Sat, 11 Jan 2025 21:00:46 +0000 (13:00 -0800)]
fix: compile under Nix flake on macOS
Emilie Burgun [Tue, 7 Jan 2025 17:10:50 +0000 (18:10 +0100)]
Add tests for PR #2756
Emilie Burgun [Tue, 7 Jan 2025 16:59:13 +0000 (17:59 +0100)]
Fix load_context_module triggering unreachable code in unify_atom
Mark Thom [Sat, 4 Jan 2025 20:26:08 +0000 (13:26 -0700)]
Merge pull request #2742 from triska/clpb
Revert "FIXED: CLP(B): Delay BDD restriction until after the instantiation"
Mark Thom [Sat, 4 Jan 2025 20:24:35 +0000 (13:24 -0700)]
Merge pull request #2728 from aarroyoc/lets-play-brisca
Add tutorial: Let's play Brisca
Mark Thom [Sat, 4 Jan 2025 20:23:59 +0000 (13:23 -0700)]
Merge pull request #2743 from triska/crypto
atom --> string
Mark Thom [Sat, 4 Jan 2025 20:23:44 +0000 (13:23 -0700)]
Merge pull request #2744 from triska/files
state when the predicates are true
Markus Triska [Thu, 2 Jan 2025 17:54:27 +0000 (18:54 +0100)]
state when the predicates are true
"returns" is not used in this way in logic programming. "return"
suggests that something went away and is now coming back, but this is
never the case in these situations. The arguments may be variables or
also fully known at the time of the call in most cases.
Markus Triska [Thu, 2 Jan 2025 17:30:29 +0000 (18:30 +0100)]
atom --> string
Markus Triska [Thu, 2 Jan 2025 17:01:45 +0000 (18:01 +0100)]
Revert "FIXED: CLP(B): Delay BDD restriction until after the instantiation."
This reverts commit
e185b626bdf1a99ab8188ae39875f645c0de90f0 .
This change is now no longer needed, and the underlying issue is
apparently somewhere else entirely. See the description at:
https://github.com/mthom/scryer-prolog/issues/2732
Current master behaves differently from Scryer as it was at
099d9aaca6509496ccb28c522659b990f42037f0 (i.e., preceding
the commit that is now being reverted), even on the same file.
For an example, see:
https://github.com/triska/scryer-prolog/commit/
dd41176b97d8369c3bb7de1c9932a9c3d10a0466
Scryer now works as expected, and compatibly with SICStus. We still
need to find out what fixed the root cause of this issue.
Adrián Arroyo Calle [Sun, 29 Dec 2024 22:55:57 +0000 (23:55 +0100)]
Add tutorial: Let's play Brisca
Mark Thom [Wed, 25 Dec 2024 21:29:38 +0000 (14:29 -0700)]
Merge pull request #2681 from hurufu/remove-dcgs-that-have-failed-to-expand
Remove DCGs that have thrown an exception during term expansion
Mark Thom [Wed, 25 Dec 2024 20:23:21 +0000 (12:23 -0800)]
qualify module quantification errors better (#2685)
Mark Thom [Wed, 25 Dec 2024 20:11:17 +0000 (12:11 -0800)]
style corrections
Aleksy Grabowski [Thu, 5 Dec 2024 10:15:42 +0000 (11:15 +0100)]
Remove DCGs that have thrown an exception during term expansion
Some DCG constructs aren't supported and can't be expanded, here we
remove offending DCG rule and don't compile it at all – in a similar
fashion to what we do when incorrect goal was found – whole predicate
isn't getting compiled.
Fixes #2675
Mark Thom [Sat, 21 Dec 2024 01:42:09 +0000 (18:42 -0700)]
Merge pull request #2714 from triska/graphic_token
prevent accidental amalgamation of graphic token chars in output
Mark Thom [Sat, 21 Dec 2024 01:41:51 +0000 (18:41 -0700)]
Merge pull request #2717 from jasagredo/js/small-doc
Ensure max_assoc/3 is shown as documented
Mark Thom [Wed, 18 Dec 2024 07:28:50 +0000 (23:28 -0800)]
leave variable modules uninstantiated (#2685)
Javier Sagredo [Wed, 18 Dec 2024 00:02:45 +0000 (01:02 +0100)]
Ensure max_assoc/3 is shown as documented
Markus Triska [Tue, 17 Dec 2024 21:51:47 +0000 (22:51 +0100)]
use round brackets for goals involving operators
Examples:
?- portray_clause(((+) :- a=b,(-))).
(+) :-
a=b,
(-).
true.
?- portray_clause((a :- (b :- c))).
a :-
(b:-c).
true.
This addresses #2715.
Currently, more round brackets than needed are emitted. Ideally, a
better approach to solve the issue here and also in toplevel.pl is
found in the future.
Markus Triska [Tue, 17 Dec 2024 18:51:11 +0000 (19:51 +0100)]
prevent accidental amalgamation of graphic token chars in output
This addresses #2713. Many thanks to @notoria for reporting this
excellent case!
Example:
?- portray_clause(A = @).
A= @ .
true.
At other positions the now inserted space is unnecessary, as in:
?- portray_clause((head:- @,b)).
head :-
@ ,
b.
true.
The toplevel has a similar issue:
?- C = # ; false.
C = # |<-- cursor is here; redundant space after #
There may be a way to solve this issue for all cases like this.
Mark Thom [Sat, 14 Dec 2024 04:46:43 +0000 (21:46 -0700)]
Merge pull request #2582 from bakaq/rework_library_interface
Rework library interface
Mark Thom [Sat, 14 Dec 2024 04:39:38 +0000 (21:39 -0700)]
Merge pull request #2691 from aarroyoc/remove-meetup-2024
Remove Scryer Prolog Meetup 2024 announcements
Mark Thom [Sat, 14 Dec 2024 04:39:12 +0000 (21:39 -0700)]
Merge pull request #2683 from ffortier/master
Support hermetic build environment
Mark Thom [Sat, 14 Dec 2024 04:38:47 +0000 (21:38 -0700)]
Merge pull request #2689 from triska/weighted_maybe
introduce and use weighted_maybe/2
Mark Thom [Sat, 14 Dec 2024 04:38:32 +0000 (21:38 -0700)]
Merge pull request #2690 from notoria/next
Add '$random_integer'/3
Mark Thom [Sat, 14 Dec 2024 04:37:56 +0000 (21:37 -0700)]
Merge pull request #2696 from jasonhemann/patch-3
s/performance characters/performance characteristics/