1 / 79

Reasoning Systems for e-Business

Explore how reasoning systems can improve e-business applications, including privacy, security, trust, and efficient market modeling. Learn about technologies like natural language processing and diagnostics.

carylg
Download Presentation

Reasoning Systems for e-Business

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS6905 Advanced Technologies for e-BusinessMay 1 – July 31 2003 Segment 1 Bruce Spencer May 1 – May 29 2003

  2. INTRO Course Overview • NRC e-Business Application Groups • e-Health (Saint John) • e-Government (Fredericton) • e-Learning (Moncton) • Technology Groups • Human Web (Fredericton) • Internet Logic (Fredericton) • reasoning systems for e-business (on the web) Reasoning Systems for e-Business

  3. INTRO Internet logic: meeting needs of e-business applications • privacy, security, trust • Does this transaction meet with user’s intentions, espressed as rules • semantic processing of web data • natural language, data bases, web logs • market modelling • maximizing utilities for buying and selling • diagnosis • fixing faults, comparing to models of what should happen • qualitative reasoning • models of what should happen are described abstractly • collaborative filtering, data mining • information from data Reasoning Systems for e-Business

  4. INTRO Specific Project: NBON • online tendering for purchasing by gov’ts, schools, hospitials universities • purchasing agent assigns GSIN codes to items to be purchased, from among 16K codes in hierarchy • each vendor (private business) codes self according to what is for sale • NBON system: if two items on the same branch of hierarchy, send an email notification to vendor • NB is only place this is done in Canada (world?) • Problem: too much email • coding too high (not precise enough) • inaccurate coding Reasoning Systems for e-Business

  5. Reasoning Systems for e-Business

  6. INTRO Reasoning Systems for e-Business

  7. INTRO Technologies that can help • Natural Language Processing • mapping NL descriptions of items to the codes is hard for most people to do; experts hired by NBON • Bayes network of conditional probabilities P(code | word). • For a given code, combine all of the prob’ties over words • Report codes with highest prob’ties • Uses years of previous codes assigned to tenders • OLAP • How many furniture purchases by municipalities in southeast NB municipalities cost in range $50-100 in 2002? • In constant time? Reasoning Systems for e-Business

  8. INTRO Diagnostics • a machine that takes tender description and vendor description and generates a yes/no to the question should this tender be sent to this vendor? • False positives • too much email, system becomes ineffective • False negative • missed tendering opportunity, company dies • Fix the machine so that neither fault occurs Reasoning Systems for e-Business

  9. INTRO Logic, Policies and eBusiness • Policies govern any eBusiness transaction • privacy policies • pricing policies • eligibilities • access control • Logic and proofs • logic for expressing policies • exact correspondence with desired states of the world • convincing proofs that policies were adopted Reasoning Systems for e-Business

  10. An elite customer can get 5% discount on decent or better cars if his payment type is “silver”. discount(V0,V1,' 5%percent' ) eliteCustomer(V0), decentCarOrAbove(V1), paymentType(silver). INTRO “Silver” payment type is pay by 2 year installments with financial assistance of less than $10000. paymentType(silver)  payBy(2yearInstallment), financialAssistance(lessThan$10000). “Silver” payment type is pay by 3 year installments with financial assistance of less than $7000. paymentType(silver)  payBy(3yearInstallment), financialAssistance(lessThan$7000). “Silver” payment type is pay by 5 year installments without financial assistance. paymentType(silver)  payBy(5yearInstallment), financialAssistance($0). Policies and Rules Reasoning Systems for e-Business

  11. INTRO Interactive system for negotiating policy Reasoning Systems for e-Business

  12. Overview Lectures for Segment 1 • 1 Intro to logic • Syntax • Semantics • Web-ized Logic • 2 More logic • Logical Consequences • Inference Rules • Proofs • Soundness and Completeness • 3 Logic for the Web • Well Founded Semantics • Description Logic • Efficiency vs. Expressiveness Reasoning Systems for e-Business

  13. Overview Lectures for Segment 1 (cont`d) • 4 Ontologies and the Semantic Web • 5 Rules for e-Commerce • 6 Rules for Privacy • 7 Discrimination Trees and Indexing • 8 Inference Queue Reasoning Systems for e-Business

  14. Example • Suppose Prof Phil teaches at the university and has two students, a boy Bob and girl Gail. Bob likes Gail but we are not sure whether Gail likes Bob. We know that each person has one best friend, and always likes that friend. Also if one person likes another, then it is always mutual. Reasoning Systems for e-Business

  15. Intro to Logic Intro to Logic: Syntax • Given: V, CS, FS, PS, connectives, quantifiers • Variables: x, y, z, u, v, w, x1, y1, … • Constant Symbols: a, b, c, d, e, a1, b1, … • Function Symbols: f, g, h, f1, g1, … • Predicate Symbols: P, Q, R, P1, Q1, … • , ,, • ,  • Function Symbols and Predicate Symbols have arities • FSi is the set of functions symbols with arity i • PSi is the set of functions symbols with arity i • FS is the union of all FSi • PS is the union of all PSi Reasoning Systems for e-Business

  16. Intro to Logic Exercise • Think of reasonable constant symbols, function symbols and predicate symbols for the example. Reasoning Systems for e-Business

  17. Definitions: Terms • The set T of terms is defined inductively: • V T (variables are terms) • CS T (constants are terms) • If t1,…,tnT and f FSn then f(t1,…,tn) T. • Terms from (3) are called functional terms, tiare called the arguments. • A term soccurs in t if s=t, or s occurs in an argument of t. • V(t) denotes the set of variables occurring in a term t. • If V(t) =  then t is ground. • FS(t) is the set of all function symbols occurring in t. FSn(t) is the set of all function symbols of arity n occurring in t.PS(t) and PSn(t) are similarly defined. Reasoning Systems for e-Business

  18. Exercise • Think of reasonable constant symbols, function symbols and predicate symbols for the example. What are their arities? • Write terms for the best friend of the Gail, for the best friend of the best friend of Phil. What other terms occur in your terms? Give some examples with non-empty sets of variables. Reasoning Systems for e-Business

  19. Intro to Logic Definitions: Formulas • If t1,…,tnT and PPSn then P(t1,…,tn) is an atom formula or atom. P is called the leading symbol and the tiare called the arguments. • If A is an atom formula, A and A are called literals. • AT is the set of all atoms. LIT is the set of all literals. • The set of all predicate logic formulas PL is defined inductively: • LIT  PL (literals are in PL) • If A,B  PL then (AB), (AB), (AB)  PL. • If A PL and x  V and neither (x)nor (x) occurs in A then (x) A and ( x) A  PL. Reasoning Systems for e-Business

  20. Exercise • Write some atoms, some literals and some formulas using the symbols from the previous exercise. Reasoning Systems for e-Business

  21. Intro to Logic Interpretations • An interpretation of a formula F in PL is a pair  =(D,) with the following properties. • D is a non-empty set called the domain. •  is a mapping on PS(F)  FS(F)  CS(F) • For c  CS(F) (c) D • For f  FSn(F) (f) is a function of type Dn D • For P  FSn(F) (P) is a function of type Dn {T,F}. (That is, P is an n-ary predicate.) Reasoning Systems for e-Business

  22. Exercise • Give an explicit interpretation for this example. Can there be more than three people in the domain of your interpretation? Reasoning Systems for e-Business

  23. Intro to Logic Evaluation of a formula • Let  =(D,) be an interpretation of a formula F. • We assume that F has no free variables. • The evaluation functionv is a function of type PL(F)  {T,F} defined inductively as follows: • If A = P(t1,…,tn) then v(A)= (P)(v(t1),…,v(tn)) • v(AB) = and(v(A),v(B)) • v(AB) = or(v(A),v(B)) • v(A  B) = imp(v(A),v(B)) • v(A) = not(v(A)) • v( (x) A ) = T iff v( A’ ) = Twhere A’ is A where the value chosen for x is d, for all values d  D • v( (x) A ) = T iff v( A’ ) = Twhere A’ is A where the value chosen for x is d, for some value d  D where and, or, imp and not have the usual meanings. Reasoning Systems for e-Business

  24. Definitions: Verifies, Falsifies, Model • An interpretation  of a formula AverifiesA if v(A) = T. Then we say that  is a model of A. •  falsifies A if v(A) = F. • A formula A is satisfiable if it has a model. A is valid if every interpretation is a model. • Two formulas are logically equivalent of they have the same models. They are satisfiably equivalent if one is satisfiable iff the other is. Reasoning Systems for e-Business

  25. Exercises • Give a formula that characterizes the situation described. Give a model of those formulas. • Describe a situation that would be a non model for the formula you gave. • Give a formula that is a conjunction of subformulas, for which the described situation is a model. Select each of these conjuncts in turn and give an interpretation that falsifies the selected conjunct but not any of the others. • Give an example of a valid formula. • Remember, the formula describes the situation, but the situation models (is a model of) the formula. Reasoning Systems for e-Business

  26. Intro to Logic Hint Male(bob)  Male(phil)  Female(gail) Teaches(phil, bob)  Teaches(phil, gail)  Likes(bob, gail)  (z) (Likes(z, bestFriendOf(z))  (x) (y) (¬Likes(x,y)  Likes(y,x)) Reasoning Systems for e-Business

  27. Intro to Logic “Web-ized” logic • Consider a variant of PL in which all constant symbols are Uniform Resource Indexes, consisting of a host and domain name and path from the root of the web directory of the host. Thus it defines the current world-wide-web. • Could function and relation symbols also be URI’s? • Could constant, function and relation symbols also refer to files, i.e. could they be URL’s? What would they reasonably point to? Reasoning Systems for e-Business

  28. Intro to Logic Clausal formulas • Definition: A clause is defined inductively: •  is a clause. • Literals are clauses. • If C and D are clauses then C D are clauses. • In clause notation, there are no quantifiers. We assume that all variables are quantified with . • We remove the restriction that variables must be unique. • There is a mechanical means of computing a set of clauses that is satisfiably equivalent to a given formula. • A clause with at most one positive literal is called a Horn clause. Reasoning Systems for e-Business

  29. Intro to Logic Exercise • How important are Horn clauses? Are all of your formulas for the previous exercises convertible to Horn clauses? • Describe a situation modeling a non-Horn clause. Reasoning Systems for e-Business

  30. Intro to Logic IF – THEN Clauses • A definite clause is a non-negative Horn clause. Thus it has exactly one positive literal. • Given a definite clause, let COND refer to the collection of atoms from the negative literals, if any, and CONCL refer to the positive literal. • COND  CONCL is a logically equivalent formula, said to be in rule form. • Example: ¬Likes(x,y)  ¬Likes(y,z)  Likes(x,z) COND = {Likes(x,y), Likes(y,z) } Rule form: Likes(x,y)  Likes(y,z) Likes(x,z) Reasoning Systems for e-Business

  31. Intro to Logic Exercise • Show that a definite clause is logically equivalent to its rule form. Reasoning Systems for e-Business

  32. Intro to Logic RuleML: Web-ized, rules and XML ''The discount for a customer buying a product is 5.0 percent if the customer is premium and the product is regular <imp> <_head> <atom> <_opr><rel>discount</rel></_opr> <var>customer</var> <var>product</var> <ind>5.0 percent</ind> </atom> </_head> <_body> <and> <atom> <_opr><rel>premium</rel></_opr> <var>customer</var> </atom> <atom> <_opr><rel>regular</rel></_opr> <var>product</var> </atom> </and> </_body> </imp> Reasoning Systems for e-Business

  33. Intro to Logic The Module Hierarchy of RuleML DTDs ruleml ur-equalog Rooted DAG will be extended with branches for further sublanguages equalog ur-hornlog hornlog ur-datalog ur-datalog = join(ur,datalog) datalog ur urc-datalog bin-datalog URL/URI-like ‘ur’-objects urc-bin-datalog urc-bin-data-ground-log urc-bin-data-ground-fact RDF-like triples Reasoning Systems for e-Business

  34. More Logic = 2 1.999… Logical Consequences • We sometimes want to know what is true in all models. 1  2 Likes(bob, gail) Likes(gail, bob) Likes(x,y) Likes(y,x)  n Reasoning Systems for e-Business

  35. Definition of Logical Consequence • Given formulas F and G, such that for every model  of F,  verifies G. Then G is a logical consequence of F. We write F  G and we say that F entails G. models of G models of F Reasoning Systems for e-Business

  36. Rules of Inference • A rule of inference constructs a new formula G from a given (set of) formulas F. • We write F  G • Example: from A andAB infer B • Properties • Soundness: Rule does not lie. F  G implies F = G • Completeness: Rule tells whole truth. F  = G implies F  G • Completeness when G is an atom may be all you want. Reasoning Systems for e-Business

  37. Rule of Inference for Definite Clauses • Rule of inference for definite clauses (one positive literal) From C1,…,Cm Ai and A1,…, AnB infer A1,…, Ai-1,C1,…,Cm, Ai+1,…,An B • Sound? Yes. • Consider an arbitrary model  of both C1,…,Cm Ai and A1,…, AnB. Ai is either true or false in . If Ai true in , then A1,…, Ai-1,Ai+1,…,An B is also true in  and henceso is A1,…, Ai-1,C1,…,Cm, Ai+1,…,An B.If Ai false in  then one ofC1,…,Cmis also false in so A1,…, Ai-1,C1,…,Cm, Ai+1,…,An B is true in . • Complete? No. • Can never infer AB from A. • Is it complete for inferring definite clauses? for inferring atoms? Reasoning Systems for e-Business

  38. With variables • Want to infer Likes(bob, gail) from • Likes(x,y) Likes(y,x) • Likes(gail, bob). • Consider that in any model of Likes(x,y) Likes(y,x), any value in the domain could be chosen as the value for x and y. • Thus Likes(gail, bob) Likes(bob, gail) is true. • Robinson’s Unification (1965) “minimal instantiation”: • Likes(z, raymond). • Likes(x,y)  Likes(y,x). • Unification: compute substitutions  = {x := z, y := raymond} • Likes(x,y)  Likes(y,x)  = Likes(z, raymond)  Likes(raymond,z). • Infer Likes(raymond, z). Reasoning Systems for e-Business

  39. Proofs – Definite Clause trees • Rule of inference for definite clauses (one positive literal) From C1,…,Cm Ai and A1,…, AnBinfer A1,…,Ai-1,C1,…,Cm,Ai+1,…,An Be.g. From A andAB infer B • A Proof is a data structure representing a sequence of applications of rules of inference. B + – – – B Ai A1 Ai An + + + give with – – – – – – – – – C1 Cj Cm A1 Ai An C1 Cj Cm Reasoning Systems for e-Business

  40. Complete for atomic consequences Theorem Let F be a non-empty set of definite clauses and G an atom.If F |= G then there exists a proof from F with top atom G. (This is true in general, but here we assume F and G are ground. Note that there must be a model of any set of definite clauses.) ProofBase of induction on size of F. Suppose F has one clause C. If G does not occur positively in C then the model  ofF may be changed to map G to false and still be a model of F. Contradiction. So G occurs as a positive literal in C. If G does not occur alone in C then  may be changed to map G to false and the other literal to true and still be a model of F. Contradiction. So G occurs alone C, so C forms the proof. Reasoning Systems for e-Business

  41. Induction step Suppose F has k clauses. Construct the minimal subset F’ of F such that F’ |= G. Note that no subset of F’ has this property. Suppose F’ contains no clause C = A1,…,An G such that F’ |=Ai for all i=1,…,n. Then a model of F’can be converted so that it maps G to false. Contradiction. Thus C  F’ and F’|=Ai for all i=1,…,n. Suppose F’-{C} does not entail Aifor some i. Then some model  ofF’-{C} is not a model of Ai. So  verifies C. Thus  is a model of F’. So F’ does not entail Ai. Contradiction. Thus F’-{C} |=Ai for all i=1,…,n. By induction there is a proof of each Aifrom F’-{C}. Combine these with the clause C and this forms a proof of G. QED Reasoning Systems for e-Business

  42. Exercises • Build a clause tree proof that shows seven is less than nine, using the clauses Next(x,y)Less(x,y)and Less(x,y),Next(y,z)Less(x,z)and Next(seven,eight) and Next(eight,nine) • Note that we have to change variables names in some instances to prevent them from having unintentionally colliding names. • Install Java according to http://www.cs.unb.ca/courses/gen . Copy the file cs6905ateb.zip to your computer and unzip it to a directory. Start Emacs. In Emacs open the file ForwardReasoner.java in that directory, using C-x C-f ForwardReasoner.javaThen enter Alt-x shell and at the command prompt enter the lines javac -classpath "./jdom.jar;./xerxes.jar;." ForwardReasoner.java java ForwardReasoner • Note the syntax used in the definite clauses file a.dc. We’ll use this syntax in the next section. Reasoning Systems for e-Business

  43. Resolution • Given two clauses, to form the resolvent: • find two literals, one from each clause, that • can be made to match (with assignments to the variables) • differ in sign • construct the disjunction of all literals except these two • apply the substitution • Resolve • b(X)  c(X, 3) against c(2, Y)  d(Y, Z) • unify with  = {X:=2, Y:=3} • b(X)  d(Y, Z)  =b(2)  d(3, Z) Reasoning Systems for e-Business

  44. Bottom Up Reasoning • Single literal definite clauses are called facts • passes(‘Fang’, cs6999) • Resolving a fact against a condition in a rule is called forward reasoning • attends(Student, Course)  passes(Student, Course) • Resolvent: attends(‘Fang’, cs6999) • Usually a derivation tree is viewed with given facts at the bottom and derived facts at the top • so forward reasoning also called bottom up reasoning • Prolog does top-down, backward reasoning • starting from a negative clause, called a query Reasoning Systems for e-Business

  45. Theorem Prover’s Search Procedure • Priority queue • new facts • Discrimination trees: • used facts • rules, indexed onfirst goal main loop select new fact for each matching rule resolve process new result add to old facts process new result(C) if C is rule for each old fact matching first goal resolve process new result add C to rules else add C to new facts Reasoning Systems for e-Business

  46. Completeness of the Search Procedure • We know that if F |= G then a proof of G exists, but do we know that the bottom-up system will find it? • Theorem: Let F be a set of definite clauses and G an atom so that F |= G. With the prover started so that set of new facts is initialized to the single literal clauses in F and the set of rules to F’s other clauses, G will occur eventually among the used facts. • Proof sketch. Simplify by assuming all atoms are ground and that the priority queue is just a queue. Since F |= G, there is a clause tree proof of G from the clauses of F. Proceed by induction on the length of a longest path in the proof. Let A1,…,An G be the top clause of the clause tree proof. Then F |= Ai for each i. By induction each Ai is placed in the old facts. Let Akbe the final of these. By the time Ak is selected Ak,…,An G has already been placed in the rules. As part of the procedure, Ak+1,…, An G is produced and since all Ak+1,…, Anare in the used facts, G is also produced. Reasoning Systems for e-Business

  47. Preventing Infinite Loops • To prevent infinite loops in the search procedure, • use subsumption (next slides) and either • 1a) use ground facts and rules only, or • 1b) use no function symbols Sometimes it helps if the positive literal has no new variables (that do not already occur in the body) Reasoning Systems for e-Business

  48. Subsumption • A clause C subsumes a clause D if there is a substitution  such that CD • C is more general than D • Given C you do not need D • We use subsumption between facts (atoms) • Atom C subsumes atom D if there exists  such that C=D • Subsumption is checked by • first grounding all variables in D to new constants • then trying to unify C with grounded D • Why new constants? Reasoning Systems for e-Business

  49. Why does “ground D with new constants and unify” work? • Exercise • Does C = p(a) subsume D = p(X)? No. • What if “subsume” were decided simply with “unify D with C”? This would allow us to say that this D which is more general than this C, is subsumed by it, which is not correct. • What if “subsume” were decided with “ground D and unify with C”? This would allow D to be ground to p(a), which would unify with C, allowing us to conclude incorrectly that C subsumes D. • Does C=p(X) subsume D = p(Y)? yes • Does C=p(X) subsume D = p(a)? yes Reasoning Systems for e-Business

  50. Forward subsumption • New result is checked against old results to see if it is more general • We can prevent some infinite loops by checking subsumption of new fact against old facts • Should this be done when the new fact is derived or when it is selected? • experience shows that subsumption on selection is better • What about subsumption of rules? • Are there still infinite loops? Reasoning Systems for e-Business

More Related