Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
171 views

The phrase "pure monotonic Prolog" (sometimes written with a comma) is often used in discussion of the language, especially in discussion of how one ought to write code. How is the phrase ...
rotu's user avatar
  • 190
2 votes
0 answers
142 views

I need to prove A =~ Star re -> B =~ Star re -> A ++ B =~ Star re. in order to prove Pumping Lemma. These are the available match rules: Inductive exp_match {T} : list T -> reg_exp T -&...
Mohammad Teimori Pabandi's user avatar
0 votes
0 answers
45 views

Is there any LPL that supports tracking multiple fact scenarios, identifying those that have become inconsistent, and performing what-if tests? All the versions of Prolog I have seen have only a ...
Mark Green's user avatar
  • 1,362
0 votes
0 answers
54 views

Questions are as follows: Points on the straight line, 1, 2, 3, 4, 5, the starting point is 1, can go to any point, but a point can only be reached once, output the path to visit all points. I ...
CodeNumb's user avatar
1 vote
0 answers
103 views

I am interested in expressing the number of occurrences of an element in a list as a relational goal in Clojure's core.logic library. (Note that this question is not a duplicate of clojure core.logic ...
oper0's user avatar
  • 11
1 vote
2 answers
146 views

I am trying to implement multiplication for unary numbers in MiniKanren. So I have written the following code: #lang iracket/lang (require minikanren) (require minikanren/matche) (defrel (unaryo n) (...
 NAD 's user avatar
1 vote
1 answer
76 views

I'm developing a Minizinc model and I ran into this issue: given this model enum req_type = {roads, rivers}; enum cities = {city1, city2, city3} array[cities, cities] of var bool: are_connected; % ...
Sassa's user avatar
  • 11
0 votes
0 answers
196 views

I'm trying to define a knowledge base where a disease has a list of symptoms. Here's a snippet: import pytholog as pl diseases_kb = pl.KnowledgeBase() diseases_kb([ "disease(diabetes, [...
Elissa's user avatar
  • 1
3 votes
0 answers
113 views

I have to find a logically consistent subset of multiple fact sets (databases). Is there a logic programming language with built-in facilities to do this? If not, are there logic programming languages ...
Paul Jurczak's user avatar
  • 8,630
0 votes
0 answers
59 views

I'm confused about the inner workings of ASP. Say I'm modelling a country's. For example, say we have city(london). city(manchester). city(leeds). city(newcastle). city(sheffield). road(a1). road(b1)....
Dan Öz's user avatar
  • 351
4 votes
2 answers
500 views

I'm learning prolog, and I'm confused by the claim that prolog uses proof by contradiction: The resolution proof process makes use of a technique that is known as reduction to the absurd: suppose ...
Joseph Garvin's user avatar
1 vote
1 answer
415 views

I'm trying to find all the shortest path from one source node to all other destination node (so 1-3, 1-5, 1-4) with the relative cost for each shortest path. I've tried with this code node(1..5). ...
user16457964's user avatar
0 votes
0 answers
44 views

What is the advantage of following value semantics while designing parallel programming?
Pankaj Chowdhury's user avatar
2 votes
2 answers
143 views

In conversations around Prolog's cut operator !/0, I have only ever heard it described in terms of choice points and Prolog's execution model. It also seems to me that cut was introduced to give more &...
jweightman's user avatar
1 vote
0 answers
32 views

I use the next unification lib. from unification import * x1 = var('x1') unify((x1, 1), x1) # {~x1: (~x1, 1)} Can you please suggest how to eliminate such circular solutions (~x1 references to ...
Oleg Dats's user avatar
  • 4,143
1 vote
1 answer
133 views

I am using Racket v8.5, with the packages for minikanren and minikanren/numbers required. Why does introducing the numbero constraint cause previously valid unifications to fail? > (run 1 (q) (<...
jpt4's user avatar
  • 13
0 votes
1 answer
960 views

I want to find atoms, within a pre-defined set of atoms, that are in all possible optimal solutions of an ASP problem. I'll explain what i want to do. I have an optimization problem where multiple ...
J.Doe's user avatar
  • 21
1 vote
2 answers
253 views

For my thesis, I am looking at specific properties of knowledge bases and how this affects argumentation tree sizes. I need a sat solver in prolog which I already have, but I also need an algorithm ...
user avatar
1 vote
0 answers
143 views

Prolog mixes logic (fallible) goals, and (infallible) processes like write/2 or assert/1. Is it possible to do so with Clojure's core.logic? For example: (pldb/with-db myFacts (l/run* [x y] ...
Hugolin Bergier's user avatar
1 vote
1 answer
163 views

I’m making a puzzle level generator (sokoban) using Clingo and got stuck trying to create levels with a specific move limit. The idea is to use the move limit to control difficulty of a level. This is ...
jokke's user avatar
  • 65
7 votes
1 answer
328 views

I started to learn Prolog and I just read that the atom at the beginning of an structure is usually called functor. I'm also familiar with the term functor from Category Theory and Functional ...
Gabriel Santana Paredes's user avatar
3 votes
2 answers
973 views

I am testing the inductive capabilities of some theorem provers (such as Z3, Alt-Ergo, Vampire etc.) using the TPTP syntax. To my surprise, none of them managed to demonstrate the following simple ...
mateleco's user avatar
  • 619
0 votes
1 answer
152 views

I've been trying to solve the logic puzzle Lady or the Tiger in Alloy but got stuck. Right now I'm trying to solve the 4th puzzle which is on the 2nd day. It goes as following: There are a few rooms ...
Myrqz's user avatar
  • 51
1 vote
1 answer
92 views

For simplicity, this is a toy version of the actual problem: given a set of integers, find the longest sequence of consecutive numbers from that set. I looked at CLIPS and other expert systems, and ...
Paul Jurczak's user avatar
  • 8,630
2 votes
1 answer
236 views

For the multidirected graph below I am trying to write an program that visits all edges at least once. For instance, in the below graph I am looking for an outcome similar to "edge(1,2), edge(2,3)...
john_ny's user avatar
  • 183
2 votes
0 answers
107 views

I am reading the paper Implementing Type Theory in Higher Order Constraint Logic Programming, and on p7 I see the following lambda-prolog code: % KAM-like rules in CPS style whd1 (app M N) S Ks Kf :- !...
Mike Shulman's user avatar
1 vote
1 answer
465 views

I have written an ASP program with an optimization condition in the end. When I compile it, even though I get the correct result, in the summary I get a negative value for the optimization (i.e. -3). ...
john_ny's user avatar
  • 183
1 vote
1 answer
310 views

For the undirected graph described below, I am trying to get its spanning trees and then separate its leaves from the internal nodes. Could you please help me with my code ? What I expect to see after ...
john_ny's user avatar
  • 183
1 vote
1 answer
113 views

Consider this blog post where the author implements palindrome relation using reverso: (defn reverso [l r] (conde [(== l ()) (== r ())] [(fresh [la ld ldr] (conso la ld l) (...
tsuki's user avatar
  • 907
1 vote
1 answer
562 views

instance.lp node(1). node(2). node(3). node(4). node(5). node(6). edge(1,2). edge(2,1). edge(4,1). edge(2,3). edge(2,6). edge(3,4). edge(3,5). edge(5,6). edge(6,3). begin(4). I have this problem ...
cheshire's user avatar
  • 1,159
3 votes
2 answers
330 views

In the logic programming community, I have heard many people talk about "committed choice logic programming language", but I am not very clear about its definition. I searched the internet, ...
chansey's user avatar
  • 1,439
5 votes
1 answer
2k views

I'm currently learning how to prove the unsatisfiability of first-order logic. I've learnd in my class that resolution is one way to solve the unsatisfiability problem, e.g., tools like Prolog achieve ...
Li Danyuan's user avatar
3 votes
1 answer
133 views

Here's an algorithm in Curry which takes n and matches on two strings within edit distance n of each other. lev :: Eq a => Int -> [a] -> [a] -> () lev n (a : b) (a : c) = lev n b c lev n ...
Wheat Wizard's user avatar
  • 4,226
3 votes
2 answers
405 views

In recent years many elements of 'functional programming' have entered Java, in particular with Java 8. I have in mind lambda-expressions, functional interfaces, Java Generics, the Stream-interface, ...
Sebastian's user avatar
  • 569
1 vote
1 answer
363 views

Recently I am learning SMT solver. Although SMT solver is a new concept to me, it reminds me of logic programming, e.g. Prolog and minikanren. So I tried a classic example of logic programming in SMT ...
chansey's user avatar
  • 1,439
1 vote
1 answer
294 views

I am a newbie to ASP (Answer Set Programming). I tried the following program in clingo online version (reasoning mode = enumerate all) % instance member(dave). % encoding edu(X);rich(X) :- member(X). ...
chansey's user avatar
  • 1,439
1 vote
1 answer
547 views

Suppose I have a the following file foo.lp: foo(x). Now when I run gringo -t -c x=1 foo.lp I obviously get: foo(1). Now I want to know how to achieve the same behavior as the -c command line option ...
user1747134's user avatar
  • 2,502
1 vote
1 answer
300 views

I need to write a paper on the Event-Driven Programming Paradigm in Logic Programing. I have been able to find a lot of information on Event-Driven Programming in Object-Oriented and Functional ...
ProgLog's user avatar
  • 35
1 vote
1 answer
658 views

Adding the following rule to my code results in an error message (info: operation undefined (Max-Min)): rank_difference(Room, Deck, Diff) :- played(Room, Deck), Min = #min {Rank: seat(Player, ...
rudolfovic's user avatar
  • 3,316
0 votes
1 answer
558 views

I am struggling to scale a constraint problem (it breaks down for large values and / or if I try to optimise instead of just looking for any solution). I've taken some steps to break the search space ...
rudolfovic's user avatar
  • 3,316
0 votes
1 answer
321 views

Right now I have a single choice predicate that defines my search space. #const nRounds = 3. #const nPlayers = 17. #const nSeats = nRounds * nPlayers. #const nRooms = 3. #const nDecks = 6. nSeats { ...
rudolfovic's user avatar
  • 3,316
2 votes
1 answer
673 views

The following code produces x(3) rather than x(4) because it adds 1 and 2 together even though 1 appears twice. What is the right way of obtaining total sums in clingo? p(0,1;1,1;2,2). x(X) :- X = #...
rudolfovic's user avatar
  • 3,316
2 votes
2 answers
776 views

I am trying to use clingo to generate tournament player-room allocations: player(1..20). room(1..4). played(1..20, 0). rank(1..20, 1). played(1..20, 1..20, 0). 0 { used_room(R) } 1 :- room(R). 3 {...
rudolfovic's user avatar
  • 3,316
6 votes
2 answers
406 views

I am currently learning miniKanren by The Reasoned Schemer and Racket. I have three versions of minikanren implementation: The Reasoned Schemer, First Edition (MIT Press, 2005). I called it TRS1 ...
chansey's user avatar
  • 1,439
0 votes
1 answer
489 views

I am testing some programs involving arithmetics in Clingo 5.0.0 and I don't understand why the below program is unsatisfiable: #const v = 1. a(object1). a(object2). b(object3). value(object1,object2,...
Olivier's user avatar
  • 33
2 votes
2 answers
1k views

Task is to write a program that can decide whether two words are synonyms or not. I have pairs of synonymous words, E.g.: [big large] [large huge] [small little] We can derive the synonymous ...
Sharas's user avatar
  • 915
1 vote
2 answers
127 views

I'm looking for research, algorithms or even terminology for this area of research that take a Prolog program and a query I want to be true and attempt to find the facts that would need to be asserted ...
Eric Zinda's user avatar
2 votes
1 answer
157 views

I was working with the minikanren library for Racket, but wanted to use the "disj" and "conj" operators. I want to be able to more explicitly declare whether I am using disj or ...
Flywheel's user avatar
2 votes
1 answer
318 views

I have come across the following puzzle and couldn't formulate a solution in Picat: You will generate 5-digit numbers, where each digit is in 1..5 and different from the others, with the constraint ...
mlg556's user avatar
  • 419
1 vote
3 answers
745 views

I have the following clingo code that generates the search space, followed by constraints. {in(I,1..4)}=1 :- I=1..n. :- [constraint1] :- [constraint2] This code works. But I need clingo to find the ...
Saqib Ali's user avatar
  • 4,551

1
2 3 4 5