@@ -33,7 +33,7 @@ obligations which need to be resolved to create the final term.
3333.. _elaborating-programs :
3434
3535Elaborating programs
36- ---------------------
36+ --------------------
3737
3838The main difference from |Coq | is that an object in a type :g: `T : Set ` can
3939be considered as an object of type :g: `{x : T | P} ` for any well-formed
@@ -113,7 +113,7 @@ coercions.
113113.. _syntactic_control :
114114
115115Syntactic control over equalities
116- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117117
118118To give more control over the generation of equalities, the
119119type checker will fall back directly to |Coq |’s usual typing of dependent
@@ -158,12 +158,8 @@ prove some goals to construct the final definitions.
158158Program Definition
159159~~~~~~~~~~~~~~~~~~
160160
161- .. todo PR need to understand this better. Is there a reason this only has
162- a subset of the Definition syntax? Maybe need to ask Matthieu
163-
164- .. cmd :: Program Definition @ident := @term
165-
166- A variant of :cmd: `Definition `. Types the value term in Russell and generates proof
161+ A :cmd: `Definition ` command with the :attr: `program ` attribute types
162+ the value term in Russell and generates proof
167163 obligations. Once solved using the commands shown below, it binds the
168164 final |Coq | term to the name :n: `@ident ` in the environment.
169165
@@ -199,20 +195,8 @@ Program Definition
199195Program Fixpoint
200196~~~~~~~~~~~~~~~~
201197
202- .. cmd :: Program Fixpoint @fix_definition {* with @fix_definition }
203-
204- The optional :n: `@fixannot ` annotation can be one of:
205-
206- + :g: `measure f R ` where :g: `f ` is a value of type :g: `X ` computed on
207- any subset of the arguments and the optional term
208- :g: `R ` is a relation on :g: `X `. :g: `X ` defaults to :g: `nat ` and :g: `R `
209- to :g: `lt `.
210-
211- + :g: `wf R x ` which is equivalent to :g: `measure x R `.
212-
213- The structural fixpoint operator behaves just like the one of |Coq | (see
214- :cmd: `Fixpoint `), except it may also generate obligations. It works
215- with mutually recursive definitions too.
198+ A :cmd: `Fixpoint ` command with the :attr: `program ` attribute may also generate obligations. It works
199+ with mutually recursive definitions too. For example:
216200
217201.. coqtop :: reset in
218202
@@ -249,8 +233,6 @@ using the syntax:
249233 | _ => O
250234 end.
251235
252-
253-
254236.. caution :: When defining structurally recursive functions, the generated
255237 obligations should have the prototype of the currently defined
256238 functional in their context. In this case, the obligations should be
@@ -269,21 +251,20 @@ using the syntax:
269251Program Lemma
270252~~~~~~~~~~~~~
271253
272- .. cmd :: Program Lemma @ident : @type
273-
274- A variant of :cmd: `Lemma `. The Russell language can also be used to type statements of logical
275- properties. It will generate obligations, try to solve them
276- automatically and fail if some unsolved obligations remain. In this
277- case, one can first define the lemma’s statement using :cmd: `Program
278- Definition ` and use it as the goal afterwards. Otherwise the proof
254+ A :cmd: `Lemma ` command with the :attr: `program ` attribute uses the Russell
255+ language to type statements of logical
256+ properties. It generates obligations, tries to solve them
257+ automatically and fails if some unsolved obligations remain. In this
258+ case, one can first define the lemma’s statement using :cmd: `Definition `
259+ and use it as the goal afterwards. Otherwise the proof
279260 will be started with the elaborated version as a goal. The
280261 :g: `Program ` attribute can similarly be used as a prefix for
281262 :cmd: `Variable `, :cmd: `Hypothesis `, :cmd: `Axiom ` etc.
282263
283264.. _solving_obligations :
284265
285266Solving obligations
286- --------------------
267+ -------------------
287268
288269The following commands are available to manipulate obligations. The
289270optional identifier is used when multiple functions have unsolved
@@ -295,7 +276,7 @@ optional tactic is replaced by the default one if not specified.
295276
296277 Sets the default obligation solving tactic applied to all obligations
297278 automatically, whether to solve them or when starting to prove one,
298- e.g. using :g : `Next `.
279+ e.g. using :cmd : `Next Obligation `.
299280
300281 This command supports the :attr: `local ` and :attr: `global ` attributes.
301282 :attr: `local ` makes the setting last only for the current
@@ -310,7 +291,7 @@ optional tactic is replaced by the default one if not specified.
310291
311292 Displays all remaining obligations.
312293
313- .. cmd :: Obligation @natural {? of @ident } {? : @term {? with @ltac_expr } }
294+ .. cmd :: Obligation @natural {? of @ident } {? : @type {? with @ltac_expr } }
314295
315296 Start the proof of obligation :token: `natural `.
316297
0 commit comments