PROLOG (VI) : La estructura condicional if-then-else
La estructura condicional if-then-else (si-entonces-sino) está implementada en PROLOG aunque tiene un formato singular.
true -> print(«then»); print(«else») se leería como «if true then print(«then») else «print(«else»)» así que devuelve then y true
false -> print(«then»); print(«else») se leería como «if false then print(«then») else «print(«else»)» devuelve else y truetrue *-> print(«true») ; print(«false»).
Para leer más:
Comentarios
Publicar un comentario