logo
down
shadow

Listing facts with uncertainty


Listing facts with uncertainty

By : Tom Charland
Date : November 22 2020, 10:31 AM
With these it helps Why don't you use a tuple predicate like fact/2?
Then you specify:
code :
fact(fever,likely).
fact(flu,certain).
findall(::(X,Y),::(fact(X),Y),L).
op(900, xfx, user:(::)).


Share : facebook icon twitter icon
How to enter all results of this rule as facts in the program or how can I process these results as facts?

How to enter all results of this rule as facts in the program or how can I process these results as facts?


By : nOosha
Date : March 29 2020, 07:55 AM
like below fixes the issue My suggestions are coming from SWI-Prolog.
You can insert data to a dynamic database using assert/1; you can put the tuple on the Linda table with out/1 or use even more advanced features such as db_assert.
Clips: matching complex patterns consisting of many facts and instances whose creation is based on these facts

Clips: matching complex patterns consisting of many facts and instances whose creation is based on these facts


By : Michael Mowad
Date : March 29 2020, 07:55 AM
may help you . All other things being equal, I'd suggest choosing the approach which is most maintainable. So a few simpler rules would be better than one large unwieldy and/or self modifying complicated rule.
Patterns will be shared for rules using the same set of initial patterns, so there's not a large computational burden for duplicating the patterns for multiple rules, but it does make the rules more difficult to maintain since changes to those common patterns will need to be made across multiple rules.
code :
(defrule rule1
   (a ?x)
   =>
   (assert (conclusion 1 ?x)))

(defrule rule2
   (a ?x)
   (conclusion 1 ?x)
   (b ?x)
   =>
   (assert (conclusion 2 ?x)))

(defrule rule3
   (a ?x)
   (conclusion 1 ?x)
   (b ?x)
   (conclusion 2 ?x)
   (c ?x)
   =>
   (assert (conclusion 3 ?x)))
(defrule rule1
   (a ?x)
   =>
   (assert (conclusion 1 ?x)))

(defrule rule2
   (conclusion 1 ?x)
   (b ?x)
   =>
   (assert (conclusion 2 ?x)))

(defrule rule3
   (conclusion 2 ?x)
   (c ?x)
   =>
   (assert (conclusion 3 ?x)))
(defrule rule1
   (logical (a ?x))
   =>
   (assert (conclusion 1 ?x)))

(defrule rule2
   (logical (conclusion 1 ?x)
            (b ?x))
   =>
   (assert (conclusion 2 ?x)))

(defrule rule3
   (logical (conclusion 2 ?x)
            (c ?x))
   =>
   (assert (conclusion 3 ?x)))
ansible how is hostvars and gathered facts and facts from setup module different

ansible how is hostvars and gathered facts and facts from setup module different


By : Juan Ignacio Ubeira
Date : March 29 2020, 07:55 AM
it should still fix some issue You define host vars in your inventory prior to contacting your hosts.
You collect facts during setup phase.
How can I pair up facts to create new facts?

How can I pair up facts to create new facts?


By : Blumenwiese
Date : March 29 2020, 07:55 AM
around this issue I'm new to CLIPS and am trying to use it to create a custom Instrument in Xcode to model state changes in an enumeration.
code :
         CLIPS (6.31 4/1/19)
CLIPS> 
(deftemplate signpost
    (slot time (type INTEGER))
    (slot state (type STRING)))
CLIPS> 
(deftemplate state-interval
    (slot start (type INTEGER))
    (slot duration (type INTEGER))
    (slot state (type STRING)))
CLIPS> 
(defrule find-interval

   ;; Find the first signpost

   (signpost (time ?time1) (state ?state))

   ;; And a second signpost that comes later

   (signpost (time ?time2&:(> ?time2 ?time1)))

   ;; And there's no other signpost between the two

   (not (signpost (time ?time3&:(> ?time3 ?time1)
                              &:(< ?time3 ?time2))))
   =>

   (assert (state-interval (start ?time1)
                           (duration (- ?time2 ?time1))
                           (state ?state))))
CLIPS>    
(deffacts sample-data
    (signpost (time 0) (state "one"))
    (signpost (time 2) (state "two"))
    (signpost (time 5) (state "three"))
    (signpost (time 10) (state "four")))
CLIPS> (watch rules)
CLIPS> (watch facts)
CLIPS> (watch activations)
CLIPS> (reset)
<== f-0     (initial-fact)
==> f-0     (initial-fact)
==> f-1     (signpost (time 0) (state "one"))
==> f-2     (signpost (time 2) (state "two"))
==> Activation 0      find-interval: f-1,f-2,*
==> f-3     (signpost (time 5) (state "three"))
==> Activation 0      find-interval: f-2,f-3,*
==> f-4     (signpost (time 10) (state "four"))
==> Activation 0      find-interval: f-3,f-4,*
CLIPS> (run)
FIRE    1 find-interval: f-3,f-4,*
==> f-5     (state-interval (start 5) (duration 5) (state "three"))
FIRE    2 find-interval: f-2,f-3,*
==> f-6     (state-interval (start 2) (duration 3) (state "two"))
FIRE    3 find-interval: f-1,f-2,*
==> f-7     (state-interval (start 0) (duration 2) (state "one"))
CLIPS> (facts)
f-0     (initial-fact)
f-1     (signpost (time 0) (state "one"))
f-2     (signpost (time 2) (state "two"))
f-3     (signpost (time 5) (state "three"))
f-4     (signpost (time 10) (state "four"))
f-5     (state-interval (start 5) (duration 5) (state "three"))
f-6     (state-interval (start 2) (duration 3) (state "two"))
f-7     (state-interval (start 0) (duration 2) (state "one"))
For a total of 8 facts.
CLIPS> 
How to add dependency for custom facts -Facts['name'] executing first before all exec commands

How to add dependency for custom facts -Facts['name'] executing first before all exec commands


By : Jaleel Niyaz
Date : March 29 2020, 07:55 AM
wish help you to fix your issue
My problem is that Facts['listdirectory'] is executed before being downloaded from ftp.
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org