mmj.util.BatchFramework.java
actually calls
another object
-- an instance of mmj.util.LogicalSystemBoss.java
-- which then
calls the Theorem
Loader. The rectangles on the diagram represent input/output data
stores (files) and the arrows to/from these rectangles show the I/O
accesses. The arrows between the objects which do not have borders,
such as "BatchMMJ2
" and
"BatchFramework
" represent high-level objects using
function calls, where
the arrow
points to the object being called.set.mm
with groups of lemmas and theorems.) Existing theorems are also
handled by the Theorem Loader, but only the proofs ('$=
") and
distinct variable restrictions ('$d
') are updated.
(As with the Proof Assistant GUI, variable and variable hypothesis
declarations are not permitted in use with the TheoremLoader)..mmt
" (to avoid accidents
involving ".mm
" files :-) file for each theorem to be
loaded. Or, a successfully
unified mmj2 Proof Worksheet passed via a
program "call" statement (incomplete and invalid Proof Worksheets are
not
"storable" using Theorem loader, but the Metamath "eimm" command may
provide more support for importing from/exporting to Proof Worksheets
involving incomplete or invalid proofs..).mmt
"
type files in
the Metamath .mm
file format, as well as updates to
mmj2's Logical System
in memory. .mmt
"
files which can be read back in by the Theorem Loader, thus
enabling a user to perform considerable amounts of work in one or
multiple sessions before being
forced to manually update the main .mm file (e.g. set.mm) -- without
having to exit-and-restart mmj2! .mm
format file -- or
files --
input to mmj2 during a single run. Most often a single .mm
file such as
set.mm
is input to mmj2, and this is specified with the
RunParms.txt
command "LoadFile,c:\metamath\set.mm
" line (see mmj2\mmj2jar\RunParms.txt and metamath\set.mm). It is possible to
use two or more LoadFile run parms sequentially to load more than one
.mm file consecutively and as if they were strung together into one
large file. .mmt folder
(or
folders, since the directory in use can be
changed during the course of processing) contains theorems in Metamath
.mm
format but written using file-type ".mmt" (to avoid
accidents involving real Metamath files such as set.mm
.).
These theorems can be loaded, upon command, into the
Logical System currently loaded into memory, and theorems from the
Logical System and/or the mmj2 Proof Assistant can be written to the
.mmt
folder. Thus,
the .mmt
folder can be used as a repository for sets
of theorems which in development, prior to their ultimate -- manual --
entry into the main .mm
file. .mmt
folder are written
to the folder
upon user command by mmj2's Theorem Loader, which is called either by
Proof Assistant, or via the new RunParm "ExtractTheoremToMMTFolder
".
Therefore, the following processing rules pertaining to loading of
theorems from the .mmt
folder will be of minor concern to
the users --
except that periodically when the user manually updates the main input
.mm
file with new theorems and new proofs, the contents of
the .mmt
folder must be manually cleaned out (and archived or backed up) -- or
if .mmt
files are created manually:.mmt
folder:.mmt
folder
(directory). Thus,
sub-directories of the .mmt
folder could be used as
archives or backup
locations for work which has already been completed..mmt
Folder, either via RunParm or the Proof Assistant GUI prior to its
actual use; this allows use of mmj2 without using the Theorem Loader,
with no change to existing RunParm files or user practices. However,
when processing requires a .mmt
Folder and the .mmt
Folder is "null
" (not yet specified), an error message is
output. There is no default setting for .mmt
Folder, in
other words (i.e. not to the "current directory" or any place else.).mmt
" are loaded. Other
files, such as
".mmp
" (mmj2 Proof Worksheets) can be stored in the .mmt
folder, which means that a single
directory (folder) could be used as the .mmt
folder and
the "ProofAsstProofFolder
"
(see mmj2\mmj2jar\RunParms.txt)
-- but this is not recommended (best to separate the two.)$p
"
label inside each file are loaded (e.g. "syl.mmt
" matches
label "syl
").${
", "$}
",
"$(
", "$)
", "$d
", "$e
",
and "$p
"
. Files containing any other
statements are not loaded.$( this is a comment $) syl $p blah $= ?
$.
"). This is the only comment which Theorem Loaded will store
in the Logical System. Any other comments are ignored. $e
')
and Theorem ('$p
') statement must equal the "provable
logic statement type code" in use with the input .mm file. For set.mm
and ql.mm
this is "|-
" (see RunParm "ProvableLogicStmtType
").
TheoremLoaderMMTFolder,
DirectoryPathname"
where:TheoremLoaderMMTFolder"
is a constant.mmt
files (via
the Theorem
Loader).TheoremLoaderDjVarsOption,
DjVarsOption"
where:TheoremLoaderDjVarsOption
" is a constant.mmt
file for that theorem; may be
either "Replace"
(means "replace old with new"), "Merge" (means "merge old
with new"), or "NoUpdate" (the default, means "don't touch the old
$d's!!!") Note: A new theorem's $d statements are set to the $d
statement in the input .mmt
file.ProofAsstDjVarsSoftErrors
" option (see mmj2\mmj2jar\AnnotatedRunParms.txt
). The simplest choice is "NoUpdate
" because a subsequent
VerifyProof
will report any missing $d statements. However, the recommended setting
is "Replace
" if your ProofAsstDjVarsSoftError option is "GenerateNew
"
(which always create a completely new set of $d statements even if
there are no $d errors.) Here is a table showing the recommended choice
combinations:ProofAsstDjVarsSoftErrors |
TheoremLoaderDjVarsOption |
Notes
|
GenerateNew |
Replace |
recommended settings |
GenerateReplacements |
NoUpdate |
GenerateReplacements generates
$d statements in the Proof Worksheet only if soft $d errors are found,
so using "Replace" would wipe out existing $d statements when the .mm
file is subsequently reloaded. |
GenerateDifferences |
Merge |
these are "ok" too |
Report |
NoUpdate |
|
Ignore |
NoUpdate |
TheoremLoaderAuditMessages,
GenerateAuditMessagesOption"
where:
TheoremLoaderAuditMessages
" is a
constantYes
", "No
" or omitted.
Default is "No
". If set to "Yes
" then
audit messages about the load process are generated (for educational
and testing purposes.)LoadTheoremsFromMMTFolder,
LoadSpecification"
where:LoadTheoremsFromMMTFolder
" is a constant.mmt
Folder" or is a theorem label, meaning to load the file "label.mmt
" from the
.mmt Folder..mmt
files.
LoadTheoremsFromMMTFolder,*"
VerifyProof,*
"
and "Parse,*
". For maximum ease of use however, the LoadTheoremsFromMMTFolder
RunParm can be located after the "VerifyProof,*
"
and "Parse,*
". This is because the source of any Verify
errors will be more obvious. Newly loaded theorems are verified and
parsed if the VerifyProof and
Grammar objects are available, which is based on the current
processing location in the RunParms file. It is possible for updated $d
statements in existing theorems tol cause
Verify Proof errors in subsequent theorems which have not been updated.LoadTheoremsFromMMTFolder
RunParm commands
can be input,
but that would be an "advanced" scenario -- and perhaps troublesome in
practice..mmt
files contain
serious errors, error message(s) are output but the MMJ2Batch
job
continues processing RunParm.txt commands, and any updates made to the
LogicalSystem are rolled back (undone). .mmt
file
loads (Note: using RunParm "OutputVerbosity,0
" will turn
off informational messages in the output print stream.)MObj.seq
number -- the sequential, logical
location within the Logical System
-- of a new theorem is computed as follows: a) if the theorem's proof
contains a "?
" symbol then the theorem is added at the end
of the
Logical System but prior to any other new theorems being loaded which
depend upon it in their own proofs; b) if the theorem's proof does not
contain a "?
" symbol then the MObj.seq
is
computed to be in the "gap",
if
present, following the highest MObj.seq
of the
assertions and logical
hypotheses it uses in its proof. (MObj.seq
numbers are
assigned from
100 by 100, so "gap" refers to the range between two originally
assigned MObj.seq
numers -- for example the gap after MObj.seq
3600 is
3601 through 3699.) If the "gap" is full -- has no unused seq numbers,
the theorem is added at the end of the Logical System but prior to any
other new theorems being loaded which depend on it in their own proofs.LoadTheoremsFromMMTFolder
RunParm's processing -- and
"undo" of any updates that were made during the command's processing.
However, a proof that is merely incomplete (contains "?" label) or
incorrect -- does not prove the conclusion -- is reported with an error
message and processing continues (this behavior is identical to
the "VerifyProofs,*
" processing -- where proof
errors in already loaded theorems are reported but do not terminate the
entire BatchMMJ2
jobstream.)$d
" and "$=
" (Distinct
Variable and Proof) data are
updated
using the contents of an input .mmt
file which specifies
a theorem
already loaded into the Logical System. An error message is generated
if any formulas in the existing theorem and its logical hypotheses are
different from the input (this is a fail-safe double-check...)LoadTheoremsFromMMTFolder
command will be added to the mmj2 Proof Assistant GUI as a menu item, and to the ProofAssistant.java
public call interface (for use by the mmj2 Service feature.) For mmj2
Proof Assistant GUI users this means that new .mmt
format
files can be
created -- manually, if desired -- in the .mmt
folder,
and these
theorems can be dynamically loaded into the Logical System without
exiting the mmj2 Proof Assistant GUI. This could be a very useful
feature when working with lemmas (note that if the Proof Worksheet
"LOC_AFTER
" is used with a new theorem and a lemma is
dynamically
loaded from the .mmt
folder, and the lemma has a "?
"
in its
proof
(meaning that the lemma is loaded at the logical end of the Logical
System), then the user will need to erase the LOC_AFTER
label to avoid
a "forward reference" in the proof.ExtractTheoremToMMTFolder,
TheoremLabel"
where:ExtractTheoremToMMTFolder
" is a constantExtractTheoremToMMTFolder
RunParm is provided for
testing purposes, but could be used by anyone for other reasons.
UnifyAndStoreInLogSysAndMMTFolder
,ProofWorksheetFileNameUnifyAndStoreInLogSysAndMMTFolder
" is a
constantsyl.mmp
" or an "absolute"
name such as "c:\my\myproofs\syl.txt
". If the "ProofAsstProofFolder
"
RunParm has been input, it is used with a relative filename.
7. "UnifyAndStoreInMMTFolder
,ProofWorksheetFileNameUnifyAndStoreInLogSysAndMMTFolder
" is a
constantsyl.mmp
" or an "absolute"
name such as "c:\my\myproofs\syl.txt
". If the "ProofAsstProofFolder
"
RunParm has been input, it is used with a relative filename.
SvcCallback
" interface and then
passes a
reference to that object in its call to BatchMMJ2.generateSvcCallback()
-- also passing the necessary BatchMMJ2 Command Line Parms which
specify the RunParms file to be used by mmj2. Svc
*" RunParms
may be
specified, including the executable RunParm,"SvcCall
". SvcCall
" RunParm
it invokes the
"go()
" method in the designated SvcCallback
interface object.go()
" method is passed arguments providing
access to the main
mmj2 objects, including ProofAsst
.go()
"
method to
terminate mmj2's callback, at which point the user's Caller program
remains in control and may continue processing as it pleases.SvcCallback
interface. Then when BatchFramework encounters the "SvcCall
"
RunParm,
it creates an instance of that class using a default constructor and
calls
the "go()
" method in that object. Boss
" objects which actually perform
the requested
work. BatchFramework also catches un-handled exceptions and performs
any cleanup or reporting prior to exiting.mmj.svc.SvcCallback
is an interface which is used by mmj2
to pass
control to a user program operating either in "Caller" or "Callee"
mode. The SvcCallback.go()
method's arguments are passed
by mmj2 and
provide access to the major mmj2 objects, such as the ProofAsst
and
LogicalSystem
. Using these objects a user program can,
effectively,
use mmj2 as a (single-threaded) subroutine. (Note that the mmj2 Proof
Assistant can be used without initiating the mmj2 Proof Assistant GUI.).mm
file's symbol table (symTbl
)
and statement table
(stmtTbl
), as well as a few other necessaries :-) Other
objects are
needed by the mmj2 Service feature to fully utilize mmj2 as a
subroutine, but LogicalSystem
is the main repository of
data from the
input Metamath .mm file.SeqAssigner
"
is present in LogicalSystem. It replaces the existing rudimentary
function, LogicalSystem.nextSeq()
,
which simply increments the MObj
counter and multiplies
by LangConstants.MOBJ_SEQ_NBR_INCREMENT
to determine the next MObj.seq
. The SeqAssigner
handles
sequence number assignment for objects appended to the end of the
LogicalSystem
as well as inserts located in the middle of
LogicalSystem
. A key feature of SeqAssigner
is that it has
updateInit()
, commit()
and rollback()
functions so that a failed
partial mass-update by the Theorem Loader can be "undone".SeqAssigner
takes advantage of the fact that MObj.seq
numbers are
assigned from 100 by 100 using a Java "int
" field --
meaning that
approximately 2 million Metamath objects can be input before
overflowing the system's capacity. In between two objects, say, "100"
and "200", there are 99 unused sequence numbers. What SeqAssigner
does
is keep track of the MObj
's which have been inserted in
the middle of
the LogicalSystem
in the "gaps" -- and it keeps track of
the highest
sequence number assigned so far to appended MObj
's. MObj
's
added at the
end of LogicalSystem are not considered "inserted" but "appended", as
they do not require the special "gap" insertion processing and nearly
unlimited numbers of them can be added to the LogicalSystem
.SeqAssigner
's implementation goals are to a) use CPU
and memory resources
efficiently; b) provide relatively rapid service for individual
sequence number assignments, and c) to consume resources on inserts
proportionately to the number of inserts (meaning that if the user
doesn't use the Theorem Loader then minimal resources are utilized.
Here
is how it works.SeqAssigner
maintains a HashMap
whose
Key is existing MObj.seq
number modulo 100 (the increment interval), and whose Value is a
reference to a BitMap
of length 100 (one hundred bits)
wherein a "1"
(one) bit signifies that the associated MObj.seq
number
object has been
inserted into a "gap". Thus, the HashMap
is empty until
at least one
insert has been performed successfully. Insertion into a gap requires
obtaining the Value object for the gap's Key (or creating a new Value
object), and then scanning through the BitMap
looking for
the first
available open spot (after bit number 0 which is always open since it
represents a MObj
that was loaded during the initial
load.) In the
event that the gap BitMap
is full, SeqAssigner
assigns the next
seq number at the very end of the Logical System. Note that the calling
function needs to ascertain this "overflow"situation because it affects
the MObj.seq
of every other theorem which uses the
inserted theorem in
a proof, and may even result in a severe "forward" reference error in
an existing theorem's proof if the proof has been modified to use the
new theorem being appended because of a gap "overflow" situation.LogicalSystem
is "TheoremLoadListeners
",
which
is a list of
objects which must be informed when a set of theorems is commit()'ed by
TheoremLoader. There are several of these, besides the obvious
candidates, LogicalSystem.stmtTbl
and LogicalSystem.seqAssigner
.
During previous enhancements to mmj2 certain lists of logical
assertions (which
were sorted in a specific sequence) were added to mmj2 -- these are
always
created during initialization of mmj.lang.ProofAsst
. They
are mmj.pa.ProofUnifier.unifySearchList
and
StepSelectorSearch.assrtArray
. In addition, the new Book
Manager
feature, added in this release, keeps track of MObj
's in
the LogicalSystem
and assigns them its own section and
sequence numbers. So, the
following changes will be made for the TheoremLoader enhancement to
accomodate objects outside of LogicalSystem
which keep
track of
theorems:mmj.pa.ProofUnifier.unifySearchList
is sorted by MObj.seq
.
When commit()
is communicated to ProofAsst
-- which is passed an object containing a MObj.seq
list
of containing new theorems added to LogicalSystem.stmtTbl
,
the new theorems will be merged into unifySearchList
in a
single pass through the list. If this operation fails for any reason
whatsoever then processing in mmj2 is terminated abruptly with a fatal IllegalArgumentException
-- therefore, the restore()
communique to the
TheoremLoadListeners requires no processing.mmj.pa.StepSelectorSearch.assrtArray
is sorted by Assrt.NBR_LOG_HYP_SEQ
..
The assrtArray
will be changed to be an ArrayList
called assrtList
-- and StepSelectorSearch
modified accordingly -- so that insertions can be made without
recreating the array (we look forward to the day when Metamath's set.mm
has 1,000,000 theorems :-) Then when commit()
is
communicated to ProofAsst
-- which is passed an object
containing a MObj.seq
list of new theorems added to LogicalSystem.stmtTbl
,
the list of new theorems will be first sorted by Assrt.NBR_LOG_HYP_SEQ
and then merged into unifySearchList
in a single pass through the list. If this operation fails for any
reason whatsoever then processing in mmj2 is terminated abruptly with a
fatal IllegalArgumentException
-- therefore, the restore()
communique to the TheoremLoadListeners
requires no
processing.mmj.pa.ProofUnifier.unifySearchList
and StepSelectorSearch.assrtList
will be set at LogicalSystem.stmtTbl.size()
* 105%
so that
TheoremLoader inserts do
not require resizing unless rather large additions are made.mmj.lang.BookManager
keeps track of Chapters and
Sections, and
maintains the following fields in MObj
: MObj.chapterNbr
,
MObj.sectionNbr
, and MObj.sectionMObjNbr
.
The key idea of BookManager
is that each MObj
is assigned to a Section, and MObj.sectionMObjNbr
is
assigned from 1 by 1 within the current Section, thus allowing
unlimited inserts at the end
of a Section. When commit()
is communicated to BookManager
-- which is passed an
object containing a MObj.seq
list of new theorems added
to LogicalSystem.stmtTbl
, the new theorems will be
assigned BookManager
chapter, section and sectionMObj
numbers. If this
operation fails for any
reason whatsoever then processing in mmj2 is terminated abruptly with a
fatal IllegalArgumentException
-- therefore, the restore()
communique to the BookManager requires no
processing. Note that the input list of theorems
contains for each new theorem, a "located after" reference to an
existing MObj
-- this is used to determine the BookManager
Chapter and
Section of the new theorem: the new theorem is assigned to the Chapter
and Section of the "located after" MObj
(adjusted for the
fact that
Section is adjusted for the type of MObj
, so if the
"located after" MObj
happens to be an axiom, then the
theorem's
Section will be one
greater than the "located after" MObj
's section. Note also -- this is important -- if the
input theorem list contains an update to an existing theorem's proof
and the revised proof uses a new theorem in the same BookManager
Section, then the MObj.sectionMObjNbr
's will need to be
resequenced
following the initial assignment (to eliminate the severely erroneous
forward reference.) mmj.pa.ProofAsst.getSortedTheoremIterator()
contains redundant code -- probably a leftover from the initial coding,
and exercised only via the batch testing RunParm commands -- which
builds its own sorted list of assertions. Since this redundant list is
identical to unifySearchList
, getSortedTheoremIterator()
will be modified to contain just the following statement:return
proofUnifier.getUnifySearchListByMObjSeq().iterator()
;
".LogicalSystem
for the
TheoremLoader enhancement is a new LogicalSystem
method
(aka "function") called
"TheoremLoaderMassUpdate
" which is responsible for
performing all
inserts of new theorems, and updates of existing proofs and $d
statements for existing theorems, as specified in its input parameter,
"theoremStmtGroupList
", which designates a rigorously
pre-validated
pre-validated list of TheoremStmtGroup
objects
sorted by
MObj.seq
. TheoremStmtGroup
object contains the data
corresponding to exactly one theorem's input .mmt
file
from the
TheoremLoader .mmt
Folder (see above). Not only
will
TheoremStmtGroup
objects be rigorously validated prior to
any attempt
to update the LogicalSystem
, but the MObj.seq
numbers for
each new
Theorem and LogHyp are "reserved" ProofAsst
"public" interface is
available for
use by the mmj2 Service, including functions which involve the new
Theorem Loader.Theorem Loader DjVars Option
:
Identical to function of TheoremLoaderDjVarsOption RunParm.
Specifies
how $d statements in an existing theorem's extended frame are to be
updated by an input .mmt
file for that theorem; may be
either "Replace"
(means "replace old with new"), "Merge" (means "merge old
with new"), or "NoUpdate" (the default, means "don't touch the old
$d's!!!") Note: A new theorem's $d statements are set to the $d
statement in the input .mmt
file. Theorem Loader MMT Folder
:
Identical to function of TheoremLoaderMMTFolder
RunParm. Specifies the pathname of the directory to be used for
storing or
retrieving .mmt files with the Theorem Loader.Theorem Loader Audit
Messages
:
Identical to function of TheoremLoaderAuditMessages
RunParm. May be "Yes", "No" or omitted. Default is "No". If set to
"Yes" then
audit messages about the load process are generated (for educational
and testing purposes.)
Load Theorems From MMT Folder
:
identical
to function of LoadTheoremsFromMMTFolder
RunParm.
Extract Theorem To MMT Folder
:
identical to function of ExtractTheoremToMMTFolder
RunParm.Unify + Store in MMT Folder
:
Unifies the Proof
Worksheet, and if the proof unifies successfully, a .mmt
file is created in the current .mmt
Folder for the Proof
Worksheet's theorem. Note: if the Proof Worksheet has been modified
since the last File/Save, the user is prompted to save before
proceeding.
Unify + Store in LogSys and MMT
Folder
: Unifies the
Proof Worksheet, and if the proof unifies successfully, a .mmt
file is created in the current .mmt
Folder for the Proof Worksheet's theorem. Then, if there are no errors,
the newly stored .mmt file is loaded into the Logical System using the
same processed used by LoadTheoremsFromMMTFolder
RunParm, except that only a single .mmt
file is
loaded. Note: if the Proof Worksheet
has been modified since the last File/Save, the user is prompted to
save before proceeding. Also note that if the theorem is new and the
LOC_AFTER field has been used in the Proof Worksheet header, the user
will need to erase the LOC_AFTER location manually if another Unify
function is attempted (because the theorem is no longer new and
LOC_AFTER applies only to new theorems.)Verify All Proofs
: This
operates identically to the "VerifyProof,*
"
RunParm -- except that if the "LoadProofs,no
" RunParm was
used during initial file loading, something like 10,000 error messages
will be returned (subject to the "MaxErrorMessages
"
RunParm limitation :-) Proof Verification using the Metamath proof
verification algorithm is equivalent, in theory, to the mmj2
Unification algorithm. However, if Theorem Loader has been used to
update the $d specifications of an existing theorem, other theorems
which refer to that theorem in their proofs may become "invalid" as a
result of the Theorem Loader's update -- which is precisely the reason
that this function will be useful in the mmj2 Proof Assistant GUI.LOC_AFTER
"
field in the Proof Worksheet Header line specifies the location of a
new theorem being proven using the Proof Assistant GUI. However, the
LOC_AFTER label specification applies only to the Proof Assistant GUI's
validation of proof step Ref labels and formulas; it does not control
the location of new theorems loaded by the Theorem Loader. When a new
theorem is stored after unification in the Proof Assistant via Unify + Store in MMT Folder
or Unify + Store in LogSys and MM Folder
the LOC_AFTER specification has no effect upon where the theorem is
stored when the Logical System is updated -- that location is
controlled by the contents of its proof.
Sample Program: mmj2 Service in
"Callee" mode:
import java.io.*;
import java.util.*;
import java.io.File;
import java.util.Map;
import mmj.lang.*;
import mmj.pa.*;
import mmj.util.*;
import mmj.verify.*;
import mmj.svc.*;
/**
* Test mmj2 SvcCallback as "callee"
*/
public class TSvcCallbackCallee implements SvcCallback {
public TSvcCallbackCallee() {
}
public void
go(Messages
messages,
OutputBoss
outputBoss,
LogicalSystem
logicalSystem,
VerifyProofs
verifyProofs,
Grammar
grammar,
WorkVarManager
workVarManager,
ProofAsstPreferences proofAsstPreferences,
ProofAsst
proofAsst,
File
svcFolder,
Map
svcArgs) {
System.out.println(
"Hello world, I am TSvcCallbackCallee.java");
}
}
Sample Program: mmj2 Service in
"Caller" mode:
import java.io.*;
import java.util.*;
import java.io.File;
import java.util.Map;
import mmj.lang.*;
import mmj.pa.*;
import mmj.util.*;
import mmj.verify.*;
import mmj.svc.*;
/**
* Test mmj2 SvcCallback as "callee"
*/
public class TSvcCallbackCaller implements SvcCallback {
public TSvcCallbackCaller() {
}
public void
go(Messages
messages,
OutputBoss
outputBoss,
LogicalSystem
logicalSystem,
VerifyProofs
verifyProofs,
Grammar
grammar,
WorkVarManager
workVarManager,
ProofAsstPreferences proofAsstPreferences,
ProofAsst
proofAsst,
File
svcFolder,
Map
svcArgs) {
System.out.println(
"Hello world, I am TSvcCallbackCaller.java");
}
/**
* Main function interfacing to Java
environment,
* running the BatchMMJ2 functions.
*
* @param args see class description.
*/
public static void main(String[] args) {
TSvcCallbackCaller
tSvcCallbackCaller
=
new
TSvcCallbackCaller();
BatchMMJ2
batchMMJ2 = new BatchMMJ2();
int
returnCode
=
batchMMJ2.generateSvcCallback(args,
tSvcCallbackCaller);
if (returnCode != 0) {
System.exit(returnCode);
}
}
}
New mmj2 Service interface
"mmj.svc.SvcCallback.java":
//********************************************************************/
//* Copyright (C)
2008
*/
//* MEL O'CAT mmj2 (via) planetmath (dot)
org
*/
//* License terms: GNU General Public License Version
2
*/
//*
or any later
version
*/
//********************************************************************/
//*4567890123456 (71-character line to adjust editor window) 23456789*/
/*
* SvcCallback.java 0.01 08/01/2008
*
* Version 0.01:
* --> new.
*/
package mmj.svc;
import java.io.File;
import java.util.Map;
import mmj.lang.*;
import mmj.pa.*;
import mmj.util.*;
import mmj.verify.*;
/**
* Interface for using mmj2 as a service.
* <p>
*/
public interface SvcCallback {
/**
* Method go is called by mmj2 after
initialization
* and a RunParm command is encountered
triggering
* a SvcCallback.
* <p>
* Note: if a "fatal" or severe error is
encountered
*
just trigger an IllegalArgumentException
* to
instantly terminate the mmj2 process.
* <p>
* @param
messages
mmj.lang.Messages object.
* @param
outputBoss
mmj.util.OutputBoss
* @param
logicalSystem
mmj.lang.LogicalSystem
* @param
verifyProofs
mmj.verify.VerifyProofs
* @param
grammar
mmj.verify.Grammar
* @param
workVarManager
mmj.lang.WorkVarManager
* @param proofAsstPreferences
mmj.pa.ProofAsstPreferences
* @param
proofAsst
mmj.pa.ProofAsst
* @param
svcFolder
home Folder for use by Svc
*
(specified via RunParm).
* @param
svcArgs
Map of Svc key/value pair arguments
*
(specified via RunParm).
*/
void
go(Messages
messages,
OutputBoss
outputBoss,
LogicalSystem
logicalSystem,
VerifyProofs
verifyProofs,
Grammar
grammar,
WorkVarManager
workVarManager,
ProofAsstPreferences proofAsstPreferences,
ProofAsst
proofAsst,
File
svcFolder,
Map
svcArgs
);
}