Before this commit, we were inferring whether an inductive/structure/class were meta or not. This was bad since the user had no clue whether the type was trusted (non meta) or not. Moreover, users could get confused by this behavior and assume the kernel was allowing trusted code to rely on untrusted one.
33 lines
1,013 B
Text
33 lines
1,013 B
Text
/-
|
|
Copyright (c) 2016 Microsoft Corporation. All rights reserved.
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
Authors: Leonardo de Moura
|
|
-/
|
|
prelude
|
|
import init.meta.expr
|
|
universe variables u
|
|
|
|
/- Quoted expressions. They can be converted into expressions by using a tactic. -/
|
|
meta constant pexpr : Type
|
|
protected meta constant pexpr.of_expr : expr → pexpr
|
|
protected meta constant pexpr.subst : pexpr → pexpr → pexpr
|
|
|
|
/- Low level primitives for accessing internal representation. -/
|
|
protected meta constant pexpr.to_raw_expr : pexpr → expr
|
|
protected meta constant pexpr.of_raw_expr : expr → pexpr
|
|
|
|
meta constant pexpr.to_string : pexpr → string
|
|
meta instance : has_to_string pexpr :=
|
|
⟨pexpr.to_string⟩
|
|
|
|
meta class has_to_pexpr (A : Type u) :=
|
|
(to_pexpr : A → pexpr)
|
|
|
|
meta definition to_pexpr {A : Type u} [has_to_pexpr A] : A → pexpr :=
|
|
has_to_pexpr.to_pexpr
|
|
|
|
meta instance : has_to_pexpr pexpr :=
|
|
⟨id⟩
|
|
|
|
meta instance : has_to_pexpr expr :=
|
|
⟨pexpr.of_expr⟩
|