← All Picat Flashcard Decks

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
  1. Which operator is used in Picat to unify two terms?

    Answer: =

    The = operator performs unification in Picat, binding variables so both sides become identical.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.