-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
usabilityMakes behaviour and outputs of the system easier to understand.Makes behaviour and outputs of the system easier to understand.
Milestone
Description
If-Then-Else Logic is already supported with this "syntax":
?- once((If, Then) ; Else).The official syntax, used by other prologs, and that must be implemented with this ticket however is
?- (If -> Then ; Else)The trick is that with iso operators, this is parsed as ';'('->'(If, Then), Else). ->/2 is then probably defined like
'->'(If, Then) :-
call(If),
(Then ; !).With ! being basically impossible to implement into the coroutine-based search tree, implementing this syntax on ISO operators seems pretty challenging.
One option could be redefining the operators so (If -> Then ; Else) gets parsed as '->'(If, ';'(Then, Else)) and implementing '->'/2 using once.
If it is not possible/feasible to implement this way, consider an alternate syntax that is more readable than the once version, e.g. if(IF) then (Then) else (Else)
Metadata
Metadata
Assignees
Labels
usabilityMakes behaviour and outputs of the system easier to understand.Makes behaviour and outputs of the system easier to understand.