Skip to content
Snippets Groups Projects
Commit 4706decb authored by Thorsten Wißmann's avatar Thorsten Wißmann :guitar:
Browse files

Make CoAlgLogics with GML rules compile

parent 7b0020d2
No related branches found
No related tags found
No related merge requests found
...@@ -278,13 +278,38 @@ let mkRule_GML sort bs sl = ...@@ -278,13 +278,38 @@ let mkRule_GML sort bs sl =
in in
bsetIter addRole boxes; bsetIter addRole boxes;
bsetIter addRole diamonds; bsetIter addRole diamonds;
(* let addRule role acc =
mkRule_GML sort bs [s1] let premise: (bool*int*int) list =
= { (λ[bs1]. bs, [(s1, { ?a_i | i∈I, ?=neg iff a_i should be false })]) let modality isDiamond m acc =
| I some rule conclusion if lfGetDest3 sort m = role
} then (isDiamond,lfGetDestNum sort m,lfToInt (lfGetDest1 sort m))::acc
*) else acc
let rules = [] in in
List.append
(bsetFold (modality true) diamonds [])
(bsetFold (modality false) boxes [])
in
let conclusion = gml_rules premise in
(* conclusion is a set of rules, each of the forman \/ /\ lit *)
let handleRuleConcl rc acc =
let handleConjunction conj =
let res = bsetMake () in
List.iter (fun (f,positive) ->
let f = lfFromInt f in
let f = if positive then f else
match lfGetNeg sort f with
| Some nf -> nf
| None -> raise (CoAlgFormula.CoAlgException ("Negation of formula missing"))
in
bsetAdd res f)
conj;
(s1,res)
in
let rc = List.map handleConjunction rc in
((fun bs1 -> bs),rc)::acc
in List.fold_right handleRuleConcl conclusion acc
in
let rules = S.foldBS addRule roles [] in
(* standard return procedure *) (* standard return procedure *)
let res = ref (Some rules) in let res = ref (Some rules) in
fun () -> fun () ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment