# Principia Mathematica II
#
# Subject: QEDEQ Format Description
# Date:    2004-04-14
#
# Prototype Warning
# =================
# This program suite is only a working prototype for the main project. It
# concentrates on the basic logic foundation of mathematics. The software
# design of the main implementation will be highly different. The following
# information is only appropriate for this prototype. Look at 
#  http://sourceforge.net/projects/pmii/
#  http://www.qedeq.org/
# to get the latest source code and information.
#
#
# This text defines the format of a qedeq module file for the rule version
# 1.00.00. Such a file contains ASCII characters and has a lisp like
# structure. There are two kinds of axioms: integers and strings.
# Strings are quoted (") that means strings are surrounded by quotes (")
# and quotes inside the strings are escaped by doubling them.
# All other types are lists preceded by an function operator. These
# lists are surrounded by brackets and contain a sequence of elements,
# separated by commas. Each element is an atom or further operator
# lists. E.g.:
#  AND(PROP(1), OR(PROP(2), PROP(3)))
#
# The following text shows the structure of a qedeq module file.
# The characters ?, * and + have a special meaning:
# ? optional occurrence, this list entry must not exist
# * arbitrary occurrence of an list entry, could be repeated any time
#    or missing completely
# + entry occurs at least once
#
# "text" stands for a string atom and "number" for an integer atom.
#
#
# Tag         ;Atom/List     ;Description
MODULE        ;list          ;start terminal for qedeq module format
              ;HEADER        ;header
              ;IMPORTS?      ;needed other qedeq modules
              ;USEDBY?       ;this qedeq module is used by
              ;PARAGRAPHS    ;paragraphs with axioms, propositions etc.
HEADER        ;list          ;header of a qedeq module
              ;SPEC          ;specification of this module 
              ;HEADLINE      ;title of this module
              ;DESCRIPTION   ;abstract
              ;EMAIL         ;email address of module administrator
              ;AUTHORS       ;authors of this module
SPEC          ;list          ;specification of a qedeq module
              ;NAME          ;name of qedeq module
              ;VERSION       ;version of qedeq module 
              ;VERSION       ;needed rule version
              ;LOCATIONS     ;list of absolute or relative URLs, the specified module could be found, only the path to the module should stand here, the file name is: $\langle$NAME$\rangle\_\langle$VERSION$\rangle\_\langle$VERSION$\rangle$.qedeq
NAME          ;list          ;name
              ;text
VERSION       ;list          ;version nummer in format nn.nn.nn
              ;text
LOCATIONS     ;list          ;list of qedeq module URLs
              ;LOCATION+     ;at least one URL must be there
LOCATION      ;list          ;relative or absolute URL, which points to the directory of an qedeq module file
              ;text
HEADLINE      ;list          ;title of a qedeq module
              ;text
DESCRIPTION   ;list          ;description of qedeq module ("abstract")
              ;text
EMAIL         ;list          ;email address
              ;text
AUTHORS       ;list          ;author list
              ;AUTHOR+       ;
AUTHOR        ;list          ;
              ;text          ;author name
              ;EMAIL         ;email address of author
IMPORTS       ;list          ;list of imported modules
              ;IMPORT+
IMPORT        ;list          ;informations about an import module
              ;SPEC          ;module specification
              ;LABEL         ;alias name for an imported module
LABEL         ;list          ;label for referencing
              ;text
USEDBY        ;list          ;list of modules, which use this one
              ;SPEC+         ;
PARAGRAPHS    ;list          ;paragraphs
              ;PARAGRAPH+    ;
PARAGRAPH     ;list          ;paragraph
              ;LABEL         ;reference anchor
              ;text?         ;LaTeX text 
              ;(
              ;| ABBREVIATION 
              ;| AXIOM 
              ;| DECLARERULE
              ;| PROPOSITION
              ;)
              ;text?         ;LaTeX text
ABBREVIATION  ;list          ;definition of an abbreviation
              ;FORMULA       ;operator to be defined with pattern variables
              ;FORMULA       ;definition for the operator, the same pattern variables as before must occur
AXIOM         ;list          ;declaration of an axiom, that is a stressed formula
              ;FORMULA       ;axiom formula
DECLARERULE   ;list          ;declaration of a new rule
              ;text          ;rule name
              ;text          ;rule description
              ;LINK*         ;references to  necessary axioms, propositions
LINK          ;list          ;rererences to a label of an axiom, proposition
              ;text          ;label name
PROPOSITION   ;list          ;consists of a mathematical theorem and its proof
              ;SENTENCE      ;theorem
              ;PROOF         ;proof, last proof formula must be identical to theorem
SENTENCE      ;list          ;mathematical theorem
              ;FORMULA       ;true mathematical formula
PROOF         ;list          ;proof of a mathematical theorem, consists sequent proof lines, each one is constructed by using logical rules by foregoing proof lines, axioms, abbreviations or propositions
              ;LINE+         ;proof lines
LINE          ;list          ;single proof line, consists of a derived formula and an information about the used rule and necessary references that enable the derivation
              ;FORMULA
              ;(
              ;ADDAXIOM              ;simple addition of an axiom to the prooflines
              ;| ADDSENTENCE         ;simple addition of an already proved proposition
              ;| MODUSPONENS         ;execution of Modus Ponens
              ;| REPLACEPROP         ;replacement of an propositional variable
              ;| USEABBREVIATION     ;usage of an abbreviation
              ;| REVERSEABBREVIATION ;reverse an abbreviation
              ;| RENAMEFREEVARIABLE  ;rename a free subject variable
              ;| RENAMEBOUNDVARIABLE ;rename a bound subject variable
              ;| REPLACEPREDICATE    ;replace a predicate variable by a formula
              ;| GENERALIZATION      ;execution of generalization
              ;| PARTICULARIZATION   ;execution of particularization
              ;)
FORMULA       ;vlist          ;formula of predicate calculus
              ;(
              ;PROP           ;proposition variable
              ;| NOT          ;negation
              ;| AND          ;conjunction (logical "and")
              ;| OR           ;disjunction (logical "or")
              ;| IMPL         ;implication
              ;| EQUI         ;logical equivalence
              ;| PREDVAR      ;predicate variable
              ;| FORALL       ;universal quantifier
              ;| EXISTS       ;existential quantifier
              ;| FPATTERN     ;pattern variable which can stand for any formula (used for abbreviations)
              ;| SPATTERN     ;pattern variable which can stand for any predicate variable (used for abbreviations)
              ;)
PROP          ;list           ;proposition variable
              ;number         ;identification number
NOT           ;list           ;negation
              ;FORMULA        ;formula to negate
AND           ;list           ;conjunction (logical "and")
              ;FORMULA        ;first argument
              ;FORMULA        ;second argument
OR            ;list           ;disjunction (logical "or")
              ;FORMULA        ;first argument
              ;FORMULA        ;second argument
IMPL          ;list           ;logical implication
              ;FORMULA        ;first formula
              ;FORMULA        ;second formula
EQUI          ;list           ;logical equivalence
              ;FORMULA        ;formula
              ;FORMULA        ;formula
PREDVAR       ;list           ;predicate variable
              ;number         ;identification number
              ;L              ;list of subject variables
L             ;list           ;list of subject variables
              ;VAR*           ;
VAR           ;list           ;subject variable
              ;number         ;identification number
FPATTERN      ;list           ;formula pattern variable
              ;number         ;identification number
SPATTERN      ;list           ;subject variable pattern variable
              ;number         ;identification number
EXISTS        ;list           ;existential quantifier
              ;VAR            ;quantify over this subject variable
              ;FORMULA        ;formula which has the above subject variable as a free variable
FORALL        ;list           ;universal quantifier
              ;VAR            ;quantify over this subject variable
              ;FORMULA        ;formula which has the above subject variable as a free variable
ADDAXIOM            ;list     ;add an axiom
                    ;LINK     ;axiom reference
ADDSENTENCE         ;list     ;add an already proven proposition
                    ;LINK;    ;proposition reference
MODUSPONENS         ;list     ;Modus Ponens
                    ;number   ;proof line number which references formula A
                    ;number   ;proof line number which references formula A -> B
REPLACEPROP         ;list     ;propositional variable replacement
                    ;number   ;proof line number at which the rule should be executed
                    ;PROP     ;this propositional variable should be replaced
                    ;FORMULA  ;replacement
USEABBREVIATION     ;list     ;use definition of an abbreviation
                    ;number   ;proof line number at which the rule should be executed
                    ;LINK     ;abbreviation reference
                    ;number   ;this occurrence number of the abbreviation shall be transformed
REVERSEABBREVIATION ;list     ;reverse definition of an abbreviation
                    ;number   ;proof line number at which the rule should be executed
                    ;LINK     ;abbreviation reference
                    ;number   ;this occurrence number of the abbreviation pattern shall be replaced by the abbreviation
RENAMEFREEVARIABLE  ;list     ;rename of a free subject variable
                    ;number   ;proof line number at which the rule should be executed
                    ;VAR      ;rename this free subject variable
                    ;VAR      ;with this (non bound) subject variable
RENAMEBOUNDVARIABLE ;list     ;rename of a bound subject variable (at a specific location)
                    ;number   ;proof line number at which the rule should be executed
                    ;VAR      ;rename this bound subject variable
                    ;VAR      ;with this (non free) subject variable, which thereby must not get bound a second time
                    ;number   ;this occurrence of an quantor with the designated subject variable shall be target of the operation
REPLACEPREDICATE    ;list     ;replace predicate by formula
                    ;number   ;proof line number at which the rule should be executed
                    ;PREDVAR  ;with pairwise different pattern variables as arguments
                    ;FORMULA  ;formular which contains the same pattern variables, the set of free subject variables must be disjunct to the set of bounded subject variables of the referenced proof line and conversely (the set of bounded subject variables must be disjunct to the set of free subject variables of the referenced proof line) and the predicate variable must not occur in the sphere of action of an quantor with an associated subject variable that is also contained in this formula
GENERALIZATION      ;list     ;generalization rule
                    ;number   ;proof line number at which the rule should be executed, must have the form A -> B(x), with x not contained in A
                    ;VAR      ;this subject variable is generalized
PARTICULARIZATION   ;list     ;particularization rule
                    ;number   ;proof line number at which the rule should be executed, must have the form A(x) -> B, with x not contained in B
                    ;VAR      ;this subject variable is particularized
number				;atom     ;numeric atom, an integer
text                ;atom     ;text atom, an arbitrary string
