Skip to content

Instantly share code, notes, and snippets.

@denismerigoux
Last active June 12, 2020 16:15
Show Gist options
  • Save denismerigoux/24ae5d45e0a79e144e5f8f40986ba728 to your computer and use it in GitHub Desktop.
Save denismerigoux/24ae5d45e0a79e144e5f8f40986ba728 to your computer and use it in GitHub Desktop.
/*
# First structure and signatures definitions
declaration structure Person
data name content string
data income content amount
date number_of_children content integer
declaration scope TaxCreditA :
context person content Person
context rate_base content decimal
context rate_final content decime
context credit_amount content amount
declaration scope TaxCreditB
context person content Person
context credit_amount content amount
context tax_creditA scope TaxCreditA
# Now for the definitions
scope TaxCreditA:
definition rate_base equals 15%
definition rate_final equals rate_base
definition credit_amount equals person.income * rate_final
scope TaxCreditB :
definition tax_creditA.person equals person
definition tax_creditA.rate_final under condition
person.number_of_children = 2
consequence equals tax_creditA.rate_base / 2
definition credit_amount equals tax_creditA.credit_amount
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment