Skip to content

Instantly share code, notes, and snippets.

@ammkrn
Created March 24, 2022 18:58
Show Gist options
  • Select an option

  • Save ammkrn/3b1bbd23349695093359d61e428a8576 to your computer and use it in GitHub Desktop.

Select an option

Save ammkrn/3b1bbd23349695093359d61e428a8576 to your computer and use it in GitHub Desktop.
> Include: ./preamble.catala_en
## 26 U.S. Code § 1041 - Transfers of property between spouses or incident to divorce
```catala-metadata
declaration enumeration MaritalStatus:
-- Married
-- DivorcedAsOf content duration
# The transferee can either be a spouse (or former spouse), or a trust
# for the benefit of the spouse/former spouse.
declaration enumeration Transferee:
-- SpouseOrFormerSpouse
# content is the sum of the liabilities assumed by the trust, and the
# liabilites to which the property is subject. See `Test2` for an example.
-- Trust content money
declaration scope Section1041:
input transferor_adjusted_basis content money
input transferee content Transferee
input transfer_date content date
input marital_status_as_of_transfer_date content MaritalStatus
input transfer_related_to_cessation_of_marriage content boolean
input spouse_or_former_spouse_is_nonresident_alien content boolean
output gain_or_loss_recognized content money
output transferee_adjusted_basis content money
output characterization content Characterization
```
### (a) General rule
No gain or loss shall be recognized on a transfer of property from an individual to (or in trust for the benefit of)—
```catala
# The left hand side of this conjunction is guaranteed by the type, but I think
# you would want it to be explicit in a doc-like output.
scope Section1041 under condition
(transferee with pattern SpouseOrFormerSpouse or transferee with pattern Trust of _)
and (a_1 or a_2):
definition gain_or_loss_recognized equals $0
```
(1) a spouse, or
```catala
scope Section1041:
definition a_1 equals marital_status_as_of_transfer_date with pattern Married
```
(2) a former spouse, but only if the transfer is incident to the divorce.
```catala
scope Section1041:
definition a_2 equals transfer_incident_to_divorce
```
### (b) Transfer treated as gift; transferee has transferor’s basis
In the case of any transfer of property described in subsection (a)—
(1) for purposes of this subtitle, the property shall be treated as acquired by the transferee by gift, and
```catala
scope Section1041 under condition subsection_a:
definition characterization equals Gift
```
(2) the basis of the transferee in the property shall be the adjusted basis of the transferor.
```catala
scope Section1041 under condition subsection_a:
definition transferee_adjusted_basis equals transferor_adjusted_basis
```
### (c) Incident to divorce
For purposes of subsection (a)(2), a transfer of property is incident to the divorce if such transfer—
```catala
scope Section1041:
definition transfer_incident_to_divorce equals c_1 or c_2
```
(1) occurs within 1 year after the date on which the marriage ceases, or
```catala
scope Section1041:
definition c_1 equals
match marital_status_as_of_transfer_date with pattern
-- DivorcedAsOf of divorce_date: transfer_date -@ divorce_date <=^ 1 year and divorce_date <= transfer_date
```
(2) is related to the cessation of the marriage.
```catala
scope Section1041:
definition c_2 equals transfer_related_to_cessation_of_marriage
```
### (d) Special rule where spouse is nonresident alien
Subsection (a) shall not apply if the spouse (or former spouse) of the individual
making the transfer is a nonresident alien.
```catala
scope Section1041:
if spouse_or_former_spouse_is_nonresident_alien then not subsection_a
```
### (e) Transfers in trust where liability exceeds basis
Subsection (a) shall not apply to the transfer of property in trust to the extent that—
(1) the sum of the amount of the liabilities assumed, plus the amount of the liabilities
to which the property is subject, exceeds
(2) the total of the adjusted basis of the property transferred.
Proper adjustment shall be made under subsection (b) in the basis of the transferee in
such property to take into account gain recognized by reason of the preceding sentence.
```catala
scope Section1041 under condition subsection_a and transferee with pattern Trust of sum_liabilities:
let recognized := max $0 (sum_liabilities -$ transferee_adjusted_basis)
gain_or_loss_recognized += recognized
transferee_adjusted_basis += recognized
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment