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.devel Subject: Logic programming with prompts Date: Sun, 24 Mar 2013 14:20:04 +0100 Message-ID: <2117338.vrdFpiuacV@warperdoze> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: ger.gmane.org 1364131217 30775 80.91.229.3 (24 Mar 2013 13:20:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Mar 2013 13:20:17 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Mar 24 14:20:44 2013 Return-path: Envelope-to: guile-devel@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 1UJkqm-0006IT-Ky for guile-devel@m.gmane.org; Sun, 24 Mar 2013 14:20:40 +0100 Original-Received: from localhost ([::1]:40764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJkqO-0003FA-TD for guile-devel@m.gmane.org; Sun, 24 Mar 2013 09:20:16 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJkqJ-0003Ce-8e for guile-devel@gnu.org; Sun, 24 Mar 2013 09:20:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJkqI-00060q-79 for guile-devel@gnu.org; Sun, 24 Mar 2013 09:20:11 -0400 Original-Received: from mail-la0-x231.google.com ([2a00:1450:4010:c03::231]:46985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJkqI-000602-0L for guile-devel@gnu.org; Sun, 24 Mar 2013 09:20:10 -0400 Original-Received: by mail-la0-f49.google.com with SMTP id fs13so9642279lab.8 for ; Sun, 24 Mar 2013 06:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=rdy/bePBWzuNI2RPaPUHpkMr9edkGA4wSzM7ToCCZtY=; b=XbOnCeq3Rpd/6+s8pbVINhsBI8yHoFHarFc0CwT+U9EhKOB6YgBkW7C45y2UhdLy+e GOcGZk0preOG/87jzowDXSRvlmvgUcj1b1cf31ugThfx0AfwMHMaUMYp4Hj8x8QQaZgL /cBtf6wk20u3CciICB5T4v8DvHc6mWcV2UfRkD8ruS+KcyDfacQ94wXjmHP1LENmcdB5 vuMtt9XOuXI1AcjqmAHgvJLMZX+durm5Bdx1p3qYIb11kkb//AejM4+rh46/BA0cmc0G bd3a+DZQfbCAPLwuckKf/Z/ev/Jb4cFKDS1nusAZaeEziRA3wKKHFV6wG+YHRvteddk1 rJxQ== X-Received: by 10.112.84.228 with SMTP id c4mr4157168lbz.113.1364131208523; Sun, 24 Mar 2013 06:20:08 -0700 (PDT) Original-Received: from warperdoze.localnet (1-1-1-39a.veo.vs.bostream.se. [82.182.254.46]) by mx.google.com with ESMTPS id nv3sm1483845lbb.15.2013.03.24.06.20.06 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 24 Mar 2013 06:20:07 -0700 (PDT) User-Agent: KMail/4.9.5 (Linux/3.5.0-26-generic; KDE/4.9.5; x86_64; ; ) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::231 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15986 Archived-At: Dear friends, I think that the current state of guile is in a sad state for logic programming with prompts in guile. I really think that we should fix the most pressing issues or stop touting prompts as a way to implement logic programming and direct to kanren or guile-log instead. Issues. 1. with a prompt based solution fluids is the natural choice to implement backtracking logical variables. But the current fluid implementation is fundamentally broken with respect to undo and redo semantics and will haunt any project that want to have interactive logic reasoning implemented. It's possible to fix it in pure guile with a horrible complex solution and will lead to laughable performance. 2. with-fluids is not tail recursive. It is quite possible that project will fail due to burnout of the stack in current guile because of this. One probably cannot get kanrens great support for tail call's implemented but at-least reduce the total memory consumption quite significantly. 3. Speed, Logic programming in pure guile is currently 100x slower then than with e.g. gprolog. It can be imporved to 20x by using a C-based backend. It's possible to get down to 4x (with prompts) if we could have a fast C-call mechansim or support in the VM. 4. This is a less important issue. But in order to implement all logic constructs found in kanren with prompts you will need to be able to use a special-variables construct that i'm touting which is needed if one want to be able to undo and redo things. Regards Stefan