[[
✎ pl:prolog:pllib:subterm
]]
aiWiki
Pokaż stronę
Ostatnie zmiany
Indeks
Zaloguj
Ta strona jest tylko do odczytu. Możesz wyświetlić źródła tej strony ale nie możesz ich zmienić.
====== Subterm ====== {{tag>function}} ===== Description ===== Finding subterms of a term **Source**: The Art of Prolog ===== Download ===== Program source code: {{subterm.pl}} ===== Listing ===== <code prolog> /* subterm(Sub,Term) :- Sub is a subterm of the ground term Term. */ subterm(Term,Term). subterm(Sub,Term) :- compound(Term), functor(Term,F,N), subterm(N,Sub,Term). subterm(N,Sub,Term) :- N > 1, N1 is N-1, subterm(N1,Sub,Term). subterm(N,Sub,Term) :- arg(N,Term,Arg), subterm(Sub,Arg). % Program 9.2 Finding subterms of a term </code> ===== Comments =====
pl/prolog/pllib/subterm.txt
· ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna)
Pokaż stronę
Poprzednie wersje
Menadżer multimediów
Do góry