agent_logic.cli

Command-line interface for the agent-logic package.

This module provides a command-line interface for interacting with the agent-logic package, including tools for validating proofs and other logical operations.

Usage:

python -m agent_logic.cli –help python -m agent_logic.cli validate path/to/proof.json python -m agent_logic.cli –log-level DEBUG validate path/to/proof.json

Functions

main()

Main entry point for the CLI.

parse_args()

Parse command-line arguments.

validate_proof(proof_file[, debug])

Validate a proof from a JSON file.

agent_logic.cli.main()[source]

Main entry point for the CLI.

Parses command-line arguments, sets up logging, and executes the appropriate command.

Returns:

Exit code (0 for success, non-zero for errors).

agent_logic.cli.parse_args()[source]

Parse command-line arguments.

Returns:

Parsed command-line arguments as an argparse.Namespace object.

agent_logic.cli.validate_proof(proof_file, debug=False)[source]

Validate a proof from a JSON file.

Loads a proof from a JSON file and checks if it is valid according to the specified inference rules.

Parameters:
  • proof_file – Path to the JSON file containing the proof.

  • debug – Whether to enable debug mode in the proof validation.

Returns:

Exit code (0 for success, 1 for invalid proof, 2 for errors).

Raises:
  • FileNotFoundError – If the proof file doesn’t exist.

  • json.JSONDecodeError – If the file contains invalid JSON.