unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* guarding functional datastructures in guile log
@ 2014-01-08 22:03 Stefan Israelsson Tampe
  2014-01-08 22:05 ` Stefan Israelsson Tampe
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Israelsson Tampe @ 2014-01-08 22:03 UTC (permalink / raw)
  To: guile-devel, guile-user@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1790 bytes --]

Christmas holliday's has ended and a good progress has been made, mostly
coding an
iso prolog to be used with guile and guile-log. I use two test repos and
most of the
tests are passing. I will not head for passing all tests because I do not
want to reuse
the number tower of guile as well as the module code base.

But I would like to produce some code for people to peek at and actually
have
some scheme code to show, and not a bunch of words that doesn't make sense.

So here is the issue. It would be nice to have datastructures in
prolog/kanren that
i)   backtracks at will or not
ii)  faster then lists
iii) can redo and undo cleanly in order to support the more advanced
constructs
=================================================================

One of the drivers to do this is that the prolog way of keeping state across
backtrackings e.g. data that does not backtrack is via dynamic functions.
But the path
taken in guile-log is to have a datastructure for dynamic functions that is
compiling e.g. they are fast to execute but slow to modify. The solution is
to supply alternative objects that can
be used in stead of dynamic functions.

Guile-log generally head for functional datastructures but that is not
enough, backtracking put a severe stress on many functional datastructures
like vhashes and if one can prove that the backtracking is done without
stored state, then they may take a shortcut.

Also refering to a global variable can make code much cleaner, we will show
how we can allow that later.

So, consider the task of managing a hash for a logical program. we could
start modelling this ontop of vhashes e.g.

(define (make-prolog-hash) vlist-null)
(define* (prolog-hash-ref h k #:optional (e #f))
   (let ((r (vhash-assoc h k)))
       (if r
           (cdr r)

[-- Attachment #2: Type: text/html, Size: 2387 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: guarding functional datastructures in guile log
  2014-01-08 22:03 guarding functional datastructures in guile log Stefan Israelsson Tampe
@ 2014-01-08 22:05 ` Stefan Israelsson Tampe
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Israelsson Tampe @ 2014-01-08 22:05 UTC (permalink / raw)
  To: guile-devel, guile-user@gnu.org

[-- Attachment #1: Type: text/plain, Size: 2108 bytes --]

ops, I pushed the wrong buttons,

But I need to use another email client, the one I use kills my creativity,
until then
Happy Hacking

On Wed, Jan 8, 2014 at 11:03 PM, Stefan Israelsson Tampe <
stefan.itampe@gmail.com> wrote:

> Christmas holliday's has ended and a good progress has been made, mostly
> coding an
> iso prolog to be used with guile and guile-log. I use two test repos and
> most of the
> tests are passing. I will not head for passing all tests because I do not
> want to reuse
> the number tower of guile as well as the module code base.
>
> But I would like to produce some code for people to peek at and actually
> have
> some scheme code to show, and not a bunch of words that doesn't make sense.
>
> So here is the issue. It would be nice to have datastructures in
> prolog/kanren that
> i)   backtracks at will or not
> ii)  faster then lists
> iii) can redo and undo cleanly in order to support the more advanced
> constructs
> =================================================================
>
> One of the drivers to do this is that the prolog way of keeping state
> across
> backtrackings e.g. data that does not backtrack is via dynamic functions.
> But the path
> taken in guile-log is to have a datastructure for dynamic functions that
> is compiling e.g. they are fast to execute but slow to modify. The solution
> is to supply alternative objects that can
> be used in stead of dynamic functions.
>
> Guile-log generally head for functional datastructures but that is not
> enough, backtracking put a severe stress on many functional datastructures
> like vhashes and if one can prove that the backtracking is done without
> stored state, then they may take a shortcut.
>
> Also refering to a global variable can make code much cleaner, we will
> show how we can allow that later.
>
> So, consider the task of managing a hash for a logical program. we could
> start modelling this ontop of vhashes e.g.
>
> (define (make-prolog-hash) vlist-null)
> (define* (prolog-hash-ref h k #:optional (e #f))
>    (let ((r (vhash-assoc h k)))
>        (if r
>            (cdr r)
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 2860 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-08 22:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-08 22:03 guarding functional datastructures in guile log Stefan Israelsson Tampe
2014-01-08 22:05 ` Stefan Israelsson Tampe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).