Advertisement
logicmoo

Modal MT

Feb 27th, 2018
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 4.97 KB | None | 0 0
  1.  
  2. (ModalHelperFunction AssertedFor)
  3. (ModalHelperFunction PossibleFor)
  4. (ModalHelperFunction FalsifiedFor)
  5. (ModalHelperFunction FallaciousFor)
  6. (ModalHelperFunction UnknownFor)
  7. (ModalHelperFunction AskableFrom)
  8. (ModalHelperFunction AnswerableFrom)
  9.  
  10. (forall ((ModalHelperFunction mhf))
  11.   (UniqueObjectDesignatingFunction mhf ModalContext HelperContext))
  12.  
  13. (forall (odf domain range)
  14.  (if
  15.   (UniqueObjectDesignatingFunction odf domain range)
  16.   (forall ((domain term))
  17.    (exists ((range denotes))
  18.     (and
  19.      (= denotes (odf term))
  20.  
  21.     ;; forces all odf results to be unique
  22.      (forall (other-term)
  23.        (if (= (odf other-term) denotes)
  24.       (= term other-term))))
  25.  
  26.     ;; forces all odfs to have at max one result
  27.      (forall (other-denotes)
  28.        (if (= other-denotes (odf term))
  29.        (= other-denotes denotes)))))))
  30.  
  31.  
  32. ;; a testing mt
  33. (ModalContext TestMt)
  34.  
  35. ;; Funny little set of ist/2 assertions
  36. (forall (MT S)
  37.   (if
  38.    (ModalContext MT)
  39.    (and
  40.  
  41.  ;; at least 1/2 are redundant logically
  42.  ;; But sometimes it is nice to see them
  43.  
  44.     (if (ist (AssertedFor MT) S)
  45.         (ist (ProvenFor MT) S))
  46.  
  47.     (if (ist (ProvenFor MT) S)
  48.      (and
  49.       (not (ist (FalsifiedFor MT) S))
  50.            (ist (PossibleFor MT) S)
  51.       (not (ist (UnknownFor MT) S))))
  52.  
  53.     (if (not (ist (AssertedFor MT) S))
  54.      (or (ist (PossibleFor MT) S)
  55.          (ist (FalsifiedFor MT) S)
  56.          (ist (FallaciousFor MT) S)))
  57.  
  58.  
  59.     (if (not (ist (FallaciousFor MT) S))
  60.      (or (ist (UnknownFor MT) S)
  61.          (ist (FalsifiedFor MT) S)
  62.          (ist (ProvenFor MT) S)))
  63.  
  64.     (if (and
  65.         (not (ist (UnknownFor MT) S))
  66.     (not (ist (FallaciousFor MT) S)))
  67.      (or (ist (ProvenFor MT) S)
  68.          (ist (FalsifiedFor MT) S)))
  69.  
  70.     (if (not (ist (FalsifiedFor MT) S))
  71.      (or (ist (FallaciousFor MT) S)
  72.          (ist (UnknownFor MT) S)
  73.          (ist (ProvenFor MT) S)))
  74.  
  75.     (iff (ist (AnswerableFrom MT) S)
  76.       (and   (ist (AskableFrom MT) S)
  77.            (not (ist (UnknownFor MT) S))))
  78.  
  79.     (if (ist (AnswerableFrom MT) S)
  80.      (or (ist (ProvenFor MT) S)
  81.          (ist (FalsifiedFor MT) S)))
  82.  
  83.     (iff  (ist (AskableFrom MT) S)
  84.      (not (ist (FallaciousFor MT) S)))
  85.  
  86.  
  87.     (if (ist (AskableFrom MT) S)
  88.      (or (ist (ProvenFor MT) S)
  89.          (ist (UnknownFor MT) S)
  90.          (ist (FalsifiedFor MT) S)))
  91.  
  92.     (not
  93.      (and (ist (AskableFrom MT) S)
  94.          (ist (FallaciousFor MT) S)))
  95.  
  96.     (if
  97.      (ist (FallaciousFor MT) S)
  98.      (not
  99.       (or (ist (FalsifiedFor MT) S)
  100.           (ist (ProvenFor MT) S)
  101.           (ist (UnknownFor MT) S)
  102.           (ist (PossibleFor MT) S))))      
  103.  
  104.     (if
  105.      (and (ist (ProvenFor MT) S)
  106.          (ist (FalsifiedFor MT) S))
  107.      (ist (FallaciousFor MT) S))
  108.  
  109.  
  110.     (if
  111.       (ist (ProvenFor MT) S)
  112.       (not
  113.        (or (ist (FalsifiedFor MT) S)
  114.            (ist (FallaciousFor MT) S))))
  115.  
  116.     (if (ist (ProvenFor MT) S)
  117.      (and (not (ist (UnknownFor MT) S))
  118.           (not (ist (FalsifiedFor MT) S))
  119.           (not (ist (FallaciousFor MT) S))))
  120.  
  121.     (if (ist (ProvenFor MT) S)
  122.         (ist (PossibleFor MT) S))
  123.  
  124.     (if (ist (PossibleFor MT) S)
  125.      (and (not (ist (FalsifiedFor MT) S))
  126.           (not (ist (FallaciousFor MT) S))))
  127.  
  128.     (if (not (ist (ProvenFor MT) S))
  129.      (or (ist (FalsifiedFor MT) S)
  130.          (ist (FallaciousFor MT) S)
  131.          (ist (PossibleFor MT) S)))
  132.  
  133.     (iff (ist (FalsifiedFor MT) S)
  134.      (and
  135.       (not (ist (ProvenFor MT) S))
  136.       (not (ist (PossibleFor MT) S))
  137.       (not (ist (UnknownFor MT) S))))
  138.  
  139.     (if (not (ist (PossibleFor MT) S))
  140.      (or (ist (FalsifiedFor MT) S)
  141.          (ist (FallaciousFor MT) S)))
  142.  
  143.     (if (ist (PossibleFor MT) S)
  144.      (and (not (ist (FalsifiedFor MT) S))
  145.           (not (ist (FallaciousFor MT) S))))
  146.  
  147.     (if (ist (UnknownFor MT) S)
  148.      (and
  149.       (not (ist (ProvenFor MT) S))
  150.            (ist (PossibleFor MT) S)
  151.       (not (ist (AssertedFor MT) S))
  152.       (not (ist (FalsifiedFor MT) S))))
  153.  
  154.  ;; subcontext inheritance
  155.  (forall (SUBCTX)
  156.     (if
  157.      (subContextOf SUBCTX MT)
  158.      (and
  159.  
  160.         (if (ist (ProvenFor MT) S)
  161.         (ist (ProvenFor SUBCTX) S))
  162.  
  163.         (if (ist (AskableFrom MT) S)
  164.         (ist (AskableFrom SUBCTX) S))
  165.  
  166.         (if (ist (FalsifiedFor MT) S)
  167.         (ist (FalsifiedFor SUBCTX) S)))))
  168.  
  169. )))
  170.  
  171.  
  172. ;; Completely Unrelated,  but other fun stuff
  173.  
  174. ;; sentence instance ?
  175. (forall (mgu lgu)
  176.  (exists (tmp-ctx)
  177.   (if
  178.     (if
  179.      (ist tmp-ctx mgu)
  180.      (ist tmp-ctx lgu))))
  181.   (prop-instance-of-prop lgu mgu))
  182.  
  183.  
  184. ;; some sentence unifier ?
  185. (forall (sent1 sent2)
  186.  (exists (tmp-ctx)
  187.   (if
  188.    (and
  189.     (subContextOf tmp-ctx LogicalEquivAxiomsMt)
  190.     (iff
  191.      (ist tmp-ctx sent1)
  192.      (ist tmp-ctx sent2)))
  193.   (sents-unify sent1 sent2))))
  194.  
  195. ;; some sentence unifier ?
  196. (forall (sent1 sent2)
  197.  (exists (tmp-ctx)
  198.   (if
  199.    (and
  200.     (subContextOf tmp-ctx LogicalEquivAxiomsMt)
  201.     (ist tmp-ctx (iff sent1 sent2)))
  202.   (sents-unify sent1 sent2))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement