nltk.inference.mace module

A model builder that makes use of the external ‘Mace4’ package.

class nltk.inference.mace.MaceCommand[source]

Bases: nltk.inference.prover9.Prover9CommandParent, nltk.inference.api.BaseModelBuilderCommand

A MaceCommand specific to the Mace model builder. It contains a print_assumptions() method that is used to print the list of assumptions in multiple formats.

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

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

  • max_models (int) – The maximum number of models that Mace will try before simply returning false. (Use 0 for no maximum.)

property valuation
class nltk.inference.mace.Mace[source]

Bases: nltk.inference.prover9.Prover9Parent, nltk.inference.api.ModelBuilder

__init__(end_size=500)[source]
nltk.inference.mace.spacer(num=30)[source]
nltk.inference.mace.decode_result(found)[source]

Decode the result of model_found()

Parameters

found (bool) – The output of model_found()

nltk.inference.mace.test_model_found(arguments)[source]

Try some proofs and exhibit the results.

nltk.inference.mace.test_build_model(arguments)[source]

Try to build a nltk.sem.Valuation.

nltk.inference.mace.test_transform_output(argument_pair)[source]

Transform the model into various Mace4 interpformat formats.

nltk.inference.mace.test_make_relation_set()[source]
nltk.inference.mace.demo()[source]