Perfect I got it. Can you please check below I should suppose to be getting two facts added to the list but its only adding one fact however condition of another fact is also met.
CLIPS> (deftemplate slope
(slot variable)
(slot value)
(slot time)
(slot peak))
CLIPS> (deftemplate output
(slot variable)
(slot time)
(slot peak))
CLIPS> (defrule score
(slope (variable ?v)
(time ?t1)
(value 0)
(peak 0))
(slope (variable ?v)
(time ?t2&=(+ ?t1 1))
(value ?v1&:(> ?v1 0))
(peak ?p1&:(> ?p1 0)))
(slope (variable ?v)
(time ?t3&=(+ ?t1 2))
(value 0)
(peak ?p2&:(> ?p2 ?p1)))
(slope (variable ?v)
(time ?t4&=(+ ?t1 3))
(value ?v3&:(< ?v3 0))
(peak ?p3&:(< ?p3 ?p2)))
(slope (variable ?v)
(time ?t5&=(+ ?t1 4))
(value ?v4&:(= ?v4 0))
(peak ?p4&:(= ?p4 0)))
(slope (variable ?v)
(time ?t6&=(+ ?t1 5))
(value ?v5&:(> ?v5 0))
(peak ?p5&:(> ?p5 ?p4)))
(slope (variable ?v)
(time ?t7&=(+ ?t1 6))
(value ?v6&:(< ?v6 0))
(peak ?p6&:(< ?p6 ?p5)))
=>
(assert (output (variable ?v)(time ?t3)(peak ?p2) )))
CLIPS> (defrule scores
(slope (variable ?v)
(time ?t1)
(value 0)
(peak 0))
(slope (variable ?v)
(time ?t2&=(+ ?t1 1))
(value INF)
(peak ?p1&:(> ?p1 0)))
(slope (variable ?v)
(time ?t3&=(+ ?t1 2))
(value INF)
(peak ?p2&:(> ?p2 ?p1)))
(slope (variable ?v)
(time ?t4&=(+ ?t1 3))
(value INF)
(peak ?p3&:(> ?p3 ?p2)))
(slope (variable ?v)
(time ?t5&=(+ ?t1 4))
(value 0)
(peak ?p4&:(= ?p4 ?p3)))
(slope (variable ?v)
(time ?t6&=(+ ?t1 5))
(value INF)
(peak ?p5&:(< ?p5 ?p4)))
(slope (variable ?v)
(time ?t7&=(+ ?t1 6))
(value 0)
(peak 0))
=> (assert (output (variable ?v)(time ?t5)(peak ?p4))))
CLIPS> (assert (slope (variable drill) (time 1) (value 0) (peak 0))
(slope (variable drill) (time 2) (value 3) (peak 200))
(slope (variable drill) (time 3) (value 0) (peak 300))
(slope (variable drill) (time 4) (value -2) (peak 100))
(slope (variable drill) (time 5) (value 0) (peak 0))
(slope (variable drill) (time 6) (value 4) (peak 600))
(slope (variable drill) (time 7) (value -1) (peak 550))
(slope (variable drillpipe)(time 1)(value 0)(peak 0))
(slope (variable drill)(time 2)(value INF)(peak 20))
(slope (variable drill)(time 3)(value INF)(peak 35))
(slope (variable drill)(time 4)(value INF)(peak 50))
(slope (variable drill)(time 5)(value 0)(peak 50))
(slope (variable drill)(time 6)(value INF)(peak 45))
(slope (variable drill)(time 7)(value 0)(peak 0)))