]> Repositorios git - scryer-prolog.git/log
scryer-prolog.git
6 years agoMerge pull request #475 from notoria/debug
Mark Thom [Sat, 9 May 2020 21:35:16 +0000 (18:35 -0300)]
Merge pull request #475 from notoria/debug

Debug & warnings

6 years agoRemoved the warnings
notoria [Sat, 9 May 2020 20:30:39 +0000 (22:30 +0200)]
Removed the warnings

6 years agoImplemented Debug for the new data structures
notoria [Sat, 9 May 2020 20:28:32 +0000 (22:28 +0200)]
Implemented Debug for the new data structures

6 years agoMerge pull request #474 from triska/radix
Mark Thom [Sat, 9 May 2020 18:09:14 +0000 (15:09 -0300)]
Merge pull request #474 from triska/radix

ADDED: ~Nr and ~NR are now available for radix conversions

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Sat, 9 May 2020 21:05:09 +0000 (15:05 -0600)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agohalt on Ctrl-D in toplevel (#473)
Mark Thom [Sat, 9 May 2020 21:04:30 +0000 (15:04 -0600)]
halt on Ctrl-D in toplevel (#473)

6 years agoMerge branch 'sockets-develop'
Mark Thom [Sat, 9 May 2020 20:26:29 +0000 (14:26 -0600)]
Merge branch 'sockets-develop'

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Sat, 9 May 2020 20:26:22 +0000 (14:26 -0600)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agoupdate README.md
Mark Thom [Sat, 9 May 2020 20:26:08 +0000 (14:26 -0600)]
update README.md

6 years agoadd set_stream_position/2
Mark Thom [Sat, 9 May 2020 20:20:32 +0000 (14:20 -0600)]
add set_stream_position/2

6 years agoMerge pull request #471 from triska/master
Mark Thom [Sat, 9 May 2020 17:33:58 +0000 (14:33 -0300)]
Merge pull request #471 from triska/master

ADDED: Initial version of library(crypto).

6 years agoADDED: ~Nr and ~NR are now available for radix conversions
Markus Triska [Sat, 9 May 2020 17:19:03 +0000 (19:19 +0200)]
ADDED: ~Nr and ~NR are now available for radix conversions

6 years agoadd at_end_of_stream/{0,1}
Mark Thom [Sat, 9 May 2020 07:38:23 +0000 (01:38 -0600)]
add at_end_of_stream/{0,1}

6 years agocarry past_end_of_stream in WrappedStreamInstance
Mark Thom [Sat, 9 May 2020 07:34:56 +0000 (01:34 -0600)]
carry past_end_of_stream in WrappedStreamInstance

6 years agoadd stream_property/2
Mark Thom [Sat, 9 May 2020 06:56:17 +0000 (00:56 -0600)]
add stream_property/2

6 years agoADDED: Initial version of library(crypto).
Markus Triska [Fri, 8 May 2020 19:58:56 +0000 (21:58 +0200)]
ADDED: Initial version of library(crypto).

6 years agoMerge pull request #468 from notoria/cont
Mark Thom [Thu, 7 May 2020 17:26:34 +0000 (14:26 -0300)]
Merge pull request #468 from notoria/cont

Enhanced shift/1

6 years agoEnhanced shift/1
notoria [Thu, 7 May 2020 16:51:49 +0000 (18:51 +0200)]
Enhanced shift/1

6 years agoadd peek_char/{1,2}, peek_byte/{1,2}, peek_code/{1,2}
Mark Thom [Wed, 6 May 2020 07:05:03 +0000 (01:05 -0600)]
add peek_char/{1,2}, peek_byte/{1,2}, peek_code/{1,2}

6 years agoadd sockets library, use new type_error function from sockets system calls
Mark Thom [Wed, 6 May 2020 04:57:06 +0000 (22:57 -0600)]
add sockets library, use new type_error function from sockets system calls

6 years agoadd put_code/{1,2}, get_code/{1,2}, improve get_* predicates
Mark Thom [Wed, 6 May 2020 04:42:35 +0000 (22:42 -0600)]
add put_code/{1,2}, get_code/{1,2}, improve get_* predicates

6 years agoadd put_byte/{1,2}, put_char/{1,2}
Mark Thom [Tue, 5 May 2020 23:42:18 +0000 (17:42 -0600)]
add put_byte/{1,2}, put_char/{1,2}

6 years agocleanup on reading predicates, add get_char/{1,2}
Mark Thom [Tue, 5 May 2020 22:54:40 +0000 (16:54 -0600)]
cleanup on reading predicates, add get_char/{1,2}

6 years agoclean up stream error handling, add get_byte/{1,2}
Mark Thom [Tue, 5 May 2020 22:09:17 +0000 (16:09 -0600)]
clean up stream error handling, add get_byte/{1,2}

6 years agochange EOFCode eof_action from end_of_stream to end_of_file, add echo_server.pl example
Mark Thom [Tue, 5 May 2020 20:15:16 +0000 (14:15 -0600)]
change EOFCode eof_action from end_of_stream to end_of_file, add echo_server.pl example

6 years agoadd flush_output/{0,1}, past_end_of_stream
Mark Thom [Tue, 5 May 2020 20:10:49 +0000 (14:10 -0600)]
add flush_output/{0,1}, past_end_of_stream

6 years agoMerge pull request #460 from notoria/get_single_char
Mark Thom [Tue, 5 May 2020 17:10:24 +0000 (14:10 -0300)]
Merge pull request #460 from notoria/get_single_char

Fixed ctrl-c issue with get_single_char/1

6 years agoFixed ctrl-c issue with get_single_char/1
notoria [Tue, 5 May 2020 16:30:42 +0000 (18:30 +0200)]
Fixed ctrl-c issue with get_single_char/1

6 years agoadd close/{1,2}, better EOF action handling in read_term
Mark Thom [Tue, 5 May 2020 06:38:21 +0000 (00:38 -0600)]
add close/{1,2}, better EOF action handling in read_term

6 years agoadapt write_term family, add handling for EOF actions.
Mark Thom [Tue, 5 May 2020 03:17:06 +0000 (21:17 -0600)]
adapt write_term family, add handling for EOF actions.

6 years agoadd open/3, write_term/3
Mark Thom [Mon, 4 May 2020 20:50:26 +0000 (14:50 -0600)]
add open/3, write_term/3

6 years agoMerge pull request #453 from triska/master
Mark Thom [Mon, 4 May 2020 17:32:26 +0000 (14:32 -0300)]
Merge pull request #453 from triska/master

disable goal expansion until #445 is resolved

6 years agotest
Mark Thom [Mon, 4 May 2020 17:18:13 +0000 (11:18 -0600)]
test

6 years agodisable goal expansion until #445 is resolved
Markus Triska [Mon, 4 May 2020 16:55:41 +0000 (18:55 +0200)]
disable goal expansion until #445 is resolved

6 years agomerge
Mark Thom [Mon, 4 May 2020 05:36:26 +0000 (23:36 -0600)]
merge

6 years agoimprove answer substitutions at top-level
Mark Thom [Mon, 4 May 2020 05:35:21 +0000 (23:35 -0600)]
improve answer substitutions at top-level

6 years agoMerge branch 'master' into sockets-develop
Mark Thom [Mon, 4 May 2020 05:09:13 +0000 (23:09 -0600)]
Merge branch 'master' into sockets-develop

6 years agoimprove answer substitutions at top-level
Mark Thom [Mon, 4 May 2020 05:08:53 +0000 (23:08 -0600)]
improve answer substitutions at top-level

6 years agomerge with master
Mark Thom [Mon, 4 May 2020 00:49:15 +0000 (18:49 -0600)]
merge with master

6 years agomake term{_attributed_}variables/2 order {attributed} variables by left-to-right...
Mark Thom [Mon, 4 May 2020 00:43:23 +0000 (18:43 -0600)]
make term{_attributed_}variables/2 order {attributed} variables by left-to-right occurrence

6 years agoMerge pull request #450 from triska/master
Mark Thom [Sun, 3 May 2020 23:34:47 +0000 (20:34 -0300)]
Merge pull request #450 from triska/master

do not project queue/2 attributes to residual goals

6 years agouse select/3 in gather_equations for detecting whether variables are distinct.
Mark Thom [Mon, 4 May 2020 02:31:12 +0000 (20:31 -0600)]
use select/3 in gather_equations for detecting whether variables are distinct.

6 years agouse copy_term/3 as source of attribute goals
Mark Thom [Mon, 4 May 2020 01:34:18 +0000 (19:34 -0600)]
use copy_term/3 as source of attribute goals

6 years agorestore previous focus upon character match failure in compare_pstr_to_string (#441)
Mark Thom [Sun, 3 May 2020 23:03:59 +0000 (17:03 -0600)]
restore previous focus upon character match failure in compare_pstr_to_string (#441)

6 years agodo not project queue/2 attributes to residual goals
Markus Triska [Sun, 3 May 2020 22:54:43 +0000 (00:54 +0200)]
do not project queue/2 attributes to residual goals

6 years agoMerge pull request #449 from notoria/read
Mark Thom [Sun, 3 May 2020 18:27:46 +0000 (15:27 -0300)]
Merge pull request #449 from notoria/read

Completed read/1, ctrl-d is end_of_file

6 years agoversion bump for prolog_parser
Mark Thom [Sun, 3 May 2020 19:46:34 +0000 (13:46 -0600)]
version bump for prolog_parser

6 years agoCompleted read/1, ctrl-d is end_of_file
notoria [Sun, 3 May 2020 17:54:17 +0000 (19:54 +0200)]
Completed read/1, ctrl-d is end_of_file

6 years agouse complete strings in FileToChars (#430)
Mark Thom [Sun, 3 May 2020 08:54:49 +0000 (02:54 -0600)]
use complete strings in FileToChars (#430)

6 years agoProject goals of query variables (#362)
Mark Thom [Sun, 3 May 2020 04:27:32 +0000 (22:27 -0600)]
Project goals of query variables (#362)

6 years agowrap support code in modules
Mark Thom [Sun, 3 May 2020 03:26:36 +0000 (21:26 -0600)]
wrap support code in modules

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Sun, 3 May 2020 00:47:53 +0000 (18:47 -0600)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agoadd term_attributed_variables/2 (#422)
Mark Thom [Sun, 3 May 2020 00:46:29 +0000 (18:46 -0600)]
add term_attributed_variables/2 (#422)

6 years agoMerge pull request #443 from notoria/arithmetic
Mark Thom [Sat, 2 May 2020 15:00:44 +0000 (12:00 -0300)]
Merge pull request #443 from notoria/arithmetic

Implemented expmod/4

6 years agoImplemented expmod/4
notoria [Sat, 2 May 2020 01:36:01 +0000 (03:36 +0200)]
Implemented expmod/4

6 years agoremove now unnecessary dependencies, correct ordering of ! in (;)/3
Mark Thom [Sat, 2 May 2020 02:38:44 +0000 (23:38 -0300)]
remove now unnecessary dependencies, correct ordering of ! in (;)/3

6 years agoMerge pull request #440 from notoria/arithmetic
Mark Thom [Sat, 2 May 2020 00:48:55 +0000 (21:48 -0300)]
Merge pull request #440 from notoria/arithmetic

Enhanced number_to_rational/2 and number_to_rational/3

6 years agoMerge pull request #439 from notoria/cli2
Mark Thom [Sat, 2 May 2020 00:45:03 +0000 (21:45 -0300)]
Merge pull request #439 from notoria/cli2

Enhanced command line?

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Sat, 2 May 2020 03:40:45 +0000 (21:40 -0600)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agocut after compound check in (;)/2 only after semicolon_compound_selector succeeds
Mark Thom [Sat, 2 May 2020 03:40:36 +0000 (21:40 -0600)]
cut after compound check in (;)/2 only after semicolon_compound_selector succeeds

6 years agoinsert cuts where needed into (;)/3 (#434)
Mark Thom [Sat, 2 May 2020 00:52:01 +0000 (18:52 -0600)]
insert cuts where needed into (;)/3 (#434)

6 years agoEnhanced number_to_rational/2 and number_to_rational/3
notoria [Sat, 2 May 2020 00:36:23 +0000 (02:36 +0200)]
Enhanced number_to_rational/2 and number_to_rational/3

6 years agoAdded $scryer_prolog_version/1
notoria [Fri, 1 May 2020 23:52:53 +0000 (01:52 +0200)]
Added $scryer_prolog_version/1

6 years agoEnhanced command line
notoria [Fri, 1 May 2020 23:02:06 +0000 (01:02 +0200)]
Enhanced command line

6 years agoMerge pull request #437 from triska/master
Mark Thom [Fri, 1 May 2020 22:08:45 +0000 (19:08 -0300)]
Merge pull request #437 from triska/master

use ℤ

6 years agouse ℤ
Markus Triska [Fri, 1 May 2020 22:06:16 +0000 (00:06 +0200)]
use ℤ

This is now possible thanks to the great contribution by @matt2xu.

Many thanks!

6 years agoMerge pull request #436 from mthom/revert-419-cli
Mark Thom [Fri, 1 May 2020 21:43:37 +0000 (18:43 -0300)]
Merge pull request #436 from mthom/revert-419-cli

Revert "Enhanced command line"

6 years agoRevert "Enhanced command line" revert-419-cli origin/revert-419-cli
Mark Thom [Fri, 1 May 2020 21:43:20 +0000 (15:43 -0600)]
Revert "Enhanced command line"

6 years agoMerge pull request #419 from notoria/cli
Mark Thom [Fri, 1 May 2020 21:32:02 +0000 (18:32 -0300)]
Merge pull request #419 from notoria/cli

Enhanced command line

6 years agoaccept any and all characters in comment chars
Mark Thom [Fri, 1 May 2020 22:39:27 +0000 (16:39 -0600)]
accept any and all characters in comment chars

6 years agoEnhanced command line #2
notoria [Fri, 1 May 2020 16:52:41 +0000 (18:52 +0200)]
Enhanced command line #2

6 years agoMerge pull request #432 from triska/master
Mark Thom [Fri, 1 May 2020 16:41:43 +0000 (13:41 -0300)]
Merge pull request #432 from triska/master

correct overeager CLP(ℤ) goal expansion

6 years agocorrect failing character match in compare_pstr_to_string (#397)
Mark Thom [Fri, 1 May 2020 16:29:10 +0000 (10:29 -0600)]
correct failing character match in compare_pstr_to_string (#397)

6 years agocorrect overeager CLP(ℤ) goal expansion
Markus Triska [Fri, 1 May 2020 16:29:00 +0000 (18:29 +0200)]
correct overeager CLP(ℤ) goal expansion

For instance, consider:

    t(X) :- X #= 1.

We *cannot* expand this to:

    ?- listing(t/1).
    t(A) :-
       (  integer(A) ->
          A=:=A
       ;  (  var(A) ->
             true
          ;  true,
             clpz:clpz_equal(A,A)
          )
       ).

Also, a new binding *must not* be dragged outside of disjunctions,
since the code may look for example like this:

        i(X) :-
            (   X #= 3
            ;   X #= 4
            ).

This commit fixes such issues, and still rewrites CLP(ℤ) expressions
as far as possible already at compilation time.

For example:

    n(X) :- X #= 1+3.

This is now compiled to (note that 1+3 is evaluated to 4):

    ?- listing(n/1).
    n(A) :-
       (  integer(A) ->
          A=:=4
       ;  (  var(A) ->
             A=4
          ;  B=4,
             clpz:clpz_equal(A,B)
          )
       ).

Ideally, it should be compiled to:

    n(4).

6 years agoEnhanced version
notoria [Fri, 1 May 2020 14:46:31 +0000 (16:46 +0200)]
Enhanced version

6 years agoEnhanced command line
notoria [Fri, 1 May 2020 13:57:50 +0000 (15:57 +0200)]
Enhanced command line

6 years agomap single character atoms down to characters in constant_index
Mark Thom [Fri, 1 May 2020 07:34:09 +0000 (01:34 -0600)]
map single character atoms down to characters in constant_index

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Fri, 1 May 2020 00:20:51 +0000 (18:20 -0600)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agouse slightly better names in indexing functions
Mark Thom [Fri, 1 May 2020 00:20:42 +0000 (18:20 -0600)]
use slightly better names in indexing functions

6 years agoonly add expanded goals to dynamic clause code (#416)
Mark Thom [Thu, 30 Apr 2020 23:53:26 +0000 (17:53 -0600)]
only add expanded goals to dynamic clause code (#416)

6 years agocorrect queue_len += queue_len; to queue_len += queue.len(); (#416)
Mark Thom [Thu, 30 Apr 2020 21:30:55 +0000 (15:30 -0600)]
correct queue_len += queue_len; to queue_len += queue.len(); (#416)

6 years agoMerge pull request #425 from triska/master
Mark Thom [Thu, 30 Apr 2020 21:20:27 +0000 (18:20 -0300)]
Merge pull request #425 from triska/master

enable goal expansion for CLP(ℤ) goals

6 years agoenable goal expansion for CLP(ℤ) goals
Markus Triska [Thu, 30 Apr 2020 21:09:15 +0000 (23:09 +0200)]
enable goal expansion for CLP(ℤ) goals

Example:

    integer_successor(I0, I) :- I #= I0 + 1.

Yielding:

    ?- listing(integer_successor/2).
    integer_successor(A,B) :-
       (  integer(B) ->
          (  integer(A) ->
             B=:=A+1
          ;  C is B,
             clpz:clpz_equal(C,A+1)
          )
       ;  (  integer(A) ->
             (  var(B) ->
                B is A+1
             ;  C is A+1,
                clpz:clpz_equal(B,C)
             )
          ;  clpz:clpz_equal(B,A+1)
          )
       ).

Thus, fast low-level arithmetic is used whenever possible.

6 years agoindex atoms with operators against the same atom with no operator (#387)
Mark Thom [Thu, 30 Apr 2020 21:09:05 +0000 (15:09 -0600)]
index atoms with operators against the same atom with no operator (#387)

6 years agoMerge pull request #420 from triska/master
Mark Thom [Thu, 30 Apr 2020 16:32:21 +0000 (13:32 -0300)]
Merge pull request #420 from triska/master

correct verify_attributes/3 for variables that have no CLP(ℤ) attribute attached (#373)

6 years agocorrect verify_attributes/3 for variables that have no CLP(ℤ) attribute attached...
Markus Triska [Thu, 30 Apr 2020 16:10:09 +0000 (18:10 +0200)]
correct verify_attributes/3 for variables that have no CLP(ℤ) attribute attached (#373)

Example:

    ?- freeze(B, queen_value_truth(C,N,B)), Q #= N #<==> B.
       clpz:(Q#=N#<==>B), clpz:(B in 0..1), freeze:freeze(B,queen_value_truth(C,N,B))
    ;  false.

6 years agofix user:goal_expansion
Mark Thom [Thu, 30 Apr 2020 15:28:11 +0000 (09:28 -0600)]
fix user:goal_expansion

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

6 years agofix 'drain lower bound was too large', store user-level expansions to modules (#416)
Mark Thom [Thu, 30 Apr 2020 06:01:00 +0000 (00:01 -0600)]
fix 'drain lower bound was too large', store user-level expansions to modules (#416)

6 years agoMerge pull request #418 from notoria/mediants
Mark Thom [Wed, 29 Apr 2020 21:53:00 +0000 (18:53 -0300)]
Merge pull request #418 from notoria/mediants

Documentation for arithmetic.pl

6 years agoMerge pull request #4 from triska/mediants
notoria [Wed, 29 Apr 2020 21:48:07 +0000 (23:48 +0200)]
Merge pull request #4 from triska/mediants

include library(arithmetic) in the overview

6 years agoMerge branch 'mediants' into mediants
notoria [Wed, 29 Apr 2020 21:47:05 +0000 (23:47 +0200)]
Merge branch 'mediants' into mediants

6 years agoadd ordsets.pl to README
Mark Thom [Wed, 29 Apr 2020 21:42:17 +0000 (18:42 -0300)]
add ordsets.pl to README

6 years agoMerge pull request #417 from notoria/mediants
Mark Thom [Wed, 29 Apr 2020 21:33:35 +0000 (18:33 -0300)]
Merge pull request #417 from notoria/mediants

Implemented predicate mediants/2 with Stern-Brocot tree

6 years agoAdd rational_numerator_denominator/3, number_to_rational/2 and renamed stern_brocot...
notoria [Wed, 29 Apr 2020 16:27:34 +0000 (18:27 +0200)]
Add rational_numerator_denominator/3, number_to_rational/2 and renamed stern_brocot/3 to number_to_rational/3

6 years agoinclude library(arithmetic) in the overview
Markus Triska [Wed, 29 Apr 2020 20:02:51 +0000 (22:02 +0200)]
include library(arithmetic) in the overview

Many thanks to @notoria for these very useful predicates!

6 years agoAdd rational_numerator_denominator/3, number_to_rational/2 and renamed stern_brocot...
notoria [Wed, 29 Apr 2020 16:27:34 +0000 (18:27 +0200)]
Add rational_numerator_denominator/3, number_to_rational/2 and renamed stern_brocot/3 to number_to_rational/3

6 years agouse select to filter variable lists when printing equations of two variables
Mark Thom [Wed, 29 Apr 2020 14:05:10 +0000 (11:05 -0300)]
use select to filter variable lists when printing equations of two variables

6 years agoselect variable names in write_eq based on whether RHS is a variable (#326)
Mark Thom [Wed, 29 Apr 2020 13:56:17 +0000 (10:56 -0300)]
select variable names in write_eq based on whether RHS is a variable (#326)

6 years agoRemoved predicate mediants/2 and added stern_brocot/3
notoria [Wed, 29 Apr 2020 12:18:20 +0000 (14:18 +0200)]
Removed predicate mediants/2 and added stern_brocot/3