From ccdf5d88f6239d7e8af6b53f3a73d4fdde384b61 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 27 Oct 2020 17:37:40 +0100 Subject: [PATCH] Beginning to formalize US tax code section 121 --- examples/us_tax_code/section_121.catala_en | 140 +++++++++++++++++++++ examples/us_tax_code/us_tax_code.catala_en | 2 + 2 files changed, 142 insertions(+) create mode 100644 examples/us_tax_code/section_121.catala_en diff --git a/examples/us_tax_code/section_121.catala_en b/examples/us_tax_code/section_121.catala_en new file mode 100644 index 00000000..92238984 --- /dev/null +++ b/examples/us_tax_code/section_121.catala_en @@ -0,0 +1,140 @@ +@@Section 121@@ + +@@Begin metadata@@ +/* +declaration structure PropertyOwnagePeriod: + data owner content Person + data user content Person + data start_date content date + data end_date content date + +declaration structure Property: + data ownages content collection PropertyOwnagePeriod + +declaration structure SaleOrExchange: + data property content Property + data gain content amount + data date_of_sale_or_exchange content date + +declaration scope Section121: + context taxpayer content Person + context applicable condition + context maximum_gain_excluded content amount + context gain_considered_for_exclusion content amount + context sale_or_exchange content SaleOrExchange + context included_in_gross_income condition + context ownage_considered_for_gain_inclusion condition + depends on PropertyOwnagePeriod + context joint_return condition + context taxable_year content integer + context joint_return condition + context condition_b_2 condition +*/ +@@End metadata@@ + +@(a) Exclusion@ + +Gross income shall not include gain from the sale or exchange of property if, during the 5-year period ending on the date of the sale or exchange, such property has been owned and used by the taxpayer as the taxpayer’s principal residence for periods aggregating 2 years or more. +/* +scope Section121: + definition ownage_considered_for_gain_inclusion of ownage equals + ownage.owner = taxpayer and ownage.user = taxpayer and + ownage.end_date - ownage.start_date >= 2 year and + ownage.start_data >= sale_or_exchange.date_of_sale_or_exchange - 5 year + + rule included_in_gross_income under condition + exists ownage in sale_or_exchange.property.ownages such that + ownage_considered_for_gain_inclusion of ownage + consequence not fulfilled +*/ + +@@(b) Limitations@@+ + +@(1) In general@ + +The amount of gain excluded from gross income under subsection (a) with respect to any sale or exchange shall not exceed $250,000. +/* +scope Section121: + definition maximum_gain_excluded equals $250,000 + + definition gain_considered_for_exclusion equals + if sale_or_exchange.gain >= maximum_gain_excluded then + maximum_gain_excluded + else + sale_or_exchange.gain +*/ + +@(2) Special rules for joint returns@ + +In the case of a husband and wife who make a joint return for the taxable year of the sale or exchange of the property— + +/* +scope Section121: + rule condition_b_2 under condition + joint_return and + taxable_year = get_year of sale_or_exchange.date_of_sale_or_exchange + consequence fulfilled +*/ + + +@(A) $500,000 Limitation for certain joint returns@ + +Paragraph (1) shall be applied by substituting “$500,000” for “$250,000” if— + + +(i) either spouse meets the ownership requirements of subsection (a) with +respect to such property; + +(ii) both spouses meet the use requirements of subsection (a) with respect to +such property; and + +(iii) neither spouse is ineligible for the benefits of subsection (a) with +respect to such property by reason of paragraph (3). + +@(B) Other joint returns@ +If such spouses do not meet the requirements of subparagraph (A), the limitation under paragraph (1) shall be the sum of the limitations under paragraph (1) to which each spouse would be entitled if such spouses had not been married. For purposes of the preceding sentence, each spouse shall be treated as owning the property during the period that either spouse owned the property. + +@@(3) Application to only 1 sale or exchange every 2 years@@++ + +Subsection (a) shall not apply to any sale or exchange by the taxpayer if, during the 2-year period ending on the date of such sale or exchange, there was any other sale or exchange by the taxpayer to which subsection (a) applied. + +@@(4) Special rule for certain sales by surviving spouses@@++ + +In the case of a sale or exchange of property by an unmarried individual whose spouse is deceased on the date of such sale, paragraph (1) shall be applied by substituting “$500,000” for “$250,000” if such sale occurs not later than 2 years after the date of death of such spouse and the requirements of paragraph (2)(A) were met immediately before such date of death. + +@@(5) Exclusion of gain allocated to nonqualified use@@++ + +@(A) In general@ + +Subsection (a) shall not apply to so much of the gain from the sale or exchange of property as is allocated to periods of nonqualified use. + +@(B) Gain allocated to periods of nonqualified use@ + +For purposes of subparagraph (A), gain shall be allocated to periods of nonqualified use based on the ratio which— +(i) the aggregate periods of nonqualified use during the period such property was owned by the taxpayer, bears to +(ii) the period such property was owned by the taxpayer. + +@@(C) Period of nonqualified use@@+++ + +For purposes of this paragraph— + +@(i) In general@ + +The term “period of nonqualified use” means any period (other than the portion of any period preceding January 1, 2009) during which the property is not used as the principal residence of the taxpayer or the taxpayer’s spouse or former spouse. + +@(ii) Exceptions@ + +The term “period of nonqualified use” does not include— + +(I) any portion of the 5-year period described in subsection (a) which is after the last date that such property is used as the principal residence of the taxpayer or the taxpayer’s spouse, + +(II) any period (not to exceed an aggregate period of 10 years) during which the taxpayer or the taxpayer’s spouse is serving on qualified official extended duty (as defined in subsection (d)(9)(C)) described in clause (i), (ii), or (iii) of subsection (d)(9)(A), and + +(III) any other period of temporary absence (not to exceed an aggregate period of 2 years) due to change of employment, health conditions, or such other unforeseen circumstances as may be specified by the Secretary. +@(D) Coordination with recognition of gain attributable to depreciation@ + +For purposes of this paragraph— + +(i) subparagraph (A) shall be applied after the application of subsection (d)(6), and + +(ii) subparagraph (B) shall be applied without regard to any gain to which subsection (d)(6) applies. diff --git a/examples/us_tax_code/us_tax_code.catala_en b/examples/us_tax_code/us_tax_code.catala_en index a929de91..4fb9039a 100644 --- a/examples/us_tax_code/us_tax_code.catala_en +++ b/examples/us_tax_code/us_tax_code.catala_en @@ -2,6 +2,8 @@ @@Include: preamble.catala_en@@ +@@Include: section_121.catala_en@@ + @@Include: section_132.catala_en@@ @@Include: section_1015.catala_en@@