Skip to content

Instantly share code, notes, and snippets.

@adolfont
Created April 11, 2018 18:27
Show Gist options
  • Select an option

  • Save adolfont/7c3c04d6eb8fa26d58ea5e296311fb47 to your computer and use it in GitHub Desktop.

Select an option

Save adolfont/7c3c04d6eb8fa26d58ea5e296311fb47 to your computer and use it in GitHub Desktop.
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