greatly reduce the number of goal expansions done in callable if/then/else

This commit is contained in:
Mark Thom
2021-11-15 21:27:42 -07:00
parent 0404c3bd94
commit ffd1b7069f
5 changed files with 184 additions and 159 deletions

View File

@@ -629,6 +629,8 @@ expand_module_name(ESG0, M, ESG) :-
ESG = M:ESG0
; ESG0 = _:_ ->
ESG = ESG0
; predicate_property(ESG0, built_in) ->
ESG = ESG0
; ESG = M:ESG0
).
@@ -656,7 +658,8 @@ expand_module_names(Goals, MetaSpecs, Module, ExpandedGoals, HeadVars) :-
( GoalFunctor == (:),
SubGoals = [M, SubGoal] ->
expand_module_names(SubGoal, MetaSpecs, M, ExpandedSubGoal, HeadVars),
ExpandedGoals = M:ExpandedSubGoal
expand_module_name(ExpandedSubGoal, M, ExpandedGoals)
% ExpandedGoals = M:ExpandedSubGoal
; expand_meta_predicate_subgoals(SubGoals, MetaSpecs, Module, ExpandedGoalList, HeadVars),
ExpandedGoals =.. [GoalFunctor | ExpandedGoalList]
).