thank you very much
--------------------------------------------------------------------------------
------------------ 原始邮件 ------------------
发件人: FERNANDO SAENZ PEREZ [via Gnu -
Prolog]<[email protected]>;
发送时间: 2013-10-14 15:16:31
收件人: liubin0314 <[email protected]>;
抄送: (无);
主题: Re: how to get some statements about a constant?
You can use the following, extracted from the user manual:
==========================
Templates
current_predicate(?predicate_indicator)
Description
current_predicate(Pred) succeeds if there
exists a predicate indicator of a defined procedure that unifies
with Pred. All user defined procedures are found, whether static
or dynamic. Internal system procedures whose name begins with ’$’
are not found. A user-defined procedure is found even when it has
no clauses. A user-defined procedure is not found if it has been
abolished. To conform to the ISO reference, built-in predicates
are not found except if the strict_iso Prolog flag is switched
off (section 8.22.1). This predicate is
re-executable on backtracking.
==========================
Then, using more meta-pretapredicates (univ and higher-order call):
| ?- current_predicate(N/2), G=..[N,baba,wo], G.
G = father(baba,wo) N = father ? ;
(31 ms) no
Regards,Fernando
2013/10/13 <[hidden email]>
Yes,
that works fine if you know the predicates in the database, but is
it possible yo find the term that contains a constant without
knowing the predicae?t Sent from my Verizon Wireless
BlackBerry
-----Original Message----- From: FERNANDO SAENZ
PEREZ <[hidden email]>
Sender: users-prolog-bounces+pkra=[hidden email] Date:
Sun, 13 Oct 2013 20:09:13 To: liubin0314<[hidden email]>
Cc: <[hidden email]>
Subject: Re: how to get some statements about a
constant?
_______________________________________________
Users-prolog mailing list [hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog
_______________________________________________
Users-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/users-prolog
--------------------------------------------------------------------------------
If you reply to this email, your
message will be added to the discussion below:
http://gnu-prolog.996310.n3.nabble.com/how-to-get-some-statements-about-a-constant-tp1110p1116.html
To unsubscribe from how to get some statements about a constant?, click
here. NAML
--
View this message in context:
http://gnu-prolog.996310.n3.nabble.com/how-to-get-some-statements-about-a-constant-tp1110p1117.html
Sent from the Users mailing list archive at Nabble.com.
_______________________________________________
Users-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/users-prolog