2014-11-28 07:06:46 -05:00
|
|
|
|
/-
|
|
|
|
|
Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
Authors: Leonardo de Moura, Jeremy Avigad
|
|
|
|
|
-/
|
2014-11-30 20:34:12 -08:00
|
|
|
|
prelude
|
|
|
|
|
import init.datatypes
|
2014-08-11 17:35:25 -07:00
|
|
|
|
|
|
|
|
|
notation `assume` binders `,` r:(scoped f, f) := r
|
|
|
|
|
notation `take` binders `,` r:(scoped f, f) := r
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2014-11-28 07:06:46 -05:00
|
|
|
|
/-
|
|
|
|
|
Global declarations of right binding strength
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2014-11-28 07:06:46 -05:00
|
|
|
|
If a module reassigns these, it will be incompatible with other modules that adhere to these
|
|
|
|
|
conventions.
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2015-04-22 15:13:34 -04:00
|
|
|
|
When hovering over a symbol, use "C-c C-k" to see how to input it.
|
2014-11-28 07:06:46 -05:00
|
|
|
|
-/
|
|
|
|
|
|
2015-01-26 11:28:13 -05:00
|
|
|
|
definition std.prec.max : num := 1024 -- the strength of application, identifiers, (, [, etc.
|
2014-11-29 18:29:48 -08:00
|
|
|
|
definition std.prec.arrow : num := 25
|
|
|
|
|
|
2015-01-26 11:28:13 -05: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-10-21 14:08:07 -07:00
|
|
|
|
reserve prefix `¬`:40
|
2014-11-08 20:54:17 -05:00
|
|
|
|
reserve prefix `~`:40
|
2014-10-21 14:08:07 -07:00
|
|
|
|
reserve infixr `∧`:35
|
|
|
|
|
reserve infixr `/\`:35
|
2014-12-02 12:06:39 -08:00
|
|
|
|
reserve infixr `\/`:30
|
2014-10-21 14:08:07 -07:00
|
|
|
|
reserve infixr `∨`:30
|
2015-04-22 15:13:34 -04:00
|
|
|
|
reserve infix `<->`:20
|
|
|
|
|
reserve infix `↔`:20
|
2014-10-21 14:08:07 -07:00
|
|
|
|
reserve infix `=`:50
|
|
|
|
|
reserve infix `≠`:50
|
|
|
|
|
reserve infix `≈`:50
|
2015-06-17 15:58:58 -04:00
|
|
|
|
reserve infix `~`:50
|
2015-04-18 13:41:58 -04:00
|
|
|
|
reserve infix `≡`:50
|
2014-10-21 14:08:07 -07:00
|
|
|
|
|
2015-01-26 11:28:13 -05:00
|
|
|
|
reserve infixr `∘`:60 -- input with \comp
|
|
|
|
|
reserve postfix `⁻¹`:std.prec.max_plus -- input with \sy or \-1 or \inv
|
|
|
|
|
|
2014-10-22 22:12:53 -07:00
|
|
|
|
reserve infixl `⬝`:75
|
2014-10-21 14:08:07 -07:00
|
|
|
|
reserve infixr `▸`:75
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2014-11-28 07:06:46 -05:00
|
|
|
|
/- types and type constructors -/
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2014-10-21 14:08:07 -07:00
|
|
|
|
reserve infixl `⊎`:25
|
|
|
|
|
reserve infixl `×`:30
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2014-11-28 07:06:46 -05:00
|
|
|
|
/- arithmetic operations -/
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2014-10-21 14:08:07 -07:00
|
|
|
|
reserve infixl `+`:65
|
|
|
|
|
reserve infixl `-`:65
|
|
|
|
|
reserve infixl `*`:70
|
|
|
|
|
reserve infixl `div`:70
|
|
|
|
|
reserve infixl `mod`:70
|
2015-02-02 17:02:14 -08:00
|
|
|
|
reserve infixl `/`:70
|
2014-11-13 22:08:20 -08:00
|
|
|
|
reserve prefix `-`:100
|
2015-05-14 14:48:32 +10:00
|
|
|
|
reserve infix `^`:80
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2014-10-21 14:08:07 -07:00
|
|
|
|
reserve infix `<=`:50
|
|
|
|
|
reserve infix `≤`:50
|
|
|
|
|
reserve infix `<`:50
|
|
|
|
|
reserve infix `>=`:50
|
|
|
|
|
reserve infix `≥`:50
|
|
|
|
|
reserve infix `>`:50
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2014-11-28 07:06:46 -05:00
|
|
|
|
/- boolean operations -/
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2014-10-21 14:08:07 -07:00
|
|
|
|
reserve infixl `&&`:70
|
|
|
|
|
reserve infixl `||`:65
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2014-11-28 07:06:46 -05:00
|
|
|
|
/- set operations -/
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2014-10-21 14:08:07 -07:00
|
|
|
|
reserve infix `∈`:50
|
2014-12-14 18:49:19 -08:00
|
|
|
|
reserve infix `∉`:50
|
2014-10-21 14:08:07 -07:00
|
|
|
|
reserve infixl `∩`:70
|
|
|
|
|
reserve infixl `∪`:65
|
2015-05-20 18:33:59 +10:00
|
|
|
|
reserve infix `⊆`:50
|
2014-08-22 16:36:47 -07:00
|
|
|
|
|
2014-11-28 07:06:46 -05:00
|
|
|
|
/- other symbols -/
|
|
|
|
|
|
2015-04-06 09:24:09 -07:00
|
|
|
|
reserve infix `∣`:50
|
2014-10-21 14:08:07 -07:00
|
|
|
|
reserve infixl `++`:65
|
|
|
|
|
reserve infixr `::`:65
|