Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Friendly enough expression language (FEEL) for the purpose of giving standard executable semantics to many kinds of expressions in decision model has the following features;

...

Name and ParametersParameterDescriptionExample
boolean(from)stringboolean conversion

boolean("true") = true

boolean("false") = false

boolean(true) = true

not(negand)

boolean

logical negation

not(true) = false

not(null) = null

...

Name and ParametersParameterDescriptionExample

list contains(list, element)

list, any element of the semantic domain including null

does the list contain the element ?

list contains([1,2,3], 2) = true

count(list)

list

return size of list

count([1,2,3]) = 3

min(list)
min(c1,..., cN), N >1 max(list)
max(c1,..., cN), N >1

(list of) comparable items

return minimum item
return maximum item

min([1,2,3]) = 1
min(1,2,3) = 1
max([1,2,3]) = 3
max(1,2,3) = 3

sum(list)
sum(
n1,..., nN), N >1

(list of) numbers

return sum of numbers

sum([1,2,3]) = 6
sum(1,2,3) = 6

mean(list)
mean(
n1,..., nN), N >1

(list of) numbers

return arithmetic mean (average) of numbers

mean([1,2,3]) = 2
mean(1,2,3) = 2

and(list)
and(
b1,..., bN), N >1

(list of) Boolean items

return false if any item is false, else true if all items are true, else null

and([false,null,true]) = false and(false,null,true) = false
and([]) = true
and(0) = null

or(list)
or(
b1,..., bN), N >1

(list of) Boolean items

return true if any item is true, else false if all items are false, else null

or([false,null,true]) = true
or(false,null,true) = true
or([]) = false
or(0) = null

sublist(list, start position, length?)

list, number1, number2

return list of length (or all) elements of list, starting with list[start position]. 1st position is 1, last position is -1

sublist([1,2,3], 1, 2) = [2]

append(list, item...)

list, any element including null

return new list with items appended

append([1], 2, 3) = [1,2,3]

concatenate(list...)

list

return new list that is a concatenation of the arguments

concatenate([1,2],[3]) = [1,2,3]

insert before(list, position, newItem)

list, number1, any element including null

return new list with newItem inserted at position

insert before([1,3],1,2) = [1,2,3]

remove(list, position)

list, number1

list with item at position removed

remove([1,2,3], 2) = [1,3]

reverse(list)

list

reverse the list

reverse([1,2,3]) = [3,2,1]

index of(list, match)

list, any element including null

return ascending list of list positions containing match

index of([1,2,3,2],2) = [2,4]

union(list...)

list

concatenate with duplicate removal

union([1,2],[2,3]) = [1,2,3]

distinct values(list)

list

duplicate removal

distinct values([1,2,3,2,1] = [1,2,3]

flatten(list)

list

flatten nested lists

flatten([[1,2],[[3]], 4]) = [1,2,3,4]

...