Last active
May 31, 2022 11:41
-
-
Save ammkrn/4e9d35edea17fe200699a983c2b7d0f6 to your computer and use it in GitHub Desktop.
pseudocode_1041.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun | |
| (transferor_adjusted_basis : money) | |
| (transferor_holding_period : duration) | |
| (transferee : Transferee) | |
| (transfer_date : date) | |
| (marital_status_as_of_transfer_date : MaritalStatus) | |
| (related_to_cessation_of_marriage : boolean) | |
| (spouse_is_nonresident_alien : boolean) | |
| : Option (gain_loss_recognized : money, transferee_adjusted_basis : money, characterization) := | |
| // subsection_c | |
| let transfer_incident_to_divorce := | |
| related_to_cessation_of_marriage || (marital_status = Divorced(divorce_date) && (transfer_date - divorce_date) <= 1 year) | |
| // (subsection_a1 || subsection_a2) && !subsection_d | |
| if (marital_status = Married || transfer_incident_to_divorce) && !spouse_is_nonresident_alien { | |
| // subsection_a | |
| let mut gain_loss_recognized := $0 | |
| // subsection_b | |
| let mut transferee_adjusted_basis := transferor_adjusted_basis | |
| // subsection_e | |
| if let Trust(sum_liabilities) = transferee { | |
| let trust_gain_recognized := max $0 (sum_liabilities -$ transferee_adjusted_basis) | |
| gain_loss_recognized += trust_gain_recognized | |
| transferee_adjusted_basis += trust_gain_recognized | |
| } | |
| Some(gain_loss_recognized, transferee_adjusted_basis, Gift(transferor_holding_period)) | |
| } else { | |
| // 1041 doesn't apply at all. | |
| None | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment