GRACeFUL-project / GRACe

The Constraint Functional Programming DSL for the GRACeFUL project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GRACe - a domain specific language for GRACeFUL Concept Maps

A DSL for GRACeFUL components.

Overview

Directory Contents
doc/ Various documentation.
docker_dist/ Scripts for creating a Docker image.
examples/ Example programs written in GRACe.
src/ Haskell source code for the GRACe library.
test/ Test suite.

Installation for users

We provide a platform-independent Docker image containing an executable for the OilCrops example, written in GRACe.

Running the example requires the Docker Community Edition (CE) to be installed. Docker CE, as well as installation instructions are available at the docker website. Once Docker CE is installed, the example can be executed using the Docker application as follows:

Open a terminal (the command prompt for Windows users) and execute the commands

  docker pull eugraceful/grace-examples:latest
  docker run --rm eugraceful/grace-examples:latest

This will run the OilCrops example and write the problem solution to standard output.

This example contains a small optimization problem in which the objective is to dedicate a set amount of farmland area to three different crops, with the goal of maximizing the yield of vegetable oil produced from these crops. A description of the example can be found in the tutorial and the source code is here.

Installation for developers

Development of GRACe programs requires the following software dependencies to be met:

The recommended way of installing GHC and other Haskell libraries/tools are through stack. stack handles the entire Haskell toolchain (including the compiler GHC), library dependencies, building and executing. Instructions for installing stack on macOS, Linux and Windows can be found here.

The recommended way of installing the required MiniZinc solver tools is through the bundled binary packages available here.

Usage

First, clone the GRACe repository:

git clone https://github.com/GRACeFUL-project/GRACe grace

GRACe comes with a few examples that can be built using

stack build
stack exec SomeExamples

stack will automatically take care of dependencies. Optionally, a small test suite is available. Run the tests by executing

stack test

This assumes MiniZinc is in your path. If it is not you can add the correct directory to the environment - for example

env MZN_STDLIB_DIR=/home/patrikj/Downloads/MiniZincIDE-2.1.0-bundle-linux-x86_64/share/minizinc \
stack test

Development

The examples folder contains several examples of GRACe programs. In addition to these, we provide a short tutorial on how to write GRACe programs here.

About

The Constraint Functional Programming DSL for the GRACeFUL project.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Haskell 99.6%Language:Shell 0.2%Language:Makefile 0.1%