This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/pl/android.yap
Vitor Santos Costa 186c156a4a android
2019-04-05 23:52:34 +01:00

21 lines
463 B
Prolog

:- module(android,
[text_to_query/2]).
:- initialization(yap_flag(verbose,_,normal)).
:- meta_predicate( text_to_query( :, - ) ).
text_to_query( MString, Status ) :-
strip_module( MString, Mod, String ),
top_query(query_( MString, Mod, Status ) ).
query_( Mtring, Mod, Status ) :-
atomic_to_term( String, Goal, VarNames ),
(
is_list(Goal) -> G = ensure_loaded( Goal ) ; G = Goal ),
catch(query_to_answer( Mod:G, VarNames, Status, Bindings).