Created
November 24, 2016 21:10
-
-
Save horpto/d870dcd0c522117bcc3e5cbd6dd4f972 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREDICATES | |
nondetermclear_string(string, string) | |
CLAUSES | |
clear_string("", ""). | |
clear_string(Str, Res) :- | |
frontstr(1, Str, Fchar, Rest), | |
Fchar = " ", !, | |
clear_string(Rest, Res) | |
. | |
clear_string(Str, Res) :- !, | |
frontstr(1, Str, Fchar, Rest), | |
clear_string(Rest, Tail), | |
concat(Fchar, Tail, Res) | |
. | |
goal | |
clear_string("hell oo lss ", R), write(R). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment