Questions tagged [datalog]

Datalog is a query and rule language for (deductive) databases that syntactically is a subset of Prolog.

Datalog is a query and rule language for (deductive) databases that syntactically is a subset of Prolog. Compared to Prolog, Datalog has certain restrictions on the syntax of allowable predicates, which mean that any bottom-up calculation is guaranteed to terminate. These restrictions also guarantee that the order of Datalog statements within a program does not affect its functioning. However, unlike Prolog, it is not Turing Complete, and so cannot be used for general purpose programming.

164 questions
0
votes
1 answer

Why are the following Datalog programs equivalent?

For some existentional predicates a,b why is this: q(X,Y) <-- a(X,Y), q(Z,Y) q(X,Y) <-- b(X,Y) equivalent to this: q(X,Y) <-- a(X,Y), b(Z,Y) q(X,Y) <-- b(X,Y) ? Why can't the top recursion just continue to expand?
EpsilonVector
  • 3,973
  • 7
  • 38
  • 62
0
votes
0 answers

Integrating Datalog with C++ applications

I'm not new to programming, but I am new to Datalog. I practiced Datalog throughout the week and it is very useful to make queries against a database. One thing I am having difficulties figuring out is how to use Datalog with a C++ application. What…
0
votes
3 answers

Maximum minimum and mean in Datalog

I cannot figure how calculate a mean, maximum and minimum using Datalog declarative logic programming language. Eg. Considering this simple schema Flows(Stream, River) Rivers(River, Length) If I want a) the mean length of the rivers, b) the…
AndreaF
  • 11,975
  • 27
  • 102
  • 168
0
votes
1 answer

I need to create a Datalog Query based off two Tables?

The Datalog rule below for none_of_manufacturer was intended to list those aircraft manufacturers for which the airline has no aircraft in its fleet. The fragment of Datalog below, however, does not do what it was intended to…
0
votes
1 answer

Using Datalog by itself, is it possible?

I am currently studying Datalog for my report in class, I only need to discuss basic syntax and a basic example. I know Datalog is usually used as a query language and is usually only implemented to other languages such as Java, Lua, C, etc. but is…
Nigel
  • 13
  • 5
0
votes
1 answer

Querying for uniqueness in Datalog?

Is it possible in Datalog to write a query for facts where there is exactly one value for one of the variables, for each possible value of the other variables? e.g. find all X such that there is only one X for each Y in expr(X, Y)
Filip Haglund
  • 13,919
  • 13
  • 64
  • 113
0
votes
1 answer

Safe Datalog rules for the query

Consider the relations: edge(X,Y), Red(X,Y), Blue(X,Y). These relations are representing a graph whose edges can be colored red or blue(or no color). provide safe datalog rules(with negation if necessary) for the following queries. Q1. find the…
Katie
  • 452
  • 7
  • 18
0
votes
1 answer

DLV list composition

I was wondering if there is a way in DLV for creating a list with the elements of all predicates that are true in a rule. For example, if I have the following predicates foo(a, b). foo(a, c). foo(a, e). foo(b, c). The result I am looking for should…
rutex
  • 137
  • 3
  • 12
0
votes
1 answer

DLV interactive mode (debugging)

I have been working on DLV for a little while and when the program is big I find it difficult to follow the activation of rules. So I went to the manual and checked if there was something to allow me to do this. The only thing I found was the…
rutex
  • 137
  • 3
  • 12
0
votes
1 answer

Arduino Datalogger webserver failing to connect to client

I have an Arduino mega with Ethernet shield + SD card running sensor data logger with DHT22 sensor writing sensor data to SD card. I'm trying to implement web server to read that data from SD card. I have made an program using Arduino's examples but…
Jussi
  • 1
  • 1
0
votes
1 answer

Testing attribute against list in datomic datalog

I would like to test in a where clause in datalog if an attribute is in a particular set (or list). For example I want to test whether the :tag-type/code is in ["urgent" "todo"] . I can do this: (or [?tag-type :tag-type/code "urgent"] …
Peter
  • 47,963
  • 46
  • 132
  • 181
0
votes
1 answer

How to run datalog in Z3 using commad line

I try to run datalog file (test.dl, from http://rise4fun.com/Z3/tutorialcontent/fixedpoints#h21) as following in Z3 (version:4.3.2). (set-option :fixedpoint.engine datalog) (define-sort s () (_ BitVec 3)) (declare-rel edge (s s)) (declare-rel path…
user1487718
0
votes
1 answer

Prolog advantages over Datalog

I've been trying to understand if there is a substantial advantage of using Prolog over Datalog in a specific context. Prolog is Turing complete and Datalog is not. But is there other substantial advantages of using Prolog ? the specific context…
cdiogo7
  • 57
  • 7
0
votes
1 answer

How can I delete data from logicblox without warning message

In the new version of logicblox (any version later than 4.2.1), if there is a predicate "Person(p), hasPNr(p:n) -> int(n)." And I insert an data "+Person(p),+hasPNr[p]=1." Then if I want to delete data by "-Person(1)." There will be an warning…
jitron
  • 135
  • 1
  • 9
0
votes
0 answers

Model datalog queries client side

I have datomic DB and going to build web-interface to query the database. The straightforward solution I always implemented with relational databases is to write server API to retrieve entities. Each API end-point has list of parameters it accepts,…
Boffin
  • 570
  • 2
  • 7
  • 21
1 2 3
10
11