astnode_info(properties,Info,[P]) :-
!,text_info('Properties',Info),b_get_properties_from_machine(P).
astnode_info(invariant,Info,[I]) :-
!,text_info('Invariant',Info),b_get_invariant_from_machine(I).
astnode_info(operations,Info,Ops) :-
!,text_info('Operations',Info),
findall(op(Name),b_is_operation_name(Name),Ops).
astnode_info(op(Name),Info,Result) :-
!,b_get_machine_operation(Name,Returns,Parameters,_),
( Returns =[] -> Result=PRes; Result=[returns(Name) |PRes]),
( Parameters=[] -> PRes =Subs; PRes =[parameters(Name)|Subs]),
Subs = [subst(Name)],text_info(Name,Info).
astnode_info(returns(Name),info('Returns','','',Ids),TIds) :-
!,b_get_machine_operation(Name,TIds,_,_),get_texpr_ids(TIds,Ids).
astnode_info(parameters(Name),info('Parameters','','',Ids),TIds) :-
!,b_get_machine_operation(Name,_,TIds,_),get_texpr_ids(TIds,Ids).
astnode_info(subst(Name),Info,[Subst]) :-
!,text_info('Substitution',Info), b_get_machine_operation(Name,_,_,Subst).
astnode_info(static_assertions,Info,Ass) :-
!,text_info('Static Assertions',Info),b_get_static_assertions_from_machine(Ass).
astnode_info(dynamic_assertions,Info,Ass) :-
!,text_info('Dynamic Assertions',Info),b_get_dynamic_assertions_from_machine(Ass).
astnode_info(TExpr,info(Node,Type,Infos,Ids),Subs) :-
create_texpr(Expr,Type,Infos,TExpr),!,
safe_syntaxelement(Expr,Subs,Names,_,Constant),
(Names = [] -> Ids='' ; get_texpr_ids(Names,Ids)),
functor(Expr,Functor,_),
( Constant=[] ->
Node=Functor
;
functor(Node,Functor,1),
arg(1,Node,Constant)
).
astnode_info(TExpr,info('INVALID NODE','',TExpr,''),[]).