this post was submitted on 03 Jan 2025
45 points (92.5% liked)

Programmer Humor

32866 readers
1100 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

something is a person if it is either Adam or Eve, or if it has a mother. We can express this in a single rule as follows:

person(X) :- (X=adam; X=eve; mother(X, Y)).

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 13 points 1 week ago (2 children)

I learned Prolog in university and it was instructive. But has anyone ever professionally used it?

[–] [email protected] 3 points 1 week ago

DataLog is used to verify smart contracts. I don't know any specific examples of prolog used in the industry, though I am sure there are a few. Probably, there are expert systems implemented with prolog that are still used.

Logic programming in general has a few usages, the unification algorithm is used for pretty much every type system. Also, it is quite good for verification systems. For example, I know some symbolic execution systems implemented in OCaml.