mls_macros 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ########################################
  2. #
  3. # gen_cats(N)
  4. #
  5. # declares categores c0 to c(N-1)
  6. #
  7. define(`decl_cats',`dnl
  8. category c$1;
  9. ifelse(`$1',`$2',,`decl_cats(incr($1),$2)')dnl
  10. ')
  11. define(`gen_cats',`decl_cats(0,decr($1))')
  12. ########################################
  13. #
  14. # gen_sens(N)
  15. #
  16. # declares sensitivites s0 to s(N-1) with dominance
  17. # in increasing numeric order with s0 lowest, s(N-1) highest
  18. #
  19. define(`decl_sens',`dnl
  20. sensitivity s$1;
  21. ifelse(`$1',`$2',,`decl_sens(incr($1),$2)')dnl
  22. ')
  23. define(`gen_dominance',`s$1 ifelse(`$1',`$2',,`gen_dominance(incr($1),$2)')')
  24. define(`gen_sens',`
  25. # Each sensitivity has a name and zero or more aliases.
  26. decl_sens(0,decr($1))
  27. # Define the ordering of the sensitivity levels (least to greatest)
  28. dominance { gen_dominance(0,decr($1)) }
  29. ')
  30. ########################################
  31. #
  32. # gen_levels(N,M)
  33. #
  34. # levels from s0 to (N-1) with categories c0 to (M-1)
  35. #
  36. define(`decl_levels',`dnl
  37. level s$1:c0.c$3;
  38. ifelse(`$1',`$2',,`decl_levels(incr($1),$2,$3)')dnl
  39. ')
  40. define(`gen_levels',`decl_levels(0,decr($1),decr($2))')
  41. ########################################
  42. #
  43. # Basic level names for system low and high
  44. #
  45. define(`mls_systemlow',`s0')
  46. define(`mls_systemhigh',`s`'decr(mls_num_sens):c0.c`'decr(mls_num_cats)')