UGC-NET Jun 2015 · Uninformed Search (BFS, DFS, UCS)

MCQ · 2 marks · Problem AI-ASRC-0018

Which of the following is false for the programming language PROLOG?
  1. A
    A PROLOG variable can only be assigned to a value once
  2. B
    PROLOG is a strongly typed language
  3. C
    The scope of a variable in PROLOG is a single clause or rule
  4. D
    The scope of a variable in PROLOG is a single query

Solve it on GATE DA practice →More Search Strategies problems

Show the worked solutionProlog is a dynamically typed (essentially untyped) language: a variable can be bound to an atom, number or structure, and types are not declared or checked at compile time. So "Prolog is strongly typed" is false.(A) A logic variable, once bound (unified), cannot be reassigned — true.(C) A variable's scope is the clause (rule) in which it appears — true.(D) Within a query, the variable's scope is that query — true.Answer: B

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com