Picat Cheat Sheet 2026

The 30 highest-yield Picat facts, distilled from real exam questions. Print it, save it as a PDF, or study it here — free, no sign-up.

145 questions
165 min time limit
31% to pass
  1. Which Picat built-in can be used to inspect or clear the tabling store at runtime? abolish_table_pred/1
  2. What is the output of `writeln(2 ** 10)` in Picat? 1024
  3. Which predicate finds a cost-optimal plan in Picat's planner module? best_plan/2
  4. How do you import the `io` module in a Picat program? :- import io.
  5. What does `spy(Predicate)` do in Picat? Sets a breakpoint on a specific predicate
  6. Silicon chips are mostly utilized in integrated circuits
  7. What predicate writes a term followed by a newline to standard output in Picat? writeln(T)
  8. What term describes organisms that can produce their own food using sunlight? Autotrophs
  9. Which predicate in Picat's CP module finds a solution that minimizes a given objective expression? solve([min(Obj)], Vars)
  10. Which pattern matches a non-empty list in Picat? [_|_]
  11. Which Picat construct provides a `do ... while` style loop that tests the condition at the end? Picat has no post-condition loop construct
  12. The word COHERENT most nearly means: logical
  13. How does Picat handle arithmetic evaluation — must you use a special operator? Yes, use X = Y evaluates; without it, expressions remain unevaluated terms
  14. The word SURPLUS most nearly means: excess
  15. Friendly most of the time Friendly
  16. What is the key reason you cannot use a predicate directly inside a list comprehension expression in Picat? List comprehensions expect expressions that yield values, which only functions provide
  17. Which default search strategy does Picat's planner module employ? Iterative-deepening depth-first search
  18. Which predicate reads a full line from standard input in Picat? read_line(L)
  19. What does the second argument in `error(ErrorTerm, Context)` provide in Picat? Context information about where the error occurred
  20. A Picat script needs to be executed from the command line with several arguments. How can the script access these arguments? By calling `sys:get_args()`
  21. What does `plan_unbounded/2` do differently from `plan/2`? It searches without any cost bound, potentially exploring all reachable states
  22. The word ARBITRARY most nearly means: random
  23. How do you generate the 7-times multiplication table (7×1 through 7×10) as a list using a Picat list comprehension? [7*X : X in 1..10]
  24. Which planet in our solar system is closest to the Sun? Mercury
  25. What type constraint applies to the Cost argument in `action(State, NextState, Action, Cost)`? It must be a non-negative number
  26. In Picat, what is the scope of a variable assigned inside a `foreach` loop body? It is visible in the enclosing function after the loop ends
  27. Which operator concatenates two strings or lists in Picat? S1 ++ S2
  28. What does the second argument of `plan/2` return after a successful call? A list of action terms constituting the plan
  29. To execute an external command-line program (e.g., `ls -l` or `dir`) from within a Picat script and capture its output, which predicate is most suitable? os:shell(Command, Output)
  30. Which Picat pattern would match a struct term `point(X, Y)` only when both coordinates are integers? point(X, Y), integer(X), integer(Y) => ...
Turn these facts into recall:
Was this helpful?