• C 97.1%
  • Makefile 2.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-05 09:56:16 +02:00
.gitignore chore: 🎉 Initial commit 2025-10-05 14:51:35 +02:00
history.txt Fix stuff 2026-02-16 15:24:31 +01:00
main.c Fix compiler warnings 2026-09-05 09:43:13 +02:00
makefile Rewrite C 2026-02-12 17:36:55 +01:00
README.fr.md Fix typo in syntax description of operators 2026-09-05 09:56:16 +02:00
README.md Fix typo in syntax description of operators 2026-09-05 09:56:16 +02:00

Assert checker

This is a simple assertion checker written in C.

Installation

This is the english version of the documentation. Go to README.fr.md to get the french version)

Follow the installation steps for your platform :

MacOS is not listed here, because I never tried it. Please propose changes if you tested the installation on MacOS

Linux

  1. Install dependencies, that are : git, gcc and make. For example, on debian-based distributions : sudo apt install git gcc make
  2. Get source code (using git) : git clone https://git.greensky.tf/Greensky/assert-checker && cd assert-checker
  3. Compile the code to an executable : make
  4. You can now use the main.exe file, by following the usage instructions

Run the command listed above in a terminal

Windows

  1. Install dependencies : git, gcc and make through regular installation, or using winget :
winget install -e --id Arm.GnuArmEmbeddedToolchain
winget install -e --id GnuWin32.Make
winget install -e --id Git.Git
  1. Get source code (using git) : git clone https://git.greensky.tf/Greensky/assert-checker && cd assert-checker
  2. Compile the code to an executable : make
  3. You can now use the main.exe file, by following the usage instructions

Use the above commands in a terminal (windows + R, type cmd and enter)

Usage

Once you have the main.exe file executable, you can use it by launching the script. It will ask you to enter an expression. An expression is composed of :

  • Variables, represented by single letters
  • Operators
  • Parenthesis, that create groups

Operators list

Operator Symbol Syntax
Logical and & X&Y
Logical or | X|Y
Logical not ! !X
Logical implication - X-Y
Group of expression ( and ) (X)

In the above syntax description, a X, Y means a valid assertion, so it is at least a variable, and at most one or two assertions, joined by operator

Examples

All the below examples are valid expressions to the program to parse (one per line)

a
B&c
(a&c)-d
(a|(b&d))|c-d
(a|b)-(c&(d|v)|a)
(((!p&s)|(g|!s))|(!t&!g))&((s|!g)&(r|s))

Program complexity

If n is the number of different variables, the program has a complexity of O(2^n).

Since it is written in native C, it is very fast anyway.

Contributors