]> Repositorios git - scryer-prolog.git/log
scryer-prolog.git
4 years agomake rustfmt optional
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

4 years agounmark cells in arith_eval_by_metacall (#1497)
Mark Thom [Wed, 1 Jun 2022 06:02:11 +0000 (00:02 -0600)]
unmark cells in arith_eval_by_metacall (#1497)

4 years agodon't print superfluous round brackets in curly braces (#1416)
Mark Thom [Wed, 1 Jun 2022 05:34:55 +0000 (23:34 -0600)]
don't print superfluous round brackets in curly braces (#1416)

4 years agofix broken quoting in writeq/1 (#1498)
Mark Thom [Wed, 1 Jun 2022 00:12:19 +0000 (18:12 -0600)]
fix broken quoting in writeq/1 (#1498)

4 years agofix off-by-one error reporting in write_term/3 (#1490)
Mark Thom [Tue, 31 May 2022 05:25:44 +0000 (23:25 -0600)]
fix off-by-one error reporting in write_term/3 (#1490)

4 years agodon't quote most characters in strings (#1495, #301)
Mark Thom [Tue, 31 May 2022 05:09:20 +0000 (23:09 -0600)]
don't quote most characters in strings (#1495, #301)

4 years agouse existence_error for dropped streams (#1472)
Mark Thom [Mon, 23 May 2022 17:15:58 +0000 (11:15 -0600)]
use existence_error for dropped streams (#1472)

4 years agoMerge pull request #1485 from triska/in_character
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, ...)

4 years agouse in_character
Markus Triska [Sun, 22 May 2022 20:43:48 +0000 (22:43 +0200)]
use in_character

This addresses one aspect of #1472.

4 years agoADDED: must_be(in_character, ...) and can_be(in_character, ...)
Markus Triska [Sun, 22 May 2022 20:43:01 +0000 (22:43 +0200)]
ADDED: must_be(in_character, ...) and can_be(in_character, ...)

4 years agofix stream position and term comparison bugs (#1472)
Mark Thom [Sun, 22 May 2022 20:15:56 +0000 (14:15 -0600)]
fix stream position and term comparison bugs (#1472)

4 years agoMerge pull request #1484 from aarroyoc/fix-windows-build-2
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

4 years agoMSI installer
Adrián Arroyo Calle [Sun, 22 May 2022 12:18:51 +0000 (14:18 +0200)]
MSI installer

4 years agoFix build on Windows 10
Adrián Arroyo Calle [Sun, 22 May 2022 11:18:11 +0000 (13:18 +0200)]
Fix build on Windows 10

4 years agothrow a representation error if max arity is exceeded (#1483)
Mark Thom [Sun, 22 May 2022 06:03:55 +0000 (00:03 -0600)]
throw a representation error if max arity is exceeded (#1483)

4 years agoMerge pull request #1482 from triska/multiple_of_five_answers
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.

4 years agoadd max arity checks at various stages (#1459)
Mark Thom [Sat, 21 May 2022 18:32:48 +0000 (12:32 -0600)]
add max arity checks at various stages (#1459)

4 years agoENHANCED: "f" on toplevel to report answers up to the next multiple of 5.
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.

4 years agocheck asserta/2, assertz/2, abolish/2 for uninstantiated Module variables (#1475)
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)

4 years agodetect character type errors in atom_{chars|codes}/2 (#1472)
Mark Thom [Mon, 16 May 2022 22:32:38 +0000 (16:32 -0600)]
detect character type errors in atom_{chars|codes}/2 (#1472)

4 years agoMerge pull request #1478 from triska/sgml_improvements
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)

4 years agoMerge pull request #1477 from triska/document_tab_completion
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

4 years agoindent enumerations
Markus Triska [Sun, 15 May 2022 08:55:56 +0000 (10:55 +0200)]
indent enumerations

4 years agoclarify the representation
Markus Triska [Sun, 15 May 2022 08:55:27 +0000 (10:55 +0200)]
clarify the representation

4 years agostrengthen and improve type checks
Markus Triska [Sun, 15 May 2022 08:25:41 +0000 (10:25 +0200)]
strengthen and improve type checks

4 years agoclarify comment
Markus Triska [Sun, 15 May 2022 08:23:00 +0000 (10:23 +0200)]
clarify comment

4 years agouse phrase_from_file/2 directly on the file name
Markus Triska [Sun, 15 May 2022 08:19:00 +0000 (10:19 +0200)]
use phrase_from_file/2 directly on the file name

4 years agodocument atom and predicate completion with TAB
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!

4 years agoMerge pull request #1474 from triska/correct_can_be_chars
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

4 years agoconsider deallocate a head instruction (#1473)
Mark Thom [Sat, 14 May 2022 17:01:26 +0000 (11:01 -0600)]
consider deallocate a head instruction (#1473)

4 years agoprioritize type errors over instantiation errors
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

4 years agoFIXED: can_be(chars, [a,X]), i.e., if variables occur as elements
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.

4 years agoremove non-determinism in number_chars/2 and numbercodes/2 (#1473)
Mark Thom [Sat, 14 May 2022 00:38:02 +0000 (18:38 -0600)]
remove non-determinism in number_chars/2 and numbercodes/2 (#1473)

4 years agouse must_be(chars) in number_chars/2 (#1470)
Mark Thom [Thu, 12 May 2022 06:00:37 +0000 (00:00 -0600)]
use must_be(chars) in number_chars/2 (#1470)

4 years agoMerge pull request #1467 from euanlacy/master
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

4 years agowip: add more atoms to completion list
Euan Lacy [Wed, 11 May 2022 20:37:03 +0000 (21:37 +0100)]
wip: add more atoms to completion list

4 years agofix: remove unnecessary string & vec allocations
Euan Lacy [Tue, 10 May 2022 16:54:15 +0000 (17:54 +0100)]
fix: remove unnecessary string & vec allocations

4 years agowip: basic completion of predicates
Euan Lacy [Tue, 10 May 2022 03:40:22 +0000 (04:40 +0100)]
wip: basic completion of predicates

4 years agounify partial string tail later in create_partial_string (#1462, #1465, #1427)
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)

4 years agofix culprit in stream_position permission_error (#1463)
Mark Thom [Fri, 6 May 2022 23:38:25 +0000 (17:38 -0600)]
fix culprit in stream_position permission_error (#1463)

4 years agocorrect cycle detection in unify_* (#1455)
Mark Thom [Fri, 6 May 2022 00:58:22 +0000 (18:58 -0600)]
correct cycle detection in unify_* (#1455)

4 years agoMerge pull request #1461 from triska/clpz_sign
Mark Thom [Thu, 5 May 2022 23:24:54 +0000 (17:24 -0600)]
Merge pull request #1461 from triska/clpz_sign

ADDED: sign/1

4 years agoADDED: sign/1
Markus Triska [Thu, 5 May 2022 20:49:48 +0000 (22:49 +0200)]
ADDED: sign/1

4 years agoremove comment that seems no longer valid
Markus Triska [Thu, 5 May 2022 20:51:21 +0000 (22:51 +0200)]
remove comment that seems no longer valid

4 years agofix rnd_i fixnum casting bug (#1456, #1458)
Mark Thom [Thu, 5 May 2022 04:44:12 +0000 (22:44 -0600)]
fix rnd_i fixnum casting bug (#1456, #1458)

4 years agotrack f64 offsets in Literal (#1190)
Mark Thom [Thu, 5 May 2022 03:54:46 +0000 (21:54 -0600)]
track f64 offsets in Literal (#1190)

4 years agocompact lists of characters to partial strings in read_term_from_heap (#1452, #1453)
Mark Thom [Mon, 2 May 2022 05:13:48 +0000 (23:13 -0600)]
compact lists of characters to partial strings in read_term_from_heap (#1452, #1453)

4 years agofix match_partial_string, compare_pstr_to_string (#1451)
Mark Thom [Sun, 1 May 2022 01:51:19 +0000 (19:51 -0600)]
fix match_partial_string, compare_pstr_to_string (#1451)

4 years agoremove redundant register assignments in numeric comparisons (#1438, #1448)
Mark Thom [Fri, 29 Apr 2022 07:25:36 +0000 (01:25 -0600)]
remove redundant register assignments in numeric comparisons (#1438, #1448)

4 years agoremove redundant skip_stub_try_me_else condition (#1444)
Mark Thom [Fri, 29 Apr 2022 01:25:09 +0000 (19:25 -0600)]
remove redundant skip_stub_try_me_else condition (#1444)

4 years agoMerge pull request #1436 from triska/must_be_term
Mark Thom [Tue, 26 Apr 2022 19:31:43 +0000 (13:31 -0600)]
Merge pull request #1436 from triska/must_be_term

ADDED: can_be(term, ...) and must_be(term, ...)

4 years agoreplace SliceDeque with VecDeque
Mark Thom [Tue, 26 Apr 2022 04:55:28 +0000 (22:55 -0600)]
replace SliceDeque with VecDeque

4 years agocatch existence_error exceptions from top-level calls to attribute_goals/3 (#1432)
Mark Thom [Mon, 25 Apr 2022 02:59:00 +0000 (20:59 -0600)]
catch existence_error exceptions from top-level calls to attribute_goals/3 (#1432)

4 years agounify structures from left to right (#1396)
Mark Thom [Sat, 23 Apr 2022 01:00:42 +0000 (19:00 -0600)]
unify structures from left to right (#1396)

4 years agoupdate to crossterm 0.20.0 (#1439)
Mark Thom [Fri, 22 Apr 2022 00:41:07 +0000 (18:41 -0600)]
update to crossterm 0.20.0 (#1439)

4 years agoADDED: can_be(term, ...) and must_be(term, ...)
Markus Triska [Wed, 20 Apr 2022 18:41:11 +0000 (20:41 +0200)]
ADDED: can_be(term, ...) and must_be(term, ...)

This terminology is a bit harder to understand than that of the other
type checks.

Scryer Prolog comprises two individually consistent but incompatible
notions of terms, namely terms and rational trees (which are also
called "cyclic terms"). This leads to a confusion in terminology,
because cyclic terms are not terms in the former sense even though
they also contain the word "term" in their name.

This terminological confusion is not restricted to terms: We also find
it for example in the notion of lists. Lists are defined inductively:

    - The empty list (written as "" or [], called 'nil') is a list.
    - A term with principal functor '.'/2 is a list if its second argument
      is a list.

Note that a list may contain cyclic terms as elements, and still be
called a list. However, if we post:

    ?- Ls = [_|Ls].

then Ls is not a list, because it does not fit the inductive
definition. Still, it is sometimes referred to as a "cyclic list" or
"circular list", even though it is not a list. Even Prolog
implementors that aim for strict conformance to the Prolog ISO
standard and are deeply familiar with the standard use this
terminology when talking about such terms, see for example:

    https://github.com/ichiban/prolog/pull/198

Consequently, must_be(list, Ls) raises a *type error* in this case.

Terms are distinguished from cyclic terms completely analogously. This
leads to the counterintuitive consequence that *cyclic lists are not
terms*. The reason for this apparent contradiction in terminology is
the mutual incompatibility of different notions of terms. The notion
of "term" precludes rational trees, similar to the notion of "list"
which precludes cyclic lists.

We therefore introduce:

    * must_be(term, Term)
      - raises an instantiation error if Term contains variables (since
        it could still become a rational tree)
      - raises a type error if Term is a rational tree

    * can_be(term, Term)
      - raises a type error if Term is a rational tree

Note that using the notion of "cyclic term" and "acyclic term" in this
terminology would not be a good idea, because this confusion is
precisely what we want to eliminate: must_be(term, Term) should be
usable as a test that reliably determines whether Term can be treated
as a term with the logical properties we expect from terms.

This addresses #1428.

4 years agovery minor optimizations
Mark Thom [Mon, 18 Apr 2022 02:10:13 +0000 (20:10 -0600)]
very minor optimizations

4 years agomark unsafe variables and substitute temporary variables in is/2 when appropriate...
Mark Thom [Sun, 17 Apr 2022 23:33:09 +0000 (17:33 -0600)]
mark unsafe variables and substitute temporary variables in is/2 when appropriate (#1430)

4 years agofix panic caused by jmp offset off by one error (#1429)
Mark Thom [Sun, 17 Apr 2022 18:19:48 +0000 (12:19 -0600)]
fix panic caused by jmp offset off by one error (#1429)

4 years agoavoid writing chars to the atom table in several places
Mark Thom [Sun, 17 Apr 2022 01:57:26 +0000 (19:57 -0600)]
avoid writing chars to the atom table in several places

4 years agoMerge pull request #1421 from gruhn/master
Mark Thom [Sat, 16 Apr 2022 17:11:33 +0000 (11:11 -0600)]
Merge pull request #1421 from gruhn/master

push Docker image on new release

4 years agofix comparisons to partial string tails (#1420)
Mark Thom [Fri, 15 Apr 2022 04:14:23 +0000 (22:14 -0600)]
fix comparisons to partial string tails (#1420)

4 years agopush Docker image on new release
Niklas Gruhn [Thu, 14 Apr 2022 14:33:57 +0000 (16:33 +0200)]
push Docker image on new release

Setup GitHub action which automatically builds and pushes Docker
images, when new release tags are created.

4 years agoinstantiate Module in definition of retract/1 (#1392)
Mark Thom [Thu, 14 Apr 2022 02:31:16 +0000 (20:31 -0600)]
instantiate Module in definition of retract/1 (#1392)

4 years agomark cells that are about to be iterated in the stackful iterator (#1418)
Mark Thom [Wed, 13 Apr 2022 04:51:20 +0000 (22:51 -0600)]
mark cells that are about to be iterated in the stackful iterator (#1418)

4 years agouse '$call' all throughout setup_call_cleanup/3
Mark Thom [Mon, 11 Apr 2022 23:24:00 +0000 (17:24 -0600)]
use '$call' all throughout setup_call_cleanup/3

4 years agodereference head of list in is_continuable (#1417)
Mark Thom [Mon, 11 Apr 2022 23:01:47 +0000 (17:01 -0600)]
dereference head of list in is_continuable (#1417)

4 years agostop detecting cycles in compare_pstr_to_string
Mark Thom [Mon, 11 Apr 2022 01:46:34 +0000 (19:46 -0600)]
stop detecting cycles in compare_pstr_to_string

4 years agomark variable referents in stackful iterator, fix tests (#1408)
Mark Thom [Sun, 10 Apr 2022 20:17:33 +0000 (14:17 -0600)]
mark variable referents in stackful iterator, fix tests (#1408)

4 years agoMerge pull request #1415 from wkral/set_output-error
Mark Thom [Sun, 10 Apr 2022 20:11:43 +0000 (14:11 -0600)]
Merge pull request #1415 from wkral/set_output-error

Fix reported source for set_output/1 error (#1407)

4 years agoFix reported source for set_output/1 error (#1407)
William Kral [Sun, 10 Apr 2022 19:00:59 +0000 (12:00 -0700)]
Fix reported source for set_output/1 error (#1407)

4 years agoprint dot after errors, fix tests (#1408)
Mark Thom [Sun, 10 Apr 2022 16:15:00 +0000 (10:15 -0600)]
print dot after errors, fix tests (#1408)

4 years agofix tests, use '$first_answer' to print indentation before errors (#1408)
Mark Thom [Sun, 10 Apr 2022 02:32:52 +0000 (20:32 -0600)]
fix tests, use '$first_answer' to print indentation before errors (#1408)

4 years agoprint errors as goals (#1408)
Mark Thom [Sat, 9 Apr 2022 20:01:48 +0000 (14:01 -0600)]
print errors as goals (#1408)

4 years agounmark dereferenced cells in term_variables/2 (#1412)
Mark Thom [Sat, 9 Apr 2022 18:15:46 +0000 (12:15 -0600)]
unmark dereferenced cells in term_variables/2 (#1412)

4 years agodereference bindings returned by stackful iterator (#1410, #1411)
Mark Thom [Sat, 9 Apr 2022 17:47:54 +0000 (11:47 -0600)]
dereference bindings returned by stackful iterator (#1410, #1411)

4 years agodeduplicate variable list in term_variables/2 (#1409)
Mark Thom [Sat, 9 Apr 2022 03:18:59 +0000 (21:18 -0600)]
deduplicate variable list in term_variables/2 (#1409)

4 years agothrow errors on cyclic terms when evaluating is/2 expressions
Mark Thom [Fri, 8 Apr 2022 05:06:58 +0000 (23:06 -0600)]
throw errors on cyclic terms when evaluating is/2 expressions

4 years agofix loop in stackful iterator (#1405, #1384)
Mark Thom [Fri, 8 Apr 2022 02:48:40 +0000 (20:48 -0600)]
fix loop in stackful iterator (#1405, #1384)

4 years agodetect immediately cyclic lists (#1384)
Mark Thom [Thu, 7 Apr 2022 04:53:48 +0000 (22:53 -0600)]
detect immediately cyclic lists (#1384)

4 years agorestore correct order to term_variables/2 (#1400, #1401)
Mark Thom [Wed, 6 Apr 2022 14:39:16 +0000 (08:39 -0600)]
restore correct order to term_variables/2 (#1400, #1401)

4 years agolimit use of stackless iterator to test suite
Mark Thom [Wed, 6 Apr 2022 03:02:39 +0000 (21:02 -0600)]
limit use of stackless iterator to test suite

4 years agoadd forwarding bit to all heap cells (#1384)
Mark Thom [Wed, 6 Apr 2022 02:13:17 +0000 (20:13 -0600)]
add forwarding bit to all heap cells (#1384)

4 years agoallocate floats in dedicated buffer
Mark Thom [Tue, 5 Apr 2022 05:56:30 +0000 (23:56 -0600)]
allocate floats in dedicated buffer

4 years agomake marker into an iterators, recover post_order_iterator
Mark Thom [Sun, 3 Apr 2022 04:45:10 +0000 (22:45 -0600)]
make marker into an iterators, recover post_order_iterator

4 years agoremoval of old stackless iterator, implementation of new more faithful one
Mark Thom [Sat, 2 Apr 2022 23:30:04 +0000 (17:30 -0600)]
removal of old stackless iterator, implementation of new more faithful one

4 years agoMerge pull request #1395 from wkral/fix-test-indentation
Mark Thom [Tue, 5 Apr 2022 16:58:12 +0000 (10:58 -0600)]
Merge pull request #1395 from wkral/fix-test-indentation

Fix indentation before false in tests (#676)

4 years agoFix indentation before false in tests (#676)
William Kral [Tue, 5 Apr 2022 06:58:20 +0000 (23:58 -0700)]
Fix indentation before false in tests (#676)

4 years agoindent plain false (#676)
Mark Thom [Mon, 4 Apr 2022 02:22:44 +0000 (20:22 -0600)]
indent plain false (#676)

4 years agoMerge pull request #1386 from triska/better_call_nth
Mark Thom [Sun, 3 Apr 2022 07:38:37 +0000 (01:38 -0600)]
Merge pull request #1386 from triska/better_call_nth

ENHANCED: more memory efficient call_nth/2 (#1264)

4 years agocompare complete strings to one another in write_literal_to_var (#1388)
Mark Thom [Sun, 3 Apr 2022 07:37:19 +0000 (01:37 -0600)]
compare complete strings to one another in write_literal_to_var (#1388)

4 years agoENHANCED: more memory efficient call_nth/2 (#1264)
Markus Triska [Sat, 2 Apr 2022 08:31:56 +0000 (10:31 +0200)]
ENHANCED: more memory efficient call_nth/2 (#1264)

I hope that this will allow more extensive tests of Scryer Prolog. Enjoy!

4 years agodon't mark forwarded refs in stackless iterator/marker (#1384)
Mark Thom [Sat, 2 Apr 2022 07:29:51 +0000 (01:29 -0600)]
don't mark forwarded refs in stackless iterator/marker (#1384)

4 years agobe aware of temporary variables of stackless iterator in term_variables (#1383)
Mark Thom [Fri, 1 Apr 2022 00:18:04 +0000 (18:18 -0600)]
be aware of temporary variables of stackless iterator in term_variables (#1383)

4 years agoMerge pull request #1381 from wkral/build-fmt-error
Mark Thom [Thu, 31 Mar 2022 23:59:02 +0000 (17:59 -0600)]
Merge pull request #1381 from wkral/build-fmt-error

Improve rustfmt missing error during build (#1379)

4 years agoImprove rustfmt missing error during build (#1379)
William Kral [Wed, 30 Mar 2022 21:26:35 +0000 (14:26 -0700)]
Improve rustfmt missing error during build (#1379)

4 years agoMerge pull request #1380 from triska/as_is
Mark Thom [Wed, 30 Mar 2022 19:56:25 +0000 (13:56 -0600)]
Merge pull request #1380 from triska/as_is

as --> is

4 years agoas --> is
Markus Triska [Wed, 30 Mar 2022 19:33:46 +0000 (21:33 +0200)]
as --> is

4 years agofix dif/2 crash (#1378)
Mark Thom [Wed, 30 Mar 2022 00:39:45 +0000 (18:39 -0600)]
fix dif/2 crash (#1378)

4 years agoMerge pull request #1373 from aarroyoc/http-open
Mark Thom [Tue, 29 Mar 2022 05:10:08 +0000 (23:10 -0600)]
Merge pull request #1373 from aarroyoc/http-open

Add Hyper based `http_open/3`