2014-12-05 23:47:04 +00:00
|
|
|
|
/-
|
|
|
|
|
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
2015-02-21 00:30:32 +00:00
|
|
|
|
Module: init.reserved_notation
|
2014-12-05 23:47:04 +00:00
|
|
|
|
Authors: Leonardo de Moura
|
|
|
|
|
-/
|
|
|
|
|
prelude
|
|
|
|
|
import init.datatypes
|
|
|
|
|
|
|
|
|
|
notation `assume` binders `,` r:(scoped f, f) := r
|
|
|
|
|
notation `take` binders `,` r:(scoped f, f) := r
|
|
|
|
|
|
|
|
|
|
/-
|
|
|
|
|
Global declarations of right binding strength
|
|
|
|
|
|
|
|
|
|
If a module reassigns these, it will be incompatible with other modules that adhere to these
|
|
|
|
|
conventions.
|
|
|
|
|
|
2015-04-22 19:13:34 +00:00
|
|
|
|
When hovering over a symbol, use "C-c C-k" to see how to input it.
|
2014-12-05 23:47:04 +00:00
|
|
|
|
-/
|
|
|
|
|
|
2015-02-28 00:02:18 +00:00
|
|
|
|
definition std.prec.max : num := 1024 -- the strength of application, identifiers, (, [, etc.
|
2014-12-05 23:47:04 +00:00
|
|
|
|
definition std.prec.arrow : num := 25
|
|
|
|
|
|
2015-02-28 00:02:18 +00:00
|
|
|
|
/-
|
|
|
|
|
The next definition is "max + 10". It can be used e.g. for postfix operations that should
|
|
|
|
|
be stronger than application.
|
|
|
|
|
-/
|
|
|
|
|
|
|
|
|
|
definition std.prec.max_plus :=
|
|
|
|
|
num.succ (num.succ (num.succ (num.succ (num.succ (num.succ (num.succ (num.succ (num.succ
|
|
|
|
|
(num.succ std.prec.max)))))))))
|
|
|
|
|
|
|
|
|
|
/- Logical operations and relations -/
|
|
|
|
|
|
2014-12-05 23:47:04 +00:00
|
|
|
|
reserve prefix `¬`:40
|
|
|
|
|
reserve prefix `~`:40
|
|
|
|
|
reserve infixr `∧`:35
|
|
|
|
|
reserve infixr `/\`:35
|
|
|
|
|
reserve infixr `\/`:30
|
|
|
|
|
reserve infixr `∨`:30
|
2015-04-22 19:13:34 +00:00
|
|
|
|
reserve infix `<->`:20
|
|
|
|
|
reserve infix `↔`:20
|
2014-12-05 23:47:04 +00:00
|
|
|
|
reserve infix `=`:50
|
|
|
|
|
reserve infix `≠`:50
|
|
|
|
|
reserve infix `≈`:50
|
|
|
|
|
reserve infix `∼`:50
|
2015-04-22 19:13:34 +00:00
|
|
|
|
reserve infix `≡`:50
|
2014-12-05 23:47:04 +00:00
|
|
|
|
|
2015-02-28 00:02:18 +00:00
|
|
|
|
reserve infixr `∘`:60 -- input with \comp
|
|
|
|
|
reserve postfix `⁻¹`:std.prec.max_plus -- input with \sy or \-1 or \inv
|
2015-04-22 19:13:34 +00:00
|
|
|
|
|
2014-12-05 23:47:04 +00:00
|
|
|
|
reserve infixl `⬝`:75
|
|
|
|
|
reserve infixr `▸`:75
|
|
|
|
|
|
|
|
|
|
/- types and type constructors -/
|
|
|
|
|
|
2014-12-20 19:04:13 +00:00
|
|
|
|
reserve infixr `⊎`:25
|
|
|
|
|
reserve infixr `×`:30
|
2014-12-05 23:47:04 +00:00
|
|
|
|
|
|
|
|
|
/- arithmetic operations -/
|
|
|
|
|
|
|
|
|
|
reserve infixl `+`:65
|
|
|
|
|
reserve infixl `-`:65
|
|
|
|
|
reserve infixl `*`:70
|
|
|
|
|
reserve infixl `div`:70
|
|
|
|
|
reserve infixl `mod`:70
|
2015-02-03 01:02:14 +00:00
|
|
|
|
reserve infixl `/`:70
|
2014-12-05 23:47:04 +00:00
|
|
|
|
reserve prefix `-`:100
|
|
|
|
|
|
|
|
|
|
reserve infix `<=`:50
|
|
|
|
|
reserve infix `≤`:50
|
|
|
|
|
reserve infix `<`:50
|
|
|
|
|
reserve infix `>=`:50
|
|
|
|
|
reserve infix `≥`:50
|
|
|
|
|
reserve infix `>`:50
|
|
|
|
|
|
|
|
|
|
/- boolean operations -/
|
|
|
|
|
|
|
|
|
|
reserve infixl `&&`:70
|
|
|
|
|
reserve infixl `||`:65
|
|
|
|
|
|
|
|
|
|
/- set operations -/
|
|
|
|
|
|
|
|
|
|
reserve infix `∈`:50
|
2014-12-15 02:49:19 +00:00
|
|
|
|
reserve infix `∉`:50
|
2014-12-05 23:47:04 +00:00
|
|
|
|
reserve infixl `∩`:70
|
|
|
|
|
reserve infixl `∪`:65
|
|
|
|
|
|
|
|
|
|
/- other symbols -/
|
|
|
|
|
|
2015-04-06 16:24:09 +00:00
|
|
|
|
reserve infix `∣`:50
|
2014-12-05 23:47:04 +00:00
|
|
|
|
reserve infixl `++`:65
|
|
|
|
|
reserve infixr `::`:65
|
|
|
|
|
|
|
|
|
|
-- Yet another trick to anotate an expression with a type
|
2015-04-10 01:41:23 +00:00
|
|
|
|
abbreviation is_typeof (A : Type) (a : A) : A := a
|
2014-12-05 23:47:04 +00:00
|
|
|
|
|
|
|
|
|
notation `typeof` t `:` T := is_typeof T t
|
2015-03-25 01:35:21 +00:00
|
|
|
|
notation `(` t `:` T `)` := is_typeof T t
|