2014-11-28 12:06:46 +00:00
|
|
|
|
/-
|
|
|
|
|
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
2014-08-12 00:35:25 +00:00
|
|
|
|
|
2014-11-28 12:06:46 +00:00
|
|
|
|
Module: general_notation
|
|
|
|
|
Authors: Leonardo de Moura, Jeremy Avigad
|
|
|
|
|
-/
|
2014-12-01 04:34:12 +00:00
|
|
|
|
prelude
|
|
|
|
|
import init.datatypes
|
2014-08-12 00:35:25 +00:00
|
|
|
|
|
|
|
|
|
notation `assume` binders `,` r:(scoped f, f) := r
|
|
|
|
|
notation `take` binders `,` r:(scoped f, f) := r
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-11-28 12:06:46 +00:00
|
|
|
|
/-
|
|
|
|
|
Global declarations of right binding strength
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-11-28 12:06:46 +00:00
|
|
|
|
If a module reassigns these, it will be incompatible with other modules that adhere to these
|
|
|
|
|
conventions.
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-11-28 12:06:46 +00:00
|
|
|
|
When hovering over a symbol, use "C-u C-x =" to see how to input it.
|
|
|
|
|
-/
|
|
|
|
|
|
|
|
|
|
/- Logical operations and relations -/
|
2014-11-09 01:54:17 +00:00
|
|
|
|
|
2014-11-30 02:29:48 +00:00
|
|
|
|
definition std.prec.max : num := 1024 -- reflects max precedence used internally
|
|
|
|
|
definition std.prec.arrow : num := 25
|
|
|
|
|
|
2014-10-21 21:08:07 +00:00
|
|
|
|
reserve prefix `¬`:40
|
2014-11-09 01:54:17 +00:00
|
|
|
|
reserve prefix `~`:40
|
2014-10-21 21:08:07 +00:00
|
|
|
|
reserve infixr `∧`:35
|
|
|
|
|
reserve infixr `/\`:35
|
|
|
|
|
reserve infixr `\/`:30
|
|
|
|
|
reserve infixr `∨`:30
|
|
|
|
|
reserve infix `<->`:25
|
|
|
|
|
reserve infix `↔`:25
|
|
|
|
|
reserve infix `=`:50
|
|
|
|
|
reserve infix `≠`:50
|
|
|
|
|
reserve infix `≈`:50
|
|
|
|
|
reserve infix `∼`:50
|
|
|
|
|
|
2014-11-28 13:11:23 +00:00
|
|
|
|
reserve infixr `∘`:60 -- input with \comp
|
2014-11-28 12:06:46 +00:00
|
|
|
|
reserve postfix `⁻¹`:100 --input with \sy or \-1 or \inv
|
2014-10-23 05:12:53 +00:00
|
|
|
|
reserve infixl `⬝`:75
|
2014-10-21 21:08:07 +00:00
|
|
|
|
reserve infixr `▸`:75
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-11-28 12:06:46 +00:00
|
|
|
|
/- types and type constructors -/
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-10-21 21:08:07 +00:00
|
|
|
|
reserve infixl `⊎`:25
|
|
|
|
|
reserve infixl `×`:30
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-11-28 12:06:46 +00:00
|
|
|
|
/- arithmetic operations -/
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-10-21 21:08:07 +00:00
|
|
|
|
reserve infixl `+`:65
|
|
|
|
|
reserve infixl `-`:65
|
|
|
|
|
reserve infixl `*`:70
|
|
|
|
|
reserve infixl `div`:70
|
|
|
|
|
reserve infixl `mod`:70
|
2014-11-14 06:08:20 +00:00
|
|
|
|
reserve prefix `-`:100
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-10-21 21:08:07 +00:00
|
|
|
|
reserve infix `<=`:50
|
|
|
|
|
reserve infix `≤`:50
|
|
|
|
|
reserve infix `<`:50
|
|
|
|
|
reserve infix `>=`:50
|
|
|
|
|
reserve infix `≥`:50
|
|
|
|
|
reserve infix `>`:50
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-11-28 12:06:46 +00:00
|
|
|
|
/- boolean operations -/
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-10-21 21:08:07 +00:00
|
|
|
|
reserve infixl `&&`:70
|
|
|
|
|
reserve infixl `||`:65
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-11-28 12:06:46 +00:00
|
|
|
|
/- set operations -/
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-10-21 21:08:07 +00:00
|
|
|
|
reserve infix `∈`:50
|
|
|
|
|
reserve infixl `∩`:70
|
|
|
|
|
reserve infixl `∪`:65
|
2014-08-22 23:36:47 +00:00
|
|
|
|
|
2014-11-28 12:06:46 +00:00
|
|
|
|
/- other symbols -/
|
|
|
|
|
|
2014-10-21 21:08:07 +00:00
|
|
|
|
precedence `|`:55
|
|
|
|
|
reserve notation | a:55 |
|
|
|
|
|
reserve infixl `++`:65
|
|
|
|
|
reserve infixr `::`:65
|
2014-11-06 23:54:18 +00:00
|
|
|
|
|
|
|
|
|
-- Yet another trick to anotate an expression with a type
|
|
|
|
|
definition is_typeof (A : Type) (a : A) : A := a
|
|
|
|
|
|
|
|
|
|
notation `typeof` t `:` T := is_typeof T t
|