]>
Repositorios git - scryer-prolog.git/log
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.
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
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/
Mark Thom [Sat, 14 Dec 2024 03:02:50 +0000 (20:02 -0700)]
Merge pull request #2698 from jasonhemann/patch-5
Documentation for read/2
Mark Thom [Sat, 14 Dec 2024 03:02:21 +0000 (20:02 -0700)]
Merge pull request #2703 from jasonhemann/patch-6
s/avaibale/available/
Mark Thom [Sat, 14 Dec 2024 02:57:21 +0000 (19:57 -0700)]
Merge pull request #2697 from jasonhemann/patch-4
"bound to an atom"
Jason Hemann [Fri, 13 Dec 2024 18:41:05 +0000 (13:41 -0500)]
s/avaibale/available/
Quick typo fix to docs.
bakaq [Thu, 12 Dec 2024 09:03:43 +0000 (06:03 -0300)]
cargo fmt
bakaq [Thu, 12 Dec 2024 08:59:59 +0000 (05:59 -0300)]
Use Cow<'a,B> for toplevel configuration
bakaq [Thu, 12 Dec 2024 08:49:52 +0000 (05:49 -0300)]
FIXME in Drop for QueryState
bakaq [Thu, 12 Dec 2024 08:43:23 +0000 (05:43 -0300)]
Leave residual goals for later
bakaq [Thu, 12 Dec 2024 08:38:55 +0000 (05:38 -0300)]
Derive Default for StreamConfig
bakaq [Thu, 12 Dec 2024 08:34:16 +0000 (05:34 -0300)]
Rename lib_machine_tests.rs to tests.rs
Jason Hemann [Wed, 11 Dec 2024 13:05:03 +0000 (08:05 -0500)]
Update builtins.pl
s/compund/compound/
Jason Hemann [Wed, 11 Dec 2024 10:46:28 +0000 (05:46 -0500)]
Update builtins.pl
Simplifying docstring.
Jason Hemann [Wed, 11 Dec 2024 02:18:09 +0000 (21:18 -0500)]
Documentation for read/2
Mirrored the wording in the docstrings for `read/1` and `read_term/3`.
Jason Hemann [Wed, 11 Dec 2024 02:07:48 +0000 (21:07 -0500)]
"bound to an atom"
Quick typo.
Jason Hemann [Wed, 11 Dec 2024 01:56:44 +0000 (20:56 -0500)]
s/performance characters/performance characteristics/
Small typo fix in docs.
Adrián Arroyo Calle [Mon, 9 Dec 2024 12:52:43 +0000 (13:52 +0100)]
Remove Scryer Prolog Meetup 2024 announcements
bakaq [Sun, 8 Dec 2024 22:47:18 +0000 (19:47 -0300)]
Handle errors in QueryState
bakaq [Sat, 12 Oct 2024 22:08:45 +0000 (19:08 -0300)]
Migrate benches
bakaq [Sat, 12 Oct 2024 20:41:48 +0000 (17:41 -0300)]
Migrate tests to new API
bakaq [Sat, 12 Oct 2024 20:04:29 +0000 (17:04 -0300)]
Separate lib_machine tests into separate file
bakaq [Sat, 12 Oct 2024 19:58:38 +0000 (16:58 -0300)]
Shrink MVP API surface
bakaq [Sat, 12 Oct 2024 19:48:13 +0000 (16:48 -0300)]
Rename PrologTerm to Term
bakaq [Sat, 12 Oct 2024 19:42:56 +0000 (16:42 -0300)]
Remove parsed_results.rs
bakaq [Sat, 12 Oct 2024 19:07:13 +0000 (16:07 -0300)]
MachineBuilder
bakaq [Mon, 30 Sep 2024 02:53:37 +0000 (23:53 -0300)]
Fix Machine links
bakaq [Mon, 30 Sep 2024 02:50:15 +0000 (23:50 -0300)]
#[deny(missing_docs)]
bakaq [Mon, 30 Sep 2024 02:45:40 +0000 (23:45 -0300)]
Document test methods
bakaq [Mon, 30 Sep 2024 02:42:11 +0000 (23:42 -0300)]
Add interfaces for QueryState methods
bakaq [Mon, 30 Sep 2024 02:30:57 +0000 (23:30 -0300)]
Docs for Machine and QueryState
bakaq [Mon, 30 Sep 2024 02:22:51 +0000 (23:22 -0300)]
Docs for run_binary()
bakaq [Mon, 30 Sep 2024 02:21:18 +0000 (23:21 -0300)]
LeafAnswer docs and success checking methods
bakaq [Mon, 30 Sep 2024 02:09:47 +0000 (23:09 -0300)]
More PrologTerm documentation
bakaq [Mon, 30 Sep 2024 02:06:43 +0000 (23:06 -0300)]
Conjunctions, disjunction, and LeafAnswer to PrologTerm
bakaq [Mon, 30 Sep 2024 01:30:24 +0000 (22:30 -0300)]
Associated functions for creating PrologTerm