Skip to content

Instantly share code, notes, and snippets.

View adolfont's full-sized avatar

Adolfo Neto adolfont

View GitHub Profile
(defn maior [x y]
(if (> x y) x y))
@adolfont
adolfont / syntax.exs
Last active September 2, 2020 18:15
Syntax checker for Classical Propositional Logic in Elixir
# Syntax checker for Classical Propositional Logic
# Examples:
# atomic formulas:
# :p
# :q
# :r
# negation:
# [:not, :p]
# [:not, [:not, :q]]]
@adolfont
adolfont / sintaxe.exs
Created August 11, 2017 00:10
Verificador de Sintaxe para Lógica Clássica Proposicional em Elixir
# Verificador de Sintaxe para Lógica Clássica Proposicional em Elixir
# Como executar:
# > elixir sintaxe.exs
# Sintaxe
# Fórmulas atômicas pode ser
# :p
defmodule SatSolver do
@moduledoc """
Documentation for SatSolver.
"""
@doc """
Values a clause according to a valuation.
Supposes no repetition of atoms on clauses.
Returns either true or a clause.
@adolfont
adolfont / logical_symbols.tex
Created October 31, 2017 15:55
Logical Symbols that I use on my Latex documents
\newcommand{\NOT}{\neg}
\newcommand{\IMPLIES}{\to}
\newcommand{\AND}{\wedge}
\newcommand{\OR}{\vee}
\newcommand{\BIMPLI}{\leftrightarrow}
\newcommand{\XOR}{\otimes}
\newcommand{\T}{\begin{tt}T\end{tt}\, }
\newcommand{\F}{\begin{tt}F\end{tt}\, }
\newcommand{\x}{\ensuremath{\times}}
defmodule Aula do
def pi do
3.1415
end
def identidade(x) do
x
end
def oposto(x) do
def pi do
3.1415
end
def sorteia_numero_1_a_10 do
Enum.random(1..10)
end
def identidade(x) do
x
end
mix new aula1
cd aula1
mix test
atom lib/aula1.ex