match where with
| C.ARel (_, _, i, premise) as v ->
let where = Some (premise, name) in
- let _script = convert_elim st ~name:(premise, i) t v e in
+(* let _script = convert_elim st ~name:(premise, i) t v e in *)
let script = mk_arg st what @ mk_arg st v (* @ script *) in
let st = {st with context = Cn.clear st.context premise} in
st, T.Rewrite (direction, what, where, e, dtext) :: script
assert (List.length tl = 5);
let predicate = List.nth tl 2 in
let e = Cn.mk_pattern 1 predicate in
- let script = convert_elim st t t e in
+ let script = [] (* convert_elim st t t e *) in
script @ [T.Rewrite (direction, where, None, e, dtext); T.Branch (qs, "")]
let rec proc_lambda st name v t =
let predicate = List.nth tl (parsno - i) in
let e = Cn.mk_pattern j predicate in
let using = Some hd in
- convert_elim st what what e @ script @
+ (* convert_elim st what what e @ *) script @
[T.Elim (where, using, e, dtext ^ text); T.Branch (qs, "")]
| None ->
let qs = proc_bkd_proofs (next st) synth [] classes tl in
| C.MutConstruct _ -> false
| _ -> true
+let is_atomic t = not (is_not_atomic t)
+
let get_ind_type uri tyno =
match E.get_obj Un.empty_ugraph uri with
| C.InductiveDefinition (tys, _, lpsno, _), _ -> lpsno, List.nth tys tyno
int -> Cic.context * Cic.term -> bool
val is_not_atomic:
Cic.term -> bool
+val is_atomic:
+ Cic.term -> bool
val get_ind_type:
UriManager.uri -> int -> int * Cic.inductiveType
val get_default_eliminator:
| C.LetIn (nname, vv, tt) when H.is_proof c v ->
let x = C.LetIn (nname, vv, C.LetIn (name, tt, S.lift_from 2 1 t)) in
HLog.warn "Optimizer: swap 1"; opt1_proof g true c x
- | v ->
+ | v when H.is_proof c v && H.is_atomic v ->
+ let x = S.subst v t in
+ HLog.warn "Optimizer: remove 5"; opt1_proof g true c x
+ | v ->
g (C.LetIn (name, v, t))
in
if es then opt1_term g es c v else g v
String.concat "" (List.map aux script) ^ "\n\n"
let txt_of_inline_macro style suri prefix =
+ let print_exc = function
+ | ProofEngineHelpers.Bad_pattern s as e ->
+ Printexc.to_string e ^ " " ^ Lazy.force s
+ | e -> Printexc.to_string e
+ in
let dbd = LibraryDb.instance () in
let sorted_uris = MetadataDeps.sorted_uris_of_baseuri ~dbd suri in
let map uri =
with
| e ->
Printf.sprintf "\n(* ERRORE IN STAMPA DI %s\nEXCEPTION: %s *)\n"
- (UriManager.string_of_uri uri) (Printexc.to_string e)
+ (UriManager.string_of_uri uri) (print_exc e)
in
String.concat "" (List.map map sorted_uris)
%.mo: preall
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) $@
%.mo.opt: preall.opt
- $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $@
+ $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $(@:.opt=)
preall:
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) init $(devel)
%.mo: preall
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) $@
%.mo.opt: preall.opt
- $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $@
+ $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $(@:.opt=)
preall:
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) init $(devel)
%.mo: preall
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) $@
%.mo.opt: preall.opt
- $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $@
+ $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $(@:.opt=)
preall:
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) init $(devel)
%.mo: preall
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) $@
%.mo.opt: preall.opt
- $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $@
+ $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $(@:.opt=)
preall:
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) init $(devel)
%.mo: preall
$(H)MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) $@
%.mo.opt: preall
- $(H)MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $@
+ $(H)MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $(@:.opt=)
preall:
$(H)MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) init $(devel)
%.mo: preall
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) $@
%.mo.opt: preall.opt
- $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $@
+ $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $(@:.opt=)
preall:
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) init $(devel)
software/matita/contribs/LAMBDA-TYPES/Unified-Sub
software/matita/contribs/LAMBDA-TYPES/Base-1
software/matita/contribs/LAMBDA-TYPES/LambdaDelta-1
+software/matita/contribs/LAMBDA-TYPES/Base-2
%.mo: preall
$(H)MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) $@
%.mo.opt: preall
- $(H)MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $@
+ $(H)MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $(@:.opt=)
preall:
$(H)MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) init $(devel)
%.mo: preall
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) $@
%.mo.opt: preall.opt
- $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $@
+ $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $(@:.opt=)
preall:
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) init $(devel)
%.mo: preall
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) $@
%.mo.opt: preall.opt
- $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $@
+ $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $(@:.opt=)
preall:
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) init $(devel)
%.mo: preall
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) $@
%.mo.opt: preall.opt
- $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $@
+ $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $(@:.opt=)
preall:
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) init $(devel)
%.mo: preall
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) $@
%.mo.opt: preall
- $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $@
+ $(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKEO) $(@:.opt=)
preall:
$(H)$(XXX) MATITA_FLAGS=$(MATITA_FLAGS) $(MMAKE) init $(devel)