From: Eshel Yaron Date: Sat, 7 Oct 2023 12:21:31 +0000 (+0200) Subject: ; Recognize ext-quantified goal positions as callable X-Git-Tag: V9.1.16-sweep-0.25.3~8 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ebd42adc3087c7006f2d4c1a3801d992b4d3f966;p=sweep.git ; Recognize ext-quantified goal positions as callable --- diff --git a/sweep.pl b/sweep.pl index fa16037..abe7cfe 100644 --- a/sweep.pl +++ b/sweep.pl @@ -1008,10 +1008,7 @@ name_variable(N, V) :- V = '$VAR'(N). sweep_context_callable([H|T], R) :- H = [F0|_], atom_string(F, F0), - ( xref_op(_, op(1200, _, F)) - -> true - ; current_op(1200, _, F) - ), + op_is_neck(F), !, ( F == (-->) -> R0 = 2 @@ -1021,6 +1018,12 @@ sweep_context_callable([H|T], R) :- sweep_context_callable([_|T], R) :- sweep_context_callable(T, R). +op_is_neck(F) :- + ( xref_op(_, op(1200, _, F)) + -> true + ; current_op(1200, _, F) + ). + sweep_context_callable_([], R0, R1, R) :- R is R0 + R1, !. sweep_context_callable_([[":"|2]], R0, R1, R) :- R is R0 + R1, !. sweep_context_callable_([["("|_]|T], R0, R1, R) :- @@ -1036,11 +1039,9 @@ sweep_context_callable_([H|T], R0, _, R) :- sweep_context_callable_(T, R0, R1, R). sweep_context_callable_arg((-->), _, 2) :- !. +sweep_context_callable_arg(^, _, 0) :- !. sweep_context_callable_arg(Neck, _, 0) :- - ( xref_op(_, op(1200, _, Neck)) - -> true - ; current_op(1200, _, Neck) - ), + op_is_neck(Neck), !. sweep_context_callable_arg(F, N, R) :- sweep_current_module(Mod),