ccobra.propositional

Propositional submodule.

Classes

class ccobra.propositional.PropositionalTaskEncoder[source]

Syllogistic encoder. Provides functions for abbreviating syllogistic tasks.

static encode_clause(clause)[source]

Encodes a single clause by parsing the Polish normal form.

Parameters

clause (list(str)) – Propositional clause in list representation (e.g., [‘If’, ‘not’, ‘A’, ‘B’]).

Returns

String representation of the input clause (e.g., “~A -> B”).

Return type

str

static encode_task(task)[source]

Encodes a task to its propositional encoding.

Parameters

task (list(list(str))) – Propositional task as a list of clauses (e.g., [[“If”, “A”, “B”], [“A”]]).

Returns

String representation of the propositional task.

Return type

str

class ccobra.propositional.PropositionalResponseEncoder[source]

Syllogistic encoder. Provides functions for abbreviating syllogistic responses.

static encode_clause(clause)[source]

Encodes a single clause by parsing the Polish normal form.

Parameters

clause (list(str)) – Propositional clause in list representation (e.g., [‘If’, ‘not’, ‘A’, ‘B’]).

Returns

String representation of the input clause (e.g., “~A -> B”).

Return type

str

static encode_response(response, task)[source]

Encodes a response to its propositional encoding.

Parameters
  • response (list(str)) – Propositional response in list representation (e.g., [“not”, “A”]).

  • task (list(list(str))) – Propositional task as a list of clauses (e.g., [[“If”, “A”, “B”], [“A”]]).

Returns

String representation of the propositional response.

Return type

str