这是indexloc提供的服务,不要输入任何密码
Skip to content

Tmp call #1760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 8, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 76 additions & 1 deletion opencog/nlp/relex2logic/rule-helpers.scm
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@
(define (possessive-rule noun noun_instance word word_instance)
(list (InheritanceLink (ConceptNode noun_instance) (ConceptNode noun))
(InheritanceLink (ConceptNode word_instance) (ConceptNode word))
(r2l-wordinst-concept noun_instance)
(r2l-wordinst-concept word_instance)
(EvaluationLink
(PredicateNode "possession")
(ListLink
Expand All @@ -638,6 +640,10 @@
(InheritanceLink (ConceptNode o_instance) (ConceptNode o))
(ImplicationLink (PredicateNode v1_instance) (PredicateNode v1))
(ImplicationLink (PredicateNode v2_instance) (PredicateNode v2))
(r2l-wordinst-concept s_instance)
(r2l-wordinst-concept o_instance)
(r2l-wordinst-Predicate v1_instance)
(r2l-wordinst-Predicate v2_instance)
(EvaluationLink
(PredicateNode v1_instance)
(ListLink
Expand All @@ -661,6 +667,11 @@
(InheritanceLink (ConceptNode o_instance) (ConceptNode o))
(ImplicationLink (PredicateNode v1_instance) (PredicateNode v1))
(ImplicationLink (PredicateNode v2_instance) (PredicateNode v2))
(r2l-wordinst-concept s1_instance)
(r2l-wordinst-concept s2_instance)
(r2l-wordinst-concept o_instance)
(r2l-wordinst-Predicate v1_instance)
(r2l-wordinst-Predicate v2_instance)
(EvaluationLink
(PredicateNode v1_instance)
(ListLink
Expand All @@ -682,6 +693,9 @@
(list (InheritanceLink (ConceptNode v1_instance) (ConceptNode v1))
(ImplicationLink (PredicateNode v2_instance) (PredicateNode v2))
(InheritanceLink (ConceptNode v3_instance) (ConceptNode v3))
(r2l-wordinst-concept v1_instance)
(r2l-wordinst-concept v3_instance)
(r2l-wordinst-Predicate v2_instance)
(EvaluationLink
(PredicateNode v2_instance)
(ListLink ; does this ListLink make sense here? (by sebastianruder)
Expand All @@ -697,6 +711,8 @@
(define (to-do-rule-4 v1 v1_instance v2 v2_instance)
(list (InheritanceLink (ConceptNode v2_instance) (ConceptNode v2))
(ImplicationLink (PredicateNode v1_instance) (PredicateNode v1))
(r2l-wordinst-concept v2_instance)
(r2l-wordinst-Predicate v1_instance)
(EvaluationLink
(PredicateNode "able_to")
(ListLink
Expand All @@ -712,6 +728,9 @@
(list (InheritanceLink (ConceptNode subj_instance) (ConceptNode subj))
(ImplicationLink (PredicateNode verb1_instance) (PredicateNode verb1))
(ImplicationLink (PredicateNode verb2_instance) (PredicateNode verb2))
(r2l-wordinst-concept subj_instance)
(r2l-wordinst-Predicate verb1_instance)
(r2l-wordinst-Predicate verb2_instance)
(EvaluationLink
(PredicateNode verb1_instance)
(ListLink
Expand All @@ -735,6 +754,7 @@
(let ((var_name (choose-var-name)))
(list
(ImplicationLink (PredicateNode verb_instance) (PredicateNode verb))
(r2l-wordinst-Predicate verb_instance)
(EvaluationLink
(PredicateNode "AtPlace")
(ListLink
Expand All @@ -752,6 +772,7 @@
(let ((var_name (choose-var-name)))
(list
(InheritanceLink (ConceptNode subj_instance) (ConceptNode subj_concept))
(r2l-wordinst-concept subj_instance)
(EvaluationLink
(PredicateNode "AtPlace")
(ListLink
Expand All @@ -773,6 +794,7 @@
(let ((var_name (choose-var-name)))
(list
(ImplicationLink (PredicateNode verb_instance) (PredicateNode verb))
(r2l-wordinst-Predicate verb_instance)
(AtTimeLink
(VariableNode var_name)
(PredicateNode verb_instance)
Expand All @@ -787,6 +809,7 @@
(let ((var_name (choose-var-name)))
(list
(InheritanceLink (ConceptNode subj_instance) (ConceptNode subj_concept))
(r2l-wordinst-concept subj_instance)
(AtTimeLink
(VariableNode var_name)
(ConceptNode subj_instance)
Expand All @@ -805,6 +828,7 @@
(let ((var_name (choose-var-name)))
(list
(ImplicationLink (PredicateNode verb_instance) (PredicateNode verb))
(r2l-wordinst-Predicate verb_instance)
(EvaluationLink
(PredicateNode "Because")
(ListLink
Expand All @@ -822,6 +846,7 @@
(let ((var_name (choose-var-name)))
(list
(InheritanceLink (ConceptNode subj_instance) (ConceptNode subj_concept))
(r2l-wordinst-concept subj_instance)
(EvaluationLink
(PredicateNode "Because")
(ListLink
Expand All @@ -842,6 +867,7 @@
(let ((var_name (choose-var-name)))
(list
(ImplicationLink (PredicateNode verb_instance) (PredicateNode verb))
(r2l-wordinst-Predicate verb_instance)
(EvaluationLink
(PredicateNode "InManner")
(ListLink
Expand All @@ -862,6 +888,7 @@
(let ((var_name (choose-var-name)))
(list
(InheritanceLink (ConceptNode subj_instance) (ConceptNode subj_concept))
(r2l-wordinst-concept subj_instance)
(InheritanceLink (ConceptNode subj_instance) (VariableNode var_name))
)
)
Expand All @@ -879,6 +906,7 @@
(let ((var_name (choose-var-name)))
(list
(InheritanceLink (ConceptNode instance) (ConceptNode concept))
(r2l-wordinst-concept instance)
(QuantityLink
(ConceptNode instance)
(VariableNode var_name)
Expand All @@ -893,6 +921,7 @@
(let ((var_name (choose-var-name)))
(list
(InheritanceLink (ConceptNode instance) (ConceptNode concept))
(r2l-wordinst-concept instance)
(EvaluationLink
(PredicateNode "DegreeLink")
(ListLink
Expand Down Expand Up @@ -924,6 +953,9 @@
(InheritanceLink (ConceptNode subj_instance) (ConceptNode subj_concept))
(InheritanceLink (ConceptNode obj_instance) (ConceptNode obj_concept))
(InheritanceLink (VariableNode var_name) (ConceptNode obj_instance))
(r2l-wordinst-concept subj_instance)
(r2l-wordinst-concept obj_instance)
(r2l-wordinst-Predicate verb_instance)
(SatisfyingSetLink
(VariableNode var_name)
(EvaluationLink (PredicateNode verb_instance)
Expand All @@ -946,6 +978,9 @@
(InheritanceLink (ConceptNode subj_instance) (ConceptNode subj_concept))
(ImplicationLink (PredicateNode obj_instance) (PredicateNode obj_concept))
(InheritanceLink (VariableNode var_name) (ConceptNode subj_instance))
(r2l-wordinst-concept subj_instance)
(r2l-wordinst-concept obj_instance)
(r2l-wordinst-Predicate verb_instance)
(SatisfyingSetLink
(VariableNode var_name)
(EvaluationLink (PredicateNode verb_instance)
Expand All @@ -969,6 +1004,10 @@
(InheritanceLink (ConceptNode obj_instance) (ConceptNode obj_concept))
(InheritanceLink (ConceptNode iobj_instance) (ConceptNode iobj_concept))
(InheritanceLink (VariableNode var_name) (ConceptNode iobj_instance))
(r2l-wordinst-concept subj_instance)
(r2l-wordinst-concept obj_instance)
(r2l-wordinst-concept iobj_instance)
(r2l-wordinst-Predicate verb_instance)
(SatisfyingSetLink
(VariableNode var_name)
(EvaluationLink (PredicateNode verb_instance)
Expand All @@ -991,6 +1030,8 @@
(InheritanceLink (ConceptNode subj_instance) (ConceptNode subj_concept))
(ImplicationLink (PredicateNode pred_instance) (PredicateNode pred_concept))
(InheritanceLink (VariableNode var_name) (ConceptNode subj_instance) )
(r2l-wordinst-concept subj_instance)
(r2l-wordinst-Predicate pred_instance)
(SatisfyingSetLink
; (ScopeLink ;; not yet supported !? Huhh ??
(VariableNode var_name)
Expand All @@ -1016,6 +1057,7 @@
; "All right-handed Canadians write." -> (all-rule "Canadians@333")
(define (all-rule noun_instance)
(list
(r2l-wordinst-concept noun_instance)
(EvaluationLink
(PredicateNode "allmarker")
(ListLink
Expand All @@ -1034,6 +1076,9 @@
(list (ImplicationLink (PredicateNode verb_instance) (PredicateNode verb))
(InheritanceLink (ConceptNode obj_instance) (ConceptNode obj))
(InheritanceLink (ConceptNode passive_obj_instance) (ConceptNode passive_obj))
(r2l-wordinst-concept obj_instance)
(r2l-wordinst-concept passive_obj_instance)
(r2l-wordinst-Predicate verb_instance)
(EvaluationLink
(PredicateNode verb_instance)
(ListLink
Expand All @@ -1049,6 +1094,8 @@
(list
(ImplicationLink (PredicateNode verb_instance) (PredicateNode verb))
(InheritanceLink (ConceptNode obj_instance) (ConceptNode obj))
(r2l-wordinst-concept obj_instance)
(r2l-wordinst-Predicate verb_instance)
(EvaluationLink
(PredicateNode verb_instance)
(ListLink
Expand All @@ -1072,6 +1119,8 @@
(cond [(equal? pos "verb")
(list (ImplicationLink (PredicateNode var1_instance) (PredicateNode var1))
(ImplicationLink (PredicateNode var2_instance) (PredicateNode var2))
(r2l-wordinst-Predicate var1_instance)
(r2l-wordinst-Predicate var2_instance)
(EvaluationLink
(PredicateNode "and")
(ListLink
Expand All @@ -1082,6 +1131,8 @@
[else
(list (InheritanceLink (ConceptNode var1_instance) (ConceptNode var1))
(InheritanceLink (ConceptNode var2_instance) (ConceptNode var2))
(r2l-wordinst-concept var1_instance)
(r2l-wordinst-concept var2_instance)
(EvaluationLink
(PredicateNode "and")
(ListLink
Expand All @@ -1095,6 +1146,8 @@
(cond [(equal? pos "verb")
(list (ImplicationLink (PredicateNode var1_instance) (PredicateNode var1))
(ImplicationLink (PredicateNode var2_instance) (PredicateNode var2))
(r2l-wordinst-Predicate var1_instance)
(r2l-wordinst-Predicate var2_instance)
(EvaluationLink
(PredicateNode "but")
(ListLink
Expand All @@ -1104,7 +1157,8 @@
))]
[else
(list (InheritanceLink (ConceptNode var1_instance) (ConceptNode var1))
(InheritanceLink (ConceptNode var2_instance) (ConceptNode var2))
(r2l-wordinst-concept var1_instance)
(r2l-wordinst-concept var2_instance)
(EvaluationLink
(PredicateNode "but")
(ListLink
Expand All @@ -1118,6 +1172,8 @@
(cond [(equal? pos "verb")
(list (ImplicationLink (PredicateNode var1_instance) (PredicateNode var1))
(ImplicationLink (PredicateNode var2_instance) (PredicateNode var2))
(r2l-wordinst-Predicate var1_instance)
(r2l-wordinst-Predicate var2_instance)
(EvaluationLink
(PredicateNode "or")
(ListLink
Expand All @@ -1128,6 +1184,8 @@
[else
(list (InheritanceLink (ConceptNode var1_instance) (ConceptNode var1))
(InheritanceLink (ConceptNode var2_instance) (ConceptNode var2))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct the square brackets above

(r2l-wordinst-concept var1_instance)
(r2l-wordinst-concept var2_instance)
(EvaluationLink
(PredicateNode "or")
(ListLink
Expand All @@ -1144,6 +1202,8 @@
(list
(ImplicationLink (PredicateNode comp_instance) (PredicateNode comp_concept))
(ImplicationLink (PredicateNode pred_instance) (PredicateNode pred_concept))
(r2l-wordinst-Predicate comp_instance)
(r2l-wordinst-Predicate pred_instance)
(EvaluationLink
(PredicateNode comp_instance)
(ListLink
Expand All @@ -1157,6 +1217,8 @@
(list
(ImplicationLink (PredicateNode comp_instance) (PredicateNode comp_concept))
(ImplicationLink (PredicateNode pred_instance) (PredicateNode pred_concept))
(r2l-wordinst-Predicate comp_instance)
(r2l-wordinst-Predicate pred_instance)
(EvaluationLink
(PredicateNode "InManner")
(ListLink
Expand All @@ -1171,6 +1233,8 @@
(list
(ImplicationLink (PredicateNode comp_instance) (PredicateNode comp_concept))
(ImplicationLink (PredicateNode pred_instance) (PredicateNode pred_concept))
(r2l-wordinst-Predicate comp_instance)
(r2l-wordinst-Predicate pred_instance)
(EvaluationLink
(PredicateNode "Because")
(ListLink
Expand All @@ -1185,6 +1249,8 @@
(list
(ImplicationLink (PredicateNode comp_instance) (PredicateNode comp_concept))
(ImplicationLink (PredicateNode pred_instance) (PredicateNode pred_concept))
(r2l-wordinst-Predicate comp_instance)
(r2l-wordinst-Predicate pred_instance)
(AtTimeLink)
(PredicateNode pred_instance)
(ConceptNode comp_instance)
Expand All @@ -1195,6 +1261,8 @@
(list
(ImplicationLink (PredicateNode comp_instance) (PredicateNode comp_concept))
(ImplicationLink (PredicateNode pred_instance) (PredicateNode pred_concept))
(r2l-wordinst-Predicate comp_instance)
(r2l-wordinst-Predicate pred_instance)
(EvaluationLink
(PredicateNode pred_instance)
(ListLink
Expand All @@ -1213,6 +1281,8 @@
(list
(ImplicationLink (PredicateNode main_instance) (PredicateNode main))
(ImplicationLink (PredicateNode sub_instance) (PredicateNode sub))
(r2l-wordinst-Predicate main_instance)
(r2l-wordinst-Predicate sub_instance)
(EvaluationLink
(PredicateNode "that")
(ListLink
Expand Down Expand Up @@ -1266,6 +1336,9 @@
(list (InheritanceLink (ConceptNode adj_instance) (ConceptNode adj))
(InheritanceLink (ConceptNode w1_instance) (ConceptNode w1))
(InheritanceLink (ConceptNode w2_instance) (ConceptNode w2))
(r2l-wordinst-concept adj_instance)
(r2l-wordinst-concept w1_instance)
(r2l-wordinst-concept w2_instance)
(TruthValueGreaterThanLink
(InheritanceLink (ConceptNode w1_instance) (ConceptNode adj_instance))
(InheritanceLink (ConceptNode w2_instance) (ConceptNode adj_instance))
Expand All @@ -1275,6 +1348,8 @@
(define (on-rule w1 w1_instance w2 w2_instance)
(list (InheritanceLink (ConceptNode w1_instance) (ConceptNode w1))
(InheritanceLink (ConceptNode w2_instance) (ConceptNode w2))
(r2l-wordinst-concept w1_instance)
(r2l-wordinst-concept w2_instance)
(EvaluationLink
(PredicateNode "on")
(ListLink
Expand Down