โ† All Picat Flashcard Decks

Picat Exception Handling and Debugging Flashcards

6 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 6 Picat Exception Handling and Debugging flashcards as text
  1. Which built-in activates Picat's execution tracer for debugging?

    Answer: trace

    `trace` activates the Picat tracer, printing each goal as it is called, exited, or failed.

  2. What does `spy(Predicate)` do in Picat?

    Answer: Sets a breakpoint on a specific predicate

    `spy(Predicate)` sets a spy point so the debugger activates only when that predicate is called.

  3. Which predicate prints the current execution call stack in Picat?

    Answer: print_backtrace

    `print_backtrace` prints the current execution stack, which is helpful for diagnosing errors.

  4. How do you measure the execution time of a goal in Picat?

    Answer: time(Goal)

    `time(Goal)` executes Goal and prints the elapsed wall-clock time and inference count.

  5. What does `listing(Predicate)` display in Picat's interactive session?

    Answer: The source clauses of the named predicate

    `listing(Predicate)` prints all source clauses for the specified predicate to standard output.

  6. Which flag setting causes Picat to throw an error when an undefined predicate is called?

    Answer: unknown = error

    Setting the `unknown` flag to `error` causes Picat to throw `existence_error` for undefined predicate calls.