Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,3 @@
numeric_string(String) :-
atom_string(Atom, String),
atom_number(Atom, _).

View file

@ -0,0 +1,8 @@
test_strings(Strings) :-
forall( member(String, Strings),
( ( numeric_string(String)
-> Result = a
; Result = 'not a' ),
format('~w is ~w number.~n', [String, Result])
)
).

View file

@ -0,0 +1,7 @@
?- test_strings(["123", "0.123", "-123.1", "NotNum", "1."]).
123 is a number.
0.123 is a number.
-123.1 is a number.
NotNum is not a number.
1. is not a number.
true.