Commit a51ac616 authored by Michael Hanus 's avatar Michael Hanus
Browse files

FiniteMap extended as in KiCS2, script generation added

parent 963db5bb
......@@ -13,8 +13,12 @@
# Logfile for make:
MAKELOG=make.log
# the root directory
ROOT=${CURDIR}
# binary directory and executables
BINDIR=${ROOT}/bin
# Directory where local executables are stored:
LOCALBIN=bin/.local
LOCALBIN=${BINDIR}/.local
#
# Install all components of PAKCS
......@@ -31,7 +35,7 @@ all: config
# Install all components of PAKCS
#
.PHONY: install
install:
install: installscripts
# install cabal front end if sources are present:
@if [ -d frontend ] ; then ${MAKE} installfrontend ; fi
# install the front-end if necessary:
......@@ -61,6 +65,15 @@ config:
@./update-pakcsrc
@./configure-pakcs
# install some scripts of PAKCS in the bin directory:
.PHONY: installscripts
installscripts:
@if [ ! -d ${BINDIR} ] ; then mkdir -p ${BINDIR} ; fi
sed "s|^PAKCSHOME=.*$$|PAKCSHOME=${ROOT}|" < scripts/pakcs_wrapper.sh > ${BINDIR}/.pakcs_wrapper
sed "s|^PAKCSHOME=.*$$|PAKCSHOME=${ROOT}|" < scripts/makecurrycgi.sh > ${BINDIR}/makecurrycgi
sed "s|^PAKCSHOME=.*$$|PAKCSHOME=${ROOT}|" < scripts/makesavedstate.sh > ${BINDIR}/.makesavedstate
cd ${BINDIR} && chmod 755 .pakcs_wrapper makecurrycgi .makesavedstate
# install new front end:
.PHONY: installfrontend
installfrontend:
......
......@@ -50,8 +50,11 @@ lib:
This directory contains a collection of standard libraries
implemented in Curry (including the standard prelude).
scripts:
This directory contains scripts used in PAKCS.
tools:
This directory contains various tools for the PAKCS system
This directory contains various tools for PAKCS
(see the README there for a more detailed description).
www:
......
......@@ -17,7 +17,7 @@ compilerVersion('PAKCS1.10').
compilerMajorVersion(1,10).
compilerMinorVersion(0).
buildVersion(2).
buildDate('27/04/12').
buildDate('01/06/12').
% Prolog compiler version included in .pl headers to distinguish
% code for different Prolog systems
......@@ -45,7 +45,7 @@ printPakcsHeader :-
writeNQ(' | | | | / /\\ \\ | |_/ / | | | |_____ Curry System'), nlNQ,
writeNQ(' | |__| | / /__\\ \\ | _ | | | |_____ | '), nlNQ,
writeNQ(' | ____| / ______ \\ | | \\ \\ | |____ _____| | Version '), printVersion, nlNQ,
writeNQ(' |_| /_/ \\_\\ |_| \\_\\ |______| |_______| March 2012'), nlNQ,
writeNQ(' |_| /_/ \\_\\ |_| \\_\\ |______| |_______| June 2012'), nlNQ,
nlNQ,
writeNQ('Curry2Prolog('), writeNQ(Prolog),
writeNQ(' '), writeNQ(MajV), writeNQ('.'), writeNQ(MinV),
......
......@@ -79,7 +79,7 @@
{\Huge\bf PAKCS 1.10.0}\\[4ex]
{\huge The Portland Aachen Kiel Curry System}\\[7ex]
{\huge User Manual}\\[4ex]
Version of November 18, 2011\\[6ex]
Version of June 1, 2012\\[6ex]
\Large
Michael Hanus$^1$ [editor] \\[3ex]
{\large Additional Contributors:}\\[2ex]
......
......@@ -51,10 +51,13 @@ module FiniteMap (
eltsFM,
fmSortBy,
minFM,maxFM,updFM, fmToListPreOrder
minFM,maxFM,updFM, fmToListPreOrder,
showFM, readFM
) where
import Maybe
import ReadShowTerm (readQTerm, showQTerm)
--- order predicates are boolean
type LeKey key = key -> key -> Bool
......@@ -414,6 +417,22 @@ fmToListPreOrder (FM _ fm) = pre fm []
fmSortBy :: LeKey key -> [key] -> [key]
fmSortBy p l = keysFM (listToFM p (zip l (repeat ())))
-----------------------------------------------------
-- reading/showing finite maps
-----------------------------------------------------
--- Transforms a finite map into a string. For efficiency reasons,
--- the tree structure is shown which is valid for reading only if one
--- uses the same ordering predicate.
showFM :: FM _ _ -> String
showFM (FM _ fm) = showQTerm fm
--- Transforms a string representation of a finite map into a finite map.
--- One has two provide the same ordering predicate as used in the
--- original finite map.
readFM :: LeKey key -> String -> FM key _
readFM p s = FM p (readQTerm s)
-----------------------------------------------------
-- internal Implementation
-----------------------------------------------------
......
#!/bin/sh
# Compile a Curry program (using the HTML library) into a cgi script
# Compute the main directory where PAKCS is installed:
PAKCSHOME=`echo PAKCSHOME must be defined here!`
export PAKCSHOME
# Standard suffix that will be added to the main script:
CGISUFFIX="_CGIMAIN_$$"
# Name of the main function in the main script (should not be in conflict
......@@ -91,11 +95,6 @@ if [ $# != 1 -a $# != 3 ] ; then
exit 1
fi
# Compute the main directory where PACKS is installed:
PATHNAME=`(cd \`dirname $0\` > /dev/null ; pwd)`
PAKCSHOME=`expr $PATHNAME : '\(.*\)/bin'`
export PAKCSHOME
# Definitions for WUI/JavaScript generation:
WUIJS_PREPROCESSOR=$PAKCSHOME/tools/curry2js/Curry2JS.state
WUIJS_DEFAULT_JS=$PAKCSHOME/include/wui_prims.js
......
......@@ -6,6 +6,10 @@
# - add path information to the saved state
# - add locale information (LANG, LC_ALL) to the saved state
# Compute the main directory where PAKCS is installed:
PAKCSHOME=`echo PAKCSHOME must be defined here!`
export PAKCSHOME
STANDALONE=no
if [ "$1" = "-standalone" ] ; then
STANDALONE=yes
......@@ -25,13 +29,8 @@ if [ $# != 1 ] ; then
exit 1
fi
# Compute the main directory where PACKS is installed:
PATHNAME=`(cd "\`dirname \"$0\"\`" ; pwd)`
PAKCSHOME=`expr "$PATHNAME" : '\(.*\)/bin'`
export PAKCSHOME
# Load definition of SPLD
. "$PATHNAME/.pakcs_variables"
. "$PAKCSHOME/bin/.pakcs_variables"
if [ "$PAKCSLIBPATH" = "" ] ; then
PAKCSLIBPATH="$PAKCSHOME/lib:$PAKCSHOME/lib/meta"
......
......@@ -12,7 +12,7 @@ PATHNAME=`(cd "\`dirname \"$0\"\`" > /dev/null ; pwd)`
. "$PATHNAME/.pakcs_variables"
# Compute the main directory where PAKCS is installed:
PAKCSHOME=`expr "$PATHNAME" : '\(.*\)/bin'`
PAKCSHOME=`echo PAKCSHOME must be defined here!`
export PAKCSHOME
# Define load path for standard libraries provided by PAKCS:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment