aboutsummaryrefslogtreecommitdiff
path: root/src/ee/souffle
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-05-27 08:52:38 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-05-27 08:52:38 +0200
commit0259c6f907875b54e5d1df4bc89efa1c293d2812 (patch)
treed27f62ac6eb6fc09d8e989088978d959176ca6dd /src/ee/souffle
parent101d17f0993795769fa125d26ceec71ccfecd057 (diff)
downloadee-python-0259c6f907875b54e5d1df4bc89efa1c293d2812.tar.gz
ee-python-0259c6f907875b54e5d1df4bc89efa1c293d2812.tar.bz2
ee-python-0259c6f907875b54e5d1df4bc89efa1c293d2812.tar.xz
ee-python-0259c6f907875b54e5d1df4bc89efa1c293d2812.zip
Adding Soufflé based reasoning on parts. Replacing default configuration
with applying python function with this new reasoner.
Diffstat (limited to 'src/ee/souffle')
-rw-r--r--src/ee/souffle/digikey.dl3
-rw-r--r--src/ee/souffle/kicad.dl43
2 files changed, 46 insertions, 0 deletions
diff --git a/src/ee/souffle/digikey.dl b/src/ee/souffle/digikey.dl
new file mode 100644
index 0000000..735dd2d
--- /dev/null
+++ b/src/ee/souffle/digikey.dl
@@ -0,0 +1,3 @@
+#include "facts.dl"
+
+.output fact
diff --git a/src/ee/souffle/kicad.dl b/src/ee/souffle/kicad.dl
new file mode 100644
index 0000000..5448b05
--- /dev/null
+++ b/src/ee/souffle/kicad.dl
@@ -0,0 +1,43 @@
+#include "facts.dl"
+
+.output fact
+
+/*
+.decl is_resistor(uri:symbol)
+.decl is_capacitor(uri:symbol)
+.decl is_inductor(uri:symbol)
+
+is_resistor(Ref) :-
+ resistor_lib(lib).
+ fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).
+
+is_capacitor(Ref) :-
+ capacitor_lib(lib).
+ fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).
+
+is_inductor(Ref) :-
+ inductor_lib(lib).
+ fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).
+*/
+
+.decl resistor_lib(name:symbol)
+resistor_lib("Resistor_SMD").
+resistor_lib("Resistor_THT").
+
+.decl capacitor_lib(name:symbol)
+capacitor_lib("Capacitor_SMD").
+
+.decl inductor_lib(name:symbol)
+inductor_lib("Inductor_SMD").
+
+fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#resistor") :-
+ resistor_lib(lib),
+ fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).
+
+fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#capacitor") :-
+ capacitor_lib(lib),
+ fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).
+
+fact(Ref, "http://purl.org/ee/fact-type/ee-component-type", "http://purl.org/ee/part-type#inductor") :-
+ inductor_lib(lib),
+ fact(Ref, "http://purl.org/ee/kicad-sch-fact-type#footprint-library", lib).