Skip to content

Commit

Permalink
logging for hb_instance
Browse files Browse the repository at this point in the history
  • Loading branch information
gares committed Jun 22, 2021
1 parent 1201b80 commit 8679ff3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions HB/common/log.elpi
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ log.coq.check Skel Ty T D :- std.do! [
log.private.log-vernac (log.private.coq.vernac.check Skel Fail),
].

pred refine i:term, i:goal, o:list sealed-goal. % to silence a warning, since this is only in tactics
pred log.refine i:term, i:goal, o:list sealed-goal.
log.refine T G GL :- std.do! [
refine T G GL,
G = goal _ _ _ Solution _,
log.private.log-tactic Solution,
].

namespace log.private {

%%%%% Logging Utils %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down Expand Up @@ -241,6 +249,7 @@ type coq.vernac.strategy list constant -> conversion_strategy -> coq.vernac

pred with-logging i:prop.
pred log.private.log-vernac i:log.private.coq.vernac.
pred log.private.log-tactic i:term.

/* Hierarchy Builder: algebraic hierarchies made easy
This software is released under the terms of the MIT license */
Expand Down Expand Up @@ -276,6 +285,11 @@ log.private.log-vernac V :- log.private.logger L Nice, !,
log.private.logger-extend L {PPALL => log.private.coq.vernac->pp [V]}.
log.private.log-vernac _.

log.private.log-tactic P :- log.private.logger L Nice, !,
if (Nice = tt) (PPALL = []) (PPALL = [@ppall!]),
log.private.logger-extend L {PPALL => coq.term->pp P}.
log.private.log-tactic _.

% The main entry point to print vernacular commands is coq.vernac->pp

shorten log.private.coq.vernac.{ begin-module , end-module , begin-section, end-section }.
Expand Down
2 changes: 1 addition & 1 deletion structures.v
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ solve (goal _ _ Statement _ Args as G) GLS :- with-attributes (with-logging (std

hb-instance Ty T Factory Instance,

std.assert! (refine Instance G GLS) "the instance does not solve the goal",
std.assert! (log.refine Instance G GLS) "the instance does not solve the goal",
])).

}}.
Expand Down

0 comments on commit 8679ff3

Please sign in to comment.