Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,3 @@
|
|||
numeric_string(String) :-
|
||||
atom_string(Atom, String),
|
||||
atom_number(Atom, _).
|
||||
|
|
@ -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])
|
||||
)
|
||||
).
|
||||
|
|
@ -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.
|
||||
Loading…
Add table
Add a link
Reference in a new issue