# Prolog Knowledge Base for SSI Eligibility This document describes the Prolog knowledge base representing rules and facts about Supplemental Security Income (SSI) eligibility, particularly focusing on the eligibility criteria for non-citizens. ## Entity Types The knowledge base defines several entity types: * **program**: Government programs, like 'SSI'. * **law**: Legal acts, such as 'PRWORA', 'INA', 'NACARA'. * **alien_category**: Categories of non-citizens, like 'Qualified_Alien', 'Nonqualified_Alien'. * **ethnicity**: Ethnicities, such as 'American_Indian', 'Amerasian_Immigrant'. * **organization**: Organizations like 'Federally_Recognized_Indian_Tribe', 'U.S._Armed_Forces'. * **status**: Immigration statuses like 'Refugee', 'Asylee', 'Parolee'. * **condition**: Medical conditions like 'Blind', 'Disabled'. * **time_period**: Specific periods, like '7_Years'. ## Facts and Rules The knowledge base contains facts and rules related to SSI eligibility: **Eligibility Requirements**: * `eligibility_requirement('SSI', 'Qualified_Alien')`: A 'Qualified_Alien' meets a core requirement for SSI. * `eligibility_requirement('SSI', 'Exception_Condition')`: Specific exceptions based on conditions exist for SSI. **Law Applicability**: * `applies_to('PRWORA', 'SSI', 'Alien_Applicants')`: The Personal Responsibility and Work Opportunity Reconciliation Act (PRWORA) applies to 'Alien_Applicants' for 'SSI'. * Similar `applies_to` facts define the applicability of other laws to specific statuses. **General SSI Eligibility**: * `eligible_for_ssi(Person)`: This rule defines various ways a `Person` can be eligible for SSI: * Being a US citizen or national. * Qualifying through the American Indian exception. * Being a grandfathered SSI recipient. * Being a qualified alien who meets further criteria. **Specific Eligibility Rules**: * Rules like `american_indian_exception(Person)`, `grandfathered_ssi_recipient(Person)`, and `qualified_alien_eligible(Person)` detail the specific requirements for each eligibility category. * Further rules define eligibility based on specific statuses like 'Refugee', 'Asylee', 'Deportation_Withheld', etc. These rules often check for conditions like being blind or disabled in 1996, lawfully residing and receiving SSI in 1996, having military connections, or meeting the 7-year rule. **Helper Predicates**: The knowledge base relies on several helper predicates (not fully defined within this knowledge base) to determine eligibility. These predicates cover aspects like: * `us_citizen(Person)`: Checks if a `Person` is a US citizen. * `lawfully_residing(Person, 'U.S.', Date)`: Checks if a `Person` was lawfully residing in the 'U.S.' on a specific `Date`. * `has_40_qualifying_quarters(Person)`: Checks if a `Person` has accumulated 40 qualifying quarters of work. * And many others related to military connections, specific dates, status durations, etc. ## Usage This Prolog knowledge base can be used to: * Determine the SSI eligibility of individuals based on their citizenship, immigration status, and other relevant factors. * Identify the legal grounds for eligibility or ineligibility. * Answer queries about the relationship between different laws, statuses, and eligibility criteria. ## Example Queries * **Is a person with refugee status granted within the last 5 years eligible for SSI?** * code ```prolog status(person1, 'Refugee'). status_granted_within_7_years(person1, 'Refugee'). ``` * query ```prolog eligible_for_ssi(person1). ``` * **Is a person who has been a parolee for 2 years eligible for SSI?** * code ```prolog status(person2, 'Parolee'). parolee_for_at_least_1_year(person2). ``` * query ```prolog eligible_for_ssi(person2). ``` This knowledge base provides a foundation for reasoning about SSI eligibility, particularly for non-citizens. By defining specific facts and rules, it enables users to query and understand the complex interplay of factors that determine eligibility under US law.