pysabelle.raw package
Submodules
pysabelle.raw.commands module
Raw command wrappers corresponding to each Isabelle server command.
Each method sends the appropriate command and returns a typed result.
- class pysabelle.raw.commands.RawCommands(dispatcher)[source]
Bases:
objectLow-level interface to Isabelle server commands.
Each method corresponds to one command defined in §§4.4 of the Isabelle System Manual. Synchronous commands return a
RawReplywhose payload has been parsed into the appropriate dataclass. Asynchronous commands accept an optional on_note callback for progress updates and return the final result after the task completes.- Parameters:
dispatcher (
TaskDispatcher) – TheTaskDispatcherused to send commands and wait for replies.
- async help()[source]
Send the help command.
- Return type:
list[str]- Returns:
List of available command names.
- async echo(value)[source]
Send the echo command.
- Parameters:
value (
Any) – Any JSON-serializable value to echo.- Return type:
Any- Returns:
The same value, as echoed by the server.
- async shutdown()[source]
Send the shutdown command.
Shuts down the server. No reply is expected.
- Return type:
None
- async cancel(task_id)[source]
Send the cancel command to interrupt a running task.
- Parameters:
task_id (
TaskId) – Identifier of the task to cancel.- Return type:
None
- async session_build(args, on_note=None, timeout=None)[source]
Send the session_build command to build a session hierarchy.
- Parameters:
args (
SessionBuildArgs) – Build arguments (session name, options, …).on_note (
Callable[[RawReply],Awaitable[None]] |None) – Optional callback invoked for each NOTE message during the build.timeout (
float|None) – Optional limit in seconds (raisesIsabelleTimeoutError).
- Return type:
- Returns:
Aggregated build results for all required sessions.
- async session_start(args, on_note=None, timeout=None)[source]
Send the session_start command to start a new PIDE session.
- Parameters:
args (
SessionBuildArgs) – Start arguments (session name, options, print mode, …).on_note (
Callable[[RawReply],Awaitable[None]] |None) – Optional callback invoked for each NOTE message during startup.timeout (
float|None) – Optional limit in seconds (raisesIsabelleTimeoutError).
- Return type:
- Returns:
Result containing the new session ID and temporary directory.
- async session_stop(session_id, on_note=None, timeout=None)[source]
Send the session_stop command to terminate a running session.
- Parameters:
- Return type:
- Returns:
Stop result indicating success and return code.
- async use_theories(args, on_note=None, timeout=None)[source]
Send the use_theories command to load and check theories.
- Parameters:
args (
UseTheoriesArgs) – Use-theories arguments (session ID, theory list, options, …).on_note (
Callable[[RawReply],Awaitable[None]] |None) – Optional callback for NOTE messages (progress, nodes status).timeout (
float|None) – Optional limit in seconds (raisesIsabelleTimeoutError).
- Return type:
- Returns:
Results containing per-node status, messages and exports.
- async purge_theories(args)[source]
Send the purge_theories command to unload theories from a session.
- Parameters:
args (
PurgeTheoriesArgs) – Purge arguments (session ID, theory list, all flag).- Return type:
- Returns:
Result listing which theories were purged and which retained.
pysabelle.raw.dispatcher module
Asynchronous task dispatcher for multiplexing replies.
The dispatcher runs a background reader loop that receives raw replies from the transport, classifies them (OK, ERROR, NOTE, FINISHED, FAILED) and routes them to the appropriate waiting futures or callbacks.
- class pysabelle.raw.dispatcher.TaskDispatcher(transport)[source]
Bases:
objectMultiplexes incoming server replies to waiting callers.
The dispatcher owns a background task that continuously reads from the transport. It maintains: - a single _sync_reply future for the next synchronous reply (OK/ERROR) - a dictionary _pending mapping task UUIDs to (future, callback) for async tasks
For asynchronous commands the task is registered in _pending by the reader loop itself, at the moment it reads the immediate
OK {"task": id}reply. This guarantees thatNOTE/FINISHED/FAILEDmessages that follow immediately on the wire (possibly in the same TCP segment) are never lost.Once the reader loop has crashed (e.g. connection lost) or the dispatcher has been stopped, new commands fail immediately with
IsabelleConnectionError.Use run_sync() for commands that return a single immediate reply. Use run_async() for commands that first return an OK with a task ID, then later a FINISHED/FAILED, possibly with intermediate NOTE messages.
- Parameters:
transport (
Transport) – Open transport to the server.
- async run_sync(command, arg=None)[source]
Execute a synchronous command and return its immediate reply.
The command is sent while holding the command lock. The reply must be either OK or ERROR; any other kind is considered a protocol error.
- Parameters:
command (
str) – Name of the command (e.g., “help”, “echo”).arg (
Any) – Optional JSON-serializable argument.
- Return type:
- Returns:
The raw reply (OK or ERROR).
- Raises:
IsabelleCommandError – If the server replies with ERROR.
IsabelleProtocolError – If the reply is neither OK nor ERROR.
- async run_async(command, arg=None, on_note=None, timeout=None)[source]
Execute an asynchronous command and wait for its terminal reply.
The command is sent; the first reply must be OK containing a task ID. Subsequent NOTE messages are delivered to on_note, and the future returned completes when FINISHED or FAILED arrives.
- Parameters:
command (
str) – Name of the command (e.g., “session_build”).arg (
Any) – Optional JSON-serializable argument.on_note (
Callable[[RawReply],Awaitable[None]] |None) – Callback invoked for each NOTE message belonging to this task.timeout (
float|None) – Maximum seconds to wait for the terminal reply. On timeout, and also when the awaiting coroutine is cancelled, a best-effortcancelcommand is sent to the server for this task.
- Return type:
- Returns:
The terminal reply (FINISHED or FAILED).
- Raises:
IsabelleCommandError – If the immediate reply is ERROR or the task fails.
IsabelleProtocolError – If the immediate reply is OK but lacks a task ID.
IsabelleTimeoutError – If the terminal reply does not arrive within timeout.
IsabelleTaskCancelled – If the task ends with FAILED {“message”: “Interrupt”}.
pysabelle.raw.exceptions module
Exception hierarchy for the raw protocol layer.
- exception pysabelle.raw.exceptions.IsabelleError[source]
Bases:
ExceptionRoot exception for all pYsabelle errors (protocol, server process, session).
- exception pysabelle.raw.exceptions.IsabelleConnectionError[source]
Bases:
IsabelleErrorRaised on TCP-level failures: connection refused, EOF, or write error.
- exception pysabelle.raw.exceptions.IsabelleProtocolError[source]
Bases:
IsabelleErrorRaised when a server message violates the §4.2 framing rules.
- exception pysabelle.raw.exceptions.IsabelleCommandError(kind, argument, payload=None)[source]
Bases:
IsabelleErrorRaised when the server replies with
ERRORor a task ends withFAILED.- Parameters:
kind (str)
argument (str)
payload (object)
- Return type:
None
- exception pysabelle.raw.exceptions.IsabelleTimeoutError(task_id, timeout)[source]
Bases:
IsabelleErrorRaised when a task does not complete within the allotted time.
- Parameters:
task_id (str)
timeout (float)
- Return type:
None
- exception pysabelle.raw.exceptions.IsabelleTaskCancelled[source]
Bases:
IsabelleErrorRaised when a task ends with
FAILED {"message": "Interrupt"}.
pysabelle.raw.protocol module
Low-level parsing and encoding of Isabelle server messages (§4.2, §4.3).
- class pysabelle.raw.protocol.ReplyKind(value)[source]
Bases:
str,EnumKind of server reply as defined in §4.2.3.
- OK = 'OK'
- ERROR = 'ERROR'
- FINISHED = 'FINISHED'
- FAILED = 'FAILED'
- NOTE = 'NOTE'
- class pysabelle.raw.protocol.RawReply(kind, argument_raw)[source]
Bases:
objectA raw server reply before semantic interpretation.
- Variables:
kind – The reply kind (OK, ERROR, FINISHED, FAILED, NOTE).
argument_raw – The raw argument string following the kind tag.
- Parameters:
kind (ReplyKind)
argument_raw (str)
- argument_raw: str
- classmethod parse(line)[source]
Parse a single line (or the first line of a long message) into a RawReply.
- Parameters:
line (
str) – The reply line as received from the server (without trailing newline).- Return type:
- Returns:
A RawReply instance.
- Raises:
ValueError – If the line cannot be parsed or the kind is unknown.
- json()[source]
Parse argument_raw as JSON and cache the result.
- Return type:
Any- Returns:
The parsed JSON object, or None if argument_raw is empty.
- get(key, default=None)[source]
Convenience method to extract a key from the JSON payload.
- Parameters:
key (
str) – The key to look up.default (
Any) – Value to return if the payload is not a dict or key is missing.
- Return type:
Any- Returns:
The value for key, or default.
- property task_id: str | None
Extract the task UUID from the JSON payload, if present.
- property is_ok: bool
True if kind is OK.
- property is_error: bool
True if kind is ERROR.
- property is_finished: bool
True if kind is FINISHED.
- property is_failed: bool
True if kind is FAILED.
- property is_note: bool
True if kind is NOTE.
- property is_terminal: bool
True for FINISHED or FAILED (terminal async replies).
- property is_async: bool
True for NOTE, FINISHED, FAILED (all replies that belong to async tasks).
- pysabelle.raw.protocol.encode_long_message(text)[source]
Encode a string as a long message according to §4.2.1.
Format:
<length>\n<text>\nwhere <length> is the decimal byte count of <text> including the trailing newline, exactly as Isabelle’s ownByte_Message.write_line_messagedoes. An uncounted trailing newline would be read by the server as a separate empty message (which it answers with a spuriousNOTE).- Parameters:
text (
str) – The message content (may contain newlines).- Return type:
bytes- Returns:
Encoded bytes ready to be sent over the wire.
- Raises:
ValueError – If the text is too long (internal limit not enforced here).
- pysabelle.raw.protocol.encode_short_message(text)[source]
Encode a string as a short message according to §4.2.1.
Short messages must not contain newline characters. The message is sent as a single line terminated by
\n.- Parameters:
text (
str) – The message content (no newlines allowed).- Return type:
bytes- Returns:
Encoded bytes ready to be sent over the wire.
- Raises:
ValueError – If the text contains a newline.
pysabelle.raw.transport module
Async TCP transport for the Isabelle server protocol.
Async TCP transport implementing the Isabelle byte-message framing protocol (§4.2.1 - §4.2.2).
Transport wraps an asyncio StreamReader / StreamWriter
pair and exposes two primitives:
Both short messages (single LF-terminated line) and long messages (decimal byte-count prefix followed by a body block) are handled transparently on receive, as required by §4.2.1.
Obtain an instance via the async factory Transport.open(), or supply
an already-connected stream pair directly to the constructor.
- class pysabelle.raw.transport.Transport(reader, writer)[source]
Bases:
objectAsync byte-level transport for the Isabelle server protocol (§4.2).
Do not instantiate directly — use
Transport.open()or supply an existing(reader, writer)pair to the constructor.Supports use as an async context manager:
async with await Transport.open(host, port) as t: await t.send(password, is_long_msg=False) reply = await t.receive()
- Parameters:
reader (
StreamReader) – Anasyncio.StreamReaderconnected to the server.writer (
StreamWriter) – Anasyncio.StreamWriterconnected to the server.
- async classmethod open(host='127.0.0.1', port=4711, timeout=30.0)[source]
Open a TCP connection to the Isabelle server.
- Parameters:
host (
str) – Server hostname or IP address (default"127.0.0.1").port (
int) – TCP port (default4711).timeout (
float) – Connection-establishment timeout in seconds.
- Return type:
- Returns:
A connected
Transport.- Raises:
IsabelleConnectionError – If the connection cannot be established within timeout seconds, or if the OS refuses it.
- async send(command, *, is_long_msg=True)[source]
Write one command string to the server.
- Parameters:
command (
str) – Full command text, e.g.'session_start {"session": "HOL"}'.is_long_msg (
bool) – WhenTrue(default) the message is framed as a long message (§4.2.1). SetFalseonly for the initial password exchange (§4.2.4), which requires a plain LF-terminated line.
- Raises:
IsabelleConnectionError – On write errors.
- Return type:
None
- async receive(timeout=None)[source]
Read and decode one server reply message.
Handles both §4.2.1 message framings transparently:
Short message — the first line is the complete reply.
Long message — the first line is a decimal byte-count; the body follows immediately.
- Parameters:
timeout (
float|None) – Optional per-call timeout in seconds.Nonewaits indefinitely.- Return type:
- Returns:
Decoded
RawReply.- Raises:
IsabelleConnectionError – If the server closes the connection.
IsabelleProtocolError – If the data violates §4.2 framing rules or contains an unknown reply name-tag.
asyncio.TimeoutError – If timeout is exceeded.
- property is_closing: bool
Trueif the underlying transport is closing or already closed.
pysabelle.raw.types module
Typed dataclasses mirroring the JSON types defined in §4.3 of the Isabelle System Manual.
All types are pure data containers with from_dict / to_dict methods for JSON (de)serialisation.
- pysabelle.raw.types.UUID
Isabelle UUID — a plain string on the wire.
- class pysabelle.raw.types.TaskId(task)[source]
Bases:
objectWraps the UUID of a running asynchronous task (§4.3
type task).Using a dedicated type prevents accidentally passing a task UUID where a session UUID is expected, and vice versa.
- Variables:
task – Raw UUID string from an
OK {"task": "<uuid>"}reply.- Parameters:
task (str)
- task: str
- class pysabelle.raw.types.SessionId(session_id)[source]
Bases:
objectWraps the UUID of an active PIDE session (§4.3
type session_id).- Variables:
session_id – Raw UUID string from a
FINISHED {"session_id": "<uuid>", …}reply.- Parameters:
session_id (str)
- session_id: str
- pysabelle.raw.types.NoteCallback
Async callable invoked once for every
NOTEmessage belonging to a task. Receives the rawRawReplyso the caller can decode it intoTheoryProgress, a genericMessage, or any other appropriate type.alias of
Callable[[RawReply],Awaitable[None]]
- class pysabelle.raw.types.Position(line=None, offset=None, end_offset=None, file=None, id=None)[source]
Bases:
objectSource position within Isabelle text (§4.3
type position).All fields are optional; only
lineandfileare directly meaningful to external programs. Offset fields are counted in Isabelle symbol units, not bytes.- Variables:
line – 1‑based line number.
offset – Start offset in Isabelle symbol units.
end_offset – End offset in Isabelle symbol units.
file – Canonical file path.
id – PIDE command‑transaction identifier (rarely needed externally).
- Parameters:
line (int | None)
offset (int | None)
end_offset (int | None)
file (str | None)
id (int | None)
- line: int | None = None
- offset: int | None = None
- end_offset: int | None = None
- file: str | None = None
- id: int | None = None
- class pysabelle.raw.types.MessageKind(value)[source]
Bases:
str,EnumKind tag for Isabelle output messages (§4.3).
- WRITELN = 'writeln'
- WARNING = 'warning'
- ERROR = 'error'
- class pysabelle.raw.types.Message(kind, message, pos=None)[source]
Bases:
objectGeneral Isabelle output message (§4.3
type message).- Variables:
kind – Message category —
"writeln","warning", or"error".message – Human‑readable text.
pos – Optional source position associated with the message.
- Parameters:
kind (str)
message (str)
pos (Position | None)
- kind: str
- message: str
- classmethod from_dict(d)[source]
Deserialise from a JSON object.
- Return type:
- Parameters:
d (dict[str, Any])
- property is_error: bool
Trueifkind == "error".
- class pysabelle.raw.types.ErrorMessage(message)[source]
Bases:
objectError message whose
kindis always"error"(§4.3type error_message).- Variables:
message – Error description.
- Parameters:
message (str)
- message: str
- kind: str = 'error'
- class pysabelle.raw.types.TheoryProgress(message, theory, session, percentage=None)[source]
Bases:
objectTheory‑loading progress notification (§4.3
type theory_progress).Arrives as a
NOTEmessage duringsession_buildandsession_starttasks.kindis always"writeln".- Variables:
message – Human‑readable progress description.
theory – Qualified theory name, e.g.
"HOL.Nat".session – Session name, e.g.
"HOL".percentage – Loading percentage in the range 0–100 (optional).
- Parameters:
message (str)
theory (str)
session (str)
percentage (int | None)
- message: str
- theory: str
- session: str
- kind: str = 'writeln'
- percentage: int | None = None
- class pysabelle.raw.types.Timing(elapsed, cpu, gc)[source]
Bases:
objectWall‑clock timing reported by Isabelle in seconds (§4.3
type timing).- Variables:
elapsed – Total wall‑clock time.
cpu – CPU time consumed.
gc – Time spent in garbage collection.
- Parameters:
elapsed (float)
cpu (float)
gc (float)
- elapsed: float
- cpu: float
- gc: float
- class pysabelle.raw.types.NodeStatus(ok, total, unprocessed, running, warned, failed, finished, canceled, consolidated, percentage)[source]
Bases:
objectPIDE document‑model processing status for a theory node (§4.3
type node_status).- Variables:
ok –
Trueifffailed == 0.total – Total number of commands in the node.
unprocessed – Commands not yet started.
running – Commands currently executing.
warned – Commands that produced warnings.
failed – Commands that failed.
finished – Commands that completed successfully.
canceled –
Trueif any command was spontaneously interrupted.consolidated –
Trueonce the outermost theory structure has finished or failed and the finalendcommand is checked.percentage – Progress indicator in the range 0–100; reaches 100 when the node is consolidated.
- Parameters:
ok (bool)
total (int)
unprocessed (int)
running (int)
warned (int)
failed (int)
finished (int)
canceled (bool)
consolidated (bool)
percentage (int)
- ok: bool
- total: int
- unprocessed: int
- running: int
- warned: int
- failed: int
- finished: int
- canceled: bool
- consolidated: bool
- percentage: int
- class pysabelle.raw.types.Node(node_name, theory_name)[source]
Bases:
objectInternal theory node reference (§4.3
type node).- Variables:
node_name – Canonical file‑system path after normalisation, e.g.
"~~/src/HOL/Examples/Seq.thy".theory_name – Session‑qualified theory name, e.g.
"HOL-Examples.Seq".
- Parameters:
node_name (str)
theory_name (str)
- node_name: str
- theory_name: str
- class pysabelle.raw.types.NodeWithStatus(node, status)[source]
Bases:
objectTheory node identity combined with its current processing status.
This is the element type of the
nodes_statuslist emitted inNOTEmessages whennodes_status_delay >= 0is configured inUseTheoriesArgs. Corresponds to the spec typenode ⊕ {status: node_status}.- Variables:
node – Theory node identity.
status – Current processing status.
- Parameters:
node (Node)
status (NodeStatus)
- status: NodeStatus
- class pysabelle.raw.types.SessionBuildArgs(session, preferences=None, options=<factory>, dirs=<factory>, include_sessions=<factory>, verbose=False, print_mode=<factory>)[source]
Bases:
objectArguments shared by
session_build(§4.4.5) andsession_start(§4.4.6).print_modeis accepted here for convenience; it is only meaningful forsession_startand is silently ignored bysession_build.- Variables:
session – Target session name, e.g.
"HOL"or"HOL-Analysis".preferences – Raw preferences text (the file content, not a path).
options – Individual option updates, e.g.
["timeout=60"].dirs – Additional directories containing ROOT or ROOTS files.
include_sessions – Sessions whose theories should be included in the name space (for use with session‑qualified theory names).
verbose – Enable verbose build output.
print_mode – Print mode identifiers for
session_start, e.g.["ASCII"].
- Parameters:
session (str)
preferences (str | None)
options (list[str])
dirs (list[str])
include_sessions (list[str])
verbose (bool)
print_mode (list[str])
- session: str
- preferences: str | None = None
- options: list[str]
- dirs: list[str]
- include_sessions: list[str]
- verbose: bool = False
- print_mode: list[str]
- class pysabelle.raw.types.SessionBuildResult(session, ok, return_code, timeout, timing)[source]
Bases:
objectBuild outcome for a single session within a
session_buildtask (§4.4.5).- Variables:
session – Session name.
ok –
Trueiffreturn_code == 0.return_code – POSIX process exit code.
timeout –
Trueif the build was aborted after exceeding the timeout.timing – Wall‑clock timing for this session’s build.
- Parameters:
session (str)
ok (bool)
return_code (int)
timeout (bool)
timing (Timing)
- session: str
- ok: bool
- return_code: int
- timeout: bool
- class pysabelle.raw.types.SessionBuildResults(ok, return_code, sessions)[source]
Bases:
objectAggregate result of a completed
session_buildtask (§4.4.5).- Variables:
ok –
Trueiff all required sessions were built successfully.return_code – Highest POSIX return code across all sessions.
sessions – Individual build results, one per session in the hierarchy.
- Parameters:
ok (bool)
return_code (int)
sessions (list[SessionBuildResult])
- ok: bool
- return_code: int
- sessions: list[SessionBuildResult]
- class pysabelle.raw.types.SessionStartResult(session_id, tmp_dir)[source]
Bases:
objectResult of a successful
session_starttask (§4.4.6).- Variables:
session_id – Identifier of the newly created PIDE session.
tmp_dir – Path to a temporary directory created for this session; deleted when the session is stopped.
- Parameters:
session_id (SessionId)
tmp_dir (str)
- tmp_dir: str
- class pysabelle.raw.types.SessionStopResult(ok, return_code)[source]
Bases:
objectResult of a
session_stoptask (§4.4.7).- Variables:
ok –
Trueiff the underlying ML process terminated cleanly.return_code – POSIX process exit code.
- Parameters:
ok (bool)
return_code (int)
- ok: bool
- return_code: int
- class pysabelle.raw.types.UseTheoriesArgs(session_id, theories, options=None, master_dir=None, pretty_margin=None, unicode_symbols=None, export_pattern=None, check_delay=None, check_limit=None, watchdog_timeout=None, nodes_status_delay=None)[source]
Bases:
objectArguments for the
use_theoriescommand (§4.4.8).- Variables:
session_id – Identifier of the target session.
theories – Theory names or absolute file paths to load.
options – Individual option updates for this invocation, e.g.
["show_states"](Isabelle2026, §4.4.8; ignored by older servers).master_dir – Base directory for resolving relative theory paths; defaults to the session
tmp_dir.pretty_margin – Line width used for pretty‑printing output messages; default is 76.
unicode_symbols – When
True, render Isabelle symbols as Unicode in output rather than keeping their symbolic representation.export_pattern – Pattern selecting theory exports (e.g.
"*:*"); empty orNonedisables export retrieval.check_delay – Seconds between consolidation status checks; default 0.5.
check_limit – Maximum number of checks; 0 means unbounded.
watchdog_timeout – Seconds of PIDE inactivity before aborting; default 600; 0 disables the watchdog.
nodes_status_delay – Seconds between
NOTE nodes_statusmessages; negative disables them (default −1).
- Parameters:
session_id (SessionId)
theories (list[str])
options (list[str] | None)
master_dir (str | None)
pretty_margin (float | None)
unicode_symbols (bool | None)
export_pattern (str | None)
check_delay (float | None)
check_limit (int | None)
watchdog_timeout (float | None)
nodes_status_delay (float | None)
- theories: list[str]
- options: list[str] | None = None
- master_dir: str | None = None
- pretty_margin: float | None = None
- unicode_symbols: bool | None = None
- export_pattern: str | None = None
- check_delay: float | None = None
- check_limit: int | None = None
- watchdog_timeout: float | None = None
- nodes_status_delay: float | None = None
- class pysabelle.raw.types.Export(name, base64, body)[source]
Bases:
objectSingle theory export item returned by
use_theories(§4.4.8).- Variables:
name – Compound export name in
"theory/name"format.base64 –
Trueifbodyis base64‑encoded binary;Falseif it is plain UTF‑8 text.body – Export content — either UTF‑8 text or a base64 string.
- Parameters:
name (str)
base64 (bool)
body (str)
- name: str
- base64: bool
- body: str
- class pysabelle.raw.types.NodeResults(status, messages, exports)[source]
Bases:
objectProcessing results for a single theory node (§4.4.8
type node_results).- Variables:
status – Final processing status of the node.
messages – All prover messages produced while checking this node.
exports – Theory exports matching the requested pattern.
- Parameters:
status (NodeStatus)
messages (list[Message])
exports (list[Export])
- status: NodeStatus
- class pysabelle.raw.types.NodeResultEntry(node, results)[source]
Bases:
objectOne entry in
use_theories_results.nodes(§4.4.8).The spec type is
node ⊕ node_results— a flat JSON merge of node identity and processing results. This class separates the two concerns into typed fields for clarity.- Variables:
node – Theory node identity.
results – Processing results for that node.
- Parameters:
node (Node)
results (NodeResults)
- results: NodeResults
- class pysabelle.raw.types.UseTheoriesResults(ok, errors, nodes)[source]
Bases:
objectFinal result of a completed
use_theoriestask (§4.4.8).- Variables:
ok –
Trueiff all nodes were processed without errors.errors – All error messages across every node (with position info).
nodes – Per‑node identity and detailed processing results.
- Parameters:
ok (bool)
errors (list[Message])
nodes (list[NodeResultEntry])
- ok: bool
- nodes: list[NodeResultEntry]
- class pysabelle.raw.types.PurgeTheoriesArgs(session_id, theories=<factory>, master_dir=None, all=False)[source]
Bases:
objectArguments for the
purge_theoriescommand (§4.4.9).- Variables:
session_id – Identifier of the target session.
theories – Theory node names to remove — use
node_namevalues fromNodeResultEntry.nodefor precision.master_dir – Base directory for relative paths; defaults to the session
tmp_dir.all – When
True, attempt to purge all currently loaded theories.
- Parameters:
session_id (SessionId)
theories (list[str])
master_dir (str | None)
all (bool)
- theories: list[str]
- master_dir: str | None = None
- all: bool = False
- class pysabelle.raw.types.PurgeTheoriesResults(purged, retained)[source]
Bases:
objectResult of a
purge_theoriescommand (§4.4.9).The manual gives the type as
{purged: [string]}, but the server (verified with Isabelle2025-2) returns lists ofnodeobjects for both fields; plain strings are still accepted for robustness.- Variables:
purged – Theory nodes that were actually removed from the session.
retained – Remaining loaded nodes (the complement of
purged), e.g. those still imported by other theories or used by pending tasks.
- Parameters:
Module contents
Raw protocol layer: transport, dispatcher, commands and types.
This package contains the low-level implementation of the Isabelle Server protocol. All public symbols are re-exported here for convenience.