remove $reify_switch

This commit is contained in:
Mark Thom
2019-04-05 09:04:05 -06:00
parent 6dade1b917
commit 03f2190d6b
5 changed files with 6 additions and 57 deletions

View File

@@ -4,18 +4,13 @@
:- use_module(library(dif)).
/* in essence, '$reify_switch'(T, Then_0, Else_0) is semantically this,
( T == true -> call(Then_0)
if_(If_1, Then_0, Else_0) :-
call(If_1, T),
( T == true -> call(Then_0)
; T == false -> call(Else_0)
; nonvar(T) -> throw(error(type_error(boolean, T), _))
; throw(error(instantiation_error, _))
).
but it does not create choice points.
*/
if_(If_1, Then_0, Else_0) :-
call(If_1, T),
'$call_with_default_policy'('$reify_switch'(T, Then_0, Else_0)).
=(X, Y, T) :-
( X == Y -> T = true