โ† All Picat Flashcard Decks

Picat String and I/O Operations 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 String and I/O Operations flashcards as text
  1. Which built-in opens a file for writing in Picat?

    Answer: open(File, write, Stream)

    `open(File, write, Stream)` opens a file for writing and binds the resulting stream to Stream.

  2. What predicate writes a term followed by a newline to standard output in Picat?

    Answer: writeln(T)

    `writeln(T)` writes term T to standard output and appends a newline character.

  3. How do you close a file stream after I/O operations in Picat?

    Answer: close(Stream)

    `close(Stream)` closes an open file stream, freeing the associated resources.

  4. Which format specifier prints an integer inside Picat's `format` predicate?

    Answer: ~d

    Picat's `format` predicate uses `~d` to print an integer argument.

  5. What does `read_term(Stream, Term, Options)` accomplish in Picat?

    Answer: Reads and parses a Picat term from a stream

    `read_term/3` reads and parses a complete Picat term from the given stream using the provided options.

  6. Which predicate forces buffered output to be written to a stream immediately in Picat?

    Answer: flush_output(Stream)

    `flush_output(Stream)` forces any buffered output to be physically written to the stream.