fix: pp.all should not turn off pp.binder_types

This commit is contained in:
Sebastian Ullrich 2021-03-23 19:45:41 +01:00
parent a0eff55772
commit 62ae39e62b
5 changed files with 11 additions and 8 deletions

View file

@ -128,6 +128,7 @@ def escapedChar : Quickparse Char := do
Char.ofNat $ 4096*u1 + 256*u2 + 16*u3 + u4
| _ => fail "illegal \\u escape"
set_option trace.compiler true in
partial def strCore (acc : String) : Quickparse String := do
let c ← peek!
if c = '"' then -- "

View file

@ -151,7 +151,7 @@ register_builtin_option g_pp_compact_let : Bool := {
-/
def getPPAll (o : Options) : Bool := o.get `pp.all false
def getPPBinderTypes (o : Options) : Bool := o.get `pp.binder_types (!getPPAll o)
def getPPBinderTypes (o : Options) : Bool := o.get `pp.binder_types true
def getPPCoercions (o : Options) : Bool := o.get `pp.coercions (!getPPAll o)
def getPPExplicit (o : Options) : Bool := o.get `pp.explicit (getPPAll o)
def getPPNotation (o : Options) : Bool := o.get `pp.notation (!getPPAll o)

View file

@ -1,2 +1,2 @@
fun {α} => PEmpty.rec.{v, u_1} fun x => α : {α : Sort v} → PEmpty.{u_1} → α
fun {α : Sort v} => PEmpty.rec.{v, u_1} fun (x : PEmpty.{u_1}) => α : {α : Sort v} → PEmpty.{u_1} → α
276.lean:13:4-13:15: error: code generator does not support recursor 'PEmpty.rec' yet, consider using 'match ... with' and/or structural recursion

View file

@ -3,21 +3,23 @@ fun (x : BV 32) => (fun (x : BV 32) => g (f x).val) x
def r : Nat → Prop :=
fun (a : Nat) => if a == 0 = true then a != 1 = true else a != 2 = true
def r : Nat → Prop :=
fun a =>
fun (a : Nat) =>
@ite.{1} Prop
(@Eq.{1} Bool
(@BEq.beq.{0} Nat (@instBEq.{0} Nat fun a b => instDecidableEqNat a b) a
(@BEq.beq.{0} Nat (@instBEq.{0} Nat fun (a b : Nat) => instDecidableEqNat a b) a
(@OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))
Bool.true)
(instDecidableEqBool
(@BEq.beq.{0} Nat (@instBEq.{0} Nat fun a b => instDecidableEqNat a b) a
(@BEq.beq.{0} Nat (@instBEq.{0} Nat fun (a b : Nat) => instDecidableEqNat a b) a
(@OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))
Bool.true)
(@Eq.{1} Bool
(@bne.{0} Nat (@instBEq.{0} Nat fun a b => instDecidableEqNat a b) a (@OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))
(@bne.{0} Nat (@instBEq.{0} Nat fun (a b : Nat) => instDecidableEqNat a b) a
(@OfNat.ofNat.{0} Nat 1 (instOfNatNat 1)))
Bool.true)
(@Eq.{1} Bool
(@bne.{0} Nat (@instBEq.{0} Nat fun a b => instDecidableEqNat a b) a (@OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)))
(@bne.{0} Nat (@instBEq.{0} Nat fun (a b : Nat) => instDecidableEqNat a b) a
(@OfNat.ofNat.{0} Nat 2 (instOfNatNat 2)))
Bool.true)
def s : Option Nat :=
ConstantFunction.f myFun 3 <|> ConstantFunction.f myFun 4

View file

@ -2,4 +2,4 @@
(100, 400)
(49, 576, 576)
def g : Int → Int → Int :=
fun x y => @mul.{0} (@magmaOfMul.{0} Int Int.instMulInt) x y
fun (x y : Int) => @mul.{0} (@magmaOfMul.{0} Int Int.instMulInt) x y