7

While executing below code, I am getting error as mentioned.

I downloaded the required package from http://www.cs.unm.edu/~mccune/prover9/download/ and configure. But still same issue.

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

While configuring the LADR-2009-11 through make all, ended 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
user123
  • 5,269
  • 16
  • 73
  • 121

5 Answers5

1

Here is what worked for me. I found it on github issue 193

In brief

  • download gui
  • download dll
  • place downloaded dll in C:\Program Files (x86)\Prover9-Mace4
  • create Windows system environment variable PROVER9 and set it to C:\Program Files (x86)\Prover9-Mace4\bin-win32
user1700890
  • 7,144
  • 18
  • 87
  • 183
0
NLTK was unable to find the mace4

and

make: *** [all] Error 2

Maybe it's obvious, but you need to have a successful build of LADR/Prover9. Only after that, you can use nltk.Prover9() or nltk.MaceCommand(...)

so why is there an compilation error? see some possible answers here use gcc flags: -std=c99 and -lm in your make file

Community
  • 1
  • 1
mircea
  • 91
  • 3
0

The user @mircea already answered a similar question about Prover9 and Mace. Check it out Unable to Open Prover9 and Mace . It is about setting the path to your library like

prover = nltk.Prover9() prover.config_prover9(r'd:/prover9/bin')

Community
  • 1
  • 1
Fidel Orozco
  • 998
  • 11
  • 19
0

I fixed my problem by modifying the nltk/inference/prover9.py file. In line 144, where binary_locations(self) is defined I added the path to this folder:

C:\Program Files (x86)\Prover9-Mace4\bin-win32 (Notice: not the prover folder, but the bin-win32 subfolder). There you will find both the prover9.exe and the mace4.exe files.

Lastly, I don't know if this is relevant but I downloaded the GUI found here: http://www.cs.unm.edu/~mccune/prover9/gui/v05.html. Using windows 10

Kostas Mouratidis
  • 1,145
  • 2
  • 17
  • 30
0

I had the exact same problem today. Fixed it by moving -lm to the end of the line in all the lines involving -lm. Edit file Makefile in LADR-2009-11A/provers.src to make it look like the following:

 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
alys
  • 331
  • 3
  • 10