40 research outputs found
オフラインWebアプリケーションにおける事前データ取得の半自動化
近年GmailやGoogle MapsなどのWebアプリケーションが多くのユーザにより利用されている. Webアプリケーションは使用する実行環境に依存しないという特徴がある. しかしWebアプリケーションのダウンロード時だけでなく, その実行の間中, ネットワーク接続がオンライン状態でなければならない事も多い. 近年ではスマートフォンからWebアプリケーションを使用するケースも多く, オフライン状態下で使用できない事は不便さにつながる可能性がある. その点を解消したものがオフラインWebアプリケーションである. オフラインWebアプリケーションはオフライン環境下でも実行が可能なWebアプリケーションの総称である. オフラインWebアプリケーションはアプリケーションの実行に必要なデータをあらかじめWebサーバから取得する事でオフライン状態での実行を可能にしている.オフラインWebアプリケーションにおいてはWebサーバからWebブラウザ側に実行に必要なデータを一括で事前取得(以下プリフェッチ)する事が基本である. 従ってプログラム中のプリフェッチコードは最初のデータ取得時の記述のみでよく, 通信処理に伴うコールバック関数の記述コストは少ない. しかしデータの一括取得が困難な場合がある. この問題は従来では一括取得後は常にオフライン状態である事を想定していたオフラインWebアプリケーションにおいて, データの一括取得後も必要に応じて一時的にオンライン状態になる事を想定したオンデマンドプリフェッチを採用する事で解決できる. ただしオンラインになるタイミングは選択できないものとする. これは電波が不安定になる場所での使用を想定している為である. このようにデータの一括取得後に, 一時的にオンライン状態になることを想定するアプリケーションを準オフライン型, また一括取得後のデータ通信を行わないアプリケーションを完全オフライン型と便宜上呼ぶことにする. 準オフライン型においてはオンラインになるタイミングを選べないため必要なデータを予測し, オンライン時にプリフェッチをする事が考えられる. しかしこの方法を採用すると実行に必要なデータをプリフェッチするタイミングを考慮しつつプログラミングを行うことが求められるため, データのプリフェッチを行うコードを何度も修正する事が予想される. 例えばオフライン時にプリフェッチを行っても失敗する事からプリフェッチコードの実行を試みる間隔を変更する事などが考えられる. さらにプリフェッチコードに伴うコールバック関数の書き換えも行う必要があり非常に煩わしい. そこで本研究では準オフライン型のWebアプリケーションにおいて, プリフェッチコードをプログラムのロジックとは別に用意した情報から自動生成し, プログラム中に自動挿入する手法を提案する. またコールバック関数などの煩雑な処理を記述する必要のない手法についても提案する.電気通信大学201
Automated verification of termination certificates
In order to increase user confidence, many automated theorem provers provide
certificates that can be independently verified. In this paper, we report on
our progress in developing a standalone tool for checking the correctness of
certificates for the termination of term rewrite systems, and formally proving
its correctness in the proof assistant Coq. To this end, we use the extraction
mechanism of Coq and the library on rewriting theory and termination called
CoLoR
Towards Compatible and Interderivable Semantic Specifications for the Scheme Programming Language, Part I: Denotational Semantics, Natural Semantics, and Abstract Machines
We derive two big-step abstract machines, a natural semantics, and the valuation function of a denotational semantics based on the small-step abstract machine for Core Scheme presented by Clinger at PLDI'98. Starting from a functional implementation of this small-step abstract machine, (1) we fuse its transition function with its driver loop, obtaining the functional implementation of a big-step abstract machine; (2) we adjust this big-step abstract machine so that it is in defunctionalized form, obtaining the functional implementation of a second big-step abstract machine; (3) we refunctionalize this adjusted abstract machine, obtaining the functional implementation of a natural semantics in continuation style; and (4) we closure-unconvert this natural semantics, obtaining a compositional continuation-passing evaluation function which we identify as the functional implementation of a denotational semantics in continuation style. We then compare this valuation function with that of Clinger's original denotational semantics of Scheme
Denotational style correctness of a CPS-Transform based compiler
RIT department of computer science technical report. Correctness is a crucial property for compilers; programmers rely on it when writing code. Ideally, correctness should be proved. Work on compiler correctness has focused on direct translation strategies. However, in practice, the continuation passing style (CPS) transform (or a variant) is often used in the translation process. Here a simple source language and its CPS-transform based compiler are introduced. A tractable proof for this compiler is presented, including a denotational proof of the correctness of a CPS-transform. The benefits of the proof are discussed
Adding hygiene to gambit scheme
Le langage de programmation Scheme est reconnu pour son puissant
système de macro-transformations. La représentation
du code source d'un programme, sous forme de données manipulables
par le langage,
permet aux programmeurs de modifier directement
l'arbre de syntaxe abstraite sous-jacent.
Les macro-transformations
utilisent une syntaxe similaire aux procédures régulières mais,
elles définissent plutôt des procédures à exécuter
lors de la phase de compilation.
Ces procédures retournent une représentation sous
forme d'arbre de syntaxe abstraite qui devra être substitué
à l'emplacement de l'appel du transformateur. Les procédures
exécutées durant la phase de compilation profitent
de la même puissance que celles exécutées durant de la phase d'évaluation.
Avec ce genre de système de macro-transformations,
un programmeur peut créer des règles de syntaxe spécialisées
sans aucun coût additionnel en performance:
ces extensions syntactiques
permettent l'abstraction de code sans les coûts d'exécution
habituels reliés à la création d'une fermeture sur le tas.
Cette représentation pour le code source de Scheme provient
directement du langage de programmation Lisp. Le code source
est représenté sous forme de listes manipulables
de symboles, ou bien de
listes contenants d'autres listes: une structure appelée
S-expression. Cependant, avec cette approche simpliste,
des conflits de noms peuvent apparaître.
En effet, l'association référée par un certain identifiant
est déterminée exclusivement par
le contexte lexical de celui-ci.
En déplaçant un identifiant dans l'arbre de syntaxe abstraite,
il est possible que cet identifiant se retrouve dans
un contexte lexical contenant une certaine association pour un identifiant du même nom.
Dans de tels cas,
l'identifiant déplacé pourrait ne plus référer à l'association
attendue, puisque cette seconde
association pourrait avoir prévalence sur
la première. L'assurance de transparence référentielle est alors perdue.
En conséquence, le choix de nom pour les identifiants
vient maintenant influencer directement
le comportement du programme,
générant des erreurs difficiles à comprendre.
Les conflits de noms
peuvent être corrigés manuellement dans le code en utilisant,
par exemple, des noms d'identifiants uniques.
La préservation automatique de la transparence référentielle
se nomme hygiène, une notion qui a été beaucoup
étudiée dans le contexte
des langages de la famille Lisp.
La dernière version du Scheme revised report, utilisée
comme spécification pour le langage, étend ce dernier
avec un support pour les macro-transformations hygiéniques.
Jusqu'à maintenant,
l'implémentation Gambit de Scheme ne fournissait
pas de tel système à sa base. Comme contribution, nous
avons ré-implémenter le système de macro de Gambit pour
supporter les macro-transformations hygiéniques au plus bas niveau
de l'implémentation. L'algorithme choisi se base sur l'algorithme
set of scopes implémenté dans le langage Racket et créé par Matthew Flatt.
Le langage Racket s'est grandement inspiré
du langage Scheme mais, diverge
sur plusieurs fonctionnalités importantes. L'une de
ces différences est le puissant système de macro-transformation
sur lequel Racket base la majorité de ses primitives.
Dans ce contexte, l'algorithme a donc été testé
de façon robuste.
Dans cette thèse, nous donnerons un aperçu du langage
Scheme et de sa syntaxe. Nous énoncerons le problème d'hygiène
et décrirons différentes stratégies utilisées
pour le résoudre. Nous justifierons par la suite
notre choix d'algorithme et fourniront une définition
formelle. Finalement, nous présenterons une analyse
de la validité et de la performance du compilateur en
comparant la version originale de Gambit avec notre
version supportant l'hygiène.The Scheme programming language is known for
its powerful macro system.
With Scheme source code represented as actual Scheme data,
macro transformations
allow the programmer, using that data, to act directly on the
underlying abstract syntax tree.
Macro transformations use a similar syntax to
regular procedures but, they define procedures
meant to be executed at compile time.
Those procedures return an abstract syntax tree representation
to be substituted at the transformer's call location.
Procedures executed at compile-time use the same
language power as run-time procedures.
With the macro system,
the programmer can create specialized
syntax rules without additional performance costs.
This also allows for code abstractions
without the expected run-time cost of closure creations.
Scheme's representation of source code using values
inherits that virtue from the Lisp programming language.
Source code is represented as a list of symbols, or lists
of other lists: a structure coined S-expressions.
However, with this simplistic approach,
accidental name clashes can occur.
The binding to which an identifier refers to
is determined by the lexical context of that identifier.
By moving an identifier around in the abstract syntax tree,
it can be caught within the lexical context of another binding definition with the same name.
This can cause unexpected behavior for programmers
as the choice of names can create substantial changes
in the program.
Accidental name clashes can be manually fixed in the code,
using name obfuscation, for instance.
However, the programmer becomes responsible
for the program's safety.
The automatic preservation of referential transparency
is called hygiene and was
thoroughly studied in the context
of lambda calculus and Lisp-like languages.
The latest Scheme revised report, used as a specification for the
language, extend the language with hygienic macro
transformations.
Up to this point, the Gambit Scheme implementation
wasn't providing a built-in hygienic macro system.
As a contribution, we re-implemented Gambit's
macro system to support hygienic transformations
at its core.
The algorithm we chose is
based on the set of scopes algorithm, implemented in the
Racket language by Matthew Flatt.
The Racket language is heavily based on Scheme but,
diverges on some core features.
One key aspect of the Racket language is
its extensive hygienic syntactic macro system, on
which most core features are built on:
the algorithm
was robustly tested in that context.
In this thesis, we will give an overview of the Scheme language
and its syntax. We will state the hygiene problem and describe
different strategies used to enforce hygiene automatically.
Our algorithmic
choice is then justified and formalized. Finally, we
present the original Gambit macro system and explain
the changes required. We also provide a validity and performance
analysis, comparing the original Gambit implementation to
our new system
The False Dichotomy Between Causal Realization and Semantic Computation
In this paper, I show how semantic factors constrain the understanding
of the computational phenomena to be explained so that they help build
better mechanistic models. In particular, understanding what cognitive
systems may refer to is important in building better models of cognitive
processes. For that purpose, a recent study of some phenomena in rats
that are capable of ‘entertaining’ future paths (Pfeiffer and Foster 2013)
is analyzed. The case shows that the mechanistic account of physical
computation may be complemented with semantic considerations, and
in many cases, it actually should.Publikacja została sfinansowana ze środków Ministerstwa Nauki i Szkolnictwa Wyższego w ramach programu Narodowego Programu Rozwoju Humanistyki przyznanych na podstawie decyzji 0014/NPRH4/H3b/83/2016 - projekt „Przygotowanie i publikacja dwóch anglojęzycznych numerów monograficznych Internetowego Magazynu Filozoficznego HYBRIS” (3bH 15 0014 83)
Die C# Schnittstelle der Referenzattributgrammatik-gesteuerten Graphersetzungsbibliothek RACR: Übersicht, Anwendung und Implementierung: Entwicklerhandbuch
Dieser Bericht präsentiert RACR-NET, eine Schnittstelle der Referenzattributgrammatik-gesteuerten Graphersetzungsbibliothek RACR für C#.
RACR-NET ermöglicht die Nutzung der deklarativen, dynamischen Sprachspezifikations-, Instanziierungs- und Auswertungsmeachanismen der RACR Scheme-Bibliothek in der objektorientierten Programmierung. Dies umfasst insbesondere die automatische inkrementelle Auswertung attributbasierter semantischer Analysen und somit das automatische Cachen parametrisierter Funktionsmethoden. Graphersetzungen entsprechen hierbei Zustandsänderungen von Objektinstanzen und der Invalidierung abgeleiteter Berechnungen.
Schwerpunkt dieses Berichts ist die objektorientierte Programmierschnittstelle von RACR-NET, dessen praktische Anwendung und Implementierung. Der Bericht ist ein Referenzhandbuch für RACR-NET Anwender und Entwickler.:1. Einleitung
1.1. Aufgabenstellung
1.2. Struktur der Arbeit
2. Konzeptionelle und technische Voraussetzungen
2.1. Überblick der RAG-gesteuerten Graphersetzung
2.2. Scheme
2.3. Die RACR Scheme-Bibliothek
2.4. Das .NET-Framework und die Common Language Infrastructure
2.5. IronScheme
3. RACR-NET Implementierung: Prozedurale Schnittstelle
3.1. Scheme in C#
3.2. RACR in C#
3.3. Anforderungsanalyse
3.4. Implementierung der prozeduralen Schnittstelle
4. RACR-NET Implementierung: Objektorientierte Schnittstelle
4.1. Überblick über die objektorientierte Schnittstelle
4.2. Anwendungsbeispiel
4.3. Herausforderungen bei der Implementierung
4.4. Implementierung
5. Evaluation
5.1. Testen der Schnittstelle
5.2. Performance-Messungen und -Vergleiche
6. Zusammenfassung und Ausblick
6.1. Eine objektorientierte Bibliothek für RAG-gesteuerte Graphersetzung
6.2. Zukünftige Arbeiten
A. Literaturverzeichnis
B. MIT Lizen
Proving Correctness of a Chez Scheme Compiler Pass
We present a proof of correctness for a pass of the Chez Scheme compiler over a subset of the Scheme programming language. To improve trust in our proof approach, we provide two different validation frameworks. The first, created with the Coq proof assistant, is a partial mechanization of the proof, notably implementing a formal semantics for our subset of Scheme. This framework was designed to serve as a basis for the future work of a complete mechanization of our proof. The second framework uses an existing implementation of the Scheme semantics to demonstrate correctness of the pass on a variety of individual examples. We discuss our proof and frameworks in-depth, and give a historical background on compiler correctness proofs and their mechanization