datalog

stuartrexking 2020-03-25T04:01:51.003300Z

In this example from the http://learndatalogtoday.org website

[:find ?name-1 ?name-2
 :where
 [?p1 :person/name ?name-1]
 [?p2 :person/name ?name-2]
 [?p1 :person/born ?born-1]
 [?p2 :person/born ?born-2]
 [(.getMonth ?born-1) ?m] ;assigned here
 [(.getMonth ?born-2) ?m] ;re-assigned here? filtered? What's going on?
 [(.getDate ?born-1) ?d]
 [(.getDate ?born-2) ?d]
 [(< ?name-1 ?name-2)]]
How does the assignment to ?m and ?d for the .getMonth and .getData functions work?

zane 2020-03-25T07:06:36.003600Z

Try not to think of it as assignment. Instead think of it as a set of constraints: (.getMonth ?born-1) and (.getMonth born-2) must return the same value for every pair of people in the result set.

stuartrexking 2020-03-25T20:54:58.003800Z

@zane Thank you!