lambdapi icon indicating copy to clipboard operation
lambdapi copied to clipboard

Prefix priority which can supersede regular application

Open yannl35133 opened this issue 3 years ago • 4 comments

As far as I understand, regular application has infinite priority, so nothing can supersede it.

yannl35133 avatar Apr 29 '21 11:04 yannl35133

Thanks @yannl35133 to provide a use case.

fblanqui avatar May 03 '21 05:05 fblanqui

@yannl35133 What is the status of this issue? You didn't answer my question yet.

fblanqui avatar May 25 '21 17:05 fblanqui

I don't have a personal use-case, I don't need it currently.

As for a theoretical use-case, a prefix could always be replaced by a normal id, so it wouldn't be completely necessary; a use-case for an infix notation could be an operation lifted on functions, with a function called with parameters:

constant symbol Int: TYPE;
symbol +: Int → Int → Int;

symbol +! (f: Int → Int) (g: Int → Int) : Int → Int ≔ λ(x: Int), f x + g x;
notation +! infix left 1000; // more than application

type λ(x: Int), f +! g x;

I agree it does not feel natural here, most would just put parentheses around the addition, but it can be turned into something more convincing

yannl35133 avatar May 25 '21 20:05 yannl35133

Is this still relevant? Aren't we happy with the current behaviour being that function application has always the highest priority? Plus I think it would introduce some complexity regarding the user interface because users would have to remember what the application priority is, or we'd have to complexify the priority notation.

gabrielhdt avatar Apr 24 '24 07:04 gabrielhdt