Three types of Rules can be called: 
 Local and External Rules have Inputs and Outputs parameters. This information is used to determine what Rule should be called to evaluate an Attribute/Child during the KML process. The number of Rules called is not limited. An attribute can be the Output of only one Rule but can be used as Input for any Rule. 
Rules
{
           External Rules
{
                     Add(a,b,c); /* a and b are Inputs for the Add Rule, c is Output */
            }
            Rule   /* Local Rule */
            {
                   let i = 1
                   c = 0
                   for i while i <= b
                    {
                         c = c + a
                    }
            };
            Rule on Init /* Initialization Rule */
            {
                    /* Provides acceptable values for a String attribute named CarColor */
                    let acceptableValues(List)
                    If Owner.CarType == “FluoCar”
                    {
                             acceptableValues.Append(“Green”)
                             acceptablevalues.Append(“Yellow”)
                    }
                    else
                    {
                             acceptableValues.Append(“Red”)
                             acceptableValues.Append(“White”)
                             acceptableValues.Append(“Black”)
                     }
                     CarColor.AuthorizedValues = acceptableValues
            };
} | ||||||||