Saya tahu bahwa penulis yang berbeda menggunakan notasi yang berbeda untuk mewakili semantik bahasa pemrograman. Sebenarnya Guy Steele mengatasi masalah ini dalam video yang menarik .
Saya ingin tahu apakah ada yang tahu apakah operator pintu putar terkemuka memiliki makna yang dikenal baik. Misalnya saya tidak mengerti operator terkemuka di awal penyebut sebagai berikut:
Bisakah seseorang membantu saya mengerti? Terima kasih.
type-theory
denotational-semantics
Jim Newton
sumber
sumber
type-checking
Jawaban:
Di sebelah kiri pintu putar, Anda dapat menemukan konteks lokal, daftar asumsi terbatas pada jenis variabel yang ada.
Di atas, bisa menjadi nol, sehingga . Ini berarti tidak ada asumsi pada variabel yang dibuat. Biasanya, ini berarti bahwa adalah istilah tertutup (tanpa variabel bebas) yang memiliki tipe .n ⊢e:T e T
Seringkali, aturan yang Anda sebutkan ditulis dalam bentuk yang lebih umum, di mana mungkin ada lebih banyak hipotesis daripada yang disebutkan dalam pertanyaan.
Here,Γ represents any context, and Γ,x:T1 represents its extension obtained by appending the additional hypothesis x:T1 to the list Γ . It is common to require that x did not appear in Γ , so that the extension does not "conflict" with a previous assumption.
sumber
As a complement to the other answers, note that there are three levels of "implication" in typing derivations. And the same remark holds with logical derivations since there is actually a correspondence between the two (called the Curry-Howard's correspondance).
The first implication is the arrow that appears in formulas, and it corresponds to logical implication in a formula (or a function type for theλ -calculus).
The second implication is materialized by the turnstile symbol, and means "assuming every formula on the left, the formula on the right holds". In particular, the rule you give tells how one should prove an implication: to proveA⇒B , then one must prove B under the assumption that A holds. In terms of the λ -calculus, to prove that λx.t has type A→B , one must show that t has type B , assuming that x is a variable of type A (see the correspondence?).
The third level of implication is materialized by the horizontal bar, and means "if every premise (elements at the top) holds, then the conclusion (the element at the bottom) holds". You can link that to the interpretation of the typing rule forλ -abstraction that you gave (see the explanation in the previous paragraph).
sumber
In type checking systems, the (⊢ ) represents the ternary relation over type environments, expressions and types: ⊢Env×Exp×Typ .
In your example, the expressiont2 is typed at type T2 wrt. to a type environment having a type assumption mapping T1 to some type variable x
In this context, a type environment is a partial function that assigns types to variables, usually denoted withΓ where
Γ∈Env:Var⇀Typ
Note that, the operator reserves its functionality regardless of where it appears, either in the premise or the conclusion of the rule.
sumber
In every situation that I've seen,X⊢Y means that there is a proof of Y assuming that X holds. If X is empty, that means that Y is a tautology: it has a proof without needing any assumptions.
sumber