Skip to content

Commit

Permalink
Merge pull request #2 from PESchoenberg/develop
Browse files Browse the repository at this point in the history
Norm. code.
  • Loading branch information
PESchoenberg authored Jan 18, 2019
2 parents 92e2221 + 54e2c63 commit 57f7e51
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 252 deletions.
2 changes: 1 addition & 1 deletion examples/example1.scm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
; Vars and initial stuff.
(define dbms "sqlite3")
(define kb1 "example1.db")
(define co "prg0_0")
(define co "prg0.1")
(define st "enabled")
(define v 0.0)
(define p 1.0)
Expand Down
9 changes: 3 additions & 6 deletions examples/example2.scm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
; Vars and initial stuff.
(define dbms "sqlite3")
(define kb1 "example2.db")
(define co "prg0_0")
(define co "prg0.1")
(define st "enabled")
(define v 0.0)
(define p 1.0)
Expand Down Expand Up @@ -97,7 +97,7 @@
; Insertion of rules.
(define tb3 "sde_rules")
; (define tb2 "sde_mem_rules") ; We would need this only if rules are stored as programs.
(define co "prg0_0") ; Standard context value to indicate that a rule always resides on sde_rules and not sde_meme_rules.
(define co "prg0.1") ; Standard context value to indicate that a rule always resides on sde_rules and not sde_meme_rules.


; Insert rule.
Expand Down Expand Up @@ -179,8 +179,6 @@
; get confusing if the Scheme variables are named otherwise.
;
(define mode-run 1)


(kb-setup-session dbms kb1 f3)
(while (= mode-run 1)

Expand All @@ -206,8 +204,7 @@

; And finally we get the value of item mode-run and pass it to a
; of the same name.
(set! mode-run (kb-get-value-from-item dbms kb1 "sde_facts" "mode-run"))
)
(set! mode-run (kb-get-value-from-item dbms kb1 "sde_facts" "mode-run")))


; And then show all the facts and their values at the end of the loop.
Expand Down
7 changes: 5 additions & 2 deletions examples/example3.scm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
; Vars and initial stuff.
(define dbms "sqlite3")
(define kb1 "example3.db")
(define co "prg0_0")
(define co "prg0.1")
(define st "enabled")
(define v 0.0)
(define p 1.0)
Expand Down Expand Up @@ -95,6 +95,9 @@
(kb-insert-facts dbms kb1 tb2 co st it v p f3)





; Now we will inser some facts that will describe the following graph:
;
; a ---- b ---- c
Expand Down Expand Up @@ -159,7 +162,7 @@

; Standard context value to indicate that a rule always resides on sde_rules
; and not sde_meme_rules.
(define co "prg0_0")
(define co "prg0.1")


; Insert rule.
Expand Down
Loading

0 comments on commit 57f7e51

Please sign in to comment.