Package: caesium-lang
CaesiumCaesium is a simple language built to help myself (and others) learn about and understand how Boolean algebra works. It does this by providing an interpreter for Boolean algebra.InstallationEnsure that you have a working version of python (You can get python3 from theofficial siteif you don't have it or want to upgrade). Any python version >= 3.6.0 is officially supported so it should work. Older versions of python3 will probably work but they are not officially supported so use them at your own risk.Install caesium using pip by runningpip install caesium-langfrom the command line.Test it out by running the commandcaesiumin your command line.UsageStarting the PromptYou can start the prompt by typing the wordcaesiuminto your terminal and pressing Enter. The caesium prompt should start and print something out to the screen like so:$ caesium
caesium version 1.3.1 running on win32.
Press Ctrl+C or type "exit" to quit.
Cs>If you wish to close the interpreter now, scroll down to theExitingheader or presshereto learn how to do that.ExpressionsAn expression is any valid code which can be turned into a single value. All valid code is made
up of expressions (except theexitkeyword which exits the prompt).
Expressions are
evaluated right to left by default unless brackets (()) are used.ValuesThere are only 2 built-in values:True(or1) andFalse(or0). Caesium is
case-insensitive, so it will accept them in upper, lower or even mixed case.There is also therandomkeyword which randomly evaluates to eitherTrueorFalsewhenever
it is used.Cs> TRUE
True
Cs> False
False
Cs> tRuE
True
Cs> 0
True
Cs> 1
False
Cs> random
TrueAssignmentYou can bind a name to a value by putting a valid name, then a=and any valid expression. A valid name is made up of any number of alphanumeric characters and underscores.Valid names also cannot be keywords. Assignments can be chained together to define more than one variable at once. Since assignments are expressions, they can be nested within larger expressions. I wouldn't recommend this though, it makes the line quite unreadable.Cs> foo = True
True
Cs> quux = coco = (True ^ (bar = True)) & False
FalseOperatorsIn Boolean algebra,there are 2 types of operators,basicoperators andderivedoperators.Basic OperatorsBasic operators, together with the 2 Boolean values, are the building blocks of Boolean algebra. Without them, Boolean algebra simply wouldn't exist. There are only 3 basic operators:1.NOTnottakes a value and flips its value. It can also be written as!. Its operations can be summarised as:ExpressionResultnot TrueFalsenot FalseTrue2.ANDandtakes 2 arguments and checks if both of them evaluate toTrue.andcan also be written as&or&&.andoperations can be summarised as:ExpressionResultTrue and TrueTrueTrue and FalseFalseFalse and TrueFalseFalse and FalseFalse3.ORoralso takes 2 arguments and checks if both of them evaluate toFalse.orcan also be written as|or||.oroperations can be summarised as:ExpressionResultTrue or TrueTrueTrue or FalseTrueFalse or TrueTrueFalse or FalseFalseDerived OperatorsDerived operators are called "derived" because they are derived from the basic operators (they can be re-written as basic operators). Since we ,as programmers, are too lazy to write them out in full, we made them as a kind of shorthand.1.XORxor(eXclusive OR) works just likeor, but where both values cannot beTrue.xorcan also be written as^.xoroperations can be represented in a table as:ExpressionResultTrue xor TrueFalseTrue xor FalseTrueFalse xor TrueTrueFalse xor FalseFalse2.NORnor(Not OR) also works just likeor, but it negates whatorreturns. It can also
be written as~.nandnoroperations can be represented in a table as:ExpressionResultTrue nor TrueFalseTrue nor FalseFalseFalse nor TrueFalseFalse nor FalseTrue3.NANDnand(Not AND) works exactly likeand, but it negates whatandreturns. It can also be
written as@.nandoperations can be represented in a table as:ExpressionResultTrue nand TrueFalseTrue nand FalseTrueFalse nand TrueTrueFalse nand FalseTrueHelpRather than having to refer to the README every single time you don't remember what an operator does, caesium comes with thehelpcommand. It is used to print out a line of explanation about the operator passed to it.It is useed by typinghelpthen the operator in question like so:Cs> help or
or checks if at least one value is true.CommentsComments are lines of text meant for other people to read, rather than for the interpreter to run. Everything that comes after a#character is treated by the interpreter as if it is not there. So for example, if a line starts with a#, the entire line will be treated as if it were blank.ErrorsWhen you try to run code which has a mistake (like a missing bracket), the interpreter complains about your code instead of running it. This is an error. An error is basically the interpreter alerting you that there was something wrong with the code and so it can't run it. Once an error is thrown, you will have to fix whatever is wrong with your expression then rerun it.Examples:Cs> quux
Error: Undefined name "quux".
Cs> random/  # Here I'm supposed to write "random"
Error: Invalid syntax: "/".ExitingEither pressingControl + Cor typing inexitand hitting Enter will cause the interpreter to stop instantly and take you back to the normal shell.Cs> exit

$Development SetupInstall development packages by runningpip install -r requirements-dev.txtinside a fresh virtualenv (for this project, we use the.venvfolder).Assert everything is working by runningpytest tests.pyfrom the project's root dir.ContributingCreate your feature branch by forking thedevelopbranch.Commit your changes.Push toorigin/develop.Open a pull request.NotesJust like the element Caesium, this app may break down. In case it does, please contact me or if you want to, fix it yourself.MetaName:Armani TallamE-Mail:armanitallam@gmail.comGitHub:https://www.github.com/Armani-TThis project is licensed under theBSD 3-Clause License. Please see thelicense filefor more information.