GithubHelp home page GithubHelp logo

digama0 / mmj2 Goto Github PK

View Code? Open in Web Editor NEW
72.0 11.0 25.0 22.7 MB

mmj2 GUI Proof Assistant for the Metamath project

License: GNU General Public License v2.0

Java 90.54% Shell 0.22% HTML 1.14% Batchfile 0.83% Objective-C++ 6.17% JavaScript 1.12%

mmj2's Introduction

README for mmj2

mmj2 is a proof assistant for the Metamath language. Metamath is a language that lets you express mathematical axioms and theorems. The proof assistant includes a GUI for creating proofs, proof verification tools, and grammatical/syntax analysis.

mmj2 was originally developed by Mel O'Cat 2005-2011. This version has been further modified by Mario Carneiro and David A. Wheeler. This program is released under the terms of the GNU General Public License Version 2 or any later version (SPDX license identifier GPL-2.0-or-later); see LICENSE.TXT.

Installation

Refer to INSTALL.md for instructions on how to install mmj2. This includes installing a Java runtime if you don't already have one (since mmj2 requires a Java runtime).

Interactive Tutorial

Once you have installed mmj2, if you've not used mmj2 before, be sure to try the interactive tutorial (which ought to take about an hour).

Quick Start

See Quick Start if you want to quickly get running.

More information

Once you've installed mmj2, the following pages may be useful:

Contributing

If you want to contribute to this version of mmj2, please submit issues, pull requests, etc., to: https://github.com/digama0/mmj2

MMj2 was initially developed by Mel O'Cat. If you wish to provide financial support or send questions to Mel O'Cat, see mel-contact.md.

Limitations

  • mmj2 takes a time to get started (circa 60 seconds on a slow machine loading the large database set.mm). Java programs are slow to start up in general, and like Metamath.exe, when a database is selected, it loads the entire Metamath .mm database into memory and does computations on that. The first unification can also take several seconds. Once it gets started and you've done your first unification it should generally be quite fast.
  • As noted in the license, there is NO WARRANTY.
  • It has a few minor automation mechanisms, but it is fundamentally designed to help a human create proofs, not replace humans.
  • It does not update Metamath .mm databases. Once you complete a proof, you have to use another tool (like a text editor) to put the proof into database. Writing a proof takes far more time copying it into a database, so this has not been seen as a serious problem.
  • It is a single-user system, not designed for concurrent access throughout (but you can run more than one instance of mmj2's Proof Assistant GUI simultaneously.)
  • All messages are output in English.
  • All output is left-to-right.
  • Support for Unicode or non-ASCII input/output is minimal. (Note that the metamath specification itself requires ASCII input.)

mmj2's People

Contributors

david-a-wheeler avatar dependabot[bot] avatar digama0 avatar icecream17 avatar ishanpm avatar jkingdon avatar jn1z avatar josojo avatar jvierling avatar ml-2 avatar steelart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmj2's Issues

Proofs are broken since this morning.

I have tried to use mmj2 for proofs. So far so good.
But in the morning it generates me wrong proofs that give issues when i try to import the results into set.mm.

$( <MM> <PROOF_ASST> THEOREM=syllogism LOC_AFTER=


h1::syllogism.1 |- ( ph -> M e. ZZ ) 
h2::syllogism.2 |- ( ph -> N e. ZZ ) 
h3::syllogism.3 |- ( ph -> M <_ N ) 
h4::syllogism.4 |- ( ph -> K e. NN0 ) 
h5::syllogism.5 |- ( ( ph /\ k e. ( M ... ( N + K ) ) ) -> A e. CC ) 
10:2:zred          |- ( ph -> N e. RR )
11:10:ltp1d        |- ( ph -> N < ( N + 1 ) )
12::fzdisj         |- (  N < ( N + 1 )
                      ->   ( ( M ... N ) i^i ( ( N + 1 ) ... ( N + K ) ) )
                         = (/) )
13:11,12:syl       |- (  ph
                      ->   ( ( M ... N ) i^i ( ( N + 1 ) ... ( N + K ) ) )
                         = (/) )
14:4:nn0zd         |- ( ph -> K e. ZZ )
15:2,14:zaddcld    |- ( ph -> ( N + K ) e. ZZ )
16::nn0addge1      |- ( ( N e. RR /\ K e. NN0 ) -> N <_ ( N + K ) )
17:10,4,16:syl2anc |- ( ph -> N <_ ( N + K ) )
18::elfz4          |- (  (  ( M e. ZZ /\ ( N + K ) e. ZZ /\ N e. ZZ )
                         /\ ( M <_ N /\ N <_ ( N + K ) ) )
                      -> N e. ( M ... ( N + K ) ) )
19:1,15,2,3,17,18:syl32anc    
                   |- (  ph
                      -> N e. ( M ... ( N + K ) ) )
20::fzsplit        |- (  N e. ( M ... ( N + K ) )
                      ->   ( M ... ( N + K ) )
                         = ( ( M ... N ) u. ( ( N + 1 ) ... ( N + K ) ) ) )
21:19,20:syl       |- (  ph
                      ->   ( M ... ( N + K ) )
                         = ( ( M ... N ) u. ( ( N + 1 ) ... ( N + K ) ) ) )
22::fzfid          |- ( ph -> ( M ... ( N + K ) ) e. Fin )
qed:13,21,22,5:fprodsplit 
                   |- (  ph
                      ->   prod_ k e. ( M ... ( N + K ) ) A
                         = ( prod_ k e. ( M ... N ) A
                             x.
                             prod_ k e. ( ( N + 1 ) ... ( N + K ) ) A ) )


      
$=  ( syllogism.2 syllogism.1 syllogism.4 syllogism.3 syllogism.5 cfz
    co caddc wbr wceq syl wcel cz cle c1 clt cin c0 zred ltp1d fzdisj
    cun nn0zd zaddcld cr cn0 nn0addge1 syl2anc elfz4 syl32anc fzsplit
    fzfid fprodsplit ) AEFLMZFUANMZFDNMZLMZBEVBLMZCAFVAUBOUTVCUCUDPAF
    AFGUEZUFEFVAVBUGQAFVDRZVDUTVCUHPAESRVBSRFSREFTOFVBTOZVFHAFDGADIUI
    UJGJAFUKRDULRVGVEIFDUMUNFEVBUOUPFEVBUQQAEVBURKUS $.
$d K k 
$d M k 
$d N k 
$d k ph 
$) 

And here is the metamath output

$ ./rewrap.sh
Metamath - Version 0.199.pre 29-Jan-2022      Type HELP for help, EXIT to exit.
MM> read D:\metamath\set.mm\set.mm
Reading source file "D:\metamath\set.mm\set.mm"... 44359149 bytes
44359149 bytes were read into the source buffer.
The source has 212383 statements; 2812 are $a and 42097 are $p.
No errors were found.  However, proofs were not checked.  Type VERIFY PROOF *
if you want to check them.
MM> write source D:\metamath\set.mm\set.mm /rewrap
The input file will be renamed D:\metamath\set.mm\set.mm~1.
Writing "D:\metamath\set.mm\set.mm"...
212383 source statement(s) were written.
MM> erase
Metamath has been reset to the starting state.
MM> read D:\metamath\set.mm\set.mm
Reading source file "D:\metamath\set.mm\set.mm"... 44359149 bytes
44359149 bytes were read into the source buffer.
The source has 212383 statements; 2812 are $a and 42097 are $p.
No errors were found.  However, proofs were not checked.  Type VERIFY PROOF *
if you want to check them.
MM> save proof */compressed/fast
Reformatting and saving (but not recompressing) all proofs...
Remember to use WRITE SOURCE to save changes permanently.
MM> write source D:\metamath\set.mm\set.mm
The input file will be renamed D:\metamath\set.mm\set.mm~1.
Writing "D:\metamath\set.mm\set.mm"...
212383 source statement(s) were written.
MM> verify proof *
0 10%  20%  30%  40%  50%  60%  70%  80%  90% 100%
........................................?Error at statement 173145, label "prodsplit", type "$p":
      cr cn0 ) AEFLMZFUANMZFDNMZLMZBEVBLMZCAFVAUBOUTVCUHUCPAFAFGUDZUEEFVAVBUFQA
                                                                ^^
The hypotheses of statement "zred" at proof step 37 cannot be unified.
  Hypothesis 1:  wff ph
  Step 34:  wff ph
  Hypothesis 2:  class A
  Step 35:  class N
  Hypothesis 3:  |- ( ph -> A e. ZZ )
  Step 36:  |- ( ph -> M e. ZZ )
..........
MM> quit

This is how I converted the proof to metamath

  ${
    $d M k $.  $d N k $.  $d K k $.  $d ph k $.
    prodsplit.1 $e |- ( ph -> M e. ZZ ) $.
    prodsplit.2 $e |- ( ph -> N e. ZZ ) $.
    prodsplit.3 $e |- ( ph -> M <_ N ) $.
    prodsplit.4 $e |- ( ph -> K e. NN0 ) $.
    prodsplit.5 $e |- ( ( ph /\ k e. ( M ... ( N + K ) ) ) -> A e. CC ) $.
    $( Product split into two factors, original by icecream.  (Contributed by
       metakunt, 21-Apr-2024.) $)
    prodsplit $p |- ( ph
                      -> prod_ k e. ( M ... ( N + K ) ) A
                      = ( prod_ k e. ( M ... N ) A
                          x.
                      prod_ k e. ( ( N + 1 ) ... ( N + K ) ) A ) ) $=
      ( cfz co caddc wbr wceq syl wcel cz cle c1 clt c0 zred ltp1d fzdisj nn0zd
      cin cun zaddcld nn0addge1 syl2anc elfz4 syl32anc fzsplit fzfid fprodsplit
      cr cn0 ) AEFLMZFUANMZFDNMZLMZBEVBLMZCAFVAUBOUTVCUHUCPAFAFGUDZUEEFVAVBUFQA
      FVDRZVDUTVCUIPAESRVBSRFSREFTOFVBTOZVFHAFDGADIUGUJGJAFURRDUSRVGVEIFDUKULFE
      VBUMUNFEVBUOQAEVBUPKUQ $.
  $}

This is the second proof that's broken. And I have no clue what is the cause. Another broken proof is found in metamath/set.mm#3939 I'd hope to know why it breaks so I can avoid it in the future. MMJ2 seems to output a proof, so I'd hope that works.

some search terms get no response

I'm using ver. 2.5.1.

If I do a search for

limCC

the general search never ends.

There are other terms that lead to the same behavior (I should have written down all of them).

Glauco

Default store.json not written relative to mmj2 path + load/saveSettings() quirk

Well, what I see is my store.json off somewhere in the /user2 directory, not the mmj2 directory.
That problem does not occur with a relative file name such as ocat-store.json, the program
is careful to resolve the path against mmj2. So I have a little patch for that in mmj2.util.StoreBoss.

Also I noticed that the SaveSettings and LoadSettings functions -- where ever called,
such as PA GUI -- were indirectly invoking the setSettingsFile() function used to process
the SettingsFile RunParm! That is incorrect because that RunParm is gone when PA GUI
is running.

I will upload the fixed StoreBoss later today most likely.

IllegalArgumentException on starting mmj2

Since recently, an IllegalArgumentException is thrown on starting mmj2. The start of the application is aborted afterwards:

Here is the stack trace from the cmd console:

I-UT-0015 **** Processing RunParmFile Command #20 = RunProofAsstGUI
I-PA-0412 Excluded these assertions from Unification search list as requested on input RunParm: [dummylink]
Comparison method violates its general contract!
java.lang.IllegalArgumentException: Comparison method violates its general contract!
        at java.util.ComparableTimSort.mergeHi(Unknown Source)
        at java.util.ComparableTimSort.mergeAt(Unknown Source)
        at java.util.ComparableTimSort.mergeCollapse(Unknown Source)
        at java.util.ComparableTimSort.sort(Unknown Source)
        at java.util.Arrays.sort(Unknown Source)
        at sun.awt.shell.Win32ShellFolderManager2.get(Unknown Source)
        at sun.awt.shell.ShellFolder.get(Unknown Source)
        at javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxModel.addItem(Unknown Source)
        at javax.swing.plaf.metal.MetalFileChooserUI$DirectoryComboBoxModel.access$800(Unknown Source)
        at javax.swing.plaf.metal.MetalFileChooserUI.doDirectoryChanged(Unknown Source)
        at javax.swing.plaf.metal.MetalFileChooserUI.access$1100(Unknown Source)
        at javax.swing.plaf.metal.MetalFileChooserUI$5.propertyChange(Unknown Source)
        at java.beans.PropertyChangeSupport.fire(Unknown Source)
        at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
        at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
        at java.awt.Component.firePropertyChange(Unknown Source)
        at javax.swing.JFileChooser.setCurrentDirectory(Unknown Source)
        at javax.swing.JFileChooser.setSelectedFile(Unknown Source)
        at mmj.pa.ProofAsstGUI.buildMMTFolderChooser(ProofAsstGUI.java:538)
        at mmj.pa.ProofAsstGUI.<init>(ProofAsstGUI.java:257)
        at mmj.pa.ProofAsst.doGUI(ProofAsst.java:200)
        at mmj.util.ProofAsstBoss.doRunProofAsstGUI(ProofAsstBoss.java:1031)
        at mmj.util.Boss.lambda$putCommand$0(Boss.java:107)
        at mmj.util.Boss.doRunParmCommand(Boss.java:121)
        at mmj.util.BatchFramework.executeRunParmCommand(BatchFramework.java:281)
        at mmj.util.BatchFramework.runIt(BatchFramework.java:223)
        at mmj.util.BatchMMJ2.main(BatchMMJ2.java:53)
Comparison method violates its general contract!

I still use mmj2 v2.4.1 as of 26-Jan-2016, currently with Java version 1.8.0_371 (there was an update on 15-Sep-2023!). Is it possible that the Java update causes this problem? Or did any change within my file system caused it (root cause for the exception within mmj2 is at mmj.pa.ProofAsstGUI.buildMMTFolderChooser(ProofAsstGUI.java:538)).

There are many hints on stackoverflow (https://stackoverflow.com/questions/11441666/java-error-comparison-method-violates-its-general-contract), even remarks on Java versions.

mmj2 is difficult to install/compile/get running

(The parts where I talk about "install" are basically an edited version of my comment on #38; the parts about "compile" are new.)

It's difficult to get mmj2 up and running, especially if you're starting from an "mmj2" Google search. My first result on Google was this repository, which is good news; but from there, the normal way to discover how to install the system -- the README.md that is displayed by Github -- is not terribly helpful. Near the top are links to QuickStart.html and README.html, but if you click on either of those you're greeted with a sea of &nbsp; and HTML tags. Next is a "Quick Start CHEAT SHEET" that assumes you've already installed mmj2. After that is an Installation section that links to INSTALL.html -- another sea of &nbsp; and HTML tags. (There's also a link for the "mmj2 Proof Assistant Tutorial" which takes you to the Github page for a .bat file; not terribly helpful, especially if you haven't managed to install mmj2 yet.)

If you do manage to install the system -- perhaps you found the 3-year-old release at https://github.com/digama0/mmj2/releases, or you managed to compile it for yourself -- now you need to get it to run. In particular, you need a copy of set.mm. The README.md doesn't say anything about downloading set.mm, or how to do so. QuickStart.html says to download set.mm from http://us2.metamath.org:8888/metamath/set.mm (and also says it's a 6MB download... a bit obsolete). INSTALL.html says to visit the download page of http::\www.metamath.org (note the very malformed URL) and download metamath.zip, which includes set.mm . So if you follow the links from the README, and you brave the raw HTML, you can find two different ways to download set.mm, either of which should work (although one of the ways uses Norm's home Internet bandwidth, which seems like a poor default).

Compiling it for yourself is also not easy, especially if you're not familiar with git and Java. Checking out the code is fairly easy, but then you need to use the obscure "git submodule" feature and type "git submodule init" and "git submodule fetch" before you can actually compile it. Then, the correct thing to do is to type "ant" to build it; but "ant" is not mentioned in README.md, QuickStart.html, or INSTALL.html; you just have to know that the presence of a "build.xml" file means you should type "ant".

I guess my suggestion would be to get rid of the current README.md, QuickStart.html, and INSTALL.html. Write a new README.md from scratch; make sure it has simple instructions that work. Remove the obsolete bits, like how to install Java 6.0 (as of 2011). Be sure to include where to download mmj2. (The current INSTALL.html does say to go to http://us2.metamath.org:8888/ocat/mmj2/ , which I guess is probably correct? But like I said, it's difficult to read the INSTALL.html. Before I found that in INSTALL.html, I found http://us.metamath.org/index.html#downloads , which is probably correct but looks wrong because it claims that http://us2.metamath.org:88/ocat/mmj2/mmj2.zip is "latest version, 2.4.1 26-Jan-2016"; and https://github.com/digama0/mmj2/releases, whose most recent artifact is from May 2017.) Include a section on compiling that has the "git submodule" and "ant" commands necessary.

Also, it's confusing to have old releases in https://github.com/digama0/mmj2/releases but not current releases. Maybe you could start doing github releases again? Or if you don't want to, maybe there's some way to mark the github releases as not the place to look? (I don't know what options github offers for managing that page.) Or I suppose you could consider actually deleting the old releases.

mmj2 bad version check; remove?

When I tried to run mmj2, it failed with this error:

Exception in thread "main" java.lang.NumberFormatException: For input string: "14-ea"
        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)
        at java.base/java.lang.Integer.parseInt(Integer.java:652)
        at java.base/java.lang.Integer.parseInt(Integer.java:770)
        at mmj.util.BatchMMJ2.checkVersion(BatchMMJ2.java:129)
        at mmj.util.BatchMMJ2.<init>(BatchMMJ2.java:40)
        at mmj.util.BatchMMJ2.main(BatchMMJ2.java:51)

It's complaining because it can't parse the version; sure enough:

$ java -version
openjdk version "14-ea" 2020-03-17
OpenJDK Runtime Environment (build 14-ea+36-Debian-2)
OpenJDK 64-Bit Server VM (build 14-ea+36-Debian-2, mixed mode, sharing)

my Java version seems to be "14-ea". (This is on a reasonably current Debian testing, using Debian's openjdk-14-jdk package version 14~36-2.)

Since the code is checking to make sure you have at least Java 1.5 (== J2SE 5.0), which was released over 15 years ago, maybe that function could just be deleted? If somebody hasn't upgraded their Java version in 15 years, I don't think mmj2 is going to be what pushes them to do it... (I simply commented out the entire body of checkVersion() and recompiled, which resulted in a working version.)

mmj2 tutorial issues: can't start on Linux; chapter 5 is broken

I wanted to run the tutorial, but there were several roadblocks in my way.

  1. The instructions talk about Mac OS-X and Windows, but not Linux. Not a big problem; I just copied the command line out of mmj2PATutorial.bat and ran it by hand.

  2. That command line uses the obsolete "-Xincgc" flag, so it doesn't work on the version of Java I have ("14-ea", from Debian openjdk-14-jdk 14~36-2). So I deleted the "-Xincgc" part from the command line and re-ran.

  3. The command line references RunParmsPATutorial.txt , which has this line:

ProofAsstStartupProofWorksheet,PATutorial\Page101.mmp

That pathname doesn't work on Linux. So I copied PATutorial/Page101.mmp to PATutorial\Page101.mmp and re-ran.

  1. I finally was able to get into the tutorial, and got through most of it. But when I got to chapter 5, I got an initially mystifying error when I followed instructions and pressed Control-U on Page501.mmp:
E-PA-0343 Theorem 95p1e96 Step qed: Invalid symbol in proof step formula. Input token = ; not found in Logical System Symbol Table. Proof Text input reader last position: Source Id: Proof Text Line: 28 Column: 12
 --------------------------------------------------------- 

I eventually figured out that this is because RunParmsPATutorial.txt loads setFirst100.mm, which doesn't have decimal notation (or real numbers, or set theory, or predicate calculus).

I can see a couple of possible fixes: either copy enough of the current set.mm into setFirst100.mm to get through the tutorial, or get rid of setFirst100.mm altogether and tell users they need to download the real set.mm. But the current situation, where following instructions gets a tutorial that breaks mysteriously at chapter 5, is very bad.

Switch to a modern build system

If we want to change the the tool to a git-style command line tool

  • mmj2 gui to invoke the GUI
  • mmj2 verify to invoke the verification
  • ...

How can we achieve this quickly?

I think the most convenient way is adopting argsparser libraries outside and connect the old https://github.com/digama0/mmj2/blob/master/src/mmj/util/BatchMMJ2.java or other source files.

But the obstacle here is the old build system. We need to switch to a modern build system, they can add dependencies easily, e.g.

  • gradle: the most widely adopted
  • maven: quite old but easier than ant
  • bazal: from google
  • lein: mostly used in clojure community

Mingli

mmj2 prints "cannot be cast to class" exception when unify (check proof) option is chosen

When mmj2 is run from the jar in the git archive (as of May 4, 2020), clicking on unify (check proof) deletes the proof and emits the following error message on the console:

Exception in thread "AWT-EventQueue-0" Ignoring exception:
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
at java.desktop/javax.swing.text.DefaultStyledDocument.setCharacterAttributes(DefaultStyledDocument.java:530)
at mmj.pa.ColorThread.processEvent(ColorThread.java:266)
at mmj.pa.ColorThread.run(ColorThread.java:170)
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
at java.desktop/javax.swing.text.AbstractDocument.handleRemove(AbstractDocument.java:632)
at java.desktop/javax.swing.text.AbstractDocument.remove(AbstractDocument.java:596)
at mmj.pa.HighlightedDocument.remove(HighlightedDocument.java:101)
at mmj.pa.HighlightedDocument.setTextProgrammatic(HighlightedDocument.java:178)
at mmj.pa.ProofAsstGUI.setProofTextAreaText(ProofAsstGUI.java:618)
at mmj.pa.ProofAsstGUI.displayProofWorksheet(ProofAsstGUI.java:2354)
at mmj.pa.ProofAsstGUI.access$3(ProofAsstGUI.java:2345)
at mmj.pa.ProofAsstGUI$44.receive(ProofAsstGUI.java:2150)
at mmj.pa.ProofAsstGUI$RequestThreadStuff.lambda$0(ProofAsstGUI.java:2295)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Ignoring exception:
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
at java.desktop/javax.swing.text.DefaultStyledDocument.setCharacterAttributes(DefaultStyledDocument.java:530)
at mmj.pa.ColorThread.processEvent(ColorThread.java:266)
at mmj.pa.ColorThread.run(ColorThread.java:170)

This seems to be a change in Java 9; see nordfalk/jsyntaxpane@5fc7559#diff-b3f8826824f551219879f1c798618c12R67 for one example of how it was fixed.

store.json (settings file) not created by SaveSettings or SettingsFile RunParms (on Mac)

SettingsFile,MY-pa-store.json
LoadSettings
BLAHBLAH
RunProofAsstGUI
SaveSettings

generates E-UT-1602, Saving Settings File Failed error message.

The java doc for the code in mmj.pa.SessionStore#save()

try (PrintStream s = new PrintStream(file)) {
            s.println(dat);

indicates that the file will be created, but nooo...

Seems to me that in the SettingsFile code, if the filename is valid but
it does not exist at that time, then create an empty file. Boom.
Problem solved.

Crash in case of ambiguous grammar

See set.mm PR#2379:
In case of an ambiguous grammar ($a class A B : $.), there is a NullPointerException:

java.lang.NullPointerException
	at mmj.verify.LRParser.initialize(LRParser.java:175)
	at mmj.verify.LRParser.load(LRParser.java:320)
	at mmj.verify.LRParser.load(LRParser.java:317)
	at mmj.verify.LRParser.parseExpr(LRParser.java:382)
	at mmj.verify.Grammar.grammaticalParseSyntaxExpr(Grammar.java:732)
	at mmj.verify.GrammarAmbiguity.basicAmbiguityEdits(GrammarAmbiguity.java:208)
	at mmj.verify.Grammar.initializeGrammarTables(Grammar.java:1008)
	at mmj.verify.Grammar.initializeGrammar(Grammar.java:704)
	at mmj.util.GrammarBoss.initializeGrammar(GrammarBoss.java:288)
	at mmj.util.GrammarBoss.doParse(GrammarBoss.java:242)
	at mmj.util.Boss.lambda$0(Boss.java:107)
	at mmj.util.Boss.doRunParmCommand(Boss.java:121)
	at mmj.util.BatchFramework.executeRunParmCommand(BatchFramework.java:281)
	at mmj.util.BatchFramework.runIt(BatchFramework.java:223)
	at mmj.util.BatchMMJ2.main(BatchMMJ2.java:53)

It shall rather trigger a clean error complaining about the grammar being ambiguous.

Step search error in one of the Page412.mmp examples

In tutorial Page412.mmp, one of the lines you're supposed to click on (to invoke step search is this:

200:2,100,?:  |- ( ( -. ps -> ph ) -> &W2 )

However, instead of showing a list of options, mmj2 shows: "A-PA-0901 Step 200: Null parse tree for Hyp's formula, this should have been caught!"

As a temporary measure in the mmj2 walkthough I just don't show clicking on that step, since I suspect it will eventually be fixed but I don't want to wait for that before finishing the video.

@digama0 - any idea why it's doing that?

mmj2 setup for Mac OS

I'm using Mac OS 10.12.6 and and had some issues when going through the tutorial video David Wheeler was soliciting feedback on in the user group.
For anyone else who runs across this (or for the maintainers if you want to update the README), the latest version of JDK does not seem to work well with mmj2 on mac OS, but I was able to get a working setup by installing openjdk 8 via homebrew with the following two commands :

brew tap adoptopenjdk/openjdk
brew cask install adoptopenjdk8

You also need to edit mmj2/mmj2jar/MacMMJ2.command to look like this, where <your_prefix> is replaced by a fully qualified path, and the last one points to whatever the location of the metamath executable is on your system. Also if you don't increase the value after -Xmx to at least 512, the startup script just hangs at LoadFile,set.mm.

java -Xincgc -Xms128M -Xmx512M -jar <your_prefix>/mmj2/mmj2jar/mmj2.jar "<your_prefix>/mmj2/mmj2jar/RunParms.txt" Y "<your_prefix>/mmj2/mmj2jar/" "<your_prefix>/metamath/metamath/" ""

On the off chance that the maintainers are interested, using the latest version of Java (specifically 13.0.1) produces the following error and fails to render what's seen in the video both when attempting to open a mmp file and when attempting to unify using the option from the dropdown menu :

Exception in thread "AWT-EventQueue-0" Ignoring exception:
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
	at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
	at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
	at java.desktop/javax.swing.text.AbstractDocument.handleRemove(AbstractDocument.java:632)
	at java.desktop/javax.swing.text.AbstractDocument.remove(AbstractDocument.java:596)
	at mmj.pa.HighlightedDocument.remove(HighlightedDocument.java:101)
	at mmj.pa.HighlightedDocument.setTextProgrammatic(HighlightedDocument.java:178)
	at mmj.pa.ProofAsstGUI.setProofTextAreaText(ProofAsstGUI.java:618)
	at mmj.pa.ProofAsstGUI.access$19(ProofAsstGUI.java:615)
	at mmj.pa.ProofAsstGUI$19.receive(ProofAsstGUI.java:937)
	at mmj.pa.ProofAsstGUI$RequestThreadStuff.lambda$0(ProofAsstGUI.java:2295)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
	at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
	at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
	at java.desktop/javax.swing.text.DefaultStyledDocument.setCharacterAttributes(DefaultStyledDocument.java:530)
	at mmj.pa.ColorThread.processEvent(ColorThread.java:266)
	at mmj.pa.ColorThread.run(ColorThread.java:170)
Ignoring exception:
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
	at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
	at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
	at java.desktop/javax.swing.text.DefaultStyledDocument.setCharacterAttributes(DefaultStyledDocument.java:530)
	at mmj.pa.ColorThread.processEvent(ColorThread.java:266)
	at mmj.pa.ColorThread.run(ColorThread.java:170)
Ignoring exception:
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
	at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
	at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
	at java.desktop/javax.swing.text.DefaultStyledDocument.setCharacterAttributes(DefaultStyledDocument.java:530)
	at mmj.pa.ColorThread.processEvent(ColorThread.java:266)
	at mmj.pa.ColorThread.run(ColorThread.java:170)
Ignoring exception:
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
	at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
	at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
	at java.desktop/javax.swing.text.DefaultStyledDocument.setCharacterAttributes(DefaultStyledDocument.java:530)
	at mmj.pa.ColorThread.processEvent(ColorThread.java:266)
	at mmj.pa.ColorThread.run(ColorThread.java:170)

What is the minimum from set.mm for mmj2 to start up

I tried to get mmj2 to start on a small file (proved and saved from metamath) and it failed with:

I-UT-0015 **** Processing RunParmFile Command #7 = RunProofAsstGUI
mmj.pa.ProofAsstException: A-PA-0902 Input list of assertions (for unification)empty!
java.lang.IllegalArgumentException: mmj.pa.ProofAsstException: A-PA-0902 Input list of assertions (for unification) empty!
        at mmj.pa.StepSelectorSearch.<init>(StepSelectorSearch.java:83)
        at mmj.pa.ProofUnifier.initializeLookupTables(ProofUnifier.java:292)
        at mmj.pa.ProofAsst.initializeLookupTables(ProofAsst.java:255)
        at mmj.util.ProofAsstBoss.getProofAsst(ProofAsstBoss.java:316)
        at mmj.util.ProofAsstBoss.doRunProofAsstGUI(ProofAsstBoss.java:1009)
        at mmj.util.Boss.lambda$0(Boss.java:107)
        at mmj.util.Boss.doRunParmCommand(Boss.java:121)
        at mmj.util.BatchFramework.executeRunParmCommand(BatchFramework.java:281)
        at mmj.util.BatchFramework.runIt(BatchFramework.java:223)
        at mmj.util.BatchMMJ2.main(BatchMMJ2.java:53)
Caused by: mmj.pa.ProofAsstException: A-PA-0902 Input list of assertions (for unification) empty!
        at mmj.pa.StepSelectorSearch.<init>(StepSelectorSearch.java:84)
        ... 9 more
mmj.pa.ProofAsstException: A-PA-0902 Input list of assertions (for unification)empty!

I had noticed earlier that I had to add the constants $c wff |- set class $. from set.mm to even get this far. The content is very minimal right now:

  $c wff |- set class $. $( Keep mmj2 happy $)

  $c cat term cj $.
  $v C C1 C2 D D1 D2 $.
  cC $f cat C $.
  cC1 $f cat C1 $.

  ${
    $( PLEASE PUT DESCRIPTION HERE. $)
    cat-term $a term C $.
  $}

  ${
    $( PLEASE PUT DESCRIPTION HERE. $)
    cat-term2 $p term C1 $=
    cC1 cat-term $.
  $}

And RunParms look like

LoadFile,../../metamath/ct.mm
VerifyProof,*
Parse,*
ProofAsstUnifySearchExclude,biigb,xxxid,dummylink
ProofAsstProofFolder,myproofs
TheoremLoaderMMTFolder,myproofs
RunProofAsstGUI

Compile warnings

I am using the Eclipse IDE. There are many warnings "The serializable class does not declare a static final serialVersionUID field of type long". One suggested way to remove the warning is to add "@SuppressWarnings("serial")". I am willing to make these changes and submit a pull request from my fork. Is this worthwhile doing? Will it be accepted? Thanks.

Set up github actions for automatic build and deploy

A lot of issues are being caused by the lack of prompt binary releases. It is possible to set up github actions so that it will automatically build mmj2 and create a "release" for the latest version. @david-a-wheeler could I tempt you to try setting this up? My time for mmj2 maintenance is very little these days.

ProofAsstExportToFile in UT2PA001.txt is missing 7th parameter??

I am running on a Mac and I am trying to run some of the tests in the test/windows folder (after making suitable changes).

In particular, I am trying RunUT2.bat which uses the UT2PA001.txt param file. The UT2PA001.txt is in folder mmj2/data/runparm/windows. Line 28 of that file is:

   ProofAsstExportToFile,dfbi2,dfbi2.mmp,update,un-unified,NotRandomized,Print

When I try to run it, I get an error for that line that it needs a 7th parameter like DeriveFormulas. If I add this parameter at the end, the error goes away.

Question: Is this a true error?

Note: If you do a search on "ProofAsstExportToFile," there are other places that lack this 7th parameter. I found 4 and possibly 5 such cases. That are other cases which have the parameter provided.

Misc Bugs from 10/5 in PA GUI and Friends

Lots of little things to fix. I'm just copying my notes so there are no surprises later...

`===

2018-10-05: ISSUE PA GUI Miscellaneous Bugs from today
- mmj2 :PA GUI Help needs updating:
- Proof Worksheet -> proof step numbers out of date
- File -> missing items
- Edit / Undo -> out of date

===

2018-10-05: ISSUE PA GUI Miscellaneous Bugs from today

    - mmj2 : TL Menu Items:
            - Unable to set Theorem Loader Store Formulas ASIS to false
            - Unable to set Theorem Loader Audit Messages to false
            - Many problems setting Theorem Loader mmt folder, including
              showing an error message with a getYesNoAnswer() dialog!

===

2018-10-05: ISSUE PA GUI Miscellaneous Bugs from today

    - mmj2 : File/Save Proof File
             File/Save As 
             File/Open Proof File   show default directory
             of user2, not the mmj2Path or the already given
             ProofAsstProofFolder.

===

2018-10-05: ISSUE PA GUI Miscellaneous Bugs from today

    - mmj2 : File/New Proof asked for Theorem Label, accepted invalid
             label (see Proof Worksheet below): 

$( <PROOF_ASST> THEOREM=as;dfkljasdjklf;laaldfsjl;aadjksf;laadjksfl;adjksfl;adjksflk;ajsdkfl;jaskdlfjkl;aadksjflasjdfjlasdfasldfjklasdjfk;a;fdl;agjl;akgj LOC_AFTER=?

h1:: |- ?
2:?: |- ?
qed:?: |- ?

$)

===

2018-10-05: ISSUE PA GUI Miscellaneous Bugs from today

    - mmj2 : Ctrl-U causes abort with following proof worksheet
             (and note that Highlighting is off, the dump just shows
             method/object names.) It is stored in blablah/mytemp/assdfsadf.mmp
             and all that is need to create the abort is to open proof file and
             hit ctrl-u.

Exception in thread "Thread-1" java.lang.NullPointerException
at mmj.pa.ProofAsst.unifyProofWorksheet(ProofAsst.java:1691)
at mmj.pa.ProofAsst.unify(ProofAsst.java:660)
at mmj.pa.ProofAsstGUI$44.send(ProofAsstGUI.java:2145)
at mmj.pa.ProofAsstGUI$RequestThreadStuff.run(ProofAsstGUI.java:2315)
at java.lang.Thread.run(Thread.java:748)

$( <PROOF_ASST> THEOREM=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa LOC_AFTER=?

qed:?: |- ph

$)

====

2018-10-05: ISSUE PA GUI Miscellaneous Bugs from today

    - mmj2 : runparm TheoremLoaderMMTFolder,myproofs/mmt 
             causes abort. 

             Attempting first batch test of UT19100updated.txt

END CommandLineArguments.displayArgumentOptionReport()

I-UT-0015 **** Processing RunParmFile Command #1 = ProofAsstHighlightingEnabled,no
I-UT-0015 **** Processing RunParmFile Command #2 = MacrosEnabled,no
I-UT-0015 **** Processing RunParmFile Command #3 = ProofAsstProofFolder,myproofs/mmp
I-UT-0015 **** Processing RunParmFile Command #4 = TheoremLoaderMMTFolder,myproofs/mmt
mmj.pa.MMJException: A-UT-0200 Cannot complete current RunParmFile request because either, a) the previous LoadFile RunParm processing detected errors in the input Metamath file; or b) a LoadFile RunParm must be input before the current RunParmFile line.
Review previous error messages to find the error.
java.lang.IllegalArgumentException: mmj.pa.MMJException: A-UT-0200 Cannot complete current RunParmFile request because either, a) the previous LoadFile RunParm processing detected errors in the input Metamath file; or b) a LoadFile RunParm must be input before the current RunParmFile line.
Review previous error messages to find the error.
at mmj.util.Boss.error(Boss.java:755)
at mmj.util.Boss.error(Boss.java:746)
at mmj.util.Boss.error(Boss.java:740)
at mmj.util.LogicalSystemBoss.getLogicalSystem(LogicalSystemBoss.java:164)
at mmj.util.TheoremLoaderBoss.getTlPreferences(TheoremLoaderBoss.java:105)
at mmj.util.TheoremLoaderBoss.editTheoremLoaderMMTFolder(TheoremLoaderBoss.java:158)
at mmj.util.Boss.lambda$0(Boss.java:107)
at mmj.util.Boss.doRunParmCommand(Boss.java:121)
at mmj.util.BatchFramework.executeRunParmCommand(BatchFramework.java:290)
at mmj.util.BatchFramework.runIt(BatchFramework.java:231)
at mmj.util.BatchMMJ2.main(BatchMMJ2.java:55)
Caused by: mmj.pa.MMJException: A-UT-0200 Cannot complete current RunParmFile request because either, a) the previous LoadFile RunParm processing detected errors in the input Metamath file; or b) a LoadFile RunParm must be input before the current RunParmFile line.
Review previous error messages to find the error.
... 10 more
mmj.pa.MMJException: A-UT-0200 Cannot complete current RunParmFile request because either, a) the previous LoadFile RunParm processing detected errors in the input Metamath file; or b) a LoadFile RunParm must be input before the current RunParmFile line.
Review previous error messages to find the error.
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

RESOLVED: The RunParm cannot be input before LoadFile:

	TheoremLoaderMMTFolder,myproofs/mmt.

            (I did not know that.)

====

2018-10-05: ISSUE PA GUI Miscellaneous Bugs from today

    - mmj2 : runparm file paths with '\' in RunParm causing 
             problems on Mac, but '/' ok. These are supposed
             to be system independent (in the code measures
             are required.)

====

2018-10-05: ISSUE PA GUI Miscellaneous Bugs from today

    - mmj2 : Theorem Loader exports csbima12g to mmt folder
             with ANY proof format "normal", "packed" or "compressed"
             and gibberish? is the result?

             NEGATIVE: output in .mmt always packed format,
             which is not recognized when loaded by TL...

ProofAsstHighlightingEnabled,no
MacrosEnabled,no
LoadFile,RegressionTest1set.mm
VerifyProof,*
Parse,*
ProofAsstUnifySearchExclude,biigb,xxxid,dummylink
ProofAsstProofFolder,myproofs/mmp/
TheoremLoaderMMTFolder,myproofs/mmt/temp
ExtractTheoremToMMTFolder,csbima12g

${
$d x y z $. $d A y $. $d A z $. $d B y $. $d B z $. $d C y $. $d C z $.
$d F y $. $d F z $.
$( Move class substitution in and out of the image of a function.
(Contributed by FL, 15-Dec-2006.) $)
csbima12g $p |- ( A e. C -> [_ A / x ]_ ( F " B ) = ( [_ A / x ]_ F " [_ A
/ x ]_ B ) ) $=
cA cC 1:wcel vy cA vx vy 2:cv cF cB 3:cima 4:csb csb vy cA vx 2 cF 5:csb
6:csb vy cA vx 2 cB 7:csb 8:csb 9:cima vx cA 3 csb vx cA cF 10:csb vx cA
cB 11:csb 12:cima vy vz cA 4 9 cC 1 vy vz 6 8 1 vy ax-17 vy vz cA 5 cC vz
13:cv cA wcel vy 14:ax-17 hbcsb1g vy vz cA 7 cC 14 hbcsb1g hbimad 2 cA
15:wceq 4 5 7 16:cima 6 7 cima 9 4 16 17:wceq 15 vx cv 2 18:wceq vx wex
17 vx vy a9e 18 17 vx vx vz vz 4 16 vx vz 2 3 vy 19:visset 13 2 wcel vx
20:ax-17 hbcsb1 vx vz 5 7 vx vz 2 cF 19 20 hbcsb1 vx vz 2 cB 19 20 hbcsb1
hbima hbeq 18 3 5 cB cima 4 16 18 cF 5 cB vx 2 cF csbeq1a imaeq1d vx 2 3
csbeq1a 18 cB 7 5 vx 2 cB csbeq1a imaeq2d 3eqtr3d 19.23ai ax-mp a1i 15 5
6 7 vy cA 5 csbeq1a imaeq1d 15 7 8 6 vy cA 7 csbeq1a imaeq2d 3eqtrd
csbiegf vx vy cA 3 cC csbcog 1 9 10 8 cima 12 1 6 10 8 vx vy cA cF cC
csbcog imaeq1d 1 8 11 10 vx vy cA cB cC csbcog imaeq2d eqtrd 3eqtr3d $.
$}

====

2018-10-05: ISSUE PA GUI Miscellaneous Bugs from today

    - mmj2 : Edit/Set Soft DJ Vars Error Handling = 2, Report is
             being processed exactly like 1, Ignore. There are
             supposed to be output error messages in the messages
             window. 

====
`

Deprecated methods

There are several places where deprecated methods are being used.

For example: "final Double d = new Double(value);"

The suggested correction is: "final Double d = Double.valueOf(value);"

I am willing to make these changes and submit a pull request from my fork.
Is this worthwhile doing? Will it be accepted? Thanks.

Other examples:

"this.put(key, new Integer(value));"

"this.put(index, new Long(value));"

Move to next LTS version: Java SE 17?

Java SE 11 was released in Sept 2018, since then Java evolved a lot, see below link for details

Java SE 17 was released in Sept 2021, maybe too early to adopt? I check the code with Java SE 17, since Nashorn was removed in Java SE 15, a tiny code change is required

This may also related with issue #61 , because with a modern build system it is easy to add a dependency.

Add LOC_BEFORE= in addition to LOC_AFTER=?

Several places in the tutorial depend, in a fragile way, on the specific ordering of theorems in set.mm, because there's no way to say LOC_BEFORE=statement. You can only say LOC_AFTER=. But in all the tutorial cases, what you really want is to say "put this theorem BEFORE that one".

Could LOC_BEFORE=statement be added so that the tutorial would be more like to work over time?

org.json openjdk 21.0.4

Hi, I have problems with compiling mmj2. JSON seems to be the main problem, and I can't get it right. Eg. org.json.JSONObject doesn't have a containsKey method but mmj.verify.LRParser is using exactly this. What's the dependency you use here for org.json?

Anyway, I try to fix up these things and a lot of others (quite a few warnings for deprecated stuff and superfluous use of superclasses etc.). But I cannot overcome the problem with JSON, I need your help for that, at least for the exact dependency you use.

java.lang.OutOfMemoryError: Java heap space for set.mm

I'm using Mac. I followed the Mac OS-X instructions in QuickStart.html. I downloaded http://us2.metamath.org:88/ocat/mmj2/mmj2.zip. I extracted to Users/Userone. I also downloaded http://us2.metamath.org:8888/metamath/set.mm and put it in Users/Userone/metamath.

I right-click on MacMMJ2.command. I choose Open With > Terminal.app.

I get an error: java.lang.OutOfMemoryError: Java heap space

QuickStart.html says set.mm is 6 MB. The one I downloaded is 32.3 MB. Perhaps that's the problem.

Here's the full output:

Jareds-MacBook-Pro:~ jared$ /Users/mmj2/mmj2jar/MacMMJ2.command ; exit;
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

CommandLineArguments.displayArgumentOptionReport():

Hi! I am mmj2 v2.5.1 as of 29-Dec-2016.
Visit https://github.com/digama0/mmj2/ or
http://code.google.com/p/metamath-mmj2/
for support or bug reports.

  Command Line Arguments:
    Arg #1 = RunParms.txt
    Arg #2 = Y
    Arg #3 = /users/Userone/mmj2jar/
    Arg #4 = /users/Userone/metamath/
    Arg #5 = 
    Arg #6 = 

  [3] mmj2Path     = /users/Userone/mmj2jar (e.g. /Users/Userone/mmj2jar/YourFile.xyz)
  [4] metamathPath = /users/Userone/metamath (e.g. /Users/Userone/metamath/YourFile.xyz)
  [5] svcPath      = null (e.g. /Users/jared/YourFile.xyz)
  [1] runParmFile  = /Users/Userone/mmj2jar/RunParms.txt
  [2] displayMMJ2FailPopupWindow 
                   = true

***END CommandLineArguments.displayArgumentOptionReport()***

I-UT-0015 **** Processing RunParmFile Command #1 = LoadFile,set.mm
I-UT-0015 **** Processing RunParmFile Command #2 = VerifyProof,*
I-UT-0015 **** Processing RunParmFile Command #3 = Parse,* 
Java heap space
java.lang.OutOfMemoryError: Java heap space
	at mmj.verify.EarleyParser.initArrays(EarleyParser.java:1013)
	at mmj.verify.EarleyParser.reInitArrays(EarleyParser.java:943)
	at mmj.verify.EarleyParser.parseExpr(EarleyParser.java:274)
	at mmj.verify.Grammar.grammaticalParseSyntaxExpr(Grammar.java:732)
	at mmj.verify.GrammarAmbiguity.basicAmbiguityEdits(GrammarAmbiguity.java:208)
	at mmj.verify.Grammar.initializeGrammarTables(Grammar.java:1014)
	at mmj.verify.Grammar.initializeGrammar(Grammar.java:704)
	at mmj.util.GrammarBoss.initializeGrammar(GrammarBoss.java:288)
	at mmj.util.GrammarBoss.doParse(GrammarBoss.java:242)
	at mmj.util.GrammarBoss$$Lambda$36/935044096.run(Unknown Source)
	at mmj.util.Boss.lambda$0(Boss.java:107)
	at mmj.util.Boss$$Lambda$7/960604060.getAsBoolean(Unknown Source)
	at mmj.util.Boss.doRunParmCommand(Boss.java:121)
	at mmj.util.BatchFramework.executeRunParmCommand(BatchFramework.java:281)
	at mmj.util.BatchFramework.runIt(BatchFramework.java:223)
	at mmj.util.BatchMMJ2.main(BatchMMJ2.java:53)
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOf(Arrays.java:3236)
	at sun.misc.Resource.getBytes(Resource.java:117)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:462)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at mmj.pa.AuxFrameGUI.<init>(AuxFrameGUI.java:61)
	at mmj.util.MMJ2FailPopupWindow.showAuxFrameGUI(MMJ2FailPopupWindow.java:229)
	at mmj.util.MMJ2FailPopupWindow.displayFailMessage(MMJ2FailPopupWindow.java:119)
	at mmj.util.BatchFramework.runIt(BatchFramework.java:243)
	at mmj.util.BatchMMJ2.main(BatchMMJ2.java:53)
: command not found/MacMMJ2.command: line 2: 
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

I assume I can increase JVM memory. But I assume you want your software to just work out of the box, so I'm letting you know :) (Alternatively let me know what I'm doing wrong)

ClassCastException on New Proof

Attempting File > New Proof and entering "bl.add2i" in the dialog box causes a cascade of ClassCastException below.

I created ccerror.mm (attached)ccerror.mm.zipto have the fewest number of constructs to cause the error.

Exception in thread "AWT-EventQueue-0" Ignoring exception:
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
at java.desktop/javax.swing.text.AbstractDocument.handleRemove(AbstractDocument.java:632)
at java.desktop/javax.swing.text.AbstractDocument.remove(AbstractDocument.java:596)
at mmj.pa.HighlightedDocument.remove(HighlightedDocument.java:101)
at mmj.pa.HighlightedDocument.setTextProgrammatic(HighlightedDocument.java:178)
at mmj.pa.ProofAsstGUI.setProofTextAreaText(ProofAsstGUI.java:618)
at mmj.pa.ProofAsstGUI.displayProofWorksheet(ProofAsstGUI.java:2354)
at mmj.pa.ProofAsstGUI.access$3(ProofAsstGUI.java:2345)
at mmj.pa.ProofAsstGUI$WorksheetRequest.receive(ProofAsstGUI.java:2248)
at mmj.pa.ProofAsstGUI$RequestThreadStuff.lambda$0(ProofAsstGUI.java:2295)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
at java.desktop/javax.swing.text.DefaultStyledDocument.setCharacterAttributes(DefaultStyledDocument.java:530)
at mmj.pa.ColorThread.processEvent(ColorThread.java:266)
at mmj.pa.ColorThread.run(ColorThread.java:170)
Ignoring exception:
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
at java.desktop/javax.swing.text.DefaultStyledDocument.setCharacterAttributes(DefaultStyledDocument.java:530)
at mmj.pa.ColorThread.processEvent(ColorThread.java:266)
at mmj.pa.ColorThread.run(ColorThread.java:170)
Ignoring exception:
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
at java.desktop/javax.swing.text.DefaultStyledDocument.setCharacterAttributes(DefaultStyledDocument.java:530)
at mmj.pa.ColorThread.processEvent(ColorThread.java:266)
at mmj.pa.ColorThread.run(ColorThread.java:170)
Ignoring exception:
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
at java.desktop/javax.swing.text.DefaultStyledDocument.setCharacterAttributes(DefaultStyledDocument.java:530)
at mmj.pa.ColorThread.processEvent(ColorThread.java:266)
at mmj.pa.ColorThread.run(ColorThread.java:170)
Ignoring exception:
java.lang.ClassCastException: class javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper cannot be cast to class javax.swing.text.AbstractDocument$DefaultDocumentEvent (javax.swing.text.AbstractDocument$DefaultDocumentEventUndoableWrapper and javax.swing.text.AbstractDocument$DefaultDocumentEvent are in module java.desktop of loader 'bootstrap')
at mmj.pa.CompoundUndoManager.undoableEditHappened(CompoundUndoManager.java:110)
at java.desktop/javax.swing.text.AbstractDocument.fireUndoableEditUpdate(AbstractDocument.java:293)
at java.desktop/javax.swing.text.DefaultStyledDocument.setCharacterAttributes(DefaultStyledDocument.java:530)
at mmj.pa.ColorThread.processEvent(ColorThread.java:266)
at mmj.pa.ColorThread.run(ColorThread.java:170)

Support for automatically figuring out substitutions

I am looking for a way to automatically figure out the substitutions required to be able to convert a theorem to a provided statement. This is needed so that we don't need to manually create substitution maps like this for generating automation:
https://github.com/Sophize/METAMATH_SERVER/blob/master/src/main/java/org/sophize/metamath/server/machines/NNSumMachine.java#L273

Mario suggested that this is called 'unification' and provided this link:

private void attemptProofOfDerivStep() {

It would be great if we could get a simple interface that takes a theorem and a statement as input and returns a substitution map.

mmj2 gives non-fatal error when starting up on iset.mm

When I start mmj2 on iset.mm, I get a dialog which says error in macro transformations and javax.script.ScriptException: TypeError: null has no such function "getSeq" in transformations.js at line number 96

If I add a dummy mathbox theorem, as at jkingdon iset-mathbox, then I get a similar dialog with:

Error in callback TRANSFORMATION_SET_UP:
null

In both cases, mmj2 seems to function normally after dismissing the dialog.

This is the checked in jar file from the master branch. When it starts up, it reports its version as Hi! I am mmj2 v2.5.1 as of 29-Dec-2016. I can run mmj2 on set.mm without these problems.

I would prefer that mmj2 just handle the lack of a mathbox theorem (or whatever the issue is here), as I think people are trying to run it on things other than set.mm or iset.mm, but if the right solution is for me to add a mathbox theorem or something else to iset.mm, please advise about what to add.

mmj2 is still difficult to install

Since #39 mentioned wanting details about the current onboarding experience, I figured I should write up mine. This was all done on a Windows 11 machine with Java 17 (I read that Java 11 or newer was recommended and so decided to stick with Java 17). Note that I didn't start documenting everything right away, so some details may be incorrect.

I began by cloning the repository and installing the precompiled mmj2. I navigated to mmj2.bat and clicked on it, only to have a command prompt window appear and disappear with an unreadable error. I switched to running mmj2.bat from the command line, where I could see that the error was "Error: No MM database found". I navigated to the doc folder and found mmj2CommandLineArguments.html, which mentioned RunParms.txt. I edited this file so that LoadFile pointed to the location of my local copy of set.mm, and ran mmj2.bat again only to get the same error. After this, I went back to mmj2CommandLineArguments, which says that

The actual Windows command line from mmj2.bat is: java -Xincgc -Xms128M -Xmx256M -jar mmj2.jar RunParms.txt Y "" c:\metamath ""

Through trial and error I got to the command java -Xms128M -Xmx1024M -jar mmj2.jar RunParms.txt Y instead, which avoided all the garbage collection/memory errors. However, it gave me a new error:

mmj.pa.MMJException: E-UT-1502 You attempted to use a macro, but the default Macro language 'js' does not exist. Use 'MacroLanguage,xxx' with one of the following installed languages:

I did some digging until I found readme.js in the macros folder, which mentioned that Nashorn is used for the scripts. I did some googling and found that Nashorn used to be included with the JDK, but isn't included with Java 17. I downloaded Nashorn and ASM as external JARs, and rooted around through the class files to find that mmj.util.BatchMMJ2 was the main class. I thus ended up with java -Xms128M -Xmx1024M -cp "C:\Path\To\External JARs\*;mmj2.jar" mmj.util.BatchMMJ2 RunParms.txt Y as the command I use to run mmj2.

Bug in the definition soundness check

The definition soundness check didn't catch an unsound definition in metamath/set.mm#3339 even though that definition has free setvars in its definiens:

$c <> $.
wich $a wff [ x <> y ] ph $.
${
  $d a b ph $.  $d a b x $.  $d a b y $.
  df-ich $a |- ( [ x <> y ] ph <-> ( x = y \/ ( [ a / x ] [ b / y ] ph <-> [ b / x ] [ a / y ] ph ) ) ) $.
$}

I didn't try to reduce further since I can test the definition soundness check only via the CI and not locally (because of #68 and #69).

Cannot compile with maven following INSTALL.md instructions

On Debian, I followed the instructions from the paragraph "Building mmj2 with maven" of INSTALL.md up to

$ mvn package
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------< mmj:mmj2 >------------------------------
[INFO] Building mmj2 2.5.2-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ mmj2 ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/benoit/Documents/personnel/metamath/git/mmj2/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ mmj2 ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 357 source files to /home/benoit/Documents/personnel/metamath/git/mmj2/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.321 s
[INFO] Finished at: 2023-07-28T22:37:33+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project mmj2: Fatal error compiling: invalid target release: 11 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I do not know maven at all so I do not understand these messages. I can post the outputs with the -e and -X options if needed.

Crash on startup reading iset.mm

Using b7f15d5eb748f1d8c23a76ccdbc2bd54ff6377ed of iset.mm (from the develop branch of https://github.com/metamath/set.mm ), mmj2 crashes on startup.

OpenJDK 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

CommandLineArguments.displayArgumentOptionReport():

Hi! I am mmj2 v2.5.1 as of 29-Dec-2016.
Visit https://github.com/digama0/mmj2/ or
http://code.google.com/p/metamath-mmj2/
for support or bug reports.

  Command Line Arguments:
    Arg #1 = RunParms.txt
    Arg #2 = Y
    Arg #3 = /home/jkingdon/work/mmj2/mmj2jar
    Arg #4 = /home/jkingdon/work/mmj2/mmj2jar
    Arg #5 = 

  [3] mmj2Path     = /home/jkingdon/work/mmj2/mmj2jar (e.g. /home/jkingdon/work/mmj2/mmj2jar/YourFile.xyz)
  [4] metamathPath = /home/jkingdon/work/mmj2/mmj2jar (e.g. /home/jkingdon/work/mmj2/mmj2jar/YourFile.xyz)
  [5] svcPath      = null (e.g. /home/jkingdon/work/mmj2/mmj2jar/YourFile.xyz)
  [1] runParmFile  = /home/jkingdon/work/mmj2/mmj2jar/RunParms.txt
  [2] displayMMJ2FailPopupWindow 
                   = true

***END CommandLineArguments.displayArgumentOptionReport()***

I-UT-0015 **** Processing RunParmFile Command #1 = LoadFile,set.mm
I-UT-0015 **** Processing RunParmFile Command #2 = VerifyProof,*
I-UT-0015 **** Processing RunParmFile Command #3 = Parse,* 
I-UT-0015 **** Processing RunParmFile Command #4 = ProofAsstUnifySearchExclude,biigb,xxxid,dummylink
I-UT-0015 **** Processing RunParmFile Command #5 = ProofAsstProofFolder,myproofs
I-UT-0015 **** Processing RunParmFile Command #6 = TheoremLoaderMMTFolder,myproofs
I-UT-0015 **** Processing RunParmFile Command #7 = RunProofAsstGUI
I-PA-0412 Excluded these assertions from Unification search list as requested on input RunParm: [dummylink]

Cannot compile following INSTALL.md instructions

On Debian, I followed the instructions from INSTALL.md up to

$ compile/posix_compile
find: ‘../lib’: Aucun fichier ou dossier de ce type
javac: directory not found: ../classes
Usage: javac <options> <source files>
use -help for a list of possible options

Looking at compile/posix_compile, there is indeed the line

cd src && javac $(find . ../lib -name "*.java") -d ../classes && \

but no corresponding directories. So, first, I think that before that line one should add

mkdir classes

and since the directory ../lib does not exist, probably another directory is meant ?
With mkdir classes added, I get:

$ compile/posix_compile
find: ‘../lib’: Aucun fichier ou dossier de ce type
./test/java/mmj/pa/MacroManagerTest.java:3: error: package org.junit does not exist
import org.junit.Test;
                ^
./test/java/mmj/pa/MacroManagerTest.java:7: error: package org.junit does not exist
import static org.junit.Assert.assertNotNull;
                       ^
./test/java/mmj/pa/MacroManagerTest.java:7: error: static import only from classes and interfaces
import static org.junit.Assert.assertNotNull;
^
./test/java/mmj/pa/MacroManagerTest.java:11: error: cannot find symbol
    @Test
     ^
  symbol:   class Test
  location: class MacroManagerTest
./test/java/mmj/pa/MacroManagerTest.java:14: error: cannot find symbol
        assertNotNull(factory.getEngineByName("js"));
        ^
  symbol:   method assertNotNull(ScriptEngine)
  location: class MacroManagerTest
5 errors

Crash on startup with custom .mm file

Hello,

I'm using mmj2 to create a database of linear logic theorems, and mmj2 crashes upon startup in the presence of two particular theorems.

Here is the database I am using, along with the RunParams file and start script:
https://github.com/ishanpm/metamathlinear/tree/7f8b9e3d8e0ec36532d4b3d91079476354ad81dd

Here are the specific statements causing the crash; mmj2 starts fine when either one is commented out:
https://github.com/ishanpm/metamathlinear/blob/7f8b9e3d8e0ec36532d4b3d91079476354ad81dd/linear.mm#L632-L642

${
  lbsymi.1 $e |- ( ph O-O ps ) $.
  $( Linear biconditional is symmetric. Inference for ~lbsym . ERROR this makes mmj2 freak out for some reason $)
  lbsymi $p |- ( ps O-O ph ) $= ? $.
$}
${
  lbtri.1 $e |- ( ph O-O ps ) $.
  lbtri.2 $e |- ( ps O-O ch ) $.
  $( Linear biconditional is transitive. Inference for ~lbtr . $)
  lbtri $p |- ( ph O-O ch ) $= ? $.
$}

This error message is produced when attempting to start mmj2:

I-UT-0015 **** Processing RunParmFile Command #8 = RunProofAsstGUI
null
java.lang.NullPointerException
        at mmj.transforms.EquivalenceInfo.fillDeductRules(EquivalenceInfo.java:91)
        at mmj.transforms.TransformationManager.<init>(TransformationManager.java:106)
        at mmj.pa.ProofAsst.initAutotransformations(ProofAsst.java:977)
        at mmj.pa.ProofAsst.initializeLookupTables(ProofAsst.java:259)
        at mmj.util.ProofAsstBoss.getProofAsst(ProofAsstBoss.java:319)
        at mmj.util.ProofAsstBoss.doRunProofAsstGUI(ProofAsstBoss.java:1020)
        at mmj.util.Boss.lambda$putCommand$0(Boss.java:107)
        at mmj.util.Boss.doRunParmCommand(Boss.java:121)
        at mmj.util.BatchFramework.executeRunParmCommand(BatchFramework.java:281)
        at mmj.util.BatchFramework.runIt(BatchFramework.java:223)
        at mmj.util.BatchMMJ2.main(BatchMMJ2.java:53)
null

I am running the latest precompiled version of mmj2 as of 12/20/2020, under HotSpot on Windows 10.

Eclipse IDE reformats existing code style when making changes

I am modifying the file ProofAsstGUI.java with the Eclipse IDE. The Eclipse IDE automatically corrects code style according to the preference in Java->Code Style->Formatter setting. I modified the default setting to keep "{ }" on one line to match the current mmj2 style. However, there are still other differences: see lines 471, 1238, 1264, and 1449 where the "{" is not under "new".

Question one: Is this intentional? I prefer it under "new".

There is also a difference for line 2093. The original is:

 `
    try (final BufferedWriter w = new BufferedWriter(new FileWriter(file))){
        final String s = proofTextPane.getText();
        w.write(s, 0, s.length());
    } catch (final Throwable e) {

`

My version is:

 `
    try (
        final BufferedWriter w = new BufferedWriter(new FileWriter(file)))
    {
        final String s = proofTextPane.getText();
        w.write(s, 0, s.length());
    } catch (final Throwable e) {

`

I am not worry about this case.

Question two: Should we all be using the same IDE with the same code style settings?

Otherwise, every time someone does a push, unnecessary changes will be made due only to code style requirements.

Add a CI build for Windows

With several issues like #71 , #72 and #73 reported, maybe it would be good to add a windows install/build to the CI, using other installation procedures than the maven build.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.