the target language is: prolog. % Division 36 loss sequencing, written out as executable rules. % Every rule below is a statement of law. Above each one, in plain words, is what % we think it says. If any of those statements is wrong, our fix will be wrong. % % ITAA 1997 s 36-10 how a tax loss is calculated % ITAA 1997 s 36-15 how earlier year tax losses are deducted (non-corporate) % ITAA 1997 s 36-20 what net exempt income means % ITAA 1997 s 6-20 exempt income % ITAA 1997 s 6-23 non-assessable non-exempt income the templates are: *a taxpayer* has deductions of *an amount* in *a year*. *a taxpayer* has assessable income of *an amount* in *a year*. *a taxpayer* has a loss brought forward of *an amount* into *a year*. *a taxpayer* receives *a receipt* of *an amount* in *a year*. *a receipt* is exempt income under *a provision*. *a receipt* is not assessable and not exempt under *a provision*. *a taxpayer* incurs expenses of *an amount* in earning *a receipt*. *a taxpayer* has expenses of *an amount* in earning *a receipt*. *a taxpayer* has net exempt income of *an amount* in *a year*. *a taxpayer* has an excess of deductions of *an amount* in *a year*. *a taxpayer* has a tax loss of *an amount* for *a year*. *a taxpayer* has net exempt income left of *an amount* in *a year*. *a taxpayer* applies *an amount* against the loss brought forward in *a year*. *a taxpayer* carries forward *an amount* after *a year*. the knowledge base div36 includes: % Expenses of earning a receipt are whatever was incurred. a taxpayer has expenses of an amount in earning a receipt if the taxpayer incurs expenses of the amount in earning the receipt. % Where no expenses of earning the receipt have been identified, they are nil. a taxpayer has expenses of 0 in earning a receipt if the taxpayer receives the receipt of a gross amount in a year and it is not the case that the taxpayer incurs expenses of a cost in earning the receipt. % s 36-20. Net exempt income is exempt income reduced by the expenses of % earning it. It cannot be negative. a taxpayer has net exempt income of an amount in a year if the taxpayer receives a receipt of a gross amount in the year and the receipt is exempt income under a provision and the taxpayer has expenses of an expense amount in earning the receipt and a surplus = gross amount - expense amount and the maximum of the surplus and 0 is the amount. % s 6-23. Non-assessable non-exempt income is not exempt income, so it produces % no net exempt income and never enters any of the steps below. a taxpayer has net exempt income of 0 in a year if the taxpayer receives a receipt of a gross amount in the year and the receipt is not assessable and not exempt under a provision. % s 36-10, steps 1 and 2. The year's deductions, less the year's assessable % income. Nil where assessable income is the greater. a taxpayer has an excess of deductions of an amount in a year if the taxpayer has deductions of a deduction amount in the year and the taxpayer has assessable income of an assessable amount in the year and a shortfall = deduction amount - assessable amount and the maximum of the shortfall and 0 is the amount. % s 36-10, steps 3 and 4. Net exempt income is subtracted INSIDE the tax loss % calculation, not after it. There is a tax loss only to the extent an amount % remains: where net exempt income covers the excess, the tax loss is nil. a taxpayer has a tax loss of an amount for a year if the taxpayer has an excess of deductions of an excess amount in the year and the taxpayer has net exempt income of a net exempt amount in the year and a residue = excess amount - net exempt amount and the maximum of the residue and 0 is the amount. % s 36-15(4)(a). The excess of deductions over assessable income is taken off % net exempt income FIRST, before anything reaches the loss brought forward. a taxpayer has net exempt income left of an amount in a year if the taxpayer has net exempt income of a net exempt amount in the year and the taxpayer has an excess of deductions of an excess amount in the year and a remainder = net exempt amount - excess amount and the maximum of the remainder and 0 is the amount. % s 36-15(4)(b). The loss brought forward is then deducted from whatever net % exempt income is left, and no more than that. a taxpayer applies an amount against the loss brought forward in a year if the taxpayer has a loss brought forward of a brought forward amount into the year and the taxpayer has net exempt income left of a remaining amount in the year and the minimum of the brought forward amount and the remaining amount is the amount. % What goes into next year: this year's tax loss, plus so much of the loss % brought forward as was not absorbed. a taxpayer carries forward an amount after a year if the taxpayer has a tax loss of a year loss amount for the year and the taxpayer has a loss brought forward of a brought forward amount into the year and the taxpayer applies an absorbed amount against the loss brought forward in the year and the amount = year loss amount + brought forward amount - absorbed amount. % --------------------------------------------------------------------------- % Your figures. Wren Kavanagh is a stand-in for the client. % --------------------------------------------------------------------------- % 1. As reported: the 4,579 is exempt income, with no expenses of earning it. scenario as reported is: Wren Kavanagh has deductions of 2822 in FY2026. Wren Kavanagh has assessable income of 0 in FY2026. Wren Kavanagh has a loss brought forward of 3286 into FY2026. Wren Kavanagh receives the pension of 4579 in FY2026. the pension is exempt income under section 52-10. net exempt income expects answers ["Wren Kavanagh has net exempt income of 4579 in FY2026"]. this year loss expects answers ["Wren Kavanagh has a tax loss of 0 for FY2026"]. applied expects answers ["Wren Kavanagh applies 1757 against the loss brought forward in FY2026"]. carried forward expects answers ["Wren Kavanagh carries forward 1529 after FY2026"]. % 2. If the 4,579 turns out to be non-assessable non-exempt income instead. % Then no offset arises at all, at either step. scenario if nane is: Wren Kavanagh has deductions of 2822 in FY2026. Wren Kavanagh has assessable income of 0 in FY2026. Wren Kavanagh has a loss brought forward of 3286 into FY2026. Wren Kavanagh receives the payment of 4579 in FY2026. the payment is not assessable and not exempt under section 59-30. net exempt income expects answers ["Wren Kavanagh has net exempt income of 0 in FY2026"]. this year loss expects answers ["Wren Kavanagh has a tax loss of 2822 for FY2026"]. applied expects answers ["Wren Kavanagh applies 0 against the loss brought forward in FY2026"]. carried forward expects answers ["Wren Kavanagh carries forward 6108 after FY2026"]. % 3. If the 4,579 is a gross figure and there were expenses of earning it. % Illustrated with 500. Every dollar of expense adds a dollar to the % carry-forward, so this one matters if any expenses were incurred. scenario if expenses is: Wren Kavanagh has deductions of 2822 in FY2026. Wren Kavanagh has assessable income of 0 in FY2026. Wren Kavanagh has a loss brought forward of 3286 into FY2026. Wren Kavanagh receives the pension of 4579 in FY2026. the pension is exempt income under section 52-10. Wren Kavanagh incurs expenses of 500 in earning the pension. net exempt income expects answers ["Wren Kavanagh has net exempt income of 4079 in FY2026"]. this year loss expects answers ["Wren Kavanagh has a tax loss of 0 for FY2026"]. applied expects answers ["Wren Kavanagh applies 1257 against the loss brought forward in FY2026"]. carried forward expects answers ["Wren Kavanagh carries forward 2029 after FY2026"]. query net exempt income is: which taxpayer has net exempt income of which amount in which year. query this year loss is: which taxpayer has a tax loss of which amount for which year. query applied is: which taxpayer applies which amount against the loss brought forward in which year. query carried forward is: which taxpayer carries forward which amount after which year.