Difference Between First Order Logic and Conjunctive Queries

124 Views Asked by At

What is the difference between First Order Logic and Conjunctive Queries ?

Can you for instance give an example of FO query and Conjunctive Query for the following statement?

Give the all the triples p,q,s in graph S that has edges among each other?

1

There are 1 best solutions below

6
On BEST ANSWER

See Erich Gradel & Phokion Kolaitis & Leonid Libkin, Finite Model Theory and Its Applications (2007), page 259 :

a conjunctive query is a formula like :

$\varphi (x,y) \equiv \exists z ( E(x,z) \land E(z,y))$

Assuming that "a triples $p,q,s$ in a graph $S$ that has edges among each other" means that the three vertex form a "triangle", your query $q(p,q,s)$ can be defined by the following formula:

$\varphi(p, q, r) \equiv (E(p,r) \land E(r,q) \land E(p,q))$.