Created
April 11, 2018 18:27
-
-
Save adolfont/7c3c04d6eb8fa26d58ea5e296311fb47 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Logic do | |
| @spec boolean ~> boolean :: boolean | |
| def x ~> y do | |
| not x or y | |
| end | |
| end | |
| # Modo de usar: | |
| # - Salvar como logic.ex | |
| # - Na mesma pasta, chamar | |
| # > iex logic.ex | |
| # No iex: | |
| # > | |
| IO.puts( | |
| ''' | |
| Para fazer teste no iex: | |
| import Logic | |
| p = true | |
| q = false | |
| r = true | |
| p ~> (q and not r) | |
| p = false | |
| p ~> (q and not r) | |
| ''' | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment