More documentation fixes
This commit is contained in:
parent
2b69999380
commit
57ece3f787
|
@ -1,28 +1,27 @@
|
||||||
#lang scribble/manual
|
#lang scribble/manual
|
||||||
|
|
||||||
@(require "defs.rkt")
|
@(require
|
||||||
|
"defs.rkt"
|
||||||
|
scribble/eval)
|
||||||
|
|
||||||
@title{Curnel Forms}
|
@title{Curnel Forms}
|
||||||
@deftech{Curnel forms} are the core forms provided @racketmodname[cur].
|
@deftech{Curnel forms} are the core forms provided @racketmodname[cur].
|
||||||
These forms come directly from the trusted core and are all that remain after macro expansion.
|
These forms come directly from the trusted core and are all that remain after macro expansion.
|
||||||
@todo{Link to guide regarding macro expansion}
|
@todo{Link to guide regarding macro expansion}
|
||||||
The core of @racketmodname[cur] is essentially TT.
|
The core of @racketmodname[cur] is essentially TT with an impredicative universe @racket[(Type 0)].
|
||||||
For a very understandable in-depth look at TT, see chapter 2 of
|
For a very understandable in-depth look at TT, see chapter 2 of
|
||||||
@hyperlink["https://eb.host.cs.st-andrews.ac.uk/writings/thesis.pdf"
|
@hyperlink["https://eb.host.cs.st-andrews.ac.uk/writings/thesis.pdf"
|
||||||
"Practical Implementation of a Dependently Typed Functional Programming Language"], by
|
"Practical Implementation of a Dependently Typed Functional Programming Language"], by
|
||||||
Edwin C. Brady.
|
Edwin C. Brady.
|
||||||
|
|
||||||
@(require racket/sandbox scribble/eval)
|
@(define curnel-eval (curnel-sandbox ""))
|
||||||
@(define curnel-eval
|
|
||||||
(parameterize ([sandbox-output 'string]
|
|
||||||
[sandbox-error-output 'string]
|
|
||||||
[sandbox-eval-limits #f]
|
|
||||||
[sandbox-memory-limit #f])
|
|
||||||
(make-module-evaluator "#lang cur")))
|
|
||||||
|
|
||||||
@defform[(Type n)]{
|
@defform*[((Type n)
|
||||||
|
Type)]{
|
||||||
Define the universe of types at level @racket[n], where @racket[n] is any natural number.
|
Define the universe of types at level @racket[n], where @racket[n] is any natural number.
|
||||||
|
@racket[Type] is a synonym for @racket[(Type 0)]. Cur is impredicative
|
||||||
|
in @racket[(Type 0)], although this is likely to change to a more
|
||||||
|
restricted impredicative universe.
|
||||||
|
|
||||||
@examples[#:eval curnel-eval
|
@examples[#:eval curnel-eval
|
||||||
(Type 0)]
|
(Type 0)]
|
||||||
|
@ -31,10 +30,6 @@ Define the universe of types at level @racket[n], where @racket[n] is any natura
|
||||||
(Type 1)]
|
(Type 1)]
|
||||||
}
|
}
|
||||||
|
|
||||||
@defidform[Type]{
|
|
||||||
A synonym for @racket[(Type 0)].
|
|
||||||
|
|
||||||
|
|
||||||
@examples[#:eval curnel-eval
|
@examples[#:eval curnel-eval
|
||||||
Type]
|
Type]
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
(require
|
(require
|
||||||
scribble/base
|
scribble/base
|
||||||
scribble/manual
|
scribble/manual
|
||||||
racket/sandbox
|
racket/sandbox)
|
||||||
scribble/eval)
|
|
||||||
(provide (all-defined-out))
|
(provide (all-defined-out))
|
||||||
|
|
||||||
(define (todo . ls)
|
(define (todo . ls)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
@(require
|
@(require
|
||||||
"defs.rkt"
|
"defs.rkt"
|
||||||
|
scribble/eval
|
||||||
(for-label (only-in racket local-expand)))
|
(for-label (only-in racket local-expand)))
|
||||||
|
|
||||||
@title{Reflection}
|
@title{Reflection}
|
||||||
|
@ -10,13 +11,7 @@ various parts of the language implementation as Racket forms at @gtech{phase} 1.
|
||||||
The reflection features are @emph{unstable} and may change without warning.
|
The reflection features are @emph{unstable} and may change without warning.
|
||||||
Many of these features are extremely hacky.
|
Many of these features are extremely hacky.
|
||||||
|
|
||||||
@(require racket/sandbox scribble/eval)
|
@(define curnel-eval (curnel-sandbox "(require cur/stdlib/bool cur/stdlib/nat)"))
|
||||||
@(define curnel-eval
|
|
||||||
(parameterize ([sandbox-output 'string]
|
|
||||||
[sandbox-error-output 'string]
|
|
||||||
[sandbox-eval-limits #f]
|
|
||||||
[sandbox-memory-limit #f])
|
|
||||||
(make-module-evaluator "#lang cur (require cur/stdlib/bool) (require cur/stdlib/nat)")))
|
|
||||||
|
|
||||||
@defproc[(cur-expand [syn syntax?] [id identifier?] ...)
|
@defproc[(cur-expand [syn syntax?] [id identifier?] ...)
|
||||||
syntax?]{
|
syntax?]{
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
#lang scribble/manual
|
#lang scribble/manual
|
||||||
|
|
||||||
@(require "../defs.rkt")
|
@(require
|
||||||
|
"../defs.rkt"
|
||||||
|
scribble/eval)
|
||||||
|
|
||||||
@(define curnel-eval "(require cur/stdlib/bool cur/stdlib/sugar)")
|
@(define curnel-eval (curnel-sandbox "(require cur/stdlib/bool cur/stdlib/sugar)"))
|
||||||
|
|
||||||
@title{Bool}
|
@title{Bool}
|
||||||
@defmodule[cur/stdlib/bool]
|
@defmodule[cur/stdlib/bool]
|
||||||
|
|
|
@ -1,15 +1,10 @@
|
||||||
#lang scribble/manual
|
#lang scribble/manual
|
||||||
|
|
||||||
@(require "../defs.rkt")
|
@(require
|
||||||
|
"../defs.rkt"
|
||||||
|
scribble/eval)
|
||||||
|
|
||||||
@;(TODO Move this to defs.rkt)
|
@(define curnel-eval (curnel-sandbox "(require cur/stdlib/bool cur/stdlib/sugar)"))
|
||||||
@(require racket/sandbox scribble/eval)
|
|
||||||
@(define curnel-eval
|
|
||||||
(parameterize ([sandbox-output 'string]
|
|
||||||
[sandbox-error-output 'string]
|
|
||||||
[sandbox-eval-limits #f]
|
|
||||||
[sandbox-memory-limit #f])
|
|
||||||
(make-module-evaluator "#lang cur (require cur/stdlib/bool) (require cur/stdlib/sugar)")))
|
|
||||||
|
|
||||||
|
|
||||||
@title{Sugar}
|
@title{Sugar}
|
||||||
|
|
|
@ -1,19 +1,15 @@
|
||||||
#lang scribble/manual
|
#lang scribble/manual
|
||||||
|
|
||||||
@(require "../defs.rkt")
|
@(require
|
||||||
|
"../defs.rkt"
|
||||||
|
scribble/eval)
|
||||||
|
|
||||||
@title{Tactics}
|
@title{Tactics}
|
||||||
As Coq has shown, tactics have proven useful for doing complex proofs. In Cur, tactics are not
|
As Coq has shown, tactics have proven useful for doing complex proofs. In Cur, tactics are not
|
||||||
built-in or provided by the language. However, any user can use meta-programming to add tactics to
|
built-in or provided by the language. However, any user can use meta-programming to add tactics to
|
||||||
Cur. A tactic system ships in the standard library, written entirely in user-land code.
|
Cur. A tactic system ships in the standard library, written entirely in user-land code.
|
||||||
|
|
||||||
@(require racket/sandbox scribble/eval)
|
@(define curnel-eval (curnel-sandbox "(require cur/stdlib/tactics/base cur/stdlib/tactics/standard cur/stdlib/bool cur/stdlib/nat)"))
|
||||||
@(define curnel-eval
|
|
||||||
(parameterize ([sandbox-output 'string]
|
|
||||||
[sandbox-error-output 'string]
|
|
||||||
[sandbox-eval-limits #f]
|
|
||||||
[sandbox-memory-limit #f])
|
|
||||||
(make-module-evaluator "#lang cur (require cur/stdlib/tactics/base) (require cur/stdlib/tactics/standard) (require cur/stdlib/bool) (require cur/stdlib/nat)")))
|
|
||||||
|
|
||||||
@section{Proof State and Defining Tactics}
|
@section{Proof State and Defining Tactics}
|
||||||
@defmodule[cur/stdlib/tactics/base]
|
@defmodule[cur/stdlib/tactics/base]
|
||||||
|
@ -57,17 +53,17 @@ Returns an empty partial @tech{proof}, i.e., the identity function.
|
||||||
[current-goal natural-number/c]
|
[current-goal natural-number/c]
|
||||||
[proof (or/c syntax? procedure?)]
|
[proof (or/c syntax? procedure?)]
|
||||||
[theorem syntax?])]{
|
[theorem syntax?])]{
|
||||||
A structure representing the @deftech{proof state} for the proof of the current theorem.
|
A structure representing the @deftech{proof state} for the proof of the current @tech{theorem}.
|
||||||
|
|
||||||
The environment @racket[env] is a map of assumptions local to the theorem from symbols (names) to the
|
The @deftech{environment} @racket[env] is a map of assumptions local to the @tech{proof} from symbols (names) to the
|
||||||
type of the assumption as a syntax object.
|
type of the assumption as a syntax object.
|
||||||
The list of goals @racket[goals] is a map from natural numbers to goals, types as syntax objects.
|
The list of @deftech{goals} @racket[goals] is a map from natural numbers to goals, types as syntax objects.
|
||||||
The current goal @racket[current-goal] is a natural number indexing into @racket[goals], representing
|
The @deftech{current goal} @racket[current-goal] is a natural number indexing into @racket[goals], representing
|
||||||
the goal currently in focus.
|
the goal currently in focus.
|
||||||
The @racket[proof] is the @tech{proof} of the theorem so far. The @racket[proof] is either a
|
The @racket[proof] is the @tech{proof} of the @tech{theorem} so far. The @racket[proof] is either a
|
||||||
syntax object if complete, or a procedure which expects a proof to replace the current holes in the
|
syntax object if complete, or a procedure which expects a proof to replace the current holes in the
|
||||||
@racket[proof].
|
@racket[proof].
|
||||||
The @racket[theorem] is the original statement of the theorem to be proved.
|
The @racket[theorem] is the original statement of the @tech{theorem} to be proved.
|
||||||
}
|
}
|
||||||
|
|
||||||
@defproc[(new-proof-state [prop syntax?])
|
@defproc[(new-proof-state [prop syntax?])
|
||||||
|
@ -148,7 +144,8 @@ tactic is defined and a theorem has been defined but not proved.
|
||||||
}
|
}
|
||||||
|
|
||||||
@defform[(define-theorem name prop)]{
|
@defform[(define-theorem name prop)]{
|
||||||
Defines a new theorem.
|
Defines a new @deftech{theorem}. Theorem are Cur types that can be
|
||||||
|
inhabited using the tactic language starting with @racket[proof].
|
||||||
}
|
}
|
||||||
|
|
||||||
@defform[(proof (tactic args ...) ...)]{
|
@defform[(proof (tactic args ...) ...)]{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user