From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.user Subject: Re: Potluck time! Date: Sat, 13 Feb 2016 15:36:39 +0100 Message-ID: References: <87mvr8ood1.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114444e0307432052ba7b6d2 X-Trace: ger.gmane.org 1455374217 29549 80.91.229.3 (13 Feb 2016 14:36:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Feb 2016 14:36:57 +0000 (UTC) Cc: "guile-user@gnu.org" To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Feb 13 15:36:57 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aUbJf-0006yM-Su for guile-user@m.gmane.org; Sat, 13 Feb 2016 15:36:56 +0100 Original-Received: from localhost ([::1]:42478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUbJf-0003LY-7y for guile-user@m.gmane.org; Sat, 13 Feb 2016 09:36:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUbJS-0003LI-MK for guile-user@gnu.org; Sat, 13 Feb 2016 09:36:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUbJR-0002Md-9o for guile-user@gnu.org; Sat, 13 Feb 2016 09:36:42 -0500 Original-Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:37716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUbJQ-0002LZ-Vu; Sat, 13 Feb 2016 09:36:41 -0500 Original-Received: by mail-wm0-x231.google.com with SMTP id g62so54642726wme.0; Sat, 13 Feb 2016 06:36:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=bqIMP015TkIx61Kuix8yH63jLfJ1WLRSuLTMsJKGCZY=; b=fxxjqCXndLu1Bp1zipo+BxTC4AawWT1jVpxyqXxM5SrANcijCQWrbD8HXqFEPSx2y0 YMnl3PN0yAkt9ipJyh87lurHGDbwcQobUZXyCr8JzkgwNSHLmGeoI8v+myXB9hX57SW3 DuW8Lfv+mEvwAIhzPd8t/b/baWPMXxcE6ypeOC/HX3fEFM+v1dBEHmNHDQ5nhDoFvR0s Et4DMDcXi7SepiGQXBnqA380skRoMnaGDbdy6+RVe54VH3NocQTbamUzFrdHTD6zc8IG rl7+pBK1DBcLEuBoZQRRCmp6r595JWzX1nCy+yWbpVVPGRKs8f+eaDtKLEqtjS5++tmd 57qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=bqIMP015TkIx61Kuix8yH63jLfJ1WLRSuLTMsJKGCZY=; b=HgQ4IwnN3RWXZ6FTus3TZ2k68AYJcG98OUNs1kIcLKAsypLrFTUtS6coxQS+PedkCN kjVg7RuiB73AJiLWes5fFQI7vJdFe+ebZaqbLOz1C7sZLasAUDSC3fFtb4Sr0U6pp7vu JWoRPhPGUUh0DwlDodkcgWULiXnmfDHId1X10DpXnPKmfrdeVt4P4z1m0RzCu2Ux+By8 5ZjR1zzgp7qv6H5WqXJ85IL+WGnRWkbr48/NI+NyQtmhk0OsssJzRu3eQaXkNvxwERPc 6YcomT9L4ABI+ByqI04jdGsdNWgLEHcGGFc9e8jylM0uVmUx3gNxnjsFD6gdn/ZiX/rU GYQA== X-Gm-Message-State: AG10YOQeOhR+xKZ0Tg0ZEZsRFeq0rq1s65+qke+FlzNtITVFBhqU1fvHSh30g/gKVBeqD15JalO59zcO1lB9qA== X-Received: by 10.28.174.72 with SMTP id x69mr3325082wme.68.1455374199709; Sat, 13 Feb 2016 06:36:39 -0800 (PST) Original-Received: by 10.27.187.196 with HTTP; Sat, 13 Feb 2016 06:36:39 -0800 (PST) In-Reply-To: <87mvr8ood1.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::231 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:12394 Archived-At: --001a114444e0307432052ba7b6d2 Content-Type: text/plain; charset=UTF-8 Hey Guilers My potluk contibution is tp implement attributed variables for minikanren ontop af the source written by William E. Byrd. You can find the source at https://gitlab.com/tampe/attributed-minikanren The source containes examples using attributed variables to implement =/= symbolo numbero absento freezeo and wheno API (define AttributeId (make-attribute unify-fkn portray-fkn) (unify-fkn var data val lam) var is the varibale that is unified (not yet unified at the execution of this fkn) data is the data associated with AttributedId for variable var and val is the value that var will be unified to and lam is a variable that can be bound to a predicate to be executed after the unification have been taken. (portray-fkn var data s) Return a list of representations of attribuete AttributedId with data data for variable var. s is the variable binding stack. (get-attr var id data) Get data associated with attributed id if no attribute exists fail (put-attr var id data) Put attributed data data of kind id to variable var. New Examples (wheno (cons test1 lam1) (cons test2 lam2) u1 u2 ...) If u1 u2 ... is bound then before bounding test1 will by tried with no unification as a result and if success lam2 will be executed else the binding will fail then the variable will be bound and test2 lam2 combo will be tried similarly, the conses can be repaced with #f to indicate a void semantics. (freezeo u lam1 lam2) before the binding of u lam1 will be tried and after the binding of u lam2 will be tried. The rest of the constraints was implemented by other means before and is known please read the documentation by William E. Byrd. Regards Stefan --001a114444e0307432052ba7b6d2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hey Guilers

My potluk contibution is tp= implement attributed variables for minikanren ontop af the source written = by=C2=A0=C2=A0William E. Byrd.

You can find the so= urce at=C2=A0htt= ps://gitlab.com/tampe/attributed-minikanren

Th= e source containes examples using attributed variables to implement =3D/=3D= symbolo numbero absento freezeo and wheno

API
(define AttributeId =C2=A0(make-attribute unify-fkn portray-fkn)

(unify-fkn var data val lam)
var is the var= ibale that is unified (not yet unified at the execution of this fkn) data i= s the data associated with AttributedId for variable var
and val = is the value that var will be unified to and lam is a variable that can be = bound to a predicate to be executed after the unification have
be= en taken.

(portray-fkn var data s)
Retur= n a list of =C2=A0representations of attribuete AttributedId with data data= for variable var. s is the variable binding stack.

(get-attr var id data)
Get data associated with attributed id i= f no attribute exists fail

(put-attr var id da= ta)
Put attributed data data of kind id to variable var.

New Examples
(wheno (cons test1 lam1) (cons test= 2 lam2) u1 u2 ...)
If u1 u2 ... is bound then before bounding tes= t1 will by tried with no unification as a result and if success lam2 will b= e executed else the binding will fail
then the variable will be b= ound and test2 lam2 combo will be tried similarly, the conses can be repace= d with #f to indicate a void semantics.

(freezeo u= lam1 lam2)
before the binding of u lam1 will be tried and after = the binding of u lam2 will be tried.

The rest of t= he constraints was implemented by other means before and is known please re= ad the documentation by=C2=A0=C2=A0William E. Byrd.

Regards
Stefan


--001a114444e0307432052ba7b6d2--