-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8156e94
commit 90186ed
Showing
3 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 17, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"%reload_ext jetisu.query_idr_magic" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"# Eligibility for rates subsidy\n", | ||
"\n", | ||
"A person is eligible for a rates subsidy if, on the relevant date:\n", | ||
"1. the person is a ratepayer; and\n", | ||
"1. the property for which the rates are paid is a residential property; and\n", | ||
"1. the property is the usual place of residence of the ratepayer.\n" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 18, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": "<IPython.core.display.Markdown object>", | ||
"text/markdown": "```\n\npredicate eligible_for_rates_subsidy(var bool: is_ratepayer,\n var bool: is_residential_property,\n var bool: usual_place_of_residence,\n var bool: is_retirement_subsidy,\n var bool: is_eligible) =\nlet {\n constraint is_eligible = (is_ratepayer /\\ is_residential_property /\\ usual_place_of_residence);\n constraint is_eligible -> not is_retirement_subsidy;\n }\nin true;\n```" | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"%%jetisu_show\n", | ||
"eligible_for_rates_subsidy" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"## I am a ratepayer, the property is residential and it is my usual place of residence. Am I eligible?" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 19, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": "<IPython.core.display.Markdown object>", | ||
"text/markdown": "|is_eligible|is_retirement_subsidy|\n|----|----|\n|True|False|" | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"%%jetisu_query\n", | ||
"select is_eligible, is_retirement_subsidy\n", | ||
" from eligible_for_rates_subsidy\n", | ||
" where is_ratepayer and is_residential_property and usual_place_of_residence;" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"## For the people who are eligible, what can we say about their status as a ratepayer, the kind of property under discussion and if they are resident at the property?" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 20, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": "<IPython.core.display.Markdown object>", | ||
"text/markdown": "|is_ratepayer|is_residential_property|usual_place_of_residence|\n|----|----|----|\n|True|True|True|" | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"%%jetisu_query\n", | ||
"select is_ratepayer,\n", | ||
" is_residential_property,\n", | ||
" usual_place_of_residence\n", | ||
" from eligible_for_rates_subsidy\n", | ||
" where is_eligible;" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 2 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython2", | ||
"version": "2.7.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
predicate eligible_for_rates_subsidy(var bool: is_ratepayer, | ||
var bool: is_residential_property, | ||
var bool: usual_place_of_residence, | ||
var bool: is_retirement_subsidy, | ||
var bool: is_eligible) = | ||
let { | ||
constraint is_eligible = (is_ratepayer /\ is_residential_property /\ usual_place_of_residence); | ||
constraint is_eligible -> not is_retirement_subsidy; | ||
} | ||
in true; |