Ask Your Question
1

Solving logic problems

asked 2013-04-27 08:48:08 -0500

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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-04-27 13:20:00 -0500

sage: Mary, Tom, Sue = var('Mary Tom Sue')
sage: assume(Mary > Tom)
sage: assume(Tom > Sue)
sage: bool(Mary > Sue)
True
edit flag offensive delete link more

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: 2013-04-27 08:48:08 -0500

Seen: 311 times

Last updated: Apr 27 '13