diff options
Diffstat (limited to 'subprojects/frontend/src/index.tsx')
-rw-r--r-- | subprojects/frontend/src/index.tsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/subprojects/frontend/src/index.tsx b/subprojects/frontend/src/index.tsx index 2c0259bf..b42b8062 100644 --- a/subprojects/frontend/src/index.tsx +++ b/subprojects/frontend/src/index.tsx | |||
@@ -20,6 +20,12 @@ enum TaxStatus { | |||
20 | child, student, adult, retired | 20 | child, student, adult, retired |
21 | } | 21 | } |
22 | 22 | ||
23 | int ageDifference(Person p, Person q) = | ||
24 | children(p, q), age(p, pAge), age(q, qAge) -> qAge - pAge. | ||
25 | |||
26 | error invalidAgeDifference(Person p, Person q) <-> | ||
27 | children(p, q), ageDifference(p, q) <= 0. | ||
28 | |||
23 | % A child cannot have any dependents. | 29 | % A child cannot have any dependents. |
24 | pred invalidTaxStatus(Person p) <-> | 30 | pred invalidTaxStatus(Person p) <-> |
25 | taxStatus(p, child), | 31 | taxStatus(p, child), |
@@ -29,7 +35,7 @@ pred invalidTaxStatus(Person p) <-> | |||
29 | parent(p, q), | 35 | parent(p, q), |
30 | !taxStatus(q, retired). | 36 | !taxStatus(q, retired). |
31 | 37 | ||
32 | indiv family. | 38 | individual family. |
33 | Family(family). | 39 | Family(family). |
34 | members(family, anne). | 40 | members(family, anne). |
35 | members(family, bob). | 41 | members(family, bob). |