Skip to content

Commit

Permalink
Demo : parse ↔
Browse files Browse the repository at this point in the history
  • Loading branch information
hferee committed Sep 12, 2024
1 parent 54426f8 commit 9d3758e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/modal_expressions_parser.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ let disj = spaces *> ((char '\xE2' *> char '\x88' *> char '\xA8') <|> char '|')
let conj = spaces *> ((char '\xE2' *> char '\x88' *> char '\xA7') <|> char '&') *> spaces *> return (fun x y -> And (x, y))

let modal (p : form t) : form t = box p <|> neg p <|> diamond p
let impl = spaces *> ((char '\xE2' *> char '\x86' *> char '\x92') <|> (char '-' *> char '>')) *> spaces *> return (fun x y -> Implies(x, y))
let impl = spaces *> ((char '\xE2' *> char '\x86' *> char '\x92') <|> (char '-' *> char '>')) *> spaces *>
return (fun x y -> Implies(x, y))
let iff = spaces *> ((char '\xE2' *> char '\x86' *> char '\x94') <|> (char '<' *> char '-' *> char '>')) *> spaces *>
return (fun x y -> And(Implies(x, y), Implies(y, x)))

(* this is ⊥ *)
let bot = spaces *> ((char '\xE2' *> char '\x8A' *> char '\xA5') <|> char '#'
Expand Down
4 changes: 4 additions & 0 deletions doc-config/resources/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
<td>implication</td>
</tr>
<tr>
<td></td>
<td class="ms"><-></td>
<td>equivalence</td>
</tr> <tr>
<td>¬</td>
<td class="ms">~</td>
<td>negation</td>
Expand Down

0 comments on commit 9d3758e

Please sign in to comment.