Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noti0na1/kripke-models
A Racket Implement of Kripke Models
https://github.com/noti0na1/kripke-models
computer-science cs245e kripke-models logic macro racket syntax-parse
Last synced: 24 days ago
JSON representation
A Racket Implement of Kripke Models
- Host: GitHub
- URL: https://github.com/noti0na1/kripke-models
- Owner: noti0na1
- License: gpl-3.0
- Created: 2017-06-03T21:07:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-06T01:29:44.000Z (over 7 years ago)
- Last Synced: 2024-10-28T21:25:05.892Z (2 months ago)
- Topics: computer-science, cs245e, kripke-models, logic, macro, racket, syntax-parse
- Language: Racket
- Size: 17.6 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kripke Models
A Simple Racket Implement of Kripke Models
Examples in `km.rkt`:
```racket
#lang racket
(require "KripkeModels.rkt")#|
define a tree with root ru o C
/
/
s o B t o A
\ /
\ /
r o
|#
(define-tree
(r ((s B ())
(t A ((u C ()))))));; enable log printing
(set-show-log! #t);; s ⊩ B => true
(s . ⊩ . B);; t ⊮ B => true
(t . ⊮ . B);; u ⊩ A => true
(u . ⊩ . A);; u ⊩ (A ∧ C) => true
(u . ⊩ . (A ∧ C));; u ⊩ (A ∧ C) => false
(u . ⊩ . (A ∧ B));; s ⊩ (A ∨ B) => true
(s . ⊩ . (A ∨ B));; s ⊩ (¬ A) => true
(s . ⊩ . (¬ A));; u ⊩ (¬ A) => false
(u . ⊩ . (¬ A));; r ⊩ (A -> C) => false
(r . ⊩ . (A -> C));; r ⊩ (C -> A) => true
(r . ⊩ . (C -> A))
```Output for `(r . ⊩ . (C -> A))`:
```
Check: r ⊩ (C -> A)
Check: r ⊩ C
Result: r ⊮ C
Check: s ⊩ (C -> A)
Check: s ⊩ C
Result: s ⊮ C
Result: s ⊩ (C -> A)
Check: t ⊩ (C -> A)
Check: t ⊩ C
Result: t ⊮ C
Check: u ⊩ (C -> A)
Check: u ⊩ C
Result: u ⊩ C
Check: u ⊩ A
Result: u ⊩ A
Result: u ⊩ (C -> A)
Result: t ⊩ (C -> A)
Result: r ⊩ (C -> A)
#t
```Update: add printing log, add indent