https://github.com/aclai-lab/solelogics.jl
Computational logic in Julia!
Science Score: 59.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 2 DOI reference(s) in README -
✓Academic publication links
Links to: springer.com, acm.org -
✓Committers with academic emails
2 of 11 committers (18.2%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.9%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Computational logic in Julia!
Basic Info
- Host: GitHub
- Owner: aclai-lab
- License: mit
- Language: Julia
- Default Branch: main
- Homepage: https://aclai-lab.github.io/SoleLogics.jl/
- Size: 5.14 MB
Statistics
- Stars: 17
- Watchers: 5
- Forks: 7
- Open Issues: 5
- Releases: 48
Topics
Metadata Files
README.md
SoleLogics.jl – Computational logic in Julia
In a nutshell
SoleLogics.jl provides a fresh codebase for computational logic, featuring easy manipulation of: - Propositional and (multi)modal logics (atoms, logical constants, alphabets, grammars, crisp/fuzzy algebras); - Logical formulas (parsing, random generation, minimization); - Logical interpretations (e.g., propositional valuations, Kripke structures); - Algorithms for finite model checking, that is, checking that a formula is satisfied by an interpretation.
Usage
julia
using Pkg; Pkg.add("SoleLogics")
using SoleLogics
Parsing and manipulating Formulas
```julia julia> φ1 = parseformula("¬p∧q∧(¬s∧¬z)");
julia> φ1 isa SyntaxTree true
julia> syntaxstring(φ1) "¬p ∧ q ∧ ¬s ∧ ¬z"
julia> φ2 = ⊥ ∨ Atom("t") → φ1;
julia> φ2 isa SyntaxTree true
julia> syntaxstring(φ2) "(⊥ ∨ t) → (¬p ∧ q ∧ ¬s ∧ ¬z)" ```
Generating random formulas
```julia julia> using Random
julia> height = 2
julia> alphabet = Atom.(["p", "q"])
Propositional case
julia> SoleLogics.BASEPROPOSITIONALCONNECTIVES 6-element Vector{SoleLogics.Connective}: ¬ ∧ ∨ →
julia> randformula(Random.MersenneTwister(507), height, alphabet, SoleLogics.BASEPROPOSITIONALCONNECTIVES) SyntaxBranch: ¬(q → p)
Modal case
julia> SoleLogics.BASEMODALCONNECTIVES 8-element Vector{SoleLogics.Connective}: ¬ ∧ ∨ → ◊ □
julia> randformula(Random.MersenneTwister(14), height, alphabet, SoleLogics.BASEMODALCONNECTIVES) SyntaxBranch: ¬□p ```
Model checking
Propositional logic
```julia
julia> phi = parseformula("¬(p ∧ q)") SyntaxBranch: ¬(p ∧ q)
julia> I = TruthDict(["p" => true, "q" => false]) ┌────────┬────────┐ │ q │ p │ │ String │ String │ ├────────┼────────┤ │ false │ true │ └────────┴────────┘
julia> check(phi, I) true
```
Modal logic K (Saul Kripke, see an introduction here)
```julia julia> using Graphs
Instantiate a Kripke frame with 5 worlds and 5 edges
julia> worlds = SoleLogics.World.(1:5);
julia> edges = Edge.([(1,2), (1,3), (2,4), (3,4), (3,5)]);
julia> fr = SoleLogics.ExplicitCrispUniModalFrame(worlds, Graphs.SimpleDiGraph(edges)) SoleLogics.ExplicitCrispUniModalFrame{SoleLogics.World{Int64}, SimpleDiGraph{Int64}} with - worlds = ["1", "2", "3", "4", "5"] - accessibles = 1 -> [2, 3] 2 -> [4] 3 -> [4, 5] 4 -> [] 5 -> []
Enumerate the world that are accessible from the first world
julia> accessibles(fr, first(worlds)) 2-element Vector{SoleLogics.World{Int64}}: SoleLogics.World{Int64}(2) SoleLogics.World{Int64}(3)
julia> p,q = Atom.(["p", "q"])
# Assign each world a propositional interpretation julia> valuation = Dict([ worlds[1] => TruthDict([p => true, q => false]), worlds[2] => TruthDict([p => true, q => true]), worlds[3] => TruthDict([p => true, q => false]), worlds[4] => TruthDict([p => false, q => false]), worlds[5] => TruthDict([p => false, q => true]), ])
Instantiate a Kripke structure by combining a Kripke frame and the propositional interpretations over each world
julia> K = KripkeStructure(fr, valuation)
Generate a modal formula
julia> modphi = parseformula("◊(p ∧ q)")
Check the just generated formula on each world of the Kripke structure
julia> [w => check(modphi, K, w) for w in worlds] 5-element Vector{Pair{SoleLogics.World{Int64}, Bool}}: SoleLogics.World{Int64}(1) => 1 SoleLogics.World{Int64}(2) => 0 SoleLogics.World{Int64}(3) => 0 SoleLogics.World{Int64}(4) => 0 SoleLogics.World{Int64}(5) => 0 ```
Temporal modal logics
```julia
A temporal frame of 10 (equidistant) points
julia> fr = SoleLogics.FullDimensionalFrame((10,), SoleLogics.Point{1,Int});
Linear Temporal Logic (LTL) successor relation
julia> accessibles(fr, SoleLogics.Point(3), SoleLogics.SuccessorRel) |> collect 1-element Vector{SoleLogics.Point{1, Int64}}: ❮4❯
Linear Temporal Logic (LTL) greater than relation
julia> accessibles(fr, SoleLogics.Point(3), SoleLogics.GreaterRel) |> collect 7-element Vector{SoleLogics.Point{1, Int64}}: ❮4❯ ❮5❯ ❮6❯ ❮7❯ ❮8❯ ❮9❯ ❮10❯
```
```julia
An interval temporal frame on 10 (equidistant) points
julia> fr = SoleLogics.FullDimensionalFrame(10, Interval{Int});
Interval Algebra (IA) relation L (later, see Halpern & Shoham, 1991)
julia> accessibles(fr, Interval(3,5), IA_L) |> collect 15-element Vector{Interval{Int64}}: Interval{Int64}(6, 7) Interval{Int64}(6, 8) Interval{Int64}(7, 8) Interval{Int64}(6, 9) Interval{Int64}(7, 9) Interval{Int64}(8, 9) Interval{Int64}(6, 10) Interval{Int64}(7, 10) Interval{Int64}(8, 10) Interval{Int64}(9, 10) Interval{Int64}(6, 11) Interval{Int64}(7, 11) Interval{Int64}(8, 11) Interval{Int64}(9, 11) Interval{Int64}(10, 11)
Region Connection Calculus relation DC (disconnected, see Cohn et al., 1997)
julia> accessibles(fr, Interval(3,5), Topo_DC) |> collect 16-element Vector{Interval{Int64}}: Interval{Int64}(6, 7) Interval{Int64}(6, 8) Interval{Int64}(7, 8) Interval{Int64}(6, 9) Interval{Int64}(7, 9) Interval{Int64}(8, 9) Interval{Int64}(6, 10) Interval{Int64}(7, 10) Interval{Int64}(8, 10) Interval{Int64}(9, 10) Interval{Int64}(6, 11) Interval{Int64}(7, 11) Interval{Int64}(8, 11) Interval{Int64}(9, 11) Interval{Int64}(10, 11) Interval{Int64}(1, 2) ```
About
SoleLogics.jl lays the logical foundations for Sole.jl, an open-source framework for symbolic machine learning, originally designed for machine learning based on modal logics (see Eduard I. Stan's PhD thesis 'Foundations of Modal Symbolic Learning' here).
The package is developed by the ACLAI Lab @ University of Ferrara.
Thanks to Jakob Peters (author of PAndQ.jl) for the interesting discussions and ideas.
Want to contribute?
We have some TODOs
More on Sole
Similar Julia Packages for Computational Logic
Owner
- Name: Applied Computational Logic and Artificial Intelligence Laboratory
- Login: aclai-lab
- Kind: organization
- Email: aclai@unife.it
- Location: Italy
- Website: aclai.unife.it
- Repositories: 14
- Profile: https://github.com/aclai-lab
Applied Computational Logic and Artificial Intelligence (ACLAI) Laboratory of the Department of Mathematics and Computer Science, University of Ferrara
GitHub Events
Total
- Create event: 24
- Issues event: 30
- Release event: 9
- Watch event: 2
- Delete event: 28
- Issue comment event: 85
- Push event: 180
- Pull request review comment event: 1
- Pull request event: 62
- Fork event: 3
Last Year
- Create event: 24
- Issues event: 30
- Release event: 9
- Watch event: 2
- Delete event: 28
- Issue comment event: 85
- Push event: 180
- Pull request review comment event: 1
- Pull request event: 62
- Fork event: 3
Committers
Last synced: 11 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| giopaglia | 2****a | 531 |
| mauro-milella | m****o@l****t | 346 |
| alberto-paparella | a****a@e****t | 130 |
| mauro.milella | m****a@e****t | 35 |
| Michele21 | g****2@g****m | 24 |
| edo-007 | e****7@g****m | 15 |
| Eduard | s****d@g****m | 13 |
| CompatHelper Julia | c****y@j****g | 11 |
| ferdiu | f****a@g****m | 5 |
| Perro2110 | p****1@g****m | 2 |
| PasoStudio73 | p****3@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 18
- Total pull requests: 83
- Average time to close issues: 3 months
- Average time to close pull requests: 21 days
- Total issue authors: 5
- Total pull request authors: 8
- Average comments per issue: 11.78
- Average comments per pull request: 0.58
- Merged pull requests: 59
- Bot issues: 0
- Bot pull requests: 24
Past Year
- Issues: 14
- Pull requests: 58
- Average time to close issues: 3 days
- Average time to close pull requests: 4 days
- Issue authors: 4
- Pull request authors: 8
- Average comments per issue: 0.71
- Average comments per pull request: 0.71
- Merged pull requests: 45
- Bot issues: 0
- Bot pull requests: 4
Top Authors
Issue Authors
- alberto-paparella (11)
- giopaglia (3)
- mauro-milella (2)
- ReubenJ (1)
- JuliaTagBot (1)
Pull Request Authors
- alberto-paparella (36)
- github-actions[bot] (24)
- mauro-milella (7)
- edo-007 (4)
- Perro2110 (4)
- PasoStudio73 (3)
- giopaglia (3)
- Michele21 (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- julia 5 total
- Total dependent packages: 4
- Total dependent repositories: 0
- Total versions: 48
juliahub.com: SoleLogics
Computational logic in Julia!
- Homepage: https://aclai-lab.github.io/SoleLogics.jl/
- Documentation: https://docs.juliahub.com/General/SoleLogics/stable/
- License: MIT
-
Latest release: 0.13.2
published 11 months ago
Rankings
Dependencies
- JuliaRegistries/TagBot v1 composite
- julia-actions/setup-julia v1 composite
- actions/checkout v2 composite
- julia-actions/setup-julia latest composite
- actions/checkout v2 composite
- codecov/codecov-action v3 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-processcoverage v1 composite
- julia-actions/julia-runtest v1 composite
- julia-actions/setup-julia v1 composite
