As the title suggests, I am having an error I don't really know how to fix as I am quite new to prolog and was wondering if someone could point out a solution?
I wrote some code to find paths between certain points. Here is my…
I'm relatively new to Prolog and my aim from this code is to try and find all routes between all defined edges. Prolog should output me the full route from the inputted start to destination. However I keep getting an error bash: -c: line 1: syntax…
This is my code:
% A The first link as a predicate
link(1,2).
link(2,3).
link(3,4).
link(3,6).
link(6,7).
link(6,5).
So what we did with the path predicate is check from a given starting point check if there exists a path from that point to the…
Greetings,
This question is about vscode itself, the Microsoft build. I would
like to know all the dependencies it does have, recursively until I
hit the transitive closure. I also need to know the version/license of
each one of these dependencies.…
I am trying to solve the traditional path-finding puzzle using DCG notation. These are some connected numbers, and they make a chain from start to end. You can step between two numbers if there is a connection one way or the other, as normal. For…
This is a continue of another post:
JQ, convert CSV (parent child format) to JSON
Hi, sorry to ask again. I tried to get the following format, without success. Really appreciate for some advice. I attach a picture to show how it looks like in a…
This function should return the transitive closure of L. For Examples:
(Transitive-Closure'((a b) (b c) (a c))) ---> '((a b) (b c) (a c))
(Transitive-Closure'((a a) (b b) (c c))) ---> '((a a) (b b) (c c))
(Transitive-Closure'((a b) (b a))) --->…
I am very new to Prolog programming. Any help is greatly appreciated.
I have the following program,
bigger(elephant, horse).
bigger(horse, donkey).
bigger(donkey, dog).
bigger(donkey, monkey).
is_bigger(X, Y) :- bigger(X, Y).
is_bigger(X, Y) :-…
My scenario:
User A is (fraudster).
User B is not (fraudster). However, the system will not allow user B
to do any action. Because B and A are using the same Phone
Number(Shared attribute with Fraud User). (1 layer).
User D is not (fraudster). But…
I am running the following program about transitive closure of z3:
from z3 import *
def main():
A = DeclareSort('A')
R = Function('R', A, A, BoolSort())
TC_R = TransitiveClosure(R)
# TRC_R = TransitiveReflexiveClosure(R)
s =…
Sorry, I know this question comes up a lot but I've done so much research and I just can't figure out how to solve this problem. I have represented a tube map in PROLOG and need to write a predicate that returns all routes between two stations. I…
I'm a beginner! I'm trying to code a for-while loop using Twint to scrape Twitter, starting from a list or a dict of usernames and ending up with a (NetworkX) directed graph of transitively associated nodes and edges. I want to set a variable number…
Task: Create a database query that gives a hierarchical relationship for any two representatives of the genus, in other words, find out who is the ancestor and who is the descendant.
Database:
parent('Rurik', 'Igor').
parent('Igor',…
I was looking at this question, in which we make a predicate in Prolog which finds a path between two nodes ("metro stations") in a directed graph. The original code suggested is the following
path(Start, Dest, [[Start,Dest]]) :- connected(Start,…
I want to know why does the program goes in an infinite recursion in those cases:
?- love(kay, amanda).
and
?- love(rob, amanda).
And here is the code:
love(amanda, kay).
love(kay, geo).
love(geo, rob).
love(X, Y) :-
love(X, Z),
love(Z,…