Solutions
Scare(hagrid,dudley).
Functors always have to be atoms, but atoms cannot start with a
capital letter.
Correction: scare(hagrid,dudley).
hate(uncle vernon,X) :- magical(X).
Atoms cannot contain spaces (and neither can variables, by the
way) unless the whole atom is enclosed in single quotes. So, the
problem is uncle vernon
.
Correction: hate(uncle_vernon,X) :- magical(X).
or
hate('uncle vernon',X) :- magical(X).
hate(aunt_petunia,X :- magical(X).
The head of the rule (what comes before :-
) should
be a complex term. All arguments have to be between an opening
and a closing parenthesis. In Line 14, the closing parenthesis
is missing.
Correction: hate(aunt_petunia,X) :- magical(X).
hate(aunt_petunia,X) :-
scare(X,dudley)
All clauses (facts and rules) have to end with a full stop. In
Line 17, this full stop is missing.
Correction: hate(aunt_petunia,X) :-
scare(X,dudley)