diff --git a/docs/Style.thy b/docs/Style.thy index 86ac86afa0..48ec6b1366 100644 --- a/docs/Style.thy +++ b/docs/Style.thy @@ -227,6 +227,43 @@ lemma test_lemma3: case_tac h; simp) done + +section \Fact transformers and attributes\ + +text \ + For simple cases, standard approach applies: comma-separated list with one space after commas:\ + +lemmas attr1 = conj_absorb[THEN iffD2, OF conj_absorb, simplified] \ \basic case\ + +text \ + When the transform is more complex or runs out of horizontal room, wrapping is needed. + In most cases, reconfiguring the attributes into a vertical list should suffice:\ + +lemmas attr2 = conj_absorb[THEN iffD2, + OF conj_absorb[where A="A \ B \ C \ D \ E \ F \ G" for A B C D E F G, + simplified], + simplified] \ \simple wrapping case\ + +text \ + When terms get even larger, the transforms more complicated, or we start running into the column + limit, more wrapping is needed. We can gain extra space by indenting from the fact name:\ + +lemmas attr3 = conj_absorb[ \ \note the @{text "["} to indicate transform\ + THEN iffD2, + OF conj_absorb[where A="A \ B \ C \ D \ E \ F \ G" for A B C D E F G, + simplified], + simplified] \ \extreme wrapping case\ + +text \ + There is an important principle here: telling apart transformed/attributed facts from unaltered + facts at a glance. In other words avoid:\ + +lemmas attrb = conj_absorb \ \BAD: at first glance looks to be an unmodified fact\ + [THEN iffD2 (*...*)] + +lemmas attrb2 = conj_absorb [THEN iffD2 (*...*)] \ \avoid: still needs some mental processing\ + + section \Right vs left operator-wrapping\ text \