-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactions.pl
More file actions
executable file
·32 lines (30 loc) · 998 Bytes
/
actions.pl
File metadata and controls
executable file
·32 lines (30 loc) · 998 Bytes
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
#!/usr/bin/env swipl
:- initialization(main, main).
:- use_module("./core/core.pl", [classify_actions/1, classify_action/2, classify_plan/1, prepare_owl/2]).
main(Argv) :-
nth0(0, Argv, Domain),
nth0(1, Argv, Ontology),
string_concat("./domains/", Domain, DomainPath0),
string_concat(DomainPath0, ".pl", DomainPath),
string_concat("./ontologies/", Ontology, OntologyPath0),
string_concat(OntologyPath0, ".owl", OntologyPath),
consult(DomainPath),
plan(Plan),
prepare_owl(Plan, OntologyPath),
process(Argv).
process(Argv) :-
length(Argv, 2),
classify_actions(ActionTypes),
classify_plan(PlanType),
writeln([PlanType, ActionTypes]).
process(Argv) :-
length(Argv, 3),
nth0(2, Argv, plan),
classify_plan(PlanType),
writeln(PlanType).
process(Argv) :-
length(Argv, 3),
nth0(2, Argv, ArgActionNumber),
atom_number(ArgActionNumber, ActionNumber),
classify_action(ActionNumber,ActionTypes),
writeln(ActionTypes).