Spaces:
Sleeping
Sleeping
Create knowledge_base.pl
Browse files- knowledge_base.pl +194 -0
knowledge_base.pl
ADDED
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
% Entity types
|
2 |
+
program('SSI').
|
3 |
+
law('PRWORA').
|
4 |
+
law('P.L._105-306').
|
5 |
+
law('Noncitizen_Benefit_Clarification_and_Other_Technical_Amendments_Act_of_1998').
|
6 |
+
law('INA').
|
7 |
+
law('NACARA').
|
8 |
+
law('HRIFA').
|
9 |
+
law('CAA66').
|
10 |
+
law('Refugee_Education_Assistance_Act_of_1980').
|
11 |
+
alien_category('Qualified_Alien').
|
12 |
+
alien_category('Nonqualified_Alien').
|
13 |
+
alien_category('LAPR').
|
14 |
+
ethnicity('American_Indian').
|
15 |
+
ethnicity('Amerasian_Immigrant').
|
16 |
+
organization('Federally_Recognized_Indian_Tribe').
|
17 |
+
organization('U.S._Armed_Forces').
|
18 |
+
status('PRUCOL').
|
19 |
+
status('Refugee').
|
20 |
+
status('Asylee').
|
21 |
+
status('Deportation_Withheld').
|
22 |
+
status('Removal_Withheld').
|
23 |
+
status('Conditional_Entrant').
|
24 |
+
status('Cuban_Haitian_Entrant').
|
25 |
+
status('Parolee').
|
26 |
+
status('Battered_Alien').
|
27 |
+
status('Compact_Of_Free_Association_States_Citizen').
|
28 |
+
condition('Blind').
|
29 |
+
condition('Disabled').
|
30 |
+
time_period('7_Years').
|
31 |
+
|
32 |
+
% SSI eligibility requirements for aliens
|
33 |
+
eligibility_requirement('SSI', 'Qualified_Alien').
|
34 |
+
eligibility_requirement('SSI', 'Exception_Condition').
|
35 |
+
|
36 |
+
% PRWORA applicability
|
37 |
+
applies_to('PRWORA', 'SSI', 'Alien_Applicants').
|
38 |
+
applies_to('INA', 'Refugee', 'Section_207').
|
39 |
+
applies_to('INA', 'Asylee', 'Section_208').
|
40 |
+
applies_to('INA', 'Deportation_Withheld', 'Section_243_h').
|
41 |
+
applies_to('INA', 'Removal_Withheld', 'Section_241_b_3').
|
42 |
+
applies_to('INA', 'Conditional_Entrant', 'Section_203_a_7').
|
43 |
+
applies_to('INA', 'Parolee', 'Section_212_d_5').
|
44 |
+
|
45 |
+
% General SSI eligibility rule
|
46 |
+
eligible_for_ssi(Person) :-
|
47 |
+
(us_citizen(Person); us_national(Person));
|
48 |
+
american_indian_exception(Person);
|
49 |
+
grandfathered_ssi_recipient(Person);
|
50 |
+
qualified_alien_eligible(Person).
|
51 |
+
|
52 |
+
% American Indian exception
|
53 |
+
american_indian_exception(Person) :-
|
54 |
+
(ethnicity(Person, 'American_Indian'),
|
55 |
+
born_in_canada(Person),
|
56 |
+
indian_blood_percentage(Person, Percentage),
|
57 |
+
Percentage >= 50);
|
58 |
+
member(Person, 'Federally_Recognized_Indian_Tribe').
|
59 |
+
|
60 |
+
% Grandfathered SSI recipient
|
61 |
+
grandfathered_ssi_recipient(Person) :-
|
62 |
+
receiving_ssi_before(Person, date(1979, 1, 1));
|
63 |
+
(not_qualified_alien(Person),
|
64 |
+
receiving_ssi_on(Person, date(1996, 8, 22)),
|
65 |
+
prucol_status_continues(Person)).
|
66 |
+
|
67 |
+
% Qualified Alien eligibility
|
68 |
+
qualified_alien_eligible(Person) :-
|
69 |
+
qualified_alien_status(Person),
|
70 |
+
(blind_or_disabled_1996(Person);
|
71 |
+
lawfully_residing_and_receiving_ssi_1996(Person);
|
72 |
+
has_40_qualifying_quarters(Person);
|
73 |
+
military_connection(Person);
|
74 |
+
time_limited_eligibility(Person)).
|
75 |
+
|
76 |
+
% Blind or disabled in 1996
|
77 |
+
blind_or_disabled_1996(Person) :-
|
78 |
+
lawfully_residing(Person, 'U.S.', date(1996, 8, 22)),
|
79 |
+
(condition(Person, 'Blind'); condition(Person, 'Disabled')).
|
80 |
+
|
81 |
+
% Lawfully residing and receiving SSI in 1996
|
82 |
+
lawfully_residing_and_receiving_ssi_1996(Person) :-
|
83 |
+
lawfully_residing(Person, 'U.S.', date(1996, 8, 22)),
|
84 |
+
receiving_ssi_on(Person, date(1996, 8, 22)).
|
85 |
+
|
86 |
+
% Military connection
|
87 |
+
military_connection(Person) :-
|
88 |
+
(veteran(Person, 'U.S._Armed_Forces');
|
89 |
+
active_duty(Person, 'U.S._Armed_Forces');
|
90 |
+
spouse_of_veteran_or_active_duty(Person);
|
91 |
+
dependent_child_of_veteran_or_active_duty(Person)).
|
92 |
+
|
93 |
+
% Time-limited eligibility (7-year rule)
|
94 |
+
time_limited_eligibility(Person) :-
|
95 |
+
member(Status, ['Refugee', 'Asylee', 'Deportation_Withheld', 'Removal_Withheld', 'Cuban_Haitian_Entrant', 'Amerasian_Immigrant']),
|
96 |
+
status_granted_within_7_years(Person, Status).
|
97 |
+
|
98 |
+
% Specific alien category eligibility rules
|
99 |
+
refugee_eligible(Person) :-
|
100 |
+
status(Person, 'Refugee'),
|
101 |
+
(blind_or_disabled_1996(Person);
|
102 |
+
lawfully_residing_and_receiving_ssi_1996(Person);
|
103 |
+
military_connection(Person);
|
104 |
+
status_granted_within_7_years(Person, 'Refugee')).
|
105 |
+
|
106 |
+
asylee_eligible(Person) :-
|
107 |
+
status(Person, 'Asylee'),
|
108 |
+
(blind_or_disabled_1996(Person);
|
109 |
+
lawfully_residing_and_receiving_ssi_1996(Person);
|
110 |
+
military_connection(Person);
|
111 |
+
status_granted_within_7_years(Person, 'Asylee')).
|
112 |
+
|
113 |
+
deportation_removal_withheld_eligible(Person) :-
|
114 |
+
(status(Person, 'Deportation_Withheld'); status(Person, 'Removal_Withheld')),
|
115 |
+
(blind_or_disabled_1996(Person);
|
116 |
+
lawfully_residing_and_receiving_ssi_1996(Person);
|
117 |
+
military_connection(Person);
|
118 |
+
status_granted_within_7_years(Person, 'Deportation_Withheld');
|
119 |
+
status_granted_within_7_years(Person, 'Removal_Withheld')).
|
120 |
+
|
121 |
+
conditional_entrant_eligible(Person) :-
|
122 |
+
status(Person, 'Conditional_Entrant'),
|
123 |
+
(blind_or_disabled_1996(Person);
|
124 |
+
lawfully_residing_and_receiving_ssi_1996(Person);
|
125 |
+
military_connection(Person)).
|
126 |
+
|
127 |
+
cuban_haitian_entrant_eligible(Person) :-
|
128 |
+
status(Person, 'Cuban_Haitian_Entrant'),
|
129 |
+
(blind_or_disabled_1996(Person);
|
130 |
+
lawfully_residing_and_receiving_ssi_1996(Person);
|
131 |
+
military_connection(Person);
|
132 |
+
status_granted_within_7_years(Person, 'Cuban_Haitian_Entrant')).
|
133 |
+
|
134 |
+
parolee_eligible(Person) :-
|
135 |
+
status(Person, 'Parolee'),
|
136 |
+
parolee_for_at_least_1_year(Person),
|
137 |
+
(blind_or_disabled_1996(Person);
|
138 |
+
lawfully_residing_and_receiving_ssi_1996(Person);
|
139 |
+
military_connection(Person);
|
140 |
+
status_granted_within_7_years(Person, 'Cuban_Haitian_Entrant')).
|
141 |
+
|
142 |
+
battered_alien_eligible(Person) :-
|
143 |
+
status(Person, 'Battered_Alien'),
|
144 |
+
(blind_or_disabled_1996(Person);
|
145 |
+
lawfully_residing_and_receiving_ssi_1996(Person);
|
146 |
+
military_connection(Person)).
|
147 |
+
|
148 |
+
% Compact of Free Association States citizens are ineligible
|
149 |
+
compact_of_free_association_states_citizen_eligible(Person) :-
|
150 |
+
status(Person, 'Compact_Of_Free_Association_States_Citizen'),
|
151 |
+
fail.
|
152 |
+
|
153 |
+
% Loss of eligibility
|
154 |
+
loses_eligibility(Person, Date) :-
|
155 |
+
qualified_alien_status(Person),
|
156 |
+
(loses_7_year_eligibility(Person, Date);
|
157 |
+
loses_military_connection(Person, Date);
|
158 |
+
loses_40_quarters(Person, Date)).
|
159 |
+
|
160 |
+
% Helper predicates (to be defined elsewhere)
|
161 |
+
us_citizen(_).
|
162 |
+
us_national(_).
|
163 |
+
ethnicity(_, _).
|
164 |
+
born_in_canada(_).
|
165 |
+
indian_blood_percentage(_, _).
|
166 |
+
member(_, _).
|
167 |
+
receiving_ssi_before(_, _).
|
168 |
+
not_qualified_alien(_).
|
169 |
+
receiving_ssi_on(_, _).
|
170 |
+
prucol_status_continues(_).
|
171 |
+
qualified_alien_status(_).
|
172 |
+
qualified_alien_status(_, _).
|
173 |
+
lawfully_residing(_, _, _).
|
174 |
+
blind(_).
|
175 |
+
disabled(_).
|
176 |
+
has_40_qualifying_quarters(_).
|
177 |
+
veteran(_, _).
|
178 |
+
active_duty(_, _).
|
179 |
+
spouse_of_veteran_or_active_duty(_).
|
180 |
+
dependent_child_of_veteran_or_active_duty(_).
|
181 |
+
status_granted_within_7_years(_, _).
|
182 |
+
nationality(_, _).
|
183 |
+
adjusted_status_under(_, _).
|
184 |
+
loses_7_year_eligibility(_, _).
|
185 |
+
loses_military_connection(_, _).
|
186 |
+
loses_40_quarters(_, _).
|
187 |
+
parolee_for_at_least_1_year(_).
|
188 |
+
condition(_, _).
|
189 |
+
status(_, _).
|
190 |
+
|
191 |
+
% Define the person
|
192 |
+
us_citizen(john_doe).
|
193 |
+
lawfully_residing(john_doe, 'U.S.', date(1996, 1, 1)). % Born on January 1, 1996
|
194 |
+
condition(john_doe, 'Blind').
|