Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble defining new operator

Tags:

prolog

I'm trying to define an infix operator but I keep getting errors. I'm using GNU Prolog 1.4.

I tried this: [user]. op(35, xfx, =>). ctrl-D

But got the error "native code procedure op/3 cannot be redefined (ignored)"

I also tried op(35, xfx, '=>'). and got the same error, and tried doing it without typing in [user]. first, but when I tried to actually use the operator I got an existence_error.

like image 319
user1215117 Avatar asked May 27 '26 10:05

user1215117


1 Answers

yup you need to run the predicate instead of defining it. To do that just insert :- before your op/3 call.

like image 124
m09 Avatar answered May 31 '26 11:05

m09