5D Library › Four-Pillar Calendrical Computation and Formal Rule Engines · 中文

Chapter 7. The Yuanhai ziping, the Sanming tonghui and the Ditian sui

Why read these sources here

Each rule of the first six chapters has a textual source: taking the day stem as master, the ten gods and the hidden stems come from the Ziping books of the Song and later; “three days count as one year” and the days in command appear in Ming compilations; and the Ditian sui raises the judgement of strength to the key of the whole art. This chapter returns to those texts, checks the statements the models rest on, and marks where reading turns into interpretation.

The Yuanhai ziping and taking the day as master

The Yuanhai ziping, credited to Xu Sheng of the Song and presented as the method of Xu Ziping, takes the day stem as the “self” and reads the stems and branches of year, month and hour by their relation to it (Xu, n.d.). The ten gods of Chapter 4 formalise this “day as master”: once the day stem is fixed, each of the other nine stems corresponds to one god, which is just a coordinate system on ℤ5×ℤ2\mathbb{Z}_5 \times \mathbb{Z}_2 with the day stem at the origin. The names and derivation of the ten gods agree broadly across editions today; this book uses only their structure, not the verdicts attached to them.

The Sanming tonghui: days in command and the start of luck

Wan Minying’s Sanming tonghui of the Ming is the great compilation of the Ziping art (Wan, n.d.). It and the Yuanhai ziping both give the “days in command” of each month, sharing the month’s thirty days among a few stems. The weighting S3 of Chapter 4 uses one common version.

Calculation

# Chapter 7. Two classical tables read as data.
# (1) "Days in command" (one commonly printed version, as in p09): each
# month's 30 days are shared among stems. We check the sums, compare the
# stems with the hidden-stem list, and look at the proportions.
# (2) The luck-cycle rule "three days make one year": its usual glosses,
# one day = four months and one double-hour = ten days, assume a year of
# 360 days (12 months of 30). We check them against 360 and 365.2422.
BRANCHES = ("zi", "chou", "yin", "mao", "chen", "si", "wu", "wei", "shen",
            "you", "xu", "hai")
STEMS = ("jia", "yi", "bing", "ding", "wu", "ji", "geng", "xin", "ren",
         "gui")
HIDDEN = ((9,), (5, 9, 7), (0, 2, 4), (1,), (4, 1, 9), (2, 4, 6), (3, 5),
          (5, 3, 1), (6, 8, 4), (7,), (4, 7, 3), (8, 0))
DAYS = (((8, 10), (9, 20)), ((9, 9), (7, 3), (5, 18)),
        ((4, 7), (2, 7), (0, 16)), ((0, 10), (1, 20)),
        ((1, 9), (9, 3), (4, 18)), ((4, 5), (6, 9), (2, 16)),
        ((2, 10), (5, 9), (3, 11)), ((3, 9), (1, 3), (5, 18)),
        ((4, 10), (8, 3), (6, 17)), ((6, 10), (7, 20)),
        ((7, 9), (3, 3), (4, 18)), ((4, 7), (0, 5), (8, 18)))

if __name__ == "__main__":
    print("   branch  days (stem:days)              only in days"
          "  only in list")
    for b, name in enumerate(BRANCHES):
        stems = [s for s, _ in DAYS[b]]
        extra = [STEMS[s] for s in stems if s not in HIDDEN[b]]
        miss = [STEMS[s] for s in HIDDEN[b] if s not in stems]
        cells = " ".join("{}:{}".format(STEMS[s], d) for s, d in DAYS[b])
        print("   {:6s}  {:28s}  {:12s}  {}".format(
            name, cells, " ".join(extra) or "-", " ".join(miss) or "-"))
    print("   every month sums to 30 days: {}".format(
        all(sum(d for _, d in row) == 30 for row in DAYS)))
    tomb = [sorted(d for _, d in DAYS[b]) for b in (1, 4, 7, 10)]
    print("   the four storage branches (chou chen wei xu) split 30 as {}"
          .format(tomb[0]))
    print("   in all four: {}".format(all(t == [3, 9, 18] for t in tomb)))
    for year in (360, 365.2422):
        print("   year of {:8.4f} days: 1 day -> {:6.2f} days of age,"
              .format(year, year / 3))
        print("                            1 double-hour -> {:5.2f}".format(
            year / 3 / 12))
    print("\nReading: the days-in-command table sums correctly but does not")
    print("match the hidden-stem list in five branches; the storage branches")
    print("split their 30 days 18 / 9 / 3, the same 0.6 / 0.3 / 0.1 as S2.")
    print("The age glosses of the luck-cycle rule assume a 360-day year.")
#    branch  days (stem:days)              only in days  only in list
#    zi      ren:10 gui:20                 ren           -
#    chou    gui:9 xin:3 ji:18             -             -
#    yin     wu:7 bing:7 jia:16            -             -
#    mao     jia:10 yi:20                  jia           -
#    chen    yi:9 gui:3 wu:18              -             -
#    si      wu:5 geng:9 bing:16           -             -
#    wu      bing:10 ji:9 ding:11          bing          -
#    wei     ding:9 yi:3 ji:18             -             -
#    shen    wu:10 ren:3 geng:17           -             -
#    you     geng:10 xin:20                geng          -
#    xu      xin:9 ding:3 wu:18            -             -
#    hai     wu:7 jia:5 ren:18             wu            -
#    every month sums to 30 days: True
#    the four storage branches (chou chen wei xu) split 30 as [3, 9, 18]
#    in all four: True
#    year of 360.0000 days: 1 day -> 120.00 days of age,
#                             1 double-hour -> 10.00
#    year of 365.2422 days: 1 day -> 121.75 days of age,
#                             1 double-hour -> 10.15
#
# Reading: the days-in-command table sums correctly but does not
# match the hidden-stem list in five branches; the storage branches
# split their 30 days 18 / 9 / 3, the same 0.6 / 0.3 / 0.1 as S2.
# The age glosses of the luck-cycle rule assume a 360-day year.

Each month’s days add up to exactly thirty, but the stems listed disagree with the common hidden-stem list in five branches: zi, mao, wu, you and hai. The four storage branches (chou, chen, wei and xu) all split their days 18, 9 and 3, exactly the 0.6, 0.3 and 0.1 of S2; the proportions common in later software were very likely derived from the days in command.

The luck cycles start at three days to a year; the usual working rules add that one day counts as four months and one double-hour as ten days. The program shows that these glosses assume a year of 360 days (twelve months of thirty): with 360 days, one day gives 120 days of age and one double-hour 10.00 days; with the tropical year of 365.2422 days, 121.75 days and 10.15 days. The difference is small, but it shows that the working rules count in traditional whole months, not in astronomical years.

Note

Checking the editions. The days in command above are one common version; editions differ on the allocation in some months, such as shen and hai, and the conversion rules for the start of luck follow common paraphrase. This book uses this version; another edition can be used by replacing the corresponding table in the program.

The Ditian sui: the true mechanism of strength

Source text

Ditian sui, “Strength and Weakness”

能知衰旺之真機,其於三命之奧,思過半矣。

(Whoever knows the true mechanism of strength and weakness has more than half understood the mysteries of fate.)

(Jing Tu (attributed) et al., n.d.)

The Ditian sui, traditionally ascribed to Jing Tu with a commentary attributed to Liu Ji, and expanded in the Qing by Ren Tieqiao as the Ditian sui chanwei, is among the most esteemed theoretical works of the Ziping art. It puts strength at the centre of all judgement. The results of Chapter 5 confirm the weight of the sentence from the other side: strength is indeed the most decisive step of the whole judgement and the hardest to make uniform; three defensible parameter sets agree only moderately.

Hypothesis · not established

The author’s interpretation (not yet tested): that the Ditian sui stresses a “true mechanism” rather than giving numerical rules can be read as an admission that strength cannot be captured fully by one fixed set of parameters. What would show this reading wrong: a passage in the Ditian sui or its commentaries that gives numerical weights and thresholds explicitly, on which the commentators through the ages agree.

Summary

The Yuanhai ziping takes the day as master, and the ten gods are coordinates on ℤ5×ℤ2\mathbb{Z}_5 \times \mathbb{Z}_2 with the day stem at the origin. The days in command of the Sanming tonghui and other books fill thirty days each month but disagree with the hidden-stem list in five branches; the 18, 9 and 3 days of the storage branches are the 0.6, 0.3 and 0.1 common in software. The working rules for the start of luck assume a 360-day year. The Ditian sui treats strength as the key of the art, and Chapter 5 shows that it is also the step most dependent on convention.

References

Jing Tu (attributed), Liu Ji (attributed commentary), and Tieqiao Ren. n.d. Ditian Sui Chanwei [the Ditian Sui Elucidated]. In Chinese; Qing Dynasty Commentary by Ren Tieqiao.
Wan, Minying. n.d. Sanming Tonghui [Comprehensive Collection on the Three Fates]. In Chinese; Ming Dynasty.
Xu, Sheng. n.d. Yuanhai Ziping [the Sea of Ziping]. In Chinese; Song Dynasty, Later Expanded Editions.

Fan, Y. (2026). Four-Pillar Calendrical Computation and Formal Rule Engines: Julian-Day Sexagenary Cycles, Midnight-Boundary Disagreements, Birth-Time Sensitivity Bounds and Weighted-Graph Strength Scoring [四柱排盘的历法计算与规则引擎] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090180 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).