1 answer

Difference between logic programming and automated theorem proving

What is the difference between logic programming and automated theorem proving (ATP) (e.g. with E-Prover, Spass or Princess)? I searched a lot and the only information I found is that ATP is the ...

1 answer

Dependency Graph Resolving with pyDatalog

I am striving to write more readable, declarative programs. So I decided to implement a simple algorithm we currently use. The procedural implementation is the following: There are commands and ...

0 answers

Best tool for a beginner in Constraint Logic Programming

I need to create a prototype application for production order scheduling for my university. I am still new to the topic of CLP and I am looking for an easy tool/environment/system that will let me ...

0 answers

Detecting Bigamy with minikanren

I am using the LogPy implementation of minikanren. I have some facts about marriages. from logpy import * marriedo=Relation() fact(marriedo,"Bob", "Jane") fact(marriedo,"Greg", "Anne") ...

1 answer

turning off Redefined static procedure in prolog

anyone of you could tell me how to turn off "Redefined static procedure" warnings? I red online documentation of swi-prolog and i found this predicate no_style_check(ultimate) that in principle ...

1 answer

WARMR (ACE suite): eliminate “connected” terms from frequent patterns

i am using the WARMR frequent pattern algorithm in the ACE data mining suite. here is a toy example illustrating my problem. imagine you have, say, 20 examples (example(ex1)),...,example(ex20))) and ...

1 answer

Arithmetic operations in the head of a clause

I am a writing Prolog predicate that would compare some point (myPosition(2,2)) in Cartesian coordinate system with some other point in the neighbourhood. As a result, it should show the direction ...

1 answers | Dec 12 '15 at 18:24 by Zaslon on Stack Overflow stackoverflow.com
1 answer

Prolog combinatorics

Is there any way to generate all possibilities like 9 letters to be divided in 3 teams, like this: 1st team: 2 letters 2nd team: 3 letters 3rd team: 4 letters ? Example: find([a, b, c, d, ...

1 answers | Dec 9 '15 at 15:19 by charqus on Stack Overflow stackoverflow.com
4 answers

How is this context free grammar using difference lists in Prolog functioning?

I'm reading this tutorial on context free grammars in Prolog, and they mention at the bottom of the page implementing a context free grammar in Prolog using difference lists, with the following code ...

1 answer

Prolog minimum value in a list

I'm working on defining a predicate min_in_list/2 that would find the smallest value on a list. If there is less than 2 elements in the list the program should output "Error: There are not enough ...

2 answers

Are regular expressions an example of logic programming?

I'm just wondering if regular expressions fit into the definition of what Logic Programming is. It is a set of rules which given a set of facts yields a result depending on how the query is asked. To ...

2 answers | Nov 30 '15 at 16:44 by user10628 on Stack Overflow stackoverflow.com
2 answers

Prolog multiply all elements of a list

I want to define a predicate in Prolog, prod_list/2 that multiplies every element of a list. I'm having problem with the empty list wish the product should be zero, instead i get false. My code is ...

1 answer

Generating a parser with `inverse`, with constraints on the grammar

I recently followed through A Taste of Curry, and afterwards decided to put the trivial arithmetic parser example to test, by writing a somewhat more substantial parser: a primitive but correct and ...

2 answers

Compact vs full/verbose definition of the inverse combinator/operator in Curry

The rather fascinating 2013 introductory post to the Haskell based KiCS2 implementation of Curry by Wolfgang Jeltsch, A Taste of Curry, provides the following definition for the inverse combinator: ...

1 answer

How to limit search space in Curry?

Below is my first program in Curry. It prints sequence of steps required for reaching a desired solution (walking through a closed door). Evaluating expression: main Done (Just [Open,Walk,Close]) ...

1 answers | Nov 2 '15 at 21:51 by Rumca on Stack Overflow stackoverflow.com
1 answer

Zero of a quadratic function using Racket's logic paradigm

First of all, I want to apologize for the following question. I am a total noob with Racket, but I was quite interested after I have learned about its logic programming feature. Sadly there is only a ...

1 answers | Oct 17 '15 at 12:17 by Dschehuti Nefer on Stack Overflow stackoverflow.com
1 answer

How do I implement my own list in Prolog?

I am learning Prolog and I know there is a data structure already implemented to handle Lists, but I was wondering and if for some reason I want to implement my own data structure, how can I do that? ...

1 answers | Oct 16 '15 at 13:20 by Leonardo Lima on Stack Overflow stackoverflow.com
7 answers

Relational/Logic Programming in Python?

I'm a longtime python developer and recently have been introduced to Prolog. I love the concept of using relationship rules for certain kinds of tasks, and would like to add this to my repertoire. ...

7 answers | Oct 6 '15 at 20:48 by AJ. on Stack Overflow stackoverflow.com
1 answer

Prolog: Symmetric Rules

I'm following a Prolog tutorial that asks to define a symmetric relation. Say for instance you have the following fact in the knowledge base: colleague(john,bob). You also want ...

1 answers | Oct 2 '15 at 14:38 by Wolff on Stack Overflow stackoverflow.com
2 answers

Documentation for the Prolog dialect Prova

I would like to switch from SWI-Prolog to Prova - but it seems to be harder than expected: Predicates like succ() are not available and operations like Var1+Var2>Var3 do not work (obviously it ...

2 answers | Oct 2 '15 at 11:52 by shink on Stack Overflow stackoverflow.com
0 answers

How do I view how Prolog got to its result/the path it took?

I have a simple Prolog predicate that spits accepts a variable, Result, that calculates a result then stores it in Result to be viewed. Sometimes I'm unsure how it comes to the answer it stores in ...

1 answer

WARMR algorithm in ALEPH (SWI-Prolog)

i am trying to use WARMR to find frequent relational patterns in my data; for this i am using ALEPH in SWI-Prolog. however, i am struggling to figure out how to do this and why my previous attempts ...

1 answer

How do I get a list from an association list in Prolog, and then either append to it or create it if it doesn't exist?

Apologies for the convoluted title, but the gist of what I'm trying to do is I have a hash table/association list with a bunch of keys, each corresponding to a list. My issue lies with the fact I ...

1 answer

Why is this contradictory clojure.core.logic/featurec result being returned?

...and how can I avoid it? (run* [q] (featurec q {:a 1}) (featurec q {:a 2}))) returns ((_0 :- (clojure.core.logic/featurec _0 {:a 2}) (clojure.core.logic/featurec _0 {:a 1}))) which ...

4 answers

Prolog : Enumerate All Elements of Countably Infinite Results

Are there any prolog implementations that are able to enumerate all elements of countably infinite results? Let's consider to enumerate all pairs of natural numbers. If we enumerate pairs in order ...

4 answers | Aug 22 '15 at 17:22 by egi on Stack Overflow stackoverflow.com
13 answers

Embedded Prolog Interpreter/Compiler for Java

I'm working on an application in Java, that needs to do some complex logic rule deductions as part of its functionality. I'd like to code my logic deductions in Prolog or some other logic/constraint ...

2 answers

Is the `append` predicate tail-recursive?

A typical code example of list processing in Prolog is append: append([], Ys, Ys). append([X | Xs], Ys, [X | Zs]) :- append(Xs, Ys, Zs). My question is whether this program is tail recursive or ...

2 answers | Aug 12 '15 at 22:50 by day on Stack Overflow stackoverflow.com
0 answers

how Sets and Relations are useful and related to logic programming?

i am getting started with logic programming, but i am forced to do contents of discrete mathematics first. but i don't see the relation here. Sets however is used in predicate logic but Relations, how ...

1 answer

Modelling recipes and available ingredients with constraint logic

Imagine I have a number of recipes for different dishes and a larder containing various ingredients in my kitchen. I want to construct a model using core.logic which will enable me to answer the ...

0 answers

Restriction of resolution - logic programming-horn clause

I am confused about restriction of resolution especially input resolution. In one of the input resolution exercise, we began to resolve the clauses with negative horn clause. Question 1: Do we have ...

15 30 50 per page
1 2 3