;; $Id: log.txt 2696 2014-01-24 09:23:42Z schwicht $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2014-01-24

In pconst.scm

Change comment in constructor-type-to-step-type from Comment: nested
argtype: substitute alg times type to Comment: argtype tvar or nested
(then substitute alg times type)

In formula.scm

In formula-substitute an active impnc becoming inactive after
substitution is changed to imp.  In the fold-formula / unfold-formula
mechanism only imp is used, not impnc (as before 2014-01-08).
foldable-excl-form? and foldable-excu-form? changed accordingly.
tensor-form-to-imp-impnc-formula and h-deg-respecting? then become
superfluous and are removed.

In axiom.scm

typed-constr-name-to-step-formula corrected for multiary constructors,
corresponding to constructor-type-to-step-type .  This is necessary to
fit the type of the recursion operator.  Induction with partial
variables and stotality premise disallowed.  Use elimination instead.
truth-aconst (with Truth-Axiom) removed.  truth-aconst is redefined in
ets.scm via the theorem Truth (with truth-proof).

In proof.scm

Typo corrected.

In pproof.scm

Initial THEOREMS moved to ets.scm because formula-substitute (used in
make-proof-in-aconst-form for AllncTotalIntro) needs
formula-of-nulltype?

In ets.scm

Initial THEOREMS moved here because formula-substitute (used in
make-proof-in-aconst-form for AllncTotalIntro) needs
formula-of-nulltype?  truth-aconst redefined via the theorem Truth
(with truth-proof).  efq-atom-proof imp-to-atom-proof
atom-to-imp-proof and-atom-to-left-proof and-atom-to-right-proof
atoms-to-and-atom-proof dec-cases-proof moved here, because they need
truth-aconst .

In atr.scm

In atr-rel-definite-proof atr-arb-definite-proof atr-irrel-goal-proof
atr-arb-goal-proof impnc case added.  min-excl-proof? replaced by
min-excl-formula?

In doc/tutor.tex

Display functions added.  Minor corrections.

In examples/tutor.scm

Minor changes.

In doc/ref.tex

by-assume-minimal-with renamed into by-assume-minimal-wrt .  Typos
corrected.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2014-01-08

In list.scm

init-segments nonnil-init-segments string-suffix?
string-replace-substrings added.  Examples for string functions added.

In typ.scm

remove-nulltype-argtypes nested-alg-name? added.
type-to-alg-with-simalg-names added.

In var.scm

VAR-NAMES renamed into VARIABLE-NAMES

In pconst.scm

rec-at partially rewritten.  In the use of nbe-object-rec-compose the
proper recobj is obtained by first applying the one obtained from
rel-simalg-names-to-recobjs-alist to free-objs.
constr-name-to-rec-args-indicator now is obsolete.
all-formulas-to-rec-const and all-formula-to-cases-const now give an
error message in case of a nested algebra.  imp-formulas-to-rec-const
changed: free kept separate from recop-type, and unfold-totality is
first applied to imp-formulas.  destruct-at changed: it now uses
injection-or-f rather than injection.  If there is no disjunction in
the result (eg ntree, yprod), injection-or-f is #f and the
argument-product of the constructor is returned.  In case of the unit
algebra, Dummy is returned.

In psym.scm

PVAR-NAMES renamed into PREDICATE-VARIABLES .  pvar-to-string changed.
If a new arity has been assigned to a pvar name, pvar-to-string uses
the default display string, as var-to-string.  idpredconst-to-string
changed: new case for OrNc.  term-to-unfolded-totality-formula added.
It uses alg-name-to-rtotality-idpredconst-name in case alg has
parameters (needed when normalizing proofs with elim for totality).
add-rftotality alg-name-to-rftotality-idpredconst-name and
add-rltotality alg-name-to-rftotality-idpredconst-name removed.  They
can be defined by rtotal where the other parameters are substituted by
totality.  term-and-alist-to-totality-formula rewritten accordingly.

In term.scm

default-term-to-token-tree changed: if-terms for nested algebras do
not admit a case display.  In match-aux A -> B and A --> B considered
equal if A is n.c.  term-to-expr corrected: (i) in case GRecGuard if
language is scheme: then prevs rather than prevs-fix is used (ii) in
case = if language is scheme: quotation inserted.  (iii) parentheses
in var names are displayed with a semicolon.  Example:
\x28;nat=>nat=>nat@@nat\x29;.  This confuses the parser who takes the
semicolon as a comment symbol.  Cure: rename-parentheses .  natrec
natgrecguard etc renamed into natRec natGrecGuard

In pp.scm

token-tree-to-string and token-tree-to-pp-tree get new cases
idpredconst-op and cterm.  token-tree-tag-to-precedence and
prime-token-tree? adapted.

In formula.scm

formula-to-depth moved here from term.scm.  formula-to-spos-pvars
moved here from psym.scm.  imp-impnc-all-allnc-form-to-vars added.
imp-impnc-all-allnc-form-to-vars-and-prems-with-nc-indicator added.
tensor-form-to-imp-impnc-formula and h-deg-respecting? added.
fold-formula and unfold-formula adapted to h-deg-respecting
implications.  Reason: an excl-intro-aconst generated by
(make-excl-intro-aconst nc-indicator n) when turned into a theorem
should have an extracted term whose type does not involve the unit
type.  This is generally needed in program extraction when the theorem
is c.r. and contains general pvars some of whose are instantiated with
n.c. cterms.  Then cThm has a too general (i.e., not fitting) type,
since unit types are simplified away.  Therefore for the relevant
pvars (i.e., those whose tvar appears in type of cThm, except bot and
a final-val-type pvar) we say using nc-indicator which ones are are to
be specialized with n.c. cterms.  make-andi corrected: make-andl was
called with formula2 and formula1, i.e., in the wrong order.  ornc
added.  make-bicon, bicon-form?, bicon-form-to-bicon,
bicon-form-to-left, bicon-form-to-right or-form-to-disjuncts
qf-to-term formula-to-token-tree all extended by an ornc case.
formula-to-depth and formula-to-idpredconst-names added.
negation-form?  negation-form-to-kernel negation-log-form?
negation-log-form-to-kernel added.  totality-predicate? and
(unfold-totality formula) added.  In unfold-totality
term-to-totality-formula replaced by term-to-unfolded-totality-formula .
predicate-to-token-tree gets token-tree-tag idpredconst-op in case
there are cterms.  cterm-to-token-tree added.

In boole.scm

Token ornc added.  make-injection corrected.

In axiom.scm

Added Comp axioms corresponding to computation rules.  In check-aconst
opt-ignore-deco-flag (default: #t) introduced.  If it is #f it is
checked that psubst for the relevant pvars has c.r. cterms only.
all-formulas-to-ind-aconst and all-formula-to-cases-aconst now give an
error message in case of a nested algebra.  In
imp-formulas-to-uninst-gfp-formulas-etc at the internally defined
and-ex-fla-to-shortened-fla cases andu exl exu added.
tpsubst-for-param-pvars renamed into tpsubst.

In proof.scm

mk-proof-in-and-intro-form adapted to right-associative and.
(mk-proof-in-cr-nc-intro-form x . rest) added.  x is obtained from a
list of premises and variables where each element is followed by an
indicator for nc or cr (true means nc).  When normalizing a proof via
nbe in the elim case the associated rec constant has to accomodate the
free variables in inst-formula of the elim-aconst.  The tvars in their
types may be affected by the tpsubst of the elim-aconst.  When such a
type clash occurs, we rename type variables implicitly bound by tsubst
away from tvars.  In check-and-display-proof-aux it is checked that in
c.r. parts every aconst has relevant pvars substituted by c.r. cterms
only.  Hand normalization of proofs redone, including beta conversion
and idpredconst-elim-intro conversion.  The latter uses for nested
idpredconstants formula-and-psubsts-to-mon-proof.  An elim-intro redex
occurs when an elim aconst is applied to terms and the result of
applying an intro-aconst to terms and an idpc-proof.
proof-in-idpredconst-elim-intro-redex-form? and
proof-to-one-step-idpredconst-elim-intro-reduct added.
proof-to-one-step-beta-reduct replaced by proof-to-one-step-reduct.
proof-to-beta-nf replaced by proof-to-normal-form
proof-in-beta-normal-form? replaced by proof-in-normal-form?
proof-in-beta-normal-form-for-extraction? replaced by
proof-in-normal-form-for-extraction?  proof-in-beta-normal-form-aux?
replaced by proof-in-normal-form-aux?
formula-and-falsity-avar-to-efq-proof corrected and extended to
coinductively defined predicates (work of Kenji Miyamoto).

In pproof.scm

mk-imp-impnc-formula added.  make-exc-intro-aconst split into
make-exca-intro-aconst and make-excl-intro-aconst.  The latter takes a
list nc-indicator of booleans and a positive integer n.  The
implications after the Qs are determined by nc-indicator.  Similarly
exc-formula-to-exc-intro-aconst is split into
exca-formula-to-exca-intro-aconst and
excl-formula-to-excl-intro-aconst.  Both are used in exc-intro-intern.
(make-exc-elim-aconst l-test m n) uses stability.  In case the goal is
a negation stability can be avoided.  We then use
(make-exca-elim-neg-aconst m n) (make-excl-elim-neg-aconst
nc-indicator n).  All these occur in
(exca-formula-and-nega-concl-to-exca-elim-neg-aconst exca-formula
nega-concl) (excl-formula-and-negl-concl-to-excl-elim-neg-aconst
excl-formula negl-concl) (exc-formula-and-concl-to-exc-elim-aconst
exc-formula concl).  reset and INITIAL- removed.

In ets.scm

atom-true-proof rewritten and generalized to a partial variable.  It
is moved here from pproof.scm since it uses EqD.
idpredconst-to-et-type rewritten, to avoid that (exd boole T) gets
type boole yprod unit.  axiom-to-extracted-term corrected in case Elim
of a uniform one-clause defined idpredconst (like EqD).  In
global-assumption-to-extracted-term case EfqLog one needs an eterm of
function type, not inhab.  all-formulas-to-et-rec-const
all-formulas-to-mr-ind-proof now give an error message in case of a
nested algebra.  number-and-idpredconst-to-et-constr-term corrected:
simidpc-et-tvars instead of et-tvars needed.  OrNc added.  It is
needed for soundness proofs.  boole-eq-total-proof and theorem
BooleEqTotal added already here.  axiom-to-soundness-proof extended by
cases for Closure and Gfp.  rtotality added for yprod ysum ysumu
uysum.  Efq-Log and Stab-Log renamed into EfqLog and StabLog.  In
eqd-compat-proof and eqd-compat-rev-proof impnc replaced by imp.

In etsd.scm

impnc allowed.  However, for the Dialectica interpretation there is
no difference between imp and impnc.

In atr.scm

atr-min-excl-proof-to-bot-reduced-proof atr-min-excl-proof-to-ex-proof
atr-min-excl-proof-to-structured-extracted-term min-excl-proof?
adapted to the fact that the premises in the final kernel of
wrong-formula (i.e., the goals) can be imp as well as impnc premises.

In prop.scm

Reference to Vorobev 1964 added.

In gen-app.scm

INITIAL- removed.

In init.scm

INITIAL- removed.

In mpc.scm

INITIAL- removed.

In lnf.scm

(map (lambda (x y) (list x y)) arg1 arg2) replaced by (map list arg1 arg2)

In todo.scm

Added: (e, Total, RTotal) ~ (=, Equal, REqual).  add-equality and
add-requality to be defined.  The predconst Equal_{\alpha} should have
type alpha.  Example: CoREqualList, bisimilarity.

In examples/analysis/cauchysds.scm

simpreal.scm loaded before real.scm.  Constructor names L M R renaed
in Lft Mid Rht.  Simplified split lemmata.  Removed an unnecessary
let.  Inserted description of running the file cauchysds.hs generated
by terms-to-haskell-program . Extended experiments to include haskell
code.

In lib/nat.scm

AllPartial-All replaced by AllTotalIntro

In lib/list.scm

Theorem BooleEqTotal removed.  It already is in ets.scm.  rtotality
for list added.

In lib/numbers.scm

Theorem BooleEqTotal removed.  It already is in ets.scm.  Usage of
Stab-Atom removed.

  In examples/test/typ.scm In examples/test/var.scm
In examples/test/pconst.scm In examples/test/psym.scm In
examples/test/term.scm In examples/test/formula.scm In
examples/test/axiom.scm In examples/test/proof.scm In
examples/test/pproof.scm In examples/test/ets.scm

Extended and cleaned up.

In examples/tutor.scm
In doc/tutor.tex

Updated to the present terminology.  For instance, Truth-Axiom
replaced by the theorem Truth.  Minor corrections.

In doc/ref.tex

Material in temp/nested.tex and in lectures/proofth/ss13/pt.tex included.
Structural totality used as a convenient abbreviation only.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2013-09-27

In examples/test/typ.scm
In examples/test/var.scm
In examples/test/pconst.scm
In examples/test/psym.scm
In examples/test/term.scm
In examples/test/formula.scm
In examples/test/axiom.scm
In examples/test/proof.scm
In examples/test/pproof.scm
In examples/test/ets.scm

Updated to the present examples of algebras.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2013-09-16

In list.scm

remove-nth added.

In typ.scm

RESERVED-NAMES extended, and made into a simple list.

In psym.scm

In add-ids enforced-et-alg-names removed.  One can use arbitrary
algebra names.

In term.scm

default-term-to-token-tree corrected: if an alternative in an if-term
does not have sufficiently many abstracted variables, then they are
generated via term-to-simple-outer-eta-expansion .
term-to-simple-outer-eta-expansion introduced.  It takes an optional
argument l for the number of argument types to be abstracted.  In
contrast to term-to-outer-eta-expansion it does not expand newly
introduced variables.  Moreover new abstracted variables are only
generated when necessary.  Changes made by Fredrik Nordvall Forsberg
(Haskell translation): (i) The list of pconst names mapped to Haskell
functions was outdated.  (ii) We sometimes added more function
definitions than needed, e.g. IntPred is defined in terms of PosPred,
but IntPred is translated to a builtin function, so there is no need
to pull in the definition of PosPred anymore.  (iii) Take the type of
constants, not only their names, into account when deciding if they
are numeric terms.  (iv) Star-types now considered in the translation
of canonical inhabitants.  (v) Bug repaired in the version of the
translation which removes the measure from general recursion.

In boole.scm

Display strings des and desyprod changed into Des and DesYprod.

In axiom.scm

alltotal-aconst and alltotal-rev-aconst marked as obsolete (not used).
alltotal-intro-aconst added (for allpartial-all-aconst ).
alltotal-elim-aconst added (for all-allpartial-aconst ).
allnctotal-intro-aconst and allnctotal-elim-aconst added.  In
aconst-to-computed-repro-data occurence of make-stotal removed, and
typo for the Cases aconst eliminated.  In check-aconst newly
introduced assumption constants inserted.  symm replaced by sym.

In pproof.scm

Axioms AllTotalIntro (was AllPartial-All), AllTotalElim (was
All-AllPartial), AllncTotalIntro, AllncTotalElim are viewed as initial
theorems, with the same name.  This makes it easy to use them in
interactive proofs.  Further abbreviation axioms AtomToEqDTrue
EqDTrueToAtom ExTotalIntro (was ExPartial-Ex) and ExTotalElim (was
Ex-ExPartial) will be added to THEOREMS in ets.scm, when Leibniz
equality EqD and ExR are available.  From them Truth := atom(True) (a
preferred alternative to Truth-Axiom) is proved and added to THEOREMS.
Then EqDCompat EqDCompatRev EqDSymm EqDTrans EqDCompatApp EFEqD are
proven and added to THEOREMS.  Also InhabTotal (needed to express that
an arbitrary type given by a type variable is inhabited) and
InhabTotalMR (needed for its realizability interpretation) are proved
from the corresponding axioms and added (in ets.scm) to THEOREMS.
INITIAL-THEOREMS updated accordingly.  In reset
INCREASING-ALGEBRAS-TO-COERCION-ALIST commented out.  simp-with-intern
corrected: when testing whether the substitution of lhs by varterm has
changed the formula, the comparison should be done *without*
normalization.  Use formula=? rather than classical-formula=?  Further
change in simp-with-intern : all non-normalized cases are checked
first, to avoid unwanted normalizations.  Names in simp-with
corrected: opt-dir -> opt-dir-or-x and rest -> x-and-xs-or-xs.  A goal
has ncvars as a separate field.  This is a sublist of its context,
containing all object and assumption variables used later for
allnc-intro or impnc-intro.  Obsolete: goal-to-cvars.  New:
context-and-ncvars-and-formula-to-formula which replaces
context-and-cvars-and-formula-to-formula . In inst-with-intern test
for nc-violations corrected.  It is now done as in use-with-intern,
via nc-violations of final-proof.  symm replaced by sym.

In ets.scm

extotal-aconst and extotal-rev-aconst marked as obsolete (not used).
expartial-ex-aconst renamed into extotal-intro-aconst.
ex-expartial-aconst renamed into extotal-elim-aconst.
Theorems ExTotalIntro and ExTotalElim added.
axiom-to-extracted-term and theorem-to-extracted-term adapted to
the renaming.

In lib/nat.scm

Theorem NatTimesPlusDistr and NatTimesPlusDistrLeft expressing the
corresponding rewrite rules added.  Their proofs are adapted to the
change in simp.  NatTotalVar added.  NatLeastUpTotal added.  Theorems
NatLtMonPlus1 NatLtMonPlus2 NatLtMonMinus NatLtMonMinusLeft added.
NatLeastLeIntro NatLeastLtElim NatLeastUpLeIntro NatLeastUpLtElim
added.  NatLeastUpBound NatLeastUpLBound added (were forgotten).
NatLeGeToEq renamed into NatLeAntiSym.  NatEqSymm replaced by
NatEqSym.  NatRecTotal added.  NatDouble NatEven NatHalf CVInd added.
synt-non-zero? now includes NatToPos.

In lib/numbers.scm

TranslationPosAsInt added.  nat.scm always loaded if not already done.
Algebra real renamed in to rea.  This avoids a clash with data Real =
RealConstr .. in average.hs produced by terms-to-haskell-program .
Added PosTotalVar PosEqToEqD PosIfTotal PosRecTotal .  Similarly for
the algebras int rat rea cpx.  Computation rule for RealLt corrected.
PosExpOne added, and also the rewrite rule 1**n -> 1.  To transfer
properties proved for nat to pos is seems best to have an inverse
NatToPos to PosToNat .  This requires introduction of NatEven
NatDouble and NatHalf .  PosToNat redefined using NatDouble
NatToPosToNatId and PosToNatToPosId added, proving the identities.
PosToNatPlus PosToNatTimes PosToNatLe PosToNatLt added, proving that
PosToNat is an isomorphism w.r.t. + * <= <.  Similarly for NatToPos .
PosLeMonPlus and PosLeMonTimes added.  To prepare defining RealTimes
by computation rules and proving RealTimesTotal (in real.scm) PosLog
and the theorems PosLeExpTwoLog PosLtExpTwoSuccLog RatLeCritPos
RatLeBoundPos added.  Global assumptions RatTimesTwoExp RatDivTwoExp
added.  Theorems RatLeBound and RatLeAbsBound added.  PosToNatToInt:
NatToInt(PosToNat pos)=IntP pos added.  PosNotLeToLt added as global
assumption.  It should be best proved using the isomorphic embedding
PosToNat of pos into nat.  PosNotLtToLe added.  Proofs of RealPosTotal
RealLtTotal added.  RealInv and RealInvTotal added.

In examples/analysis/simpreal.scm

Algebra real renamed into rea.  This avoids a clash with data Real =
RealConstr .. in average.hs produced by terms-to-haskell-program .
Comment syntax with hash symbol removed.

In examples/analysis/real.scm

This file real.scm should be loaded after numbers.scm.  Global
assumptions already proved in numbers.scm removed.  Rules for
RealTimes and proof of RealTimesTotal added.  This requires much of
this file, and in particular ord-field-simp-bwd from simpreal.  Hence
both are covered only here.  TotalReaPos TotalReadInt TotalReaRat
added.  ApproxSplit and its corollaries, together with the used global
assumptions, moved here from cont.scm.  We formulate ApproxSplit with
oru rather than with ex boole.  The latter version is called
ApproxSplitBoole and proved from the present ApproxSplit in cont.scm.

In examples/analysis/cont.scm

Names for global assumptions unified.  Equal replaced by Leibniz
equality EqD.

In examples/analysis/extraction.scm

Updated.

In examples/tutor.scm

Symm, Tran replaced by Sym, Trans

In doc/tutor.tex

Symm, Tran replaced by Sym, Trans.

In doc/ref.tex

NatLeast and NatLeastUp updated.  Adapted the Example (introducing
let) in section 6.2 Normalization.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2013-06-02

In boole.scm

Discarded code (with add-param-alg) removed.

In axiom.scm

In add-theorem for lemma L degree of totality of the pconst cL changed
to (term-to-t-deg (proof-to-extracted-term proof)).  Usage of
formula-with-total-extract? removed.

In ets.scm

formula-with-total-extract? removed.

In lib/nat.scm

LeastNat added, with theorems LeastNatTotal LeastNatBound
LeastNatLtIntro LeastNatLtElim1 LeastNatLtElim2 LeastNatEqIntro
LeastNatEqElim .  LeastNat supersedes AllBNat.  NatMaxLUB added.

In lib/numbers.scm

Definition of PosMinus and of RatExp corrected.  Totality proofs added,
also for PosMax PosMin IntAbs IntMax IntMin IntEqTotal RatEqTotal
RatAbsTotal RealAbsTotal.  Rewrite rule PosPred(PosS pos) -> pos added.

In doc/ref.tex

Example (introducing let) added in section 6.2 Normalization.
Example (introducing abbreviations) added in the by-assume section.
Section on nat.scm added.

New names of abbreviating axioms:

AllTotalIntro (was AllPartial-All or AllTotalRev)
AllTotalElim (was All-AllPartial or AllTotal)
AllncTotalIntro (was AllncPartial-Allnc or AllncTotalRev)
AllncTotalElim (was Allnc-AllncPartial or AllncTotal)

For the inductively defined existential quantifiers

ExDTotalIntro (was ExDTotalRev)
ExLTotalIntro (was ExLTotalRev)
ExRTotalIntro (was ExRTotalRev)
ExUTotalIntro (was ExUTotalRev)
ExDTotalElim (was ExDTotal)
ExLTotalElim (was ExLTotal)
ExRTotalElim (was ExRTotal)
ExUTotalElim (was ExUTotal)

For the primitive existential quantifier (possibly useful for efficiency)

ExTotalIntro (was ExPartial-Ex or ExTotalRev)
ExTotalElim (was Ex-ExPartial or ExTotal)

In examples/analysis/simpreal.scm

term-to-numerator-and-denominator rewritten, to work with general
application terms

In examples/analysis/cont.scm

Adapted to right-associative and.  Dot notation removed.  Definition
of application notation f x simplified.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2013-03-01

In gen-app.scm

Introduction of application notation simplified: add-application takes
an application operator as argument.

In init.scm

COMMENT-STRING set to the empty string.

In list.scm

minima and choices added.

In typ.scm

type-to-free renamed into type-to-tvars .  In make-substitution-wrt
error message improved.  (type-gen-substitute type gen-tsubst)
substitutes simultaneously the left hand sides of the alist
gen-tsubst by the corresponding right hand sides.  gen-subst is an
alist associating types to types.  alg-name-to-spos-tvars
alg-to-spos-tvars type-to-spos-tvars added.  finalg? adapted to
nested algebras.  add-algebras-with-parameters extended to nested
algebras.  To add algebras use add-algs.

Parallel to add-ids, the constructor names are optional and hence
written after the type-string.  However, since by convention algebra
names start with a lower case character and constructor names with
an upper case character we can also use the opposite order (as
before).  We require that the constructor types are given in a fixed
order, where nullary constructor types come first.
type-to-canonical-inhabitant adapted (should be renamed into
type-to-total-inhabitant ).

constr-types-with-names-and-rest-names-to-inhabcrits
type-to-inhabcrits alg-name-to-constr-types-with-names added.

In pconst.scm

make-map-const type-etc-to-map-const map-at and map-at-intern added.
In alg-name-etc-to-rec-const rec-at nbe-object-rec-compose usage of
apply made more readable (no cons needed for initial arguments).
Recursion and corec-const-and-bound-to-bcorec-term adapted to nested
algebras.  corec-const-to-uninst-alg-or-arrow-types corrected.
destr-const-to-alg added.

In psym.scm

idpredconst-name-to-spos-param-pvars idpredconst-to-spos-pvars
formula-to-spos-pvars added.  add-ids adapted to nested clauses.
idpc-clause? removed.  For simplicity it is required that nullary
clauses come first in the listing of clauses.  This makes
clauses-with-idpc-pvars-to-nullary-clauses superfluous.  Minor
cleanup in add-mr-ids .  formula-to-et-type-for-mr-clauses adapted
to nestedness by referring to a new
idpredconst-to-et-type-for-mr-clauses .  In the imp/impnc case of
real-and-idpc-clause-to-mr-idpc-clause allnc, impnc replaced by all,
imp.  This modifies the IMR clauses which allows in the IMR case to
construct the correct formula in
imp-formulas-to-uninst-elim-formulas-etc .
real-and-idpc-clause-to-mr-idpc-clause is similar to
real-and-formula-to-mr-formula-aux .  The difference is in the usage
of the local pvar-to-mr-pvar (with special results for idpc-pvars)
and formula-to-et-type-for-mr-clauses.  add-co extended to nested
clauses.

In term.scm

unfold-simplified-simrec-appterm and simplify-simrec-appterm
adapted.  first-match rewritten to accomodate inductive predicates.
pattern-and-instance-to-tsubst-aux extended to deal with Total x^
and TotalNat n^ (as in match-aux).

Fredrik Nordvall Forsbergs to-expr.scm integrated.
term-to-external-expr aims at producing a readable Scheme/Haskell
expression that can be evaluated.

The case for Scheme, it transforms an application of a program
constant c to args, where c has a corresponding built-in Scheme
operator written in uncurried form with (length args) many
arguments, into the corresponding Scheme expression.  Example:
((NatLe r1) r2) is transformed into (<= e1 e2).  If however c is
applied to fewer arguments, then the default translation of c is
used.  Example: (NatLe r1) is transformed into (|NatLe| e1).  To run
this expression one needs to define the default translation of c on
the Scheme level, in curried form.  Example: (define |NatLe| (lambda
(x) (lambda (y) (<= x y)))).  For the usual built-in operators this
can be done globally.  For constants occurring in a special example
it must be done locally.  Example: in the gcd example we have the
Step function.  The general term-to-external-expr produces (by
default) |Step|, and then in gcd.scm |Step| needs to be defined on
the Scheme level.  By default |Step| is treated as a curried
function.  However, with an optional argument '("Step" 4) in
term-to-external-expr one can enforce that |Step| is treated as a
function with four arguments.

Equality with name "=" requires a special treatment: if there are
exactly two arguments, it is transformed into an =-expression if the
type of = refers to a number type (nat, pos, int or rat), and to an
equal?-expression otherwise.  If it is applied to fewer arguments,
then one needs FinAlg= as a special default name, since the internal
name = cannot be used.

In term-to-external-expr, terms in numeric form wrt either pos or
nat are both displayed as the corresponding number.  Therefore both
is-numeric-term-wrt-pos? and is-numeric-term-wrt-nat? have been
moved here, and similarly numeric-term-wrt-pos-to-number and
numeric-term-wrt-nat-to-number.

In pp.scm

token-tree-tag-to-precedence corrected:  alg-typeop has one less than
the maximal precedence

In formula.scm

andl included

In boole.scm

Token andL added.  make-ysumu and make uysum added.

In axiom.scm

check-aconst adapted to ElimMR.
mr-elim-aconst-to-computed-repro-formulas added.
non-computational-invariant? adapted to andl.

alltotal-aconst alltotal-rev-aconst
allnctotal-aconst allnctotal-rev-aconst exdtotal-aconst
exltotal-aconst exrtotal-aconst exutotal-aconst exdtotal-rev-aconst
exltotal-rev-aconst exrtotal-rev-aconst exutotal-rev-aconst
extotal-aconst extotal-rev-aconst total-pair-aconst
total-pair-rev-aconst added.  In add-theorem error identification
corrected for soundness theorems.

imp-formulas-to-uninst-elim-formulas-etc adapted to nested idpcs.
imp-formulas-to-elim-aconst returns ElimMR aconst in IMR case.
formula-to-prem-modified-formula added.
idpc-clause? 
imp-form-to-param-premises-and-rec-prems-imp-final-concl
rec-premise-of-idpc-clause? (appeared twice)
idpc-clause-to-rec-premises
imp-form-to-param-premises-imp-rec-prems-imp-final-concl removed.
strictly-positive? removed.  It is superseded by type-to-spos-tvars
and formula-to-spos-pvars .

In proof.scm

andl included.  formula-to-efq-proof simplified.
unfold-total-variables fold-total-variables fold-to-unfold
unfold-to-fold fold-imp-unfold-proof added.
constructor-eqd-proof-to-args-eqd-proof corrected (arg-type -> alg)

In pproof.scm

casedist added (was forgotten).  andl included.  elim-intern adapted
to the fact that the uninst-formula of an elim-aconst for IMR starts
with all x.  In inversion-intern, simplified-inversion-intern and
cases-intern the obsolete make-eq replaced by make-eqd.  In
x-and-x-list-to-proof-and-new-num-goals-and-maxgoal partial
arguments for and-const and imp-const allowed.

In ets.scm

imp-formulas-to-mr-elim-proof corrected in case (car imp-formulas)
is c.i.: then the lists gs are all empty (cf. [SW12, p.344]).  In
imp-formulas-to-mr-elim-proof pvar-to-tvar replaced by PVAR-TO-TVAR
idpredconst-to-mr-idpredconst adapted to nested algebras.  AndL
added.  imp-formulas-to-et-rec-const adapted to nested algebras.

In atr.scm

impnc added

In lib/numbers.scm

make-numeric-term-wrt-pos extended to also handle negative integers
(it already handles the non-positive number 0) suggestion: rename
function since not always positive

Some program constants added that are needed for the translation to
Haskell, not meant to be used by the user.  Maybe give them less
understandable names?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2012-10-18
Done locally 2012-04-22

In list.scm

list-tabulate and find-tail added.

In pconst.scm

In change-t-deg-to-one new-rhs and new-lhs generated by term-gen-subst
for pconst and new-pconst, rather than by first producing a display
string and then parsing this string.

In psym.scm

Duplicated term-to-totality-formula (commented out) removed.  In
add-ids it is checked that taking the initial clause of each idpc
produces clauses without recursive calls which are terminating.  In
clauses-with-idpc-pvars-to-nullary-clauses imp-form-to-premises
replaced by imp-impnc-form-to-premises.

In axiom.scm

In add-theorem special treatment of Inhab removed.  inhabtotal-aconst
and inhabtotalmr-aconst moved from here to axiom.scm.

In boole.scm

Degrees of totality changed to t-deg-zero for pconsts Inhab AndConst
ImpConst OrConst NegConst PairOne PairTwo.  Duplicated falsity-log
(commented out) removed.

In proof.scm

formula-to-efq-proof renamed into formula-to-efq-proof-or-f , since it
is used as a test in inversion and simplified-inversion , and occurs
only there.  A new section 10-8 Basic proof constructions has been
added.  There a proper formula-to-efq-proof is provided, which returns
a proof of F --> A .  make-proof-in-iterated-imp-elim-form and
eqd-proofs-and-predicate-proof-to-proof added.  To generate proofs of
the injectivity of constructors
constructor-eqd-proof-to-args-eqd-proof added.  It expects an
eqd-proof of C rs eqd C ss with the same constructor C and C rs of
ground type, and an optional index (with default value 0).  The result
is a proof of ri eqd si.  constructor-eqd-imp-args-eqd-proof is
similar, but expects an eqd-formula rather than an eqd-proof, and
proves the implication C rs eqd C ss --> ri eqd si.
constructors-overlap-imp-falsity-proof moved from ets.scm to here.  It
is used for formula-to-efq-proof and this in turn for inversion.

In pproof.scm

InhabTotal and InhabTotalMR removed from INITIAL-THEOREMS .  They will
be proved from the respective axioms in ets.scm and added to THEOREMS.

formula-to-efq-proof renamed into formula-to-efq-proof-or-f , since it
is used as a test in inversion and simplified-inversion , and occurs
only there.  strip-intern adapted to inductively defined connectives.

In ets.scm

inhabtotal-aconst and inhabtotalmr-aconst moved here from axiom.scm.
Theorems InhabTotal and InhabTotalMR added.  imp-const-total-proof
or-const-total-proof neg-const-total-proof pair-one-total-proof
pair-two-total-proof added.  Theorems ImpConstTotal OrConstTotal
NegConstTotal PairOneTotal PairTwoTotal added.
constructors-overlap-imp-falsity-proof moved to proof.scm from here.
truth-proof and theorem Truth added.

In lib/nat.scm

Theorem BooleEqToEqD added (for use in NatMinusPlusEq when simp is
applied to NatMinusPlus).

In lib/list.scm

ListNatEqToEqD added (for use in compat-at, to avoid Equal).
ListNatEqTotal BooleEqTotal ListBooleEqToEqD ListBooleEqTotal added.

In src/Makefile

Removed ../doc/ref.tex ../doc/tutor.tex from TAGS

In doc/ref.tex

Updated and extended.  New subsection on Basic proof constructions
added.

In doc/tutor.tex

by-assume-with replaced by by-assume.  display-constructors replaced
by display-alg.  Index added.

In doc/minlog.bib

Updated.

In doc/Makefile

makeindex added for tutor.

In examples/tutor.scm

COQ-GOAL-DISPLAY set to false.  by-assume-with replaced by by-assume.
display-constructors replaced by display-alg.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2012-03-17

In proof.scm

permutative-aconst-proof-to-eta-expansion-aux corrected:
proof-to-formula replaced by aconst-to-inst-formula

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2012-03-15

In lib/numbers.scm

Removed add-mr-ids for TotalNat.  It is already in lib/nat.scm.

In examples/analysis/average.scm

Removed add-totality for pos and int.  They are already in
numbers.scm.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2012-03-13

In doc/ref.txt

Theory of spreading, wiping and isolating formulas included.

In list.scm

list-and-test-to-head-up-to-last added.

In typ.scm

TotalMR added as reserved name.  check-admissible-tpsubst added, as
test function for tpsubsts.  If the argument is not an admissible
tpsubst, an error is returned.  type-match-modulo-coercion-aux
corrected.  For the rigid components of the type type-le? had to be
used in the other direction.

In pconst.scm

display-pconst corrected for external code.  In add-rewrite-rule
reference (via make-eq) to the obsolete predicate constant Equal
removed.  In change-t-deg-to-one usage of (term-to-string lhs)
replaced by (token-tree-to-string (default-term-to-token-tree lhs)).
This avoids disappearance of coercion functions like NatToInt, which
can lead to type errors in subsequent parsing.  In destruct-at wrong
parenthesis moved to the right place.

In term.scm

app-term-with-low-original-types? added.  It is used in
term-to-token-tree, to display coercions where the strategy of doing
arthmetical operations at the lowest possible level has not been
observed.  Example: (IntPlus pos n) has this display, not (pos+n).
The pconst RealPos does not appear, since it has no special display.
formula-to-token-tree need not be changed, since a prime formula is
either given by a boolean term or else has no special display
(examples: RealEq RealNNeg RealLe).  default-term-to-token-tree in
case term-in-if-form and a newly introduced global variable
CASE-DISPLAY is true returns a token tree with case-op, which includes
token trees with case-item.  In term-to-expr NatMax and NatMin etc
allowed.  term-in-rec-normal-form? corrected.  term-to-rec-nf added.
match-aux extended to match Total xs with TotalList ns.
huet-unifiers-rigid-rigid extended similarly.

In pp.scm

token-tree-to-string extended to tokens case-op and caseitem-op.
Auxiliary function token-tree-tag-to-precedence added.
token-tree-to-pp-tree added.  pretty-print-with-case-display
(abbreviated ppc) added.

In psym.scm

Suffix Real (for realize) changed to MR.  terms-to-mr-totality-formula
alg-to-mr-totality-idpredconst and
alg-name-to-mr-totality-idpredconst-name added.
string-and-arity-to-predconst-parse-function rewritten with
formula-substitute , to parse Total and (arity nat) into TotalNat.
check-idpredconst added, as test function for idpredconsts.  If the
argument is not an idpredconst, an error is returned.
idpredconst-name-to-tvars corrected for mr-idpcs.  We must distinguish
whether we have an original idpc or an mr-idpc.  In the former case
take orig-idpredconst-name-to-tvars, i.e., the tvars in the original
clauses.  In the latter case from et-types take all tvars associated
to param-pvars.  These mr-tvars are appended in front of orig-tvars.
add-ids-aux adapted: param-tvars and param-pvars are only computed
after idpc-names are added to IDS.  This enables the new
idpredconst-name-to-tvars (which distinguishes original idpc-names and
mr-idpc-names) to produce correct results.  add-mr-ids corrected.
cr-param-pvars and ci-param-pvars treated differently.  Its auxiliary
functions formula-to-et-type-for-mr-clauses and
real-and-idpc-clause-to-mr-idpc-clause both need additional arguments
mr-et-tvars and idpc-pvars.  Notice that the general
real-and-formula-to-mr-formula-aux does not need these additional
arguments mr-et-tvars and idpc-pvars: in the pvar case the h-deg of
the pvar suffices.  term-to-totality-formula and
term-to-stotality-formula corrected for terms with type in star form.
In real-and-idpc-clause-to-mr-idpc-clause and
formula-to-et-type-for-mr-clauses in the predconst case the predconst
Total (which is c.r.) gets a special treatment.

In formula.scm

make-totalmr added.  formula-substitute extended to predconst TotalMR.
make-stotal removed.  unfold-formula now unfolds (Total r) via
term-to-totality-formula and (TotalMR r0 r) via
terms-to-mr-totality-formula.  rename-variables-aux simplified for
identity substitutions.  formula-subst-and-beta0-nf added.

In grammar.scm

STotal removed and TotalMR added predconst-names.

In axiom.scm

aconst=? gives #f in case one argument is not of aconst form.
check-aconst corrected for Elim and Gfp aconsts.  total-aconst
removed.  It is obsolete because Total f unfolds via unfold-formula
into allnc x^(Total x^ -> Total(f x^)).  STotal make-stotal
stotal-aconst and the initial theorem Stotal removed.  Reason:
stotality does not make sense abstractly, but only for an algebra.
There it can be defined inductively.  Example: STotalList.
constr-name-to-constr-total-aconst removed: this is just what the
clauses of TotalNat say.
constr-name-and-index-to-constr-total-args-aconst removed.  Reason:
TotalNat(Succ n^) -> TotalNat n^ can be proved by inversion (cf
test.scm for the idpc Even).  total-pair-aconst and total-proj-aconst
removed, because for instance Total(x^ @y^) unfolds via unfold-formula
into Total x^ & Total y^ .  Moreover one should use the inductively
defined TotalYprod(x^ pair y^) instead.  finalg-to-eq-to-=-1-aconst
and finalg-to-eq-to-=-2-aconst and finalg-to-=-to-eq-aconst are
obsolete because Equal is.  TotalInhab renamed into InhabTotal.
inhabtotalmr-aconst added.  sfinalg-to-se-to-stotal-aconst and
sfinalg-to-stotal-to-se-aconst removed since they contain the obsolete
predconct STotal.  allnc-allncpartial-aconst and its converse
allncpartial-allnc-aconst and also ex-expartial-aconst
expartial-ex-aconst exnc-exncpartial-aconst exncpartial-exnc-aconst
conflict with Total being c.r. and are discarded.
idpc-clause-to-rec-premises added.  non-computational-invariant?
extended to inductively defined connectives.
theorem-or-global-assumption-name-to-pconst-name changed:
RatTimesTotal maps to RatTimes, not cRatTimesTotal.  add-theorem
adapted to the case where the theorem name ends with Total.
add-global-assumption accepts a string as argument, which is parsed
into a formula.  Suffix Real (for realize) changed to MR.

In proof.scm

Corrected (free variables were forgotten):
make-proof-in-andd-elim-left-form make-proof-in-andd-elim-right-form
make-proof-in-andr-elim-left-form make-proof-in-andr-elim-right-form
make-proof-in-andu-elim-left-form make-proof-in-andu-elim-right-for
display-proof display-normalized-proof proof-to-expr and
proof-to-expr-with-formulas now have opt-proof-or-thm-name as
argument.  opt-proof-or-thm-name-and-ignore-deco-flag now has
opt-proof-or-thm-name-and-ignore-deco-flag as argument.  Adapted to
admissible substitutions: proof-to-goedel-gentzen-translation-aux
spreading-formula-to-proof spreading-formula-to-proof-aux
wiping-formula-to-proof wiping-formula-to-proof-aux
isolating-formula-to-proof isolating-formula-to-proof-aux Suffix Real
(for realize) changed to MR.  In reset TotalMR included.  Typo
corrected: myerreor -> myerror.

In pproof.scm

set-goal displays the goal with the originally chosen variable names:
it uses display-num-goal with fold-formula only.  This overrides the
default display function (with rename-variables) in display-num-goal .
Error message introduced for sg .  INITIAL-THEOREMS updated,
InhabTotalMR included.  INITIAL-COQ-GOAL-DISPLAY set to true.
display-num-goal uses rename-variables (default case).  If renaming of
variables in a goal is not desired, use
display-current-goal-with-original-variables abbreviated dcgo .
assert and cut both accept a string as argument, which is parsed into
a formula.  drop-except added.  In (drop-except . x-list), x-list is a
list of numbers or strings identifying hypotheses from the context.  A
new goal is created, which differs from the previous one only in
display aspects: all hypotheses except the listed ones are hidden (but
still present).  split extended to inductively defined conjunctions
andd andr andu.  msplit adapted to right-associative and.  ex-intro
accepts a string as argument, which is parsed into a term.  compat-at
and compat-rev-at rewritten, using Leibniz equality EqD rather than
Equal.  This makes Equal obsolete.  Auxiliary functions
finalg-to-string and finalg-to-=-to-eqd-aconst added.
simphyp-with-intern corrected.  simp-with-to removed.

In prop.scm

elem-form? redefined, to make formulas built with (inductively
defined) binary connectives (ord, andd etc) elementary.

In ets.scm

In formula-to-et-type treatment of preconst TotalMR included.
formula-of-nulltype? and formula-of-nulltype-under-extension? in the
preconst case Total corrected (the result then must be #f)
Totality added for the algebras unit boole yprod ysum uysum ysumu.
proof-to-extracted-term-aux corrected for an ExR elim aconst with
c.i. kernel.  proof-to-extracted-term and theorem-to-extracted-term
get an unfold-let-flag as optional argument.  If it is present and
true, than cId's will be unfolded.  axiom-to-extracted-term
theorem-to-extracted-term and global-assumption-to-extracted-term
added.  imp-formulas-to-et-rec-const adapted to c.r. Total predconsts.
efeqd-proof added.  This allows to put EFEqD into THEOREMS when
loading init.  It is done here, since the proof uses EqDCompat.
constructors-overlap-imp-falsity-proof added.  This can be used for
formula-to-efq-proof and this in turn for inversion.  Added (before
the internal proof of soundness): and-const-total-proof
boole-if-total-proof .  Theorem BooleIfTotal added.
idpredconst-to-mr-idpredconst corrected.  In
real-and-formula-to-mr-formula-aux c.r. idpcs with identity instead of
an alg name (i.e., ExL, ExR, ExLT, ExRT, AndR) are treated separately.
In the predconst case the predconst Total (which is c.r.) gets a
special treatment.  Local variable pvar-to-mr-pvar replaced by
reference to a newly introduced global variable PVAR-TO-MR-PVAR, which
refers to and updates PVAR-TO-MR-PVAR-ALIST.
proof-to-soundness-proof-aux extended to Intro and Elim axioms for
inductively defined predicates.  Auxiliary functions
number-and-idpredconst-to-intro-mr-proof imp-formulas-to-mr-elim-proof
proof-to-allnc-impnc-proof
real-mr-clause-proof-and-clause-to-clause-proof
allnc-impnc-to-exu-imp-proof added.  exl-formula-to-exl-intro-mr-proof
exr-formula-to-exr-intro-mr-proof exu-formula-to-exu-intro-mr-proof
andr-formula-to-andr-intro-mr-proof
eqd-elim-aconst-to-eqd-mr-elim-proof added.  axiom-to-soundness-proof
theorem-to-soundness-proof and global-assumption-to-soundness-proof
added.  proof-to-soundness-formula added.

In lib/nat.scm

TotalNatMR added.  Inductively defined predicate TotalBoole moved to
boole.scm.  (add-theorem "AndConstTotal" and-const-total-proof) moved
to ets.scm.  NatIfTotal NatEqTotal NatLtToLe and NatLeGeToEq added.
NatLtToLePred and NatLtMonPred added.  NatEqToEqD added.  NatIfTotal
NatEqTotal NatLtToLe and NatLeGeToEq added.  NatLtToLePred and
NatLtMonPred added.  Monotonicity properties NatLeMonPlus,
NatLeMonTimes, NatLeMonPred, NatLeMonMinus added.  NatPlusMinus
NatMinusPlus NatMinusPlusEq NatMinusMinus added.  Further rewrite
rules added:

nat1*Pred nat2 => nat1*nat2--nat1
Pred nat2*nat1 => nat2*nat1--nat1
nat1*(nat2--nat3) => nat1*nat2--nat1*nat3
(nat2--nat3)*nat1 => nat2*nat1--nat3*nat1

nat1+nat2<nat1 => False
nat1+nat2<nat2 => False

nat1<=nat2+nat1 => True
Pred nat<=nat => True
nat1--nat2<=nat1 => True

0--nat => 0
nat1+nat2--nat2 => nat1
nat2+nat1--nat2 => nat1
nat1--nat2--nat3 => nat1--(nat2+nat3)

Renamed Nat=Trans into NatEqTrans, etc.  Generally: = -> Eq.  For
Leibniz equality use EqD

In lib/list.scm

TotalListMR and STotalListMR added.  ListAppendTotalSound
ListAppendSTotalSound ListAppendNilPartialSound ListAppdTotalSound
ListAppdSTotalSound ListAppdNilPartialSound ListLengthTotalSound
ListLengthSTotalSound ListProjTotal ListProjTotalSound added.

In lib/numbers.scm

Added totality proofs.  The successor S for pos renamed in PosS, to
avoid conflict with the reserved name STotal.  CpxMax CpxMin removed.
SOne pos1--SZero pos2 mapsto SZero pos1--(SZero pos2--1) replaced by
mapsto SOne(pos1--pos2).  ALGEBRA-EDGE-TO-EMBED-TERM-ALIST needs to be
updated once PosToNat and NatToInt have been proved to be total.
replace-item-in-algebra-edge-to-embed-term-alist provided for this.
Postponed: some rewrite rules, and totality proofs of PosMax PosMin.
RatEq renamed into RatEqv to avoid clash with ordinary equality.

In examples/test.scm

Updated

In examples/analysis/average.scm.

Updated.

In examples/analysis/simpreal.scm

In ord-field-simp-bwd the newly generated global assumption 
ex k RealLt 0(abs x)k -> ... 0<abs r -> ... -> atom -> simp-atom 
now is formulated (as it should) with an integer k, not a pos.
RatEq replaced by RatEqv

In examples/analysis/real.scm

RatEq replaced by RatEqv

In examples/analysis/cont.scm

RatEq replaced by RatEqv

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2011-08-27

In examples/analysis/ratsds.scm

Adapted to the the new convention in psym.scm: in add-ids
et-constr-names written with capital C followed by the clause name
(like CInitEv) to avoid clash with program constants for the
clause-theorems.  Hence we need CGenQ rather than cGenQ.

In examples/parsing/parens.scm

Proof of totality of Test updated.  Totality predicate for the algebra
par added.

In examples/analysis

Added average.scm.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2011-08-18

In examples/tutorial.scm

Renamed into examples/tutor.scm

In lib/nat.scm

Inductively defined predicate TotalNat and TotalBoole added.  Usage
of finalg-to-e-to-total-aconst removed from the proof of
NatPlusTotal and other totality theorems.

In lib/list.scm

Inductively defined predicate TotalList added.  Arguments of Consn
switched: the parameter argument now comes first.  Usage of
finalg-to-e-to-total-aconst removed from proofs totality theorems.

In typ.scm

mk-star added.  In compose-substitutions
compose-substitutions-and-beta-nf compose-substitutions-and-beta0-nf
it is now checked that the second substitution is admissible for the
values of the first substitution (work of Anton Freund).
display-constructors renamed into display-alg and moved from
pconst.scm to typ.scm.

In pconst.scm

In add-program-constant an optional totality-flag can indicate that no
proof of totality is needed.  display-pconst added.  It replaces
display-program-constants and display-program-constant.  Terminology
in arrow-types-to-uninst-recop-types-and-tsubst clarified.
alg-or-arrow-types-to-uninst-corecop-types-and-tsubst corrected in the
simultaneous case: the uninst-step-types need to be taken in their
original order (correction due to Kenji Miyamoto).  In
corec-const-and-bound-to-bcorec-term again in the simultaneous case
the resulting application term of product type (with a recursion
constant as operator) is replaced by an appropriate component.  This
makes both bcorec-term-and-alg-name-to-component and
bcorec-term-and-alg-name-to-component-aux (which were originally
intended for this purpose) superfluous.  They are discarded.
display-constructors renamed into display-alg and moved to typ.scm.
undelay-delayed-corec corrected: terms in lcomp and rcomp form
included.  alg-to-uninst-destr-type-and-tsubst alg-to-destr-const and
destruct-at all take opt-prim-prod-flag as an optional argument.

In psym.scm

clauses-with-idpc-pvars-to-nullary-clauses added.  It is used in
add-ids to check that nullary clauses are present (and might be used
in formula-to-efq-proof to construct such a proof for an idpc).  In
add-ids-aux total program constants for the clause-theorems added.  In
add-ids et-constr-names written with capital C followed by the clause
name (like CInitEv) to avoid clash with program constants for the
clause-theorems.  term-to-totality-formula extended to terms of type
in star form.  add-stotality and its auxiliary function
alg-name-to-stotality-clauses-and-pvars removed.  Instead one should
use add-ids with the proper clauses for e.g. STotalList.  Then one can
provide a known alg name (nat in this case).
term-to-stotality-formula rewritten.  For an sfinalg it uses STotalAlg
rather than TotalAlg, assuming STotalAlg exists (otherwise: error) In
alg-name-to-totality-clauses-and-pvars pvar name totality-idpc-name
replaced by the empty string.  In add-totality double occurrence of
constr-names-list removed.  display-idpc added.  remove-idpc-name
corrected (more was to be removed).  add-co takes an optional argument
opt-prim-prod-flag.  If this is not present or true, the clause is
formed with mk-ex, mk-and (generating extracted terms with the
primitive product make-star).  If this is present and #f, the clause
is formed with mk-exi, mk-andu, mk-andd (generating extracted terms
with the defined product yprod).

In term.scm

nbe-mk-prod-obj added.  rec-op-and-args-to-if-term rewritten.
simplify-simrec-appterm corrected: alg-names-with-val-tvars should
remain in the order given by the recursion operator.

In pp.scm

pretty-print-string uses rename-variables for names of theorems or
global-assumptions.

In formula.scm

make-eq marked as obsolete.  mk-and rewritten.  make-and-without-truth
added.  In formula-substitute the predicate form Total r now uses
term-to-totality-formula for the substituted term r.

In boole.scm

Token and display for desyprod (destructor w.r.t. yprod) added.
term-to-components rewritten.  It now works for the primitive product
(via make-star) as well as for the defined product (via make-yprod).

In axiom.scm

check-aconst adapted to atom-to-eqd-true-aconst and
eqd-true-to-atom-aconst.  Both all-allpartial-aconst and
allpartial-all-aconst written with allnc alpha^(Total alpha^ -> (Pvar
alpha)alpha^) rather than with all alpha^(Total alpha^ -> (Pvar
alpha)alpha^).  This is necessary since the predicate constant Total
is c.r.  In all-formulas-to-uninst-imp-formulas-and-tpsubst only
all-formulas with total variables are allowed.  stotal-imp-formula?
stotal-or-se-imp-formula? stotal-or-se-or-e-imp-formula?
all-partial-stotal-imp-formula? marked as obsolete.
imp-formulas-to-uninst-gfp-formulas-etc corrected in the simultaneous
case: all clauses are needed, and the original ordering of the idpcs
needs to be introduced at various places (corrections due to Kenji
Miyamoto).  In add-theorem totality-flag is used to indicate that no
proof of totality is needed.

In proof.scm

proof-substitute changed to avoid superfluous renaming (work of Anton
Freund).

In pproof.scm

by-assume and by-assume-intern extended to the inductively defined
existential quantifiers exd, exr, exl, exu.  exnc marked as obsolete.
It can be replaced by exr.  Display function for display-num-goal now
has as default case (lambda (fla) (rename-variables (fold-formula
fla))).  STotal as a premise in ind and simind and cases and casedist
with a partial variable removed: one should use elim instead.
dec-stotal-cases-proof removed.  coind-intern corrected in the
simultaneous case.

In ets.scm

atom-to-eqd-true-aconst and eqd-true-to-atom-aconst added.
formula-to-et-type for the predicate constant Total_rho returns rho.
idpredconst-to-et-type corrected: et-types must use all clauses.  In
number-and-idpredconst-to-et-constr-term et-constr-names written with
capital C followed by the clause name (like CInitEv) to avoid clash
with program constants for the clause-theorems.

In examples/test.scm

Major cleanup and extension.

In examples/bar/bar.scm examples/bar/higman01.scm examples/dc/dc-first.scm

Adapted to list.scm (not listrev.scm which should be removed).

In examples/tutorial.scm

Updated, and sychronized with doc/tutor.tex

In doc/tutor.tex

Updated, and sychronized with examples/tutor.scm

In doc/Makefile

For tutor.tex second call to pdflatex and dependencies added.

In doc/ref.tex

Major extension, and adaption to the present state.

In doc/minlog.bib

Extended.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2011-06-18

In pconst.scm

In add-computation-rule add-rewrite-rule types-to-embedding inserted,
to allow the same input as in the displayed computation rule.
Corresponding change in change-t-deg-to-one .  Double occurrence of
add-rewrite-rule removed.  In rec-at definition of rec-args corrected,
using a new constr-name-to-rec-args-indicator (work of Kenji
Miyamoto).  arrow-types-to-uninst-corecop-types-and-tsubst replaced by
alg-or-arrow-types-to-uninst-corecop-types-and-tsubst , and
constructor-type-to-product-type adapted to corecursion with improper
argument types.

In term.scm

make-term-in-app-form adapted to present terminology.
term-in-const-form-to-string adapted to corecursion with improper
argument types.  term-substitute changed to avoid superfluous renaming
(work of Anton Freund).

In psym.scm

In add-co make-= replaced by make-eqd .

In formula.scm

mk-andi-for-sorted-formulas added and used for a better mk-andi .
formula-substitute changed to avoid superfluous renaming (work of
Anton Freund).

In boole.scm

Prefix display des for Destr introduced.

In axiom.scm

In imp-formulas-to-uninst-gfp-formulas-etc make-ord replaced by
make-orl if the premise of an imp-formula is non-computational.  In
h-deg-violations-aux Closure and Gfp added as aconst receiving a
special treatment in proof-to-extracted-term .

In proof.scm

Double occurrence of proof-to-extracted-term-aux removed.

In pproof.scm

In coind-intern imp-form-to-conclusion replaced (twice) by
imp-form-to-final-conclusion .  Order of arguments for Gfp axiom
corrected.

In ets.scm

In formula-with-total-extract? typo corrected.  Double occurrence of
proof-to-extracted-term-aux removed.  In proof-to-extracted-term-aux
case Gfp corrected.

In grammar.scm

arrow-types-to-corec-const replaced by alg-or-arrow-types-to-corec-const

In examples/analysis/simpreal.scm

In is-comparison and simp-comparison EqD with synt-total arguments
admitted.

In test.scm

Adapted to corecursion with improper argument types.  Inversion for
coinductively defined predicates considered.

In ref.tex

arrow-types-to-corec-const replaced by
alg-or-arrow-types-to-corec-const

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2011-05-19 2011-05-24

In doc/ref.tex

Section on predicates extended (coinductive definitions).
Sections on terms, formulas, aconsts updated and extended.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2011-05-18

In doc/ref.tex

Section on program constants extended (general recursion, corecursion).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2011-05-17

In examples/test.scm

Extended and updated

In examples/dijstra/count.scm examples/dijstra/dijkstra.scm
examples/dijstra/pick.scm

Adapted to the new lib/natinf.scm (with ysumu).  Dot notation removed.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2011-05-16

In examples/parsing/parens.scm

Cleaned up.

In examples/analysis/coind.scm

Now obsolete; its main contents have been moved in the trunk

In examples/analysis/ratsds.scm

Adapted to add-co.

In lib/natinf.scm

Adapted to the algebra ysumu.

In doc/tutor.tex

Typo in exercise 4.5(3) corrected.

In examples/test.scm

yplus replaced by ysum, and ytensor replaced by ypair, and then ypair
replaced by yprod.

In init.scm

multiline-comment added.

In typ.scm

ypair replaced by yprod.  Addition of uysum and ysumu is not reported.
remove-tvar-name gives a warning instead of an error if no tvar with
the give name exists.  remove-alg-name gives a warning instead of an
error if no algebra with the give name exists.

In var.scm

remove-var-name uses multiline-comment rather than comment when a
non-existing variable is removed.

In pconst.scm

remove-program-constant uses multiline-comment rather than myerror
when a non-existing program-constant is removed.  fixed-rules-name?
extended by CoRec and Destr.
arrow-types-to-uninst-recop-types-and-tsubst rewritten.
constructor-type-to-step-type simplified.  arrow-types-to-rec-const
introduced to replace the obsolete arrow-type-to-rec-const and
type-info-to-rec-const .  arrow-type-to-uninst-casesop-type-and-tsubst
corrected.  arrow-types-to-uninst-corecop-types-and-tsubst
constructor-type-to-product-type arrow-types-to-corec-consts
arrow-types-to-corec-const corec-at
corec-const-to-uninst-corecop-types corec-const-to-corec-consts
corec-const-to-uninst-arrow-types corec-const-and-bound-to-bcorec-term
corec-test-and-abstr-constr-terms-to-if-term
bcorec-term-and-alg-name-to-component
bcorec-term-and-alg-name-to-component-aux and undelay-delayed-corec
added.  The latter replaces every corec constant term by the result of
(corec-const-and-bound-to-bcorec-term corec-const bound).  Destructors
added, via alg-to-uninst-destr-type-and-tsubst alg-to-destr-const
destruct-at .

In term.scm

term-in-const-form-to-string adapted to CoRec and Destr.
term-in-rec-normal-form? corrected.

In psym.scm

ypair replaced by yprod.  remove-pvar-name and remove-predconst-name
use multiline-comment rather than comment when a non-existing
predicate variable or constant is removed.  In add-ids it is enforced
that every newly created algebra has as its name the string alg
followed by the idpredconst-name.  This is to allow removal of this
algebra when removing the idpredconst-name.  In remove-idpc-name only
those alg-name are removed which were newly created with the idpc-name
(like algEven for Even).  COIDS and INITIAL-COIDS added.  add-co adds
companions for inductively defined predicate constants to COIDS, for
instance CoEv, CoOd for Ev, Od.  The optional algebra names and pvars
are the same as for the corresponding idpcs.

In formula.scm

make-= now returns an atom if the term arguments are of finitary
algebra type, and Leibniz equality otherwise.  mk-andd mk-andr mk-andu
mk-andi make-andr-without-truth mk-ord mk-orl mk-orr mk-oru mk-ori
added.  formula-with-total-extract? added.

In boole.scm

make-term-in-cons-form mk-term-in-cons-form term-in-cons-form?
term-in-cons-form-to-left term-in-cons-form-to-right
make-term-in-car-form make-term-in-cdr-form term-to-components added.
Typo corrected (Inl -> InL).  ypair renamed into yprod.  lft and rht
made prefix-op rather than postfix-op.  make-yprod
yprod-form-to-left-type yprod-form-to-right-type yprod-form?  mk-yprod
yprod-form? added.  make-ysum ysum-form-to-left-type
ysum-form-to-right-type ysum-form?  mk-ysum ysum-form?
mk-ysum-without-unit and its inverse ysum-without-unit-to-components
added.  Algebra uysum added as prefix-typeop, with constructors DummyL
and InrUysum (prefix display string Inr).  Similarly algebra ysumu
added as postfix-typeop, with constructors InlYsumu (prefix display
string Inl) and DummyR.

In axiom.scm

In aconst-to-inst-formula Gfp is treated as Elim: it can have free
variables in its uninstantiated formula.
imp-formulas-to-uninst-gfp-formulas-etc
imp-formulas-to-uninst-gfp-formula-etc imp-formulas-to-gfp-aconst
added.  In check-aconst Closure and Gfp added.  In
aconst-without-rules? Exnc-Intro and Exnc-Elim added.
coidpredconst-to-closure-aconst added.  remove-theorem gives a warning
instead of an error if no theorem with the give name exists.  In
add-theorem the generated program constant now has the same degree of
totality as the extracted term of the proof.

In proof.scm

proof-substitute adapted to Gfp aconsts.

In pproof.scm

coind added.  Dot notation in comment removed.

In grammar.scm

Everything connected to and, or made rightassociative.  Reason: ypair,
ysum were (and will be) rightassociative, but and, or not.  Exchanged
arguments in grammar clauses for orformula, tail-orformula,
andformula, tail-andformula, orterm, andterm.  CoRec and Destr added.

In pp.scm

token-tree-tag-left-assoc? and token-tree-tag-right-assoc? adapted:
and-op and or-op are now rightassociative.  In token-tree-to-string
and token-tree-to-pp-tree in case alg-typeop an unnecessary space
before a parenthesis is removed.

In ets.scm

ypair replaced by yprod.  proof-to-extracted-term-aux adapted to
Closure and Gfp axioms.  idpredconst-to-et-type need not be changed.
Idpreconst OrR now with algebra uysum instead of algOrR, and similarly
OrL with ysumu instead of algOrL.  formula-with-total-extract? added.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2011-04-13

In examples/quant/orevkov.scm

Completely rewritten.  Proofs in minimal logic for the Orevkov
formulas A_i with an (unfolded) weak existential quantifier are
constructed.  These can be seen as proofs of bot from a (false)
assumption u_i.  Then A-translation can be applied to obtain a
constructive existence proof, from which a witness can be extracted.
One obtains logical proofs of existential formulas E_i (example for
i=2: ex z578,z1,z0(R zero zero z578 & R zero z578 z1 & R zero z1 z0)
from the two open assumptions hyp1: all y R y zero(S y) and hyp2:
all y,x,z,z1(R y x z -> R z x z1 -> R y(S x)z1) whose length is
linear in i, but whose witnesses are suberexponential in i.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2011-03-27

In typ.scm

In alg-name-to-tvars terminology corrected.

In pconst.scm

rec-at in case (and (nbe-constr-value? rec-val) (not nbe-for-idps?))
simplified: pd-objs selected first.

In psym.scm

add-ids and add-ids-aux extended to also cover the case of a string
identity in the field where an opt-alg-name is expected.  This is
allowed iff there is exactly one clause with et-type of the form
et-tvar=>idpc-pvar-tvar.  Then no new algebra is created.  Later
[x]x will be taken as realizer for the (single) clause, and [x,f]f x
as realizer for the elim axiom.  AndL removed from
idpredconst-to-string .

remove-idpc-name adapted: opt-alg-names ypair ysum boole identity
are not removed.

In formula.scm

exi, exnci, ori and andi provided for input of inductively defined
connectives.  Depending on whether the formulas involved are of
nulltype or not, internally one uses
for exi: ExD, ExDT, ExL, ExLT,
for exnci: ExR, ExRT, ExU, ExUT,
for ori: OrD, OrL, OrR, OrU.
for andi: AndD, AndR (if necessary with reversed formulas), AndU.

Added accordingly: make-andi, make-ori, make-exi, mk-exi,
make-exnci, mk-exnci.

all-allnc-form-to-prefix added.  It computes the list of the first
(car x) lists ('all/allnc var) of a formula.

Decoration is split into an ordinary one restricted to imp and all,
and a full one.  In the latter the inductively defined connectives
ExU, ExL, ExR, ExD, ExUT, ExLT, ExRT, ExDT, OrU, OrL, OrR, OrD,
AndU, AndR, AndD are considered as (fully) decorated.  A flag
id-deco? indicates what is meant.  Corresponding changes in
formula.scm:

formula-to-undec-formula prepares for decoration.  It changes all
occurrences of imp, all into impnc, allnc, and in case id-deco?  is
true, (i) every existential quantification exd, exl, exr into exu,
(ii) every total existential quantification exdt, exlt, exrt into
exut, (iii) every conjunction andd, andr into andu (andb is for the
boolean operator), and (iv) every disjunction or, orl, orr into oru
(orb is for the boolean operator).  It does not touch formulas of
nulltype under extension, and in case id-deco? is false it does not
touch any formula of nulltype.

cterm-to-undec-cterm ,
aconst-and-dec-inst-formula-to-extended-tpsubst
idpredconst-to-undec-idpredconst dec-variants-to-lub
extending-dec-variants? dec-variants? aconst-to-undec-aconst changed
accordingly.  They all take id-deco? as an additional argument .

In bicons-to-lub-bicon cases for imp and impnc removed.  In
quants-to-lub-quant cases for all and allnc removed.

formula=-aux? changed.  A -> B and A --> B are considered equal if A
is of nulltype.

In proof.scm

proof-to-free-cr-avars added.  It returns all free avars with are
not above a n.c. formula in the proof.  It needs id-deco? as an
extra argument, and depending on its value uses formula-of-nulltype?
or formula-of-nulltype-under-extension?

decorate corrected.  Nothing is done if decfla is of nulltype, and
all free avars are available initially.  They will be reduced in
case allnc-intro is applied.  fully-decorate added.

proof-to-ppat rewritten It turns every imp, all formula in the given
proof into an impnc, allnc formula, and in case id-deco? is true
moreover (i) every existential quantification exd, exl, exr into
exu, (ii) every total existential quantification exdt, exlt, exrt
into exut, (iii) every conjunction andd, andr into andu (andb is for
the boolean operator), and (iv) every disjunction or, orl, orr into
oru (orb is for the boolean operator).  This includes the parts of
an aconst which come from its uninstatiated formula.  proof-to-ppat
does not touch the c.i. parts of the proof, i.e., those which are
above a c.i. formula.  ppat is in general not a proof.

ppat-and-decseq-and-availavars-to-proof-and-decavars corrected and
its efficiency improved.  We avoid the do loop in
ppat-and-decseq-and-availavars-to-proof-and-decavars and use a named
let instead.  Both proof-to-ppat and
ppat-and-decseq-and-availavars-to-proof-and-decavars take id-deco?
as an additional argument.

op-and-args-and-altop-and-decfla-and-availavars-to-proof rewritten
It assumes that op applied to args proves an extension of decfla,
and that altop differs from op only in possibly requiring additional
premises.  In case id-deco? this is w.r.t. full extension, otherwise
w.r.t. imp-all extension.  It is tested whether altop applied to
args and some of availavars is between op applied to args and decfla
w.r.t. the respective extension.  If so, a proof based on altop is
returned, else #f.

ppat? as test function for proof patterns added.

In aconst-and-decfla-to-proof a proof is returned (not an aconst)
because of possible all's instead of allnc's binding free variables
of the instantiated formula.  Hence all-allnc-form-to-prefix and
aconst-and-prefix-to-proof-of-modified-aconst suffice.

cr-strengthened-dec-variants-to-proof added.

check-and-display-proof corrected: initial tests for arguments were
insufficient.  check-and-display-proof-aux corrected: in case
proof-in-imp-elim-form, an impnc-form with n.c premise is allowed.

In ets.scm

exi, exnci, ori and andi provided for input of inductively defined
connectives.  Depending on whether the formulas involved are of
nulltype or not, internally one uses
for exi: ExD, ExDT, ExL, ExLT,
for exnci: ExR, ExRT, ExU, ExUT,
for ori: OrD, OrL, OrR, OrU.
for andi: AndD, AndR (if necessary with reversed formulas), AndU.

Idpc-names ExL ExR ExLT ExRT AndR removed and added again,
now with the string identity where we had an alg-name before.

Idpc-name OrU removed and added again, now with the algebra boole
as known-alg-name.

idpredconst-to-et-type and formula-of-nulltype? adapted to identity
as a possible opt-alg-name.  formula-to-et-type and
idpredconst-to-et-type are defined simultaneously.  This makes
sense, since the clauses and also the cterms of an idpredconst are
prior to the idpredconst.

formula-of-nulltype? and formula-of-nulltype-under-extension?
rewritten.

proof-to-extracted-term-aux adapted to identity as a possible
opt-alg-name.  Then a new identity-idpredconst-to-intro-et-term is
used instead of number-and-idpredconst-to-et-constr-term .  [x,f]f x
is used as realizer for the elim axiom.

In boole.scm

Tokens andi, ori, exi, exnci added.

In doc/ref.tex

Examples for decorate added.

In examples/test.scm

Examples for decorate rewritten.

In examples/analysis/real.scm

add-global-assumption for NatNotLtToLe removed.  It is in nat.scm

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2011-01-12

In lib/nat.scm

NatNotLeToLt and NatNotLtToLe added.

In examples/test.scm

Major extension.

In typ.scm

RESERVED-NAMES extended.  In add-algebras-with-parameters del-constr
renamed into delayed-constr.

In var.scm

var-to-string corrected: a type variable whose name ends with an
ordinary character (e.g., alpha) needs a modifier _ before its index
(e.g., alpha_1 and not alpha1).  Reason: alpha1 is read as a variable
of type alpha1 with index -1.

In pconst.scm

General recursion mentioned in the introduction.  Typos corrected.
Description of the format of type-info-or-repro-formulas extended
to grecguard-const and grec-const.

arrow-types-to-uninst-paramless-recop-types-and-tsubst renamed into
arrow-types-to-uninst-recop-types-and-tsubst

arrow-type-to-uninst-paramless-casesop-type-and-tsubst renamed into
arrow-type-to-uninst-casesop-type-and-tsubst

param-types-and-arrow-type-to-cases-const removed.
arrow-type-to-cases-const defined directly.

Description of constants made more complete and clearer.
type-info-or-repro-formulas renamed into repro-data.  check-const
added.  It assumes that the constant is not one of those used during
proof normalization.

type-info-etc-to-grecguard-const corrected: the constant needs a
type-info as repro-data.

As for recursion constants, the type of a grecguard constant is
split into an uninst-grecguardop-type and a type substitution.

grecguard-const-for-gind? removed, since this holds if and only if
repro-data is a pair.

type-info-to-grecguard-type renamed into
type-info-to-uninst-grecguardop-type-and-tsubst .

exnc-formula-to-exnc-intro-const
exnc-formula-and-concl-to-exnc-elim-const
exnc-formula-and-concl-to-exnc-elim-const-aux
exnc-formula-and-concl-to-exnc-elim-const-obj added (were forgotten).

const-substitute extended to also cover GRecGuard.

UNFOLDING-FLAG renamed into REC-UNFOLDING-FLAG

Removed rec-const-to-param-types and cases-const-to-param-types and
grecguard-const-to-param-types .  They are nowhere really needed.

In term.scm

In term-in-const-form-to-string cases-const-to-param-types removed.

In term-to-expr grecguard-const-to-param-types removed.  posrecparam
and natrecparam removed.

In term-to-expr and rec-op-and-args-to-if-term and
term-to-eta-nf-with-simplified-simrec-appterms and
term-to-term-with-eta-expanded-if-terms-and-unfolded-simrecs
rec-const-to-param-types removed.

term-in-const-form-to-string rewritten.
type-info-to-rec-string removed.
type-info-or-repro-formulas replaced by repro-data.

In formula.scm

aconst-to-repro-formulas renamed into aconst-to-repro-data .
cterm-to-arity corrected.

In axiom.scm

all-pair-formula-to-pair-elim-aconst and formula-to-efq-aconst and
ex-formula-to-ex-intro-aconst and
ex-formula-and-concl-to-ex-elim-aconst and
exnc-formula-to-exnc-intro-aconst and
exnc-formula-and-concl-to-exnc-elim-aconst corrected: psubst now
constructed with make-subst-wrt pvar-cterm-equal?

aconst-to-repro-formulas renamed into aconst-to-repro-data .
aconst-to-computed-repro-formulas renamed into
aconst-to-computed-repro-data .  all-formula-to-gind-aconst renamed
into all-formula-and-number-to-gind-aconst .

In proof.scm

In proof-and-genavar-var-alist-to-pterm cases for Exnc-Intro and
Exnc-Elim added (were forgotten).

type-info-or-repro-formulas replaced by repro-data.

aconst-to-repro-formulas renamed into aconst-to-repro-data .

all-formula-to-gind-aconst renamed into
all-formula-and-number-to-gind-aconst .

In pproof.scm

all-formula-to-gind-aconst renamed into
all-formula-and-number-to-gind-aconst .  UNFOLDING-FLAG renamed into
REC-UNFOLDING-FLAG

In ets.scm

In all-formulas-to-et-rec-const and imp-formulas-to-et-rec-const
arrow-types removed from the constructed rec-const (they can be
computed).

all-formula-to-gind-aconst renamed into
all-formula-and-number-to-gind-aconst .

To do: adapt gind-aconst-to-mr-gind-proof-aux

In etsd.scm

aconst-to-repro-formulas renamed into aconst-to-repro-data .

In doc/tcf.tex

Definition of rigid variables added.  Definition of the Huet
unification algorithm clarified in case flex-rigid.  Citation
according to natbib.  Index added.

In doc/ref.tex

Major extension of the sections ob types and constants.
Section on parsing extended (with a large selection of variable names).
Definition of rigid variables added.  Definition of the Huet
unification algorithm clarified in case flex-rigid.  simphyp-with-to
added.  Typos corrected.  Plan: extend and adapt normalization issues
in term.scm.  Among others: change nbe-normalize-term into
nbe-normalize-term-without-eta

term-to-eta-nf
term-to-term-with-eta-expanded-if-terms
term-to-outer-eta-expansion
if-term-to-eta-expansion-and-unfolded-simrecs
nbe-normalize-term

term-to-term-without-predecided-ifs
term-to-one-step-beta-reduct
term-to-beta-nf
term-to-beta-eta-nf
term-to-beta-pi-eta-nf
term-to-let-candidates
term-to-term-with-let

In doc/minlog.bib

Item for the Martelli-Montanari paper added.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-12-23

In ets.scm

Replaced algOrD by ysum.  Similarly replaced algExD, algExDT, algAndD
by ypair.

In examples/test.scm

Adapted to replacement of algOrD by ysum, and of algExD, algExDT,
algAndD by ypair.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-12-22

In pconst.scm

add-prefix-display-string and add-postfix-display-string corrected:
both expected in their add-token parts that valtype is of alg-form,
which need not be the case.  Now type-match is used.

In psym.scm

Superfluous log text removed.  idpredconst-name-to-params added.
Adaption of add-ids and add-ids-aux to inductively defined predicates
with object parameters.  This is necessary when defining natural
numbers in an abstractly (by a type variable) given type of reals,
with abstractly (by object variables) given zero and successor
functions:

(add-ids
 (list
  (list "N" (make-arity (py "real") (py "real=>real") (py "real")) "nat"))
 '("N z^ s^ z^" "InitN")
 '("allnc x^(N z^ s^ x^ -> N z^ s^(s^ x^))" "GenN"))

Here the parameters z^,s^ are free in the clauses.

In axiom.scm

imp-formulas-to-uninst-elim-formulas-etc
intro-aconst-to-computed-repro-data idpc-clause? check-aconst and
number-and-idpredconst-to-intro-aconst adapted to the presence of
parameter variables.

In proof.scm

context-to-tvars added.  aconst-substitute corrected: psubst was not
defined.  fla-and-sig-tvars-and-vars-and-goal-fla-to-use-data
corrected: ord-form? orl-form? orr-form? oru-form? were forgotten.

In pproof.scm

use-intern corrected: sig-tvars were not treated properly.
fla-and-sig-tvars-and-vars-and-goal-fla-to-use-data corrected:
ord-form? orl-form? orr-form? oru-form? were forgotten.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-12-10

In pproof.scm
 
simphyp-with-to added.  It expects a string as its last argument, which
is used (via name-hyp) to name the newly introduced simplified
hypothesis.  Typo corrected: imp--impnc-form-to-premise replaced by
imp-impnc-form-to-premise

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-12-07

In examples/test.scm

Tests for huet-match with products and projections added.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-12-07

In term.scm

huet-unifiers-xi, huet-unifiers-rigid-rigid, huet-unifiers-match and
huet-imitate-term corrected in case of terms in pair, lcomp or rcomp
form.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-10-05

In examples/classical/combinatorics/booleantape.scm

Cleaned variant with emphasis on symmetry.  Based on work of Diana
Ratiu and Trifon Trifonov.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-09-01

In doc/Makefile

tcf included,

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-08-31

In doc/minlog.bib

Extended.

In doc/mlcf.tex

References updated.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-08-14

In pconst.scm

In add-rewrite-rule a preceding proof of lhs eqd rhs is accepted.
For readability of program constants add-prefix-display-string
add-postfix-display-string add-infix-display-string added.

In lib/list.scm

Equal replaced by Leibniz equality.  Adapted to usage of
add-prefix-display-string add-postfix-display-string
add-infix-display-string .

In lib/listrev.scm

Equal replaced by Leibniz equality.  Adapted to usage of
add-prefix-display-string add-postfix-display-string
add-infix-display-string .  :+: (for append) replaced by ++.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-08-09

In pproof.scm

In use2-closed-proof-intern pvars from sig-topvars removed from
uninst-pvars (this makes Efq-Log and Stab-Log behave as expected)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-08-09

In doc/minlog.bib

Updated

In doc/ref.tex

Moved to doc/tcf.tex: (1) material on admissible substitutions, (2)
proofs for unification and proof search (3) (further) case studies.

Initial commit of tcf.scm.

Purpose: provide an introduction into the theory formalized by the
Minlog system.  It consists of chapters 1, 5 and 6 of
{SchwichtenbergWainer10}.  There are also appendices covering
additional topics of interest for an implementation: (1) material on
admissible substitutions, (2) proofs for unification and proof search,
and (3) (further) case studies.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-07-29

In typ.scm

A general compose-substitutions replaces compose-t-substitutions .
admissible-substitution? added.

In pconst.scm

Adapted to more general substitutions.  term-substitute-aux replaced
by term-substitute.  pinst replaced by psubst.

In psym.scm

idpredconst-to-tpsubst replaces idpredconst-to-pinst.  Comment to
format of IDS updated.  Part of add-ids moved into a new function
add-ids-aux, which does not parse clause-strings any more.  This is
useful when after adding idpredconst one adds mr-idpredconst: it can
now be done by a further call of add-ids-aux, via add-mr-ids.
new-pvar renamed into idpc-pvar, new-tvar renamed into idpc-tvar.
add-totality and add-stotality added

In add-ids non-computational idpcs are allowed.  Then (except in
special cases) the elimination scheme must be restricted to
n.c. formulas.  Also, all (n.c.) clauses must be invariant.  This
ensures that the soundness theorem holds: every intro and elim axiom
is invariant, i.e., nullterm mr A is the same as A.  In add-ids-aux
the (non-used) argument all-with-content? is removed.


In term.scm

term-to-beta-eta-nf added.  In simultaneous substitution for type and
object variables in a term it is allowed that the substitution affects
variables whose type is changed by the substitution.  Then the
substitution must be admissible for the free variables in the term.
compose-o-substitutions and compose-substitutions removed: they are
superseded by the new compose-substitutions.  match2 replaced by
huet-match, which is defined as a special case of huet-unifiers: no
flexible variables in the instance.  huet-match picks a most
detailed substitution.  match2-for-tsubst renamed into
pattern-and-instance-to-tsubst .  substitution-to-string removed.

In formula.scm

rename-variables corrected and extended to terms and cterms.  In a
simultaneous substitution topsubst for type, object and predicate
variables in a formula or a comprehension term it is allowed that the
substitution affects vars whose type is changed by topsubst, provided
topsubst is admissible for the formula or the comprehension term.
tpinst replaced by tpsubst.  formula-substitute-aux and
cterm-substitute-aux removed.  formula-to-undec-formula changes all
occurrences of imp, all before a c.r. formula into impnc, allnc.
formula-to-beta-nf extended to idpredconsts.  cterm-to-beta-nf
formula-to-eta-nf cterm-to-eta-nf added.  Case distinctions are now
atom-form? predicate-form? bicon-form? quant-form?  This makes sure
that idpredconsts are properly treated.  p-substitution-to-string
removed.

In boole.scm

ypair introduced as polymorphic type.  It is called a record since it
is an algebra with one constructor only.  One could treat triples,
quadruples etc similarly.  Renamed tensor into pair: the previous
ypair (using unit) is obsolete.

In axiom.scm

Adapted to more general substitutions.  psubst? and pinst? replaced
by tpsubst?  tpinst replaced by tpsubst.
rec-premise-of-cr-idpc-clause? corrected: premises or recursive
premises must be free of param-pvars.  Example: in the clause for
Acc allnc x^(all y^(R y^ x^ -> Acc y^) -> Acc x^) the relation R
cannot be a predicate variable.

cr-idpc-clause? replaced by idpc-clause.  ci-idpc-clause? removed.
imp-form-to-param-premises-imp-rec-prems-imp-final-concl renamed into
imp-form-to-param-premises-and-rec-prems-imp-final-concl .
uniform-non-recursive-clause? rewritten and renamed into
uniform-non-rec-idpc-clause?  non-computational-invariant? rewritten
with new argument param-pvars.  In non-computational-invariant
formulas the following idpcs are admitted.  (1) mr-nc-idpcs.  (2)
uniform-one-clause-nc-idpcs with non-computational-invariant
parameters.  (3) restricted-elim-nc-idpcs.

In proof.scm

Adapted to more general substitution.  make-arename removed.
aconst-substitute-aux and proof-substitute-aux removed.
undec-proof-and-decavars-and-decfla-to-decproof-and-ext-decavars
corrected: in the definition of min-aconst instead of
aconst-to-formula one needs aconst-to-uninst-formula.  proof-to-tvars
and proof-to-pvars added.
undec-proof-and-decavars-and-decfla-to-decproof-and-ext-decavars
renamed into ppat-and-decseq-and-availavars-to-proof-and-decavars, and
generally undec-proof into ppat.
ppat-and-decseq-and-availavars-to-proof-and-decavars and decorate have
an optional argument name-and-altname.  If it is present, then in
every recursive call it is checked whether (1) the present proof is an
application of the aconst op with name to some args, (2) op applied to
args proves an extension of decfla, and (3) altop applied to args and
some of decavars is between op applied to args and decfla
w.r.t. extension.  If so, a proof based on altop is returned, else one
carries on.  proof-to-expr proof-to-expr-with-formulas
proof-to-expr-with-aconsts take (current-proof) as default argument.
proof-to-undec-proof replaced by proof-to-ppat.  proof-to-ppat does
not touch the c.i. parts of the proof, i.e., those which are above a
c.i. formula.  check-and-display-proof-aux now ignores decorations
when appropriate: in the argument of an impnc-elim, and whenever we
are above a c.i. formula.  make-proof-in-andd-elim-left-form
make-proof-in-andd-elim-right-form added.  In
ppat-and-decseq-and-availavars-to-proof-and-decavars
formula-of-nulltype? replaced by formula-of-nulltype-under-extension?

In pproof.scm

In use-intern in case clash-of-tvars? the renaming-tsubst was not
necessarily admissible for proof, in case proof contains free pvars,
vars or avars affected by renaming-tsubst.  Cure: produce from
renaming-tsubst an admissible substitution in proof, at least if x is
a theorem or global assumption.
fla-and-sig-topvars-and-goal-fla-to-use2-data now uses huet-match
rather than match2.  pinst replaced by psubst.  use2-intern and
x-and-x-list-to-proof-and-new-num-goals-and-maxgoal adapted to the
more general substitutions, and check for admissible substitution
built in.  simp-with-intern corrected in the Equal case.
fla-and-sig-tvars-and-vars-and-goal-fla-to-fst-match-data extended to
eqd.  In msplit typo corrected.

In ets.scm

new-pvar renamed into idpc-pvar, new-tvar renamed into idpc-tvar.
pinst replaced by psubst.  formula-of-nulltype-under-extension? added.

In atr.scm

Comment on proofs of D^F -> D etc updated.

In etsd.scm

pinst replaced by psubst.  cons#f replaced by cons-true.

In doc/ref.tex

Major update.  The role of optional arguments in normalize-goal
described.  Description of use, use-with, cut, split, ind, simind,
elim, cases, casedist updated.  Description of assert, msplit, gind,
intro-with, inversion, by-assume-minimal-with added.
make-gind-aconst, make-min-pr-aconst, make-exc-intro-aconst,
exc-formula-to-exc-intro-aconst described.

In examples/test.scm

Updated and extended.

In examples/tutorial.scm

Removed var-name y before loading lib/list.scm.  Added it later
again.  Switched COMMENT-FLAG off and on to speed up loading

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2010-01-14

In grammar.scm

Line (lpar grecguard-op number typelist rpar) : ($2 (cons $3 $4)) added.

In pconst.scm

grecguard-const-for-gind? corrected.  It gave wrong results in case
the value type tau had one argument type.

In axiom.scm

In avar-full=? the test formula=? replaced by classical-formula=?.
Reason: classical-formula=? also tests for equal normal forms.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2009-12-10

In lib/nat.scm

"NatLeLtCases" added:
"all nat1,nat2((nat1<=nat2 -> Pvar) -> (nat2<nat1 -> Pvar) -> Pvar)"

In pp.scm

token-tree-tag-left-assoc? and token-tree-tag-right-assoc? changed:
tensor-op should be right associative

In psym.scm

predconst? corrected (order tsubst - index was wrong)

In axiom.scm

In avar-to-string (+ 1 index) replaced by index.  This allows avars u0
in displays.

In proof.scm

rename-bound-avars replaces all bound avars by new ones with the
same name but a new index.  Properties: (i) rename-bound-avars
transforms a proof satisfying the avar convention w.r.t. its free
avars into a proof satisfying the avar convention completely.  (ii)
In every subproof of the result no free avar occurs (w.r.t. avar=?)
bound as well.  Property (ii) is assumed in proof-substitute-aux.

check-and-display-proof extended by checking the avar convention:
two avars with the same name and index are equal.  This done via
avar-convention-violations .

In proof-substitute-aux we must assume that in every subproof no
free avar occurs bound as well.  This is ensured by a preprocessing
step, using rename-bound-avars.  Example for the need:

(add-var-name "x" (py "alpha"))
(add-pvar-name "Q" (make-arity (py "alpha")))
(define avar (make-avar (pf "Q x") -1 "u"))

(define proof
  (mk-proof-in-elim-form
   (mk-proof-in-intro-form
    (pv "x") avar (make-proof-in-avar-form avar))
   (pt "x") (make-proof-in-avar-form avar)))

(proof-to-expr proof)
; (((lambda (x) (lambda (u) u)) x) u)

(define avar1 (make-avar (pf "Q x") 1 "u"))
(define proof1 (proof-subst proof avar (make-proof-in-avar-form avar1)))

(cdp proof1)
; ....Q x77 by assumption u66
; ...Q x77 -> Q x77 by imp intro u66
; ..all x77(Q x77 -> Q x77) by all intro
; ..x
; .Q x -> Q x by all elim
; .Q x77 by assumption u66

; equal formulas expected
; Q x
; Q x77

In src/list.scm

(duplicates-wrt equality? l) returns a list of two-element sublists
(x x') of equal elements of l whose transitive closure consists of all
such two-element sublists.

In ets.scm

proof-to-extracted-term-aux corrected: atr-x-formula removed

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2009-11-13

In psym.scm

In add-ids clause-test changed: non-computational idpcs are allowed.
Then (except in special cases) the elimination scheme must be
(severely) restricted to n.c. formulas.  Moreover, all clauses must
have non-computational invariant (n.c.i.) parameter and premise
formulas.  This ensures that the soundness theorem continues to hold:
every intro and elim axiom is invariant, i.e., nullterm mr A is the
same as A.

In formula.scm

var-and-vars-to-new-var corrected: in the loop generating new-index
(is relevant-indices (cdr is)) replaced by 
(is relevant-indices (remove i is)).

In proof.scm

proof-substitute-aux corrected in aconst case.  aconst-substitute-aux
corrected: uninst-formula0 is kept.

(decorate proof) corrected: it is first checked whether the proven
formula is c.i.  If so, the given proof is returned.  Otherwise
undec-proof-and-decavars-and-decfla-to-decproof is called.
undec-proof-and-decavars-and-decfla-to-decproof-and-ext-decavars
corrected: test (formula-of-nulltype? (proof-to-formula proof))
removed.

In examples/test.scm

Nullary clauses named Init... rather than Gen... (for instance
"InitEqD" instead of "GenEdQ").  Dialectica extraction for proofs of
formulas with allnc removed, since this is not yet properly covered by
the implementation.

In boole.scm

Discarded code removed.

In pconst.scm

Typos in comments corrected.

In axiom.scm

clause? replaced by cr-idpc-clause? and nc-idpc-clause?
(strictly-positive? formula pvars) changed: the parameter pvars need
not occur.

In etsd.scm

Typos corrected: term-subst -> term-subst-et, term-substitute ->
term-substitute-et.

In term.scm

In normalize-term-pi-with-rec-to-if-aux error corrected: abstract only
as many vars as the corresponding constructor has arguments.  Typo
corrected in term-in-elim-form-to-final-op-and-args .  In
formula-of-nulltypen? typo corrected: pvar-with-positive-content?
replaced by pvar-with-negative-content?

In pproof.scm

simphyp-with simphyp-with-to and simphyp added (were lost).  Dot
notation removed.

In ets.scm

real-and-formula-to-mr-formula-aux corrected in impnc case and
extended in the predicate case.  However, the mr-formulas are still
not written with allnc, impnc as they officially should (but it does
not matter).  mr-invariant?  removed. In proof-to-soundness-proof-aux
mr-invariant? replaced by non-computational-invariant?  In an error
message of animate unnecessary type-to-string removed.

In examples/arith/sqrttwo.scm

Minor cleanup.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done locally 2009-06-30, in the trunk 2009-09-18

In lib/list.scm

Error concerning variable names removed.

In pconst.scm

In add-program-constant message suppressed for cIf.

In term.scm

In normalize-term-pi-with-rec-to-if recursive call added in case of an
unchanged recursion operator with sufficiently many arguments (was
forgotten).

In match match2 match2-for-tsubst optional argument ignore-deco-flag
introduced.  In match-aux match2-aux match2-for-tsubst-aux
additional argument ignore-deco-flag introduced.  In match2-aux typo
corrected: sig-tvars sig-vars replaced by sig-vars sig-pvars

formula-of-nulltypep? formula-of-nulltypen? adapted to possibly
decorated formulas with inductively defined connectives.

DIALECTICA-FLAG is set to #f

In psym.scm

idpredconst-to-string drops the trailing t in exdt, exlt, exrt,
exut.  The information about totality is in the following variable.

add-ids changed: inductively defined predicate constants without
content must be defined by only one (non-recursive) uniform clause.
Examples: EqD, ExU, AndU.  Soundness of the intro and elim axioms
holds if the parameter-cterms in ExU, AndU are invariant.  Then AC, IP
and IQ are not needed.  Construction of et-constr-types simplified,
using the assumption that the clauses are either all with or all
without content.  DummynbeIDPC removed as a constructor in nbeIDPC: it
is not needed because nullary clauses are required.  Assignment of
tokens for idpc-names made more general.  Double definition of
string-and-arity-and-cterms-to-idpc-parse-function removed.

In formula.scm

imp-impnc-all-allnc-form-to-vars-and-premises formula-to-bound added.

exdt, exlt, exrt, exut replaced by exd, exl, exr, exu in displayed
formulas.  The information about totality is in the following
variable.  formula-to-undec-formula extended to exu, exut, andu, oru
and generally to predicate forms with inductively defined predicate
constants.  cterm-to-undec-cterm , idpredconst-to-undec-idpredconst
added.

dec-variants-to-lub and the binary dec-variants-to-lub-aux extended
to the new decorated connectives (ord orl orr oru andd andl andr
andu exd exl exr exu exdt exlt exrt exut) and generally to predicate
forms with inductively defined predicate.  extending-dec-variants?
added.  strengthened-dec-variants? added.

dec-variants? with its auxiliary function dec-variants-aux? and
dec-variants-up-to-pvars? with dec-variants-up-to-pvars-aux? added.
full-dec-variants? removed.

In formula-to-token-tree typo corrected (exu-form?  changed into
exut-form?).

formula=? classical-formula=? cterm=? all now have an optional
argument ignore-deco-flag  (formula=? formula1 formula2 #f) means
(formula=? formula1 formula2) but (formula=? formula1 formula2 #t)
means that decorations are ignored.  formula=-aux? has an extra
argument ignore-deco-flag.

pp-subst added, as an alternative to display-substitutions

Connective andl removed.  Reason: AndL is not accepted, since it is
required (without loss of generality) that impnc-param-prems come
before imp-param-prems.  Use B andr A instead of A andl B.

In boole.scm

Tokens exdt exlt exrt exut removed.  The information about
totality is in the following variable.

In axiom.scm

aconst-to-computed-repro-formulas corrected.  Exnc-Intro and
Exnc-Elim were missing.  Typo corrected: cetrms -> cterms.
avar-full=? now has an optinal argument ignore-deco-flag
intro-aconst-to-computed-repro-data corrected: there must be as many
cterms in idpc as there are param-pvars, but tpinst (in aconst)
might be shortened.  elim-aconst-to-computed-repro-formulas
corrected.  uniform-non-recursive-clause? added.  In check-aconst
typo in error message corrected.  In add-theorem message suppressed
for If.

In proof.scm

proof-in-imp-impnc-all-allnc-intro-form?
proof-in-imp-impnc-all-allnc-intro-form-to-var
proof-in-imp-impnc-all-allnc-intro-form-to-kernel added.

proof-in-intro-from-to-vars computes all (or at most (car x))
abstracted avars and vars of a proof.

proof-in-intro-form-to-final-kernel computes the final kernel (the
kernel after removing at most (car x) abstracted avars and vars) of
a proof.

intro-proof-and-new-kernel-and-depth-to-proof added.

proof-in-exnc-elim-rule-form? added.

We use acproof to mean proof-with-avar-contexts.  An acproof is a
proof in the sense of check-and-display-proof.  It is used to avoid
recomputation of avar-contexts.

make-acproof-in-avar-form make-acproof-in-aconst-form
make-acproof-in-imp-intro-form make-acproof-in-imp-elim-form
make-acproof-in-impnc-intro-form make-acproof-in-impnc-elim-form
make-acproof-in-and-intro-form make-acproof-in-and-elim-left-form
make-acproof-in-and-elim-right-form make-acproof-in-all-intro-form
make-acproof-in-all-elim-form make-acproof-in-allnc-intro-form
make-acproof-in-allnc-elim-form proof-to-acproof added.

nbe-normalize-proof-without-eta and its auxiliaries extended, to
allow for nbe-normalize-proof-without-eta-for-extraction.

proof-to-eta-nf and proof-to-eta-nf-for-extraction both derived from
a general (proof-to-eta-nf-aux proof extraction-flag content-flag).
This is for efficiency reasons: one need not enter parts of the
proof which do not contribute to the extracted term.

proof-to-proof-with-eta-expanded-permutative-aconsts added, modelled
after if-term-to-eta-expansion-and-unfolded-simrecs in term.scm.  It
extends, simplifies and corrects (in impnc-case)
proof-to-proof-with-eta-exp-ex-elims and its auxiliary functions
ex-elim-aconst-to-eta-expanded-proof and
ex-elim-aconst-to-eta-expanded-proof-from-exhyp.  For efficiency
again there is a variant
proof-to-proof-with-eta-expanded-permutative-aconsts-for-extraction

A permutative redex occurs if the conclusion of a permutative
assumption constant (example: Ex-Elim), applied to parameters and
all side premises, is the main premise of an elimination.  We assume
that this conclusion is a prime or existential formula, since this
will be the case when normalize-proof-pi is used in normalize-proof.
Hence the final elimination must be an elimination axiom for an
inductively defined predicate or else Ex-Elim.

permutative-aconst? permutative-redex?  added.

For permutative conversion we use an auxiliary function
(normalize-proof-pi-aux proof extraction-flag content-flag).  The
extraction-flag indicates whether we are interested in extraction
only.  If so, we can disregard (maximal) parts of the proof without
computational content.  The content-flag indicates whether the
formula of the proof has computational content.  This is for
efficiency only, since it avoids recomputation.  When
extraction-flag is #f content-flag is irrelevant.

normalize-proof-pi normalize-proof-pi-for-extraction
(normalize-proof-pi-aux proof extraction-flag content-flag) added.

Added proof-in-permutative-normal-form? and
proof-to-permutative-redexes as test functions to check
normalize-proof-pi .

proof-in-beta-normal-form? rewritten, making use of new functions
proof-in-beta-normal-form-for-extraction?
(proof-in-beta-normal-form-aux? proof extraction-flag content-flag).

Normalization of proofs is made more efficient by allowing to know
whether one is interested in extraction, and if so, disregard parts
of the proof without computational content.  The extraction-flag
indicates whether we are interested in extraction only.  If so, we
can disregard (maximal) parts of the proof without computational
content.  The content-flag indicates whether the formula of the
proof has computational content.  This is for efficiency only, since
it avoids recomputation.  When extraction-flag is #f content-flag is
irrelevant.

This is done by adding -for-extraction and general -aux variants
(taking as additional input an extraction-flag and a content-flag)
of proof-to-eta-nf
proof-to-proof-with-eta-expanded-permutative-aconsts
nbe-normalize-proof-without-eta normalize-proof-pi
proof-in-beta-normal-form .

Added nbe-normalize-proof-for-extraction and the general
(nbe-normalize-proof-aux proof extraction-flag content-flag).

normalize-proof-simp added.  Simplification conversions (Prawitz)
make use of the concept of a permutative aconst.  It is checked
whether one side-proof-kernel has no free occurrence of any avar
bound in this side-proof.  proof-to-proof-without-predecided-avars
added.  It removes dependencies on avars, and in this way helps to
make normalize-proof-simp useful.

Then remove-predecided-if-theorems (special for pruning).  Because
of its usage of term-to-minuend-and-subtrahends and
le-minuend-minus-subtrahends-avar-and-subtrahends-to-proof it is
designed for use in the binpack case study, where the boolean terms
are of the form i<=j--i0--...--in.  It would be better if a more
general decision procedure is used (simplex-algorithm?).

prune added, as a generalization of Prawitz' simplification.  A
problem with prune is that is is slow.  For efficiency the proof is
first turned into an acproof, to avoid recomputation of
avar-contexts when pruning.

undec-proof-and-decavars-and-decfla-to-decproof-and-ext-decavars
corrected in case allnc-intro: if the allnc bound variable decvar in
the decorated fromula is distinct from the variable var used in the
proof it needs to be renamed into var.  In case of an aconst that
can be changed downward we do it, particularly at intro and elim
aconsts for or, ex, and, but also for arbitrary theorems or global
assumptions one of whose less decorated variants suffices.  Example:
L: all n((C n -> F) orr C n) is an extension of another lemma LU:
all n((C n -> F) oru C n).  We assume that in IDS variants appear
in decreasing order (i.e., the more extended ones are introduced
first), that all possible variants do appear and that their clauses
use the same parameter predicate variables.  Search for proofs of
less extended formulas from alternative assumption constants
included.  Proofs of c.i. formulas are not entered by the decoration
algorithm.  Auxiliaries:
op-and-args-and-altop-and-decfla-and-decavars-to-proof assumes that
op applied to args proves an extension of decfla, and that altop
differs from op only in possibly requiring additional premises.  It
is tested whether altop applied to args and some of decavars is
between op applied to args and decfla w.r.t. extension.  If so, a
proof based on altop is returned, else #f.
decfla-and-opname-to-altops returns a list of alternative operators
(assumption constants) possibly usable to prove decfla.

proof-to-expr-with-formulas-aux now uses rename-variables.  This
gives alpha-equal variants of the formula with small indices.

In check-and-display-proof optional argument ignore-deco-flag
provided.  Moreover it was wrongly assumed (in an error message)
that the list produced by nc-violations consists of object variables
only.  check-and-display-proof-aux corrected in case of an Elim
aconst.

In pproof.scm

Adapted to EqD: simp-with-intern simp-with-kernel-aux
simphyp-with-intern compat-at eq-compat-at eq-compat-rev-at
compat-rev-at simphyp-with-intern simphyp-with-kernel-aux.

In fla-and-sig-topvars-and-goal-fla-to-use2-data the call of match2
now has #f (for ignore-deco-flag) as an additional argument.  In
intro-intern usage of aconst-to-inst-formula and free removed.

In ets.scm

proof-to-extracted-term-aux corrected in case of an Elim aconst.  The
result must be an identity for a uniform one-clause defined idpc.

mr-invariant? corrected in impnc case: then both the conclusion and
the premise need to be invariant.

In imp-formulas-to-et-rec-const simplified-relevant-clauses adapted
to impnc (was forgotten).

We initially supply the Cases Lemma If: all boole((boole -> Pvar) ->
((boole -> F) -> Pvar) -> Pvar).  This can be done only here,
because for add-theorem we need formula-to-et-type.

If: all boole((boole -> Pvar) -> ((boole -> F) -> Pvar) -> Pvar) can
be used for case distinctions.  After animation of cIf we have added
the computation rule (cIf alpha4) ->
[boole0,alpha4_1,alpha4_2][if boole0 alpha4_1 alpha4_2]

Inductive definitions of Leibniz equality EqD and of the logical
connectives ExD, ExL, ExR, ExU, ExDT, ExLT, ExRT, ExUT, AndD, AndR,
AndU, OrD, OrL, OrR, OrU added.

We need to define eqd-compat-proof in order to put EqDCompat into
THEOREMS when loading init.  This can be done only in ets.scm, because
for add-theorem we need formula-to-et-type.

In pp.scm

DOT-NOTATION set to #f initially.  token-tree-to-string and
token-tree-to-pp-tree display exdt, exlt, exrt, exut by exd, exl, exr,
exu.  The information about totality is in the following variable.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2009-06-29

In lib/list.scm

A variant ListAppd of ListAppend (with display ++) provided, which
allows rewrite rules with two arguments.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done locally  2009-06-25, in the trunk 2009-09-18

In lib/numbers.scm

allnc and --> used in the (single) add-ids clauses for RealEq
RealNNeg and RealLe.  RatPlus, RatMinus, RatTimes, RatDiv, RatLt,
RatLe exhanced by adding external code.

In examples/analysis/real.scm

allnc and --> used in the (single) add-ids clauses for Cauchy,
Mon and Real.

In examples/analysis/cont.scm

allnc and --> used in the (single) add-ids clauses for Cont and
Corr.

In pproof.scm

Typo corrected: formula-toinst -> formula-subst


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2009-03-19

In proof.scm

In spreading-formula-to-proof-aux typo corrected (parentheses).

In etsd.scm

In proof-to-extracted-d-terms-aux typo corrected: uninst-step-formula
-> uninst-step-fla

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2009-01-23

In etsd.scm

In proof-to-extracted-d-terms-aux , case imp-elim and there
proof-in-ind-rule-form? or proof-in-cases-rule-form? ,
take the correct number of arguments of the step formula
(observed by Trifon Trifonov)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-11-21

In axiom.scm

Exnc-Intro and Exnc-Elim were missing in aconst-to-computed-repro-formulas

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-11-11

In proof.scm

In rm-exc "-" deleted in exc-elim-aconst and exc-intro-aconst names.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-11-06

In proof.scm

In check-and-display-proof-aux in cases all-intro and allnc-intro
the variable condition needs only to consider the variables free in
normalized assumption formulas.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-11-03

In pproof.scm

The optional first argument m of search (i.e., how often assumptions
are to be used) is passed to intro-search, which had used mult-default
before.  Since elim-search calls intro-search, it needs m as an
argument as well.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-10-28

In term.scm

term-to-term-with-let enhanced.
term-to-expr made usable for list recursion.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-09-28

In axiom.scm

General comments on Total, STotal, SE, E and induction.
(1) For induction only STotal is relevant.  It corresponds to the
semantic concept of totality.  (2) Total is useful when working with
pairs: the components of a total pair are total.  (3) Induction for
"all a P a" proves "all a^(Total a^ -> P a^)" which is weaker than
"all a^(STotal a^ -> P a^)", but helpful because total variables
occur.  (4) SE and E are convenient when doing proofs, because of
their rules.  But they are not fundamental, and should not be used
for induction axioms.  They can be brought in later, using

finalg     | sfinalg    | alg      | rho=>sigma
-----------------------------------------------
E      | ^ |            |          |  
SE     | | | SE     | ^ |          |
STotal |   | STotal v | | STotal ^ | STotal
Total  v   | Total      | Total  | | Total

Consequences.  (1) aconst-to-computed-repro-formulas now is able to
produce correct results for "Ind" and "Cases" with partial
variables.  (2) It becomes much clearer what induction axioms are.
(3) all-formulas-to-uninst-imp-formulas-and-tpinst and ind-intern
are simplified.

all-formulas-to-uninst-imp-formulas-and-tpinst
typed-constr-name-to-step-formula
all-formulas-to-uninst-cases-imp-formulas-and-tpinst
typed-constr-name-to-cases-step-formula and
aconst-to-computed-repro-formulas adapted and simplified.

alg-to-total-to-stotal-aconst and check-aconst corrected.

In pproof.scm

ind-intern simplified and text for (ind) adapted.
simind-intern simplified and text for (simind) adapted.
stotal-imp-formula? added.
cases-intern simplified and text for (cases) adapted.
casedist-intern simplified and text for (casedist test) adapted.
dec-cases-proof and dec-stotal-cases-proof rewritten.

In examples/test.scm

Adapted to the new formulation of induction and cases for partial
variables with STotal.

In lib/list.scm

Minor adaptions: premise name [SE] renamed into [STotal].
Next-to-last command in proof of "LhConsn" removed.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-09-25

In lib/nat.scm

AllBNatIntro and AllBNatElim reformulated with a total function
variable.

In lib/list.scm lib/listrev.scm

AllBListIntro and AllBListElim reformulated with a total function
variable.

In pproof.scm

In eq-compat-at "Eq-Compat" is of kind 'axiom, not 'theorem.  In
eq-compat-rev-at the uninst-formula of the "Eq-Compat-Rev" aconst was
formed with a new tvar.  Now it is left unchanged.

In x-and-x-list-to-proof-and-new-num-goals-and-maxgoal in case of an
atomic formula for x, when using the predefined atom-to-imp-proof
and-atom-to-left-proof and-atom-to-right-proof it was not checked
that the boolean arguments are total.

In INITIAL-THEOREMS proof for "InhabTotal" added.

In proof.scm

In proof-substitute-aux make-substitution replaced by
make-substitution-wrt var-term-equal?  In aconst-substitute-aux the
case of an elim-aconst which is allowed to have free variables in its
uninst-formula is taken care of.

In axiom.scm

There was a contradiction of the general description of aconsts -
saying that uninst-formula has no free object variables - and the
way elim-aconsts are formed, where the argument variables xs^ of the
inductively defined predicate are formally free in uninst-formula;
however, they are considered bound as well.

In pconst.scm

In const? token-type constscheme added.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-09-09

In etsd.scm

all-formulas-to-etd-rec-const removed.  Its (only) usage in the
proof-in-imp-elim-form case of proof-to-extracted-d-terms-aux is
replaced by arrow-types-to-rec-consts defined in pconst.scm.
(Work of Trifon Trifonov).

In examples/test.scm

Extended by applying extraction-test-etd to a simple proof by
induction using a weak existential.  (Work of Trifon Trifonov).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-09-01

In atr.scm

atr-min-excl-proof-to-intuit-ex-proof renamed into the more correct
atr-min-excl-proof-to-ex-proof.  Tests and error messages built in.
Error messages in min-excl-proof? improved.  atr-expand-theorems
added.  It expands all non-definite theorems.  This only makes sense
before substituting for bot.

In proof.scm

In undec-proof-and-decavars-and-decfla-to-decproof-and-ext-decavars
typo corrected, in case proof-in-and-intro-form.  Bound for the forced
exit in case proof-in-impnc-elim-form increased to 3.
proof-substitute-aux and aconst-substitute-aux (again) corrected and
simplified in aconst case.  The cases proof-in-aconst-form and
proof-in-allnc-elim-form are treated together.  For proof-substitute
it is required that an aconst is applied to at least as many terms as
there are free variables in its instantiated formula.

In lib/nat.scm

Nat=Comm renamed in Nat=Symm

In examples/test.scm

Tests for search added: all y(all z R y z -> P) -> all y1,y2 R y1 y2 -> P
and drinker all y(((Q y -> F) -> F) -> Q y) -> exca x(Q x -> all y Q y).
Examples for proof-substitute added.



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-08-19

In proof.scm

proof-substitute-aux corrected in aconst case: clash of variables
was supposed to be avoided by brutal renaming in all aconsts:
(renamed-free (map rename (formula-to-free inst-formula))). However,
rename does something only for variables whose type is changed by
tsubst.  It is now done where needed only, using var-to-new-var.

In etsd.scm

rm-falsity-log adapted: after the change of proof-substitute-aux one
needs to compare the normal forms of proof-with-F-for-bot (obtained
by proof-subst) and proof.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-08-11

In term.scm

In term-to-eta-nf-with-simplified-simrec-appterms missing recursive
call added.

In axiom.scm

In aconst-to-computed-repro-formulas clause for GInd added.  In
all-formula-to-uninst-gind-formula-and-tpinst all p(p -> Rx) instead
of allnc p(p -> Rx) introduced.  all-formula-to-gind-aconst adapted to
changed formula of gind.  (Work of Trifon Trifonov)

In pproof.scm

In a comment, formula of gind changed.

In ets.scm

proof-to-extracted-term-aux adapted to changed formula of gind.
gind-aconst-to-et-grec-const changed into
gind-aconst-to-et-grecguard-const.

In etsd.scm

proof-to-extracted-d-terms-aux and proof-in-gind-rule-form?  adapted
to changed formula of gind.

In examples/test.scm

Adapted to changed formula of gind.  test.out moved to test.save

In examples/classical/ wftest.out moved to wftest.save


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-08-11

In todo.scm

Comment on provable exioms added, which are only there for
convenience.  Plan to replace the predicate constant Equal by the
inductively defined EqD, define atom p by p eqd True and falsity by
False eqd True (as in examples/test.scm).


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-06-13

In term.scm

Some corrections in term-to-expr expr-to-free natrec and posrec.  In
term-to-expr quotient-safe and modulo-safe are used to avoid division
by 0.  (Trifon Trifonov)

term-to-term-without-predecided-ifs added.  It simplifies all if-terms
whose branch is known because we are in a branch of an outer if-term
with the same test term.  tests is an alist assigning to a term of an
algebra type the number of a constructor it is assumed to be built
with.

In formula.scm

In nbe-formula-to-type added support for exnc-form?

In ets.scm

proof-to-extracted-term returns 'eps in case of null type, instead of
raising an error, for consistency with etsd.scm.  (Trifon Trifonov)

In etsd.scm

proof-to-extracted-d-terms-aux-check-result extended by free variables
checking.  Added direct realizer for Efq.  GInd realizer corrected and
simplified.  Now the conclusion formula of the gind-rule is not A, but
allnc b(b -> A) instead.  This approach simplifies the implementation
and also allows extraction from forms of the GInd rule that are not
eta expanded.  (Trifon Trifonov)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-06-06

In typ.scm

type-match-modulo-coercion added

In pconst.scm

arrow-types-to-uninst-paramless-recop-types-and-tsubst corrected in
case of simplified simultaneous recursion.  Comments clarified.

In add-computation-rule and add-rewrite-rule
term-to-term-with-eta-expanded-if-terms replaced by
term-to-term-with-eta-expanded-if-terms-and-unfolded-simrecs

In term.scm

term-in-const-form-to-string corrected in case of simplified
simultaneous recursion.

nbe-normalize-term-without-eta extended to cover simplified
simultaneous recursion.  It first unfolds it to enable nbe, and
folds it again after normalization.
term-to-term-with-eta-expanded-if-terms-and-unfolded-simrecs
includes unfolding of simultaneous recursion operators into
term-to-term-with-eta-expanded-if-terms-and-unfolded-simrecs to
enable nbe-normalize-term-without-eta to work on these.  Conversely,
besides term-to-eta-nf we also need
term-to-eta-nf-with-simplified-simrec-appterms to make the
normalized term as simple as possible.

In psym.scm

string-and-arity-and-cterms-to-idpc-parse-function corrected, using
type-match-modulo-coercion .

remove-idpc-name changed: in case of a simultaneous inductive
definition there now is a comment that each of them is removed.

In formula.scm

ex-exnc-form-to-var ex-exnc-form-to-kernel ex-exnc-form? introduced.

Decoration of formulas: formula-to-undec-formula
formula-to-dec-formula full-dec-variants? defined.

aconst-and-dec-inst-formula-to-extended-tpinst is needed to
correctly decorate an aconst, by extending a given decoration.

aconst-to-undec-aconst changes tpinst, but leaves the uninst-formula
intact.  Then the repro-formulas need to be changed as well.

In axiom.scm

imp-formulas-to-uninst-elim-formulas-etc adapted to simultaneous
inductive definitions, which may be simplified in that only some
"relevant" idpcs are used in imp-formulas.  Moreover, a test is
provided to check that the xs^ in I xs^ are distinct.  Auxiliary
function: clause-to-simplified-clause and replace-final-conclusion.
From an aconst one can compute its repro formulas, using
elim-aconst-to-computed-repro-formulas
intro-aconst-to-computed-repro-data and generally
aconst-to-computed-repro-formulas.  In check-aconst the
repro-formulas present are compared with the computed ones.

To make comparison of assumption variables fast there is an avar
convention: two avars with the same name and index are equal.  The
test avar=? is based on this convention.  To allow checking for
violations of this avar convention avar-full=? is added.

In proof.scm

Automated insertion of uniformities added.  Aim: In a proof without
uniformities, insert as many of them as possible.
proof-to-undec-proof replaces in every formula -> by --> and all by
allnc.  aconsts are replaced by their undecorated form, which leaves
the uninst-formula intact.  However, the formula of the resulting
proof-in-aconst-form is manually changed to be totally undecorated.
The rules for ->, all are replaced by the ones for -->, allnc.

Notice that we work here with proofs violating the avar convention:
if two avars have the same name and index, then they are the same.
Therefore we need avar-full=? instead of avar=?, context-full=?
instead of context=? and context-item-full=? instead of
context-item=?  Also added context-fullminus and  pp-context.
proof-to-free-and-bound-avars-wrt added, which compares avars wrt a
given avar equality.  proof-to-context-wrt added.

Notice that cdp produces an error for the undec-proofs, because a
proof in aconst form has been given a formula which differs from the
one generated by aconst-to-formula.

undec-proof-and-decavars-and-decfla-to-decproof implements: For
every undecorated proof M and every decoration of its sequent we can
find a decoration KInfty of M whose sequent extends the given
decoration of Seq(M), and such that any other decoration K of M
whose sequent extends the given decoration of Seq(M) has the
property that K also extends KInfty.

In proof-in-elim-form-to-final-op-and-args typo corrected: arg
replaced by (list arg).  proof-respects-avar-convention? added.

In make-proof-in-impnc-intro-form typo corrected.

In pproof.scm

Extension and correction of elim-intern: it now incorporates the
former simelim, and works for simultaneously inductively defined
predicates as well.

simplified-inversion for simultaneously inductively defined
predicates does not add imp-formulas J xs -> J xs to form the
elim-aconst.  Then the (new)
imp-formulas-to-uninst-elim-formulas-etc generates simplified
clauses.

In examples/test.scm

Tests for pconst.scm: Tests for constructor-type-to-step-type and
arrow-types-to-uninst-paramless-recop-types-and-tsubst added.

Tests for term.scm: Tests for unfold-simplified-simrec-appterm and
simplify-simrec-appterm

Tests for pproof.scm: Test for elim with a simultaneous inductive
definition.

Tests for simplified-inversion.  Proofs of properties of WN and WNs
adapted to simplified-inversion.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-04-25

In term.scm

Correction of term=-aux?  Tn the abstraction case test added whether
the types of the abstracted variables are equal (before adding them to
the list of variables considered for alpha equivalence).  (Work of
Trifon Trifonov)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-04-23

In proof.scm

(set-goal (pf "all n(n<0 -> n<0)"))
(assume "n")
(ng)
(use "Efq")
fails to normalise: (np (current-proof)) gives an error.  Reason: Efq
is recorded with the normalised formula without free variables.  The
problem is in a "hack" in proof.scm, line 1561.  The line
(proof-to-formula proof) takes the formula from the proof in its
non-normalised form.  It is changed to (aconst-to-formula aconst) to
take the normalised formula from the aconst Efq itself, because this
is what nbe really needs.  (Work of Trifon Trifonov)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-04-18

In psym.scm

In string-and-arity-and-cterms-to-idpc-parse-function (re)introduced
programming error repaired again: the tsubst defined there may be #f
when subst-types is evaluated, but is used with assoc there.  (Work of
Florian Ranzi)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-04-18

In proof.scm

aconst-substitute-aux corrected to yield aconsts with properly
reduced type and predicate substitutions


In psym.scm

In string-and-arity-and-cterms-to-idpc-parse-function coercions
(re)introduced.


In term.scm

In match2-aux creation of a substitution item cds -> [n]cds n
excluded (needed to avoid possible looping)


In formula.scm

Forgoten exnc case added in make-quant quant-form? quant-form-to-quant
quant-form-to-vars quant-form-to-kernel


In examples/quant.scm

Canonical inhabitants introduced

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-04-01

In proof.scm

Correction of arename, done by Trifon Trifonov.  Reason: Consider the
proof lambda n lambda u:n<0 u.  The premise is chosen in a way so that
normalisation causes disappearing of the globally quantified variable.
If we call (ng) between assume and use of the same avar, it is
recorded in the proof with two different formulas - the non-normalised
(when assumed) and the normalised (when used).  Proof substitution
goes inductively on the proof and adds a substitution of n to a fresh
variable while going through the outermost all-intro.  Then, since n
appears freely in the formula of the avar, arename considers that it
is being affected by the substitution (since formula=? is used) and u
is renamed.  However, the other occurrence of the avar with the
normalised (closed) formula is left intact.  The reason is that the
formula=?  check is before the assoc-wrt one.  -- The obvious
correction is to switch the two checks.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-03-31

In typ.scm

Complete test tsubst? for type substitutions added.


In formula.scm

(rename-variables formula) gives an alpha-equal variant of formula
with small indices.  (Work of Simon Huber).


In axiom.scm

check-aconst added: test function for aconsts.  If the argument is not
an aconst, an error is returned.  Complete test psubst? for predicate
substitutions and pinst? for predicate instantiations w.r.t. a type
substitution.

h-deg-violations (parallel to nc-violations) gives the list of names
of aconsts where a pvar whose tvar shows up in the eterm is
substituted by a cterm without computational content.  Reason: this
situation generally produces an error when proof-to-extracted-term is
applied.  Exceptions: the aconsts receiving a special treatment in
proof-to-extracted-term.  add-theorem adapted.


In proof.scm

In check-and-display-proof-aux local test for nc-violations replaced
by a warning.  Test done globally in check-and-display-proof

In an aconst (example: ACNat) substitution of {x|A} for P produces a
warning if tau(P) ne eps but tau(A) = eps.  check-and-display-proof
(which uses check-aconst) at such an aconst gives an error if we are
in a relevant part of the proof.  Reason: cACNat then has argument
type nat=>nat@@alpha66, but its argument has type nat=>nat.


In examples/test

Tests for rename-variables included.


In examples/fan/fanwklu.scm

Directory examples/fan created, and file fanwklu.scm committed.
Contents: Formalization of the equivalence of Fan and a weakened form
of WKL, with EffUniq as an additional hypothesis.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-03-27

psym.scm

In add-ids use of add-algebras-with-parameters for nbe-alg-names
corrected.  Error message improved in case of an inductive definition
not requiring witnesses which has non invariant clauses.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-03-26

etsd.scm

Corrected in case proof-in-ex-elim-rule-form?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2008-03-26

In typ.scm

types-to-embedding applied to pair types returns #f or an error if
no embedding is possible.  (Work of Florian Ranzi)


In grammar.scm

"-->" for impnc.  Token excu added.  prodtype, tensortype and sumtype
made right-associative.


In pconst.scm

In add-rewrite-rule error message improved: arguments in lhs need to
fit the *unsubstituted* type of op


In psym.scm

In add-ids: simultaneously defined idpredconsts are required to be
either all with content or all invariant.  New predicate variables
chosen as general ones, to allow arbitrary substitutions.  Some checks
built in, for instance check for existence of nullary clauses (adapted
from add-algebras-with-parameters by Simon Huber).  Comprehension
terms built with partial variables, to allow substitution of arbitrary
terms.  Totality matters for the abstracted variables of a cterm,
because of the inductively defined existential quantifier.

pvar-to-cterm replaced by the more general predicate-to-cterm

In string-and-arity-and-cterms-to-idpc-parse-function coercions removed.

make-idpredconst checks that in case of a total inductively defined
existential quantifier, that is, ExDT, ExLT, ExRT, ExUT, the
comprehension term has a total variable.  Notice that this property
will not change when a predicate substitution is performed.


In term.scm

make-rename now preserves partiality of variables.  In match-aux and
match2-aux inclusion of cterms in idpredconst was forgotten (work by
Florian Ranzi).

match2-aux needs to build cterms with partial variables.  Hence
type-to-new-var at this place replaced by type-to-new-partial-var.
pvar-to-cterm replaced by the more general predicate-to-cterm


In pp.scm

Adapted to the changes in formula.scm.  token-tree-to-string extended
prod-typeop tensor-typeop sum-typeop made right associative.

To resolve Q'1 vs Q' 1 separator-string treats ' as ^.


In formula.scm

Major changes: addition of impnc.  Binary connectives (bicon) treated
generally.  Inductively defined predicates used to define 
- exd exl exr exu and their variants exdt exlt exrt exut with a total
variable in the clause, and
- andd andl andr andu ord orr orl oru

In make-cterm tests for distinct varsiables added.  We distinguish
{n|A} and {n^|A}, in order to allow the inductively defined
existential quantifier to be restricted to total arguments.

{n|A(n)}r does not give an error if r is not syntactically total.  Its
meaning is Total r & A(r), which is the result after substituting the
cterm {n|A(n)} for Q in Q r.  If r is syntactically total, the result
is A(r).

make-cterm only exceptionally uses total variables.
formula-substitute-aux in case Xr with a predicate variable X and a
cterm {n|A(n)} (with n total) produces Total r & A(r) if r is not
syntactically total, and A(r) otherwise.

Generally we use the abbreviation {n|A(n)} rather than {n^ | Total n^
& A(n^)}.  Therefore cterm-substitute-aux when cterm has the form
{xs^ |P xs^} with a pvar P directly takes the tsubst-value.
(Otherwise the result of P mapsto {xs|A(xs)} would be {xs^ |Total xs^
& A(xs^)}).

Added all-allnc-form-to-final-kernel
imp-impnc-all-allnc-form-to-premises


In axiom.scm

In number-and-idpredconst-to-intro-aconst in case of a total
inductively defined existential quantifier, the param-pvar-cterm is
produced by predicate-to-cterm-with-total-vars .

nc-violations-aux extended by an impnc clause.  

For a clause of an inductively defined predicate we require the form
allnc xs all ys(nc-param-prems --> param-prems -> rec-prems -> P ts)
This is not a heavy rstriction, and it makes some definitions
convenient, for instance, of added-scl-etc-to-proof.

Clauses by default use partial generalized variables.
clause-etc-to-strengthened-clause is changed accordingly.
This does affect proofs involving inductive definitions
(Monika Seisenberger's thesis, work of Klaus Thiel, Freiric Barral,
Stefan Schimanski and Dominik Schlenker), but only in a minor way
(assume needs to be done with partial variables).

Added: clause? strictly-positive?
Changed: imp-formulas-to-uninst-elim-formulas-etc
clause-etc-to-strengthened-clause  

pvar-to-cterm replaced by the more general predicate-to-cterm .
It now uses partial variables

In imp-formulas-to-uninst-elim-formulas-etc pvar-formulas were not
formed correctly.  The fixed pvar associated with I (for ease of
substitution) can have arity (alpha), hence cannot be applied to a
variable of type say boole.  We need a new-var of type alpha.  (Work
of Florian Ranzi)

Axiom InhabTotal added.  Reason: since every algebra is required to
have nullary constructors, every (closed) type rho can be given a
total canonical inhabitant.


In proof.scm

impnc incorporated.  spreading-formula-to-proof
wiping-formula-to-proof isolating-formula-to-proof and
proof-to-goedel-gentzen-translation-aux now use a partial variables to
generate the extra-psubst-gg pvar-to-cterm replaced by the more
general predicate-to-cterm .

In check-and-display-proof-aux inserted check that an elimination
axiom for an invariant idpredconst which is neither special nor
uniform one-clause defined is used with invariant conclusions only.


In pproof.scm

intro-with introduced, with use-with rather than use in case the
arguments cannot be inferred automatically.  elim-intern needs an
additional renaming of vars.  (Work of Florian Ranzi)

casedist-intern compat-at eq-compat-at eq-compat-rev-at compat-rev-at
now build cterm with a new partial variable.
pvar-to-cterm replaced by the more general predicate-to-cterm

Adapted to impnc: assume-intern
fla-and-sig-tvars-and-vars-and-goal-fla-to-use-data

In inversion-intern the instantiated-elim-proof is formed by applying
the generalized elim-formula first to the arguments of the idpredconst
to be inverted, and then to the rest of the free variables in
inst-elim-aconst.  This change is a consequence of necessary
new-var-lists (because of possible type substitutions) in
imp-formulas-to-uninst-elim-formulas-etc

search adapted to impnc.  Postponed: Terminology: clause -> sclause
(for search clause), to distinguish these clauses from those in
idpredconsts.

InhabTotal added to INITIAL-THEOREMS


In ets.scm

In number-and-idpredconst-to-et-constr-term arguments corresponding to
Harrop parameter formulas substituted by Dummy.  Correspondingly, in
proof-to-extracted-term-aux in Intro case make-term-in-const-form
removed.  gind-aconst-to-mr-gind-proof-aux now builds cterm with a
partial test-var

Adapted to impnc: formula-to-et-type idpredconst-to-et-type and others.

mr-invariant? takes invariant-pvars as optional arguments.


In etsd.scm

Corrections (work of Trifon Trifonov).


In lr-dvr.scm

lexer-info adapted to the possibility that taye of variables have
been removed.


In atr.scm

In qf-to-qf-cases-proof cterm built with partial variables


In examples/test.scm

Eqd viewed as a uniform one-clause defined idpredconst, whose
elmination axiom accepts arbitrary formulas.  Tests for EqD as a
uniform one-clause defined idpredconst.  Tests for match2 extended.

Tests for inversion added, also for a simultaneous inductive
definition.  Context: Tait's normalization proof.  Substitutions in
Hancock/Joachimski style, with a trailing number.  Inductive
definition of WN, simultaneously with WNs.

Trifon Trifonov's etsd-test.scm included.


In lib/list.scm

make-cterm used with partial variables only.  ListProjTotal proven,
with axiom InhabTotal.


In lib/listrev.scm

Totality proofs provided, as in lib/list.scm.  ListProjTotal proven,
with axiom InhabTotal.


In examples/bar/bar.scm

Now refers to nat.scm and listrev.scm (rather than the outdated files
nat2.scm and tsil.scm).  (f fbar n) used rather than Init f n.  allnc
in clauses and lemmas only where necessary.  Partial variables used in
clauses.  Totality proofs provided for program constants.


In examples/bar/higman01.scm

Missing universal quantifiers in some clauses of the inductive
definitions for R and TT added.  Now refers to nat.scm and
listrev.scm (rather than the outdated files nat2.scm and tsil.scm).


In examples/bar/higman-finite.scm

Now refers to nat.scm and listrev.scm (rather than the outdated files
nat2.scm and tsil.scm).  allnc in clauses and lemmas only where
necessary.  Partial variables used in clauses.  Totality proofs
provided for program constants.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-12-14

In etsd.scm

An optimization of the extracted Dialectica negative realizer:
do not contract avars foreign to the step proof (done by Trifon Trifonov)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-12-05

In etsd.scm

Treatment of "and" and of "Eq-Compat" added.  pvar-to-var replaced by
pvar-to-d-pvar.  Case distinctions unified.  Treatment of gind is
included, but in this file temporarily disabled.  (Done by Trifon
Trifonov and Simon Huber; their last modification 2007-09-06)

In list.scm

check-all and check-exists added

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-11-29

In proof.scm

Changes concerning aconst substitution fixed bug with incorrect
rename-free calculation (Trifon Trifonov, 28 Nov 2007)

aconst-substitute-aux: Removed unnecessary parameters.  Returns only
the new-aconst as a result

proof-substitute-aux: changes in proof-in-aconst-form and
proof-in-allnc-elim-form

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-11-26

In lib/nat.scm 

Totality proofs added.

In axiom.scm

If a theorem "CTotal" is added with "C" the name of a program
constant, then change-t-deg-to-one is called.

Axiom "Total" formulated with quantifiers with content.  This is
necessary when All-AllPartial is used in totality proofs.

final-substring? added

In examples/fibonacci/fib.scm

Updated.  The graph of the Fibonacci sequence is inductively defined.

In atr.scm

atr-irrel-goal-proof atr-arb-definite-proof now work for arbitrary
prime formulas.  Terminology corrected, and some typos removed.

id.scm

Compatibility and EfEq  theorems added.

boole.scm
Computation rules for AndConst ImpConst OrConst replaced by more
useful overlapping ones

pconst.scm

Warning added in case t-deg-one is stated and totality has not been
proved before.

add-computation-rule now allows overlapping left hand sides, provided
the right hand sides are made equal by the unifier.

Double occurrence of constr-name? removed

proof.scm
Double occurrence removed: proof-in-beta-normal-form?
proof-in-intro-form-to-kernel-and-vars

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-09-18

pproof.scm
(casedist test) replaces the goal A by two new goals
  (atom test) -> A[True/test]
  ((atom test) -> F) -> A[False/test]
and (this is new) if test is not total also
  STotal test
To this end, dec-stotal-cases-proof is added (work done by Simon Huber).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-09-13

pproof.scm
use2-intern corrected.  match2 cannot find a tsubst plus a pinst in
case (Pvar alpha)x is to be a pattern for a formula A.  Therefore the
types of the used formula are considered fixed, and we only rename the
pvars to let match2 work correctly.  (Following proposals of Florian
Ranzi)

For use-with, in its auxiliary function
x-and-x-list-to-proof-and-new-num-goals-and-maxgoal error messages
made more informative.

error messages in use-intern in case of missing terms now refer to the
original variable in the used formula even if such variables had to be
renamed.

term.scm
match-aux and match2-for-tsubst-aux corrected: In the abstraction and
quantifier cases computation of prev should only be attempted if
tsubst-from-types is not #f.

In match2-for-tsubst-aux and match2-aux typo corrected: 
;- 			 (and (equal? pred pred2)
;+ 			 (and (equal? pvar pred2)

(Done by Florian Ranzi).

formula.scm
alpha-equal-formulas-to-renaming added.
formula-to-vars-and-kernel removed.

proof.scm
thm-or-ga-name-to-proof added (simplifies use-intern)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-09-10

pproof.scm axiom.scm ets.scm
tensor ! removed from proofs.  Reason: The tensor is used with
classical existential quantifiers only.  Hence it does not appear in
unfolded formulas, and should not have proof rules.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-09-07

typ.scm
In add-algebras-with-parameters, check for non-emptyness of algebras added

proof.scm
Special treatment for substitution of aconsts in rule form so that
they remain in rule form after substitution.  Needed for Dialectica
extraction (2007-09-03, Trifon Trifonov).  In particular:

proof-substitute-aux adapted to use the aconst-substitute-aux
function.  aconst-substitute-aux is used twice: (1) In aconst in rule
form (i.e., with nc-elims) - perform manual normalization so that the
aconst remains in the same form.  (2) In the other cases of aconst
appearing - kept previous behaviour.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-09-06

modules/atr.scm
Removed.  Should also be removed from TAGS

pe07.scm
Removed.

pconst.scm
display-program-constants rewritten.  It now displays the constants in
the given order.

pproof.scm
unnecessary cvars removed in strip-intern.

numbers.scm 
Missing rewrite rules added (a+0 -> a etc).  Exponents with type
different from int admitted, without a separate treatment of double
association lists (cf. constr-name-and-tsubst-to-constr in pconst.scm).
The name of the Exp-function is determined by the value type.

Degree of totality corrected to t-deg-zero for RatDiv RealDiv CpxDiv
and exponentiation with possibly zero basis and negative exponent
(RatExp RealExp CpxExp).

term-to-t-deg-aux changed in case of division by a non-zero term, or
exponentiation of zero with a negative exponent.

examples/analysis/real.scm
examples/analysis/cont.scm
examples/analysis/extraction.scm
adapted to the changes in numbers.scm

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-08-24

In typ.scm
types-to-embedding corrected and cleaned up.

In pconst.scm
Introduced argument comes first in elimination operators 
(changes by Simon Huber)

Changed: rec-const-to-uninst-arrow-types 
arrow-types-to-uninst-paramless-recop-types-and-tsubst
arrow-type-to-uninst-paramless-casesop-type-and-tsubst
rec-at
cases-at
const-substitute

Added: nbe-object-rec-compose

In psym.scm
predicate-to-cterm uses partial variables, for clarity when exi is used
idpredconst-to-string now uses separator-string for exi and exid

In term.scm
In term-in-const-form-to-string, "Cases" alg-type is (car arg-types).
Vector notation for recursion adapted.
rec-op-and-args-to-if-term adapted.

In formula.scm
Added: inductively defined conjunction AndL AndR AndLR AndNC with the
infix notation andl andr andlr andnc (so "and" is for the boolean
and-op)

In boole.scm
Tokens "andl" "andr" "andlr" added

In axiom.scm
Introduced argument comes first in elimination operators.  Adapted
all-formulas-to-uninst-imp-formulas-and-tpinst
all-formula-to-uninst-cases-imp-formula-and-tpinst
imp-formulas-to-uninst-elim-formulas-etc

In proof.scm
Introduced argument comes first in elimination operators.  Adapted
proof-in-ind-rule-form?
proof-in-cases-rule-form?
elim-npterm-and-var-genavar-alist-to-proof
proof-of-stab-at-aux
proof-of-efq-at-aux

In pproof.scm
Introduced argument comes first in elimination operators (changes by
Simon Huber).  Adapted

atom-true-proof
atom-false-proof
efq-atom-proof
stab-atom-proof
imp-to-atom-proof
and-atom-to-left-proof
and-atom-to-right-proof
atom-to-imp-proof
atoms-to-and-atom-proof
ind-intern
cases-intern
dec-cases-proof (with (Pvar boole) instead of (Pvar boole)^)
inversion-intern
make-gind-aconst
make-min-pr-aconst

Added:

pproof-all-intro does an all-intro without changing the maxgoal number
pproof-imp-intro does an imp-intro without changing the maxgoal number

Rewritten:
elim (now accepts an optional idhyp, similar to ind)
elim-intern
simelim
simelim-intern

In pp.scm
separator-string changed

In ets.scm
Introduced argument comes first in elimination operators (changes by
Simon Huber).  Adapted

cases-aconst-to-if-term
imp-formulas-to-et-rec-const
all-formulas-to-mr-ind-proof-aux
all-formula-to-mr-cases-proof-aux

In all-formulas-to-mr-ind-proof-aux definition of mr-step-formulas
corrected.  Similar correction in all-formula-to-mr-cases-proof-aux

Changes in the example files
quant/orevkov.save warshall/warshall.save dijkstra/count.save dijkstra/pick.scm dijkstra/dijkstra.save classical/root.save classical/wftest.scm bar/bar.save bar/higman01.save dc/dc-first.save


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-08-17

In term.scm (changes by Trifon Trifonov)

Missing recursive calls to if-term-to-eta-expansion added.
normalize-term-pi-with-rec-to-if and if-term-to-eta-expansion defined
using generic helper functions.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-07-30

In pe07.scm

proof-of-stab-at-aux and proof-of-efq-at-aux adapted to new order of
args in cases-aconst

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-07-28

In list.scm

Insertion sort (from examples/analysis/simpreal.scm, moved here.

In term.scm

Second order matching added.  match2 decides whether there is a
solution.  In the positive case it returns one "most detailed"
solution.  Heuristics: Fit largest rigid arguments first.  Ignore
flexible arguments.  match2 allows to have use2 in addition to use.
use2 tries to automatically infer instances of second order
predicate and object variables.  This is not always what one wants.
For example, match2 with

(define used-formula (pf "as865 m867<=1/2**k866")) 

(define goal-formula (pf "as(M(k+1))<=1/2**(k+1)"))

instantiates the second order variable as865 and gives the result

as865 -> [n868]as(M(k+1)) k866 -> k+1

Forbidden variables removed from (first and second order) matching,
since they are not necessary.

DIALECTICA-FLAG formula-of-nulltypep? and formula-of-nulltypen? added.
We temporarily stipulate that inductively defined predicates have
neither positive nor negative content.

In formula.scm

display-substitutions added.  Displays type-, object- and
predicate-substitutions

In pproof.scm

Argument forb-vars in first-match removed.  use2 added, based on
second order matching.

Extension of use (done by Florian Ranzi).  If first order matching
(done via use-intern) fails, second order matching is tried (via
use2-intern).  Error messages in case of missing terms/cterms improved.

hyp-info-to-leaf made cleaner, by removing the special treatment of
an assumption constant with a nullary predicate variable at the end.

In lnf.scm

proceed adapted to new format of results of
fla-and-sig-tvars-and-vars-and-goal-fla-to-use-data.
Old code removed.

In etsd.scm

formula-of-nulltypep? and formula-of-nulltypen? moved into term.scm.

In prop.scm

prop-intern removed.  Error messages improved.

In id.scm

Adapted to the new notation for pvars

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-07-27

In atr.scm

Non-definite premises allowed in
atr-min-excl-proof-to-bot-reduced-proof and in
atr-min-excl-proof-to-intuit-ex-proof

In examples/Makefile

Directory dc added again

In examples/dc/dc-dirst.scm

Minor adaptions


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-07-25

In term.scm

term-to-expr corrected (following a proposal of Trifon Trifonov)

In grammar.scm positive-content, negative-content exchanged with
no-positive-content, no-negative-content.

In psym.scm

Every predicate variable carries a pair h-deg, n-deg.  This
restricts the admitted comprehension term {x|A} as follows.
h-deg  n-deg   tau^+(A)    tau^-(A) 
  0      0     arbitrary   arbitrary 
  1      0     nulltype    arbitrary 
  0      1     arbitrary   nulltype
  1      1     nulltype    nulltype

In add-ids clause-strings-with-hat removed, and general pvars used

In pproof.scm

dec-cases-proof with (Pvar boole) instead of (Pvar boole)^

In proof.scm

Comment for classical logic changes:  Pvar^ replaced by Pvar.
proof-of-efq-at-aux treats existential formulas without Efq

In boole.scm

falsity-log redefined with h-deg-zero and n-deg-zero

In formula.scm

In formula-substitute-aux special treatment of falsity-log removed

In ets.scm

In Efq and Stab global assumptions, id-proof: Pvar^ replaced by Pvar

In axiom.scm

In make-pvar 0 0 replaced by h-deg-zero n-deg-zero

In examples/dijkstra/count.scm

In NatLtSuccElim Pvar^ replaced by Pvar

In examples/dijkstra/wf.scm

Pvar^ replaced by Pvar

In examples/dijkstra/dijkstra.scm

Pvar^ replaced by Pvar

Moved dijkstra.out into dijkstra.save

In atr.scm (moved to src)

allnc and exnc admitted.  atrX removed.

In init.scm

atr.scm moved back into src from modules

In examples/classical/root.scm examples/classical/wftest.scm

Adapted

In lib/nat.scm

Pvar^ replaced by Pvar

In lib/list.scm

(Pvar nat)^ replaced by (Pvar nat)

In lib/minpr.scm

(Pvar alpha)^ replaced by (Pvar alpha).  Arguments of make-pvar adapted

In lib/minpr_gen.scm

Arguments of make-pvar adapted

In lib/exc.scm

Pvar^ replaced by Pvar

In quant/los.scm

bot replaced by F

In examples/Makefile

Directory dc temporarily removed

In examples/analysis/cont.scm

DC, IP, AC formulated with Pvar^ (no positive content)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-07-17

In pconst.scm

Double definition of constr-name-to-constr removed.  The one using
opt-pvar-to-tvar deleted.

In typ.scm
types-to-embedding extended to types with parameters

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-07-12

In formula.scm

formula-to-token-tree in case exca, excl needs to keep the list of
variables.

In pp.scm

token-tree-to-string and token-tree-to-varstrings-and-kernel adapted
to exca, excl with list of vars as first arg

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-07-11

In axiom.scm
all-formulas-to-cases-aconst -> all-formula-to-cases-aconst

In pconst.scm
cases-const-to-param-types corrected (as done by Simon Huber)
Comment added:
; Format of type-info-or-repro-formulas: (1) For a rec-const.  (a)
; Ordinary pconst: (k param-type1 ... arrow-type1 ...).  The number k
; indicates how many of the following types are parameter types.  (b)
; From an ind-aconst (while normalizing).  all-formulas.  (c) From an
; elim-aconst (while normalizing).  imp-formulas.  (2) For a
; cases-const.  Here a single arrow-type or all-formula suffices.  (a)
; Ordinary pconst: (param-type1 ... arrow-type).  (b) From a
; cases-aconst (while normalizing).  all-formula.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done locally 2007-03-07

lib/realsimp.scm removed.  
Superseded by examples/analysis/simpreal.scm

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-03-07

In examples/arith/sqrttwo.scm

Adapted to the new nat.scm

In axiom.scm

(search-about string) searches in THEOREMS and GLOBAL-ASSUMPTIONS
for all items whose name contains string.

Adapted to the new add-rewrite-rule, which generates a RewriteGA
in case no proof is provided:

examples/dijkstra/count.save
examples/dijkstra/dijkstra.save
examples/dc/dc-first.save
examples/bar/bar.save
examples/bar/higman01.save

In examples/analysis/real.scm 

(Rec real=>pos=>rat)([as2,M3,n4]as2(M3 n4)) now prints as
[x0,n1][if x0 ([as2,M3]as2(M3 n1))]
(was previously in realcorr.scm, which has been removed now).

Change: based on the new (cleaned) nat.scm and numbers.scm, which
allows to work with pos and nat simultaneously.  Cauchy sequences have
type nat=>rat, and Cauchy moduli have type int=>nat.

examples/analysis/cont.scm

Corrected the uniform modulus of continuity for the square function.
Removed unnecessary "Id" theorem (now in src/ets.scm).
ACT, IPT (T for total) renamed into AC, IP
(was previously in contcorr.scm, which has been removed now).

Change: based on the new (cleaned) nat.scm and numbers.scm, which
allows to work with pos and nat simultaneously.  Cauchy sequences have
type nat=>rat, and Cauchy moduli have type int=>nat.

examples/analysis/extraction.scm

Corrected the uniform modulus of continuity for the square function
(was previously in extractioncorr.scm, which has been removed now).
Uses (libload "realsimp.scm") instead of (load "simpreal.scm");
simpreal.scm removed.
less-expr etc removed, because of the new term-to-expr

Change: based on the new (cleaned) nat.scm and numbers.scm, which
allows to work with pos and nat simultaneously.  Cauchy sequences have
type nat=>rat, and Cauchy moduli have type int=>nat.

examples/analysis/simpreal.scm

Temporary file.  provides ord-field-simp-bwd, which should be replaced
by reflection.

alg nat is present.  Cauchy sequences have type nat=>rat, and Cauchy
moduli have type int=>nat.

Some functions previously in numbers.scm are now provided here:
int-term-to-rat-term pos-term-to-rat-term real-numeric-term-to-number
int-numeric-term-to-number rat-numeric-term-to-number
is-rat-numeric-term?  pos-term-to-int-term and similar ones.

In lib/list.scm 

- (token for NatMinus) changed into the new token -- (cut-off minus)

In var.scm

remove-var-name only gives a warning (not an error) if the variable
name does not exist.

In boole.scm

Rewrite rules for the boolean constants commented out.  They should
added as computation rules, once consistent overlaps of computation
rules is implemented.

In numbers.scm (based on examples/analysis/numbersnat.scm)

For reals, the Cauchy sequences "as" "bs" "cs" "ds" have type "nat=>rat"
and the Cauchy moduli "M" "N" have type "int=>nat".

In nat.scm (not yet in lib, but in examples/analysis)

All rewrite rules proved.  Major cleanup, following Klaus Thiel's
version of nat.scm (in exampeles/ordinals).  remove-nat-tokens
enhanced by (partial) removal of display items.

In term.scm

In term-to-expr, terms in numeric form wrt either pos or nat are both
displayed as the corresponding number.  Therefore both
is-numeric-term-wrt-pos? and is-numeric-term-wrt-nat? have been moved
to term.scm, and similarly numeric-term-wrt-pos-to-number and
numeric-term-wrt-nat-to-number.  The function is-pos-numeric-term?  is
replaced by is-numeric-term-wrt-pos?, and is-int-numeric-term? is
changed accordingly.

Scheme definitions of |IntS|, |IntToNat| added (for term-to-expr)

Definition of separator-string moved to pp.scm

Typo in definition of |cDC| corrected.

In pp.scm

Definition of separator-string moved here from term.scm

In typ.scm

Subtype relation generated from pos < nat< int < rat < real < cpx

View pos, nat, int, rat, real and cpx as algebras, with constructors
pos: One SZero SOne 
nat: Zero Succ
int: IntPos IntZero IntNeg
rat: RatConstr (written # infix) and destructors RatN RatD
real: RealConstr and Destructors RealSeq RealMod
cpx: CpxConstr (written ## infix) and destructors RealPart ImagPart

We use a global variable ALGEBRA-EDGE-TO-EMBED-TERM-ALIST
initially set to '().

term-to-original returns the original of a term under possibly
repeated embeddings stored in ALGEBRA-EDGE-TO-EMBED-TERM-ALIST

types-to-coercion renamed into types-to-embedding.  type-leq? renamed
into type-le?

In pproof.scm

In set-goal the argument can be string, to be parsed into a formula
Admit-GA renamed into AdmitGA

In pconst.scm

add-computation-rule now accepts two strings.  add-computation-rules
accepts an even number of arguments.  add-rewrite-rule (with
abbreviation arw) now takes a optional proof argument.  If no proof
is given, a global assumption RewriteGA is generated.

In lib/realsimp.scm

Leq, Less renamed in Le, Lt.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-01-29

In proof.scm

In make-arename classical-formula=? replaced by formula=?
Reason: classical-formula=? checks whether the normal forms are equal.
But in arename we want syntactic equality, i.e., formula=?

In proof-substitute-aux the aconst case has been corrected: new vars
is psubst should not cause renaming.

In examples/classical/gcd/gcd.scm

Adapted to the present atr.scm, which works with proof substitutions

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2007-01-20

init.scm

Code for comments moved to here.

list.scm

alist-to-multivalued-alist-wrt added.  It transforms ((x1 y1) (x2 y2)
...) into ((z1 y11 y12 ...) (z2 y21 y22 ...) ...) with distinct zi's.

list-to-left-associated-list and non-null-list-to-app-expr added:
(list-to-left-associated-list '(0 1 2 3)) => (((0 1) 2) 3)

Code for comments moved to init.scm.

pconst.scm

cases-const-to-param-types needs to take care of the case that
type-info-or-repro-formulas is a type info
add-program-constant gives no comment for "cId"

term.scm

term-to-term-with-let introduced.  It hand optimizes a term by
searching for its longest duplicate subterm, and taking that subterm
out via a let.  term-to-expr rewritten.  Aim: produce a readable
scheme expression that can be evaluated.

examples/bar/higman01.save changed accordingly: ((= a1) a2) -> (= a1 a2)

atr.scm

imp-const and and-const moved into boole.scm
qf-to-term moved to formula.scm

formula.scm

qf-to-term moved here (from atr.scm).
illegal-tensor? replaced by formula-with-illegal-tensor?

boole.scm

imp-const and-const or-const neg-const added

axiom.scm

add-theorem gives no comment for the "Id" theorem

arity-to-new-non-harrop-pvar -> arity-to-new-general-pvar in
all-formulas-to-uninst-imp-formulas-and-tpinst
all-formula-to-uninst-cases-imp-formula-and-tpinst
ex-formula-to-ex-intro-aconst
ex-formula-and-concl-to-ex-elim-aconst
exnc-formula-to-exnc-intro-aconst
exnc-formula-and-concl-to-exnc-elim-aconst

proof.scm

PVAR-TO-TVARP-ALIST  PVAR-TO-TVARP
PVAR-TO-TVARN-ALIST  PVAR-TO-TVARN added.
proof-to-final-imp-elim-op and proof-to-imp-elim-args added
proof-to-final-allnc-elim-op added

Problems with proof-to-expr-with-types: (1) multiple occurrences of
avars displayed many times.  (2) bound avars with no occurrence in the
kernel not shown.  Replaced by proof-to-expr-with-formulas (showing
all aconsts, free avars and bound avars with their formulas), and
proof-to-expr-with-aconsts.

expand-theorems-with-positive-content added
proof-to-proof-parts added
proof-in-ind-rule-form? proof-in-cases-rule-form?
proof-in-ex-elim-rule-form? added

pproof.scm
illegal-tensor? replaced by rewritten formula-with-illegal-tensor?

ets.scm

Id: Pvar^' -> Pvar^' added as initial theorem.

cont.scm

Supply of theorem Id removed.  It now is always a theorem.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-09-16

var.scm

var-to-string made clearer and simplified.  Now "_" is only used where
really necessary.  Examples: In (nat=>nat)7 the 7 is understood as an
argument.  When we want an index, we must use (nat=>nat)_2 7.


examples/dijkstra/dijkstra.save
examples/bar/bar.save
examples/bar/higman01.save

Adapted to the simpler print-strings for variables.

psym.scm

pvar-to-string adapted to possible positive and negative content
(needed to the implementation of the Dialectica interpretation).

formula.scm

Better error messages for make-predicate-formula

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-05-30

pp.scm

We define token-tree-to-string and use this for all display purposes
(for types, terms and formulas).  For line breaks,
token-tree-to-pp-tree and pp-tree-to-string are provided (following
Stefan Schimanski)

Flag DOT-NOTATION introduced; default is #t.  If set to #f, the
display is "all n(A -> B) -> C" instead of "(all n.A -> B) -> C".


axiom.scm ets.scm grammar.scm psym.scm boole.scm formula.scm
pproof.scm atr.scm

Format of pvars changed, to prepare for a treatment of the Dialectica
interpretation.  Instead of the Harrop degree, which could be 0
(general, display "P^") or 1 (Harrop formula, that is, no
computational content, display "P"), we now have two fields: the first
one holding 'positive-content or 'no-positive-content, and the second
one holding 'negative-content or 'no-negative-content.  For example,
"ex n T" has positive-content but no-negative-content, "all n T" has
no-positive-content but negative-content, "ex n all m T" has
positive-content and negative-content.  Display: "P" "P1" in case of
'no-positive-content and 'no-negative-content, "P^" "P^1" in case of
'positive-content and 'no-negative-content, "P'" "P1'" in case of
'no-positive-content and 'negative-content, "P^ '" "P^1'" in case of
'positive-content and 'negative-content.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-05-13

boole.scm unicode.scm

neg-op replaced by prefix-op.

proof.scm

tensor eliminated; it is only used as an abbreviating device for
classical formulas

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-05-09

dijkstra/wf.tac
dijkstra/pick.tac

Comments added with necessary animations, in order to make the
soundness proofs correct.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-05-09

ets.scm 

proof-to-soundness-proof-aux corrected: in case theorem one needs to
bind the free vars in inst-proof.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done locally 2006-04-12

doc/mlcf.tex

Some typos corrected.
instanciate -> instantiate

examples/tait/sn.scm

instanciate -> instantiate

examples/fan/fanequiv.scm

instanciate -> instantiate

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
<<<<<<< log.txt
Done 2006-05-05

term.scm

Problem: (boole1=boole2)=True prints as boole1=boole2=True.  Solution:
In token-tree-to-string and token-tree-to-ppstring, if the operator as
well as an argument has token-type rel-op or relterm, then the
argument needs parentheses.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
=======
Done locally 2006-04-19

lib/nat.scm

Rewrite rule n<n -> False added (courtesy of Monika Seisenberger)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-04-19

pconst.scm

remove-rewrite-rules-for and remove-computation-rules-for corrected.
They now use match (instead of unify) to check whether a lhs of a rule
has the form of the given term.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-04-17

term.scm

mk-term-in-if-form and some associated functions reintroduced;
they are needed for Dan Hernest's implementation of functional 
interpretation


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-04-13

pproof.scm

(undoto n) allows to go back to a previous pproof state whose (top)
goal had number n (code due to Markus Sauermann)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-04-12

formula.scm

make-=-term added, and used for make-=

term.scm

normalize-term-pi-with-rec-to-if corrected.
test-and-gen-args-to-if-nf and all mention of gen-arg removed: obsolete

instanciat -> instantiat

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-02-21

pproof.scm

In by-assume also numbers admitted as labels for hypotheses

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-02-21

examples/classical/dickson.tac
examples/classical/wftest.tac

Adapted to the cleanup concerning classical existential quantifiers,
course-of-values induction and the minimum principle.  No more need to
rerun interactive proofs: the necessary auxiliary theorems are created
silently.  lib/minpr.scm and lib/minpr_gen.scm made obsolete.

pproof.scm

Cleanup concerning classical existential quantifiers, course-of-values
induction and the minimum principle.  No more need to rerun
interactive proofs: the necessary auxiliary theorems are created
silently.  lib/minpr.scm and lib/minpr_gen.scm made obsolete.

Added: make-cvind-aconst.  It takes a positive integer n and returns an
assumption constant for course-of-values induction w.r.t. a measure
function of type alpha1 => ... => alphan => nat.

make-min-pr-aconst.  It takes positive integers m,n and returns an
assumption constant for the minimum principle w.r.t. a measure
function h of type alpha1 => ... => alphan => nat.

make-exc-intro-aconst.  It takes positive integers m,n and returns an
assumption constant for exc-introduction w.r.t. n variables of type
alpha1 to alphan.

make-exc-elim-aconst.  It takes positive integers m,n and returns an
assumption constant for exc-elimination w.r.t. n variables of type
alpha1 to alphan.

In exc-formula-to-exc-intro-aconst and similarly in
exc-formula-and-concl-to-exc-elim-aconst there is no need any more to
rerun the interactive proof.

exc-formula-and-measure-to-min-pr-aconst replaced by
exc-formula-to-min-pr-aconst

by-assume-minimal-wrt rewritten.  Suppose we are proving a goal G from
a classical existential hypothesis ExcHyp: exc x1..xn.A1 !..! Am.
Then by the minimum principle we can assume that we have x1..xn which
are minimal w.r.t. a measure h such that A1..Am are satified.

by-assume (replaces by-assume-with) now works for existential
hypotheses ex x A, exnc x A, exc x1,..,xn.A1!..!Am

Auxiliary functions: make-fixed-tvars, make-fixed-pvar,
make-fixed-pvars, make-fixed-measure-var, make-fixed-vars

display-current-pproof-state now takes an optional proof argument

instanciat -> instantiat

formula.scm

formula-to-string treats tensor as right-associative

pp.scm

tensor-op treated as right-associative

lib/nat.scm

Theorem "NatLtLtSuccTrans" added (used for make-cvind-aconst)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-01-15

proof.scm

Definition of proof-substitute-aux corrected in aconst-case.
instanciate -> instantiate

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-01-09

In examples/classical/dickson.tac

The final test (giving 3@4) now works as it should (after correcting
proof-substitute-aux in proof.scm).  Unnecessary (and meaningless)
free variable n (which showed up in the extracted term) replaced by 0.
Name "DicksonTwo" introduced for the (classical) proof.

In examples/analysis/real.scm

"RatAbsEq" renamed into "RatAbsCompat"

In term.scm

In term-to-expr, Less, Leq replaced by Lt, Le

In proof.scm

Correction of proof-substitute-aux for all-intro, allnc-intro

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2006-01-03

In pproof.scm

fla-and-sig-tvars-and-vars-and-goal-fla-to-fst-match-data corrected:
when computing match-res, in case (predicate-form? used-formula),
(predconst-form? predicate) had to be checked first

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2005-12-08

examples/pruning/align.scm added

In typ.scm

tsubst-match added

In pconst.scm

add-computation-rule simplified (and corrected) in the case of a
nullary pconst.  Remove the entries which are of the form of the
tsubst of the pconst in the lhs in the tsubst-obj-alist for
pconst-name in PROGRAM-CONSTANTS.  Add a new entry with the object for
the rhs.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 2005-12-05

doc/mlcf.tex

In proof-to-soundness-proof for exnc-intro in case tau(A) ne nulltype
parameters for new exnc-intro-axiom corrected.  Similarly for the
cases axiom.

In typ.scm
  type-unify added, by adapting unify (for terms).  Notice that
  extending the treatment in modules/type-inf.scm is no good.  There
  it is assumed that all types are built from type variables by arrow
  and star, hence equal type constants do not unify.

  Error messages in is-used? cleaned up

  make-inhabited removed.  Use add-computation-rule instead.  Example:
  (add-computation-rule (pt "(Inhab boole)") (pt "False"))

  type-to-canonical-inhabitant adapted to "Inhab"

  Global variable TYPES-WITH-CANONICAL-INHABITANTS removed


In term.scm

  In disagreement-pair constants are now compared with const=?, rather
  than only equality of their names.

  Totality constraints now respected by match-aux

In examples/warshall/warshall.tac

COMMENT-FLAG set to #f in the initial loading of nat.scm and list.scm

In examples/classical/root.tac

COMMENT-FLAG set to #f in the initial loading of nat.scm
COMMENT-FLAG set to #f when loading atr.scm

In examples/classical/wftest.tac

COMMENT-FLAG set to #f in the initial loading of nat.scm
COMMENT-FLAG set to #f when loading atr.scm

In examples/dc/dc-first.tac

COMMENT-FLAG set to #f in the initial loading, afterwards 
COMMENT-FLAG set to #f

In lib/minpr.scm

COMMENT-FLAG set to #f in the initial loading of nat.scm.  In the
proof of "Min-Pr-a-1-1" use replaced by use-with, because there is a
clash of tvars.  General variable names used.  Uses theorems in
nat.scm rather than a global assumption.  The name Cv-Ind has been
changed to CVInd (no "-" to allow the parser to read cCVInd)

In lib/nat.scm

Bounded universal quantifier added as a boolean constant.  Rewrite
rules adapted to partial variables.  Cleaned up.  Theorems added.
max and min added.

In lib/list.scm

The proof of LhConsn used Pred(Succ nat1-nat^2) |-> nat1-nat^2 as a
rewrite rule, which (correctly) does not hold for the partial nat^2
any more.

Adapted to introduction of "Inhab", and somewhat extended (parallel
to the new listrev.scm)

In lib/listrev.scm

Initial commit.  Lists written in reverse order.  Intended to replace
tsil.scm (by Monika Seisenberger).  Changes:
:: now is an add-op, hence left-associative.  Display: :0::1::2::3
Notice that tsil.scm and list.scm cannot be loaded together.
Reason: In :0::1::2::3 the ":" is a prefix-op for tsil but a
postfix-op for list.
Hence replace "tsil" -> "list", "snoc" -> cons", "lin" -> "nil"
Theorem "ListNilAppend" proved, and added as rewrite rule
++ replaced by Succ
"ListProj" considered as a partial program constant
"ListMap" used as binary program constant, written infix as map
Lead, Last replaced by Bar, __
Theorems "LhMap" and "MapAppend" added
"ListZip" and "ListUnzip" added as program constants
"ListFzip" and "ListFunzip" added as program constants
Theorem "ListMapFbar" added as rewrite rule

In boole.scm

ImpConst and some boolean proofs transferred from atr.scm here.
OrConst and NegConst added.

Program constant "Inhab" added: a constscheme providing a canonical
inhabitant of an arbitrary type.  It can be given a concrete value.
Example: (add-computation-rule (pt "(Inhab boole)") (pt "False"))

In pconst.scm

"AndConst" replaced by "Inhab" "AndConst" "ImpConst" "OrConst" "NegConst"
to hide noise when loading the system

nbe-pconst-and-tsubst-and-rules-to-object made more general: In case
(zero? arity) pconst can have instantiated tvars.

In add-computation-rule the corresponding test has been changed.  It
now is possible to add the computation rule (pt "(Inhab term)") -->
(pt "Var 0").

In axiom.scm

Error message in add-global-assumption made better: unexpected free
variables are displayed

In modules/atr.scm

ImpConst moved (slightly changed) into boole.scm.
imp-to-atom-proof moved into pproof.scm (it is needed for assume)
atom-to-imp-proof moved into pproof.scm (it is needed for 
x-and-x-list-to-proof-and-new-num-goals-and-maxgoal)


In pproof.scm

In x-and-x-list-to-proof-and-new-num-goals-and-maxgoal the atom case
needs to be extended to andb, impb.
fla-and-sig-tvars-and-vars-and-goal-fla-to-use-data adapted to andb,
impb.  Hence "use-with" and "use" are now applicable for andb, impb
formulas as used formulas.
assume now works for a boolean goal boole1 impb boole2
We could also extend use-with, use, assume to "AllBNat".  However,
it seems easier to use "AllBNatIntro" and "AllBNatElim" instead.

x-and-x-list-to-proof-and-new-num-goals-and-maxgoal corrected: it
now treats types and cterms in x-list by means of simultaneous
substitutions.

use-intern enhanced: it now renames type variables, to let match
work correctly in case of clash of tvars.

eq-compat-at corrected

simp-with-intern corrected: it now looks for nkernel in the
normalized goal formula, as it should

simphyp-with and simphyp added

Cleanup of compat-at, used in simp: it is not necessary to generate
global assumptions.  For every finitary algebra we can prove
compatibility with = from Eq-Compat and =-to-Eq.  This proof is
automatically generated.  Similarly for compat-rev-at, using Eq-Symm

  Global variable TYPES-WITH-CANONICAL-INHABITANTS removed

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-11-17

lr-dvr.dvm

string-reader rewritten in error case, to cooperate with myerror

pproof.scm

eq-compat-at corrected: formula-of-eq-compat-aconst was not defined

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-11-11

axiom.scm

exnc-formula-to-exnc-intro-aconst corrected: it should start with allnc

pproof.scm

In eq-compat-at order of variables corrected

ets.scm

real-and-formula-to-mr-formula-aux corrected in cases exnc, allnc
In proof-to-soundness-proof-aux case for exnc intro introduced:
exnc-formula-to-exnc-intro-mr-proof-aux added

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-11-03

typ.scm

RESERVED-NAMES extended by STotal.

pconst.scm

The argument pvar-to-tvar is removed in all-formulas-to-rec-const and
imp-formulas-to-rec-const; we now refer to the global variable.
Similar: all-formula-to-cases-const.  opt-pvar-to-tvar removed in
constr-name-to-constr and ex-formula-to-ex-intro-const and
number-and-idpredconst-to-intro-const and
ex-formula-and-concl-to-ex-elim-const.  In const-substitute initial
test introduced whether the type substitution is empty.

psym.scm

Format of IDS changed: all clauses now have names (normally provided
by the user, but names like "AccOne" are created if none are given),
and are added as theorems.  add-ids changed accordingly.
predicate-to-tvars added.

formula.scm

formula-to-tvars changed: tvar for cterms of idpcs taken into account.
nbe-formula-to-type needs a procedure associating type variables to
predicate variables, which remembers the assignment done so far.
Therefore it (now) refers to the global variable PVARS-TO-TVARS.  In
formula-substitute-aux it is now checked that for a pvar without cc
(h-deg 1) only a cterm without cc is substituted.

axiom.scm

all-allpartial-aconst renamed into allnc-allncpartial-aconst.
all-allpartial-aconst with all for allnc added.  Similar for
allpartial-all-aconst, and for ex.  In ex-formula-to-ex-intro-aconst
the new pvar for uninst-ex-intro-formula has h-deg 0 if the kernel has
computational content and h-deg 1 otherwise.  Similar for
ex-formula-and-concl-to-ex-elim-aconst and
exnc-formula-to-exnc-intro-aconst and
exnc-formula-and-concl-to-exnc-elim-aconst.
theorem-or-global-assumption-to-pconst now refers to the global
variable PVARS-TO-TVARS.  number-and-idpredconst-to-intro-aconst
adapted to new format of IDS.

proof.scm

make-pvar-to-tvar deleted.  Global PVAR-TO-TVAR used instead.  In
proof-and-genavar-var-alist-to-pterm and proof-to-pterm the argument
pvar-to-tvar is replaced by a reference to the global variable
PVAR-TO-TVAR.  In proof-substitute-aux in case aconst renamining in
case of `clashes' removed: pinst0 is allowed to contain variables
already in uninst-formula0

pproof.scm

use-intern and simp-intern now also work in case COMMENT-FLAG = #f and
the terms provided are too many.

ets.scm

PVAR-TO-TVAR-ALIST, INITIAL-PVAR-TO-TVAR-ALIST and PVAR-TO-TVAR moved
to proof.scm.  Reference to PVARS-TO-TVARS introduced in
formula-to-et-type idpredconst-to-et-type all-formulas-to-et-rec-const
cases-aconst-to-if-term number-and-idpredconst-to-et-constr
imp-formulas-to-et-rec-const make-pvar-to-mr-pvar
real-and-formula-to-mr-formula-aux

modules/atr.scm

Cleanup in atr-proof-to-extracted-term.  Issue: how does it cooperate
with the global PVAR-TO-TVAR.  The update of PVAR-TO-TVAR-ALIST should
happen only once.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-10-18

pproof.scm

In elim and inversion, generated clauses are proved automatically
whenever this is obvious.  imp-formulas not provided are taken as J xs
-> L xs.  Generated clauses for such J are proved automatically from
the intro axioms (the rec-prems are not needed).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-10-13

pproof.scm

Adaption of inversion to simultaneous inductive definitions.
Minor polishing in elim-intern

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-10-12

axiom.scm

imp-formulas-to-uninst-elim-formulas-etc simplified: we can assume
that the arg-lists of the premises are partial variables new wrt 
(map idpredconst-to-free idpcs)

pproof.scm

Further correction of simelim-intern.  From the generalized
variables in the elim-axiom finally used, the ones that were newly
created for the original arguments (of the premises of the
imp-formulas) have to be instantiated by these arguments.

elim-intern and elim removed, and simelim-intern and simelim renamed
into elim-intern and elim


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-10-12

proof.scm

formula-to-efq-proof added.
Cleaned (comments should not be indented)

pproof.scm

inversion now produces the efq-proofs automatically

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-10-11

pproof.scm

simelim-intern corrected.

inversion (and hyp-info-to-formula as an auxiliary) added.  Intention:
In (inversion x), x is one of the following:
- A number or string identifying a hypothesis I(rs) form the context.
- The name of a theorem or global assumption stating I(rs)
- A closed proof of I(rs)
- A formula I(rs) with free vars from the context, generating a new goal.
Here I is an inductively defined predicate, with clauses K1 ... Kn
One uses the elim-aconst for I(xs) -> xs=rs -> goal, with ? ... ?
for the clauses, rs for xs and proofs for rs=rs, to obtain the goal.
Then many of the generated goals for the clauses will contain false
premises, coming from substituted equations xs=rs.


id.scm

Proof of "allnc n^.Even n^ -> ex m n^ =m+m" rewritten.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-10-10

pproof.scm

simelim-intern corrected and error messages improved

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-10-10

pproof.scm

elim expects a non-simultaneous inducticely defined predicate in the
premise.  Error message provided: Use simelim instead.

simelim added for simultaneous inductive definitions.

axiom.scm

All clauses should use partial generalized variables.  Hence
clause-etc-to-strengthened-clause should be changed accordingly, as
below.  However, this will affect proofs involving inductive
definitions (Monika Seisenberger's thesis, work of Klaus Thiel,
Freiric Barral, Stefan Schimanski and Dominik Schlenker), but only
in a minor way (assume needs to be done with partial variables).
Postponed.

var.scm

var-to-new-partial-var added.  It creates a new partial variable with
the same name and type as the given one.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-10-03

typ.scm

For cleaner code, we use explicit access functions for the
components of a typed-constr-name.

Error messages improved; no display functions in myerror.

var.scm

Cleaner treatment of degrees of totality:  Added t-deg-zero,
t-deg-one, t-deg-zero?, t-deg-one?, t-deg?

var?, mk-var adapted.  type-to-new-partial-var now takes an optional
var argument.

pconst.scm

add-program-constant and const-substitute adapted

psym.scm

STotal added as predicate constant.  predicate-equal? changed:
Equality of predicate constants now only means equality of names,
arities (obtained by carrying out tsubst in uninst-arity) and indices.

term.scm

match-aux adapted to new concept of equality for predicate constants.
Treatment of degrees of totality adapted, in term-to-t-deg-aux.

axiom.scm

In induction it is now possible to induct on stotal objects.  So
either all all-formulas are total, like all ps Q ps, or partial, like
all ps^ .STotal ps^ -> Q ps^.  Changed accordingly:
all-formulas-to-uninst-imp-formulas-and-tpinst
typed-constr-name-to-step-formula
all-formula-to-uninst-cases-imp-formula-and-tpinst
typed-constr-name-to-cases-step-formula

Was:
In induction and cases axioms, the argument variables in the step
formulas (corresponding to parameters in the type) can be partial.
Changed accordingly:
all-formula-to-uninst-cases-imp-formula-and-tpinst
typed-constr-name-to-cases-step-formula

proof.scm

constructor-debug-hook and check-and-display-proof-aux adapted

pproof.scm

assume now also checks that the t-degs of the quanitied and the user
variable are the same

ind-intern, simind-intern, cases-intern adapted to allow goal formulas
all ps^.STotal ps^ -> A

In inst-with-intern new-num-goal (the one that was instantiated) is
put on top of the goal stack, i.e., above (reverse new-num-goals)

Problem: by-assume-minimal-wrt-with does not show all newly
generated goals.  Cure: use display-new-goals

x-and-x-list-to-proof-and-new-num-goals-and-maxgoal
formula-and-elims-to-t-deg-ok? adapted to new concept of t-degs

grammar.scm

Token for predicate constant "STotal" added

warshall.save

Adapted

wftest.tac

Order of commands had to be adapted.  Also by-assume-minimal-wrt-with
used instead of minpr.

dickson.tac

Checked; is ok (only editorial changes).  However, termination of the
extracted program for the particular f,g provided seems to be a
problem.

lib/list.scm

Statement of LhConsn now with STotal pemise

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-08-25

; pproof.scm 

; inst-with corrected: new-num-goal needs to start from new-maxgoal
; instead of maxgoal.

; min-pr simplified, using display-new-goals

; In exc-formula-to-exc-intro-aconst and also in
; exc-formula-and-concl-to-exc-elim-aconst the comments emitted when
; providing the needed exc-intro theorem are suppressed.

; by-assume-minimal-wrt-with-intern provided, as a more usable form of
; min-pr.  It is similar to by-assume-with: If we know a classical
; existence exc x A(x), then we may assume that we have a minimal x
; (wrt a given measure) such that (1) A(x) and (2) for any smaller y,
; A(y) does not hold.

; exc-formula-and-measure-to-min-pr-aconst extended: it now works for
; unfolded exc-formula as well

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-08-17

pproof.scm

In use-with-intern, the warning converning nc-correctness has been
removed when the final proof will be correct (because on the path from
the bottom formula to the present goal there is a formula with no
content).  This is tested by checking that the final proof (obtained
after substituting the present goal by the new proof) still does not
have nc-violations.

examples/tait/dbrealrs.scm

Hat made partial (which it is).  Non-needed assumptions deleted:
TotalOmegaPart, HatSuperTotal

finalg-to-all-allpartial-nonc-aconst added.  Ax3P proved from
Ax3 using this and AxNStrict2.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-07-10

lib/list.scm

Theorem added: "ListAppendNil"

axiom.scm

Typo corrected in finalg-to-expartial-ex-aconst: Expartial -> ExPartial

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-07-09

lib/nat.scm:

++ as prefix operator for Succ removed.
n m k -> nat1 nat2 nat3.  
NatLess -> NatLt, NatLeq -> NatLe
Rewrite rule Pred(Succ nat1-nat2) -> nat1-nat2 added

lib/list.scm

Theorems added: "LhAppend", "ListRefAppendLt", "ListRefAppendGe"
Program constants added: "ListMap"
Theorems added: "LhMap", "MapAppend", "ListRefMap"
Program constants added: "Consn"

var.scm

var-to-string corrected.  (pp (pt "alpha_1")) now gives "alpha_1" and not
the previous "alpha1", which is parsed into a term of type alpha1.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-06-04

ets.scm:

All-Allpartial and Expartial-Ex replaced by All-AllPartial and ExPartial-Ex 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-05-06

ets.scm:

In proof-to-extracted-term-aux the axioms all-allpartial and
expartial-ex were forgotten.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-04-19

pproof.scm

get-intern corrected: proof argument was not used.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-04-09

axiom.scm

add-theorem changed: Before saving a finished proof, it is checked
that it is nc-correct.  This uses nc-violations

pproof.scm

typo in use-intern corrected: formula -> used-formula

Correction of inst-with: check for nc inserted, as in use-with:

cvars-error in use-with and inst-with changed into a warning. 

var.scm

default-var? added

term.scm

nbe-extract now uses default-var? instead of numerated-var? (because
the default-var-names are used in normalized terms)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-03-20

Makefile

make clean now includes the directories bar and dc

lib/ref.tex

Typo corrected

pproof.scm

by-exnc-assume-with added (was forgotten).

term.scm

Correction of if-term-to-eta-expansion: recursive calls to
term-to-term-with-eta-expanded-if-terms inserted for alts and used
for test.  Inner call to if-term-to-eta-expansion removed.

Normalization of terms extended by replacing some Rec-terms by if-terms:
(Rec ...)param-args step-args rec-arg val-args is replaced by
[if rec-arg simplified-step-args]val-args.

In pattern? allnc and exnc added

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-03-20

lib/numbers.scm, lib/realsimp.scm

Minor editorial changes

axiom.scm

imp-formulas-to-uninst-elim-formulas-etc corrected: order of pvars
needs to follow the order of imp-formulas.  

Dependence on COMMENT-FLAG inserted

pproof.scm

Comments in interactive proofs are given only if COMMENT-FLAG is #t.
display-num-goal-aux now only does something if COMMENT-FLAG is #t.

prop.scm lnf.scm pconst.scm pp.scm proof.scm

Dependence on COMMENT-FLAG inserted 

list.scm

OLD-COMMENT-FLAG added, for restauring (in add-ids) the old flag value.
display-comment now only does something if COMMENT-FLAG is #t.

psym.scm

In add-ids OLD-COMMENT-FLAG used for restauring the old flag value.
Similarly in remove-idpc-name



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-03-07

pproof.scm

assert-intern corrected

psym.scm

string-and-arity-and-cterms-to-idpc-parse-function corrected:
arguments need to be coerced.

term.scm

Change of the test composed? (used for formula-to-string).  Problem:
We have Real(a) with of the present definition of composed?  Because
of coercions a in this sense *is* composed.

lib/numbers.scm and lib/realsimp.scm added to the repository.
Both are psrt of ~schwicht/wwwpublic/seminars/prosemss04/numbers.scm,v 1.23 
2004/11/02.

examples/arith/sqrttwo.scm and examples/arith/realsqrttwo.scm
added to the repository.  They are provided for Freek Wiedijk's
"stamp collection" of irrationality of sqrt(2) proof formalizations.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-03-03

pproof.scm

x-and-x-list-to-proof-and-new-num-goals-and-maxgoal extended to also
cover a leaf x formed with an AndConst-atom,

get-intern more efficiently implemented

by-assume-with-intern extended: it now works not only for
a hypothesis, but also for a theorem/global assumption/proof and for
an existential formula, which creates a new goal.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-02-25

psym.scm

add-ids changed.  The final add-token now has three cases:
idpredconst-name idpredconstscheme-name idpredconstscheme-name-wit
where wit stands for with inferable types.  idpredconst-to-string
adapted

grammar.scm

Treatment of inductively defined constants corrected and extended

id.scm

Adapted to new treatment of inductively defined constants

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-02-14

pprooof.scm

Change of simp-with-intern.  In case the kernel of the used formula
(or its normal form) is True or False, one does not `simplify'.

xs renamed into x-list (as in use-with), to be consistent with the
fact that x is separate.  Done in simp-intern and in
fla-and-sig-tvars-and-vars-and-goal-fla-to-fst-match-data

fla-and-sig-tvars-and-vars-and-goal-fla-to-fst-match-data adapted to
type matching.  In simp-intern sig-tvars-and-sig-vars introduced.

fla-and-sig-tvars-and-vars-and-goal-fla-to-use-data introduced.  Replaces
formula-and-sig-vars-and-goal-to-subst-and-xs-and-vars

Change of goal-subst, to prevent the final formula (proved by the
present proof) to be normalized (which can happen in simp-with).  In
the definition of goal-subst we make sure that the formula of proof is
not changed (i.e. normalized).  Therefore we do not use
make-proof-in-imp-intro-form etc, but rather its definition and take
the formula always from the given proof.

normalize-goal takes optional arguments.  If there are none, the goal
formula and all hypotheses are normalized.  Otherwise exactly those
among the hypotheses and the goal formula are normalized whose numbers
(or names, or just #t for the goal formula) are listed as additional
arguments.

In simp-intern no error is raised in case the goal does not simplify.

term.scm

match-aux corrected in case predicate with predconst: the types there
may have to be substituted.

lnf.scm

proceed adapted

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-02-07

typ.scm

In type-match-aux, id-vars renamed into sig-tvars and subst renamed
into tsubst.

term.scm

First order matching extended to also cover terms with type variables
in their types.  Changed: match  match-list  match-aux  first-match

pconst.scm

Adapted to different type of match.  Changed:
nbe-pconst-and-tsubst-and-rules-to-object

formula.scm

Obsolete formula-match deleted.  match works for terms and formulas.

mpc.scm

formula-match replaced by match

pproof.scm

Adapted to different type pf match.  Changed:
formula-and-sig-vars-and-goal-to-subst-and-xs-and-vars

lnf.scm

formula renamed into goal-formula

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-01-31

pconst.scm

In an extracted term it may happen that the alternatives in if-terms
would be not eta-expanded, if nt was applied to the extracted term.
Example: Pred: "all n ex b,m.(b -> m=Zero)&((b -> F) -> n=Succ m)"
has [n0][if n0 (True@Zero) ([n1]False@n1)] as normal extracted term.
But the rhs of a rule should have eta expanded if terms, because
this is expected by nbe-normalize-term-without-eta, which is where
these rules are applied.  Therefore in add-computation-rule and
add-rewrite-rule we enforce that each rhs has eta expanded if terms.
Correspondingly, in display-program-constants term-to-eta-nf is
applied to every rhs.

axiom.scm

In total-aconst the free object variables had to be bound.  Minor
corrections (name -> aconst-name) in the definitions of some other
assumption constants.

pp.scm

Typo in error message corrected

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-01-08

pproof.scm

Correction in
formula-and-sig-vars-and-goal-formula-to-first-match-data In match-res
the kernel of a used atomic formula is considered further.  Typo in
simp-with-intern corrected (simp-with-nkernel-aux replaced by
simp-with-kernel-aux)

term.scm

Correction in first-match: test in if-terms not accomodated

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2005-01-07

pp.scm

In token-tree-to-pp-tree , case postfix-op, (string-append op ")")
replaced by (string-append ")" op)

term.scm

first-match added

pproof.scm

simp-with added.  Generally: simp made more applicable:  Here is the text
In the following definition of simp-with x is one of the following.
- A number or string identifying a hypothesis form the context.
- The name of a theorem or global assumption, but not one whose final
  conclusion is a predicate variable.
- A closed proof.
- A formula with free variables from the context, generating a new goal.
Moreover x-list is a list consisting of
- a number or string identifying a hypothesis form the context,
- the name of a theorem or global assumption,
- a closed proof,
- the string "?" (value of DEFAULT-GOAL-NAME), generating a new goal,
- a symbol left or right,
- a term, whose free variables are added to the context,
- a type, which is substituted for the 1st tvar,
- a comprehension term, which is substituted for the 1st pvar.
This generates a used formula, which is to be an atom, a negated
atom or (Equal lhs rhs).  If it as a (negated) atom, check whether
the kernel or its normal form is present in the goal.  If so,
replace it by True (False).  If it is an equality (lhs = rhs) or
(Equal lhs rhs) with lhs or its normal form present in the goal,
replace lhs by rhs.  In case "<-" exchange lhs by rhs.

To avoid duplication of code we introduce auxiliary functions, to be
used in use-with-intern, use-intern, simp-intern and inst-with-intern:

context-and-cvars-and-formula-to-new-goal hyp-info-to-leaf
x-and-x-list-to-proof-and-new-num-goals-and-maxgoal

compat-at eq-compat-at added.

formula.scm

imp-all-allnc-form-to-final-conclusion added.

boole.scm

Rewrite rules for AndConst extended to also cover partial terms.
Infix notation `and' (left associative) for AndConst added.

lib/list.scm

Program constant "ListRef" added (partial!).
Infix notation `thof' for ListRef added.

examples/dijkstra/dijkstra.tac examples/dijkstra/pick.tac
examples/dijkstra/wf.tac

simpeq replaced by simp

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2004-12-31

pconst.scm

=-at and e-at extended to also reduce constructors with more that one
argument.  This requires AndConst, hence the algebra boole.  Therefore
both are moved from here into boole.scm.

boole.scm

=-at and e-at extended to also reduce constructors with more that one
argument.  This requires AndConst, hence the algebra boole.  Therefore
both are moved here from pconst.scm.

pproof.scm

split extended to also work for goals formed with AndConst.  This
requires atoms-to-and-atom-proof : 
all boole1,boole2.boole1 -> boole2 -> AndConst boole1 boole2

init.scm

In error-object-to-string the test type-form? has been replaced by the
full test type?, and var-form? by var?.  This is necessary to avoid
looping in certain error situations.

modules/atr.scm

AndConst and its rules commented out; they have been moved into boole.scm

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Done 2004-11-13

gen-app.scm list.scm typ.scm var.scm pconst.scm psym.scm term.scm ets.scm
pproof.scm

For every global variable (e.g., MAXTVARINDEX) its initial value
is assigned to an associated global variable (e.g., INITIAL-MAXTVARINDEX)
to be used for reset.

formula.scm

formula-check-to-string, check-and-display-formula (cdf) and
cterm-check-to-string added

pp.scm

done: pp for types 

Done 2004-11-11

pproof.scm

In auto-intern each time in the search-loop (display-comment) is done.
This gives the user an indication how auto proceeds.  Error messages
improved in cases where an interactive command expects a formula or a
term.

Done 2004-11-08

ets.scm

(mr-invariant? formula) added.  In proof-to-soundness-proof-aux in
case of an assumption constant it is now first checked whether the
formula is mr-invariant.  If so, then the original assumption constant
is used again.

Done 2004-11-02

lnf.scm, axiom.scm, proof.scm, temp.scm, orevkov.tac, quotrem-ex.tac,
warshall.tac

num-goals-and-proof -> pproof-state, with maxgoal as an additional entry

prop.scm, pproof.scm

Changed: num-goals-and-proof -> pproof-state, now with three entries:
num-goals, proof, maxgoal.  The local maxgoal is needed for undo.  The
interactice commads (tactics) are split into an internal part, which
only changes the pproof-state, and an external version, which in
addition displays some comments.  In use-with, using a hypothesis with
a comprehension term is explicitely allowed: it does not make sense in
our predicative (i.e., parametric) view of predicate variables.

Done 04-09-20

term.scm

Better error messages in make-term-in-app-form

In term-in-const-form-to-string for a constscheme with 2 or more
arguments we put parentheses around those types whose string contains
#\space.  Reason: otherwise we cannot parse such constschemes.

We now modify term-to-string and pp to print (cID ..)([x]kernel)arg as
[let x arg kernel] 

New version of term-to-expr.  Goals: (1) Usual syntax for arithmetical
expressions (2) For readablibity, we use (let ((x arg)) kernel) for
(((lambda (x) x) (lambda (x) kernel)) arg) and expr for ((lambda (x)
x) expr).  Moreover we define expr-to-free and
remove-vacuous-beta-redex, for otherwise (term-to-expr QR-neterm)
would have a subterm ((lambda (n2) (cons 0 0)) i1) where cond
expressions are generated.

pconst.scm

Allow for external code in pconsts.  We may keep the distinction
pconst - fixed-rule and allow in a pconst - before it tries
computation and rewrite rules - the use of an external function
working with objects.  It tests the arguments (e.g., whether they are
numerals), and if yes immediately returns the result.  Otherwise the
rules are tried next.  This external function should be optional, and
it is given explicitely by its code.

New error message added to add-computation-rule and add-rewrite-rule
requiring that the type variables used are the uninstantiated ones
from the pconst.

pp.scm

formula-token-tree-to-pp-tree changed in case imp-op and-op tensor-op
to avoid the unneccessary parentheses in T -> (all x.T & F)

psym.scm

pvar-name-to-arity corrected

typ.scm

type-leq?  increasing-types-to-coercion etc should be independent of
int rat real

type-leq? should be transitive, but is not for the present one.
Counterexample:
(type-leq? pos int) ;#t
(type-leq? int (py "ytriple (ytriple pos unit pos) unit pos")) ;#t
(type-leq? pos (py "ytriple (ytriple pos unit pos) unit pos")) ;#f

Cure: View pos, int, rat and real as algebras, with constructors
pos: One SZero SOne 
int: IntPos IntZero IntNeg
rat: RatConstr (written # infix) and Destructors RatN RatD
real: RealConstr and Destructors RealSeq RealMod

Advantages: cleaner, also better display of types.  type-leq? then
clearly is transitive.  (increasing-types-to-coercion type1 type2)
uses a global variable INCREASING-ALGEBRAS-TO-COERCION-ALIST initially
set to '().

Given type1 and type2 and tvar.  Want: interval, that is
(type-leq-lb type1 type2 tvar) and (type-leq-ub type1 type2 tvar)
such that the types in between are exactly those with (type-subst
type1 tvar type) <= (type-subst type2 tvar type)

type-leq? now accounts for monotonicity of tensor and ytriple in its
arguments.  It should be extended to other parametrized algebras
monotone in their arguments.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 04-05-04

tensor.scm

term-in-tensor-form? term-in-tensor-form-to-fst term-in-tensor-form-to-snd
added

typ.scm

Correction of increasing-types-to-coercion in tensor case

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 04-04-25

ets.scm

Correction of ex-formula-and-concl-to-ex-elim-mr-proof-aux in the case
where content is everywhere: mk-kernel should not use pair-var

In proof-to-extracted-term-aux assign the identity term to compat
axioms and global assumptions.  Because of the nc quantifiers the
previous type-to-canonical-compat-term is not needed (and in fact
can be wrong).

Correction of eq-compat-aconst-to-mr-eq-compat-proof :
nc-quantifiers need to be used.  Moreover, the procedure is
generalized to work with eq-compat-rev, compat, compat-rev as well

Corresponding change in proof-to-soundness-proof-aux

In all-formula-to-mr-cases-proof-aux replace (append free real-vars)
by (formula-to-free mr-all-formula)

pproof.scm

Correction of casedist : dec-cases-proof now proves - as it should - 
(formula-to-string (pf "all boole.(boole -> (Pvar boole)^True) -> 
                              ((boole -> F) -> (Pvar boole)^False) -> 
                              (Pvar boole)^boole"))

typ.scm

make-inhabited changed: it now only has a side effect and does not
return a term.  type-to-canonical-inhabitant adapted.

term.scm

Pretty printing of terms provided: (pp term).

In if-terms the type is to be determined as the lub of the types of
the alts (notice: parameter types may be present).

Subtype relation generated from pos < int < rat < real introduced.
Need types-to-coercion, increasing-types-to-coercion, types-lub,
types-lub-aux, types-glb-aux.

check-and-display-term provided: (cdt term)

axiom.scm

changed add-computation-rule: optional arity of the added program
constant provided


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 04-03-29
grammar.scm

For to allow
(type-to-string (py "ytriple pos unit pos@@ytriple pos unit pos"))
(which is the display string) instead of 
(type-to-string (py "(ytriple pos unit pos)@@(ytriple pos unit pos)"))
another production had to be added (as for terms):

        (prodtype prod-typeop apptype) : ($2 $1 $3)

axiom.scm

remove-theorem and remove-global-assumption extended to also remove
added program constants.

term.scm

Corrected term-to-eta-nf, for pair terms.  Correction of
constant-alts? and constants-alts-to-const-term.

proof.scm

proof-of-stab-at-aux, proof-of-efq-at-aux, proof-of-stab-log-at-aux,
proof-of-efq-log-at-aux corrected in case (atom predicate ex exnc),
when there are free parameters.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 04-02-29
typ.scm

We want to coerce a sequence of naturals (or integers) into a sequence
of rationals.  Therefore increasing-types-to-coercion has been
extended accordingly.  types-lub  extended to reals.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 04-02-17
ets.scm

proof-to-soundness-proof-aux corrected (typo in allnc case)
all-formulas-to-mr-ind-proof-aux corrected: (1) mr-ind-aconst now applied
to free variables read off from mr-inst-formula.  In the previous
(append free real-vars) the order might be incorrect.  (2) var-lists
corrected in case there are no step formulas.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 04-01-29

list.scm

Cleanup concerning comments.  

comment yields complete one-line comments composed from multiple
strings, beginning with COMMENT-STRING and ending with a newline
command.  Complete comments can be switched off using COMMENT-FLAG.

display-comment is used for building complex displays with
COMMENT-STRING inserted in front, e.g. to display goals or proofs.

pproof.scm

(comment "Proof finished.")  replaced by
(begin (display-comment "Proof finished.") (newline))

psym.scm

In add-ids COMMENT-FLAG set to #f, to suppress unnecessary comments.
remove-idpc-name added.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 04-01-19

typ.scm

types-lub types-to-coercion and increasing-types-to-coercion added,
to enable overloading and coercion when working with rationals.

term.scm

make-term-in-app-form changed, to enable overloading and coercion when
working with rationals.

The possibility to change display of say n#0 to n makes is necessary
to adapt the notion of being composed, used for diplay of predicate
formulas.  uncomposed? introduced, and composed? defined from it.
Reverted again 04-01-16.

formula.scm

make-predicate-formula changed, to enable overloading and coercion when
working with rationals.

In predicate-form-to-string, for x+y===y+x instead of (x+y)===(y+x):
Composed arguments get no parentheses in case of an infix predconst.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 04-01-08

mlcf.tex
Correction concerning Huet projections inserted.

ref.tex
remove-computation-rule replaced by remove-computation-rules-for
remove-rewrite-rule replaced by remove-rewrite-rules-for

grammar.scm
To enable coercions for equality, the predefined token "=" now forms
the =-term with the lub of the two argument types

lib/tensor.scm
Initial commit.  This is an attempt to build integers and rationals by
means of a parametrized free algebra tensor.

axiom.scm
new-global-assumption-name added to axiom.scm.  Takes a string, and
tests all indices i whether string*i-string already is a name of a
global assumption.

pproof.scm
In search and search-ex test included, whether theorems and global
assumptions have positive multiplicities.

In intro-search an atomic goal is normalized.

auto added: A new front end to the search engine, which does iterated
search automatically.  Its arguments (possibly empty) consist of a
multiplicity and theorem or global assumption names, each with its
individual multiplicity (a positive integer).  From these and the
local context clauses are determined, and with these intro-search is
called.  If it returns #f, the automated search terminates and the
unsolved goal is displayed.  If it returns a true value, the global
variables NUM-GOALS-AND-PROOF and NUM-GOALS-AND-PROOF-HISTORY are
updated accordingly and a new search is started, with the same
multiplicity and given leaves.

term.scm
Correction of pattern-unify-rigid-rigid.  Terms in pair form and terms
in component form were forgotten

huet-unifiers-match corrected: not all projections are correct, but
only those where the final value type of xi is the (ground) type of
the rigid term.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 03-12-08
pproof.scm

In elim-search we now use
		(new-leaf (proof-substitute-and-beta0-nf leaf phi))
instead of
 		(new-leaf (proof-substitute leaf phi))
Reason: proof-substitute causes a renaming of avars, which does not
fit to the rest of the proof construction.

In search
 	 (context (goal-to-context goal))
instead of
 	 (context (reverse (goal-to-context goal)))
Reason: In (search m '(name1 m1) '(name2 m2) ...) in case name1 name2 ...
are numbers they ought to refer to the hypotheses with the same numbers

proof.scm 

Change of proof-to-expr: for avars use avar-to-string.  This makes the
indices of avars in the proof expressions the same as the numbers of
hypothesis in the proof display.  Moreover, it avoids occurrence of
unnamed assumption variables

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 03-11-14: 
pconst.scm

In nbe-pconst-and-tsubst-and-rules-to-object in case of a rewrite rule
term-to-eta-nf applied to the extracted-terms of the present
arguments, because the latter are in long normal form:
(extracted-terms (map term-to-eta-nf (map nbe-extract reified-objs)))

Added: (remove-rewrite-rules-for lhs): removes all rewrite rules
unifying with lhs.  (Was forgotten)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Not yet Done 03-10-22: examples/tutorial.scm

Prepared for inclusion in the distribution (load -> mload etc)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 03-09-11: modules/type-inf.scm

Cleaned up.

tvartest.scm

Deleted.  The examples for add-algs transferred to id.scm

id.scm

Cleaned up; examples for add-algs included (from tvartest.scm)

ref.tex

Comparison with Coq and Isabelle added

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 03-09-10: ets.scm

formula-to-et-type corrected in case of idpredconsts.  Added
idpredconst-to-et-type

number-and-idpredconst-to-et-constr corrected

imp-formulas-to-et-rec-const corrected: in simplified-relevant-clauses
the test (zero? (pvar-to-h-deg pred)) is used

grammar.scm

idpredconst-name-and-types-and-cterms-to-idpredconst used instead of
make-idpredconst 
Reason: involves some tests.

psym.scm

Error messages in idpredconst-name-and-types-and-cterms-to-idpredconst
made clearer.

add-ids corrected and simplified, concerning the algebra of realizers.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 03-09-03: id.scm
allnc-all-quantifiers admitted in inductive definitions

formula.scm

atomic formula -> prime formula
typo corrected in exid-form-to-kernel

Basic function for exi added (inductively defined existential
quantifier where the kernel does not have computational content)

formula-to-beta-nf added

pproof.scm

In select use huet-unifiers in addition to pattern-unify.  It yields
a list of all unifiers found for the given MATCH-TREE-BOUND.

Ext -> Eq-Ext

ets.scm

INITIAL-PVAR-TO-TVAR-ALIST added (for reset)
formula-to-et-type corrected in case (idpredconst-form? pred)
imp-formulas-to-et-rec-const adapted to allnc-all-quantifiers in ind defs
number-and-idpredconst-to-et-constr corrected

proof.scm

Error message for cdp made clearer: `in imp elim formulas do not fit'
both A -> B and the non-fitting A' are displayed.

axiom.scm

clause-etc-to-strengthened-clause clause pvars uninst-idpcs)
adapted to allnc-all-quantifiers in ind defs

The procedure clause-and-cterm-pvars-and-idpc-pvars-to-strengthened-clause
has been adapted, but also deleted from axiom.scm : not needed

psym.scm

add-ids adapted to allnc-all-quantifiers in ind defs
idpredconst-to-string extended by exi

boole.scm

Line added:
(add-token "exi" 'quantor (lambda (v k) (apply mk-exi (append v (list k)))))


term.scm:  

Corrections in pattern-unify-xi and pattern-unify-rigid-rigid
concerning nc-quantifiers and predicate constants

Huets unification algorithm added

typ.scm

type-to-canonical-term and type-to-final-groundtypes added
(needed for Huets unification algorithm)

nat.scm

Program constants <=, Pred, - added (from nat2.scm)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 03-08-23: term.scm

Description of substitution clarified.  It is merely assumed that
subst only affects those vars whose type is not changed by tsubst.

Some procedures added (useful for debugging):
term-in-rec-normal-form?
term-to-length
term-to-consts-with-repetitions
term-to-consts
term-in-intro-form-to-final-kernels
term-in-elim-form-to-final-op-and-args
term-in-app-form-to-final-op-and-args
term-to-parts-of-level-one
(term-to-subterms term . opt-level)
term-to-depth

formula.scm

For display, p-substitution-to-string added.  Description of
substitution clarified.

axiom.scm

aconst-to-inst-formula simplified.  Description of aconsts clarified.

proof.scm

Description of substitution clarified.  
Some procedures added (useful for debugging):

proof-in-intro-form-to-kernel-and-vars
proof-in-intro-form-to-final-kernels
proof-in-elim-form-to-final-op-and-args
proof-to-parts-of-level-one
(proof-to-parts proof . opt-level)
proof-to-depth
proof-to-one-step-beta-reduct
proof-in-beta-normal-form?
proof-to-beta-nf
proof-to-beta-pi-eta-nf
bpe-np
proof-to-length

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 03-08-21: axiom.scm 

aconst-substitute-aux corrected: there was a clash between variables
free in psubst and variables free in the pinst of the aconst.  Example:
Induction all n A(f,n,X) has form all f. A(f,0 X) -> ...
After psubst X -> {|B(f)} this f gets catched.

proof.scm

Moreover, aconst-substitute-aux was deleted, or better transferred
into proof-substitute-aux where it is needed (and essentially only
there).  Its uses in proof-of-stab-at-aux etc replaced by uses of
proof-substitute-aux.

dickson.tac In the proof check procedures, allnc added.
Moved into examples/classical/debug.scm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 03-08-19: ets.scm In eq-compat-aconst-to-mr-eq-compat-proof
(pinst (list-transform-positive tpinst pvar-form?))
replaced by
(pinst (list-transform-positive tpinst
		  (lambda (x) (pvar-form? (car x)))))

and also (new-cterm (make-cterm vars mr-fla)) replaced by
(vars (cterm-to-vars cterm))
(var (if (pair? vars)
         (car vars) 
         (myerror
	  "eq-compat-aconst-to-mr-eq-compat-proof: var expected in cterm"
          (cterm-to-string cterm))))
(new-cterm (make-cterm var mr-fla))

proof-to-soundness-proof-aux corrected in case of efq global assumptions.
To this end, efq-ga-to-mr-efq-ga-proof addad.

Discarded code eliminated.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-10-30
ets.scm
In formula-to-et-type-aux
all-form-to-kernel replaced by allnc-form-to-kernel
ex-form-to-kernel replaced by exnc-form-to-kernel

formula-of-nulltype? added
(nulltype? (formula-to-et-type-aux formula pvar-to-tvar)) replaced by
(formula-of-nulltype? formula)

proof.scm pproof.scm atr.scm
(nulltype? (formula-to-et-type formula)) replaced by
(formula-of-nulltype? formula)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-10-23
typ.scm
TYPES-WITH-CANONICAL-INHABITANTS new global variable
make-inhabited implemented.
type-to-canonical-inhabitant adapted; it now works for types
involving type variables as well

ref.tex
In inst-with explanation of x-list corrected

pproof.scm
In inst-with explanation of x-list corrected
In use-with and inst-with error message inserted:
expected order of arguments is types - cterms - rest

proof.scm
In proof-of-stab-at-aux proof-of-stab-log-at-aux
proof-of-efq-at-aux proof-of-efq-log-at-aux
now allnc-form-to-vars used

term.scm
arrow-types-to-rec-const replaced by type-info-to-rec-const
separator-string now adds space between Q^ and a numeric character,
to distinguish an argument from an index

pconst.scm
pconsts of arity zero now normalize as well

psym.scm
enforce nullary constructors in generated algebras for IDs

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-09-30
list.scm

(index-of-first-occurrence x l) added

pconst.scm

constr-name-to-constr adapted to constructor with name "Intro"

imp-formulas-to-rec-const adapted to new
imp-formulas-to-uninst-elim-formulas-etc

ex-formula-to-ex-intro-const simplifies, without set-cdr!

number-and-idpredconst-to-intro-const added

rec-at adapted to the more complex phenomena concerning
free parameters in terms in Elim and Intro axioms.

const-substitute adapted to constructor with name "Intro"

psym.scm

idpredconst-name-and-types-and-cterms-to-idpredconst added

idpredconst-to-pinst simplified

idpredconst-name-to-nbe-alg-name added

idpredconst-name-to-param-pvars added

Change add-ids: use e.g. nbeAcc as alg-name for nbe.  Also, for clause
Zero we use ZeroAcc and OneAcc as constructor names for Acc.  In
addition, there is an optional alg-name (default: the old one with
prefix et) indicating computational content of the idpredconst, for
term extraction.  If it is present, then all clauses with this
idpredconst as conclusion generate constructors; default-name
e.g. EtZeroAcc, EtOneAcc.

number-to-alphabetic-string and alphabetic-string-to-number added
constructor-name-to-i-and-idpredconst-name added
formula-to-nbe-tvars added

formula.scm

nbe-formula-to-type adapted to nbe for idpcs

grammar.scm

When parsing an idpredconst, it should be checked whether the types
and the cterms are correct.  Therefore instead of the constructor
make-idpredconst use idpredconst-name-and-types-and-cterms-to-idpredconst
in grammar

axiom.scm

imp-formulas-to-uninst-elim-formulas-etc changed: allnc xs^ in front
removed.  Reason: nbe needs to ignore these in the rec-at types.  In
aconst-to-formula allnc xs^ is added anyway.

clause-etc-to-strengthened-clause added

number-and-idpredconst-to-intro-aconst changed: no more pinst for idpc-pvars

proof.scm

proof-and-genavar-var-alist-to-pterm and
elim-npterm-and-var-genavar-alist-to-proof adapted

Correction of proof-to-eta-nf in all-intro and allnc-intro cases: the
abstracted variable of the proof term (not the generalized variable of
the proved formula) must be compared.

imp-formulas-to-rec-const adapted t- nbe for ids

pproof.scm

intro slightly simplified
elim adapted and thereby simplified

ets.scm

imp-formulas-to-et-rec-const adapted to new
imp-formulas-to-uninst-elim-formulas-etc


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-08-30
axiom.scm

aconst-substitute-aux adapted to intro-aconsts with repro-data i idpredconst
(plan: rename repro-formulas into repro-data)

ets.scm

imp-formulas-to-et-rec-const changed: Rec now with arrow-types instead
of imp-formulas.  Reason: parameters are not present in ets any more

pproof.scm

In use-with another proof-to-cvars-aux replaced by proof-to-potential-cvars
intro formulated with use instead of use-with
compat-rev-at eq-compat-rev-at adapted to Eq-Compat-Rev-At with allnc

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-08-29
typ.scm

(nulltype? x) introduced, to replace (equal? (make-tconst "nulltype") x)

ets.scm

cases-aconst-to-if-term adapted to allnc in parameters of cases-aconst
proof-to-extracted-term-aux adapted to allnc in parameters of theorems
proof-to-soundness-proof-aux adapted to allnc case
real-and-formula-to-mr-formula-aux adapted to allnc case


pproof.scm

use-with corrected: When interactively developing a partial proof, a
goal v x_1...x_n is replaced by another partial proof, whose context
may contain (1) items from x_1...x_n (i.e. the context of the goal
with v removed), (2) object variables newly introduced at this moment
and (3) new goal variables.

goal-to-admitted-cvars replaced by goal-to-ncvars

context-and-cvars-and-formula-to-formula corrected


proof.scm

proof-to-cvars-aux corrected
proof-to-potential-cvars added, for use-with

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-08-27
ets.scm

all-formulas-to-et-rec-const changed: Rec now with arrow-types instead
of all-formulas.  Reason: parameters are not present in ets any more

number-and-idpredconst-to-et-constr added

pconst.scm

imp-formulas-to-rec-const added, for normalization.  It solves

imp-formulas-to-rec-const       all-formulas-to-rec-const
----------------------------  = ----------------------------
imp-formulas-to-et-rec-const    all-formulas-to-et-rec-const

number-and-idpredconst-to-intro-const added, for normalization.

formula.scm

allnc and exnc added
nbe-formula-to-type adapted to param-cterms in idpredconsts

grammar.scm

     ("allnc" quantor . (lambda (v k) (apply mk-allnc (append v (list k)))))
     ("exnc" quantor . (lambda (v k) (apply mk-exnc (append v (list k)))))
added

axiom.scm

aconst-to-string adapted to intro-aconsts
aconst-to-formula formulated with allnc (i.e., universally generalized
variables in an assumption constant generally have no computational
content).

proof.scm

allnc and exnc added.  proof-to-cvars added
Format of proofs changed: If the optional context is present,
then also the list of computational variables

pproof.scm

computational variables added to proofs

display-num-goal-aux puts braces around non-computational variables

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-08-12
psym.scm (to be renamed into pred.scm)

Inductively defined predicate constants added, from id.scm

Generalities for all kinds of predicated added:
predicate-to-arity predicate-to-cterm predicate-equal?

pconst.scm

rec-const-to-param-types adapted to idpredconsts

typ.scm

RESERVED-NAMES extended by "or" "OrID" "ExID" "EqID".  is-used? adapted

axiom.scm

clause-and-cterm-pvars-and-idpc-pvars-to-strengthened-clause
idpredconst-to-intro-aconst
imp-formulas-to-uninst-elim-formulas-etc
imp-formulas-to-uninst-elim-formula-etc
imp-formulas-to-elim-aconst
added

pproof.scm

(intro i . terms) (elim . opt-terms) added

grammar.scm

idpredconst-name-and-types-and-cterms-to-idpredconst replaced by
make-idpredconst

formula.scm

make-predicate-formula
predicate-form-to-predicate
predicate-form-to-string added

imp-form-to-premises computes the first (car x) premises of a formula.

imp-form-to-final-conclusion computes the final conclusion (conclusion
after removing the first (car x) premises) of a formula. 

all-form-to-vars computes the first (car x) vars of a formula.
all-form-to-final-kernel computes the final kernel (kernel
after removing the first (car x) vars) of a formula. 

or and exid added via inductively defined predicates

formula-to-pvars nbe-formula-to-type formula-substitute-aux 
pvar-cterm-equal? adapted

For parsing and display tokens "or "eqid" "exid" and idpredconst-display
"EqID" added.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-08-09
id.scm

imp-formulas-to-et-rec-const implemented
Interface for IDS cleaned up.
formula-to-et-type-aux corrected for idpredconsts

formula-to-et-type-aux replaced by id-formula-to-et-type-aux
proof-to-extracted-term-aux replaced by id-proof-to-extracted-term-aux
Idea: In a context with inductive definitions, the all quantifier
has no computational content.  Then ind cannot be used any more,
but must be replaced by elim with respect to an inductively defined
predicate e.g. Nat.  Also all quantifiers with computational content
must be replaced by relativizations to Nat.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-08-06
id.scm

Provided as preparation for normalization and program extraction:

allimp-formulas-to-uninst-imp-formulas-and-tpinst
allimp-formulas-to-uninst-imp-formula-and-tpinst
allimp-formulas-to-elim-aconst

Format of idpredconsts changed to ('idpredconst name types cterms)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-08-05
proof.scm

proof-to-eta-nf corrected in case 

          all n^ P n^  n
          --------------
                P n
             ---------
             all n P n

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-08-02

id.scm

Extended to inductive definitions without computational content

grammar.scm

Renamed: pvar -> pred
         pvar-infix -> pred-infix
         predconst -> pred
         predconst-infix -> pred-infix
and similarly for idpredconst.   This leads to some simplifications
in the rules for atomic-formula

formula.scm lnf.tac quant.tac hofmann.tac

predconst-infix -> pred-infix

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-08-01
id.scm

add-ids changed to also allow inductively defined predicate constants
without computational content.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-07-31
pconst.scm

ex-formula-and-concl-to-ex-elim-const reimplemented in a cleaner form
(using two simultaneously defined auxiliary functions, instead of
(set-car! (cdr const) obj))

axiom.scm

In aconst-substitute-aux the final composed-pinst is reduced

ets.scm

Correction of proof-to-extracted-term-aux in cases Stab-Log and Efq-Log

Change of formula-to-et-type-aux : excl and exca initiate a recursive call
on the unfolded formula.

formula.scm

Change of formula-substitute-aux : excl initiates a recursive call
on the unfolded formula provided falsity-log-pvar appears in the domain

proof.scm

proof-to-global-assumptions-with-repetitions and also
proof-to-global-assumptions added.  They completely collect all
used global assumptions, entering recursively into proofs.

atr.scm

Removed the tests on Stab-Log and Efq-Log in min-excl-proof?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-07-29
pproof.scm

More general use-with and inst-with: it now substitutes also for type
variables and predicate variables.

ets.scm

In proof-to-extracted-term-aux the global assumptions Stab-Log and
Efq-Log are first replaced by their proofs, whenever possible.

In min-excl-proof? formula=? used for comparison with falsity-log

atr.scm

Extraction of a program from a classical proof presupposes
(1) the global assumptions Stab-Log, Efq-Log are not used
(2) there are no predicates exept bot and atom
(3) there are no (constructive) existential quantifiers
(4) there is no conjunction &

Ad (1).  In proof-to-extracted-term-aux Stab-Log and Efq-Log are
removed before program extraction is done.  Ad (2)-(4).  It is the
responsibility of the user to only use such proofs.  Error messages
are provided.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-07-24
atr.scm
atr-min-excl-proof-to-structured-extracted-term admits more than one 
existential quantifier

Test min-excl-proof? provided

term.scm
term-to-eta-nf extended to if-terms as well (recall: For a full
normalization of terms, including permutative conversions, we defined
a preprocessing step that eta expands the alternatives of all
if-terms.  The result contains if-terms with ground type alternatives
only.)

Alternative to nbe, if no rewrite rules are applicable.  Uses
term-to-one-step-beta-reduct
term-in-beta-normal-form?
term-to-beta-nf
term-to-beta-pi-eta-nf
bpe-nt

proof.scm
proof-to-aconsts-with-repetitions and proof-to-aconsts provided.
Similarly proof-to-aconsts-without-rules-aux and proof-to-aconsts-without-rules

dickson.tac
Major cleanup.  Contains Berger's variant of nbe-reify, and
preliminary test functions for debugging, e.g.
term-in-rec-normal-form?
term-to-length
term-to-consts-with-repetitions
term-to-consts

term-in-intro-form-to-final-kernels
term-in-elim-form-to-final-op-and-args
term-in-app-form-to-final-op-and-args
term-to-parts-of-level-one
term-to-subterms
term-to-depth

proof-in-intro-form-to-kernel-and-vars
proof-in-intro-form-to-final-kernels
proof-in-elim-form-to-final-op-and-args
proof-to-parts-of-level-one
proof-to-parts
proof-to-depth
proof-to-one-step-beta-reduct
proof-in-beta-normal-form? 
proof-to-beta-nf 
proof-to-beta-pi-eta-nf
bpe-np
proof-to-length

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-07-19
term.scm
Term families reimplemented, with constructor and destructors

pconst.scm
Term families reimplemented, with constructor and destructors

Change of rec-at in reproduction case: build term family from 
application term starting with rec-term

Change of rec-at and alg-name-etc-to-rec-const: additional arguments
uninst-recop-type, inst-recop-type for efficiency reasons

Changed all occurrences of rec-at and alg-name-etc-to-rec-const in
type-info-to-rec-consts all-formulas-to-rec-const const-substitute

[ex-formula-and-concl-to-ex-elim-const cleaned up (with simultaneous letrec))]
Does not yet work

ets.scm
Changed all occurrences of rec-at and alg-name-etc-to-rec-const in
all-formulas-to-et-rec-const
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-06-17
axiom.scm

In all-formula-to-uninst-cases-imp-formula-and-tpinst typo corrected
all-formula -> uninst-all-formula

ets.scm

all-formula-to-mr-cases-proof-aux corrected (and simplified):
all-formula-to-cases-aconst used to construct cases-step-formulas

proof-to-soundness-proof-aux corrected: the given proof is only
reproduced in case on an axiom asserting a formula without
computational content.

all-formulas-to-mr-ind-proof-aux corrected: prem-vars-lists 
(i.e. list of lists of vec{x}'s) must be formed using the number of
argument types of the y-variables

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-06-12
term.scm

term-in-const-form-to-string adapted to type-infos

pconst.scm

arrow-types-or-repro-formulas replaced by type-info-or-repro-formulas
where type-info is a list of f (a positive integer), f parameter types
and then the arrow types.  If there are no parameter types, then
type-info is a list of parameter types.  In case of all-formulas, f is
the total number of their free variables and the parameter types are
their types.

For a cases constant type-info is a list of parameter types followed
by an arrow-type.  Reason: for cases a singla arrow-type or all-formula
is sufficient.

adapted: make-const etc,
nbe-pconst-and-tsubst-and-rules-to-object rec-const-to-param-types
arrow-types-to-rec-consts type-info-to-rec-const
type-info-to-rec-consts alg-name-etc-to-rec-const rec-at
arrow-type-to-uninst-paramless-casesop-type-and-tsubst
arrow-type-to-cases-const param-types-and-arrow-type-to-cases-const

alg-name-etc-to-cases-const cases-at all-formula-to-cases-const
cases-const-to-param-types
const-substitute

grammar.scm

Rec case adapted

axiom.scm

adapted: all-formula-to-cases-aconst
all-formula-to-uninst-cases-imp-formula-and-tpinst
typed-constr-name-to-cases-step-formula

proof.scm

adapted: proof-and-genavar-var-alist-to-pterm
elim-npterm-and-var-genavar-alist-to-proof proof-of-stab-at-aux
proof-of-efq-at-aux 

pproof.scm

inst-with-to  error message inserted in case ? is an argument

adapted: atom-true-proof atom-false-proof efq-atom-proof stab-atom-proof
cases casedist

ets.scm

adapted: all-formulas-to-mr-ind-proof-aux
all-formula-to-mr-cases-proof-aux
proof-to-soundness-proof-aux

mpc.scm

mpc-cases-check adapted

atr.scm

all-formulas-to-c replaced by all-formula-to-c

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done
ets.scm  
type-to-canonical-compat-term corrected
Compat renamed into Eq-Compat
proof-to-extracted-term-aux corrected for Compat and Eq-Compat

pproof.scm  
=-compat-rev-at restricted to finitary algebras.
compat-rev-at	renamed into	 eq-compat-rev-at
=-compat-rev-at	renamed into	 compat-rev-at

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-05-28 
ets.scm  compat-aconst-to-mr-compat-proof implemented
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-05-27
atr.scm  avar-or-aconst... renamed into avar-or-ga...

ets.scm  Implementation of soundness added.
avar-or-aconst... renamed into avar-or-ga...

formula.scm  ex-free-formula? added

pconst.scm  In arrow-types-to-cases-const warning introduced in case it
is applied to more than one arrow-type.

axiom.scm  In all-formulas-to-uninst-imp-formula-and-tpinst error
message concerning `formulas missing for' removed

In all-formulas-to-cases-aconst warning introduced
in case it is applied to more than one all-formula.

In all-formulas-to-uninst-cases-imp-formula-and-tpinst error
message concerning `no flas for' removed

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Done 02-05-24
term.scm:  term-in-const-form-to-string adapted to new treatment
of Rec and Cases

list.scm: zip included
(zip '(1 3 5 ) '(2 4 6 )) => (1 2 3 4 5 6)

pconst.scm: 
arrow-types-to-rec-consts, param-and-arrow-types-to-rec-consts and
arrow-types-to-uninst-paramless-recop-types-and-tsubst (plural instead
of singular) introduced.

In arrow-types-to-uninst-paramless-recop-types-and-tsubst
error message "arrow types missing for" removed.  Reason: Simplified
type of recursion operator (in case of simultaneous recursion) allowed.

; New for Cases (as for Rec)
arrow-types-to-uninst-paramless-casesop-types-and-tsubst
constructor-type-to-cases-step-type (no change)
arrow-types-to-cases-const
arrow-types-to-cases-consts
param-and-arrow-types-to-cases-const
param-and-arrow-types-to-cases-consts
uninst-casesop-type-etc-to-cases-const (no change)
cases-at (no change)
all-formulas-to-cases-const (no change)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proof.scm: proof-substitute-aux corrected: extend-subst replaced by
compose-o-substitutions, to do overwriting (in case all-intro) as
intended.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
done 02-05-07
axiom.scm

In assumption constants: type and predicate variables considered to be
bound.  aconst-to-inst-formula simplified: the internal type
substitution is not applied to the cterms.

aconst-substitute-aux and theorem-aconst-to-inst-proof generalized
accordingly.

psubst renamed into pinst (e.g. in 
all-formulas-to-uninst-cases-imp-formula-and-tpinst

ets.scm

ind-aconst-to-et-rec-const cases-aconst-to-if-term adapted
Initial steps towards giving an internal proof of correctness.

pconst.scm

  all-formulas-to-rec-const changed accordingly

pproof.scm

  aconst-substitute-aux replaced by explicit pinst in
  exc-formula-and-measure-to-min-pr-aconst
  exc-formula-to-exc-intro-aconst
  exc-formula-and-concl-to-exc-elim-aconst

  compat-rev-at and simpeq corrected

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pconst.scm

  pconst-name-and-tsubst-to-object changed: if tsubst in unknown to pconst,
  this is not an error, but pconst is updated using const-substitute

~/minlog/lib/list.scm

  lh replaced by Lh (pconst names should be capitalized)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
count.tac 
  
  use of simp corrected

wf.tac  

  Now uses by-assume-with intead of ex-elim

pproof.scm 

  by-assume-with added, to make the use of existential hypotheses more
  intuitive.

  simp corrected: test (term-in-const-form? op) added

proof.scm 

  permutative conversions for Ex-Elim added

term.scm 

  permutative conversions for if-terms added

  typo in match-aux corrected: args -> alts

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
done 02-03-18:

log root.save root.tac adapted

log wftest.tac adapted

log axiom.scm
Corrected form of aconst-to-formula, which now applies 
formula-substitute-aux without violating the condition that psubst
should not concern pvars whose type is affected by tsubst.
To construct the formula associated with an aconst, it is useful to
separate the instantiated formula from the variables to be
generalized.  The latter can be obtained as free variables in
inst-formula.

log ets.scm  proof-to-extracted-term-aux corrected in theorem case

log axiom.scm theorem-aconst-to-inst-proof added

log formula.scm formula-substitute-aux changed in quantifier case

log term.scm term-substitute-aux changed in var and abstr case

For a full normalization of terms, including permutative conversions,
we define a preprocessing step that eta expands the alternatives of
all if-terms.  The result contains if-terme with ground type
alternatives only.

log proof.scm proof-substitute-aux corrected

reduce-efq-and-stab aconst case corrected

(expand-theorems proof) expands all theorems recursively.
(expand-theorems proof name-test?) expands (non-recursively) the
theorems passing the test by instances of their saved proofs.

context-item=? added.  proof-to-context corrected

proof-to-eta-nf in all-elim term-to-eta-nf for arg inserted

proof-to-aconsts added

For a full normalization of proofs, including permutative conversions,
we define a preprocessing step that eta expands each ex-elim axiom
such that the conclusion is atomic or existential.

Section 10-7. Existence elimination added.  In case of an ex-formulas
ex xs1 A1 ... ex xsn An and conclusion B we recursively construct a
proof of

ex xs1 A1 -> ... -> ex xsn An -> (all xs1,...,xsn.A1 -> ... -> An -> B) -> B.

Call a formula E essentially existential, if it can be transformed
into an existential form.  Inductive definition:

E ::= ex x A | A & E | E & A | decidable -> E (postponed)

We want to replace an implication with an essentially existential
premise by a formula with one existential quantifier less.
Application: search.  Given a formula A, reduce it to A* by
eliminationg as many existential quantifiers as possible.  Then search
for a proof of A*.  Since a proof of A* -> A can be contructed easily,
one obtains a proof of A.

log pproof.scm To simplify search when existential formulas are
present, we may use searchex, involving the procedures
formula-to-ex-red-formula and
formula-to-proof-of-ex-red-formula-imp-formula

log minpr.scm (theorem-name-to-proof "Cv-Ind") replaced by
(make-proof-in-aconst-form (theorem-name-to-aconst "Cv-Ind"))

log tvartest.scm  
Tests related to the (integrated) searchex.scm added, written 02-02 (Luminy)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

proof.scm
  proof-to-eta-nf: oversight corrected in all-elim case
  expand-theorems: in aconst case free variables (after subst) generalized
  cdp: check of types and t-degs in case all-elim added

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
done 02-02-24

axiom.scm
  typos corrected
  Optional eterms in theorems and global assumptions removed

ets.scm
  proof-to-extracted-term-aux: theorem case corrected.  There is no more
  need to store extracted terms of theorems.  Their type variables are
  difficult to handle, and it is much easier to use proof-subst.

  Global assumptions are handled as if they were assumption variables.
  Via make-avar-or-aconst-to-var we assign object variables to them.

lnf.scm
  extended to quantifier logic: proceed

lnf.tac
  now contains tests for proceed

pproof.scm 
  use corrected.  It now employs the auxiliary function
  formula-and-sig-vars-and-goal-to-subst-and-x-list-and-vars.  Change
  of formula-and-sig-vars-and-goal-to-subst-and-x-list-and-vars into
  formula-and-sig-vars-and-goal-to-subst-and-xs-and-vars, which now
  carries along the given x as its first argument.

  Change of use, use-with and inst-with.  Also in case of theorems
  (and not only global assumptions) whose final conclusion is a
  nullary predicate variable distinct from bot (e.g. Efq-Log or
  Stab-Log), this predicate variable is substituted by the goal
  formula.

  inst-with-to expects a string as its last argument, which is used (via
  name-hyp) to name the newly introduced instantiated hypothesis.

term.scm
  match corrected in case of different predicate symbols

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
done 02-02-20
axiom.scm
  avar=? made more efficient.
  formula-to-new-avar now has the name as an optional argument

proof.scm 
  optional context entry allowed in proofs (for efficiency reasons 
    when dealing with goals)
  In proof-to-eta-nf:
    (member avar context) replaced by (member-wrt avar=? avar context)
  formula-and-flex-and-goal-to-subst-and-x-list renamed into
    formula-and-sig-vars-and-goal-to-subst-and-x-list.  It now uses match
    instead of pattern-unify
  proof-to-expr uses avar names and indices
  DEFAULT-AVAR-NAME changed from "Hyp" to "u"
  A very primitive form check-and-display-proof added: only checks whether
    imp-elims are applied with correct formulas

pproof.scm
  use: formulas are tried in original as well as in normalized form.
  set-goal, assume, split now use formula-to-new-avar to guarantee new avars
  goals must contain the context now (for efficiency reasons).
    Changed accordingly: assume, use-with, inst-with, split,
    normalize-goal
  add-hypname-info corrected
  In cases: error message in case the argument is a string

typ.scm 
  type-match corrected

term.scm  
  match corrected and extended
  pattern-unify extended to if-terms
  In match-aux the application clause is corrected

  nbe-term-to-object corrected and extended.  We now have
  (term-to-string (nt (pt "[if boole True False]")))
  ; "boole"
  (term-to-string (nt (pt "[if nat 0 Succ]")))
  ; "nat"
  (term-to-string (nt (pt "[if nat 0 ([m]Succ m]"))))
  ; "nat"
  (term-to-string (nt (pt "[if nat 0 ([m]0)]")))
  ; 0

tvartest.scm  tests for type-match and match included

examples/dijkstra/count.tac added.  Proves (10) and (11) in [BS99].

Still to do:

inst-with sollte ein optionales Argument hyp-name bekommen

In search: preprocessing to eliminate superfluous existential quantifiers
