Skip to content

Instantly share code, notes, and snippets.

@milesrout
Last active September 7, 2016 11:17
Show Gist options
  • Save milesrout/e63beb7dff68766d147f to your computer and use it in GitHub Desktop.
Save milesrout/e63beb7dff68766d147f to your computer and use it in GitHub Desktop.
#[macro_use]
mod macros {
#[macro_export]
macro_rules! prop {
(($($t:tt)*)) => (prop!($($t)*));
(T) => (Proposition::True);
(F) => (Proposition::False);
(!$e:tt) => (Proposition::Not(box prop!($e)));
($e:tt ^ $f:tt) => (Proposition::And(box prop!($e), box prop!($f)));
($e:tt v $f:tt) => (Proposition::Or(box prop!($e), box prop!($f)));
($e:tt -> $f:tt) => (Proposition::Implies(box prop!($e), box prop!($f)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment