| `Remark -> "remark"
| `Theorem -> "theorem"
| `Variant -> "variant"
+ | `Axiom -> "axiom"
let pp_fields fields =
(if fields <> [] then "\n" else "") ^
* - name is absent when an unnamed theorem is being proved, tipically in
* interactive usage
* - body is present when its given along with the command, otherwise it
- * will be given in proof editing mode using the tactical language
+ * will be given in proof editing mode using the tactical language,
+ * unless the flavour is an Axiom
*)
| Record of (string * term) list * string * term * (string * term * bool) list
(** left parameters, name, type, fields *)
| `Remark
| `Theorem
| `Variant
+ | `Axiom
]
type object_class =
| [ "value", "remark"] -> Obj_flavour `Remark
| [ "value", "theorem"] -> Obj_flavour `Theorem
| [ "value", "variant"] -> Obj_flavour `Variant
+ | [ "value", "axiom"] -> Obj_flavour `Axiom
| _ -> attribute_error ())
| "class" ->
let class_modifiers = pop_class_modifiers ctxt in
| `Remark -> Xml.xml_empty "flavour" [None, "value", "remark"]
| `Theorem -> Xml.xml_empty "flavour" [None, "value", "theorem"]
| `Variant -> Xml.xml_empty "flavour" [None, "value", "variant"]
+ | `Axiom -> Xml.xml_empty "flavour" [None, "value", "axiom"]
in
let xml_attr_of = function
| `Generated -> Xml.xml_empty "generated" []
| CicNotationPt.Theorem (flavour, name, ty, bo) ->
let attrs = [`Flavour flavour] in
let ty' = interpretate_term [] env None false ty in
- (match bo with
- None ->
+ (match bo,flavour with
+ None,`Axiom ->
+ Cic.Constant (name,None,ty',[],attrs)
+ | Some bo,`Axiom -> assert false
+ | None,_ ->
Cic.CurrentProof (name,[],Cic.Implicit None,ty',[],attrs)
- | Some bo ->
+ | Some bo,_ ->
let bo' = Some (interpretate_term [] env None false bo) in
Cic.Constant (name,bo',ty',[],attrs))
body = term ->
GrafiteAst.Obj (loc,
Ast.Theorem (flavour, name, Ast.Implicit, Some body))
+ | IDENT "axiom"; name = IDENT; SYMBOL ":"; typ = term ->
+ GrafiteAst.Obj (loc, Ast.Theorem (`Axiom, name, typ, None))
| "let"; ind_kind = [ "corec" -> `CoInductive | "rec"-> `Inductive ];
defs = CicNotationParser.let_defs ->
let name,ty =
(univgraphuri,xmlunivgraphpath) ::
(* now the optional body, both write and register *)
(match bodyxml,bodyuri with
- None,None -> []
+ None,_ -> []
| Some bodyxml,Some bodyuri->
ensure_path_exists xmlbodypath;
Xml.pp ~gzip:true bodyxml (Some xmlbodypath);
<keyword>fact</keyword>
<keyword>remark</keyword>
<keyword>variant</keyword>
+ <keyword>axiom</keyword>
</keyword-list>
<keyword-list _name = "Commands" style = "Keyword" case-sensitive="TRUE">