• No se han encontrado resultados

FICHAS DE INVENTARIO DE ATRACTIVOS TURÍSTICOS DE LA PARROQUIA

3. MARCO METODOLÓGICO

5.1. INVENTARIO DE ATRACTIVOS TURÍSTICOS DE LA PARROQUIA

5.1.5. FICHAS DE INVENTARIO DE ATRACTIVOS TURÍSTICOS DE LA PARROQUIA

The term calculus T+ is a concrete representation of our abstract notion of computability. We describe denotational semantics of T+due to Schwichtenberg [SW12] and normalization by evaluation due to Berger and Schwichtenberg [BS91]. Considering ideals as denotation of terms of T+, we define the relation between a token (U , b~ ) and the denotation of a term M, written as (U , b~ ) ∈ [[M]], by induction on the construction of M. We denote (U1, . . . ,(Un, b). . .) by (U , b~ ) and (U , b~ )∈[[λ~xM]] for all b ∈V by (U , V~ )⊆[[λ~xM]].

Definition 2.2.41 (Denotational semantics). Letb range over tokens, U, V, and W over sets of tokens, x and y over variables,M and N over terms, C over constructors, andD

over a constant with computation rules as D ~P(~y) =M where each of P~ is a constructor pattern. We define the denotation of a term by induction.

Ui `b (U , b~ )∈[[λ~xxi]] (V) , (U , V, b~ )∈[[λ~xM]] (U , V~ )⊆[[λ~xN]] (U , b~ )∈[[λ~x(M N)]] (A) , ~ V `~b∗ (U , ~~ V , C~b∗)∈[[λ~xC]] (C) , (U , ~~ V , b)∈[[λ~x,~yM]] W~ `P~(V~) (U , ~~ W , b)∈[[λ~xD]] (D) .

The denotation of a term in T+ is an ideal as expected. Essential properties as the preservation of values and adequacy with respect to operational semantics based on conversion rules also enjoy. See [BS91, BES03] for details.

One application of the denotational semantics is normalization by evaluation, NbE in short, which is an efficient algorithm to normalize terms [BS91, BES03, SW12]. It is also a theoretical basis of the implementation of normalization in the Minlog system. A term is a normal form if no conversion rule applies. For a given term M such a long normal form, written nf(M), is computed by NbE in the following way: We first evaluateM to an object

a in some denotational semantics. Then, we retrieve from a the long normal form nf(M). We define the interpretation of types as follows.

Definition 2.2.42 (Interpretation of types). Let Λρ be the set of all terms of typeρ. We

define the interpretation of types by induction on a type. [[ι]] := Λι, [[ρ→σ]] := [[σ]][[ρ]]

Meaning of free variables in an object can be given by an assignment ↑lifting a variable to an object. We write [[M]]↑ to mean the object of M under the assignment ↑. We also consider a function↓which retrieves a long normal form from an object. We simultaneously define ↑ and ↓, called reflect and reify, respectively. For convenience we define ↑ on terms rather than on variables.

Definition 2.2.43(Reflect and reify). We simultaneously define two functions↑ρ: Λρ→[[ρ]]

and ↓ρ: [[ρ]]→Λρ.

↑ι (M) :=M, ↓ι (M) :=M,

↑ρ→σ (M)(a) :=↑σ (M ↓ρ (a)), ↓ρ→σ (a) :=λx(↓σ (a(↑ρ(x)))),

where x is a fresh variable.

A problem is that whatxis in the above definition. Based on the idea of de Bruijn’s index, we introduce term families due to Berger and Schwichtenberg [BS91] and Filinski [Fil99] to avoid this difficulty.

Definition 2.2.44 (Term family). To a term Mρ we assign aterm family M:NΛ

ρ

by induction on the construction of M.

x∞(k) :=x, (λyM)∞(k) :=λxk(M[y/xk]

(k+ 1)),

c∞(k) :=c, (M N)∞(k) :=M∞(k)N∞(k),

where c is a constant.

By using term families, we can formalize Definition 2.2.43 without using a variable name.

For term families r : N → Λρ→σ and s : N → Λρ, the application rs is defined by

rs(k) :=r(k)s(k). The following is the standard way to get a term from a term family. Definition 2.2.45 (Extraction from a term family). Letr be a term family and k be the greatest index among indices of free and bound variablesxi which occur in r(0) We define

ext(r) by the term r(k+ 1).

Now we can give a refined version of NbE which is suitable for the implementation. Definition 2.2.46 (Refined interpretation of types). Let Λρ be the set of all terms of

type ρ and ΛN

ρ be the function space from natural numbers to Λρ. We define the refined

interpretation of types by induction on a type.

[[ι]] := ΛNι , [[ρ→σ]] := [[σ]][[ρ]],

Definition 2.2.47 (Refined reflect and reify). We simultaneously define two functions ↑ρ: (N→Λρ)→[[ρ]] and↓ρ: [[ρ]]→N→Λρ.

↑ι (r) :=r, ↓ι (r) :=r,

↑ρ→σ (r)(a) :=↑σ (r ↓ρ(a)), ↓ρ→σ (a)(k) := λxρk(↓σ (a(↑ρ(x

k )))(k+ 1)).

For ai ∈[[ρi]], ↑~ρ→σ (r)(a1, . . . , an) :=↑σ (r↓ρ1 (a1). . .↓ρn (an)) holds. The correctness

of NbE is shown as follows.

Theorem 2.2.48 (Correctness of NbE). Let M be a term in βη-long normal form. We have ↓([[M]]↑) =M∞ where [[M]]↑ denotes the (semantic) object of M under the assignment

given by ↑.

Proof. By induction on the construction of M.

2.3

Inductive and Coinductive Definitions

Inductive and coinductive definitions are means to define predicates inductively and coin- ductively, which makes TCF extensible. These definitions provide a way to specify a prime formula, which is sometimes not concretely given, for example in the Brouwer-Heyting- Kolmogorov interpretation of intuitionistic logic.

We give the notion of formulas and predicates simultaneously.

Definition 2.3.1 (Formula forms and predicate forms). We simultaneously define formula forms A, B and predicate forms P. Let X denote a predicate variable with an arity, and the length of~tbe the same as the length of the arity of P.

A, B ::= P~t|A→B| ∀xA,

P ::=X| {~x|A} |µX(∀~xi((Aiν)ν<ni →X~ti))i<k|νX(∀~xi((Aiν)ν<ni →X~ti))i<k.

We abbreviate A0 →. . .→An−1 →B as (Ai)i<n→B and ∀x0. . .∀xn−1A as∀~xA.

Definition 2.3.2 (Free predicate variables). We simultaneously define free predicate variables in a formula form and a predicate form.

FPV(P~t) := FPV(P), FPV(A→B) := FPV(A)∪FPV(B), FPV(∀xA) := FPV(A), FPV(X) :={X}, FPV({~x|A}) := FPV(A), FPV(µX(∀~xi((Aiν)ν<ni →X~ti))i<k) := S i<k S ν<niFPV(Aiν)\ {X}, FPV(νX(∀~xi((Aiν)ν<ni →X~ti))i<k) := S i<k S ν<niFPV(Aiν)\ {X}.

We can denote A(X) instead ofA to express that A(Y) means replacingX in A by Y. Definition 2.3.3 (Strictly positive occurrence of predicate variables). We define SPY~ on a

formula form and a predicate form. SPY~(P) SPY~(P~t) , FPV(A)∩Y~ =∅ SPY~(B) SPY~(A→B) , SPY~(A) SPY~(∀xA) , SPY~(X) , SPY~(A) SPY~({~x|A}) ,

for all i < k, for all ν < ni, SPY ,X~ (Aiν)

SPY~(µX(∀~xi((Aiν)ν<ni →X~ti))i<k) ,

for all i < k, for all ν < ni, SPY ,X~ (Aiν)

SPY~(νX(∀~xi((Aiν)ν<ni →X~ti))i<k) .

Occurrences of Y~ inA (P) is strictly positive if SPY~(A) (SPY~(P)).

Definition 2.3.4 (Inhabited formula forms and predicate forms). Let variables X and Y

predicate form as follows. InhabY~(X) InhabY~(X~t) , InhabY~(B) InhabY~(A→B) , InhabY~(A) InhabY~(∀~xA) , X 6∈Y~ InhabY~(X) , InhabY~(A) InhabY~({~x|A}) ,

there exists i < k, for all ν < ni, InhabY ,X~ (Aiν)

InhabY~(µX(∀~xi((Aiν)ν<ni →X~ti))i<k)) ,

there exists i < k, for all ν < ni, InhabY ,X~ (Aiν)

InhabY~(νX(∀~xi((Aiν)ν<ni →X~ti))i<k)) .

A formula form A is inhabited if Inhab(A) holds, where the subscript is omitted to mean that the empty list of predicate variables is given. A formula form A isabsolutely inhabited

if InhabFPV(A)(A).

Definition 2.3.5 (Formulas and predicates). We simultaneously define F and Pred. Pred(P) F(P~t) , F(A) F(B) F(A→B) , F(A) F(∀xA) , Pred(X) , F(A) Pred({~x|A}) ,

for all i < k, F(X~ti) and for all ν < ni, F(Aiν) and SPX(Aiν) Inhab(I)

Pred(I) ,

for all i < k, F(X~ti) and for all ν < ni, F(Aiν) and SPX(Aiν) Inhab(coI)

Pred(coI) ,

whereI :=µX(∀~xi((Aiν)ν<ni →X~ti))i<k and

coI :=ν

X(∀~xi((Aiν)ν<ni →X~ti))i<k. A formula

formA is a formula if F(A), and a predicate form P is a predicate if Pred(P).

Inductively defined predicate constants, also called inductive predicates in short, extend the system by adding the introduction and the elimination axioms. Similarly in the case of coinductively defined predicate constants, definitions extend the system by adding the closure and the greatest-fixed-point axioms.

Documento similar