diff options
author | dos-reis <gdr@axiomatics.org> | 2010-05-29 15:07:35 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2010-05-29 15:07:35 +0000 |
commit | acdae7bab43c4dca4ff03be1467b2fc86e7bbe1a (patch) | |
tree | 30ff3d5d44f46dd1521f1ca5ad9278a1e78a8734 | |
parent | 5c205afa0596a29c6e8de395d3b2adbd89e02ae8 (diff) | |
download | open-axiom-acdae7bab43c4dca4ff03be1467b2fc86e7bbe1a.tar.gz |
Add more utility functions
-rwxr-xr-x | configure | 18 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | configure.ac.pamphlet | 2 | ||||
-rw-r--r-- | src/interp/g-util.boot | 56 |
4 files changed, 62 insertions, 16 deletions
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for OpenAxiom 1.4.0-2010-05-26. +# Generated by GNU Autoconf 2.63 for OpenAxiom 1.4.0-2010-05-28. # # Report bugs to <open-axiom-bugs@lists.sf.net>. # @@ -745,8 +745,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='OpenAxiom' PACKAGE_TARNAME='openaxiom' -PACKAGE_VERSION='1.4.0-2010-05-26' -PACKAGE_STRING='OpenAxiom 1.4.0-2010-05-26' +PACKAGE_VERSION='1.4.0-2010-05-28' +PACKAGE_STRING='OpenAxiom 1.4.0-2010-05-28' PACKAGE_BUGREPORT='open-axiom-bugs@lists.sf.net' ac_unique_file="src/Makefile.pamphlet" @@ -1513,7 +1513,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures OpenAxiom 1.4.0-2010-05-26 to adapt to many kinds of systems. +\`configure' configures OpenAxiom 1.4.0-2010-05-28 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1583,7 +1583,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of OpenAxiom 1.4.0-2010-05-26:";; + short | recursive ) echo "Configuration of OpenAxiom 1.4.0-2010-05-28:";; esac cat <<\_ACEOF @@ -1691,7 +1691,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -OpenAxiom configure 1.4.0-2010-05-26 +OpenAxiom configure 1.4.0-2010-05-28 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1705,7 +1705,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by OpenAxiom $as_me 1.4.0-2010-05-26, which was +It was created by OpenAxiom $as_me 1.4.0-2010-05-28, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -21182,7 +21182,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by OpenAxiom $as_me 1.4.0-2010-05-26, which was +This file was extended by OpenAxiom $as_me 1.4.0-2010-05-28, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21245,7 +21245,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -OpenAxiom config.status 1.4.0-2010-05-26 +OpenAxiom config.status 1.4.0-2010-05-28 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index 5f879d6c..29555ad8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ sinclude(config/open-axiom.m4) sinclude(config/aclocal.m4) -AC_INIT([OpenAxiom], [1.4.0-2010-05-26], +AC_INIT([OpenAxiom], [1.4.0-2010-05-28], [open-axiom-bugs@lists.sf.net]) AC_CONFIG_AUX_DIR(config) diff --git a/configure.ac.pamphlet b/configure.ac.pamphlet index 43c34f12..2f446383 100644 --- a/configure.ac.pamphlet +++ b/configure.ac.pamphlet @@ -1210,7 +1210,7 @@ information: <<Autoconf init>>= sinclude(config/open-axiom.m4) sinclude(config/aclocal.m4) -AC_INIT([OpenAxiom], [1.4.0-2010-05-26], +AC_INIT([OpenAxiom], [1.4.0-2010-05-28], [open-axiom-bugs@lists.sf.net]) @ diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index 18af0463..7a93d95a 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -46,6 +46,51 @@ module g_-util where expandToVMForm: %Thing -> %Thing +--% VM forms + +++ Make the assumption named `prop' for all symbols +++ on the lis `syms'. +assumeProperty(syms,prop) == + for s in syms repeat + property(s,prop) := true + +assumeProperty('(%and %or),'%nary) + +++ We are about to construct a middle end expression +++ with operator `op, and aguments `form'. Try to +++ simplify the structure of the expression. +flattenVMForm(form,op) == main where + main() == + atom form => form + EQ(form.op,op) => [op,:flatten(form.args,op,nil)] + [flattenVMForm(form.op,op),:flattenVMForm(form.args,op)] + flatten(forms,op,acc) == + forms = nil => accu + x := flattenVMForm(first forms,op) + cons? x and EQ(x.op,op) => flatten(rest forms,op,[:accu,:x.args]) + flatten(rest forms,op,[:accu,x]) + +++ Build a midde end expression with given operator and arguments. +mkVMForm(op,args) == + if op has %nary then + args := flattenVMForm(args,op) + op = '%or => + args := REMOVE('%false,args) + args = nil => '%false + args is [arg] => arg + [op,:args] + op = '%and => + args := REMOVE('%true,args) + args = nil => '%true + args is [arg] => arg + [op,:args] + op = '%not => + [arg] := args + arg = '%false => '%true + arg = '%true => '%false + arg is ['%not,arg'] => arg' + ['%not,:args] + --% --% Opcode expansion to VM codes. --% @@ -568,13 +613,14 @@ getTypeOfSyntax t == bool: %Thing -> %Boolean bool x == null null x - + +++ Return true is the form `x' is a predicate known to always +++ evaluate to true. TruthP x == - --True if x is a predicate that's always true - x is nil => nil - x=true => true + x = nil or x = '%false => false + x = true or x = '%true => true x is ['QUOTE,:.] => true - nil + false --% Record and Union utils. |