Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Usage of "red in |- *": What does bar hyphen star mean?

In a lot of Coq code, like in the definition of sets in the standard library, I've seen this sort of notation:

 red in |- *.

What does the |-* (bar-hyphen-star) mean?

My searching hasn't turned up any results, but it's hard to search for punctuation, so please excuse me if this is a duplicate!

like image 563
Langston Avatar asked Nov 22 '25 09:11

Langston


1 Answers

It's called an occurrence clause and

The role of an occurrence clause is to select a set of occurrences of a term in a goal.

I'd add "to which the tactic is going to be applied" to the above quote (The Coq Reference manual, sect. 8.1.4).

Then the manual proceeds with the following:

if * is mentioned on the right of |-, the occurrences of the conclusion of the goal have to be selected.

Let's look at some simple cases:

  • <tactic> in * |-. applies <tactic> to every hypothesis, but not to the current goal.

  • <tactic> in H1, H2 |- *. applies <tactic> only to the hypotheses H1 and H2 and the goal.

  • <tactic> in * |- *. applies <tactic> everywhere. There is also a shortcut for this case: <tactic> in *.

For many tactics <tactic> in |- *. is equivalent to just <tactic>. If, for example, you delete all the occurrences of in |- * from the linked file it will still compile.

like image 155
Anton Trunov Avatar answered Nov 25 '25 00:11

Anton Trunov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!