Proof Explanation:

General:

The axioms of the problem needed for the proof are repeated in the
proof.  Definitions are not repeated. Instead, when the axioms are
repeated they are repeated with their definitions instantiated (and
the resulting term normalized).

If the problem has a conjecture and it is used in the proof, then
the conjecture is repeated and the negated_conjecture will be assumed.
The negated_conjecture will (probably) always be named h0.
The assumption will be discharged in the final step with a 'contra' inference rule.

Other than the axioms, conjecture and negated_conjecture
every line is either an assumption
or an inference (role plain, formula $false).
The inference rules correspond to tableau rules.
Each line is supported by some of the previous assumptions
which is listed in the useful_info as "assumptions([...])."
Assumptions are discharged by inference rules.
The way the assumptions are discharged is indicated by occurrences
of "<rulename>(discharge,[...])" in the useful_info.

thf(n,plain,$false,inference(tab_inference_rule_name,useful_info,parent_info)).

parent_info is a list of references to the premises and discharged hypotheses.
Each rule has 0,1 or 2 principal premises which are listed as the first parents.
After this the side premises are listed as parents.
Finally, the hypotheses discharged are listed as parents.

useful_info contains the following information:
. status(thm) - $false deductively follows from the assumptions.
. assumptions([...]) - which assumptions support the conclusion.
. tab_inference_rule_name(discharge,[...]) - which hypotheses were discharged from a side premise.
  This information is given in the same order as the side premises from which the assumptions are discharged.
  No assumptions are discharged from principal premises.
After the hypotheses being discharged, useful_info may contain the following:
. a fresh constant being discharged (tab_negall and tab_ex)
EG: tab_negall(eigenvar,x) or tab_ex(eigenvar,x)
. an instantiation term (tab_all and tab_negex)
EG: tab_all(inst,trm1) or tab_negex(inst,trm2)
. a predicate term for rewriting Leibniz-style (tab_rew_*)
EG: tab_rew_true(leibnizp,trm1)

Instantiation terms and Leibniz predicate terms are named by the following kinds of lines:

thf(trm1,definition,<thf term>).

Here's the specifics for each tableau inference rule. The implementation is in src/pfterm/coq.ml
In each case the parent_info lists the principle premises first as p1,... and then the side premises as l1,...

. tab_conflict:
parent_info [p1,p2] : p1 and p2 are two assumptions one of which is the negation of the other (p2 should be the negation of p1).

. tab_false:
parent_info [p] : p is an assumption of $false

. tab_refl:
parent_info [p] : p is an assumption of the form (s <> s)

. tab_imp:
parent_info [p1,l1,l2,h1,h2] : p1 is (s => t), l1 and l2 are plain $false
useful_info : h1 is an assumption ~s discharged from l1, h2 is an assumption t discharged from l2

. tab_negimp:
parent_info [p1,l1,h1,h2] : p1 is ~(s => t), l1 is plain $false
useful_info : h1 is an assumption s nad h2 is an assumption ~t both discharged from l1

. tab_or, tab_nand: like tab_imp

. tab_nor, tab_and: like tab_negimp

. tab_all:
parent_info [p1:bind(X,$thf(n)),l1,h1] : p1 is (forall X:a, m), l1 is plain $false
useful_info :
 h1 is an assumption (m[X:=n]) [normalized] discharged from l1
Note: In principle, the name of the bound variable X in (forall X:a, m) shouldn't matter
and so the X in bind(X,$thf(n)) can be safely ignored. In fact, one could have an
unnamed instance of the form ((!!) @ m). In such a case the output will be
bind(Xnoname,$thf(n)).

. tab_negall:
parent_info [p1,l1,h1] : p1 is ~(forall_a m), l1 is plain $false
useful_info : x is an eigenvar and h1 is an assumption ~(m x) discharged from l1

. tab_ex: like tab_negall

. tab_negex: like tab_all

. tab_mat :
parent_info [p1,p2,l1,...,ln,h1,...,hn] : p1 is p s1 ... sn, p2 is an assumption ~p t1 ... tn, each li is plain $false
useful_info : hi is an assumption (si <> ti) discharged from li

. tab_dec :
parent_info [p,l1,...,ln,h1,...,hn] : p is an assumption f s1 ... sn <> f t1 ... tn, each li is plain $false
useful_info : hi is an assumption (si <> ti) dischared from li

. tab_con :
parent_info [p1,p2,l1,l2,h1,...,hn]
useful_info
h1 and h2 are discharged from l1
h3 and h4 are discharged from l2

. tab_trans :
useful_info [h1]
parent_info [p1,p2,l1,h1]
h1 is discharged from l1

. tab_be :
useful_info [h1,h2,h3,h4]
parent_info [p,l1,l2,h1,h2,h3,h4]
h1 and h2 are discharged from l1
h3 and h4 are discharged from l2

. tab_bq, tab_negiff, tab_iff : like tab_be

. tab_fe
useful_info [h1]
parent_info [p,l1,h1]
h1 is discharged from l1

. tab_fq : like tab_fe

. tab_choice : For the choice operator @+
parent_info [l1,l2,h1,h2]
useful_info [h1,h2...] : a is the relevant type.
This rule has no principal premise.
h1 is discharged from l1.
h2 is discharged from l2.

. tab_choiceop : For a declared choice operator
parent_info [l1,l2,h1,h2]
useful_info [status(thm),x,k...] : x name of the declared choice operator, k is the name of the axiom that x is a choice operator
h1 is discharged from l1.
h2 is discharged from l2.

. tab_cut
parent_info [l1,l2,h1,h2]
useful_info : h1 is an assumption s and h2 is an assumption ~s
h1 is discharged from l1.
h2 is discharged from l2.

. tab_dn
parent_info [p,l1,h1] : p is an assumption ~~s
useful_info : h1 is an assumption s
h1 is discharged from l1.

. tab_rew_true, tab_rew_and, tab_rew_or, tab_rew_iff, tab_rew_ex, tab_rew_sym, tab_rew_eta, tab_rew_dn
  tab_rew_leib1, tab_rew_leib2, tab_rew_leib3, tab_rew_leib4
Each of these rewrites with some known equation (s = t) (e.g., true = (~ false))
parent_info [p1,l1,h1] : p1 is an assumption (p s)
useful_info : 
The predicate p of type a>$o is given via leibnizp.
h1 is an assumption (p t) which is dischared from l1

. tab_delta
parent_info [p,l1,h1] : p is s
useful_info [status(thm),x...] : h1 assumption s with x unfolded where x is the definition to unfold.
h1 is discharged from l1.

. tab_known
parent_info [p,l1,h1] : p is the name of the 'known' proposition
useful_info : h1 is an assumption with the known proposition which is discharged in l1

* Examples

./bin/satallax.opt -p tstp -t 2 -m mode1 test1.p | grep ^thf

thf(pt,type,(p : $o)).
thf(qt,type,(q : $o)).
thf(pq,axiom,(p => q)).
thf(pa,axiom,p).
thf(qc,conjecture,q).

% SZS output start Proof
thf(qc,conjecture,q).
thf(h0,negated_conjecture,(~(q)),inference(assume_negation,[status(cth)],[qc])).
thf(h1,assumption,(~(p)),introduced(assumption,[])).
thf(h2,assumption,q,introduced(assumption,[])).
thf(pa,axiom,p).
thf(2,plain,$false,inference(tab_conflict,[status(thm),assumptions([h1,h0])],[pa,h1])).
thf(3,plain,$false,inference(tab_conflict,[status(thm),assumptions([h2,h0])],[h2,h0])).
thf(pq,axiom,(p => q)).
thf(1,plain,$false,inference(tab_imp,[status(thm),assumptions([h0]),tab_imp(discharge,[h1]),tab_imp(discharge,[h2])],[pq,2,3,h1,h2])).
thf(0,theorem,q,inference(contra,[status(thm),contra(discharge,[h0])],[1,h0])).
% SZS output end Proof

./bin/satallax.opt -p tstp -t 2 -m mode1 test2.p | grep ^thf

thf(pt,type,(p : (($i > $i) > $o))).
thf(pa,axiom,(! [F : ($i > $i)] : (p @ F))).
thf(pc,conjecture,(p @ (^ [X:$i] : X))).

% SZS output start Proof
thf(pc,conjecture,(p @ (^[X1:$i]:X1))).
thf(h0,negated_conjecture,(~((p @ (^[X1:$i]:X1)))),inference(assume_negation,[status(cth)],[pc])).
thf(h1,assumption,(p @ (^[X1:$i]:X1)),introduced(assumption,[])).
thf(2,plain,$false,inference(tab_conflict,[status(thm),assumptions([h1,h0])],[h1,h0])).
thf(pa,axiom,(![X1:$i>$i]:(p @ X1))).
thf(1,plain,$false,inference(tab_all,[status(thm),assumptions([h0]),tab_all(discharge,[h1])],[pa:[bind(X1,$thf((^[X1:$i]:X1)))],2,h1])).
thf(0,theorem,(p @ (^[X1:$i]:X1)),inference(contra,[status(thm),contra(discharge,[h0])],[1,h0])).
% SZS output end Proof

./bin/satallax.opt -p tstp -t 2 -m mode1 test3.p | grep ^thf

thf(pt,type,(p : (($i > $i) > $o))).
thf(pa,axiom,(p @ (^ [X:$i] : X))).
thf(pc,conjecture,(? [F : ($i > $i)] : (p @ F))).

% SZS output start Proof
thf(pc,conjecture,(?[X1:$i>$i]:(p @ X1))).
thf(h0,negated_conjecture,(~(?[X1:$i>$i]:(p @ X1))),inference(assume_negation,[status(cth)],[pc])).
thf(h1,assumption,(~((p @ (^[X1:$i]:X1)))),introduced(assumption,[])).
thf(pa,axiom,(p @ (^[X1:$i]:X1))).
thf(2,plain,$false,inference(tab_conflict,[status(thm),assumptions([h1,h0])],[pa,h1])).
thf(1,plain,$false,inference(tab_negex,[status(thm),assumptions([h0]),tab_negex(discharge,[h1])],[h0:[bind(X1,$thf((^[X1:$i]:X1)))],2,h1])).
thf(0,theorem,(?[X1:$i>$i]:(p @ X1)),inference(contra,[status(thm),contra(discharge,[h0])],[1,h0])).
% SZS output end Proof

./bin/satallax.opt -p tstp -t 2 -m mode1 test4.p | grep ^thf

thf(pt,type,(p : (($o > $o) > $o))).
thf(pa,axiom,(p @ (^ [X:$o] : X))).
thf(pc,conjecture,(p @ (^ [X:$o] : (~(~(X)))))).

% SZS output start Proof
thf(pc,conjecture,(p @ (^[X1:$o]:(~((~(X1))))))).
thf(h0,negated_conjecture,(~((p @ (^[X1:$o]:(~((~(X1)))))))),inference(assume_negation,[status(cth)],[pc])).
thf(h1,assumption,(~((p @ (^[X1:$o]:X1)))),introduced(assumption,[])).
thf(pa,axiom,(p @ (^[X1:$o]:X1))).
thf(2,plain,$false,inference(tab_conflict,[status(thm),assumptions([h1,h0])],[pa,h1])).
thf(1,plain,$false,inference(tab_rew_dn,[status(thm),assumptions([h0]),tab_rew_dn(discharge,[h1]),tab_rew_dn(leibnizp,$thf((^[X1:$o>$o]:(~((p @ (^[X2:$o]:(X1 @ X2))))))))],[h0,2,h1])).
thf(0,theorem,(p @ (^[X1:$o]:(~((~(X1)))))),inference(contra,[status(thm),contra(discharge,[h0])],[1,h0])).
% SZS output end Proof

./bin/satallax.opt -p tstp -t 2 -m mode1 test5.p | grep ^thf

thf(pt,type,(p : (($o > $o) > $o))).
thf(ft,type,(f : ($o > $o))).
thf(gt,type,(g : ($o > $o))).
thf(gd,definition,(g = (^ [X:$o] : X))).
thf(pa,axiom,(p @ (^ [X:$o] : (g @ (f @ X))))).
thf(pc,conjecture,(p @ (^ [X:$o] : (f @ (g @ X))))).

% SZS output start Proof
thf(pc,conjecture,(p @ (^[X1:$o]:(f @ X1)))).
thf(h0,negated_conjecture,(~((p @ (^[X1:$o]:(f @ X1))))),inference(assume_negation,[status(cth)],[pc])).
thf(pa,axiom,(p @ (^[X1:$o]:(f @ X1)))).
thf(1,plain,$false,inference(tab_conflict,[status(thm),assumptions([h0])],[pa,h0])).
thf(0,theorem,(p @ (^[X1:$o]:(f @ X1))),inference(contra,[status(thm),contra(discharge,[h0])],[1,h0])).
% SZS output end Proof

