forked from singnet/ai-dsl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNuNet.kif
47 lines (42 loc) · 1.72 KB
/
NuNet.kif
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
(subclass NuNetEnabledSNetAIService SNetAIService)
(documentation NuNetEnabledSNetAIService EnglishLanguage "SNetAIService which can be deployed on NuNetEnabledComputers and orchestrated via NuNet platfrom")
(=>
(and
(hasMetadata ?SNetAIServiceMetadata ?SNetAIService)
(hasField ?RequiredComputingResources ?SNetAIServiceMetadata)
)
(instance ?SNetAIService NuNetEnabledSNetAIService)
)
; may include many other requirements
(subclass NuNetEnabledComputer Computer)
(documentation NuNetEnabledComputer EnglishLanguage "A Computer which was onboarded to NuNet platfrom and complies to its requirements.")
(=>
(and
(hasRun ?NuNetEnabledComputer NuNetOnboardingScript)
(hasMetadata ?NuNetEnabledComputer ?ComputerMetadata)
(hasField AvailableComputingResources ?ComputerMetadata)
(or
(runsOS ?NuNetEnabledComputer Linux)
(runsOs ?NuNetEnabledComputer Raspbian)
)
(or
(hasHardware ?NuNetEnabledComputer PC)
(hasHardware ?NuNetEnabledComputer RaspberyPi)
)
)
(instance ?NuNetEnabledComputer NuNetEnabledComputer)
)
; here we check if a NuNetEnabledSNetAIService can be deployed on a NuNetEnabledComputer
; at any particular instance in time
; since AvailableComputingResources depend on state of the computer at that time
; (therefore it can be calculated only at runtime)
(=>
(and
(hasMetadata ?NuNetEnabledComputer ?ComputerMetadata)
(hasField ?AvailableComputingResources ?ComputerMetadata)
(hasMetadata ?NuNetEnabledSNetAIService ?SNetAIServiceMetadata)
(hasField ?RequiredComputingResources ?SNetAIServiceMetadata)
(lessThanOrEqualTo ?RequiredComputingResources ?AvailableComputingResources)
)
(canDeploy ?NuNetEnabledSNetAIService ?NuNetEnabledComputer)
)