Ask Your Question
1

Solving logic problems

asked 2013-04-27 15:48:08 +0200

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 20:20:00 +0200

slelievre gravatar image
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 15:48:08 +0200

Seen: 537 times

Last updated: Apr 27 '13