diff --git a/turnstile/info.rkt b/turnstile/info.rkt new file mode 100644 index 0000000..c4f9381 --- /dev/null +++ b/turnstile/info.rkt @@ -0,0 +1,5 @@ +#lang info + +(define scribblings + '(["scribblings/turnstile.scrbl" ()])) + diff --git a/turnstile/scribblings/turnstile.scrbl b/turnstile/scribblings/turnstile.scrbl new file mode 100644 index 0000000..ce5ecbe --- /dev/null +++ b/turnstile/scribblings/turnstile.scrbl @@ -0,0 +1,43 @@ +#lang scribble/manual + +@(require (for-label racket/base + (except-in turnstile/turnstile ⊢) + )) + +@title{The @racketmodname[turnstile] language} + +@defmodule[turnstile #:lang #:use-sources (turnstile/turnstile)] + +@defform[ + #:literals (≫ ⊢ ⇒ ⇐ ≻ : --------) + (define-typed-syntax name-id option ... rule) + #:grammar + ([option syntax-parse-option] + [rule [pattern ≫ + premise + ... + -------- + conclusion] + [pattern ⇐ : expected-type ≫ + premise + ... + -------- + ⇐-conclusion]] + [premise (code:line [⊢ inf ...] ooo ...) + (code:line [ctx ⊢ inf ...] ooo ...) + (code:line [ctx ctx ⊢ inf ...] ooo ...) + (code:line [type-template τ⊑ type-template #:for expr-template]) + (code:line [type-template τ⊑ type-template #:for expr-template] ooo)] + [ctx (ctx-elem ...)] + [ctx-elem [id ≫ id : type-template] + [id ≫ id : type-template] ooo] + [inf (code:line [expr-template ≫ pattern ⇒ type-pattern] ooo ...) + (code:line [expr-template ≫ pattern ⇐ type-pattern] ooo ...)] + [conclusion [⊢ [_ ≫ expr-template ⇒ type-template]] + [_ ≻ expr-template]] + [⇐-conclusion [⊢ [_ ≫ expr-template ⇐ _]]] + [ooo ...]) +]{ +Defines a macro that can do typechecking. +} +