Nltk could not find mace4
While executing the code below, I am getting an error.
I downloaded the required package from http://www.cs.unm.edu/~mccune/prover9/download/ and configured. But still the same question.
I am getting this error:
>>> import nltk
>>> dt = nltk.DiscourseTester(['A student dances', 'Every student is a person'])
>>> dt.readings()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/nltk/inference/discourse.py", line 351, in readings
self._construct_threads()
File "/usr/local/lib/python2.7/dist-packages/nltk/inference/discourse.py", line 297, in _construct_threads
consistency_checked = self._check_consistency(self._threads)
File "/usr/local/lib/python2.7/dist-packages/nltk/inference/discourse.py", line 393, in _check_consistency
modelfound = mb.build_model()
File "/usr/local/lib/python2.7/dist-packages/nltk/inference/api.py", line 333, in build_model
verbose)
File "/usr/local/lib/python2.7/dist-packages/nltk/inference/mace.py", line 202, in _build_model
verbose=verbose)
File "/usr/local/lib/python2.7/dist-packages/nltk/inference/mace.py", line 215, in _call_mace4
self._mace4_bin = self._find_binary('mace4', verbose)
File "/usr/local/lib/python2.7/dist-packages/nltk/inference/prover9.py", line 166, in _find_binary
verbose=verbose)
File "/usr/local/lib/python2.7/dist-packages/nltk/internals.py", line 544, in find_binary
binary_names, url, verbose))
File "/usr/local/lib/python2.7/dist-packages/nltk/internals.py", line 538, in find_binary_iter
url, verbose):
File "/usr/local/lib/python2.7/dist-packages/nltk/internals.py", line 517, in find_file_iter
raise LookupError('\n\n%s\n%s\n%s' % (div, msg, div))
LookupError:
===========================================================================
NLTK was unable to find the mace4 file!
Use software specific configuration paramaters or set the PROVER9HOME environment variable.
Searched in:
- /usr/local/bin/prover9
- /usr/local/bin/prover9/bin
- /usr/local/bin
- /usr/bin
- /usr/local/prover9
- /usr/local/share/prover9
When configuring LADR-2009-11 through a make all
completed process with
.o utilities.o provers.o foffer.o ../ladr/libladr.a
search.o: In function `search':
search.c:(.text+0x6e54): undefined reference to `round'
../ladr/libladr.a(avltree.o): In function `avl_item_at_position':
avltree.c:(.text+0x7cb): undefined reference to `ceil'
collect2: error: ld returned 1 exit status
make[1]: *** [prover9] Error 1
make[1]: Leaving directory `/root/Desktop/karim/software/LADR-2009-11A/provers.src'
make: *** [all] Error 2
source to share
NLTK was unable to find the mace4
and
make: *** [all] Error 2
It might be obvious, but you need to have a successful LADR / Prover9 build. Only then can you use nltk.Prover9()
ornltk.MaceCommand(...)
so why is there a compilation error? see possible answers here use gcc flags: -std=c99
and-lm
in your makefile
source to share
User @mircea has already answered a similar question about Prover9 and Mace. Check Unable to open Prover9 and Mace . It is about setting the path to your library, for example
prover = nltk.Prover9()
prover.config_prover9(r'd:/prover9/bin')
source to share
I fixed my problem by changing the nltk / inference / prover9.py file. On line 144, where binary_locations(self)
defined, I added the path to this folder:
C:\Program Files (x86)\Prover9-Mace4\bin-win32
(Note: this is not a profile folder, but a bin-win32 subfolder). There you will find files prover9.exe
and mace4.exe
.
Finally, I don't know if this is actually relevant, but I downloaded the GUI found here: http://www.cs.unm.edu/~mccune/prover9/gui/v05.html . Using windows 10
source to share
I had the same problem today. Fixed moving -lm
to end of line on all lines with -lm
. Change the file Makefile
in LADR-2009-11A/provers.src
to look like this:
65 prover9: prover9.o $(OBJECTS)
66 $(CC) $(CFLAGS) -o prover9 prover9.o $(OBJECTS) ../ladr/libladr.a -lm
67
68 fof-prover9: fof-prover9.o $(OBJECTS)
69 $(CC) $(CFLAGS) -o fof-prover9 fof-prover9.o $(OBJECTS) ../ladr/libladr.a -lm
70
71 ladr_to_tptp: ladr_to_tptp.o $(OBJECTS)
72 $(CC) $(CFLAGS) -o ladr_to_tptp ladr_to_tptp.o $(OBJECTS) ../ladr/libladr.a -lm
73
74 tptp_to_ladr: tptp_to_ladr.o $(OBJECTS)
75 $(CC) $(CFLAGS) -o tptp_to_ladr tptp_to_ladr.o $(OBJECTS) ../ladr/libladr.a -lm
76
77 autosketches4: autosketches4.o $(OBJECTS)
78 $(CC) $(CFLAGS) -o autosketches4 autosketches4.o $(OBJECTS) ../ladr/libladr.a -lm
79
80 newauto: newauto.o $(OBJECTS)
81 $(CC) $(CFLAGS) -o newauto newauto.o $(OBJECTS) ../ladr/libladr.a -lm
82
83 newsax: newsax.o $(OBJECTS)
84 $(CC) $(CFLAGS) -o newsax newsax.o $(OBJECTS) ../ladr/libladr.a -lm
source to share