Files
Sheerka-Old/sheerka_backup/default.sb
T
kodjo 7dcaa9c111 Fixed #29: Parsers: Implement parsing memoization
Fixed #77 : Parser: ShortTermMemoryParser should be called separately
Fixed #78 : Remove VariableNode usage
Fixed #79 : ConceptManager: Implement compile caching
Fixed #80 : SheerkaExecute : parsers_key is not correctly computed
Fixed #81 : ValidateConceptEvaluator : Validate concept's where and pre clauses right after the parsing
Fixed #82 : SheerkaIsAManager: isa() failed when the set as a body
Fixed #83 : ValidateConceptEvaluator : Support BNF and SYA Concepts
Fixed #84 : ExpressionParser: Implement the parser as a standard parser
Fixed #85 : Services: Give order to services
Fixed #86 : cannot manage smart_get_attr(the short, color)
2021-06-07 21:14:03 +02:00

78 lines
2.2 KiB
Plaintext

# question
push_ontology("english")
def concept q from q ? as question(q) auto_eval True
set_is_lesser(__PRECEDENCE, q, 'Sya')
def concept the x where isinstance(x, Concept) ret memory(x)
def concept a x where isinstance(x, Concept) ret x
def concept an x where isinstance(x, Concept) ret x
set_is_greatest(__PRECEDENCE, c:the x:, 'Sya')
set_is_greatest(__PRECEDENCE, c:a x:, 'Sya')
set_is_greatest(__PRECEDENCE, c:an x:, 'Sya')
def concept "x is a concept" as isinstance(x, Concept) pre is_question()
# is a
def concept x is a y as set_isa(x, y) ret x auto_eval True
def concept x is an y as set_isa(x, y) ret x auto_eval True
def concept x is a y as isa(x,y) pre is_question()
def concept x is an y as isa(x,y) pre is_question()
# has a
def concept x has a y as set_hasa(x, y) ret x auto_eval True
def concept x has an y as set_hasa(x, y) ret x auto_eval True
def concept x has a y as hasa(x,y) pre is_question()
def concept x has an y as hasa(x,y) pre is_question()
# AND
def concept x and y as x and y pre is_question()
set_is_lesser(__PRECEDENCE, c:x and y:, 'Sya')
set_is_less_than(__PRECEDENCE, c:q:, c:x and y:, 'Sya')
# OR
def concept x or y as x or y pre is_question()
set_is_lesser(__PRECEDENCE, c:x or y:, 'Sya')
set_is_greater_than(__PRECEDENCE, c:x and y:, c:x or y:, 'Sya')
set_is_less_than(__PRECEDENCE, c:q:, c:x or y:, 'Sya')
# some words
def concept human
def concept male
def concept female
def concept man
def concept woman
def concept boy
def concept girl
man is a male
man is a human
boy is a male
boy is a human
woman is a female
woman is a human
girl is a female
girl is a human
def concept boys
def concept girls
def concept shirt
def concept table
# days of the week
def concept monday
def concept tuesday
def concept wednesday
def concept thursday
def concept friday
def concept saturday
def concept sunday
# questions
def concept how is x pre is_question() as smart_get_attr(x, adjective)
def concept what x is y pre is_question() where x is an adjective as smart_get_attr(y, x)
def concept what is the x of y pre is_question() where x is an adjective as smart_get_attr(y, x)
#
def concept he ret memory("self is a human and self is a male")
def concept she ret memory("self is a human and self is a female")