]> Repositorios git - scryer-prolog.git/log
scryer-prolog.git
6 years agointerrupt running queries and return to toplevel (#323)
Mark Thom [Wed, 15 Apr 2020 06:08:35 +0000 (00:08 -0600)]
interrupt running queries and return to toplevel (#323)

6 years agowrite [a,b,c] correctly with write_canonical (#349)
Mark Thom [Wed, 15 Apr 2020 05:25:15 +0000 (23:25 -0600)]
write [a,b,c] correctly with write_canonical (#349)

6 years agoupdate the toplevel description, incorporating the latest changes
Markus Triska [Tue, 14 Apr 2020 17:24:13 +0000 (19:24 +0200)]
update the toplevel description, incorporating the latest changes

6 years agoproperly iterate through UTF-8 strings (#350)
Mark Thom [Wed, 15 Apr 2020 05:14:47 +0000 (23:14 -0600)]
properly iterate through UTF-8 strings (#350)

6 years agoclean up print_list_like
Mark Thom [Tue, 14 Apr 2020 20:26:30 +0000 (14:26 -0600)]
clean up print_list_like

6 years agoprint lists as strings when possible (#295)
Mark Thom [Tue, 14 Apr 2020 19:28:51 +0000 (13:28 -0600)]
print lists as strings when possible (#295)

6 years agoprovide better variable names in write_term_to_chars/3 (#340)
Mark Thom [Tue, 14 Apr 2020 16:39:10 +0000 (10:39 -0600)]
provide better variable names in write_term_to_chars/3 (#340)

6 years agoimprove writeX performance (#290)
Mark Thom [Tue, 14 Apr 2020 16:25:05 +0000 (10:25 -0600)]
improve writeX performance (#290)

6 years agocopy operator exports to impromptu modules (#307)
Mark Thom [Tue, 14 Apr 2020 07:03:49 +0000 (01:03 -0600)]
copy operator exports to impromptu modules (#307)

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Tue, 14 Apr 2020 06:40:57 +0000 (00:40 -0600)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agochange from xsi to iso in bimetatrans, correct atomic/1 failure (#343)
Mark Thom [Tue, 14 Apr 2020 06:40:51 +0000 (00:40 -0600)]
change from xsi to iso in bimetatrans, correct atomic/1 failure (#343)

6 years agoMerge pull request #345 from triska/master
Mark Thom [Mon, 13 Apr 2020 22:24:52 +0000 (19:24 -0300)]
Merge pull request #345 from triska/master

ADDED: group_pairs_by_key/2

6 years agoADDED: group_pairs_by_key/2
Markus Triska [Mon, 13 Apr 2020 22:10:33 +0000 (00:10 +0200)]
ADDED: group_pairs_by_key/2

Pairs must be keysorted and may also contain variables as keys.

Examples:

    ?-  group_pairs_by_key([1-a,1-b,2-c], Ps).
       Ps = [1-[a,b],2-[c]].

    ?-  group_pairs_by_key([X-a,X-b,2-c], Ps).
       Ps = [X-[a,b],2-[c]].

6 years agoversion bump
Mark Thom [Mon, 13 Apr 2020 17:17:50 +0000 (11:17 -0600)]
version bump

6 years agoMerge pull request #327 from srenatus/sr/pass-argv-as-partial-strings
Mark Thom [Mon, 13 Apr 2020 14:17:08 +0000 (11:17 -0300)]
Merge pull request #327 from srenatus/sr/pass-argv-as-partial-strings

use partial strings for passing argv to toplevel.pl

6 years agoMerge pull request #342 from srenatus/sr/fix-cargo-install
Mark Thom [Mon, 13 Apr 2020 14:16:55 +0000 (11:16 -0300)]
Merge pull request #342 from srenatus/sr/fix-cargo-install

main: fix version reporting without git

6 years agomain: fix version reporting without git
Stephan Renatus [Mon, 13 Apr 2020 13:50:31 +0000 (15:50 +0200)]
main: fix version reporting without git

Fixes #339.

At least I hope so. I didn't come up with an idea how to test this with
little effort.

Signed-off-by: Stephan Renatus <[email protected]>
6 years agoMerge pull request #341 from triska/master
Mark Thom [Mon, 13 Apr 2020 12:13:17 +0000 (09:13 -0300)]
Merge pull request #341 from triska/master

the workaround is no longer necessary, since #336 is now corrected

6 years agothe workaround is no longer necessary, since #336 is now corrected
Markus Triska [Mon, 13 Apr 2020 09:32:06 +0000 (11:32 +0200)]
the workaround is no longer necessary, since #336 is now corrected

6 years agouse partial strings for passing argv to toplevel.pl
Stephan Renatus [Mon, 6 Apr 2020 15:35:21 +0000 (17:35 +0200)]
use partial strings for passing argv to toplevel.pl

In run_top_level: rename variables, make them partial strings

The rename is mostly cosmetic: all of argv is passed, and if argv
contains flags, goals, etc, it's more than filenames.

Using partial strings instead of atom came from discussions about how to
pass goals in the CLI, and can thus be considered preliminary work for
that.

In toplevel.pl: convert partial string to atom before passing it to
`use_module`.

Signed-off-by: Stephan Renatus <[email protected]>
6 years agouse prolog_parser 0.8.50 (#336)
Mark Thom [Mon, 13 Apr 2020 06:32:41 +0000 (00:32 -0600)]
use prolog_parser 0.8.50 (#336)

6 years agocorrect partial string copying by resetting threshold to redirected partial string...
Mark Thom [Mon, 13 Apr 2020 05:33:07 +0000 (23:33 -0600)]
correct partial string copying by resetting threshold to redirected partial string stubs to 0

6 years agouse partial_string/1 in place of the removed string/1 in bimetatrans_ruleml.pl
Mark Thom [Mon, 13 Apr 2020 04:27:53 +0000 (22:27 -0600)]
use partial_string/1 in place of the removed string/1 in bimetatrans_ruleml.pl

6 years agoupdate Cargo.lock
Mark Thom [Mon, 13 Apr 2020 04:01:59 +0000 (22:01 -0600)]
update Cargo.lock

6 years agobump version to 0.8.119
Mark Thom [Mon, 13 Apr 2020 03:59:22 +0000 (21:59 -0600)]
bump version to 0.8.119

6 years agoMerge pull request #338 from triska/master v0.8.119
Mark Thom [Sun, 12 Apr 2020 23:35:48 +0000 (20:35 -0300)]
Merge pull request #338 from triska/master

also include a newline in portray_clause/1

6 years agoalso include a newline in portray_clause/1
Markus Triska [Sun, 12 Apr 2020 23:21:32 +0000 (01:21 +0200)]
also include a newline in portray_clause/1

6 years agoMerge pull request #337 from triska/master
Mark Thom [Sun, 12 Apr 2020 23:10:21 +0000 (20:10 -0300)]
Merge pull request #337 from triska/master

ADDED: provide a rudimentary version of portray_clause/1

6 years agomake write_term_to_chars work with variable terms (#335)
Mark Thom [Mon, 13 Apr 2020 00:10:45 +0000 (18:10 -0600)]
make write_term_to_chars work with variable terms (#335)

6 years agoprovide read_term_from_chars/2 (#334)
Mark Thom [Sun, 12 Apr 2020 23:26:11 +0000 (17:26 -0600)]
provide read_term_from_chars/2 (#334)

6 years agoADDED: provide a rudimentary version of portray_clause/1
Markus Triska [Sun, 12 Apr 2020 22:12:28 +0000 (00:12 +0200)]
ADDED: provide a rudimentary version of portray_clause/1

At the moment, library(format) seems to be a fitting place.
In the eventual library organization, portray_clause/1 and
related predicates may be moved to their own dedicated library.

6 years agochange wording of QueryCannotBePostedAsFact to QueryCannotBeDefinedAsFact, remove...
Mark Thom [Sun, 12 Apr 2020 22:01:53 +0000 (16:01 -0600)]
change wording of QueryCannotBePostedAsFact to QueryCannotBeDefinedAsFact, remove old commented code in read.rs

6 years agoMerge pull request #333 from triska/master
Mark Thom [Sun, 12 Apr 2020 19:00:01 +0000 (16:00 -0300)]
Merge pull request #333 from triska/master

incorporate the latest improvements in the description of partial strings

6 years agoincorporate the latest improvements in the description of partial strings
Markus Triska [Sun, 12 Apr 2020 18:44:12 +0000 (20:44 +0200)]
incorporate the latest improvements in the description of partial strings

As of 6e4b76a3b40beb02556bd8847fe96789fa0ef012, the use of
partial_string/3 can be replaced by (=)/2 in this example.

6 years agoMerge pull request #332 from triska/master
Mark Thom [Sun, 12 Apr 2020 18:00:20 +0000 (15:00 -0300)]
Merge pull request #332 from triska/master

ENHANCED: ~w now supports compound terms, and ~q is now also available

6 years agomove write_term_to_chars/3 to src/prolog/lib/charsio.pl
Mark Thom [Sun, 12 Apr 2020 20:42:39 +0000 (14:42 -0600)]
move write_term_to_chars/3 to src/prolog/lib/charsio.pl

6 years agoadd write_term_to_chars/3 to iso_ext.pl (#288)
Mark Thom [Sun, 12 Apr 2020 20:29:28 +0000 (14:29 -0600)]
add write_term_to_chars/3 to iso_ext.pl (#288)

6 years agocorrect misleading error for modules (#300)
Mark Thom [Sun, 12 Apr 2020 18:51:59 +0000 (12:51 -0600)]
correct misleading error for modules (#300)

6 years agobe more judicious with at_cdr in print_string (#295)
Mark Thom [Sun, 12 Apr 2020 18:18:15 +0000 (12:18 -0600)]
be more judicious with at_cdr in print_string (#295)

6 years agothrow exception when attempting to post query as goal (#329)
Mark Thom [Sun, 12 Apr 2020 18:07:41 +0000 (12:07 -0600)]
throw exception when attempting to post query as goal (#329)

6 years agoENHANCED: ~w now supports compound terms, and ~q is now also available
Markus Triska [Sun, 12 Apr 2020 17:54:52 +0000 (19:54 +0200)]
ENHANCED: ~w now supports compound terms, and ~q is now also available

6 years agorecognize empty lists as partial strings (#328)
Mark Thom [Sun, 12 Apr 2020 05:08:15 +0000 (23:08 -0600)]
recognize empty lists as partial strings (#328)

6 years agoremove string/1, use a more general test for the partial_string/1 type test (#328)
Mark Thom [Sun, 12 Apr 2020 04:47:52 +0000 (22:47 -0600)]
remove string/1, use a more general test for the partial_string/1 type test (#328)

6 years agothrow error when trying to use partial lists as DCG terminal-sequence (#286)
Mark Thom [Sun, 12 Apr 2020 04:40:29 +0000 (22:40 -0600)]
throw error when trying to use partial lists as DCG terminal-sequence (#286)

6 years agoremove unnecessary use of partial_string in bimetatrans example
Mark Thom [Sun, 12 Apr 2020 04:02:17 +0000 (22:02 -0600)]
remove unnecessary use of partial_string in bimetatrans example

6 years agoMerge pull request #310 from triska/bimeta_example
Mark Thom [Sun, 12 Apr 2020 01:03:10 +0000 (22:03 -0300)]
Merge pull request #310 from triska/bimeta_example

Bimeta example

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Sun, 12 Apr 2020 03:59:25 +0000 (21:59 -0600)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agocompile special instructions for partial strings when recognized
Mark Thom [Sun, 12 Apr 2020 03:53:28 +0000 (21:53 -0600)]
compile special instructions for partial strings when recognized

6 years agodo not accept [X|Xs] patterns as DCG non-terminals (#286)
Mark Thom [Sun, 12 Apr 2020 03:52:45 +0000 (21:52 -0600)]
do not accept [X|Xs] patterns as DCG non-terminals (#286)

6 years agoMerge pull request #320 from triska/master
Mark Thom [Thu, 9 Apr 2020 15:26:31 +0000 (12:26 -0300)]
Merge pull request #320 from triska/master

add library(freeze) to make zcompare/3 work

6 years agoadd library(freeze) to make zcompare/3 work
Markus Triska [Wed, 8 Apr 2020 19:37:35 +0000 (21:37 +0200)]
add library(freeze) to make zcompare/3 work

6 years agoMerge pull request #318 from triska/master
Mark Thom [Wed, 8 Apr 2020 19:59:13 +0000 (16:59 -0300)]
Merge pull request #318 from triska/master

extend description of strings and partial strings

6 years agoextend description of strings and partial strings
Markus Triska [Wed, 8 Apr 2020 18:38:47 +0000 (20:38 +0200)]
extend description of strings and partial strings

Also, explain in more detail what this feature means to Prolog
application programmers, and the strategic direction of Scryer.

6 years agoMerge pull request #316 from triska/master
Mark Thom [Wed, 8 Apr 2020 16:18:42 +0000 (13:18 -0300)]
Merge pull request #316 from triska/master

clpz_monotonic/0 --> monotonic/0

6 years agotuples_in/2 now works
Markus Triska [Wed, 8 Apr 2020 15:49:06 +0000 (17:49 +0200)]
tuples_in/2 now works

6 years agofix list index offset bug (#314)
Mark Thom [Mon, 6 Apr 2020 22:15:36 +0000 (16:15 -0600)]
fix list index offset bug (#314)

6 years agoclpz_monotonic/0 --> monotonic/0
Markus Triska [Mon, 6 Apr 2020 21:05:57 +0000 (23:05 +0200)]
clpz_monotonic/0 --> monotonic/0

6 years agomark clp(X) item as completed, restore clp(Z) library description
Mark Thom [Mon, 6 Apr 2020 00:26:27 +0000 (21:26 -0300)]
mark clp(X) item as completed, restore clp(Z) library description

6 years agoMerge pull request #312 from triska/master
Mark Thom [Mon, 6 Apr 2020 00:14:11 +0000 (21:14 -0300)]
Merge pull request #312 from triska/master

ADDED: CLP(ℤ), Constraint Logic Programming over Integers

6 years agoconsolidate Cargo.lock
Mark Thom [Mon, 6 Apr 2020 02:34:49 +0000 (20:34 -0600)]
consolidate Cargo.lock

6 years agomerge with master
Mark Thom [Mon, 6 Apr 2020 02:33:45 +0000 (20:33 -0600)]
merge with master

6 years agouse fixnums in place of bignums where possible
Mark Thom [Mon, 6 Apr 2020 02:32:16 +0000 (20:32 -0600)]
use fixnums in place of bignums where possible

6 years agoADDED: CLP(ℤ), Constraint Logic Programming over Integers
Markus Triska [Sat, 4 Apr 2020 21:35:39 +0000 (23:35 +0200)]
ADDED: CLP(ℤ), Constraint Logic Programming over Integers

library(clpz) implements declarative integer arithmetic.

The most important predicates for reasoning about integers are:

    (#=)/2    equality
    (#\=)/2   disequality
    (#<)/2    less than
    (#>)/2    greater than
    (#=<)/2   less than or equal to
    (#>=)/2   greater than or equal to

In addition, the library provides several global constraints, such as
all_distinct/1 and global_cardinality/2, and reification predicates
that reflect the truth values of constraints into integer variables.

Enumeration predicates such label/1 and labeling/2 can be used to
search for solutions over finite domains.

Almost all Prolog programs also reason about integers. Therefore, I
recommend to add this library to your .scryerrc configuration file so
that declarative integer arithmetic is available in all your programs.

More information about CLP(ℤ):

    https://www.metalevel.at/prolog/clpz

Enjoy!

6 years agoallocate empty partial strings
Mark Thom [Sun, 5 Apr 2020 08:55:30 +0000 (02:55 -0600)]
allocate empty partial strings

6 years agouse copy_term/3 to print residual goals (#254)
Mark Thom [Sun, 5 Apr 2020 00:44:16 +0000 (18:44 -0600)]
use copy_term/3 to print residual goals (#254)

6 years agoharmonize partial strings with complete strings (#276), make Addr a copyable type
Mark Thom [Fri, 3 Apr 2020 16:22:46 +0000 (10:22 -0600)]
harmonize partial strings with complete strings (#276), make Addr a copyable type

6 years agoMerge pull request #306 from srenatus/sr/version-argument
Mark Thom [Fri, 3 Apr 2020 03:35:51 +0000 (00:35 -0300)]
Merge pull request #306 from srenatus/sr/version-argument

main: add -v/--version flag

6 years agoadd bimetatrans_ruleml.pl to examples
Mark Thom [Tue, 31 Mar 2020 02:00:08 +0000 (20:00 -0600)]
add bimetatrans_ruleml.pl to examples

6 years agointroduce and use nonterminal list//1
Markus Triska [Mon, 30 Mar 2020 23:28:16 +0000 (01:28 +0200)]
introduce and use nonterminal list//1

Example:

    ?- phrase(list(Ls), Ls0).
       Ls = [], Ls0 = []
    ;  Ls = [_A], Ls0 = [_A]
    ;  Ls = [_A,_B], Ls0 = [_A,_B]
    ;  Ls = [_A,_B,_C], Ls0 = [_A,_B,_C]
    ;  ...

6 years agoembed literal lists directly in DCGs
Markus Triska [Mon, 30 Mar 2020 23:24:15 +0000 (01:24 +0200)]
embed literal lists directly in DCGs

Example use of direct embedding:

    ?- phrase("abc", Ls0, Ls).
       Ls0 = [a,b,c|Ls].

6 years agonaming: partial_list_ws//1 --> list_ws//1
Markus Triska [Mon, 30 Mar 2020 23:23:00 +0000 (01:23 +0200)]
naming: partial_list_ws//1 --> list_ws//1

A DCG describes a list, so "list" is an appropriate name.

6 years agomain: skip args[0]
Stephan Renatus [Sat, 28 Mar 2020 08:07:42 +0000 (09:07 +0100)]
main: skip args[0]

This is a bit pedantic, it's unlikely that the executable would be
called `-v` or `--version`. However, it seems slightly more correct to
disregard argv[0] when checking flags.
Signed-off-by: Stephan Renatus <[email protected]>
6 years agomain: add -v/--version flag
Stephan Renatus [Fri, 27 Mar 2020 18:59:48 +0000 (19:59 +0100)]
main: add -v/--version flag

Added a new dependency to take care of pulling in the version from git
at build time.

Args handling is minimalistic, but there wasn't any before, so I figured
this might do for now. (Eventually, some proper `--help` and usage
output might come in handy?)

Signed-off-by: Stephan Renatus <[email protected]>
6 years agoMerge pull request #305 from srenatus/sr/typo
Mark Thom [Fri, 27 Mar 2020 17:35:17 +0000 (14:35 -0300)]
Merge pull request #305 from srenatus/sr/typo

examples/least_time.pl: fix typo

6 years agoexamples/least_time.pl: fix typo
Stephan Renatus [Fri, 27 Mar 2020 17:29:17 +0000 (18:29 +0100)]
examples/least_time.pl: fix typo

Signed-off-by: Stephan Renatus <[email protected]>
6 years agoMerge branch 'master' into develop
Mark Thom [Fri, 27 Mar 2020 04:01:25 +0000 (22:01 -0600)]
Merge branch 'master' into develop

6 years agoinitial commit for merge
Mark Thom [Fri, 27 Mar 2020 04:01:23 +0000 (22:01 -0600)]
initial commit for merge

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Fri, 20 Mar 2020 02:42:37 +0000 (20:42 -0600)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agoadd least_time example
Mark Thom [Fri, 20 Mar 2020 02:42:11 +0000 (20:42 -0600)]
add least_time example

6 years agoprovide contextual information in the return value of try_in_situ_result
Mark Thom [Fri, 20 Mar 2020 02:41:58 +0000 (20:41 -0600)]
provide contextual information in the return value of try_in_situ_result

6 years ago#278
Mark Thom [Thu, 19 Mar 2020 23:49:17 +0000 (17:49 -0600)]
#278

6 years agoMerge pull request #294 from triska/format
Mark Thom [Thu, 19 Mar 2020 23:00:40 +0000 (20:00 -0300)]
Merge pull request #294 from triska/format

ENHANCED: format_//2 now supports ~a, ~d, ~Nd, ~D, ~ND, ~Nn, ~i and ~*

6 years agoENHANCED: format_//2 now supports ~a, ~d, ~Nd, ~D, ~ND, ~Nn, ~i and ~*
Markus Triska [Thu, 19 Mar 2020 20:51:53 +0000 (21:51 +0100)]
ENHANCED: format_//2 now supports ~a, ~d, ~Nd, ~D, ~ND, ~Nn, ~i and ~*

6 years agoMerge pull request #293 from triska/documentation
Mark Thom [Tue, 17 Mar 2020 16:55:05 +0000 (13:55 -0300)]
Merge pull request #293 from triska/documentation

update toplevel interaction

6 years agoupdate toplevel interaction
Markus Triska [Tue, 17 Mar 2020 16:42:57 +0000 (17:42 +0100)]
update toplevel interaction

6 years agoremove Addr::PStrTail (#276)
Mark Thom [Tue, 17 Mar 2020 08:03:29 +0000 (02:03 -0600)]
remove Addr::PStrTail (#276)

6 years agoadd set_input/1, set_output/1
Mark Thom [Mon, 16 Mar 2020 05:29:21 +0000 (23:29 -0600)]
add set_input/1, set_output/1

6 years agocorrect contextual quoting of chars
Mark Thom [Mon, 16 Mar 2020 03:15:42 +0000 (21:15 -0600)]
correct contextual quoting of chars

6 years agoMerge pull request #289 from triska/documentation
Mark Thom [Sun, 15 Mar 2020 15:09:44 +0000 (12:09 -0300)]
Merge pull request #289 from triska/documentation

include a short overview of notable libraries

6 years agoMerge pull request #291 from triska/toplevel
Mark Thom [Sun, 15 Mar 2020 15:09:25 +0000 (12:09 -0300)]
Merge pull request #291 from triska/toplevel

Two small toplevel features

6 years agosupport 'h' to print help message during toplevel interaction
Markus Triska [Sun, 15 Mar 2020 12:24:28 +0000 (13:24 +0100)]
support 'h' to print help message during toplevel interaction

6 years agosupport 'p' to reprint answer with max depth, allowing w -> p -> w ...
Markus Triska [Sun, 15 Mar 2020 12:16:40 +0000 (13:16 +0100)]
support 'p' to reprint answer with max depth, allowing w -> p -> w ...

6 years agoinclude a short overview of notable libraries
Markus Triska [Sun, 15 Mar 2020 10:23:17 +0000 (11:23 +0100)]
include a short overview of notable libraries

6 years agouse max_depth at toplevel, allowing full printing of terms with the 'w' keypress...
Mark Thom [Sun, 15 Mar 2020 06:35:59 +0000 (00:35 -0600)]
use max_depth at toplevel, allowing full printing of terms with the 'w' keypress (#287), put disjunctions on new lines (#278)

6 years agoadd provisional max_depth option to write_term, speed printing of non-cyclic terms
Mark Thom [Sun, 15 Mar 2020 06:09:20 +0000 (00:09 -0600)]
add provisional max_depth option to write_term, speed printing of non-cyclic terms

6 years agooutput strings more efficiently
Mark Thom [Sun, 15 Mar 2020 00:17:11 +0000 (18:17 -0600)]
output strings more efficiently

6 years agodon't emit overwriting warnings for term_expansion/2 or goal_expansion/2
Mark Thom [Sat, 14 Mar 2020 20:18:01 +0000 (14:18 -0600)]
don't emit overwriting warnings for term_expansion/2 or goal_expansion/2

6 years agocorrect DCG descriptions of lists (#286)
Mark Thom [Sat, 14 Mar 2020 20:14:26 +0000 (14:14 -0600)]
correct DCG descriptions of lists (#286)

6 years agoGive new answer variables readable names (#279)
Mark Thom [Sat, 14 Mar 2020 09:04:11 +0000 (03:04 -0600)]
Give new answer variables readable names (#279)

6 years agoprint strings as strings only in the term expander
Mark Thom [Sat, 14 Mar 2020 03:05:25 +0000 (21:05 -0600)]
print strings as strings only in the term expander