First time here? Check out the FAQ!

Ask Your Question
1

Solving logic problems

asked 11 years ago

coder0xff gravatar image

Given a set of rules, for example: 1. Mary is older than Tom, 2. Tom is older than Sue; Can sage solve the question, "is Mary older than Sue?"

More specifically, is Sage able to do what Prolog does - unification of logic problems? Thanks

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 11 years ago

slelievre gravatar image
sage: Mary, Tom, Sue = var('Mary Tom Sue')
sage: assume(Mary > Tom)
sage: assume(Tom > Sue)
sage: bool(Mary > Sue)
True
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 11 years ago

Seen: 635 times

Last updated: Apr 27 '13