Abstraction Logic is introduced as a foundation for Practical Types [1] and Practal [2]. It combines the simplicity of first-order logic with direct support for variable binding constants called abstractions. It also allows free variables to depend on parameters, which means that first-order axiom schemata can be encoded as simple axioms. Conceptually abstraction logic is situated between first-order logic and second-order logic. It is sound with respect to an intuitive and simple algebraic semantics. Completeness holds for both intuitionistic and classical abstraction logic, and all abstraction logics in between and beyond.
Introduction
The goal of Practical Types[1] is to provide a foundation for formal machine-assisted reasoning that anyone would find empowering who is interested in rigorous thinking and design. This paper provides a foundation on which Practical Types will be built as a particular class of abstraction logics.
Like first-order logic, abstraction logic has a single universe of discourse, i.e. it is one-sorted. It goes even further than ordinary first-order logic in that truth values are part of this universe, i.e. the universe forms a Fregean domain[3].
Like higher-order logic and type theory, abstraction logic provides built-in support for variable binding constructs. But variable binding is not achieved indirectly via a function sort or type; instead it is directly modelled via shape specifications for (possibly) variable binding constructs called abstractions. Abstractions are simply the constants of abstraction logic. As a consequence α-equivalence of terms is a central concept in abstraction logic, but β/η-conversion do not play any role at this level.
Free variables can depend on parameters. Thus where first-order logic needs axiom schemata consisting of infinitely many axioms, abstraction logic can express the same with a single axiom, just like higher-order logic. This is illustrated multiple times when we present several concrete abstraction logics →.
Although abstraction logic started out as an investigation into the logic of Practical Types, it will be important for the design of Practal [2] in its own right. The relationship between Practal, Practical Types and abstraction logic is similar to the relationship between the Isabelle System [4] and its logics HOL and Pure. Locales[5] are an important mechanism for modular reasoning in Isabelle built on top of Pure. Because abstraction logic is simpler than type theory, but at the same time more versatile, the same should be true for an abstraction logic mechanism for modular reasoning inspired by locales.
The relationship between Practical Types and abstraction logic can also be compared to the relationship between set theory and first-order logic. Similarly, abstraction logic is not limited to Practical Types, it can provide a foundation for many applications where currently first-order logic is used. Furthermore, abstraction logic can be applied in places where previously higher-order logic was needed, as in the realm of interactive theorem proving.
We write ⟨i0,…,in−1⟩ where i0<i1<…<in−1 for the set {i0,…,in−1}.
We write U→V for the set of functions from set U to set V.
We write U↪V for the set of partial functions from set U to set V.
The function idU:U→U denotes the identity on U.
We write U×V for the cartesian product of the sets U and V.
We define Un for n∈N, n≥1 via U1=U and Um+1=Um×U for m≥1.
We write ∣p∣ for the size of the finite set p.
For f:U→V, distinct x0,…,xn−1, and arbitrary v0,…,vn−1 in V, we write f[x0:=v0,…,xn−1:=vn−1] for the function g:U∪{x0,…,xn−1}→V defined via g(u)={vif(u)ifu=xiifu∈/{x0,…,xn−1}
Instead of f[xi0:=v[i0],…,xin−1:=v[in−1]] we also write f[xp:=v[p]] where p=⟨i0,…,in−1⟩ and v[x] stands for an arbitrary expression depending on x.
Algebra
A shapeσ prescribes a number m of binders and a number n of parameters. Furthermore it assigns to each parameter the set of binders it depends on. A shape is therefore written as (m;p0,…,pn−1) where m,n∈N, and each pi is a subset of m. Furthermore we require that there are no superfluous binders: i=0⋃n−1pi=m We call m the valence of the shape, and n its arity. Above condition implies that a shape with arity 0 necessarily has valence 0. It also implies that for a unary shape its sole parameter will depend on all binders.
An abstraction signatureS=(a0:σ0,…,ak−1:σk−1) is a list of k different abstractionsai, where each abstraction ai is associated with its shape σi.
An abstraction algebraA=(U;I;S) is a non-empty set U together with an abstraction signature S and an interpretationI which interprets an abstraction ai as an element I(ai) of the set ΛU(σi). The set ΛU(σi) will be defined shortly.
Examples of abstractions and their shapes are:
Equalityx=y has two parameters x and y and no binders. The shape of equality is therefore σ==(0;{},{}).
Universal quantification∀x.P[x] has one binder x and one parameter P, which depends on x. The shape of universal quantification is σ∀=(1;{0}).
Function abstractionλx:T.A[x] has one binder x and two parameters T and A. The parameter T does not depend on x, but A does. The shape of function abstraction is therefore σλ=(1;{},{0}).
We require an abstraction a of shape σ to be an element of ΛU(σ). We define ΛU(σ) for σ=(m;p0,…,pn−1) as follows: ΛU(σ)={UFmp0(U)×…×Fmpn−1(U)→Uifn=0ifn≥1 Here, for m≥1 and p⊆m, we define Fmp(U) as follows: Fmp(U)={U{f∘πmp(U)∣f∈U∣p∣→U}⊆Um→Uifp=∅ifp=∅ The projectionsπmp(U):Um→U∣p∣ are defined for p=⟨i0,…,in−1⟩ via (u0,…,um−1)↦(ui0,…,uin−1)
In particular, if the valence of σ is 0 and its arity n, then ΛU(σ)={UUn→Uifn=0ifn=0
Note that an abstract algebra as described by Rasiowa [6] (see also [7], [8] →) is thus simply an abstraction algebra where all abstractions have zero valence.
If the valence of σ is 1, then ΛU(σ)=F1p0(U)×…×F1pn−1(U)→U, where F1pi(U) is either U or U→U, depending on whether pi=∅ or pi={0}, respectively.
Continuing our previous examples, we can now say the following:
The interpretation of = is a function in U×U→U.
The interpretation of ∀ is a function in (U→U)→U.
The interpretation of λ is a function in U×(U→U)→U.
Bounded universal quantification∀x:T.P[x] has shape (1;{},{0}), and is therefore interpreted as an element of U×(U→U)→U.
Another example is defined by funeqx.Tf[x]g[x]=def∀x:T.f[x]=g[x] The shape of funeq is (1;{},{0},{0}), and therefore funeq:U×(U→U)×(U→U)→U
Syntax
Given an abstraction signature S=(a0:σ0,…,ak−1:σk−1) and a set of variablesX, we define the set TX(S) of terms over S. We require variables and abstractions not to overlap, of course, i.e. ai∈/X for all i∈k. We also require each variable x∈X to be associated with a fixed arity xarity∈N.
The set TX(S) of terms is then defined inductively as follows:
Given a variable x and terms t0,…,txarity−1, x[t0,…,txarity−1] is a term. We also write just x instead of x[].
Given an abstraction a of valence m and arity n, terms t0,…,tn−1, and distinct variables x0,…,xm−1 such that (xi)arity=0 for all i∈m, (ax0…xm−1.t0…tn−1) is also a term.
Note that with this definition all terms in TX(S) are wellformed, although the definition makes only use of the valence and arity of an abstraction instead of its full shape. Of course, the full shape is important: it is needed to determine the free variablesFree(t) of a term t∈TX(S). We define Free(t) recursively, following the inductive definition of TX(S): Free(x[t0,…,txarity−1])Free((ax0…xm−1.t0…tn−1))=={x}∪Free(t0)∪…∪Free(txarity−1)∪(Free(t0)∖{xi0,0,…,xi0,∣p0∣−1})∪(Free(t1)∖{xi1,0,…,xi1,∣p1∣−1})⋮∪(Free(tn−1)∖{xin−1,0,…,xin−1,∣pn−1∣−1})whereσa=(m;p0,…,pn−1)andpj=⟨ij,0,…,ij,∣pj∣−1⟩∀j∈n In case of Free(t)=∅, the term t is called closed.
The following table examines our previous examples in terms of abstraction syntax: concrete syntaxx=y∀x.P[x]λx:T.A[x]∀x:T.P[x]funeqx.Tf[x]g[x]∀x:T.f[x]=g[x]abstraction syntax(=.xy)(∀x.P[x])(λx.TA[x])(∀x.TP[x])(funeqx.Tf[x]g[x])(∀x.T(=.f[x]g[x]))free variablesx,yPT,AT,PT,f,gT,f,g Note that x is a free variable of the expression λx:x.x Although the variable x is bound in the second parameter of λ, it occurs free in the first parameter of λ, and is therefore a free variable of the entire expression.
Semantics
Given a set F of variables, and a set U, a valuationν of F in U is a mapping that assigns to each x∈F with xarity=0 an element ν(x)∈U, and to each x∈F with xarity≥1 a function ν(x)∈Uxarity→U. We denote the set of valuations of F in U by VAL(F,U).
Let S be an abstraction signature, and A=(U;I;S) an abstraction algebra with signature S. Given a term t∈TX(S), any valuation ν of Free(t) in U determines an element ν[[t]]∈U, recursively defined as follows:
If t=x[t0,…,txarity−1], then x∈Free(t), and Free(ti)⊆Free(t) for all i∈xarity. Thus we set ν[[t]]={ν(x)ν(x)(ν[[t0]],…,ν[[txarity−1]])ifxarity=0ifxarity≥1
If t=(a.t0…tn−1) for an abstraction a with zero valence and arity n, we set ν[[t]]={I(a)I(a)(ν[[t0]],…,ν[[tn−1]])ifn=0ifn≥1
Assume now t=(ax0…xm−1.t0…tn−1) for an abstraction a with valence m≥1 and arity n≥1, and of shape σa=(m;p0,…,pn−1). Let us consider a fixed i∈n, and let pi=⟨j0,…,jk−1⟩⊆m. We have Free(ti)⊆Free(t)∪{xj0,…,xjk−1} Therefore, for any (u0,…,um−1)∈Um, the valuation μi=ν[xj0:=uj0,…,xjk−1:=ujk−1] determines a value μi[[ti]]∈U. Defining fi:Um→U by fi:(u0,…,um−1)↦μi[[ti]] it is obvious that fi∈Fmpi(U). Consequently, we set ν[[t]]=I(a)(f0,…,fn−1)
If t is a closed term, then ν[[t]] is independent of the choice of the valuation ν in U, and we can therefore define [[t]]A=ν[[t]]
De Bruijn Terms
Terms TX(S) provide an adequate user interface for humans, but are awkward to handle from a technical point of view. This becomes apparent when formulating more complex operations on terms, like substitution. One reason for this awkwardness is the potential of clashes between bound variables and free variables. Another reason is that two terms which are semantically equivalent, like (ax.x) and (ay.y), can nevertheless be syntactically different because of different choices for the names of bound variables.
In actual software implementations of logic, a common approach to deal with this problem is called locally nameless[9]. The following definitions are inspired by this approach. We first define de Bruijn pretermsBXpre(S):
For any n∈N, ↑n is a de Bruijn preterm. We implicitly assume everywhere that ↑n∈/X. Given a set N⊂N we write ↑N for the set {↑n∣n∈N}.
Given a variable x∈X and de Bruijn preterms t0,…,txarity−1, x[t0,…,txarity−1] is a de Bruijn preterm. We also write just x instead of x[].
Given an abstraction a of arity n, and de Bruijn preterms t0,…,tn−1, (at0…tn−1) is also a de Bruijn preterm.
The idea is that a term like (axy.(b.xy)(cx.xy)) corresponds to the de Bruijn term (a(b↑0↑1)(c↑0↑2))
This correspondence is made precise by the mapping α:TX(S)→BXpre(S) Let X0={x∈X∣xarity=0}. To define α, we first define a function α′:TX(S)×(X0↪N)→BXpre(S) which keeps track of the current mapping of bound variables to de Bruijn indices: α′(x[t0,…,tn−1],η)α′(x,η)α′((ax0…xm−1.t0…tn−1),η)where the shape ofaand for all i∈n,ti′=====x[α′(t0,η),…,α′(tn−1,η)]ifηis undefined atx↑η(x)ifηis defined atx(at0′…tn−1′)(m;p0,…,pn−1)α′(ti,(η+m)[xpi:=pi]) For any partial function f:U↪N and any m∈N we define f′=f+m in the obvious way such that f′(u)=f(u)+m holds if f is defined at u∈U.
Then we can define α by α(t)=α′(t,∅)
Of particular interest are those elements of BXpre(S) that are in the image of α. We are also interested in (part of) the image of α′: BXh(S)BX(S)=={α′(t,η)∣(t,η)∈TX(S)×(X0↪h)}⋃h=0∞BXh(S) The image of α therefore is BX0(S). We call BX(S) the set of de Bruijn terms, and BXh(S) is the set of de Bruijn terms with at most hholes.
Instead of defining de Bruijn terms indirectly via α′, it is easy to carve them out of de Bruijn preterms in a more direct fashion. For that we need the notion of free atomsFreeAtoms(t) of a de Bruijn preterm t∈BXpre(S): FreeAtoms(t)FreeAtomsl(↑n)FreeAtomsl(x[t0,…,tn−1])FreeAtomsl((at0…tn−1))====FreeAtoms0(t){∅{n−l}ifn<lifn≥l{x}∪⋃i=0n−1FreeAtomsl(ti)⋃i=0n−1FreeAtomsl+m(ti)wheremis the valence ofa
De Bruijn terms BX(S) are then those de Bruijn preterms t such that for every subpreterm of t of the form (at0…tn−1) the inclusion FreeAtoms(ti)∩↑m⊆↑pi holds for all i∈n. Here the shape of a is (m;p0,…,pn−1).
Note that an immediate consequence of this characterisation is that every subterm of a de Bruijn term is also a de Bruijn term.
Furthermore, note that BXh(S)={t∈BX(S)∣FreeAtoms(t)∩↑N⊆↑h}
α-Equivalence
We say that two terms s and t in TX(S) are α-equivalent iff α(s)=α(t)
The importance of α-equivalence stems from the fact that it is the same as semantical equivalence. We call s and t in TX(S)semantically equivalent iff for any abstraction algebra (U;I;S), and for any valuation ν∈VAL(X,U), we have ν(s)=ν(t).
We first show that α-equivalence implies semantical equivalence.
To this end, we define valuations also on de Bruijn terms. Given a set F of variables and a subset N of N, a de Bruijn valuationν of F∪↑N in U is a mapping such that ν is a valuation of F in U, and additionally, ν assigns to each ↑n an element ν(↑n)∈U for all n∈N.
Any valuation ν of FreeAtoms(t) in U determines an element ν[[t]]∈U: ν[[↑n]]ν[[x[t0,…,tn−1]]]ν[[(at0…tn−1)]]ν[[(at0…tn−1)]]wherefi(u0,…,um−1)=====ν(↑n)ν(x)(ν[[t0]],…,ν[[tn−1]])I(a)(ν[[t0]],…,ν[[tn−1]])if the valence ofais0I′(a)(f0,…,fn−1)if the valence ofaism≥1↑m(ν)[↑0:=u0,…,↑(m−1):=um−1][[ti]]for all(u0,…,um−1)∈Um
Here I′ is a slight modification of the interpretation I in that where I(a) expects an element e∈U as one of its arguments, I′(a) will accept a constant function (u0,…,um−1)↦e instead. Otherwise, I′ and I are identical.
The valuation ↑m(ν) is derived from ν via ↑m(ν)(x)↑m(ν)(↑(m+n))==ν(x)ν(↑n)wherex∈Xwheren∈N In the above the left hand sides are defined iff the right hand sides are defined.
It is not immediately obvious that ν[[(at0…tn−1)]] is well-defined, because in order to be able to apply I′(a) to (f0,…,fn−1), the fi cannot be just any functions in Um→U. Assuming that the shape of a is (m;p0,…,pn−1), if pi=∅, fi must be a constant function, and for pi=∅, fi needs to be in Fmpi(U). But this is easily seen to be the case, given that ν′[[t]]=ν[[t]] only holds if ν′ and ν have a different assignment for some q∈FreeAtoms(t), and according to our earlier observation →, FreeAtoms(ti)∩↑m⊆↑pi.
Given a valuation ν∈VAL(X,U), together with an injective function η:X0↪N, the corresponding de Bruijn valuation νη is defined as νη(x)νη(↑n)==ν(x)ν(x)wherex∈Xwhereη(x)=n We prove that for any term t∈TX(S), any valuation ν∈VAL(X,U), and any injective η:X0↪N, we have νη[[α′(t,η)]]=ν[[t]]
The proof is by induction over t:
Assume t=x[t0,…,tn−1]. Then ν[[t]]=ν(x)(ν[[t0]],…,ν[[tn−1]]).
If η is undefined at x then t′=α′(t,η)=x[α′(t0,η),…,α′(tn−1,η)] and furthermore, νη[[t′]]===ν(x)(νη[[α′(t0,η)]],…,νη[[α′(tn−1,η)]])ν(x)(ν[[t0]],…,ν[[tn−1]])ν[[t]]
If η is defined at x then n=0 and t′=α′(t,η)=↑η(x). Thus νη[[t′]]=νη(↑η(x))=ν(x)=ν[[t]]
Assume t=(ax0…xm−1.t0…tn−1), and that the shape of a is (m;p0,…,pn−1). Then ν[[t]]=I′(a)(f0,…,fn−1), where fi(u0,…,um−1)=ν[xpi:=upi][[ti]] Here I′ denotes the same interpretation modification as before →.
On the other hand, t′=α′(t,η)=(at0′…tn−1′), where ti′=α′(ti,(η+m)[xpi:=pi]) Then νη[[t′]]=νη[[(at0′…tn−1′)]]=I′(a)(f0′,…,fn−1′) where fi′(u0,…,un−1)=↑m(νη)[↑0:=u0,…,↑(m−1):=um−1][[ti′]] It remains to show that fi=fi′ holds for all i∈n.
Let ξ=(η+m)[xpi:=pi]. Clearly, ξ is injective. Then μξ[[ti′]]=μξ[[α′(ti,ξ)]]=μ[[ti]] holds for any valuation μ:X→U, in particular μ=ν[xpi:=upi]. Thus fi(u0,…,un−1)====ν[xpi:=upi][[ti]]ν[xpi:=upi]ξ[[ti′]]↑m(νη)[↑0:=u0,…,↑(m−1):=um−1][[ti′]]fi′(u0,…,un−1) if we can show L(q)=R(q) for all q∈FreeAtoms(ti′), where LandR==ν[xpi:=upi]ξ↑m(νη)[↑0:=u0,…,↑(m−1):=um−1]
We show this by case distinction:
Assume x∈X. We can furthermore assume x=xk for all k∈pi, because xk∈/FreeAtoms(ti′). Then L(x)=ν(x)=R(x).
Assume i∈m. We can assume i∈pi, because otherwise ↑i∈/FreeAtoms(ti′). Then L(↑i)=ν[xpi:=upi](x) where ξ(x)=i, which implies x=xi. Thus L(↑i)=ν[xpi:=upi](xi)=ui=R(↑i).
Assume i∈N∖m. Then L(↑i)=ν[xpi:=upi](x) where ξ(x)=i, which implies (η+m)(x)=i, and thus η(x)=i−m and x=xk for all k∈pi. Thus L(↑i)=ν(x) where η(x)=i−m. On the other hand, R(↑i)=↑m(νη)(↑i)=νη(↑(i−m))=ν(y) where η(y)=i−m. From the injectivity of η it follows that L(↑i)=ν(y)=R(↑i).
In particular, for t∈TX(S) and ν∈VAL(X,U): ν[[α(t)]]=ν[[t]] An immediate consequence is that α-equivalence implies semantical equivalence: Let s and t be α-equivalent terms in TX(S), i.e. α(s)=α(t). Then for all valuations ν∈VAL(X,U), we have ν[[s]]=ν[[α(s)]]=ν[[α(t)]]=ν[[t]]
Substitution
Before showing that semantical equivalence implies α-equivalence in the next section →, we will first consider how to perform substitution of (some of) the free atoms in a de Bruijn term.
A substitution is a function σ:D→BX(S) with domainD⊆X∪↑N. Application t/σ of a substitution σ:D→BX(S) to a de Bruijn term t∈BX(S) is recursively defined as follows: ↑n/σ↑n/σx[t0,…,tn−1]/σx[t0,…,tn−1]/σ(at0…tn−1)/σ=====σ(↑n)if↑nis in the domain ofσ↑nif↑nis not in the domain ofσ(σ(x)/∅[↑0:=t0′,…,↑(n−1):=tn−1′])−nifxis in the domain ofσ;here∅denotes the empty substitution,andti′=(ti/σ)+nx[t0/σ,…,tn−1/σ]ifxis not in the domain ofσ(at0′…tn−1′)whereti′=ti/↑m(σ),given the valence ofaism In the above definition we used the expression t+z for t∈BX(S) and z∈Z. This expression is only defined if for all ↑n∈FreeAtoms(t), we have n+z≥0. Then: t+z↑n+lz↑n+lzx[t0,…,tn−1]+lz(at0…tn−1)+lz=====t+0z↑n↑(n+z)x[t0+lz,…,tn−1+lz](a(t0+l+mz)…(tn−1+l+mz))where the valence ofaismifn<lifn≥l
Furthermore, we define ↑m(σ) for a substitution σ:D→BX(S) and m∈N by ↑m(σ)(x)↑m(σ)(↑(m+n))==σ(x)+xaritymσ(↑n)+mforx∈X∩Dfor↑n∈D Then ↑m(σ) is a substitution with domain (X∩D)∪{↑(m+n)∣↑n∈D}.
We define the free atoms of a substitutionσ:D→BX(S) by FreeAtoms(σ)=∪⋃↑n∈DFreeAtoms(σ(↑n))⋃x∈D∩X{q−xarity∣q∈FreeAtoms(σ(x))∖xarity)}
We call a substitution σ:D→BX(S)regular if FreeAtoms(σ)⊆X.
For regular σ we have σ(x)∈BXxarity(S) for all x∈D∩X and σ(↑n)∈BX0(S) for all ↑n∈D.
Note that if σ is regular, then ↑m(σ) is regular, too.
Given a de Bruijn valuation ν of F in U, any regular substitution σ:D→BX(S) with FreeAtoms(σ)⊆F induces a de Bruijn valuation νσ of F∪D in U via νσ(q)νσ(↑n)νσ(x)νσ(x)====ν(q)ifq∈F∖Dν[[σ(↑n)]]if↑n∈Dν[[σ(x)]]ifx∈D∩X0(u0,…,un−1)↦ν[↑0:=u0,…,↑(n−1):=un−1][[σ(x)]]ifx∈D∩Xand wherexarity=n>0
The following holds for any t∈BX(S) with FreeAtoms(t)⊆F∪D: ν[[t/σ]]=νσ[[t]] We prove this by induction on t:
Assume t=↑n. If ↑n∈F∖D, then νσ[[t]]=νσ[[↑n]]=ν(↑n)=ν[[↑n]]=ν[[↑n/σ]]=ν[[t/σ]] If ↑n∈D, then νσ[[t]]=νσ[[↑n]]=ν[[σ(↑n)]]=ν[[↑n/σ]]=ν[[t/σ]]
Assume t=x∈X0. If x∈F∖D, then νσ[[t]]=νσ[[x]]=ν(x)=ν[[x]]=ν[[x/σ]]=ν[[t/σ]] If x∈D, then νσ[[t]]=νσ[[x]]=ν[[σ(x)]]=ν[[x/σ]]=ν[[t/σ]]
Assume t=x[t0,…,tn−1] for n>0. If x∈F∖D, then νσ[[t]]=νσ[[x[t0,…,tn−1]]]=νσ(x)(νσ[[t0]],…,νσ[[tn−1]])=ν(x)(ν[[t0/σ]],…,ν[[tn−1/σ]])=ν[[x[t0/σ,…,tn−1/σ]]]=ν[[x[t0,…,tn−1]/σ]]=ν[[t/σ]] If x∈D, then νσ[[t]]=νσ[[x[t0,…,tn−1]]]=νσ(x)(νσ[[t0]],…,νσ[[tn−1]])=ν[↑0:=ν[[t0/σ]],…,↑(n−1):=ν[[tn−1/σ]]][[σ(x)]]=ν[[(σ(x)/∅[↑0:=(t0/σ),…,↑(n−1):=(tn−1/σ)])]]=ν[[x[t0,…,tn−1]/σ]]=ν[[t/σ]]
Assume t=(at0…tn−1) where the valence of a is m. Then νσ[[t]]=νσ[[(at0…tn−1)]]=I′(a)(f0,…,fn−1)wherefi(u0,…,um−1)=↑m(νσ)[↑0:=u0,…,↑(m−1):=um−1][[ti]]=I′(a)(g0,…,gn−1)wheregi(u0,…,um−1)=↑m(ν)[↑0:=u0,…,↑(m−1):=um−1][[(ti/↑m(σ))]]=ν[[(a(t0/↑m(σ))…(tn−1/↑m(σ)))]]=ν[[(at0…tn−1)/σ]]=ν[[t/σ]]
We need to show fi(u0,…,um−1)=gi(u0,…,um−1): gi(u0,…,um−1)=↑m(ν)[↑0:=u0,…,↑(m−1):=um−1][[(ti/↑m(σ))]]=(↑m(ν)[↑0:=u0,…,↑(m−1):=um−1])↑m(σ)[[ti]]=ζ[[ti]]whereζ=(↑m(ν)[↑0:=u0,…,↑(m−1):=um−1])↑m(σ)=ξ[[ti]]whereξ=↑m(νσ)[↑0:=u0,…,↑(m−1):=um−1]=↑m(νσ)[↑0:=u0,…,↑(m−1):=um−1][[ti]]=fi(u0,…,um−1)
Finally, we need to prove that the two valuations ζ and ξ are the same for ti. We do this by case analysis of q∈FreeAtoms(ti) in the equation ζ(q)=ξ(q):
Assume q=x∈X and x∈F∖D. Then ζ(x)=ν(x)=νσ(x)=ξ(x)
Assume q=x∈X0 and x∈D. Then ζ(x)=(↑m(ν)[↑0:=u0,…,↑(m−1):=um−1])[[↑m(σ)(x)]]=(↑m(ν)[↑0:=u0,…,↑(m−1):=um−1])[[σ(x)+m]]=(↑m(ν))[[σ(x)+m]]=ν[[σ(x)]]=νσ(x)=ξ(x)
Assume q=x∈X∖X0 and x∈D. Let r=xarity. Then ζ(x)(w0,…,wr−1)=(↑m(ν)[↑0:=u0,…,↑(m−1):=um−1])↑m(σ)(x)(w0,…,wr−1)=ρ[↑0:=w0,…,↑(r−1):=wr−1][[↑m(σ)(x)]]whereρ=↑m(ν)[↑0:=u0,…,↑(m−1):=um−1]=ρ[↑0:=w0,…,↑(r−1):=wr−1][[σ(x)+rm]]=ρ[↑0:=w0,…,↑(r−1):=wr−1][[σ(x)]]=ν[↑0:=w0,…,↑(r−1):=wr−1][[σ(x)]]=νσ(x)(w0,…,wr−1)=(↑m(νσ))(x)(w0,…,wr−1)=ξ(x)(w0,…,wr−1) Note that the regularity of σ is of crucial importance for this case.
Assume q=↑k for k<m. Then ζ(↑k)=(↑m(ν)[↑0:=u0,…,↑(m−1):=um−1])↑m(σ)(↑k)=(↑m(ν)[↑0:=u0,…,↑(m−1):=um−1])(↑k)=uk=↑m(νσ)[↑0:=u0,…,↑(m−1):=um−1](↑k)=ξ(↑k)
Assume q=↑k for k≥m. Because of ↑k∈FreeAtoms(ti) we know ↑(k−m)∈F∪D
For ↑(k−m)∈D follows: ζ(↑k)=(↑m(ν)[↑0:=u0,…,↑(m−1):=um−1])↑m(σ)(↑k)=↑m(ν)[↑0:=u0,…,↑(m−1):=um−1][[↑m(σ)(↑k)]]=↑m(ν)[↑0:=u0,…,↑(m−1):=um−1][[σ(↑(k−m))+m]]=↑m(ν)[[σ(↑(k−m))+m]]=ν[[σ(↑(k−m))]]=νσ(↑(k−m))=↑m(νσ)(↑k)=↑m(νσ)[↑0:=u0,…,↑(m−1):=um−1](↑k)=ξ(↑k)
For ↑(k−m)∈F∖D follows: ζ(↑k)=(↑m(ν)[↑0:=u0,…,↑(m−1):=um−1])↑m(σ)(↑k)=↑m(ν)[↑0:=u0,…,↑(m−1):=um−1](↑k)=↑m(ν)(↑k)=ν(↑(k−m))=νσ(↑(k−m))=↑m(νσ)(↑k)=↑m(νσ)[↑0:=u0,…,↑(m−1):=um−1](↑k)=ξ(↑k)
De Bruijn Abstraction Algebra
Given an abstraction signature S and a set of variables X, we define an abstraction algebra BX(S)=(U;I;S) such that U=BX(S)⊎{⋆} The symbol ⋆ represents an undefined value.
To define the interpretation I, let us first define functions Ψh:BX(S)→(Uh→U) for h∈N and h>0 via Ψh(t)(u0,…,uh−1)Ψh(t)(u0,…,uh−1)==(t/∅[↑j0:=uj0+h,…,↑jl−1:=ujl−1+h])−hwhere↑h∩FreeAtoms(t)=↑⟨j0,…,jl−1⟩and whereui=⋆for alli∈⟨j0,…,jl−1⟩⋆ifui=⋆for some↑i∈↑h∩FreeAtoms(t) It is easy to see that Ψh is injective: Assume s,t∈BX(S) and s=t. Then s and t must differ at some topmost position. If both s and t contain in that position only abstractions, variables, or de Bruijn indices not corresponding to one of the h function arguments, then this difference will survive the substitution. If only one of them contains a function argument de Bruijn index, then just vary the corresponding argument to produce a difference. If both contain function argument de Bruijn indices, then the indices must be different, so just pass different arguments for those two indices to produce a difference.
Assume now a is an abstraction of shape (m;p0,…,pn−1). What is I(a)?
If n=0, then I(a)=a.
If m=0 and n>0, then I(a)=(u0,…,un−1)↦{(au0…un−1)⋆ifui=⋆for alli∈nifui=⋆for somei∈n
If m>0 (and therefore also n>0), then I(a)=(f0,…,fn−1)↦{(at0…tn−1)⋆ifti=⋆for alli∈nifti=⋆for somei∈n Here ti is the result of trying to convert fi∈Fmpi(U) into an element of BX(S) such that FreeAtoms(ti)∩↑m⊆pi. If the conversion fails, we have ti=⋆.
If pi=∅, then fi∈U, and therefore we set ti=fi.
If pi=∅, then fi∈Um→U. There is at most one s such that Ψm(s)=fi. If such an s exists, we set ti=s, otherwise we set ti=⋆. Note that if s exists, then necessarily FreeAtoms(s)∩↑m⊆pi, because otherwise Ψm(s)∈/Fmpi(U).
We call BX(S) the de Bruijn Abstraction Algebra for S and X.
There is a straightforward relationship between valuation in BX(S) and substitution. To state this relationship we need the notion of strict valuation. This is a valuation ν:D→U such that for all x∈D∩X with xarity>0ν(x)(u0,…,uxarity−1)=⋆ifui=⋆for somei∈xarity We need strict valuations because they possess the following property. Given a term t∈BX(S) with FreeAtoms(t)⊆D, then ν[[t]]=⋆ifν(q)=⋆for someq∈FreeAtoms(t)
We prove this by induction over t:
Let t=↑n. Then ↑n is the only free atom in t, and thus ν[[t]]=ν(↑n)=⋆.
Let t=x∈X0. Then x is the only free atom in t, and thus ν[[t]]=ν(x)=⋆.
Let t=x[t0,…,tn−1] with n>0. We have ν[[t]]=ν(x)(ν(t0),…,ν(tn−1)). Because ν(x) is a function, it cannot be that ν(x)=⋆, and thus at least one of the ti, say t0, must contain the free atom q with ν(q)=⋆. Thus ν(t0)=⋆. From the strictness of ν follows ν[[t]]=ν(x)(ν(t0),ν(t1),…,ν(tn−1))=ν(x)(⋆,ν(t1),…,ν(tn−1))=⋆
Let t=(at0…tn−1) where the valence of t is zero. Again, we assume that t0 contains the free atom q with ν(q)=⋆. Then ν[[t0]]=⋆ and ν[[t]]=I(a)(ν[[t0]],…,ν[[tn−1]])=I(a)(⋆,…)=⋆
Let t=(at0…tn−1) where the valence of t is m>0. We can assume that t0 contains a free atom q′ such that ↑m(ν)[[q′]]=⋆ and q∈/↑m. Then ν[[t]]=I′(a)(f0,…,fn−1) where fi(u0,…,um−1)=νi[[ti]] and νi=↑m(ν)[↑0:=u0,…,↑(m−1):=um−1] The valuations νi are strict, because ν is strict, and furthermore νi(q′)=⋆. Thus ν0[[t0]]=⋆, and therefore f0 is a function with constant value ⋆. Thus ν[[t]]=I′(a)(f0,…)=⋆
Given a substitution σ:D→BX(S), we can view it as a de Bruijn valuation σ′ of D in U as follows: σ′(↑n)σ′(x)σ′(x)===σ(↑n)σ(x)Ψxarity(σ(x))if↑n∈Difx∈X0∩Difx∈X∩Dandxarity>0
We call σ a strict substitution if σ′ is a strict valuation. An equivalent characterisation of a strict substitution σ:D→BX(S) is that for all x∈D∩XFreeAtoms(σ(x))∩↑xarity=↑xarity
Applying a strict substitution σ:D→BX(S) to a term t∈BX(S) with FreeAtoms(t)⊆D is the same as applying the valuation σ′ to t: σ′[[t]]=t/σ We prove this by induction over t.
Assume t=x where x∈X0. Then x∈FreeAtoms(x)⊆D and σ′[[x]]=σ(x)=x/σ
Assume t=x[t0,…,tn−1] and n>0. Then x∈FreeAtoms(x)⊆D and σ′[[t]]=======σ′(x)(σ′[[t0]],…,σ′[[tn−1]])σ′(x)(t0/σ,…,tn−1/σ)Ψn(σ(x))(t0/σ,…,tn−1/σ)(σ(x)/∅[↑j0:=(tj0/σ)+n,…,↑jl−1:=(tjl−1/σ)+n])−nwhere↑⟨j0,…,jl−1⟩=FreeAtoms(σ(x))∩↑n(σ(x)/∅[↑0:=(t0/σ)+n,…,↑(n−1):=(tn−1/σ)+n])−n(x[t0,…,tn−1])/σt/σ
Assume t=↑n. Then ↑n∈FreeAtoms(t)⊆D and σ′[[↑n]]=σ′(↑n)=σ(↑n)=↑n/σ
Assume t=(at0…tn−1) where the valence of a is 0. Then σ′[[t]]======σ′[[(at0…tn−1)]]I(a)(σ′[[t0]],…,σ′[[tn−1]])I(a)(t0/σ,…,tn−1/σ)(at0/σ…tn−1/σ)(at0…tn−1)/σt/σ
Assume t=(at0…tn−1) where the shape of a is (m;p0,…,pn−1) and m>0: σ′[[t]]====(∗)==σ′[[(at0…tn−1)]]I′(a)(f0,…,fn−1)(as0…sn−1)(at0′…tn−1′)(at0…tn−1)/σt/σ Here we have fi(u0,…,um−1)Ψm(si)ti′===↑m(σ′)[↑0:=u0,…,↑(m−1):=um−1][[ti]]fiifsexists withΨm(s)=fiti/↑m(σ) We need to show (∗), i.e. si=ti′ for all i∈n. This is true if Ψm(ti′)=fi.
Let ⟨j0,…,jl−1⟩=FreeAtoms(ti)∩↑m. Note that then also ⟨j0,…,jl−1⟩=FreeAtoms(ti′)∩↑m.
Assume uk∈U∖{⋆} for all k∈⟨j0,…,jl−1⟩. Then Ψm(ti′)(u0,…,um−1)=(ti′/∅[↑j0:=uj0+m,…,↑jl−1:=ujl−1+m])−m=((ti/↑m(σ))/∅[↑j0:=uj0+m,…,↑jl−1:=ujl−1+m])−m=ti/ρ=ρ′[[ti]]=(∗∗)↑m(σ′)[↑j0:=uj0,…,↑jl−1:=ujl−1][[ti]]=↑m(σ′)[↑0:=u0,…,↑(m−1):=um−1][[ti]]=fi(u0,…,um−1) Here we define the substitution ρ by ρ(x)ρ(↑(m+n))ρ(↑k)===σ(x)σ(↑n)ukforx∈X∩Dfor↑n∈Dfork∈⟨j0,…,jl−1⟩ We still need to show (∗∗), i.e. ρ′(q)=(↑m(σ′)[↑j0:=uj0,…,↑jl−1:=ujl−1])(q) for all q∈FreeAtoms(ti):
Assume q=x for x∈X0∩D. Then ρ′(x)=ρ(x)=σ(x)=σ′(x)=(↑m(σ′)[↑j0:=uj0,…,↑jl−1:=ujl−1])(x)
Assume q=x for x∈(X∖X0)∩D. Then ρ′(x)=Ψxarity(ρ(x))=Ψxarity(σ(x))=σ′(x)=(↑m(σ′)[↑j0:=uj0,…,↑jl−1:=ujl−1])(x)
Assume q=↑k for k∈⟨j0,…,jl−1⟩. Then ρ′(↑k)=ρ(↑k)=uk=(↑m(σ′)[↑j0:=uj0,…,↑jl−1:=ujl−1])(↑k)
Assume q=↑(m+n) for ↑n∈D. Then ρ′(↑(m+n))=ρ(↑(m+n))=σ(↑n)=σ′(↑n)=(↑m(σ′))(↑(m+n))=(↑m(σ′)[↑j0:=uj0,…,↑jl−1:=ujl−1])(↑(m+n))
Assume uk∈U for all k∈m and uh=⋆ for some h∈⟨j0,…,jl−1⟩. Then Ψm(ti′)(u0,…,um−1)=⋆=(∗∗∗)↑m(σ′)[↑0:=u0,…,↑(m−1):=um−1][[ti]]=fi(u0,…,um−1) Equation (∗∗∗) follows because for ν=↑m(σ′)[↑0:=u0,…,↑(m−1):=um−1] we know that ν is strict and ν(↑h)=uh=⋆ and ↑h∈FreeAtoms(ti).
Consider now the strict substitution ι:X→BX(S) defined by ι(x)ι(x)==xx[↑0,…,↑(xarity−1)]ifx∈X0ifx∈X∖X0 Obviously t/ι=t holds for all t∈BX(S), and thus also ι′[[t]]=t/ι=t.
We call ι the canonical substitution.
Assume two terms s,t∈TX(S) which are semantically equivalent. Then α(s)=ι′[[α(s)]]=ι′[[s]]=ι′[[t]]=ι′[[α(t)]]=α(t) and therefore s and t are α-equivalent.
Thus semantical equivalence implies α-equivalence. Together with our previous result that α-equivalence implies semantical equivalence this means that semantical equivalence and α-equivalence are equivalent.
Logic
A signature S′extends a signature S if every abstraction of S is also an abstraction of S′, and has the same shape in both S and S′.
A logic algebra is a tuple L=(U;X;V;I;S) such that
(U;I;S) is an abstraction algebra.
X is a set of variables, and V is a non-empty subset of VAL(X,U) such that:
If v∈V, x∈X0, u∈U, then v[x:=u]∈V
If v∈V and σ:D→BX(S) is a regular substitution with D⊆X, then vσ∈V
S is an extension of the signature S0, where S0=⎝⎛⊤⇒∀:::(0;)(0;{},{})(1;{0})⎠⎞
I(⇒)(I(⊤),b)=I(⊤) implies b=I(⊤) for all b∈U.
For all f:U→U, if f(u)=I(⊤) for all u∈U, then I(∀)(f)=I(⊤).
A logic algebra is called degenerate if U consists of a single element.
An abstraction logicL=(S;X;A) is a signature S together with a set of variables X and a set of axiomsA such that
S is an extension of the signature S0.
X is a set of variables with associated arities, such that both X and X0 are countably infinite.
A is a subset of TX(S).
An abstraction logic L′=(S′;X′;A′) is called an extension of L if S′ is an extension of S and X⊆X′ and A⊆A′.
We say that a logic algebra (U;X;V;I;S) is a model for the termt∈TX(S) if for every valuation ν∈V we have ν[[t]]=I(⊤).
We furthermore say that a logic algebra is a model for the logicL=(S;X;A) if it is a model for all axioms a∈A⊆TX(S). Note that any abstraction algebra with ∣U∣=1 and signature S induces a model for L.
If every model of L is also a model of t∈TX(S), then we say that t is valid in L: L⊨t
Proofs
Given a logic L=(S;X;A), a proof in L of t∈TX(S) is one of the following:
An axiom:AX(t) such that t∈A.
An application of substitution:SUBST(t,σ,ps) where
ps is proof of s in L
σ:D→BX(S) is a regular substitution and D⊆X
α(t)=α(s)/σ
A use of modus ponens:MP(t,ph,pg) such that
ph is a proof of h in L
pg is a proof of g in L
g=(⇒.ht)
Introduction of the universal quantifier:ALL(t,x,ps) where
x∈X0
ps is a proof of s in L
t=(∀x.s)
If there exists a proof of t in L, we say that t is a theorem of L: L⊢t
Soundness
Abstraction logic is sound, i.e. every theorem of L=(S;X;A) is also valid in L: L⊢timpliesL⊨t We show by induction over p that if p is a proof of t in L, then t is valid in L:
Assume p=AX(t). Then t∈A and is therefore valid.
Assume p=SUBST(t,σ,ps). Then ps is a proof of s, and therefore s is valid. Let ν∈V for some logic algebra (U;X;V;I;S). Then ν[[t]]=ν[[α(t)]]=ν[[α(s)/σ]]=νσ[[α(s)]] Because νσ∈V, and s is valid, νσ[[α(s)]]=νσ[[s]]=I(⊤) Together this yields ν[[t]]=νσ[[α(s)]]=I(⊤).
Assume p=MP(t,ph,pg). Then ph is a proof of h, and pg is a proof of g, and therefore both h and g are valid. Let ν∈V for some logic algebra (U;X;V;I;S). Then ν[[h]]=I(⊤) and I(⊤)=ν[[g]]=ν[[(⇒.ht)]]=I(⇒)(ν[[h]],ν[[t]])=I(⇒)(I(⊤),ν[[t]]) This implies ν[[t]]=I(⊤).
Assume p=ALL(t,x,ps). Then ps is a proof of s, and therefore s is valid. Let ν∈V for some logic algebra (U;X;V;I;S). Then ν[[t]]=ν[[(∀x.s)]]=I(∀)(f) Here f:U→U where f(u)=ν[x:=u][[s]] for all u∈U. Because ν[x:=u]∈V and s is valid, we have ν[x:=u][[s]]=I(⊤) and therefore f(u)=I(⊤) for all u. This implies ν[[t]]=I(∀)(f)=I(⊤)
Several Abstraction Logics
In this section several abstraction logics of practical interest are introduced. We use convenient concrete syntax instead of pure abstraction syntax to present their axioms.
Deduction LogicLD has signature SD=S0 and the following axioms AD:
⊤
A⇒A
A⇒(B⇒A)
(A⇒(B⇒C))⇒((A⇒B)⇒(A⇒C))
(∀x.A[x])⇒A[x]
(∀x.A⇒B[x])⇒(A⇒∀x.B[x])
Axiom 1 might surprise, because one would expect it to apply only to truth values, not the entire universe. But because abstraction logic has only a single universe of discourse, every value must also be considered to be a truth value, because for any term t∈TX(S) one can ask the question: Is t true?
Using these axioms one can prove the following deduction theorem: Any proof of A in L+=(S,X,A∪{ϕ}) can be translated into a proof of ϕ′⇒A in the logic L=(S,X,A) as long as L extends LD. Here ϕ′ is the universal closure of ϕ, i.e. ϕ′=∀x0.∀x1.…∀xn−1.ϕ where Free(ϕ)={x0,…,xn−1}.
In a system for machine-assisted theorem proving like Practal [2] it makes sense to bake in native support for LD so that moving theorems from L+ to L doesn’t necessarily involve the actual translation of proofs.
Deduction Logic with EqualityLE extends LD by adding the equality abstraction = such that SE=SD+(=:(0;∅,∅)) It has axioms AE, adding the following axioms to AD:
x=x
x=y⇒(A[x]⇒A[y])
A⇒(A=⊤)
Note that (A=⊤)⇒A is then also a theorem in LE.
Deduction Logic with Equality and FalsityLF extends LE with falsity ⊥ and negation ¬: SF=SE+(⊥¬::(0;)(0;∅)) Its set of axioms AF is obtained by adding the following axioms to AE:
⊥=(∀x.x)
¬A=(A⇒⊥)
Note that all of the following are theorems of LF:
⊤=¬⊥
⊥⇒A
A⇒(¬A⇒⊥)
In particular, LF is certainly not paraconsistent as the principle of explosionA⇒(¬A⇒B) is a theorem.
Axioms 9 and 10 are actually definitions. That means that LF does not add anything new to LE really: Falsity and negation are already present in LE, albeit in disguise.
Intuitionistic LogicLI extends LF by adding abstractions for conjunction ∧, disjunction ∨, equivalence ⇔ and existential quantification ∃ such that SI=SF+⎝⎛∧∨⇔∃::::(0;∅,∅)(0;∅,∅)(0;∅,∅)(1;{0})⎠⎞ Its set of axioms AI is obtained by adding the following axioms to AF:
(A∧B)⇒A
(A∧B)⇒B
A⇒(B⇒(A∧B))
A⇒(A∨B)
B⇒(A∨B)
(A∨B)⇒((A⇒C)⇒((B⇒C)⇒C))
(A⇔B)=((A⇒B)∧(B⇒A))
A[x]⇒∃x.A[x]
(∃x.A[x])⇒((∀x.A[x]⇒B)⇒B)
Note that A⇔(A=⊤) and A⇔(A⇔⊤) and ¬A⇔(A⇔⊥) are all theorems of LI, but ¬A⇔(A=⊥) is not.
Classical LogicLK extends LI with the law of the excluded middle:
A∨¬A
Note that (A⇔⊤)∨(A⇔⊥) is thus a theorem in LK.
The class of abstraction logics Practical TypesLP will be designed as extensions of LK.
With proper support for modular reasoning and axiom tracking, it should be possible to mix different logics, so that statements like the following become provable: Theorem ϕ of LP has a proof in LI assuming hypotheses ψ0,…,ψn−1 which have been proven in LP.
Locales [5] are a mechanism for modular reasoning in Isabelle [4]. A locale corresponds in Practal just to a particular abstraction logic. So supporting locales comes down to supporting the simultaneous use of different abstraction logics, and to facilitate the transfer of theorems between them. In principle such a transfer should always construct a proof in the target logic from a proof in the source logic. In practice less expensive methods and short cuts can be used if such a proof replay is guaranteed to be possible in principle.
Consistency
An abstraction logic L is called inconsistent if L⊢∀x.x and consistent if it is not inconsistent.
If an abstraction logic L is inconsistent and an extension of a deduction logic LD, then all models of L are degenerate. This is easy to see. Assume L is inconsistent. Then ∀x.x is a theorem in L. Using axiom 4 of LD for A[x]=x and modus ponens it follows that x is a theorem. That means that x is valid in any model (U;X;V;I;S) of L. In particular, for any valuation ν∈V we have ν[[x]]=I(⊤). For any u∈U we can define a valuation νu∈V such that νu(x)=u. Then u=νu(x)=νu[[x]]=I(⊤). That means U={I(⊤)}, thus any model of L is degenerate.
What about the other direction? If every model A of an abstraction logic L is degenerate, then [[∀x.x]]A=I(⊤) holds. Therefore L⊨∀x.x But is ∀x.x then a theorem of L? We will see soon → that this is indeed the case if L extends LE.
Therefore, if L extends LE, then inconsistency of an abstraction logic L is equivalent to all of its models being degenerate.
Rasiowa Abstraction Algebra
Helena Rasiowa [10] proved completeness of intuitionistic predicate logic using algebraic methods, and furthermore gave a detailed description of her methods in her book on non-classical logics [6]. Her approach is even more far-reaching than she seems to have realized: There is no need for a special treatment of the quantifiers of predicate logic if you just choose the proper setting. That setting is abstraction logic.
We construct a special model R=(U;X;V;I;S), which we call Rasiowa Abstraction Algebra, for any logic L=(S;X;A) that extends LE.
Constructing U
The basic idea of the approach is due to Lindenbaum and Tarski and is mostly standard: Construct a model by considering the equivalence classes of terms that can be proven to be equal according to the logic. Note that while the original approach considers only variable-free terms and sentences, our approach works with terms which are allowed to contain free variables. Furthermore, there is no need (or possibility, for that matter) for us to distinguish between terms and sentences. This makes our completeness proof conceptually simple and elegant.
The relation ≈ on TX(S) is thus defined as s≈tiffL⊢s=t This is obviously an equivalence relation:
The relation is reflexive, because A=A is a theorem in LE.
The relation is symmetric, because (A=B)⇒(B=A) is a theorem in LE.
The relation is transitive, because (A=B)⇒((B=C)⇒(A=C)) is a theorem in LE.
We let U be the set of equivalence classes of TX(S) with respect to this relation: U=TX(S)/≈
For t∈TX(S) we write [t]R for its corresponding equivalence class in U.
Equivalence of de Bruijn Terms
For t′∈BX0(S) we write [t′]RB to denote [t]R where t is any term in TX(S) such that α(t)=t′. This is well-defined, because if s∈TX(S) such that α(s)=t′ as well, then α(s)=α(t) and thus s=t will be derivable in L using the axioms of LE.
For s,t∈BXm(S) we write s≈mt iff [s/σ]RB=[t/σ]RB for all substitutions σ:m→BX0(S)
Note that s≈0t is equivalent to [s]RB=[t]RB.
Assume c is an abstraction of S and has shape (m;p0,…,pn−1). If for all i∈n
si,ti∈BXm(S),
(FreeAtoms(si)∪FreeAtoms(ti))∩↑N⊆pi,
si≈mti,
then [(cs0…sn−1)]RB=[(ct0…tn−1)]RB.
To see this, let s=(cs0…sn−1) and t=(ct0…tn−1). The first two conditions guarantee that both s and t are in BX0(S). Now consider s′,t′∈TX(S) such that α(s′)=s and α(t′)=t. We can choose s′ and t′ such that s′t′==(cx0…xm−1.s0′…sn−1′)(cx0…xm−1.t0′…tn−1′) for some variables xj and some terms si′ and ti′. Then for all i∈nsiti==α′(si′,∅[xpi:=pi])α′(ti′,∅[xpi:=pi]) This implies α(si′)α(ti′)==si/∅[↑pi:=xpi]ti/∅[↑pi:=xpi]==si/∅[↑0:=x0,…,↑(m−1):=xm−1]ti/∅[↑0:=x0,…,↑(m−1):=xm−1] From si≈mti follows therefore [α(si′)]RB=[α(ti′)]RB and [si′]R=[ti′]R, thus L⊢si′=ti′for alli∈n From this we can prove in L the theorem s′=t′, which implies [s]RB=[t]RB.
Defining Φm
For m>0 we define Φm:BXm(S)→(Um→U) via Φm(t)([t0]RB,…,[tm−1]RB)=[t/∅[↑0:=t0,…,↑(m−1):=tm−1]]RBΦm has the following properties:
Φm is well-defined
Φm(s)=Φm(t) implies s≈mt
Φm(t)∈Fmp(U) implies that there exists s with Φm(t)=Φm(s) and FreeAtoms(s)∩↑N⊆p
To see 1., let us first define Φm′:BXm(S)→(BX0(S)m→BX0(S)) via Φm′(t)(t0,…,tm−1)=t/∅[↑0:=t0,…,↑(m−1):=tm−1] It is clear that Φm′ is well-defined. Furthermore, assume we are given s0,…,sm−1 such that si≈0ti. The following theorem can be derived in LE: A0=B0⇒…⇒Am−1=Bm−1⇒T[A0,…,Am−1]=T[B0,…,Bm−1]
Applying the substitution σ=∅[T:=t,A0:=s0,…,Am−1:=sm−1,B0:=t0,…,Bm−1:=tm−1] to this theorem yields Φm′(t)(s0,…,sm−1)≈0Φm′(t)(t0,…,tm−1).
To show 2., let us assume that s≈mt does not hold. Then there is a regular substitution σ with domain m such that [s/σ]RB=[t/σ]RB. Setting ri=σ(↑i) we see that Φm(s)(r0,…,rm−1)=[s/σ]RB and Φm(t)(r0,…,rm−1)=[t/σ]RB and thus Φm(s)=Φm(t).
To verify 3., let us assume we have t∈BXm(S) with Φm(t)∈Fmp(U), and that ↑i∈FreeAtoms(t) for some i∈/p. If we vary only those arguments of Φm(t) corresponding to those positions i, then this function must be constant, and does therefore not depend on those positions ⟨i0,…,ik−1⟩. We can therefore define s=t/∅[i0:=⊤,…,ik−1:=⊤] Then Φm(t)=Φm(s) and FreeAtoms(s)∩↑N⊆p.
Constructing I
Next, we are constructing the interpretation I(c) of an abstraction c of R.
Assume the arity of c is zero. Then we set I(c)=[(c.)]R
Assume the valence of c is zero, and its arity is n>0. We set I(c)([t0]R,…,[tn−1]R)=[(c.t0…tn−1)]R To show that this is well-defined, assume [si]R=[ti]R for all i∈n. Then si=ti is a theorem of L for each i, and we can derive that (c.s0…sn−1)=(c.t0…tn−1) holds in L as well, using just the axioms of LE.
Assume c has shape (m;p0,…,pn−1) with m>0. For fi∈Fmpi(U) we set I(c)(f0,…,fn−1)=⎩⎨⎧[(cf0′…fn−1′)]RB[⊤]Riffi′exist withΦm(fi′)=fiandFreeAtoms(fi′)∩↑N⊆piotherwise This is well-defined because of the properties of Φm and ≈m stated earlier.
Applying Valuations
Let σ:D→BX(S) be a regular substitution.
It induces a de Bruijn valuation σ′ of D in U as follows: σ′(x)={[σ(x)]RBΦxarity(σ(x))ifx∈X0∪(D∩↑N)ifx∈X∖X0 Then for any t∈BX(S) with FreeAtoms(t)⊆D we have σ′[[t]]=[t/σ]RB We show this by induction over t.
Assume t=↑n. Then ↑n∈D and σ′[[t]]=σ′[[↑n]]=[σ(↑n)]RB=[t/σ]RB
Assume t=x∈X0. Then x∈D and σ′[[t]]=σ′[[x]]=[σ(x)]RB=[t/σ]RB
Assume t=x[t0,…,tn−1] where x∈X∖X0. Then x∈D and σ′[[t]]=======σ′[[x[t0,…,tn−1]]]σ′(x)(σ′[[t0]],…,σ′[[tn−1]])Φn(σ(x))([t0/σ]RB,…,[tn−1/σ]RB)[σ(x)/∅[↑0:=t0/σ,…,↑(n−1):=tn−1/σ]]RB[(σ(x)/∅[↑0:=t0/σ+n,…,↑(n−1):=tn−1/σ+n])−n]RB[x[t0,…,tn−1]/σ]RB[t/σ]RB
Assume t=(at0…tn−1) where a is an abstraction with arity n and valence 0: σ′[[t]]=σ′[[(at0…tn−1)]]=I(a)(σ′[[t0]],…,σ′[[tn−1]])=I(a)([t0/σ]RB,…,[tn−1/σ]RB)=[(a.t0′…tn−1′)]R=[(at0′′…tn−1′′)]RB=[(at0…tn−1)/σ]RB=[t/σ]RBwhereα(ti′)=ti/σwhereti′′=ti/↑0(σ)=ti/σ
Assume t=(at0…tn−1) where a is an abstraction of shape (m;p0,…,pn−1) with m>0. σ′[[t]]=σ′[[(at0…tn−1)]]=I′(a)(f0,…,fn−1)wherefi([b0]RB,…,[bm−1]RB)where=↑m(σ′)[↑0:=[b0]RB,…,↑(m−1):=[bm−1]RB][[ti]]where=[(↑m(σ)[↑0:=b0,…,↑(m−1):=bm−1])′[[ti]]]RBwhere=[ti/(↑m(σ)[↑0:=b0,…,↑(m−1):=bm−1])]RB=[(af0′…fn−1′)]RBwhereΦm(fi′)=fi,=(∗)[(at0′…tn−1′)]RBwhereti′=ti/↑m(σ)=[(at0…tn−1)/σ]RB=[t/σ]RB Equation (∗) holds if we can show Φm(ti′)=fi: Φm(ti′)([b0]RB,…,[bm−1]RB)=[ti′/∅[↑0:=b0,…,↑(m−1):=bm−1]]RB=[(ti/↑m(σ))/∅[↑0:=b0,…,↑(m−1):=bm−1]]RB=[ti/(↑m(σ)[↑0:=b0,…,↑(m−1):=bm−1])]RB=fi([b0]RB,…,[bm−1]RB)
Constructing V
Now V⊆VAL(X,U) is defined as follows: V={ν∈VAL(X,U)∣ν=σ′for some regularσ:X→BX(S)} An equivalent definition of V is V={ν∈VAL(X,U)∣∀x∈X∖X0.∃t∈BXxarity(S).ν(x)=Φxarity(t)}
We need to check that V fulfills the criteria set out for it in our logic algebra definition.
Assume ν=σ′∈V, and x∈X0 and u∈U. There is t such that u=[t]RB and thus ν[x:=u]=σ′[x:=u]=(σ[x:=t])′∈V
Assume ν=σ′∈V, and that θ:D→BX(S) is a regular substitution with D⊆X. We need to show that also νθ∈V.
Assume x∈X∖X0 and m=xarity.
For x∈D we get νθ(x)([t0]RB,…,[tm−1]RB)=ν[↑0:=[t0]RB,…,↑(m−1):=[tm−1]RB][[θ(x)]]=σ′[↑0:=[t0]RB,…,↑(m−1):=[tm−1]RB][[θ(x)]]=(σ[↑0:=t0,…,↑(m−1):=tm−1])′[[θ(x)]]=[θ(x)/(σ[↑0:=t0,…,↑(m−1):=tm−1])]RB=[(θ(x)/σ)/∅[↑0:=t0,…,↑(m−1):=tm−1]]RB=Φm(θ(x)/σ)([t0]RB,…,[tm−1]RB) Thus νθ(x)=Φm(θ(x)/σ).
For x∈/D we get νθ(x)=ν(x)=σ′(x)=Φm(σ(x)).
Together this implies νθ∈V.
R is a Model for L
The tuple R=(U;X;V;I;S) we constructed is a logic algebra:
(U;I;S) is an abstraction algebra by construction.
We verified that V has the required properties.
Certainly S is an extension of S0.
Assume I(⇒)(I(⊤),[b]R)=I(⊤) for b∈TX(S). Using the definition of I in R, this is equivalent to [⊤⇒b]R=[⊤]R. This means that we can prove (⊤⇒b)=⊤ in L, and thus also ⊤⇒b. Application of modus ponens together with Axiom 0 yields L⊢b, and Axiom 8 delivers L⊢b=⊤, and thus [b]R=[⊤]R=I(⊤)
Let f:U→U such that f(u)=I(⊤) for all u∈U.
We define f′∈BX1(S) by f′=⊤. Then Φm(f′)(u)=[⊤]RB=[⊤]R=I(⊤)=f(u) This means Φm(f′)=f and therefore I(∀)(f)=[(∀⊤)]RB=[∀x.⊤]R We can prove (∀x.⊤)=⊤ in L. This yields I(∀)(f)=[∀x.⊤]R=[⊤]R=I(⊤)
We need to show that R is a model for all axioms a∈A of L.
Assume ν=σ′∈V. Then ν[[a]]=σ′[[a]]=[α(a)/σ]RB. Because a is an axiom, we can prove L⊢a. Choose t∈TX(S) such that α(t)=α(a)/σ. With proof rule SUBST we can derive L⊢t. Thus ν[[a]]=[α(a)/σ]RB=[t]R=[⊤]R=I(⊤)
We conclude that R is indeed a model of L.
Completeness
An abstraction logic L=(S;X;A) is called complete if every valid term is also a theorem, i.e. if for all t∈TX(S)L⊨timpliesL⊢t
If L extends LE, then L is complete.
This can be seen easily now. Construct the Rasiowa Abstraction Algebra R=(U;X;V;I;S) as a model for L. The canonical substitution ι:X→BX(S) is defined by ι(x)ι(x)==xx[↑0,…,↑(xarity−1)]ifx∈X0ifx∈X∖X0 Obviously t′/ι=t′ holds for all t′∈BX(S). Consequently, ι′[[t]]=[α(t)/ι]RB=[α(t)]RB=[t]R holds for all t∈TX(S).
Assume that t∈TX(S) is valid. Because of ι′∈V this implies [t]R=ι′[[t]]=I(⊤)=[⊤]R which shows that L⊢t=⊤, and therefore also L⊢t
Matching and Unification
Given two terms s,t∈BX(S), it is natural to ask and a common task in machine-assisted reasoning to unifys and t, i.e. to ask for a substitution σ such that s/σ=t/σ
A related and easier problem is to match the patterns to t, i.e. to find a substitution σ such that s/σ=t
Given that abstraction syntax can be seen as a special case of higher-order syntax, we can adapt the results from higher-order unification. Experiments in that direction have been carried out, and a higher-order unification algorithm [11] has been adapted for both abstraction unification [12] and abstraction matching [13]. These experiments have been carried out before the inception of abstraction logic, therefore the notation used in them is slightly different. The resulting algorithms are somewhat simpler than the original ones, as there is no need for iteration and no need to compensate for β/η-equivalence.
Unification and matching are especially important in automated reasoning. Superposition is the basis of modern automated reasoning systems, and it is interesting to observe that the approach of superposition to work with theorems of the form s=⊤ is very natural in abstraction logic. There are current efforts [16] to bridge the gap between first-order automated theorem proving and higher-order automated theorem proving. It would certainly make sense to have a pit stop at abstraction automated theorem proving on that journey.
[16]Petar Vukmirović, Alexander Bentkamp, Jasmin Blanchette, Simon Cruanes, Visa Nummelin, Sophie Tourret. (2021). Making Higher-Order Superposition Work, https://doi.org/10.1007/978-3-030-79876-5_24.