Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Bool backward(array<truth> truths, array<rule> rules, hypothesis) {
Bool result = false;
// Check if hypotesis is true
For(truth:truths)
If (truth(hypotesis))
Return true;
For(rule:rules)
If(rule.isThen(hypothesis))
// Remove rule to avoid circular logic
If (Result = backward(truths, rules.remove(rule), rule.getIs()))
Return true;
Return result;
}
Sorry for:
Phone
Coding something i just read for 5 minutes about
Not knowing terminology
Bad coding
!rant
Backward chaining algorithm in less than 20 lines, any bidder?
random