    001    /*
    002    @license.text@
    003     */
    004    package com.hammurapi.reasoning.tutorial.rules;
    005
    006    import com.hammurapi.reasoning.spi.Infer;
    007    import com.hammurapi.reasoning.spi.InferenceContext;
    008    import com.hammurapi.reasoning.tutorial.objectmodel.Child;
    009    import com.hammurapi.reasoning.tutorial.objectmodel.Son;
    010
    011    public class SonRule {
    012
    013            @Infer(Son.class)
    014            public void infer(Child child) {
    015                    if (!(child instanceof Son) && child.getSubject().isMale()) {
    016                            InferenceContext.INSTANCE.post(new Son(child.getSubject(), child.getObject()));
    017                    }
    018            }
    019    }