##### currently available factor expressions in YAML format

# multiply factors *f1 and *f2, then sum out variables [a,b]
!sumprod
arg: [a,b]
fac:
- *f1
- *f2

# evaluate a factor *f: set variable 'a' to value 'increased',
# 'b' to value of function *d
# NB indexed variables and indexing variables must not intersect
!index
det:
- !fun
  cod: [{'a': [normal,increased]}]
  dom: []
  par: [1]
- *d    # with codomain 'b'
fac:    # should always be single
- *f

# evaluate a factor: set variable 'a' to value 'increased', etc
# to be obsoleted by !index
!sindex
det: {a: increased, b: normal}
fac:    # should always be single
- *f

# base conditional probability table
!multinom
dom: [a: *scale1, b: [0,1] , c: [ja,nee]]
par: [0.56,0.34, ...]

# deterministic function
!fun
cod: [y: ['many','more','most']]   # possibility to extend to multivalued
dom: [x1: [0,1], x2: [0,1]]
par: [0,1,1,2]              # nb use integers!

# turning a deterministic relation into a probability distribution
!embed
det:
- *f  # of type !fun

# reorder+rename variables 
!reorder
dic: [b1: b, a1: a]
fac: - *f   # single

####### possible future extensions #########

# use arg: [var:[val1,val2],..] in !sumprod ??

multinom -> cpt/table/ptable/potential/discrete?
fun -> dtable?

# sumprod and index at the same time
!spi
arg: [a,b]
det: {c: 3, d: *f}
fac:
- *g1
- *g2

# keep variable a but cardinality becomes 1
!select
det: {a: 1}
fac:
- *i1


# deterministic function, predefined
!fun
cls: or
cod: [y: [False,True]]
dom: [x1: [False,True], x2: [False,True]]



