chore: Demo & examples

This commit is contained in:
Tibo De Peuter 2025-05-18 23:27:35 +02:00
parent 61178cbeac
commit b294467587
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
9 changed files with 228 additions and 23 deletions

15
examples/meta/ground.pl Normal file
View 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).