this is xml converted in prolog file which i wnated to be get access for each child using parent group.
here is file :-
:- style_check(-singleton).
better('SWI-Prolog', AnyOtherProlog).
group('Running Conditions',
item('No Cylinders are Cut Out
or Chief Limited',
outvar('ECUA', '02012008'),
operator(eq),
constant('false')
),
item('No FWE Request',
outvar('ECUA', '010110'),
operator(eq),
constant('false')
),
item('No Slowdown',
outvar('ECUA', '010124'),
operator(eq),
constant('false')
),
item('Cylinder Monitoring Ok',
outvar('SPSU', '0240'),
operator(eq),
constant('true')
),
item('Second Fuel Supply
System Ready',
outvar('SPCU', '600202'),
operator(eq),
constant('true')
)
).
如何编写 tis 树的谓词?
这些是我的谓词:-
isgroup(G,X):- group(G,X).
isgroup(X,Gname):- group(G,X),
item(X,gname).
isitem(_,item(_)).
isitem(item(_),outvar(_,_)).
isitem(outvar(_,_),operator(_)).
isitem(operator(_),constant(_)).