OSDN Git Service

small func recognizes [] and [X].
authorSimon Forman <sforman@hushmail.com>
Tue, 20 Aug 2019 05:02:06 +0000 (22:02 -0700)
committerSimon Forman <sforman@hushmail.com>
Tue, 20 Aug 2019 05:02:06 +0000 (22:02 -0700)
thun/gnu-prolog/thun.pl

index 88ef875..850e1db 100644 (file)
@@ -114,6 +114,10 @@ func(bool, [_|S], [true|S]).
 
 func(sqrt, [A|S], [B|S]) :- B is sqrt(A).
 
+func(small, [[_]|S], [ true|S]).
+func(small, [ []|S], [ true|S]).
+func(small, [  X|S], [false|S]) :- X \= [_], X \= [].
+
 
 /*
 Combinators