map Function Description

Description

This function converts a bag of values to another bag of values. It applies another function to n atomic values and a bag to return a bag of the same size as the first bag.

map belongs to the ALFA function reference's higher order bag functions category. It maps to the XACML function identifier urn:oasis:names:tc:xacml:1.0:function:map.

Property Value
Category higher order bag functions
# Arguments
Arguments
Return Value
Expressed As pre-fix
Representation ALFA short name
Allowed In Target false
ALFA Shorthand
Commutative false

Example

policy mapExample{
        apply firstApplicable

        rule addAge{
                permit
        target blackjack.possible == true 
                condition 21 == map(function[integerAdd], integerOneAndOnly(deck.nextCard), player.has)

This example evaluates whether blackjack is possible by evaluating the bag of possible card values in the deck with what the player has in hand.

See Also

Related Functions

Other functions in the higher order bag functions category:

Browse the full ALFA function reference.