UGC-NET Jun 2014 · Uninformed Search (BFS, DFS, UCS)
MCQ · 2 marks · Problem AI-ASRC-0034
Which of the following describe the syntax of a Prolog program?I. Rules and facts are terminated by a full stop (.)II. Rules and facts are terminated by a semicolon (;)III. Variable names must start with an upper-case letter.IV. Variable names must start with a lower-case letter.
Show the worked solutionI. Every Prolog clause (fact or rule) ends with a full stop, e.g. parent(tom, bob). True.II. A semicolon means "or" inside a rule body; it does not terminate a clause. False.III. Variables start with an upper-case letter (or an underscore), e.g. X, Person. True.IV. Names starting with a lower-case letter are atoms (constants), not variables. False.So I and III.Answer: C
GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com