<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coq/theories/Relations, branch master</title>
<subtitle>The formal proof system</subtitle>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/coq/'/>
<entry>
<title>Explicitly annotate all hint declarations of the standard library.</title>
<updated>2020-11-16T11:28:27+00:00</updated>
<author>
<name>Pierre-Marie Pédrot</name>
</author>
<published>2020-11-14T16:55:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/coq/commit/?id=68cd077344ce37db1a601079dbc4fdcae6c8d41f'/>
<id>68cd077344ce37db1a601079dbc4fdcae6c8d41f</id>
<content type='text'>
By default Coq stdlib warnings raise an error, so this is really required.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By default Coq stdlib warnings raise an error, so this is really required.
</pre>
</div>
</content>
</entry>
<entry>
<title>Modify Relations/Relations.v to compile with -mangle-names</title>
<updated>2020-08-25T20:53:32+00:00</updated>
<author>
<name>Jasper Hugunin</name>
</author>
<published>2020-08-25T20:02:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/coq/commit/?id=e5880b643bb9ce6974d3ecffd8edcbfad9f45cd4'/>
<id>e5880b643bb9ce6974d3ecffd8edcbfad9f45cd4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Modify Relations/Operators_Properties.v to compile with -mangle-names</title>
<updated>2020-08-25T20:53:32+00:00</updated>
<author>
<name>Jasper Hugunin</name>
</author>
<published>2020-08-25T19:58:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/coq/commit/?id=d5f04bd6baf88cc24ac29fa955a123e013e14bce'/>
<id>d5f04bd6baf88cc24ac29fa955a123e013e14bce</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update headers in the whole code base.</title>
<updated>2020-03-18T11:15:43+00:00</updated>
<author>
<name>Théo Zimmermann</name>
</author>
<published>2020-03-18T11:14:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/coq/commit/?id=a99776e10e0b2198d2b811ad82631111fb450f8a'/>
<id>a99776e10e0b2198d2b811ad82631111fb450f8a</id>
<content type='text'>
Add headers to a few files which were missing them.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add headers to a few files which were missing them.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update ml-style headers to new year.</title>
<updated>2019-06-17T16:08:32+00:00</updated>
<author>
<name>Théo Zimmermann</name>
</author>
<published>2019-06-06T09:22:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/coq/commit/?id=42e09b6d888a29cc6273b8e77d5f9a2e5582abc4'/>
<id>42e09b6d888a29cc6273b8e77d5f9a2e5582abc4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Pass some files to strict focusing mode.</title>
<updated>2019-01-23T14:16:39+00:00</updated>
<author>
<name>Gaëtan Gilbert</name>
</author>
<published>2019-01-23T14:16:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/coq/commit/?id=f53a011ac83fa820faba970109485780715e153f'/>
<id>f53a011ac83fa820faba970109485780715e153f</id>
<content type='text'>
ie default goal selector !

How to do this:
- change the default value of default goal selector in goal_select.ml
- eval the emacs code in this commit message
- compile Coq and in each erroring file repeatedly run
  [C-c f] (my/maybe-fix-buller-error) then [C-c C-b] (proof-process-buffer)
  until there are no errors (NB the first [C-c f] has no effect).

You need to watch for 2 cases:
- overly deep proofs where the bullets need to go beyond the list in
  my/bullet-stack (6 layers is enough the vast majority of the time
  though). The system will give you an error and you need to finish
  the lemma manually.

- weird indentation when a bullet starts in the middle of a line and
  doesn't end in that line. Just reindent as you like then go to the
  next error and continue.

~~~emacs-lisp
(defconst my/bullet-stack (list "-" "+" "*" "--" "++" "**")
  "Which bullets should be used, in order.")

(defvar-local my/bullet-count nil
  "The value in the car indicates how many goals remain in the
  bullet at (length-1), and so on recursively. nil means we
  haven't started bulleting the current proof.")

(defvar-local my/last-seen-qed nil)

(defun my/get-maybe-bullet-error ()
  "Extract the number of focused goals from the ! selector error message."
  (when-let* ((rbuf (get-buffer "*response*"))
              (str (with-current-buffer "*response*" (buffer-string)))
              (_ (string-match
                  (rx "Error: Expected a single focused goal but " (group (+ digit)))
                  str))
              (ngoals (string-to-number (match-string 1 str))))
    ngoals))

(defun my/bullet-fix-indent ()
  "Auto indent until the next Qed/Defined, and update my/last-seen-qed."
  ;;  (insert (format "(* %s -&gt; %s *)\n" my/prev-count my/bullet-count))
  (when-let ((qed (save-excursion (search-forward-regexp (rx (or "Defined." "Qed.")) nil t))))
    (set-marker my/last-seen-qed qed)
    (indent-region (- (point) 1) qed)))

(defun my/nth-bullet (n)
  "Get nth bullet, erroring if n &gt;= length my/bullet-stack"
  (or (nth n my/bullet-stack)
      (error "Too many bullets.")))

(defun my/maybe-fix-bullet-error (&amp;optional arg)
  "Main function for porting a file to strict focusing.

Repeatedly process your file in proof general until you get a
focusing error, then run this function. Once there are no more
errors you're done.

Indentation commonly looks bad in the middle of fixing a proof,
but will be fixed unless you start a bullet in the middle of a
line and don't finish it in that line. ie in 'tac1. - tac2.\n
tac3.' tac3 will get indented to align with tac2, but if tac2
finished the bullet the next action will reindent.

This is a stateful process. The state is automatically reset when
you get to the next proof, but if you get an error or take manual
action which breaks the algorithm's expectation you can call with
prefix argument to reset."
  (interactive "P")
  (unless my/last-seen-qed
    (setq my/last-seen-qed (set-marker (make-marker) 0)))
  (when (or arg (&gt; (point) my/last-seen-qed))
    (setq my/bullet-count nil)
    (set-marker my/last-seen-qed 0))

  (when-let ((ngoals (my/get-maybe-bullet-error)))
    (setq my/prev-count (format "%s %s" ngoals my/bullet-count))
    (if (= ngoals 0)
        (progn
          (while (and my/bullet-count (= (car my/bullet-count) 0))
            (pop my/bullet-count))
          (insert (concat (my/nth-bullet (- (length my/bullet-count) 1)) " "))
          (setq my/bullet-count (cons (- (car my/bullet-count) 1) (cdr my/bullet-count)))
          (my/bullet-fix-indent))

      (setq my/bullet-count (cons (- ngoals 1) my/bullet-count))
      (insert (concat (my/nth-bullet (- (length my/bullet-count) 1)) " "))
      (my/bullet-fix-indent))))

(bind-key "C-c f" #'my/maybe-fix-bullet-error coq-mode-map)
~~~
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ie default goal selector !

How to do this:
- change the default value of default goal selector in goal_select.ml
- eval the emacs code in this commit message
- compile Coq and in each erroring file repeatedly run
  [C-c f] (my/maybe-fix-buller-error) then [C-c C-b] (proof-process-buffer)
  until there are no errors (NB the first [C-c f] has no effect).

You need to watch for 2 cases:
- overly deep proofs where the bullets need to go beyond the list in
  my/bullet-stack (6 layers is enough the vast majority of the time
  though). The system will give you an error and you need to finish
  the lemma manually.

- weird indentation when a bullet starts in the middle of a line and
  doesn't end in that line. Just reindent as you like then go to the
  next error and continue.

~~~emacs-lisp
(defconst my/bullet-stack (list "-" "+" "*" "--" "++" "**")
  "Which bullets should be used, in order.")

(defvar-local my/bullet-count nil
  "The value in the car indicates how many goals remain in the
  bullet at (length-1), and so on recursively. nil means we
  haven't started bulleting the current proof.")

(defvar-local my/last-seen-qed nil)

(defun my/get-maybe-bullet-error ()
  "Extract the number of focused goals from the ! selector error message."
  (when-let* ((rbuf (get-buffer "*response*"))
              (str (with-current-buffer "*response*" (buffer-string)))
              (_ (string-match
                  (rx "Error: Expected a single focused goal but " (group (+ digit)))
                  str))
              (ngoals (string-to-number (match-string 1 str))))
    ngoals))

(defun my/bullet-fix-indent ()
  "Auto indent until the next Qed/Defined, and update my/last-seen-qed."
  ;;  (insert (format "(* %s -&gt; %s *)\n" my/prev-count my/bullet-count))
  (when-let ((qed (save-excursion (search-forward-regexp (rx (or "Defined." "Qed.")) nil t))))
    (set-marker my/last-seen-qed qed)
    (indent-region (- (point) 1) qed)))

(defun my/nth-bullet (n)
  "Get nth bullet, erroring if n &gt;= length my/bullet-stack"
  (or (nth n my/bullet-stack)
      (error "Too many bullets.")))

(defun my/maybe-fix-bullet-error (&amp;optional arg)
  "Main function for porting a file to strict focusing.

Repeatedly process your file in proof general until you get a
focusing error, then run this function. Once there are no more
errors you're done.

Indentation commonly looks bad in the middle of fixing a proof,
but will be fixed unless you start a bullet in the middle of a
line and don't finish it in that line. ie in 'tac1. - tac2.\n
tac3.' tac3 will get indented to align with tac2, but if tac2
finished the bullet the next action will reindent.

This is a stateful process. The state is automatically reset when
you get to the next proof, but if you get an error or take manual
action which breaks the algorithm's expectation you can call with
prefix argument to reset."
  (interactive "P")
  (unless my/last-seen-qed
    (setq my/last-seen-qed (set-marker (make-marker) 0)))
  (when (or arg (&gt; (point) my/last-seen-qed))
    (setq my/bullet-count nil)
    (set-marker my/last-seen-qed 0))

  (when-let ((ngoals (my/get-maybe-bullet-error)))
    (setq my/prev-count (format "%s %s" ngoals my/bullet-count))
    (if (= ngoals 0)
        (progn
          (while (and my/bullet-count (= (car my/bullet-count) 0))
            (pop my/bullet-count))
          (insert (concat (my/nth-bullet (- (length my/bullet-count) 1)) " "))
          (setq my/bullet-count (cons (- (car my/bullet-count) 1) (cdr my/bullet-count)))
          (my/bullet-fix-indent))

      (setq my/bullet-count (cons (- ngoals 1) my/bullet-count))
      (insert (concat (my/nth-bullet (- (length my/bullet-count) 1)) " "))
      (my/bullet-fix-indent))))

(bind-key "C-c f" #'my/maybe-fix-bullet-error coq-mode-map)
~~~
</pre>
</div>
</content>
</entry>
<entry>
<title>Update headers following #6543.</title>
<updated>2018-02-27T16:57:50+00:00</updated>
<author>
<name>Théo Zimmermann</name>
</author>
<published>2018-02-27T16:02:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/coq/commit/?id=629fbc743f8b5e7623a6834f19885b2e379cb782'/>
<id>629fbc743f8b5e7623a6834f19885b2e379cb782</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Bump year in headers.</title>
<updated>2017-07-04T12:20:57+00:00</updated>
<author>
<name>Pierre-Marie Pédrot</name>
</author>
<published>2017-07-04T12:19:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/coq/commit/?id=3e0334dd48b5d0b03046d0aff1a82867dc98d656'/>
<id>3e0334dd48b5d0b03046d0aff1a82867dc98d656</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>drop vo.itarget files and compute the corresponding the corresponding values automatically instead</title>
<updated>2017-06-01T15:33:19+00:00</updated>
<author>
<name>Matej Kosik</name>
</author>
<published>2017-03-23T11:56:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/coq/commit/?id=718d61a54157733bca61ed84c0ba3761cd52720f'/>
<id>718d61a54157733bca61ed84c0ba3761cd52720f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove v62 from stdlib.</title>
<updated>2016-10-24T15:28:51+00:00</updated>
<author>
<name>Théo Zimmermann</name>
</author>
<published>2016-10-24T15:28:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/coq/commit/?id=7e38b6627caaab7d19c4fc0ee542a67d9f8970c2'/>
<id>7e38b6627caaab7d19c4fc0ee542a67d9f8970c2</id>
<content type='text'>
This old compatibility hint database can be safely removed
now that coq-contribs do not depend on it anymore.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This old compatibility hint database can be safely removed
now that coq-contribs do not depend on it anymore.
</pre>
</div>
</content>
</entry>
</feed>
