Skip to content

Commit

Permalink
Fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Edkamb committed Dec 16, 2023
1 parent cd764a7 commit 995efe6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@ minimal object-oriented language with integrated semantic state
access. The interpreter can be used to examine the state with SPARQL,
SHACL and OWL queries.

The language is in development, for a general description, examples and tutorial to SMOL, we refer to [its webpage](https://www.smolang.org).

This branch in particular contains the case study for modeling geological processes.

To run the experiment contained in the article _"Semantically Triggered Qualitative Simulation of a Geological Process"_, run the following commands (tested on a Linux machine)
To compile and run the SMOL REPL, run
```
chmod +x ./execute_case.sh
./execute_case.sh
./gradlew build
java -jar build/libs/smol.jar --help
```

For a general description and tutorial to SMOL, we refer to [its webpage](www.smolang.org).
To run the SMOL REPL pre-compiled using docker, run the following command:
```
docker run -it --rm -v "$PWD":/root/smol ghcr.io/smolang/smol:latest
```

To compile and run the SMOL REPL inside docker, run the following commands:
```
docker build -t smol .
docker run -it --rm -v "$PWD":/root/smol smol
```
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = 'org.smolang'
version = '0.3'
version = '0.4'

java {
toolchain {
Expand Down
7 changes: 3 additions & 4 deletions src/main/kotlin/no/uio/microobject/type/TypeChecker.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package no.uio.microobject.type

import no.uio.microobject.antlr.WhileParser
import no.uio.microobject.ast.expr.Conversion
import no.uio.microobject.data.TripleManager
import no.uio.microobject.main.Settings
import no.uio.microobject.runtime.FieldInfo
Expand Down Expand Up @@ -30,7 +29,7 @@ class TypeChecker(private val ctx: WhileParser.ProgramContext, private val setti
Handling type data structures
***********************************************************************/
//translates a string text to a type, even accessed within class createClass (needed to determine generics)
private fun stringToType(text: String, createClass: String, generics : MutableMap<String, List<String>>) : Type {
private fun stringToType(text: String, generics : MutableMap<String, List<String>>) : Type {
return when {
//generics.getOrDefault(createClass, listOf()).contains(text) -> GenericType(text)
generics.values.flatten().contains(text) -> GenericType(text)
Expand All @@ -46,9 +45,9 @@ class TypeChecker(private val ctx: WhileParser.ProgramContext, private val setti
//translates a type AST text to a type, even accessed within class createClass (needed to determine generics)
fun translateType(ctx : WhileParser.TypeContext, className : String, generics : MutableMap<String, List<String>>) : Type {
return when(ctx){
is WhileParser.Simple_typeContext -> stringToType(ctx.text, className, generics)
is WhileParser.Simple_typeContext -> stringToType(ctx.text, generics)
is WhileParser.Nested_typeContext -> {
val lead = stringToType(ctx.NAME().text, className, generics)
val lead = stringToType(ctx.NAME().text, generics)
ComposedType(lead, ctx.typelist().type().map { translateType(it, className, generics) })
}
is WhileParser.Fmu_typeContext -> {
Expand Down

0 comments on commit 995efe6

Please sign in to comment.