Skip to content

Instantly share code, notes, and snippets.

@SerCeMan
Last active August 29, 2015 14:10
Show Gist options
  • Save SerCeMan/f0f360bf543ad4523c55 to your computer and use it in GitHub Desktop.
Save SerCeMan/f0f360bf543ad4523c55 to your computer and use it in GitHub Desktop.
LaTeX to logitext converter
# Groovy
# For example, you can run it on groovyconsole.appspot.com
def s = /(\exists x P(x) \lor Q(x)) \to \exists x P(x) \lor \exists x Q(x)/
s = s.replace(/\vdash/, '|-')
s = s.replace(/\exists x/, 'exists x,')
s = s.replace(/\exists y/, 'exists y,')
s = s.replace(/\forall x/, 'forall x,')
s = s.replace(/\forall y/, 'forall y,')
s = s.replace(/\lor/, $/\//$)
s = s.replace(/\land/, $//\/$)
s = s.replace(/\to/, /->/)
println s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment