forked from LogicalContracts/LogicalEnglish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
3_rollover_2.pl
executable file
·174 lines (149 loc) · 7.4 KB
/
3_rollover_2.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
:- module('two+https://www.ato.gov.au/general/capital-gains-tax/small-business-cgt-concessions/small-business-restructure-rollover/',[]).
en("the target language is: prolog.
the templates are:
*An entity* is an ultimate owner of *an asset* at *a time*,
the small business restructure rollover applies to *an event*,
*an event* occurs at *a time*,
*an event* is a transfer of *an asset* by *a transferor* to *a transferee*,
*an event* is part of genuine restructuring as informed by *a source*,
*an event* meets the ultimate ownership test at *a time*,
*an event* is undertaken as part of *a trust*,
*a trust* relates to a family group,
*an individual* is a member of *a group*,
*a trust* is a family trust,
*a thing* is of type *a type*,
*a party* is a party of *an event*,
*an amount* is the aggregated turnover of *a party*,
*a party* is an eligible party,
*an asset* is an eligible asset,
*an asset* is ultimately owned by *a share* with *an owner* at *a time*,
*an entity* has a share in *an asset* at *a time*,
*an owner* owns *an asset* at *a time* as informed by *a source*,
*a party* is a small business entity as informed by *a source*,
*a party* has affiliated with *an affiliate* as informed by *a source*,
*a party* is connected to *a taxpayer* as informed by *a source*,
*a party* is a partner in partnership with *a partnership* as informed by *a source*,
*an asset* is an active asset,
*an asset* is used in business of *a taxpayer* as informed by *a source*,
*an asset* is of asset type *a type* as informed by *a source*,
*an asset* is of asset type *a type*,
*a party* has an aggregated turnover of *an amount* as informed by *a source*,
*a party* has an aggregated turnover of *an amount*,
*a cost* is a rollover cost,
*an asset* costs *an amount* at *a time*,
the knowledge base Rollover includes:
% these facts are not being used:
cgt asset is of type asset.
trading stock is of type asset.
revenue asset is of type asset.
depreciating asset is of type asset.
loan_to_shareholder is of type asset.
the small business restructure rollover applies to an event
if the event occurs at a time
and the time is after 2016-07-01
and the event is a transfer of an asset by a transferor to a transferee
and the asset is an eligible asset
and the event is part of genuine restructuring as informed by a source
and the event meets the ultimate ownership test at the time
and for all cases in which
a party is a party of the event
and an amount is the aggregated turnover of the party
it is the case that
the party is an eligible party
and the amount < 10000000.
an event meets the ultimate ownership test at a time
if the event is a transfer of an asset by a transferor to a transferee
and a previous time is immediately before the time
and for all cases in which
an entity is an ultimate owner of the asset at the time
and the entity has a share in the asset at the time
it is the case that
the entity is an ultimate owner of the asset at the previous time
and the entity has a share in the asset at the previous time.
an event meets the ultimate ownership test at a time
if the event is a transfer of an asset by a transferor to a transferee
and the event is undertaken as part of a trust
and the trust is a family trust
and the trust relates to a family group
and a previous time is immediately before the time
and for all cases in which
an individual is an ultimate owner of the asset at the time
it is the case that
the individual is a member of the family group
and for all cases in which
an individual is an ultimate owner of the asset at the previous time
it is the case that
the individual is a member of the family group.
A tax payer is a party of an event
if the event is a transfer of an asset by the tax payer to a transferee.
A tax payer is a party of an event
if the event is a transfer of an asset by a transferor to the tax payer.
An asset is ultimately owned by 1 with an owner at a time
if the owner owns the asset at the time as informed by a source.
A party is an eligible party
if the party is a small business entity as informed by a source.
A party is an eligible party
if the party has affiliated with an affiliate as informed by a source
and the affiliate is a small business entity as informed by a source.
A party is an eligible party
if the party is connected to a taxpayer as informed by a source
and the taxpayer is a small business entity as informed by a source.
A party is an eligible party
if the party is a partner in partnership with a partnership as informed by a source
and the partnership is a small business entity as informed by a source.
An asset is an eligible asset
if the asset is an active asset
and the asset is of asset type a type
and the type is in [cgt event,depreciating asset,trading stock,revenue asset].
An asset is an active asset
if the asset is used in business of a taxpayer as informed by a source.
An asset is of asset type a type
if the asset is of asset type the type as informed by a source.
A party has an aggregated turnover of an amount
if the party has an aggregated turnover of the amount as informed by a source.
A cost is a rollover cost
if the event occurs at a time
and the event is a transfer of an asset by a transferor to a transferee
and a previous time is immediately before the time
and the asset costs the cost at the previous time.
% Company transfers its assets to partners in a partnership on 1 July 2020.
% Company has turnover of 5,300,000. Company is a Small Business Entity i.e.
% the transferor & the partners in a partnership i.e. transferee is also a small business entity.)
% Assets are -
% Goodwill
% Trading stock
% Plant & equipment
scenario Andrew email Feb 4 2021 is:
transfer_20200701 occurs at 2020-07-01.
2020-07-01 is after 2016-07-01.
transfer_20200701 is a transfer of goodwill by company1 to andrew.
transfer_20200701 is a transfer of trading stock by company1 to andrew.
transfer_20200701 is a transfer of plant and equipment by company1 to andrew.
goodwill is used in business of a taxpayer as informed by a source.
plant and equipment is used in business of a taxpayer as informed by a source.
goodwill is of asset type revenue asset as informed by a source.
plant and equipment is of asset type revenue asset as informed by a source.
transfer_20200701 is part of genuine restructuring as informed by a source.
2020-06-30 is immediately before 2020-07-01.
5300000 is the aggregated turnover of company.
company is a small business entity as informed by a source.
company is an ultimate owner of goodwill at 2020-07-01.
%company has share_goodwill in goodwill at 2020-07-01.
company is an ultimate owner of goodwill at 2020-06-30.
%company has share_goodwill in goodwill at 2020-06-30.
scenario testing one is:
2016-07-01 is after 2016-06-30.
2016-06-30 is immediately before 2016-07-01.
query one is:
for which event:
the small business restructure rollover applies to the event.
query two is:
which tax payer is a party of which event.
query three is:
A first time is after a second time
and the second time is immediately before the first time.
").
/** <examples>
?- answer("one with Andrew email Feb 4 2021").
?- answer(one,with('Andrew email Feb 4 2021'), le(E), R).
*/