Thematic Role System

David went to the meeting with Ashok by car.

Thematic Role
verb : go
agent : David
coagent : Ashok
destination : meeting
conveyance : car

Prepositional Constraints
Preposition, Themantic Roles
by | agent, conveyance, location
for | beneficiary, duration
from | source
to | destination
with | coagent, instrument

e.g.
That was written by Ashok.
David went to New York by train
David stood by the statue.

formal logic

Why do we need formal logic?
Soundness: Only valid conclusions can be proven.
Completeness: All valid conclusions can be proven.

Vertebrate -> Bird -> Eagle, Bluebird, Penguin
If an animal has feathers, then it is a bird.
If an animal lays eggs and it files, then it is a bird.

Frame: How do we make sense of a sentence?

Ashok ate a frog.
subject: Ashok
object: a frog
time:
utensils:
object-alive: false
object-is: in-subject
subject-mood: happy

David ate a pizza at home:
subject: David
object: a pizza
time:
utensils:
object-alive: false
object-is: in-subject
subject-mood: happy

Angela ate lasagna with her dad last night at Olive Garden.
subject : Angela
object : lasagna
location : Olive Garden
time : night
utensils :
object-alive : false
object-is : in-subject
subject-mood : happy

Levels of Cognitive Architectures

Low Level <-> High Level
Hardware/Implementation Level(e.g. a brain, transister), Algrithm/Symbol Level(e.g. means-ends analysis, semantic networks), Task/Knowledge Level(e.g. selecting a pitch, playing baseball)

The layers of Watson: the physical computer searching and decision-making answering the inputted clue

Assumptions of a Cognitive Architecture
– Goal-oriented
– Rich, complex envrionment
– Significant knowledge
– Symbols and abstractions
– Flexible and function of the environment
– Learning

Architecture + Content = Behavior
Function for cognitive architectures: f:P* -> A
Percepts -> Action

SOAR
Procedural, Semantic, Episodic
-> Working Memory

Semantic Networks

A:B
x -> x :unchanged
y -> y :expanded
z -> z :deleted

lexically: nodes
structurally: directional links
semantically: application specific labels

Guards and prisonaers

similarity weight
5point for unchanged, 4 for reflected, 3 for rotated, 2 for scaled, 1 for deleted, 0 for shape changed

Fundamental Conundrums of Artificial Intelligence

-intelligent agents have limited resources
-computation is local, but problems have global constraints
-logic is deductive, but many problems are not
-The world is dynamic, but knowledge is limited
-Problem solving, reasoning, and learning are complex, but explanation and justification are even more complex

Characteristics of AI Agents
-Agent have limited computing power
-Agent have limited sensors
-Agent have limited attention
-Computational logic is fundamentally deductive
-AI agents’ knowledge is incomplete relative to the world

input ->
Cognitive System
Metacognition
Deliberation:Reasoning, Learning, Memory
Reaction
-> output

Foundation
machine learning, semantic web, airplane autopilot, improvisational robots

Java Unit Testing

apply plugin: 'java'

repositories {
	mavenCentral()
}

dependencies {
	testCompile 'junit:junit:4.11'
}

[vagrant@localhost ud867]$ gradle test
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE

BUILD SUCCESSFUL

Total time: 7.617 secs

Dependency Reports

apply plugin: 'java'

repositories {
	mavenCentral()
}

dependencies {
	compile 'org.springframework:spring-core:4.1.1.RELEASE'
}
[vagrant@localhost ud867]$ gradle dependencies
:dependencies

------------------------------------------------------------
Root project
------------------------------------------------------------

archives - Configuration for archive artifacts.
No dependencies

compile - Compile classpath for source set 'main'.
Download http://repo1.maven.org/maven2/org/springframework/spring-core/4.1.1.RELEASE/spring-core-4.1.1.RELEASE.pom
Download http://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.pom
Download http://repo1.maven.org/maven2/org/apache/commons/commons-parent/28/commons-parent-28.pom
Download http://repo1.maven.org/maven2/org/apache/apache/13/apache-13.pom
\--- org.springframework:spring-core:4.1.1.RELEASE
     \--- commons-logging:commons-logging:1.1.3

default - Configuration for default artifacts.
\--- org.springframework:spring-core:4.1.1.RELEASE
     \--- commons-logging:commons-logging:1.1.3

runtime - Runtime classpath for source set 'main'.
\--- org.springframework:spring-core:4.1.1.RELEASE
     \--- commons-logging:commons-logging:1.1.3

testCompile - Compile classpath for source set 'test'.
\--- org.springframework:spring-core:4.1.1.RELEASE
     \--- commons-logging:commons-logging:1.1.3

testRuntime - Runtime classpath for source set 'test'.
\--- org.springframework:spring-core:4.1.1.RELEASE
     \--- commons-logging:commons-logging:1.1.3

BUILD SUCCESSFUL

Total time: 12.807 secs

$ gradle dependencies –configuration runtime
$ gradle dependencyInsight –dependency commons-logging

apply plugin: 'java'

repositories {
	mavenCentral()
}

dependencies {
	compile 'commons-logging:commons-logging:1.1.3'
	testCompile 'junit:junit:4.11'
}
[vagrant@localhost ud867]$ gradle dependencies
:dependencies

------------------------------------------------------------
Root project
------------------------------------------------------------

archives - Configuration for archive artifacts.
No dependencies

compile - Compile classpath for source set 'main'.
\--- commons-logging:commons-logging:1.1.3

default - Configuration for default artifacts.
\--- commons-logging:commons-logging:1.1.3

runtime - Runtime classpath for source set 'main'.
\--- commons-logging:commons-logging:1.1.3

testCompile - Compile classpath for source set 'test'.
Download http://repo1.maven.org/maven2/junit/junit/4.11/junit-4.11.pom
Download http://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom
Download http://repo1.maven.org/maven2/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom
+--- commons-logging:commons-logging:1.1.3
\--- junit:junit:4.11
     \--- org.hamcrest:hamcrest-core:1.3

testRuntime - Runtime classpath for source set 'test'.
+--- commons-logging:commons-logging:1.1.3
\--- junit:junit:4.11
     \--- org.hamcrest:hamcrest-core:1.3

BUILD SUCCESSFUL

Total time: 10.61 secs

Configure the Java Plugin

jar {
    manifest {
        attributes 'Implementation-Version': '1.0' // 2. Add manifest attribute
    }
}

Working with repositories

repositories {
	flatDir {
		dirs 'libs'
	}
}

repositories {
	mavenCentral()
	mavenLocal()
	jcenter()
}

repositories {
	maven {
		url 'https://repo.foo.org/m2'
	}
}

repositories {
	ivy {
		url 'https://repo.foo.org/m2'
		credentials {
			username 'user'
			password 'secret'
		}
	}
}

Java Build Tasks

compile -> jar -> documentation -> test -> report

apply plugin: "java"
[vagrant@localhost ud867]$ gradle tasks
:tasks

------------------------------------------------------------
All tasks runnable from root project
------------------------------------------------------------

Build tasks
-----------
assemble - Assembles the outputs of this project.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
classes - Assembles classes 'main'.
clean - Deletes the build directory.
jar - Assembles a jar archive containing the main classes.
testClasses - Assembles classes 'test'.

Build Setup tasks
-----------------
init - Initializes a new Gradle build. [incubating]
wrapper - Generates Gradle wrapper files. [incubating]

Documentation tasks
-------------------
javadoc - Generates Javadoc API documentation for the main source code.

Help tasks
----------
dependencies - Displays all dependencies declared in root project 'ud867'.
dependencyInsight - Displays the insight into a specific dependency in root project 'ud867'.
help - Displays a help message
projects - Displays the sub-projects of root project 'ud867'.
properties - Displays the properties of root project 'ud867'.
tasks - Displays the tasks runnable from root project 'ud867'.

Verification tasks
------------------
check - Runs all checks.
test - Runs the unit tests.

Rules
-----
Pattern: clean: Cleans the output files of a task.
Pattern: build: Assembles the artifacts of a configuration.
Pattern: upload: Assembles and uploads the artifacts belonging to a configuration.

To see all tasks and more detail, run with --all.

BUILD SUCCESSFUL

Total time: 8.759 secs

asemble

[vagrant@localhost ud867]$ gradle assemble
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar
:assemble

BUILD SUCCESSFUL

Total time: 6.788 secs