]>
Repositorios git - scryer-prolog.git/log
Markus Triska [Sat, 3 Sep 2022 11:30:57 +0000 (13:30 +0200)]
ENHANCED: Eliminate the OpenSSL dependency of library(crypto).
This is achieved by using the newly available crrl crate by @pornin
to implement crypto_curve_scalar_mult/4 for secp256k1. Many thanks!
Mark Thom [Fri, 2 Sep 2022 03:14:50 +0000 (21:14 -0600)]
properly match strings concluding with characters in lists (#1597)
Markus Triska [Thu, 25 Aug 2022 17:30:30 +0000 (19:30 +0200)]
correct nth0/4 and nth1/4
As per https://github.com/triska/scryer-prolog/commit/
56b430ecaf9bd59fb7bd0b1e56d451ab322c422e #commitcomment-
82155379 .
Markus Triska [Wed, 24 Aug 2022 22:03:47 +0000 (00:03 +0200)]
remove nth1/3, which is now provided by library(lists)
Markus Triska [Wed, 24 Aug 2022 22:03:30 +0000 (00:03 +0200)]
remove nth1/3, which is now provided by library(lists)
Markus Triska [Wed, 24 Aug 2022 19:11:54 +0000 (21:11 +0200)]
ENHANCED: Much improved nth0/3, taken from #1529.
This also adds nth0/4 and bootstraps nth1/[3,4] from it.
Markus Triska [Wed, 24 Aug 2022 19:05:44 +0000 (21:05 +0200)]
ADDED: must_be/can_be(not_less_than_zero, ...)
See #1309.
Markus Triska [Tue, 23 Aug 2022 19:21:17 +0000 (21:21 +0200)]
better implementation of list_si/1
Per discussion in https://github.com/mthom/scryer-prolog/pull/1589.
Markus Triska [Tue, 23 Aug 2022 17:54:11 +0000 (19:54 +0200)]
ADDED: chars_si/1, testing for a string
Examples:
?- chars_si("hello").
true.
?- chars_si(5).
false.
?- chars_si([a,b,c|Rs]).
error(instantiation_error,sort/2).
Markus Triska [Mon, 22 Aug 2022 20:08:10 +0000 (22:08 +0200)]
use new domain names from library(error): octet_character, octet_chars
Markus Triska [Mon, 22 Aug 2022 19:54:03 +0000 (21:54 +0200)]
ADDED: octet_character and octet_chars, testing for strings that represent bytes.
Markus Triska [Sun, 21 Aug 2022 16:59:36 +0000 (18:59 +0200)]
rely on the built-in DCG expansion, per discussion in #1577
Markus Triska [Sun, 21 Aug 2022 11:51:12 +0000 (13:51 +0200)]
ENHANCED: Use '$skip_max_list'/4 for greater efficiency of nth0/3.
This is now possible due to
4c7e2eb8614da9c04f2286f6116b468017fb442c .
See #1529 for the suggestion by @UWN.
Markus Triska [Sun, 21 Aug 2022 12:29:32 +0000 (14:29 +0200)]
ENHANCED: Improve determinism of ... //0 and seq//1.
Example:
?- phrase(..., "hello").
true.
This addresses #1577.
Mark Thom [Sun, 21 Aug 2022 02:28:49 +0000 (20:28 -0600)]
offset into complete strings with '$skip_max_list'/4 (#1529)
Mark Thom [Sat, 20 Aug 2022 05:41:47 +0000 (23:41 -0600)]
don't return ops with priority 0 when building set for current_op (#1571)
Mark Thom [Sun, 14 Aug 2022 22:14:53 +0000 (16:14 -0600)]
treat functors with PI '.'/2 as lists (#1570)
Mark Thom [Sun, 14 Aug 2022 19:18:34 +0000 (13:18 -0600)]
introduce expand_call_goal/3 to expand goals in control meta-predicates (#1568)
Markus Triska [Sun, 14 Aug 2022 06:23:39 +0000 (08:23 +0200)]
use a DCG to describe the path
Markus Triska [Sun, 14 Aug 2022 06:11:15 +0000 (08:11 +0200)]
remove entailed must_be/2 goals
Markus Triska [Sat, 13 Aug 2022 19:42:44 +0000 (21:42 +0200)]
use newly available ... //0 from library(dcgs)
Markus Triska [Sat, 13 Aug 2022 19:39:08 +0000 (21:39 +0200)]
add meta_predicate/1 declaration for phrase_to_file/3
Mark Thom [Sun, 14 Aug 2022 02:46:52 +0000 (20:46 -0600)]
strip modules from GRBody in phrase/3 (#1565)
Mark Thom [Sat, 13 Aug 2022 16:14:37 +0000 (10:14 -0600)]
fail on non-list solutions in setof/3 (#1553)
Adrián Arroyo Calle [Thu, 11 Aug 2022 18:25:19 +0000 (20:25 +0200)]
HTTP Server 2.0
Mark Thom [Sat, 6 Aug 2022 22:15:25 +0000 (16:15 -0600)]
prefix inlined goals with module names in expand_subgoal/5 (#1551)
Mark Thom [Mon, 25 Jul 2022 19:52:24 +0000 (13:52 -0600)]
try to invoke '$call_inline' a second time in call/N (#1543)
Markus Triska [Mon, 25 Jul 2022 18:08:54 +0000 (20:08 +0200)]
ENHANCED: CLP(ℤ): Reduce redundant propagator invocations during all_distinct/1 filtering
First, the current propagator is now logged and not re-triggered
during filtering. Second, and more significantly, all neq_num/2
constraints are scheduled and processed before more global constraints
are invoked. In this way, all the distilled information can be taken
into account by subsequently invoked global constraints.
These changes yield a 3-fold improvement in several Sudoku instances,
and a significant runtime reduction in social golfer instance 8-4-9.
Markus Triska [Sun, 24 Jul 2022 22:10:32 +0000 (00:10 +0200)]
add meta_predicate/1 declarations
Mark Thom [Sun, 24 Jul 2022 21:20:53 +0000 (15:20 -0600)]
resolve phrase modules internally (#1541)
Mark Thom [Sun, 24 Jul 2022 19:36:34 +0000 (13:36 -0600)]
fail when exception caught from subgoal expansion (#1535)
Mark Thom [Sun, 24 Jul 2022 06:59:42 +0000 (00:59 -0600)]
fix module resolution in dcgs, call/N (#1539)
Mark Thom [Sat, 23 Jul 2022 19:16:02 +0000 (13:16 -0600)]
deduplicate index ptr inlining for 0-arity atoms (#1538)
Mark Thom [Sat, 23 Jul 2022 03:34:38 +0000 (21:34 -0600)]
trim get_structure and put_structure arities when last arg is an index ptr (#1536)
Mark Thom [Fri, 22 Jul 2022 19:10:12 +0000 (13:10 -0600)]
print index_ptr offset (#1534)
Mark Thom [Thu, 21 Jul 2022 03:16:17 +0000 (21:16 -0600)]
use separate predicate for findall cleanup
Mark Thom [Wed, 20 Jul 2022 19:31:44 +0000 (13:31 -0600)]
inference count call_inline, fail on undefined index
Mark Thom [Wed, 20 Jul 2022 02:29:22 +0000 (20:29 -0600)]
streamline assertz/1, asserta/1
Mark Thom [Wed, 13 Jul 2022 04:39:50 +0000 (22:39 -0600)]
inline metacalls
Mark Thom [Thu, 27 Oct 2022 05:37:36 +0000 (23:37 -0600)]
Merge pull request #1630 from epilys/fix-1625
fix type_error with instantiated EOF -1 byte literal in get_byte/2
Manos Pitsidianakis [Wed, 26 Oct 2022 10:49:38 +0000 (13:49 +0300)]
fix type_error with instantiated EOF -1 byte literal in get_byte/2
According to ISO Prolog, get_byte/2 predicate can receive an
instantiated input byte:
http://www.gprolog.org/manual/html_node/gprolog037.html#sec156
get_byte(+stream_or_alias, ?in_byte)
Since in_byte can be -1 if EOF is reached, instantiating it with -1
should work but does not because the implementation is trying to convert
it to a u8 which is unsigned:
?- open("/dev/null", read, S, [type(binary)]), get_byte(S, -1).
error(type_error(in_byte,-1),get_byte/2).
This commit adds an extra check for -1 before checking for a valid u8
instantiated value if in_byte is an input:
?- open("/dev/null", read, S, [type(binary)]), get_byte(S, -1).
S = '$stream'(0x55601e65c998).
Closes #1625
Mark Thom [Wed, 26 Oct 2022 02:46:49 +0000 (20:46 -0600)]
Merge pull request #1628 from epilys/fix-1626
Fix xor/2 type error reporting wrong argument
Manos Pitsidianakis [Mon, 24 Oct 2022 16:26:43 +0000 (19:26 +0300)]
Fix xor/2 type error reporting wrong argument
If first argument n1 in xor/2 is of wrong numerical type, the match
patterns fall through to a catch all case that reports the second
argument in the type error.
Fixes #1626
`xor/2 function reports the wrong argument in type error #1626`
https://github.com/mthom/scryer-prolog/issues/1626
Mark Thom [Tue, 19 Jul 2022 03:36:46 +0000 (21:36 -0600)]
Merge pull request #1530 from RossSmyth/FixImports
Fixed imports for num-rug-adapter
Ross Smyth [Sun, 17 Jul 2022 06:06:37 +0000 (02:06 -0400)]
Fixed imports num-rug-adapter
Mark Thom [Wed, 22 Jun 2022 04:47:55 +0000 (22:47 -0600)]
capture and propagate (=..)/2 errors in phrase/{2,3} (#1460)
Mark Thom [Sat, 18 Jun 2022 17:26:31 +0000 (11:26 -0600)]
propagate inference_limit_exceeded errors through the loader (#1298)
Mark Thom [Thu, 16 Jun 2022 04:32:05 +0000 (22:32 -0600)]
use setup_cal_n_init_goal_info in dynamic_module_resolution
Mark Thom [Mon, 13 Jun 2022 04:17:44 +0000 (22:17 -0600)]
improve efficiency of call/N, replace '$call_with_default_policy' with
'$call_with_inference_counting'
Mark Thom [Wed, 8 Jun 2022 03:45:26 +0000 (21:45 -0600)]
simplify detecting undefined goal_ and term_expansion
Mark Thom [Sun, 12 Jun 2022 21:44:14 +0000 (15:44 -0600)]
Merge pull request #1510 from Skgland/add-gitattributes
add a .gitattributes file
Skgland [Sun, 12 Jun 2022 13:39:55 +0000 (15:39 +0200)]
add a .gitattributes file
- this should stop problems such as mthom/scryer-prolog#1491
by specifying the line ending
as this should take precedence over the global config
Mark Thom [Mon, 6 Jun 2022 02:53:07 +0000 (20:53 -0600)]
replace call with $call in more meta-predicates
Mark Thom [Sun, 5 Jun 2022 05:43:48 +0000 (23:43 -0600)]
emit indexing instructions in single clauses of dynamic predicates
Mark Thom [Sat, 4 Jun 2022 21:29:00 +0000 (15:29 -0600)]
do not emit indexing instructions for single clause subsequences (#1503)
Mark Thom [Sat, 4 Jun 2022 15:56:51 +0000 (09:56 -0600)]
Merge pull request #1505 from Skgland/optional_rustfmt
make rustfmt optional
Skgland [Fri, 3 Jun 2022 21:50:17 +0000 (23:50 +0200)]
adjust error message on failed formatting
Skgland [Fri, 3 Jun 2022 21:35:55 +0000 (23:35 +0200)]
make rustfmt optional
- when rustfmt is not detected (by attempting to run ``rustfmt --version)
no formatting will be attempted
- this should resolve issue mthom/scryer-prolog#1504
Mark Thom [Wed, 1 Jun 2022 06:02:11 +0000 (00:02 -0600)]
unmark cells in arith_eval_by_metacall (#1497)
Mark Thom [Wed, 1 Jun 2022 05:34:55 +0000 (23:34 -0600)]
don't print superfluous round brackets in curly braces (#1416)
Mark Thom [Wed, 1 Jun 2022 00:12:19 +0000 (18:12 -0600)]
fix broken quoting in writeq/1 (#1498)
Mark Thom [Tue, 31 May 2022 05:25:44 +0000 (23:25 -0600)]
fix off-by-one error reporting in write_term/3 (#1490)
Mark Thom [Tue, 31 May 2022 05:09:20 +0000 (23:09 -0600)]
don't quote most characters in strings (#1495, #301)
Mark Thom [Mon, 23 May 2022 17:15:58 +0000 (11:15 -0600)]
use existence_error for dropped streams (#1472)
Mark Thom [Mon, 23 May 2022 01:52:19 +0000 (19:52 -0600)]
Merge pull request #1485 from triska/in_character
Implement and use can_be(in_character, ...)
Markus Triska [Sun, 22 May 2022 20:43:48 +0000 (22:43 +0200)]
use in_character
This addresses one aspect of #1472.
Markus Triska [Sun, 22 May 2022 20:43:01 +0000 (22:43 +0200)]
ADDED: must_be(in_character, ...) and can_be(in_character, ...)
Mark Thom [Sun, 22 May 2022 20:15:56 +0000 (14:15 -0600)]
fix stream position and term comparison bugs (#1472)
Mark Thom [Sun, 22 May 2022 16:15:16 +0000 (10:15 -0600)]
Merge pull request #1484 from aarroyoc/fix-windows-build-2
Fix build on Windows 10
Adrián Arroyo Calle [Sun, 22 May 2022 12:18:51 +0000 (14:18 +0200)]
MSI installer
Adrián Arroyo Calle [Sun, 22 May 2022 11:18:11 +0000 (13:18 +0200)]
Fix build on Windows 10
Mark Thom [Sun, 22 May 2022 06:03:55 +0000 (00:03 -0600)]
throw a representation error if max arity is exceeded (#1483)
Mark Thom [Sat, 21 May 2022 18:35:35 +0000 (12:35 -0600)]
Merge pull request #1482 from triska/multiple_of_five_answers
ENHANCED: "f" on toplevel to report answers up to the next multiple of 5.
Mark Thom [Sat, 21 May 2022 18:32:48 +0000 (12:32 -0600)]
add max arity checks at various stages (#1459)
Markus Triska [Sat, 21 May 2022 16:20:08 +0000 (18:20 +0200)]
ENHANCED: "f" on toplevel to report answers up to the next multiple of 5.
This makes counting solutions easy.
Mark Thom [Tue, 17 May 2022 02:45:45 +0000 (20:45 -0600)]
check asserta/2, assertz/2, abolish/2 for uninstantiated Module variables (#1475)
Mark Thom [Mon, 16 May 2022 22:32:38 +0000 (16:32 -0600)]
detect character type errors in atom_{chars|codes}/2 (#1472)
Mark Thom [Sun, 15 May 2022 15:44:44 +0000 (09:44 -0600)]
Merge pull request #1478 from triska/sgml_improvements
Various improvements to library(sgml)
Mark Thom [Sun, 15 May 2022 15:44:26 +0000 (09:44 -0600)]
Merge pull request #1477 from triska/document_tab_completion
document atom and predicate completion with TAB
Markus Triska [Sun, 15 May 2022 08:55:56 +0000 (10:55 +0200)]
indent enumerations
Markus Triska [Sun, 15 May 2022 08:55:27 +0000 (10:55 +0200)]
clarify the representation
Markus Triska [Sun, 15 May 2022 08:25:41 +0000 (10:25 +0200)]
strengthen and improve type checks
Markus Triska [Sun, 15 May 2022 08:23:00 +0000 (10:23 +0200)]
clarify comment
Markus Triska [Sun, 15 May 2022 08:19:00 +0000 (10:19 +0200)]
use phrase_from_file/2 directly on the file name
Markus Triska [Sun, 15 May 2022 08:04:45 +0000 (10:04 +0200)]
document atom and predicate completion with TAB
This feature, added via
https://github.com/mthom/scryer-prolog/pull/1467, makes the toplevel
interaction a lot more convenient in many cases.
Many thanks to @euanlacy!
Mark Thom [Sun, 15 May 2022 05:28:04 +0000 (23:28 -0600)]
Merge pull request #1474 from triska/correct_can_be_chars
FIXED: can_be(chars, [a,X]), i.e., if variables occur as elements
Mark Thom [Sat, 14 May 2022 17:01:26 +0000 (11:01 -0600)]
consider deallocate a head instruction (#1473)
Markus Triska [Sat, 14 May 2022 07:52:34 +0000 (09:52 +0200)]
prioritize type errors over instantiation errors
Example:
?- must_be(chars, [a,X,cc]).
error(type_error(character,cc),can_be/2).
See https://github.com/mthom/scryer-prolog/pull/1474#issuecomment-
1126664368
Markus Triska [Sat, 14 May 2022 06:09:01 +0000 (08:09 +0200)]
FIXED: can_be(chars, [a,X]), i.e., if variables occur as elements
This should simplify
2f3de51e554629d2e7b4ea023c9ef181c240692c and
other cases like it.
Mark Thom [Sat, 14 May 2022 00:38:02 +0000 (18:38 -0600)]
remove non-determinism in number_chars/2 and numbercodes/2 (#1473)
Mark Thom [Thu, 12 May 2022 06:00:37 +0000 (00:00 -0600)]
use must_be(chars) in number_chars/2 (#1470)
Mark Thom [Thu, 12 May 2022 04:32:09 +0000 (22:32 -0600)]
Merge pull request #1467 from euanlacy/master
Completion of predicates in repl
Euan Lacy [Wed, 11 May 2022 20:37:03 +0000 (21:37 +0100)]
wip: add more atoms to completion list
Euan Lacy [Tue, 10 May 2022 16:54:15 +0000 (17:54 +0100)]
fix: remove unnecessary string & vec allocations
Euan Lacy [Tue, 10 May 2022 03:40:22 +0000 (04:40 +0100)]
wip: basic completion of predicates
Mark Thom [Sun, 8 May 2022 20:52:22 +0000 (14:52 -0600)]
unify partial string tail later in create_partial_string (#1462, #1465, #1427)
Mark Thom [Fri, 6 May 2022 23:38:25 +0000 (17:38 -0600)]
fix culprit in stream_position permission_error (#1463)
Mark Thom [Fri, 6 May 2022 00:58:22 +0000 (18:58 -0600)]
correct cycle detection in unify_* (#1455)
Mark Thom [Thu, 5 May 2022 23:24:54 +0000 (17:24 -0600)]
Merge pull request #1461 from triska/clpz_sign
ADDED: sign/1
Markus Triska [Thu, 5 May 2022 20:49:48 +0000 (22:49 +0200)]
ADDED: sign/1