nltk.inference.ResolutionProverCommand

class nltk.inference.ResolutionProverCommand[source]

Bases: BaseProverCommand

__init__(goal=None, assumptions=None, prover=None)[source]
Parameters
  • goal (sem.Expression) – Input expression to prove

  • assumptions (list(sem.Expression)) – Input expressions to use as assumptions in the proof.

prove(verbose=False)[source]

Perform the actual proof. Store the result to prevent unnecessary re-proving.

find_answers(verbose=False)[source]
add_assumptions(new_assumptions)[source]

Add new assumptions to the assumption list.

Parameters

new_assumptions (list(sem.Expression)) – new assumptions

assumptions()[source]

List the current assumptions.

Returns

list of Expression

decorate_proof(proof_string, simplify=True)[source]

Modify and return the proof string :param proof_string: str the proof to decorate :param simplify: bool simplify the proof? :return: str

get_prover()[source]

Return the prover object :return: Prover

goal()[source]

Return the goal

Returns

Expression

print_assumptions()[source]

Print the list of the current assumptions.

proof(simplify=True)[source]

Return the proof string :param simplify: bool simplify the proof? :return: str

retract_assumptions(retracted, debug=False)[source]

Retract assumptions from the assumption list.

Parameters
  • debug (bool) – If True, give warning when retracted is not present on assumptions list.

  • retracted (list(sem.Expression)) – assumptions to be retracted