Questions tagged [transitive-closure]

Use this tag for the transitive closure of a relationship or when related to graph theory.

References:

Wikipedia
Wolfram MathWorld

148 questions
0
votes
1 answer

Reasoning with transitive roles in Protégé

I have a problem about reasoning with transitive roles in Protégé. I created a simple ontology that says: "Any rod is part of some engine." "Any engine is part of some car." "PartOf relation is transitive." I expected Protégé to recognise this DL…
0
votes
1 answer

Prolog Out of local stack error

I tried some basic example from a book and it makes "Out of local stack" error (I'll tell more after the code). here is the code: edge(a,b). edge(a,e). edge(b,d). edge(b,c). edge(c,a). edge(e,b). tedge(Node1,Node2) :- edge(Node1,SomeNode), …
Yuval Simon
  • 335
  • 1
  • 10
0
votes
1 answer

How to check if the paths are connected between rooms

I have the following facts that build ne of the wings of my…
Garmagon117
  • 225
  • 3
  • 13
0
votes
2 answers

Trouble getting a list of trip paths in Prolog

I am having trouble with the following problem in Prolog, I have several facts in a knowledge base for example: flight(rome,london,ba,1500,150,400). flight(london,newyork,airfrance,600,60,200). flight(rome,paris,airfrance,1200,120,500). …
0
votes
1 answer

Prolog graph acyclic

I am trying to write a predicate that writes out all the ways from one node to another in a acyclic graph. If I example have these nodes/edges. node(x,y). node(x,z). node(y,z). And then I have tried something like: predicate(X,Y):- node(X,Y), …
Fjodor
  • 529
  • 1
  • 7
  • 19
0
votes
2 answers

Making a Transitive Pair Set using STL C++

I'd like to create a set which has transitive pairs. My input will be of the form pair and I need a set which has all transitive pairs for the given inputs. For example, if I have pairs {1, 2} {2, 1} {2, 3} {3,4} as inputs, then I need to…
user3125772
  • 73
  • 1
  • 10
-1
votes
1 answer

How To Write travel/3 into path/2

Let's say we have some facts and rules set like these…
-1
votes
1 answer

Beginner Prolog, How to write transtive relation?

let say bigger(elephant,buffalo). bigger(buffalo,dog). bigger(dog,cat). bigger(X,Y) :- what do i write here to establish, elephant is bigger than buffalo, buffalo is bigger than dog etc?
Sion12 C
  • 3
  • 3
-1
votes
1 answer

Database Management - closure of functional dependencies

What is the closure of these functional dependencies of a relation? A -> DC D -> B Ans: A -> BC (using pseudo transitivity rule). Am I correct or am I missing something?
-1
votes
2 answers

How to get out of an infinite loop in Prolog using an accumulator

Knowledge base I'm using: connected(1,2). connected(3,4). connected(5,6). connected(7,8). connected(9,10). connected(12,13). connected(13,14). connected(15,16). connected(17,18). connected(19,20). connected(4,1).…
notywq
  • 25
  • 3
-2
votes
1 answer

all possible routes between the Entry and the Exit

i need help to solve the maze path. Thanks in advance link(a,b). link(b,c). link(c,d). link(f,c). link(b,e). link(d,e). link(e,f). Write a predicate that defines a route between any two adjacent points (X and Y for example) based on the fact…
-2
votes
1 answer

How to start off from these details

I already have a skeleton of what I need for the program as far as the methods I was told I would need. However, other than that I am having trouble figuring out how to start coding this program. The details are as follows. I'm not asking to have…
-3
votes
1 answer

Can you give me an example of a transitive closure of a relation that is not an equivalence relation?

I am having trouble finding examples of transitive closure of relations that are not an equivalence relation.
1 2 3
9
10