]> Repositorios git - scryer-prolog.git/log
scryer-prolog.git
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 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

6 years agocorrect answer substitution order, equating variables to themselves (#326)
Mark Thom [Wed, 29 Apr 2020 07:45:42 +0000 (01:45 -0600)]
correct answer substitution order, equating variables to themselves (#326)

6 years agoImplemented predicate mediants/2 with Stern-Brocot tree
notoria [Wed, 29 Apr 2020 00:44:13 +0000 (02:44 +0200)]
Implemented predicate mediants/2 with Stern-Brocot tree

6 years agocheck that lower bound on term expansion drain is below the len of the term expansion...
Mark Thom [Wed, 29 Apr 2020 01:22:20 +0000 (19:22 -0600)]
check that lower bound on term expansion drain is below the len of the term expansion vector, queue (#416)

6 years agoprint rational numbers using the rdiv operator when defined (#413)
Mark Thom [Wed, 29 Apr 2020 00:03:04 +0000 (18:03 -0600)]
print rational numbers using the rdiv operator when defined (#413)

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Tue, 28 Apr 2020 23:20:25 +0000 (17:20 -0600)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agodo length check in PartialString::range_from (#412)
Mark Thom [Tue, 28 Apr 2020 23:20:14 +0000 (17:20 -0600)]
do length check in PartialString::range_from (#412)

6 years agoMerge pull request #414 from triska/master
Mark Thom [Tue, 28 Apr 2020 19:54:39 +0000 (16:54 -0300)]
Merge pull request #414 from triska/master

Small corrections, additions and improvements

6 years agomention portray_clause/1 and listing/1
Markus Triska [Tue, 28 Apr 2020 16:27:46 +0000 (18:27 +0200)]
mention portray_clause/1 and listing/1

6 years agomention backtrackable and non-backtrackable global variables
Markus Triska [Tue, 28 Apr 2020 16:22:18 +0000 (18:22 +0200)]
mention backtrackable and non-backtrackable global variables

6 years agouse new nth0/3 from library(lists)
Markus Triska [Tue, 28 Apr 2020 15:52:29 +0000 (17:52 +0200)]
use new nth0/3 from library(lists)

6 years agouse singleton variable, correct a mistake in maplist/8
Markus Triska [Tue, 28 Apr 2020 15:51:37 +0000 (17:51 +0200)]
use singleton variable, correct a mistake in maplist/8

6 years agoADDED: nth0/3, relating indices to list elements
Markus Triska [Tue, 28 Apr 2020 15:42:12 +0000 (17:42 +0200)]
ADDED: nth0/3, relating indices to list elements

6 years agosmall typographic corrections
Markus Triska [Tue, 28 Apr 2020 15:35:53 +0000 (17:35 +0200)]
small typographic corrections

6 years agouse new predicates from library(error) to throw type and domain errors
Markus Triska [Tue, 28 Apr 2020 15:34:56 +0000 (17:34 +0200)]
use new predicates from library(error) to throw type and domain errors

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Tue, 28 Apr 2020 07:41:11 +0000 (01:41 -0600)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agoerase unnecessary stub from block of FileToChars
Mark Thom [Tue, 28 Apr 2020 07:40:59 +0000 (01:40 -0600)]
erase unnecessary stub from block of FileToChars

6 years agodon't append lists of attributes when binding attributed variables (#353)
Mark Thom [Tue, 28 Apr 2020 07:40:11 +0000 (01:40 -0600)]
don't append lists of attributes when binding attributed variables (#353)

6 years agomodify domain.pl example (#347)
Mark Thom [Tue, 28 Apr 2020 07:39:34 +0000 (01:39 -0600)]
modify domain.pl example (#347)

6 years agoMerge pull request #409 from triska/clp
Mark Thom [Mon, 27 Apr 2020 18:05:15 +0000 (15:05 -0300)]
Merge pull request #409 from triska/clp

add more information about Constraint Logic Programming (CLP)

6 years ago`if_` --> `if_/3`
Markus Triska [Mon, 27 Apr 2020 17:53:25 +0000 (19:53 +0200)]
`if_` --> `if_/3`

6 years agoadd more information about Constraint Logic Programming (CLP)
Markus Triska [Mon, 27 Apr 2020 17:48:31 +0000 (19:48 +0200)]
add more information about Constraint Logic Programming (CLP)

6 years agoMerge pull request #408 from triska/master
Mark Thom [Mon, 27 Apr 2020 17:35:17 +0000 (14:35 -0300)]
Merge pull request #408 from triska/master

Introduce and use new predicates for throwing ISO errors

6 years agoinclude the new library(random) in the overview
Markus Triska [Mon, 27 Apr 2020 15:56:46 +0000 (17:56 +0200)]
include the new library(random) in the overview

Many thanks to @notoria for this contribution!

6 years agouse new predicates from library(error)
Markus Triska [Mon, 27 Apr 2020 15:42:05 +0000 (17:42 +0200)]
use new predicates from library(error)

6 years agoADDED: library(error): instantiation_error/1, domain_error/3, type_error/3
Markus Triska [Mon, 27 Apr 2020 15:34:47 +0000 (17:34 +0200)]
ADDED: library(error): instantiation_error/1, domain_error/3, type_error/3

These predicates simplify throwing ISO errors.

6 years agoinclude usage advice about probabilistic predicates
Markus Triska [Mon, 27 Apr 2020 15:32:06 +0000 (17:32 +0200)]
include usage advice about probabilistic predicates

6 years agoMerge pull request #406 from notoria/random
Mark Thom [Mon, 27 Apr 2020 12:14:01 +0000 (09:14 -0300)]
Merge pull request #406 from notoria/random

Created the library random and updated library clpb

6 years agopublish bimetatrans_ruleml_tests, move both files to own directory
Mark Thom [Mon, 27 Apr 2020 02:32:16 +0000 (20:32 -0600)]
publish bimetatrans_ruleml_tests, move both files to own directory

6 years agoMerge branch 'master' of https://github.com/mthom/rusty-wam
Mark Thom [Mon, 27 Apr 2020 02:15:27 +0000 (20:15 -0600)]
Merge branch 'master' of https://github.com/mthom/rusty-wam

6 years agoAdded predicate random_integer and updated clpb
notoria [Sun, 26 Apr 2020 23:52:19 +0000 (01:52 +0200)]
Added predicate random_integer and updated clpb

6 years agoCreated the library random and moved some predicates from iso_ext
notoria [Sun, 26 Apr 2020 21:33:10 +0000 (23:33 +0200)]
Created the library random and moved some predicates from iso_ext

6 years agoMerge pull request #405 from triska/master
Mark Thom [Sun, 26 Apr 2020 20:20:58 +0000 (17:20 -0300)]
Merge pull request #405 from triska/master

Two small documentation additions

6 years agoadd library(cont) to the list
Markus Triska [Sun, 26 Apr 2020 19:38:18 +0000 (21:38 +0200)]
add library(cont) to the list

6 years agoadd more information about tabling
Markus Triska [Sun, 26 Apr 2020 19:37:24 +0000 (21:37 +0200)]
add more information about tabling

6 years agoMerge pull request #402 from notoria/pio
Mark Thom [Sun, 26 Apr 2020 15:17:09 +0000 (12:17 -0300)]
Merge pull request #402 from notoria/pio

Small patch for library pio

6 years agoSmall patch for library pio
notoria [Sun, 26 Apr 2020 12:54:20 +0000 (14:54 +0200)]
Small patch for library pio

6 years agoMerge pull request #399 from notoria/debug
Mark Thom [Sun, 26 Apr 2020 02:35:27 +0000 (23:35 -0300)]
Merge pull request #399 from notoria/debug

Implemented the Debug trait for all data structures

6 years agoImplemented the Debug trait for all data structures
notoria [Sun, 26 Apr 2020 00:18:45 +0000 (02:18 +0200)]
Implemented the Debug trait for all data structures

6 years agoMerge pull request #398 from triska/master
Mark Thom [Sat, 25 Apr 2020 20:20:24 +0000 (17:20 -0300)]
Merge pull request #398 from triska/master

Several smaller improvements

6 years agouse proper module name in bimetatrans_ruleml
Mark Thom [Sat, 25 Apr 2020 18:55:36 +0000 (12:55 -0600)]
use proper module name in bimetatrans_ruleml

6 years agoinclude library(pio) and library(charsio) in the description
Markus Triska [Sat, 25 Apr 2020 18:08:56 +0000 (20:08 +0200)]
include library(pio) and library(charsio) in the description

6 years agoupdate toplevel interaction
Markus Triska [Sat, 25 Apr 2020 18:01:04 +0000 (20:01 +0200)]
update toplevel interaction

6 years agoENHANCED: Throw domain errors in char_type/2 for wrong types
Markus Triska [Sat, 25 Apr 2020 17:59:12 +0000 (19:59 +0200)]
ENHANCED: Throw domain errors in char_type/2 for wrong types

This is especially important because a few of our names diverge from
ctype(3), and we better inform programmers when the type they are
using is not available at all.

6 years agouse an anonymous variable
Markus Triska [Sat, 25 Apr 2020 17:59:38 +0000 (19:59 +0200)]
use an anonymous variable

6 years agoMerge pull request #396 from notoria/phrase_from_file
Mark Thom [Sat, 25 Apr 2020 17:17:24 +0000 (14:17 -0300)]
Merge pull request #396 from notoria/phrase_from_file

Implemented phrase_from_file/2 and /2

6 years agoNo trimming of the buffer
notoria [Sat, 25 Apr 2020 16:20:20 +0000 (18:20 +0200)]
No trimming of the buffer

6 years agoImplemented phrase_from_file/2 and /2
notoria [Sat, 25 Apr 2020 16:00:16 +0000 (18:00 +0200)]
Implemented phrase_from_file/2 and /2

6 years agoMerge pull request #391 from notoria/msb_lsb2
Mark Thom [Sat, 25 Apr 2020 15:58:03 +0000 (12:58 -0300)]
Merge pull request #391 from notoria/msb_lsb2

Implemented lsb/2 and msb/2

6 years agoImplemented lsb/2 and msb/2
notoria [Fri, 24 Apr 2020 20:47:24 +0000 (22:47 +0200)]
Implemented lsb/2 and msb/2

6 years agoMerge pull request #380 from notoria/char_type
Mark Thom [Fri, 24 Apr 2020 00:57:03 +0000 (21:57 -0300)]
Merge pull request #380 from notoria/char_type

Implementation of the predicate char_type for a subset

6 years agoImplementation of the predicate char_type for a subset
notoria [Wed, 22 Apr 2020 18:44:10 +0000 (20:44 +0200)]
Implementation of the predicate char_type for a subset

6 years agoDraft of an implementation of char_type
notoria [Tue, 21 Apr 2020 22:46:54 +0000 (00:46 +0200)]
Draft of an implementation of char_type

6 years agoMerge pull request #381 from triska/master
Mark Thom [Wed, 22 Apr 2020 00:16:40 +0000 (21:16 -0300)]
Merge pull request #381 from triska/master

ADDED: library(format) now provides a rudimentary version of listing/1

6 years agoADDED: library(format) now provides a rudimentary version of listing/1
Markus Triska [Tue, 21 Apr 2020 23:53:20 +0000 (01:53 +0200)]
ADDED: library(format) now provides a rudimentary version of listing/1

Example:

    :- dynamic(a/1).

    a(X) :- X = true, b(X).

Yielding:

    ?- listing(a/1).
    %@ a(A) :-
    %@    A=true,
    %@    b(A).
    %@    true.

listing/1 only works for predicates and DCGs that are declared dynamic/1.

6 years agoMerge pull request #377 from triska/master
Mark Thom [Mon, 20 Apr 2020 22:16:12 +0000 (19:16 -0300)]
Merge pull request #377 from triska/master

portray_clause/1 now correctly tracks variable names (#376)

6 years agoportray_clause/1 now correctly tracks variable names (#376)
Markus Triska [Mon, 20 Apr 2020 20:53:15 +0000 (22:53 +0200)]
portray_clause/1 now correctly tracks variable names (#376)

Example:

    ?- portray_clause((A :- B)).
    %@ A :-
    %@    B.
    %@    true
    %@ ;  ...

Also, change the indentation from 8 to 3 at the express request of @UWN.

6 years agoMerge pull request #375 from notoria/sleep
Mark Thom [Mon, 20 Apr 2020 14:52:25 +0000 (11:52 -0300)]
Merge pull request #375 from notoria/sleep

Changed the error being thrown by sleep/1

6 years agospeed unification of pairs of partial strings
Mark Thom [Mon, 20 Apr 2020 17:37:32 +0000 (11:37 -0600)]
speed unification of pairs of partial strings

6 years agochange CPU_now to CpuNow
Mark Thom [Mon, 20 Apr 2020 16:37:00 +0000 (10:37 -0600)]
change CPU_now to CpuNow

6 years agocheck for num in comparisons, bump num-rug-adapter to 0.1.3
Mark Thom [Mon, 20 Apr 2020 16:35:30 +0000 (10:35 -0600)]
check for num in comparisons, bump num-rug-adapter to 0.1.3

6 years agoCorrected the error being thrown by sleep/1
notoria [Mon, 20 Apr 2020 14:34:56 +0000 (16:34 +0200)]
Corrected the error being thrown by sleep/1

6 years agoChanged the error being thrown by sleep/1
notoria [Mon, 20 Apr 2020 09:27:28 +0000 (11:27 +0200)]
Changed the error being thrown by sleep/1

6 years agoMerge pull request #371 from notoria/sleep
Mark Thom [Mon, 20 Apr 2020 00:41:33 +0000 (21:41 -0300)]
Merge pull request #371 from notoria/sleep

Added the sleep predicate

6 years agodo casts between different arithmetic types for comparison and equality (#372)
Mark Thom [Mon, 20 Apr 2020 03:34:59 +0000 (21:34 -0600)]
do casts between different arithmetic types for comparison and equality (#372)

6 years agospeed comparisons of partial strings
Mark Thom [Mon, 20 Apr 2020 02:58:53 +0000 (20:58 -0600)]
speed comparisons of partial strings