The module provides the tools to work with Horn Reasoning Systems (HRS) through the definition of facts and rules and the use of forward and backward chaining to make deductions. Conversion to standard formulas and clauses is also provided to apply other algorithms on them.
It defines an inference rule of Horn as a tuple whose first element regards to the antecedents of the rule and the second one to de consecuent of the rule.
It defines a Knowledge Base of Horn as a set of facts.
It defines a row of a table of FC process with the properties:
It holds the result of forward chaining process including rules, the initial KB, the goal, a table that summarizes the development of the algorithm and the result (if the goal can be deducted from initial KB with the rules given )
It performs forwardChaining algorithm with removing, at each step, the rules shot from available rules.
It performs forwardChaining algorithm with removing, at each step, the rules whose consecuent is already in the KB from available rules.
It generates a markdown string (includinf latex notation) of the result of a forwarding chaining execution.
It defines a row of a table of BW process with the properties:
It holds the result of backward chaining process including rules, the initial KB, the goal, a table that summarizes the development of the algorithm and the result (if the goal can be deducted from initial KB with the rules given).
It performs the backward chaining algorithm by selecting at each step the way with the fewest remaining goals and the goal using alphabetical order.
It generates a MD string (including latex notation) of the result of an execution of BC algorithm
It transform a Horn fact to a standard formula
It transform a Horn KB to a standard formula set
It transform a Horn rule to a standard formula
It transform a list of Horn rules to a standard formula
It transform a Horn fact to a clause
It transform a Horn kb to a set of clauses
It transform a Horn rule to a clause
It transform a list of Horn rules to a set of clauses
It reads a Horn fact from a string. The string may correspond to:
It gives a tuple with the Horn fact (if it could be read) , the input string and the message of error (if fact couldn't be read).
It extract the Horn fact read. If it is not present it returns a fact of inconsistency
It generates the string that corresponds to the input of a given Horn fact
It reads a Horn KB from a string. The string has to match to a serial of facts separated by commas, following the rules defined for facts parsing.
It gives a tuple with the Horn KB (if it could be read) , the input string and the message of error (if fact couldn't be read).
It extract the Horn KB read. If it is not present it returns an empty set
It generates the string that corresponds to the input of a given Horn KB
It reads a Horn rule from a string. The string has to match to a serial of facts separated by & for the antecedents, followed by the symbol -> and a unique fact as consecuent.
It gives a tuple with the Horn rule (if it could be read) , the input string and the message of error (if fact couldn't be read).
It extract the Horn rule read. If it is not present it returns a rule with inconsistence as antecedent and consecuent
It generates the string that corresponds to the input of a given Horn rule
It reads a Horn rule list from a string. The string has to match to a serial of rules separated by commas.
It gives a tuple with the Horn rule list (if it could be read) , the input string and the message of error (if fact couldn't be read).
It extract the list of Horn rules read. If it is not present it returns an empty list
It generates the string that corresponds to the input of a given list of Horn rules
It gives the string representation of a Horn fact using unicode notation
It gives the string representation of a Horn fact using latex notation
It gives the string representation of a Horn KB separating facts by comma using unicode notation
It gives the string representation of a Horn KB separating facts by & using unicode notation
It gives the string representation of a Horn KB separating facts by comma using latex notation
It gives the string representation of a Horn KB separating facts by & using latex notation
It gives the string representation of a Horn rule using unicode notation
It gives the string representation of a Horn rule using latex notation
It gives the string representation of a Horn rule list using unicode notation and indexing the formulas by its position in the list
It gives the string representation of a Horn rule list using latex notation and indexing the formulas by its position in the list
It defines a fact as a propositional variable. Use ("⟂", []) for represent inconsistence and ("⊤", []) for represent tautology.