General Flashcards
7 cards from real Picat practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 General flashcards as text
Which operator is used in Picat to unify two terms?
Answer: =
The = operator performs unification in Picat, binding variables so both sides become identical.
What does the `not` predicate do in Picat?
Answer: Negation as failure — succeeds if goal fails
In Picat, `not(Goal)` succeeds when Goal fails and fails when Goal succeeds, implementing negation-as-failure.
What is the role of the `module` declaration in a Picat source file?
Answer: Defines a namespace for predicates and functions
A `module` declaration names the compilation unit and controls which predicates are exported as part of Picat's module system.
In Picat, what symbol introduces a clause head-body separator in a rule?
Answer: =>
Picat uses `=>` (fat arrow) as the clause separator between the head pattern/guard and the body of a rule.
Which built-in predicate checks whether a term is a free (uninstantiated) variable in Picat?
Answer: var(X)
`var(X)` succeeds when X is an uninstantiated variable, following the standard logic-programming convention.
What happens when a Picat rule uses `?=>` instead of `=>`?
Answer: Backtracking into the rule is allowed
`?=>` marks a non-deterministic rule, allowing the runtime to backtrack into it on failure, while `=>` commits once the head matches.
Which Picat module provides common list operations such as `append` and `member`?
Answer: lists
The `lists` module in Picat supplies standard list predicates including append/3, member/2, and related utilities.