package syntax
The classes in this package model the grammar of the PVS XML export.
They have a dual purpose * provide a Scala model of the PVS data structures * automatically induce a parser for the XML files (see syntax.makeParser).
See pvs_file and Object for the best entry points.
The reference for the XML is https://github.com/samowre/PVS/blob/master/lib/pvs.rnc
- Source
- package.scala
- Alphabetic
- By Inheritance
- syntax
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
Assertion(kind: String, _formula: Expr) extends Group with Product with Serializable
formula can have free variables
-
sealed
trait
AssumingDecl extends AnyRef
a declaration in the assumptions of a theory, essentially formal parameters of axiom flavor and some auxiliary declarations
a declaration in the assumptions of a theory, essentially formal parameters of axiom flavor and some auxiliary declarations
This is the same as Decl except for also allowing assumptions (= axioms).
-
case class
ChainedDecl(named: NamedDecl, chain_p: Boolean, semi_colon_p: Boolean) extends Group with Product with Serializable
like NamedDecl but may be chained
-
sealed
trait
Decl extends AssumingDecl
a declaration in the body of theory
- case class DeclaredType(_declared: Type, _internal: Type) extends Group with Product with Serializable
- sealed trait Expr extends Object with assignment_arg
-
sealed
trait
FormalParameter extends AnyRef
a declaration in the list of parameters of a theory declaration
a declaration in the list of parameters of a theory declaration
This is essentially a subtype of Decl, but the Decl counterparts are general.
-
case class
InlineDatatypeBody(named: NamedDecl, arg_formals: List[bindings], _constructors: List[constructor]) extends Group with Product with Serializable
an ADT-like datatype declared inside a theory, see also TopDatatypeBody
-
trait
Judgement extends Decl
named theorem-flavor statement in the meta-logic
-
trait
Module extends AnyRef
toplevel declarations
-
case class
NamedDecl(id: String, place: String, decl_formals: List[FormalParameter]) extends Group with Product with Serializable
common parts of a named declaration in a theory
- case class NonEmptiness(nonempty_p: Boolean, contains: Option[Expr]) extends Group with Product with Serializable
-
sealed
trait
Object extends AnyRef
PVS objects are theories, types, and expressions
-
case class
OptNamedDecl(id: Option[String], place: String, formals: List[FormalParameter], semi_colon_p: Boolean) extends Group with Product with Serializable
formal parameters only allowed if optional id is given
-
sealed
trait
TheoryExpr extends Object
the only theory expressions are references (names) however, those subsume instantiation of parameters and declarations
-
case class
TopDatatypeBody(named: NamedDecl, theory_formals: List[FormalParameter], importings: List[importing], _constructors: List[constructor]) extends Group with Product with Serializable
an ADT-like datatype declared at toplevel, see also InlineDatatypeBody
an ADT-like datatype declared at toplevel, see also InlineDatatypeBody
for historical reasons, imports can occur separately in addition to within formals although that is redundant
-
sealed
trait
Type extends Object with domain
PVS types
-
case class
UnnamedDecl(place: String, chain_p: Boolean, semi_colon_p: Boolean) extends Group with Product with Serializable
common parts of an unnamed declaration in a theory
- case class accessor(named: NamedDecl, _type: Type) extends Product with Serializable
-
case class
application(place: String, _fun: Expr, _arg: Expr, infix: Boolean) extends Expr with Product with Serializable
function application
-
case class
application_judgement(named: OptNamedDecl, _name: name_expr, arg_formals: List[bindings], tp: DeclaredType) extends Judgement with Product with Serializable
p: |- name(arg_formals) : A
- case class assignment(place: String, assignment_args: List[assignment_arg], _expr: Expr) extends update_assignment with Product with Serializable
- sealed trait assignment_arg extends AnyRef
-
case class
assumption(named: ChainedDecl, assertion: Assertion) extends AssumingDecl with Product with Serializable
a: F for a formula F (semantically, an axiom in the list of formal parameters, becomes tcc when instantiating the theory)
-
case class
auto_rewrite(unnamed: UnnamedDecl, key: String, kind: String, _rewrite_name: List[rewrite_name]) extends Decl with Product with Serializable
name of a formula that is loaded as a conditional rewrite rule
-
case class
axiom_decl(named: ChainedDecl, assertion: Assertion) extends Decl with Product with Serializable
a: F for a formula F
- case class binding(id: String, named: ChainedDecl, _type: Type) extends domain with Product with Serializable
-
case class
bindings(_bindings: List[binding]) extends Product with Serializable
list of variable bindings
-
case class
cases_expr(place: String, _expr: Expr, _selections: List[selection]) extends Expr with Product with Serializable
one-level pattern matching of an expression against a list of cases
-
case class
codatatype(body: TopDatatypeBody) extends Module with Product with Serializable
a top-level datatype with greatest fixed point semantics
-
case class
coercion_expr(place: String, _of: Expr, _to: Type) extends Expr with Product with Serializable
(a :: A), coerce a to A, which must be compatible with the type of a
-
case class
coind_decl(named: NamedDecl, arg_formals: List[bindings], tp: DeclaredType, _body: Expr) extends Decl with Product with Serializable
coinductive definition
-
case class
cond(_if: Expr, _then: Expr) extends Product with Serializable
if -> then (case in a condition expression)
-
case class
cond_expr(place: String, conditions: List[cond]) extends Expr with Product with Serializable
condition expression, i.e., if-expression with multiple cases (checked for disjointness and exhaustiveness)
-
case class
const_decl(named: ChainedDecl, arg_formals: List[bindings], tp: DeclaredType, _def: Option[Expr]) extends Decl with Product with Serializable
c(G) : A [= t]
-
case class
constructor(named: NamedDecl, ordnum: Int, accessors: List[accessor], recognizer: String, subtype_id: Option[String]) extends Product with Serializable
constructor of an inductive data type
constructor of an inductive data type
- ordnum
constructors are numbered consecutively for convenience
-
case class
conversion_decl(unnamed: UnnamedDecl, kind: String, _expr: Expr) extends Decl with Product with Serializable
conversion f (makes f an implicit conversion)
-
case class
cotuple_type(place: String, _arguments: List[Type]) extends Type with Product with Serializable
A1 + ...
A1 + ... + An
-
case class
datatype(body: TopDatatypeBody) extends Module with Product with Serializable
a top-level datatype with least fixed point semantics
-
case class
declref(href: String) extends Product with Serializable
attempt to represent pointers a xlinks; changed to integer-index in list of overloaded id in that theory
-
case class
def_decl(named: ChainedDecl, arg_formals: List[bindings], tp: DeclaredType, _def: Expr, _measure: Option[Expr], _order: Option[Expr]) extends Decl with Product with Serializable
c(G) : A [= t] where c is a recursive function
-
sealed
trait
domain extends AnyRef
A domain is a type, possibly binding a variable
A domain is a type, possibly binding a variable
Its two cases unify the simple and dependent cases of product and function types
The only way to create dependent types is via predicate subtypes (including declared ones).
- case class enumtype_decl(named: NamedDecl, enum_elts: List[id]) extends Decl with Product with Serializable
-
case class
exists_expr(place: String, bindings: List[binding], _body: Expr) extends Expr with Product with Serializable
existential quantifier
- case class exporting(place: String, exporting_kind: String, exporting_names_: exporting_names, exporting_but_names_: exporting_names, exporting_theory_names: List[theory_name]) extends Product with Serializable
- case class exporting_names(name: List[name]) extends Group with Product with Serializable
-
case class
expr_as_type(place: String, _expr: Expr, _type: Option[Type]) extends Type with Product with Serializable
(p): type, for a predicate p: _type = a => bool; _
-
case class
expr_judgement(named: OptNamedDecl, bindings: List[binding], _expr: Expr, tp: DeclaredType) extends Judgement with Product with Serializable
p: |- t: A (some limitations on t)
-
case class
field_appl_expr(place: String, id: String, _expr: Expr) extends Expr with Product with Serializable
named projection from a record
- case class field_assign(place: String, id: String) extends assignment_arg with Product with Serializable
- case class field_decl(named: NamedDecl, _type: Type) extends Product with Serializable
-
case class
forall_expr(place: String, bindings: List[binding], _body: Expr) extends Expr with Product with Serializable
universal quantifier
-
case class
formal_const_decl(named: ChainedDecl, tp: DeclaredType) extends FormalParameter with Product with Serializable
typed constant -- c:A for a type A
-
case class
formal_subtype_decl(named: ChainedDecl, ne: NonEmptiness, _sup: Type, _pred: const_decl) extends FormalParameter with Product with Serializable
type with given supertype -- a TYPE FROM A for a type A
-
case class
formal_theory_decl(named: ChainedDecl, _name: theory_name) extends FormalParameter with Product with Serializable
model of a theory -- m: T for a theory T
-
case class
formal_type_decl(named: ChainedDecl, ne: NonEmptiness) extends FormalParameter with Product with Serializable
type -- a TYPE
-
case class
formula_decl(named: ChainedDecl, assertion: Assertion) extends Decl with Product with Serializable
a: F for a formula F (has proof, which is not exported)
-
case class
function_type(place: String, _from: domain, _to: Type) extends Type with Product with Serializable
A -> B or (x:A) -> B
- case class id(_id: String) extends Product with Serializable
-
case class
if_expr(place: String, _if: Expr, _then: Expr, _else: Expr) extends Expr with Product with Serializable
if-then-else expression
-
case class
importing(unnamed: UnnamedDecl, _name: theory_name) extends Decl with FormalParameter with Product with Serializable
include T, can occur in formal parameters without semantic change in case parameters already need included declarations
-
case class
ind_decl(named: NamedDecl, arg_formals: List[bindings], tp: DeclaredType, _body: Expr) extends Decl with Product with Serializable
inductive definition
-
case class
inline_codatatype(body: InlineDatatypeBody) extends Decl with Product with Serializable
an inline ADT with greatest fixed point semantics
-
case class
inline_datatype(body: InlineDatatypeBody) extends Decl with Product with Serializable
an inline ADT with least fixed point semantics
-
case class
lambda_expr(place: String, bindings: List[binding], _body: Expr) extends Expr with Product with Serializable
lambda abstraction
- case class let_binding(named: ChainedDecl, _type: Type, _expr: Expr) extends Product with Serializable
-
case class
let_expr(place: String, let_bindings: List[let_binding], _body: Expr) extends Expr with Product with Serializable
let expression
-
case class
lib_decl(id: String, unnamed: UnnamedDecl, library: String) extends Decl with Product with Serializable
assigns a short name to a library (= folder)
-
case class
list_expr(place: String, _arguments: List[Expr]) extends Expr with Product with Serializable
list
-
case class
macro_decl(named: ChainedDecl, arg_formals: List[bindings], tp: DeclaredType, _def: Option[Expr]) extends Decl with Product with Serializable
defined constant that is always expanded
- case class maplet(place: String, assignment_args: List[assignment_arg], _expr: Expr) extends update_assignment with Product with Serializable
-
sealed
trait
mapping extends AnyRef
superclass of instantiations and renaming when forming theories
-
case class
mapping_rename(mapping_rhs: name, mapping_lhs: Object) extends mapping with Product with Serializable
c ~> c'
-
case class
mapping_subst(mapping_rhs: name, mapping_lhs: Object) extends mapping with Product with Serializable
c := c'
-
case class
name(id: String, theory_id: String, library_id: String, mappings: List[mapping], target: Option[theory_name], actuals: List[Object], dactuals: List[Object]) extends Group with Product with Serializable
user-provided reference to a symbol
user-provided reference to a symbol
- id
theory name
- library_id
library (in particular, as declared by lib_decl)
- mappings
instantiations/renaming for
- target
abbreviation for substituting a set of names at once by the declarations of the same local name in a different theory
- actuals
instantiations for the formal parameters (positional, full)
-
case class
name_expr(place: String, name: name, _type: Option[Type], _resolution: resolution) extends Expr with Product with Serializable
reference to a declared name
reference to a declared name
- name
the user-provided reference
- _type
the type disambiguating overloading (can be computed from resolution)
-
case class
name_judgement(named: OptNamedDecl, _name: name_expr, tp: DeclaredType) extends Judgement with Product with Serializable
p: |- name: A (special case of expr_judgement)
-
case class
number_expr(place: String, _num: BigInt) extends Expr with Product with Serializable
number literal
-
case class
number_judgement(named: OptNamedDecl, _number: number_expr, tp: DeclaredType) extends Judgement with Product with Serializable
p: |- number: A (special case of expr_judgement)
-
case class
proj_appl_expr(place: String, _expr: Expr, index: Int) extends Expr with Product with Serializable
n-th projection applied to an argument
- case class proj_assign(place: String, _index: Int) extends assignment_arg with Product with Serializable
-
case class
proj_expr(place: String, _index: Int) extends Expr with Product with Serializable
n-th projection (as a polymorphic function, turned into lambda with fresh type variable by type checker)
-
case class
pvs_file(_modules: List[Module]) extends Product with Serializable
a pvs file containing some modules
-
case class
rational_expr(place: String, _s: String) extends Expr with Product with Serializable
rational literal
-
case class
record_expr(place: String, _assignments: List[assignment]) extends Expr with Product with Serializable
record
-
case class
record_type(place: String, _fields: List[field_decl]) extends Type with Product with Serializable
{f1:A1, ..., fn: An}
-
case class
resolution(_theory: theory_name, index: Int) extends Product with Serializable
internal resolution of an overloaded declaration (including formal parameters) of a theory
internal resolution of an overloaded declaration (including formal parameters) of a theory
- index
the position in the list of overloaded declarations in that theory, starting from 0
-
case class
rewrite_name(place: String, kind: Option[String], name: name, _res: Option[resolution], _spec: Option[rewrite_name_spec]) extends Product with Serializable
reference to a formula that is to be used in rewriting
-
case class
rewrite_name_spec() extends Product with Serializable
user-provided information for disambiguation in a rewrite_name
-
case class
selection(place: String, _cons: name_expr, bindings: List[binding], _expr: Expr) extends Product with Serializable
case in a case expression -- cons(bindings) : _expr
-
case class
set_expr(place: String, bindings: List[binding], _body: Expr) extends Expr with Product with Serializable
equal to lambda, convenience for using predicates as (expression-level) sets
-
case class
setsubtype(place: String, _type: Type, _by: Expr) extends Type with Product with Serializable
predicate subtype -- A|F, e.g., A | lambda x:A|F
-
case class
string_expr(place: String, _str: String) extends Expr with Product with Serializable
string literal
-
case class
subtype_judgement(named: OptNamedDecl, sub: DeclaredType, sup: DeclaredType) extends Judgement with Product with Serializable
p: |- A <: B
-
case class
table_expr(place: String) extends Expr with Product with Serializable
table expressions, similar to 2-dimensional arrays
-
case class
tcc_decl(named: ChainedDecl, assertion: Assertion) extends Decl with Product with Serializable
a: F for a formula (for a proof obligation, prepended to a declaration by the type checker)
- case class theory(named: NamedDecl, theory_formals: List[FormalParameter], assuming: List[AssumingDecl], exporting_: Option[exporting], _decls: List[Decl]) extends Module with Product with Serializable
-
case class
theory_decl(named: ChainedDecl, _domain: theory_name) extends Decl with Product with Serializable
named import (parameters, instantiations, and renamings are part of the name); rnc to be revisited
-
case class
theory_name(place: String, id: String, library_id: String, mappings: List[mapping], target: Option[theory_name], actuals: List[Object], dactuals: List[Object]) extends TheoryExpr with Product with Serializable
user-provided reference to a module
user-provided reference to a module
- id
theory name
- library_id
library (in particular, as declared by lib_decl)
- mappings
instantiations/renaming for
-
case class
tuple_expr(place: String, _arguments: List[Expr]) extends Expr with Product with Serializable
tuple
-
case class
tuple_type(place: String, _domains: List[domain]) extends Type with Product with Serializable
flexary, possibly dependent product -- e.g., A1 * (x2:A2) * ...
flexary, possibly dependent product -- e.g., A1 * (x2:A2) * ... * An
-
case class
type_application(place: String, _type: type_name, _arguments: List[Expr]) extends Type with Product with Serializable
a(args)
-
case class
type_decl(named: ChainedDecl, nonempty_p: Boolean) extends Decl with Product with Serializable
a TYPE (may be asserted to be non-empty
-
case class
type_def_decl(named: NamedDecl, ne: NonEmptiness, arg_formals: List[bindings], df: DeclaredType) extends Decl with Product with Serializable
a(arg_formals) TYPE = A (defined types may be dependent)
- case class type_extension(place: String, _type: Type, _by: Type) extends Type with Product with Serializable
-
case class
type_from_decl(named: ChainedDecl, nonempty_p: Boolean, tp: DeclaredType) extends Decl with Product with Serializable
a TYPE FROM A (a is subtype of A)
-
case class
type_name(place: String, name: name, _res: Option[resolution]) extends Type with Product with Serializable
a
- sealed trait update_assignment extends AnyRef
-
case class
update_expr(place: String, _exp: Expr, assignments: List[update_assignment]) extends Expr with Product with Serializable
change value in a tuple, record, or function
-
case class
var_decl(id: String, unnamed: UnnamedDecl, tp: DeclaredType) extends Decl with Product with Serializable
x: A (declares type of future variables)
- case class varname_expr(place: String, id: String, _type: Type) extends Expr with Product with Serializable
Value Members
-
def
makeParser: XMLToScala
- returns
a parser that takes PVS XML and returns classes in this package The parser uses info.kwarc.mmt.api.utils.XMLToScala. That means the parser does not have to be changed if the classes in this package are changed. Instead, the parser is generated automatically using Scala reflection, i.e., the classes in this package define the grammar of the parser.