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
| (defn maior [x y] | |
| (if (> x y) x y)) |
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
| # Syntax checker for Classical Propositional Logic | |
| # Examples: | |
| # atomic formulas: | |
| # :p | |
| # :q | |
| # :r | |
| # negation: | |
| # [:not, :p] | |
| # [:not, [:not, :q]]] |
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
| # Verificador de Sintaxe para Lógica Clássica Proposicional em Elixir | |
| # Como executar: | |
| # > elixir sintaxe.exs | |
| # Sintaxe | |
| # Fórmulas atômicas pode ser | |
| # :p |
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 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. |
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
| \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}} |
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 Aula do | |
| def pi do | |
| 3.1415 | |
| end | |
| def identidade(x) do | |
| x | |
| end | |
| def oposto(x) do |
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
| def pi do | |
| 3.1415 | |
| end |
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
| def sorteia_numero_1_a_10 do | |
| Enum.random(1..10) | |
| end |
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
| def identidade(x) do | |
| x | |
| end |
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
| mix new aula1 | |
| cd aula1 | |
| mix test | |
| atom lib/aula1.ex |