I'm learning GNU Prolog and need to understand how to read a single character from an input stream. Could you tell me the predicate used for this, its expected input/output (template), and what specific error occurs if the stream isn't open, including the error type and object?
Navigate to the GNU Prolog Manual's main page (gprolog.org/manual/gprolog.html). Navigate to the 'Streams' section (Section 8.10). Locate and navigate to the 'Character input/output' subsection (Section 8.12). Find the documentation for the `get_char/1` predicate. Identify the template for `get_char/1`. Identify the error information for `get_char/1` when the stream is not associated with an open stream, including the ErrorTerm and Object type.
Identify `get_char/1` as the predicate to read a single character. State the template for `get_char/1` as `get_char(?char_code)`. State that an `existence_error` occurs if the stream is not associated with an open stream. Specify the `Object` type for this `existence_error` as `stream`.