alcides / aeon

Aeon programming language
https://alcides.github.io/aeon/
8 stars 3 forks source link

Support to different types of Fitness Decorators #48

Open eduardo-imadeira opened 5 months ago

eduardo-imadeira commented 5 months ago

We support multiples Fitness Decorators in a single function for example:

@minimize( ... )
@minimize( ... )
def f (i: Int) : Int { (?hole:Int) }

but we only support multiples fitness decorators if they are of the same kind. @minimize with @minimize or @multi_minimize, and vice versa. And the same appends for the @maximize and @multi_maximize decorators.

we would like to support multiples fitness decorators with different kinds, for examples:

@minimize( ... )
@maximize( ... )
def f (i: Int) : Int { (?hole:Int) }

this can be done by adding support to the unary negation operator ( - ) that produces the negative of its operand, and using that operator to negate the value of the @maximize and @multi_maximize decorators during the process of decorators resolution.