-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTest1.sadl
26 lines (16 loc) · 986 Bytes
/
Test1.sadl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
uri "http://sadl.org/Test1.sadl" alias Test1.
PhysicalThing is a class,
described by weight with values of type UnittedQuantity,
described by density with values of type float.
LivingThing is a type of PhysicalThing,
described by dateOfBirth with values of type dateTime,
described by age with values of type float.
Mammal is a type of LivingThing,
described by child with values of type Mammal.
Person is a type of Mammal.
child of Person only has values of type Person.
Pet is a class, described by caredFor with a single value of type boolean.
owns describes Person with values of type Pet.
External subtractDates(dateTime t1, dateTime t2, string u) returns float : "http://sadl.org/builtins/subtractDates".
Rule AgeRule: if p is a LivingThing then age of p is subtractDates(now(), dateOfBirth of p, "y").
Rule AgeRule2: if p is a LivingThing then age of p is Test1:subtractDates(now(), dateOfBirth of p, "y").