libreplanet-ca-on
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lp-ca-on] Libre Planet Ontario has started a tax project


From: Christopher Browne
Subject: Re: [lp-ca-on] Libre Planet Ontario has started a tax project
Date: Tue, 7 Jun 2016 16:07:58 -0400



On 3 June 2016 at 18:21, Greg Knittl <address@hidden> wrote:
Hi Chris,

I poked around on the web and the Prolog examples seem to be family relations. I could use an example of how it does arithmetic calculations. Any chance you could send your program? - without personal identifying data of course. If you could put in some dummy data and run it and show the output that would be even better.


Eek.  I'm taking a poke at the code that I have had; it seems to have bitrotted so that it won't load on latest version of SWI-Prolog.

For a sample of some moderately complex calculations, I'll point to the calculation of Schedule 1 values, which handles the calculation of federal taxes, including:
a) Adding up the values that are basis for credits;
b) Determining the tax credits (e.g. - base federal tax rate * material from line #335)
c) Determining portions of taxable income to which each of the marginal rates apply to.

https://github.com/cbbrowne/canadiantaxes/blob/master/schedule1.pl

Simpler is Schedule 9, which calculates that Charitable Donations tax credit.

https://github.com/cbbrowne/canadiantaxes/blob/master/schedule9.pl

Alas, it has suffered from pretty bad bitrot :-(

I'll observe that there's some merit to thinking about the family relations part; one of the neat-ish things that would be natural in a Prolog-based calculator is to have facts about a whole family handy; there are places where spousal income is of importance, as well as for children. 

When the kids are young, there are various sorts of deductions and credits, and this commonly extends through completion of university.
--
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]