From adfae65138b59930e5e12bd70af6db1dc1afe15f Mon Sep 17 00:00:00 2001 From: cannorin Date: Sat, 22 Feb 2025 11:19:22 +0900 Subject: [PATCH] kripke: more symbols --- packages/kripke/parser.ts | 28 +++++++++++++++++++++++----- packages/kripke/syntax.ts | 2 +- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/packages/kripke/parser.ts b/packages/kripke/parser.ts index 5ce8121..79741ae 100644 --- a/packages/kripke/parser.ts +++ b/packages/kripke/parser.ts @@ -50,17 +50,35 @@ const generateAlt = (words: string[]) => export const topSymbols = ["⊤", "T", "1", "\\top", "top"]; export const botSymbols = ["⊥", "F", "0", "\\bot", "bot"]; export const notSymbols = ["¬", "~", "\\neg", "\\lnot", "not"]; -export const boxSymbols = ["□", "[]", "!", "L", "\\Box", "box"]; -export const diamondSymbols = ["⋄", "<>", "?", "M", "\\Diamond", "dia"]; +export const boxSymbols = ["□", "◻", "[]", "!", "L", "\\Box", "box"]; +export const diamondSymbols = [ + "◇", + "◊", + "♢", + "⋄", + "<>", + "?", + "M", + "\\Diamond", + "dia", +]; export const andSymbols = ["∧", "^", "&", "\\wedge", "\\land", "and"]; export const orSymbols = ["∨", "v", "|", "\\vee", "\\lor", "or"]; -export const toSymbols = ["→", "->", ">", "\\rightarrow", "\\to", "to"]; -export const eqSymbols = ["↔", "<->", "=", "\\leftrightarrow", "\\equiv", "eq"]; +export const toSymbols = ["→", "->", "⊃", ">", "\\rightarrow", "\\to", "to"]; +export const eqSymbols = [ + "↔", + "<->", + "≡", + "=", + "\\leftrightarrow", + "\\equiv", + "eq", +]; export const lParenSymbols = ["(", "\\left"]; export const rParenSymbols = [")", "\\right"]; const lexer = buildLexer([ - [true, /^[pqrs]/g, TokenKind.PropVar], + [true, generateAlt(propVars), TokenKind.PropVar], [true, generateAlt(topSymbols), TokenKind.Top], [true, generateAlt(botSymbols), TokenKind.Bot], [true, generateAlt(notSymbols), TokenKind.Not], diff --git a/packages/kripke/syntax.ts b/packages/kripke/syntax.ts index eb77cd9..30f4475 100644 --- a/packages/kripke/syntax.ts +++ b/packages/kripke/syntax.ts @@ -70,7 +70,7 @@ export const unicodeSymbols: Symbols = { top: "⊤", bot: "⊥", box: "□", - diamond: "⋄", + diamond: "◇", not: "¬", and: "∧", or: "∨",