Remix.run Logo
moi2388 3 days ago

“ lowercase letter represents a constant (could be any kind of constant, like an integer or a string) An uppercase letter represents a variable”

I already disagree with this syntax.

brodo 3 days ago | parent [-]

That's the default way it has been done in Prolog since forever. If you have static typeing, like in Soufflé, you can get around it.

cubefox 3 days ago | parent | next [-]

It's also used in the theory of formal grammars, where terminal symbols (constants) are lower case, and non-terminal symbols (variables) are upper case: https://en.wikipedia.org/wiki/Formal_grammar#Introductory_ex...

moi2388 2 days ago | parent [-]

I did not know this, thanks

maweki 3 days ago | parent | prev [-]

Datalog does not need/do unification for rule evaluation, as it is just matching variables to values in a single direction. Body literals are matched against the database and the substitutions are applied to the rest of the rule and the head.

Prolog does unification of the proof goal with the rule head. It's necessary there but not with datalog.

kevindamm 3 days ago | parent [-]

While bottom-up evaluation is the norm in datalog, it is not a requirement and there are datalog engines that evaluate top-down or all-at-once.

But I still agree with you about the capitalization. Some formats, like KIF, use a '?' prefix instead, and I've seen some HRF notations that mix the '?' prefix with non-KIF formatting (':-' operator and '.' terminator).