chore: Demo & examples
This commit is contained in:
parent
61178cbeac
commit
b294467587
9 changed files with 228 additions and 23 deletions
15
examples/meta/ground.pl
Normal file
15
examples/meta/ground.pl
Normal file
|
@ -0,0 +1,15 @@
|
|||
ground(T) :-
|
||||
nonvar(T), atomic(T),
|
||||
!.
|
||||
ground(T) :-
|
||||
nonvar(T), compound(T),
|
||||
functor(T, _, N),
|
||||
ground(T, N).
|
||||
|
||||
ground(T, N) :-
|
||||
N \== 0,
|
||||
arg(N, T, A),
|
||||
ground(A),
|
||||
M is N - 1,
|
||||
ground(T, M).
|
||||
ground(T, 0).
|
Reference in a new issue