Inferred System Descriptions ELS <http://dydra.com/>

Similar documents
Object Oriented Programming (OOP)

Common Lisp Object System Specification. 1. Programmer Interface Concepts

Custom Specializers in Object-Oriented Lisp

Loading Multiple Versions of an ASDF System in the Same Lisp Image

NST: A Unit Test Framework for Common Lisp

Object oriented programming

Debugging in LISP. trace causes a trace to be printed for a function when it is called

A Genetic Algorithm Implementation

A Brief Introduction to Common Lisp

1 CLWEB INTRODUCTION 1

A Small Interpreted Language

Infinite transducers on terms denoting graphs

Custom Specializers in Object-Oriented Lisp

Artificial Intelligence Programming

A little bit of Lisp

2. Reasons for implementing clos-unit

CL-STORE: CL Serialization Package

Common LISP Tutorial 1 (Basic)

Structure Programming in Lisp. Shared Structure. Tailp. Shared Structure. Top-Level List Structure

INF4820: Algorithms for Artificial Intelligence and Natural Language Processing. More Common Lisp

ASDF: Another System Definition Facility. Manual for Version

Implementing Symmetric Multiprocessing in LispWorks

Pattern Matching WIlensky Chapter 21

Method Combinators. e ELS 2018 E. Didier Verna. EPITA / LRDE. Introduction Issues SBCL Combinators CGFs Alt. MCs Perfs Conclusion

INF4820. Common Lisp: Closures and Macros

COSI: Adding Constraints to the object-oriented paradigm

LP/LispLite: Trivial Lisp Org Mode Conversion

The Users Guide. and. API Reference

CSCE476/876 Fall Homework 3: Programming Assignment Using Emacs and Common Lisp. 1 Exercises (15 Points) 2. 2 Find (6 points) 4

Custom Specializers in Object-Oriented Lisp

Simple Dynamic Compilation with GOO. Jonathan Bachrach. MIT AI Lab 01MAR02 GOO 1

LISP. Everything in a computer is a string of binary digits, ones and zeros, which everyone calls bits.

15 Unification and Embedded Languages in Lisp

Effective Audit Trail of Data With PROV-O Scott Henninger, Senior Consultant, MarkLogic

INF4820: Algorithms for Artificial Intelligence and Natural Language Processing. Common Lisp Fundamentals

Documentation for LISP in BASIC

Allegro CL Certification Program

Symbolic Programming. Dr. Zoran Duric () Symbolic Programming 1/ 89 August 28, / 89

Multi-Methods in Racket

Meet the Macro. a quick introduction to Lisp macros. Patrick Stein / TC Lisp Users Group /

Binary Methods Programming: the Clos Perspective

ASDF: Another System Definition Facility

Using a waiting protocol to separate concerns in the mutual exclusion problem

Semantic Web Fundamentals

Common Lisp in the Wild

Stream Reasoning Workshop Technical University Berlin SR2016

UIOP is a part of ASDF ( which is released under an MIT style License: Copyright c Daniel Barlow and

Functional Programming. Pure Functional Languages

Carnegie Mellon University. Pittsburgh, PA April This research has been supported in part by the Advanced Research

COMPUTER SCIENCE TRIPOS

CS 480. Lisp J. Kosecka George Mason University. Lisp Slides

Introduction to ACL2. CS 680 Formal Methods for Computer Verification. Jeremy Johnson Drexel University

Extending Pattern Directed Inference Systems. EECS 344 Winter 2008

Common Lisp. Blake McBride

CSE413: Programming Languages and Implementation Racket structs Implementing languages with interpreters Implementing closures

Filtered Dispatch ABSTRACT. Categories and Subject Descriptors. Keywords

Generic Function Parameter and Method Parameter Metaobjects: A Proposed Enhancement to the CLOS Metaobject Protocol. Eric L.

The OWL API: An Introduction

a little more on macros sort of like functions, but..

Recursive Functions of Symbolic Expressions and Their Computation by Machine Part I

ASDF 3, or Why Lisp is Now an Acceptable Scripting Language

4. Functional Programming Language-Oriented Programming

Jatha. Common Lisp in Java. Ola Bini JRuby Core Developer ThoughtWorks Studios.

Functional Programming. Big Picture. Design of Programming Languages

Is Linked Data the future of data integration in the enterprise?

Functional Programming. Pure Functional Languages

Dynamic ADTs: a don t ask, don t tell policy for data abstraction

CSCC24 Functional Programming Scheme Part 2

CSE 341 Section 7. Ethan Shea Autumn Adapted from slides by Nicholas Shahan, Dan Grossman, Tam Dang, and Eric Mullen

Department of Computer and information Science Norwegian University of Science and Technology

6.184 Lecture 4. Interpretation. Tweaked by Ben Vandiver Compiled by Mike Phillips Original material by Eric Grimson

NOTICE WARNING CONCERNING COPYRIGHT RESTRICTIONS: The copyright law of the United States (title 17, U.S. Code) governs the making of photocopies or

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

Functional Programming. Pure Functional Programming

Are functional languages a good way to represent productive meta models?

Adding formal semantics to the Web

CSCI B522 Lecture 11 Naming and Scope 8 Oct, 2009

A Survey of Current CLOS MOP Implementations

Visual Lisp/CLOS Programming in OpenMusic

Orchestrating Music Queries via the Semantic Web

Lisp as a second language, composing programs and music. Chapter III Object-Oriented Style I

19 Machine Learning in Lisp

CSE 341 Section 7. Eric Mullen Spring Adapted from slides by Nicholas Shahan, Dan Grossman, and Tam Dang

Functional programming with Common Lisp

History. Functional Programming. Based on Prof. Gotshalks notes on functionals. FP form. Meaningful Units of Work

Implementing and extending SPARQL queries over DLVHEX

Functions, Conditionals & Predicates


Section 10: LISP to Scheme. Evolution of Software Languages

Semantic Web Fundamentals

Set Partitions Iterator

Lambda Calculus. Gunnar Gotshalks LC-1

TH IRD EDITION. Python Cookbook. David Beazley and Brian K. Jones. O'REILLY. Beijing Cambridge Farnham Köln Sebastopol Tokyo

FUNKCIONÁLNÍ A LOGICKÉ PROGRAMOVÁNÍ 4. LISP: PROMĚNNÉ, DALŠÍ VLASTNOSTI FUNKCÍ, BLOKY, MAPOVACÍ FUNKCIONÁLY, ITERAČNÍ CYKLY,

Vanilla Lisp Shell (VLS)

Web of Data: P2P Business domain translation of problem spaces. Semantic Business Integration (WIP draft)

(defvar *state* nil "The current state: a list of conditions.")

Visual Lisp/CLOS Programming in OpenMusic

Semantic Queries and Mediation in a RESTful Architecture

CS 314 Principles of Programming Languages

Transcription:

Inferred System Descriptions James Anderson <james@dydra.com> @dydradata @lomoramic <http://dydra.com/>

Perspective github : nine repositories; (SLOC) = 188,758 dydra : :depends-on x 22; (SLOC) = 317,746 github : <https://github.com/lisp> dydra : <http://dydra.com>

Perspective github : nine repositories; (SLOC) = 188,758 dydra : :depends-on x 22; (SLOC) = 317,746 build systems build (1984) defsystem (1981) define-system (1984) asdf (2002) asdf (2010) asdf (2014) mkdefsystem (1990) xcvb (2009) asdf : <http://fare.tunes.org/files/asdf3/asdf3-2014.html> github : <https://github.com/lisp> dydra : <http://dydra.com>

Perspective github : nine repositories; (SLOC) = 188,758 dydra : :depends-on x 22; (SLOC) = 317,746 build systems build (1984) defsystem (1981) define-system (1984) asdf (2002) asdf (2010) asdf (2014) mkdefsystem (1990) xcvb (2009) :depends-on : why? asdf : <http://fare.tunes.org/files/asdf3/asdf3-2014.html> github : <https://github.com/lisp> dydra : <http://dydra.com>

Perspective: must it be manual? :depends-on : why? build (robbins 1984) "patching" "more precise change analysis" description of large systems (pitman 1984) "transitivity of dependency information" "tight bonding to syntax" build : <http://hdl.handle.net/1721.1/6909> dls : <http://www.nhplace.com/kent/papers/large-systems.html>

Results http://dydra.com/data/els2016/index.htm 1683 systems

Perspective: should be possible? "patching" "more precise change analysis" "transitivity of dependency information" "loose bonding to syntax" LISP a programming system called LISP (for LISt Processor) LISP : <http://www-formal.stanford.edu/jmc/recursive.pdf>

Perspective: should be possible? "patching" "more precise change analysis" "transitivity of dependency information" "loose bonding to syntax" LISP a programming system called LISP (for LISt Processor) "Recursive Functions of Symbolic Expressions..." LISP : <http://www-formal.stanford.edu/jmc/recursive.pdf>

Abstraction Alternatives ignore any system definition macro-expansion just to normalize syntax emulate just package symbol identity extract relations from source code do not compile do not build do not execute

Abstraction Vocabulary doap : http://usefulinc.com/ns/doap : packaged product level scro : http://www.cs.uwm.edu/~alnusair/ontologies/scro.owl : just conceptual structure compre : http://www.cs.uwm.edu/~alnusair/ontologies/compre.owl : components and depends, but no hierarchy, versions, or generation swonto : http://www.cs.uwm.edu/~alnusair/ontologies/swonto.owl : data processing in jena iao : https://github.com/information-artifact-ontology/iao/ : the entities are too generic swo : https://sourceforge.net/p/theswo/code/head/tree/trunk/src/release/ swoinowl/inferredswo/swo_inferred.owl : overdrawn : 4338 entities sioc : http://sioc-project.org : process oriented oflossc : http://ns.inria.fr/oflossc/ (404) : sioc specialized for open source process code : http://sioc-project.org : provides starting point

Abstraction Vocabulary string pathname Subclass of FaslFile (external) Namespace (external) File (external) haspart generated Package (external) Subclass of wasderiv... Compilation (external) Subclass of Subclass of Subclass of compiled datetime Subclass of endedattime SourceFile (external) Collection (external) Constituent (external) Activity Subclass of Class (external) authoredon (external) Thing filecontai... Subclass of Subclass of Subclass of Subclass of Entity (external) Operator (external) Test (external) called Subclass of Subclass of Function (external) Subclass of Subclass of Subclass of Macro (external) GenericFunction (external) hasmethod Method (external)

Goals identify all packages to load to use a given operator construct system based on requirements at any of three levels derive changes to load between two versions per system per file per function (test)

Results: Metadata

Results: Metadata

Start with Text file2 test (defun iex:function (arg) (+ (iex:method1 arg) 2)) file1 (defclass iex:class () ((slot1 :initform 1 :accessor iex:class-slot1) (slot2 :initform 2 :accessor iex:class-slot2))) (defgeneric iex:method1 (object) (:method ((object iex:class)) (+ 1 (iex:method1 (iex:class-slot1 object)))) (:method ((object t)) object)) (defmethod iex:method2 ((object iex:class)) (+ (iex:method1 object) (iex:class-slot2 object))) file2 (defun test.function1 () (eql (iex:method1 (make-instance 'iex:class)) 2)) (defun test.function2 () (eql (iex:method2 (make-instance 'iex:class)) 4)) (system :example :components ((:file "file1") (:file "file2" :depends-on "file1") (:file "file3" :depends-on "file2") (:file "test" :depends-on "file2 "file1")

Just the Text file2 test (defun iex:function (arg) (+ (iex:method1 arg) 2)) file1 (defclass iex:class () ((slot1 :initform 1 :accessor iex:class-slot1) (slot2 :initform 2 :accessor iex:class-slot2))) (defgeneric iex:method1 (object) (:method ((object iex:class)) (+ 1 (iex:method1 (iex:class-slot1 object)))) (:method ((object t)) object)) (defmethod iex:method2 ((object iex:class)) (+ (iex:method1 object) (iex:class-slot2 object))) file2 (defun test.function1 () (eql (iex:method1 (make-instance 'iex:class)) 2)) (defun test.function2 () (eql (iex:method2 (make-instance 'iex:class)) 4)) (system :example :components ((:file "file1") (:file "file2" :depends-on "file1") (:file "file3" :depends-on "file2") (:file "test" :depends-on "file2 "file1")

Abstract Symbols and Relations example Package file1.lisp haspart file2.lisp haspart file3.lisp haspart package.lisp haspart test.lisp haspart ISDF-EXAMPLE-IMPLEMENTATION contains ISDF-EXAMPLE contains ISDF-EXAMPLE-TEST contains File "2016-05-07T10:23:29Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> authoredon CLASS CLASS-SLOT1 CLASS-SLOT2 METHOD1 METHOD1 METHOD1 "2016-05-07T10:22:26Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> authoredon METHOD2 "2016-05-07T10:22:26Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> authoredon FUNCTION "2016-05-07T10:22:26Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> authoredon COMMON-LISP-USER "2016-05-07T10:22:26Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> authoredon TEST.FUNCTION1 TEST.FUNCTION2 Namespace Class Function Method GenericFunction ISDF-EXAMPLE:CLASS-SLOT1+CLASS ISDF-EXAMPLE:CLASS-SLOT2+CLASS ISDF-EXAMPLE:METHOD2+CLASS

Identify Types and Relations file1.lisp file2.lisp file3.lisp test.lisp FUNCTION TEST.FUNCTION2 TEST.FUNCTION1 METHOD2 METHOD1 CLASS-SLOT2 CLASS-SLOT1

Establish Source References file2.lisp file1.lisp test.lisp file3.lisp METHOD2 CLASS-SLOT2 METHOD1 TEST.FUNCTION2 TEST.FUNCTION1 FUNCTION CLASS-SLOT1

Capabilities: Infer Source Requirements file2.lisp file1.lisp file3.lisp test.lisp

Process : Quicklisp as Corpus $ ls /tmp/quicklisp/ wc -l 1669 $ ls quicklisp/versions/2016-02-08/ wc -l 1317 $ find quicklisp/versions/2016-02-08/ -name '*.asd' wc -l 3134 $ find quicklisp/versions/2016-02-08/ -name '*' - d wc -l 5839 $ find quicklisp/versions/2016-02-08/ -name '*.asd' \ while read dir; do dirname $dir; done \ sort uniq wc -l 1670 $ find quicklisp/versions/2016-02-08/ -name '*.lisp' wc -l 20310 $/development/source/library/org/quicklisp/versions/2016-03-18 # sloccount.... Total Physical Source Lines of Code (SLOC) = 4,307,928

Process : Crawl Source Code * (time (scm:abstract-system (ensure-system "quicklisp" :location #p"quicklisp/versions/2016-02-08/"))) Evaluation took: 2178.410 seconds of real time 323.020348 seconds of total run time (75.350139 user, 247.670209 system) [ Run times consist of 0.613 seconds GC time, and 322.408 seconds non-gc time. ] 14.83% CPU 3,444,829 forms interpreted 17 lambdas converted 7,624,481,182,395 processor cycles 5,746,702,672 bytes consed * (/ 2178.4 60) 36.306664 *

Process : Result Repository

Process : Infer Dependency prefix ssd: <http://dydra.com/schema/ssd#> prefix code: <http://www.cs.cmu.edu/~anupriya/code#> clear silent graph <urn:dydra:file-requirements> ; insert { graph <urn:dydra:file-requirements> {?definitionsource ssd:?referencesource } } where{ select?definitionsource?referencesource where { graph?package {?definitionsource code:?definition. # eliminate function/function definitions?definitionsource a <http://www.cs.cmu.edu/~anupriya/code#file>.?referencesource code:?reference.?referencesource a <http://www.cs.cmu.edu/~anupriya/code#file>.?reference code:?definition. filter(?definitionsource!=?referencesource ) } } }

Process : Infer Dependency prefix ssd: <http://dydra.com/schema/ssd#> prefix code: <http://www.cs.cmu.edu/~anupriya/code#> clear silent graph <urn:dydra:system-requirements> ; insert { graph <urn:dydra:system-requirements> {?definitionpackage ssd:?referencepackage.?referencepackage ssd:requires?definitionpackage } } where{ select?definitionpackage?referencepackage where { { graph?definitionpackage {?definitionsource code:?definition.?definitionsource a <http://www.cs.cmu.edu/~anupriya/code#file>. # eliminate function/function definitions } } { graph?referencepackage {?referencesource code:?reference.?referencesource a <http://www.cs.cmu.edu/~anupriya/code#file>.?reference code:?definition. } } filter (?definitionpackage!=?referencepackage) } }

Results: Quicklisp Graphs * (quicklisp-sparql " select?p (count(?o) as?count) FROM <urn:dydra:all> where {?s?p?o } group by?p order by desc(?count)" :message "predicate count") --------------- predicate count --------------- p count <http://www.cs.cmu.edu/~anupriya/code#> 743247 298610 label 240360 <http://www.cs.cmu.edu/~anupriya/code#> 227370 <http://dydra.com/schema/ssd#> 67917 comment 38959 <http://dydra.com/schema/ssd#requires> 37251 <http://www.cs.cmu.edu/~anupriya/code#haspart> 22017 <http://www.cs.cmu.edu/~anupriya/code#location> 20344 <http://purl.org/pav/authoredon> 20334 <http://www.cs.cmu.edu/~anupriya/code#contains> 4899 endedattime 10 generated 10 used 10 wasderivedfrom 10

Results: Quicklisp Graphs * (quicklisp-sparql " select count(*) where { graph <urn:dydra:file-requirements> {?s?p?o} }" :message "intra-system file cross-references") ---------------------------------- intra-system file cross-references ---------------------------------- COUNT1 30666

Results: Quicklisp Graphs * (quicklisp-sparql " prefix ssd: <http://dydra.com/schema/ssd#> select count(*) where { graph <urn:dydra:system-requirements> {?s ssd:requires?o} }" :message "inter-system cross-references") ----------------------------- inter-system cross-references ----------------------------- COUNT1 37251 * (quicklisp-sparql " prefix ssd: <http://dydra.com/schema/ssd#> select count(*) where { graph <urn:dydra:system-requirements> {?s ssd:?o} }" :message "inter-system cross-references") ----------------------------- inter-system cross-references ----------------------------- COUNT1 37251

BKNR: Infer Source Requirements blob.lisp tests.lisp xml-tutorial.lisp object-tests.lisp category-index.lisp xml-object.lisp xml-update.lisp xml-export.lisp tutorial.lisp object.lisp actor.lisp tutorial.lisp indices-tests.lisp xml-import.lisp convert.lisp txn.lisp encoding-test.lisp acl-mp-compat.lisp indices.lisp xml-class.lisp reader.lisp encoding.lisp runtime-statistics.lisp class.lisp capability.lisp skip-list.lisp indexed-class.lisp money.lisp utils.lisp protocol.lisp dump-core.lisp fswrap.lisp mop-bug.lisp shop.lisp slot-a LISP : <http://dydra.com/data/els2016>

BKNR: Load Order * (bknr-sparql " prefix ssd: <http://dydra.com/schema/ssd#> prefix prov: <http://www.w3.org/ns/prov#> prefix pav: <http://purl.org/pav/> prefix code: <http://www.cs.cmu.edu/~anupriya/code#> select distinct?loadfilename?dependentsource #?sequencenr from <urn:dydra:all> where { { select * where { bind ( '2000-05-08T00:00:00Z'^^xsd:dateTime as?system_load_time ) { select?source where {?source a <http://www.cs.cmu.edu/~anupriya/code#file>. optional {?othersource ssd:?source } filter (!bound(?othersource) ) } }?source ssd:+?dependentsource. bind (rdf:seq(xsd:integer) as?sequencenr ) } }?source pav:authoredon?timemodified. filter (?timemodified >?SYSTEM_LOAD_TIME )?dependentsource code:location?sourcepathname.?dependentsource pav:authoredon?sourcetime.?dependentsource rdfs:label?sourcefile. optional { [] prov:used?dependentsource ; prov:generated?dependentbinary ; prov:endedattime?binarytime.?dependentbinary code:location?binarypathname.?dependentbinary rdfs:label?binaryfile. } bind (if( bound(?binarytime), if ((?binarytime >?sourcetime),?binaryfile,?sourcefile ),?sourcefile ) as?loadfilename ) } order by desc(?sequencenr) " :message "source/binary load list (but absent binaries)")

BKNR: Load Order --------------------------------------------- source/binary load list (but absent binaries) --------------------------------------------- loadfilename dependentsource convert.lisp encoding-test.lisp object.lisp txn.lisp blob.lisp object-tests.lisp tests.lisp tutorial.lisp encoding.lisp xml-object.lisp xml-tutorial.lisp xml-export.lisp xml-import.lisp xml-update.lisp indices.lisp xml-class.lisp category-index.lisp indexed-class.lisp indices-tests.lisp tutorial.lisp capability.lisp class.lisp actor.lisp NIL *

Deficiencies macros ambiguous packages : non-universal symbols non-lisp syntax ".lisp" file content colleen-20160208-git/sample.uc.lisp bknr-datastore-20150923-git/src/xml-impex/tutorial.lisp read-eval read-time, compile-time, load-time, run-time no tracking for defparameter/-constant/-var circularity implicit package definitions ambiguous methods call sites

Deficiencies macros ambiguous packages : non-universal symbols non-lisp syntax ".lisp" file content colleen-20160208-git/sample.uc.lisp bknr-datastore-20150923-git/src/xml-impex/tutorial.lisp read-eval read-time, compile-time, load-time, run-time no tracking for defparameter/-constant/-var circularity implicit package definitions ambiguous methods call sites

Deficiencies : ambiguous methods bknr-datastore-20150923-git/src/indices-tests.lisp (defmethod run-test :around ((test index-test-class) &optional (output *debug-io*))... ) unit-test-20120520-git/unit-test.lisp (defun run-all-tests (&key (verbose nil) (output *standard-output*) (unit :all)) (let (*unit-test-results*) (run-test test output)... ) would require either propagation or run-time instrumentation to distinguish specific methods for call sites.

Thank you James Anderson <james@dydra.com> @dydradata @lomoramic <http://http://dydra.com/data/els2016/>