You can design the rules as sub routine and call it to use.
First you have to define the parameters of your fuzzy model. Then you can design the fuzzification processs and you can describe the rules as a subroutine. Besides, you have to introduce the implication method (Mamdani, Sugeno etc.). Finally you can design the defuzzification procedure. The defuzzification procedure may also be defined as another subroutine.
I hope this very short definitions may be helpful for you :)