From ebd42adc3087c7006f2d4c1a3801d992b4d3f966 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 7 Oct 2023 14:21:31 +0200 Subject: [PATCH] ; Recognize ext-quantified goal positions as callable --- sweep.pl | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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), -- 2.39.2