Prolog is the most commonly used logic programming language. It supports non-deterministic programming through backtracking and pattern matching through unification.
Questions tagged [prolog]
38 questions
11
votes
3 answers
How often is Prolog/ASP used in non-research areas?
I've just recently found out about KRR (Knowledge representation and Reasoning) and ASP, not hearing a thing about them before (except a bit about prolog). I've read a bit about them and one of their primary usage seems to be AIs.
My question would…

FloriOn
- 211
- 1
- 3
2
votes
1 answer
How to determine if prolog query will give an answer or not?
Explain what will happen if we try to evaluate the query “path(a,e).”. When the query was actually run, it kept looping.I used the following method. Is it correct?
When evaluating $path(Z,e)$, if $path(Z,e):-edge(Z,e)$ was chosen, it would have…

Amy Cohen
- 45
- 5
0
votes
1 answer
Given a definite program, how do I obtain its Herbrand base?
Given a definite program, how can I obtain its Herbrand base?
For instance, given the program $P$ below, what is its Herbrand base $B_P$?
$p(f(x)) \leftarrow p(x)$
$q(a) \leftarrow p(x)$
I know the definition of Herbrand base for a first-order…

Gabriel F. Silva
- 310
- 3
- 8
0
votes
0 answers
How can I translate this following simple statements to prolog
These are simple statements:
Marcus was a man
Marcus was a Roman
All men are people
Caesar was a ruler
All Romans were either loyal to Caesar or hated him
Everyone is loyal to someone.
People only try to assassinate rulers they are not loyal…
0
votes
1 answer
Headless Prolog?
I've been playing around with prolog and realised something. You can do everything without predicate names.
e.g.
Just change all predicates
$$a(b,c,d,e,..)$$
into
$$prop(a,b,c,d,e,..)$$
Where $prop$ is some character that you can use for all…

zooby
- 263
- 1
- 5
-2
votes
1 answer
Resolution in prolog
What exaclty is resolution in prolog and how does it enables Prolog to obtain the following answer:
?- sublist([b,c],[a,b,c]).
true

Amit wadhwa
- 59
- 4